From 1a0db3dfb7d4d4510ac07c664845160a36bb689d Mon Sep 17 00:00:00 2001 From: Bill Gribble Date: Wed, 5 Dec 2001 17:22:32 +0000 Subject: [PATCH] Add --disable-gui option to autogen/configure git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6255 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 7 + configure.in | 516 ++++++++++++++++++++++++------------------------ src/Makefile.am | 27 ++- 3 files changed, 288 insertions(+), 262 deletions(-) diff --git a/ChangeLog b/ChangeLog index 003ed9c8e1..97ada69061 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-12-05 Bill Gribble + + * use AM_PATH_LIBGLADE instead of gnome-config for libglade paths + + * add --disable-gui option to configure.in and reshuffle + src/Makefile.am to not build gui code if it's used. + 2001-12-04 Rob Browning * src/scm/main.scm: merge bootstrap.scm contents here and diff --git a/configure.in b/configure.in index 9223d181e0..6b71c474fc 100644 --- a/configure.in +++ b/configure.in @@ -101,22 +101,121 @@ AC_CHECK_FUNCS(dlerror,,) LIBS="$oLIBS" AC_SUBST(DL_LIB) -GNOME_INIT -GNOME_COMPILE_WARNINGS -GNOME_CHECK_GDK_PIXBUF +### -------------------------------------------------------------------------- +### Guile and g-wrap version checks (should this be something other than +### the Gnome check?) + GNOME_CHECK_GUILE -GNOME_PRINT_CHECK + +### -------------------------------------------------------------------------- +### G-wrap (libraries and executable) + +G_WRAP_COMPILE_ARGS="" +G_WRAP_LINK_ARGS="" + +AM_PATH_GWRAP(1.3.1, , [AC_MSG_ERROR([ + + g-wrap does not appear to be installed correctly, or is not new + enough. Right now gnucash requires at least version 1.1.12 to build. + If you need to install g-wrap, you can find it at + ftp://ftp.gnucash.org/pub/g-wrap. +])]) + +# Find out what the g-wrap compile and link flags are. +AC_MSG_CHECKING(for g-wrap compile args) +G_WRAP_COMPILE_ARGS=`${G_WRAP_CONFIG} --c-compile-args guile` +AC_MSG_RESULT($G_WRAP_COMPILE_ARGS) + +AC_MSG_CHECKING(for g-wrap link args) +G_WRAP_LINK_ARGS=`${G_WRAP_CONFIG} --c-link-args guile` +AC_MSG_RESULT($G_WRAP_LINK_ARGS) + +AC_MSG_CHECKING(for g-wrap module directory) +G_WRAP_MODULE_DIR=`${G_WRAP_CONFIG} --guile-module-directory` +AC_MSG_RESULT($G_WRAP_MODULE_DIR) + +AC_GWRAP_CHECK_GUILE + +AC_SUBST(G_WRAP_CONFIG) +AC_SUBST(G_WRAP_COMPILE_ARGS) +AC_SUBST(G_WRAP_LINK_ARGS) +AC_SUBST(G_WRAP_MODULE_DIR) + +### Check size of long_long - some guile's are broken. +AC_MSG_CHECKING(if guile long_long is at least as big as gint64) +GNC_OLDCFLAGS="$CFLAGS" +CFLAGS="${GNOME_INCLUDEDIR} ${GUILE_INCS} ${CFLAGS} ${GLIB_CFLAGS}" +AC_TRY_RUN([ + #include + #include + int main(int argc, char *argv[]) { + return(!(sizeof(long_long) >= sizeof(gint64))); + } +],[ + AC_MSG_RESULT(yes) + AC_CHECK_LIB(guile, scm_long_long2num, + AC_DEFINE(GUILE_LONG_LONG_OK,1,is sizeof(long_long) >= + sizeof(gint64))) +],[ + AC_MSG_RESULT(no) +]) +CFLAGS="$GNC_OLDCFLAGS" + +# One of the places this is critical is in gnc_scm_to_gint64 and inverse. +# However, I'm sure we require this elsewhere, so don't remove this test +# unless you've done sufficient code review/testing. +AC_MSG_CHECKING(if unsigned long is at least as big as guint32) +GNC_OLDCFLAGS="$CFLAGS" +CFLAGS="${GNOME_INCLUDEDIR} ${GUILE_INCS} ${CFLAGS} ${GLIB_CFLAGS}" +AC_TRY_RUN([ + #include + int main(int argc, char *argv[]) { + return(!(sizeof(unsigned long) >= sizeof(guint32))); + } +],[ + AC_MSG_RESULT(yes) +],[ + AC_MSG_RESULT(no) + AC_MSG_ERROR(cannot continue, size of unsigned long too small.) +]) +CFLAGS="$GNC_OLDCFLAGS" + + +### -------------------------------------------------------------------------- +### Check which SRFIs we need. + +GNC_ADD_ON_SRFIS="" + +for srfi in `ls lib/srfi/srfi-*.scm | sed -e 's|lib/srfi/||; s/\.scm//'` +do + AC_MSG_CHECKING(if guile needs our copy of ${srfi}) + if ! ${GUILE} -c "(use-modules (srfi ${srfi}))" > /dev/null 2>&1 + then + GNC_ADD_ON_SRFIS="${GNC_ADD_ON_SRFIS} ${srfi}.scm" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +done + +AC_SUBST(GNC_ADD_ON_SRFIS) + + +### -------------------------------------------------------------------------- +### Gnome XML -- GNOME_XML_LIB is defined by GNOME_XML_CHECK + GNOME_XML_CHECK +GNOME_XML_CFLAGS=`$GNOME_CONFIG --cflags xml` -# gnome-print-check appears tobe sort of b0rked for the time being -GNOME_PRINT_CFLAGS=`${GNOME_CONFIG} --cflags print` +AC_SUBST(GNOME_XML_CFLAGS) - -#AC_CHECK_HEADER(libxml/xmlversion.h, [ -# HAVE_XML_VERSION_HEADER=1 -# AC_DEFINE(HAVE_XML_VERSION_HEADER) -#]) +oLIBS="$LIBS" +LIBS="$LIBS $GNOME_XML_LIB" +AC_CHECK_LIB(xml, xmlElemDump, [:], [ + AC_MSG_ERROR([libxml 1.8.3 or newer required for GnuCash]) + ]) +LIBS="$oLIBS" ### -------------------------------------------------------------------------- @@ -290,6 +389,7 @@ AC_SUBST(RPC_DIR) ### -------------------------------------------------------------------------- ### i18n + AC_ARG_WITH( locale-dir, [ --with-locale-dir=PATH specify where to look for locale-specific information], LOCALE_DIR="$with_locale_dir", @@ -302,6 +402,7 @@ LANGINFO_D_FMT_CHECK ### -------------------------------------------------------------------------- ### help files + AC_ARG_WITH( help-prefix, [ --with-help-prefix=PATH specify where to store the help files], GNC_HELPDIR="$with_help_prefix/gnome/help/gnucash", @@ -326,30 +427,6 @@ fi AM_CONDITIONAL(GNC_TAGS_FILE, test x${GNC_TAGS_FILE} = xTAGS) - -### -------------------------------------------------------------------------- -### Check for glade - -GLADE_LIBS=`$GNOME_CONFIG --libs libglade` -GLADE_CFLAGS=`$GNOME_CONFIG --cflags libglade` - -# check for glade libs -AC_CHECK_LIB(glade, glade_init, - GNOMEBUILDLIBS="${GNOMEBUILDLIBS} glade", - AC_MSG_ERROR([Cannot find libglade. See the README and config.log for more info.]), - $GLADE_LIBS) - -AC_SUBST(GLADE_LIBS) -AC_SUBST(GLADE_CFLAGS) - - -### -------------------------------------------------------------------------- -### Check for lib uri and do the right thing -# AC_CHECK_LIB(uri, uri_alloc) - -# if [ -z "$HAVE_LIBURI" ] ; then - - ### -------------------------------------------------------------------------- ### Check for perl @@ -397,6 +474,7 @@ LIBS="$LIBS -lm" ### -------------------------------------------------------------------------- ### Berkeley db + AC_ARG_ENABLE(prefer-db1, [ --enable-prefer-db1 Prefer Berkeley DB 1.x],[prefer_db1="$enableval"],[prefer_db1=yes]) @@ -438,130 +516,6 @@ fi AC_SUBST(DB_LIBS) - -### -------------------------------------------------------------------------- -### Gnome XML -- GNOME_XML_LIB is define by GNOME_XML_CHECK -GNOME_XML_CFLAGS=`$GNOME_CONFIG --cflags xml` - -AC_SUBST(GNOME_XML_CFLAGS) - -oLIBS="$LIBS" -LIBS="$LIBS $GNOME_XML_LIB" -AC_CHECK_LIB(xml, xmlElemDump, [:], [ - AC_MSG_ERROR([libxml 1.8.3 or newer required for GnuCash]) - ]) -LIBS="$oLIBS" - - -### -------------------------------------------------------------------------- -GTKHTML_LIBS=`$GNOME_CONFIG --libs gtkhtml` -GTKHTML_CFLAGS=`$GNOME_CONFIG --cflags gtkhtml` - -AC_CHECK_LIB(gal, main, true, - [AC_MSG_ERROR([gal library not found. See the README and config.log for more info.])], - `$GNOME_CONFIG --libs gal`) - -# check for gtkhtml and enable it via HAVE_LIBGTKHTML -# if found -AC_CHECK_LIB(gtkhtml, gtk_html_new, - GNOMEBUILDLIBS="${GNOMEBUILDLIBS} gtkhtml" - AC_DEFINE(HAVE_LIBGTKHTML), - AC_MSG_ERROR([Cannot find gtkhtml. See the README and config.log for more info.]), - $GTKHTML_LIBS) - -GHTTP_LIBS=`$GNOME_CONFIG --libs ghttp` -GHTTP_CFLAGS=`$GNOME_CONFIG --cflags ghttp` - -# Note: this doesn't croak if GHTTP_LIBS is empty! (e.g. on RH6.2) -AC_CHECK_LIB(ghttp, ghttp_request_new, - GNOMEBUILDLIBS="${GNOMEBUILDLIBS} ghttp" - AC_DEFINE(HAVE_LIBGHTTP) - if test "x$GHTTP_LIBS" = "x" ; then - GHTTP_LIBS=-lghttp - fi, - AC_MSG_ERROR([Cannot find ghttp. See the README and config.log for more info.]), - $GHTTP_LIBS) - -AC_CHECK_LIB(ghttp, ghttp_enable_ssl, - AC_DEFINE(HAVE_OPENSSL), - AC_MSG_WARN([****** ghttp does not have SSL support.]), - $GHTTP_LIBS) - -AC_SUBST(GTKHTML_LIBS) -AC_SUBST(GTKHTML_CFLAGS) -AC_SUBST(GHTTP_LIBS) -AC_SUBST(GHTTP_CFLAGS) - - -### -------------------------------------------------------------------------- -### guppi - -AC_ARG_ENABLE( guppi, - [ --disable-guppi compile without guppi support], - if test $enableval = no; then - USE_GUPPI=0 - else - USE_GUPPI=1 - fi, - USE_GUPPI=1 ) - -if test ${USE_GUPPI} = 0; then - AC_MSG_WARN([Compiling without guppi support]) -else - AC_DEFINE(USE_GUPPI) - - -AC_ARG_ENABLE( efence, - [ --enable-efence link using efence], - if test $enableval = yes; then - EFENCE_LIBS="-lefence" - USE_EFENCE=1 - fi, - USE_EFENCE=0 - EFENCE_LIBS="") -AC_DEFINE(USE_EFENCE) -AC_SUBST(EFENCE_LIBS) - -## Things guppi needs (actually are these guppi dependencies or gtkhtml's?) - -# LAME: if you ask gnome-config for the zvt libs, it doesn't include -# imlib, though it needs it so we'll just steal gtkhtml's which does. -AC_CHECK_LIB(zvt, main, true, - [AC_MSG_ERROR([libzvt development files not found. See config.log.])], - `$GNOME_CONFIG --libs zvt gtkhtml`) - -#AC_CHECK_LIB(bonobo, main, true, -# [AC_MSG_ERROR([libbonobo development files not found. See config.log.]) -#], -# `$GNOME_CONFIG --libs bonobo`) - -AC_CHECK_LIB(oaf, main, true, - [AC_MSG_ERROR([liboaf development files not found. See config.log.])], - `$GNOME_CONFIG --libs oaf`) - -## guppi itself. - -GUPPI_LIBS=`$GNOME_CONFIG --libs libguppi` -GUPPI_CFLAGS=`$GNOME_CONFIG --cflags libguppi` -LIBGUPPI_CHECK -AC_SUBST(GUPPI_LIBS) -AC_SUBST(GUPPI_CFLAGS) - -fi - -### -------------------------------------------------------------------------- -### XIM -AC_ARG_ENABLE(xim, - [ --enable-xim support XIM [default=yes]], - , enable_xim="yes") - -if test "x$enable_xim" = "xyes"; then - GTK_XIM_FLAGS="-DUSE_XIM" -fi - -AC_SUBST(GTK_XIM_FLAGS) - - ### -------------------------------------------------------------------------- ### popt @@ -572,108 +526,164 @@ AC_CHECK_LIB(popt, poptStrippedArgv,, [AC_MSG_ERROR([ you're running Debian, install the libpopt-dev package. ])]) -### -------------------------------------------------------------------------- -## For now, we just presume you're using the GNOME version. The other -## UI's haven't been carried over during the automake transition. At -## some point, if it's deemed worthwhile, they can be resurrected... - -GNOME=1 -AC_DEFINE(GNOME) - ### -------------------------------------------------------------------------- -### G-wrap (libraries and executable) - -G_WRAP_COMPILE_ARGS="" -G_WRAP_LINK_ARGS="" - -AM_PATH_GWRAP(1.3.1, , [AC_MSG_ERROR([ - - g-wrap does not appear to be installed correctly, or is not new - enough. Right now gnucash requires at least version 1.1.12 to build. - If you need to install g-wrap, you can find it at - ftp://ftp.gnucash.org/pub/g-wrap. -])]) - -# Find out what the g-wrap compile and link flags are. -AC_MSG_CHECKING(for g-wrap compile args) -G_WRAP_COMPILE_ARGS=`${G_WRAP_CONFIG} --c-compile-args guile` -AC_MSG_RESULT($G_WRAP_COMPILE_ARGS) - -AC_MSG_CHECKING(for g-wrap link args) -G_WRAP_LINK_ARGS=`${G_WRAP_CONFIG} --c-link-args guile` -AC_MSG_RESULT($G_WRAP_LINK_ARGS) - -AC_MSG_CHECKING(for g-wrap module directory) -G_WRAP_MODULE_DIR=`${G_WRAP_CONFIG} --guile-module-directory` -AC_MSG_RESULT($G_WRAP_MODULE_DIR) - -AC_GWRAP_CHECK_GUILE - -AC_SUBST(G_WRAP_CONFIG) -AC_SUBST(G_WRAP_COMPILE_ARGS) -AC_SUBST(G_WRAP_LINK_ARGS) -AC_SUBST(G_WRAP_MODULE_DIR) - +### GNOME gui components -- built by default, but not if --enable-gui=no +### or --disable-gui is passed to autogen ### -------------------------------------------------------------------------- -### Check size of long_long - some guile's are broken. -AC_MSG_CHECKING(if guile long_long is at least as big as gint64) -GNC_OLDCFLAGS="$CFLAGS" -CFLAGS="${GNOME_INCLUDEDIR} ${GUILE_INCS} ${CFLAGS} ${GLIB_CFLAGS}" -AC_TRY_RUN([ - #include - #include - int main(int argc, char *argv[]) { - return(!(sizeof(long_long) >= sizeof(gint64))); - } -],[ - AC_MSG_RESULT(yes) - AC_CHECK_LIB(guile, scm_long_long2num, - AC_DEFINE(GUILE_LONG_LONG_OK,1,is sizeof(long_long) >= - sizeof(gint64))) -],[ - AC_MSG_RESULT(no) -]) -CFLAGS="$GNC_OLDCFLAGS" -# One of the places this is critical is in gnc_scm_to_gint64 and inverse. -# However, I'm sure we require this elsewhere, so don't remove this test -# unless you've done sufficient code review/testing. -AC_MSG_CHECKING(if unsigned long is at least as big as guint32) -GNC_OLDCFLAGS="$CFLAGS" -CFLAGS="${GNOME_INCLUDEDIR} ${GUILE_INCS} ${CFLAGS} ${GLIB_CFLAGS}" -AC_TRY_RUN([ - #include - int main(int argc, char *argv[]) { - return(!(sizeof(unsigned long) >= sizeof(guint32))); - } -],[ - AC_MSG_RESULT(yes) -],[ - AC_MSG_RESULT(no) - AC_MSG_ERROR(cannot continue, size of unsigned long too small.) -]) -CFLAGS="$GNC_OLDCFLAGS" +AC_ARG_ENABLE(gui, + [ --enable-gui build the GNOME GUI components of Gnucash], + [case "${enableval}" in + yes) gnc_build_gui=true ;; + no) gnc_build_gui=false ;; + *) gnc_build_gui=true ;; + esac], + [gnc_build_gui=true]) +AM_CONDITIONAL(GNUCASH_ENABLE_GUI, test x${gnc_build_gui} = xtrue) -### -------------------------------------------------------------------------- -### Check which SRFIs we need. +if test x${gnc_build_gui} = xtrue ; +then + GNOME_INIT + GNOME_COMPILE_WARNINGS + GNOME_CHECK_GDK_PIXBUF + GNOME_PRINT_CHECK + + # gnome-print-check appears tobe sort of b0rked for the time being + GNOME_PRINT_CFLAGS=`${GNOME_CONFIG} --cflags print` + + ### ---------------------------------------------------------------------- + ### Check for glade + + AM_PATH_LIBGLADE + + GLADE_LIBS="$LIBGLADE_LIBS" + GLADE_CFLAGS="$LIBGLADE_CFLAGS" + + AC_SUBST(GLADE_LIBS) + AC_SUBST(GLADE_CFLAGS) + + + ### ---------------------------------------------------------------------- + GTKHTML_LIBS=`$GNOME_CONFIG --libs gtkhtml` + GTKHTML_CFLAGS=`$GNOME_CONFIG --cflags gtkhtml` + + AC_CHECK_LIB(gal, main, true, + [AC_MSG_ERROR([gal library not found. See the README and config.log for more info.])], + `$GNOME_CONFIG --libs gal`) + + # check for gtkhtml and enable it via HAVE_LIBGTKHTML + # if found + AC_CHECK_LIB(gtkhtml, gtk_html_new, + GNOMEBUILDLIBS="${GNOMEBUILDLIBS} gtkhtml" + AC_DEFINE(HAVE_LIBGTKHTML), + AC_MSG_ERROR([Cannot find gtkhtml. See the README and config.log for more info.]), + $GTKHTML_LIBS) + + GHTTP_LIBS=`$GNOME_CONFIG --libs ghttp` + GHTTP_CFLAGS=`$GNOME_CONFIG --cflags ghttp` + + # Note: this doesn't croak if GHTTP_LIBS is empty! (e.g. on RH6.2) + AC_CHECK_LIB(ghttp, ghttp_request_new, + GNOMEBUILDLIBS="${GNOMEBUILDLIBS} ghttp" + AC_DEFINE(HAVE_LIBGHTTP) + if test "x$GHTTP_LIBS" = "x" ; then + GHTTP_LIBS=-lghttp + fi, + AC_MSG_ERROR([Cannot find ghttp. See the README and config.log for more info.]), + $GHTTP_LIBS) + + AC_CHECK_LIB(ghttp, ghttp_enable_ssl, + AC_DEFINE(HAVE_OPENSSL), + AC_MSG_WARN([****** ghttp does not have SSL support.]), + $GHTTP_LIBS) + + AC_SUBST(GTKHTML_LIBS) + AC_SUBST(GTKHTML_CFLAGS) + AC_SUBST(GHTTP_LIBS) + AC_SUBST(GHTTP_CFLAGS) + + + ### ---------------------------------------------------------------------- + ### guppi + + AC_ARG_ENABLE( guppi, + [ --disable-guppi compile without guppi support], + if test $enableval = no; then + USE_GUPPI=0 + else + USE_GUPPI=1 + fi, + USE_GUPPI=1 ) + + if test ${USE_GUPPI} = 0; then + AC_MSG_WARN([Compiling without guppi support]) + else + AC_DEFINE(USE_GUPPI) + + + AC_ARG_ENABLE( efence, + [ --enable-efence link using efence], + if test $enableval = yes; then + EFENCE_LIBS="-lefence" + USE_EFENCE=1 + fi, + USE_EFENCE=0 + EFENCE_LIBS="") + AC_DEFINE(USE_EFENCE) + AC_SUBST(EFENCE_LIBS) + + ## Things guppi needs (actually are these guppi dependencies or gtkhtml's?) + + # LAME: if you ask gnome-config for the zvt libs, it doesn't include + # imlib, though it needs it so we'll just steal gtkhtml's which does. + AC_CHECK_LIB(zvt, main, true, + [AC_MSG_ERROR([libzvt development files not found. See config.log.])], + `$GNOME_CONFIG --libs zvt gtkhtml`) + + #AC_CHECK_LIB(bonobo, main, true, + # [AC_MSG_ERROR([libbonobo development files not found. See config.log.]) + #], + # `$GNOME_CONFIG --libs bonobo`) + + AC_CHECK_LIB(oaf, main, true, + [AC_MSG_ERROR([liboaf development files not found. See config.log.])], + `$GNOME_CONFIG --libs oaf`) + + ## guppi itself. + + GUPPI_LIBS=`$GNOME_CONFIG --libs libguppi` + GUPPI_CFLAGS=`$GNOME_CONFIG --cflags libguppi` + LIBGUPPI_CHECK + AC_SUBST(GUPPI_LIBS) + AC_SUBST(GUPPI_CFLAGS) + + fi + + ### ---------------------------------------------------------------------- + ### XIM + AC_ARG_ENABLE(xim, + [ --enable-xim support XIM [default=yes]], + , enable_xim="yes") + + if test "x$enable_xim" = "xyes"; then + GTK_XIM_FLAGS="-DUSE_XIM" + fi + + AC_SUBST(GTK_XIM_FLAGS) + + + ### ---------------------------------------------------------------------- + ## For now, we just presume you're using the GNOME version. The other + ## UI's haven't been carried over during the automake transition. At + ## some point, if it's deemed worthwhile, they can be resurrected... + + GNOME=1 + AC_DEFINE(GNOME) -GNC_ADD_ON_SRFIS="" +fi -for srfi in `ls lib/srfi/srfi-*.scm | sed -e 's|lib/srfi/||; s/\.scm//'` -do - AC_MSG_CHECKING(if guile needs our copy of ${srfi}) - if ! ${GUILE} -c "(use-modules (srfi ${srfi}))" > /dev/null 2>&1 - then - GNC_ADD_ON_SRFIS="${GNC_ADD_ON_SRFIS} ${srfi}.scm" - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -done - -AC_SUBST(GNC_ADD_ON_SRFIS) ### -------------------------------------------------------------------------- ### GnuCash flags and libs configuration diff --git a/src/Makefile.am b/src/Makefile.am index ed777caa84..0940fe1c64 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,29 +1,38 @@ - -SUBDIRS = \ +DIST_SUBDIRS = \ doc \ + pixmaps \ + bin + +NONGUI_SUBDIRS = \ core-utils \ gnc-module \ test-core \ - network-utils \ engine \ backend \ + report \ + scm \ + quotes + +GUI_SUBDIRS = \ + network-utils \ calculation \ tax \ app-utils \ gnome-utils \ app-file \ import-export \ - report \ dialog-account \ register \ gnome \ experimental \ - scm \ - quotes \ - pixmaps \ business \ - optional \ - bin + optional + +if GNUCASH_ENABLE_GUI +SUBDIRS = $(DIST_SUBDIRS) $(NONGUI_SUBDIRS) $(GUI_SUBDIRS) +else +SUBDIRS = $(DIST_SUBDIRS) $(NONGUI_SUBDIRS) +endif noinst_HEADERS = \ AccWindow.h \