r23390 - gnucash/trunk - Improve guile testing in configure.ac

Geert Janssens gjanssens at code.gnucash.org
Wed Nov 13 10:51:00 EST 2013


Author: gjanssens
Date: 2013-11-13 10:50:59 -0500 (Wed, 13 Nov 2013)
New Revision: 23390
Trac: http://svn.gnucash.org/trac/changeset/23390

Modified:
   gnucash/trunk/configure.ac
Log:
Improve guile testing in configure.ac

Use guile specific macros to determing the guile executable to use.
Unfortunately the macro names may be different on various supported
platforms. So we have to run some extra tests to determine which
macro names we need exactly.

Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac	2013-11-13 07:18:53 UTC (rev 23389)
+++ gnucash/trunk/configure.ac	2013-11-13 15:50:59 UTC (rev 23390)
@@ -432,17 +432,41 @@
 fi
 GUILE_LIBS=""
 
-# Look up GUILE_CFLAGS and GUILE_LIBS, and version check
-PKG_CHECK_MODULES(GUILE, [guile-1.8 >= 1.8.5], , [
-  PKG_CHECK_MODULES(GUILE, [guile-2.0 >= 2.0.0], , [AC_MSG_ERROR([
+# Guile checks:
+# - check minimum version
+# - determine GUILE_CFLAGS and GUILE_LIBS
+# - test if guile module (www main) is present on the system
+# Note: systems that install both guile 1.8 and guile 2 use different
+#       names for the 1.8 and 2.0 autoconf macros to avoid conflicts.
+#       So the tests below will check for known macro names in the order
+#       that we assume will always result in the proper macros being called
+#       for the guile version that has been detected.
+gnc_have_guile_www=no
+PKG_CHECK_MODULES(GUILE,
+                  [guile-1.8 >= 1.8.5],
+                  [m4_ifdef([GUILE1_8_PROGS],
+                            [ GUILE1_8_PROGS
+                              GUILE1_8_MODULE_AVAILABLE(gnc_have_guile_www,[(www main)]) ],
+                            [ GUILE_PROGS
+                              GUILE_MODULE_AVAILABLE(gnc_have_guile_www,[(www main)]) ])
+                  ], [
+  PKG_CHECK_MODULES(GUILE,
+                  [guile-2.0 >= 2.0.0],
+                  [m4_ifdef([GUILE_PROGS],
+                            [ GUILE_PROGS
+                              GUILE_MODULE_AVAILABLE(gnc_have_guile_www,[(www main)]) ],
+                            [ AC_MSG_ERROR([ guile 2 is found on your system, but appears
+    to export different autoconf macros than what we expected. Please report this as a bug
+    in GnuCash, so we can fix this for your platform.]) ])
+                  ],
+                  [AC_MSG_ERROR([
     guile does not appear to be installed correctly, or is not in the
     correct version range.  Perhaps you have not installed the guile
     development packages?  Gnucash requires at least version 1.8.5 to build.
   ])])
 ])
-# Look up GUILE executable
-AC_PATH_PROG(GUILE, guile)
 
+# Restore user defined guile settings if necessary
 GUILE_INCS="${GUILE_CFLAGS}"
 if test "x$saved_GUILE_LIBS" != x; then
   GUILE_LIBS="$saved_GUILE_LIBS"
@@ -453,17 +477,7 @@
 
 AS_SCRUB_INCLUDE(GUILE_INCS)
 AC_SUBST(GUILE_INCS)
-AC_SUBST(GUILE_LIBS)
-AC_SUBST(GUILE)
 
-### --------------------------------------------------------------------------
-### See if we need guile-www
-
-gnc_have_guile_www=no
-
-AC_MSG_CHECKING([if guile needs our copy of (guile www)])
-GUILE_MODULE_AVAILABLE(gnc_have_guile_www,[(www main)])
-
 AM_CONDITIONAL(GNC_HAVE_GUILE_WWW, test "${gnc_have_guile_www}" = yes)
 
 ### --------------------------------------------------------------------------



More information about the gnucash-changes mailing list