diff --git a/Makefile.am b/Makefile.am index fde5587342..9d31391384 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,7 +51,6 @@ EXTRA_DIST = \ bin_SCRIPTS = gnucash-config -BUILT_SOURCES = gnucash-config CLEANFILES = gnucash-config ## We borrow guile's convention and use @-...-@ as the substitution @@ -72,24 +71,6 @@ make-gnucash-potfiles: make-gnucash-potfiles.in chmod +x $@.tmp mv $@.tmp $@ -gnucash-config: gnucash-config.in - rm -f $@.tmp - sed < $@.in > $@.tmp \ - -e 's:@-VERSION-@:${VERSION}:g' \ - -e 's:@-GNUCASH_ENGINE_CFLAGS-@:${GNUCASH_ENGINE_CFLAGS}:g' \ - -e 's:@-GNUCASH_ENGINE_LIBS-@:${GNUCASH_ENGINE_LIBS}:g' \ - -e 's:@-GNUCASH_APP_UTILS_CFLAGS-@:${GNUCASH_APP_UTILS_CFLAGS}:g' \ - -e 's:@-GNUCASH_APP_UTILS_LIBS-@:${GNUCASH_APP_UTILS_LIBS}:g' \ - -e 's:@-GNUCASH_NETWORK_UTILS_CFLAGS-@:${GNUCASH_NETWORK_UTILS_CFLAGS}:g' \ - -e 's:@-GNUCASH_NETWORK_UTILS_LIBS-@:${GNUCASH_NETWORK_UTILS_LIBS}:g' \ - -e 's:@-GNUCASH_GNOME_UTILS_CFLAGS-@:${GNUCASH_GNOME_UTILS_CFLAGS}:g' \ - -e 's:@-GNUCASH_GNOME_UTILS_LIBS-@:${GNUCASH_GNOME_UTILS_LIBS}:g' \ - -e 's:@-GNUCASH_REGISTER_CORE_CFLAGS-@:${GNUCASH_REGISTER_CORE_CFLAGS}:g' \ - -e 's:@-GNUCASH_REGISTER_CORE_LIBS-@:${GNUCASH_REGISTER_CORE_LIBS}:g' - chmod +x $@.tmp - mv $@.tmp $@ - - DISTCLEANFILES = \ cscope.files cscope.out etags.files make-gnucash-patch diff --git a/configure.in b/configure.in index 356b198776..5999d9e507 100644 --- a/configure.in +++ b/configure.in @@ -817,6 +817,10 @@ AC_OUTPUT( dnl # non-makefiles dnl # Please read doc/build-system before adding *anything* here + + dnl # we configure gnucash-config here because we *don't* + dnl # want variables to be fully expanded + gnucash-config , dnl # commands go here, but we don't have any right now ) diff --git a/gnucash-config.in b/gnucash-config.in index b2cc313aac..5c973ff397 100644 --- a/gnucash-config.in +++ b/gnucash-config.in @@ -14,6 +14,7 @@ Options: [--version] [--libs] [--cflags] + [--ld-library-path] Libraries: engine network-utils @@ -38,6 +39,9 @@ while test $# -gt 0; do esac case $1 in + --ld-library-path) + echo_ld_library_path=yes + ;; --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then @@ -55,7 +59,7 @@ while test $# -gt 0; do echo_exec_prefix=yes ;; --version) - echo @-VERSION-@ + echo @VERSION@ exit 0 ;; --cflags) @@ -95,6 +99,14 @@ while test $# -gt 0; do shift done +datadir=@datadir@ +libdir=@libdir@ +pkgdatadir=${datadir}/@PACKAGE@ +pkglibdir=${libdir}/@PACKAGE@ +pkgincludedir=${includedir}/@PACKAGE@ +GNC_LIBDIR=@GNC_LIBDIR@ +GNC_MODULE_DIR=@GNC_MODULE_DIR@ +GNC_SHAREDIR=@GNC_SHAREDIR@ # Trim the link and compile lines down. @@ -139,23 +151,23 @@ if test "$echo_cflags" = "yes"; then cflags="" if test "$lib_engine" = "yes"; then - cflags="$cflags @-GNUCASH_ENGINE_CFLAGS-@" + cflags="$cflags @GNUCASH_ENGINE_CFLAGS@" fi if test "$lib_network_utils" = "yes"; then - cflags="$cflags @-GNUCASH_NETWORK_UTILS_CFLAGS-@" + cflags="$cflags @GNUCASH_NETWORK_UTILS_CFLAGS@" fi if test "$lib_app_utils" = "yes"; then - cflags="$cflags @-GNUCASH_APP_UTILS_CFLAGS-@" + cflags="$cflags @GNUCASH_APP_UTILS_CFLAGS@" fi if test "$lib_register_core" = "yes"; then - cflags="$cflags @-GNUCASH_REGISTER_CORE_CFLAGS-@" + cflags="$cflags @GNUCASH_REGISTER_CORE_CFLAGS@" fi if test "$lib_gnome_utils" = "yes"; then - cflags="$cflags @-GNUCASH_GNOME_UTILS_CFLAGS-@" + cflags="$cflags @GNUCASH_GNOME_UTILS_CFLAGS@" fi echo $cflags @@ -165,24 +177,29 @@ if test "$echo_libs" = "yes"; then libs="" if test "$lib_engine" = "yes"; then - libs="$libs @-GNUCASH_ENGINE_LIBS-@" + libs="$libs @GNUCASH_ENGINE_LIBS@" fi if test "$lib_network_utils" = "yes"; then - libs="$libs @-GNUCASH_NETWORK_UTILS_LIBS-@" + libs="$libs @GNUCASH_NETWORK_UTILS_LIBS@" fi if test "$lib_app_utils" = "yes"; then - libs="$libs @-GNUCASH_APP_UTILS_LIBS-@" + libs="$libs @GNUCASH_APP_UTILS_LIBS@" fi if test "$lib_register_core" = "yes"; then - libs="$libs @-GNUCASH_REGISTER_CORE_LIBS-@" + libs="$libs @GNUCASH_REGISTER_CORE_LIBS@" fi if test "$lib_gnome_utils" = "yes"; then - libs="$libs @-GNUCASH_GNOME_UTILS_LIBS-@" + libs="$libs @GNUCASH_GNOME_UTILS_LIBS@" fi echo $libs fi + +if test "$echo_ld_library_path" = "yes"; then + path="$libdir:$GNC_LIBDIR:$GNC_MODULE_DIR" + echo $path +fi