diff --git a/Makefile.am b/Makefile.am index ba8127a952..dcdbcfc548 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,7 +70,8 @@ gnucash-config: gnucash-config.in rm -f $@.tmp sed < $@.in > $@.tmp \ -e 's:@-VERSION-@:${VERSION}:g' \ - -e 's:@-GNC_INCLUDE_DIR-@:${GNC_INCLUDE_DIR}:g' + -e 's:@-GNUCASH_ENGINE_CFLAGS-@:${GNUCASH_ENGINE_CFLAGS}:g' \ + -e 's:@-GNUCASH_ENGINE_LIBS-@:${GNUCASH_ENGINE_LIBS}:g' chmod +x $@.tmp mv $@.tmp $@ diff --git a/configure.in b/configure.in index bd5c330094..0fd4af4b23 100644 --- a/configure.in +++ b/configure.in @@ -124,6 +124,7 @@ fi GNC_ACCOUNTS_DIR=${GNC_SHAREDIR}/accounts GNC_GLADE_DIR=${GNC_SHAREDIR}/glade +GNC_MODULE_DIR='${pkglibdir}' GNC_PIXMAP_DIR='${datadir}/pixmaps/gnucash' AC_SUBST(GNC_ACCOUNTS_DIR) @@ -132,6 +133,7 @@ AC_SUBST(GNC_DOC_INSTALL_DIR) AC_SUBST(GNC_GLADE_DIR) AC_SUBST(GNC_INCLUDE_DIR) AC_SUBST(GNC_LIBDIR) +AC_SUBST(GNC_MODULE_DIR) AC_SUBST(GNC_PIXMAP_DIR) AC_SUBST(GNC_SCM_INSTALL_DIR) AC_SUBST(GNC_SHAREDIR) @@ -614,6 +616,22 @@ AC_TRY_RUN([ ]) CFLAGS="$GNC_OLDCFLAGS" + +### -------------------------------------------------------------------------- +### GnuCash flags and libs configuration + +GNUCASH_ENGINE_BASE_LIBS="${GUILE_LIBS} ${GLIB_LIBS}" +GNUCASH_ENGINE_LIBS="-L${GNC_MODULE_DIR} ${GNUCASH_ENGINE_BASE_LIBS} libgncmod-engine.la libgw-engine.la libgw-glib.la" + +GNUCASH_ENGINE_BASE_CFLAGS="${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} ${GUILE_INCS}" +GNUCASH_ENGINE_CFLAGS="-I${GNC_INCLUDE_DIR} ${GNUCASH_ENGINE_BASE_CFLAGS}" + +AC_SUBST(GNUCASH_ENGINE_BASE_LIBS) +AC_SUBST(GNUCASH_ENGINE_LIBS) +AC_SUBST(GNUCASH_ENGINE_BASE_CFLAGS) +AC_SUBST(GNUCASH_ENGINE_CFLAGS) + + ### -------------------------------------------------------------------------- ### Makefile creation diff --git a/gnucash-config.in b/gnucash-config.in index 6c286739bb..d42c1edd7a 100644 --- a/gnucash-config.in +++ b/gnucash-config.in @@ -25,8 +25,6 @@ if test $# -eq 0; then usage 1 1>&2 fi -lib_gnucash=yes - while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; @@ -64,6 +62,7 @@ while test $# -gt 0; do lib_engine=yes ;; gnucash) + lib_engine=yes lib_gnucash=yes ;; *) @@ -74,17 +73,26 @@ while test $# -gt 0; do done if test "$echo_prefix" = "yes"; then - echo $prefix + echo $prefix fi if test "$echo_exec_prefix" = "yes"; then - echo $exec_prefix + echo $exec_prefix fi if test "$echo_cflags" = "yes"; then - echo -I@-GNC_INCLUDE_DIR-@ + cflags="" + if test "$lib_engine" = "yes"; then + cflags="$cflags @-GNUCASH_ENGINE_CFLAGS-@" + fi + + echo $cflags fi if test "$echo_libs" = "yes"; then - echo "" + libs="" + if test "$lib_engine" = "yes"; then + libs="$libs @-GNUCASH_ENGINE_LIBS-@" + fi + echo $libs fi diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 65a0fd5491..417c4c6d3d 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -2,9 +2,9 @@ SUBDIRS = . test-core test pkglib_LTLIBRARIES = libgncmod-engine.la -CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} +CFLAGS = @CFLAGS@ ${GNUCASH_ENGINE_BASE_CFLAGS} -INCLUDES = -I${top_srcdir}/src/gnc-module ${GUILE_INCS} -I../ +INCLUDES = -I${top_srcdir}/src/gnc-module -I../ libgncmod_engine_la_SOURCES = \ Account.c \ @@ -83,7 +83,7 @@ noinst_HEADERS = \ md5.h libgncmod_engine_la_LDFLAGS = -module -libgncmod_engine_la_LIBADD = ${GUILE_LIBS} ${GLIB_LIBS} +libgncmod_engine_la_LIBADD = ${GNUCASH_ENGINE_BASE_LIBS} libgw_glib_la_SOURCES=gw-glib.c glib-helpers.c libgw_glib_la_LDFLAGS=-module -lg-wrap-runtime-guile