[Gnucash-changes] r12332 - gnucash/trunk - * configure.in: fixes to make configure more quiet

Derek Atkins warlord at cvs.gnucash.org
Thu Jan 12 17:47:11 EST 2006


Author: warlord
Date: 2006-01-12 17:47:08 -0500 (Thu, 12 Jan 2006)
New Revision: 12332
Trac: http://svn.gnucash.org/trac/changeset/12332

Added:
   gnucash/trunk/macros/pkg.m4
Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/configure.in
Log:
	* configure.in: fixes to make configure more quiet
	  - move PKG_CONFIG check early in the process
	  - use --silence-errors more
	* macros/pkg.m4: work around a pkg-config bug that outputs
	  errors to stderr even when you tell it to output to stdout.



Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-01-12 21:44:08 UTC (rev 12331)
+++ gnucash/trunk/ChangeLog	2006-01-12 22:47:08 UTC (rev 12332)
@@ -2,6 +2,12 @@
 
 	* configure.in:  add --enable-qof so build defaults to internal qof.
 
+	* configure.in: fixes to make configure more quiet
+	  - move PKG_CONFIG check early in the process
+	  - use --silence-errors more
+	* macros/pkg.m4: work around a pkg-config bug that outputs
+	  errors to stderr even when you tell it to output to stdout.
+
 2006-01-10  David Hampton  <hampton at employees.org>
 
 	* src/gnome-utils/gnc-gnome-utils.c:

Modified: gnucash/trunk/configure.in
===================================================================
--- gnucash/trunk/configure.in	2006-01-12 21:44:08 UTC (rev 12331)
+++ gnucash/trunk/configure.in	2006-01-12 22:47:08 UTC (rev 12332)
@@ -114,6 +114,21 @@
   AC_MSG_ERROR([Cannot find ltdl.h -- libtool-devel not installed?])
 fi
 
+### --------------------------------------------------------------------------
+### See if we have pkg-config
+
+AC_PATH_PROG(PKG_CONFIG,pkg-config)
+if test "x$PKG_CONFIG" = x; then
+    # @*%&$ Ximian programmers renamed this application
+    AC_PATH_PROG(PKG_CONFIG,pkgconfig)
+    if test "x$PKG_CONFIG" = x; then
+    	AC_MSG_ERROR([Could not find the pkg-config (or pkgconfig) program.],)
+    fi
+fi
+
+### --------------------------------------------------------------------------
+### Glib checks..
+
 AM_PATH_GLIB_2_0(2.4.0,,AC_MSG_ERROR([
 *** GLIB >= 2.4 is required to build Gnucash; please make sure you have the
 *** development headers installed. The latest version of GLIB is
@@ -356,17 +371,8 @@
 fi
 
 ### --------------------------------------------------------------------------
-### See if we have pkg-config
+### look for gconf
 
-AC_PATH_PROG(PKG_CONFIG,pkg-config)
-if test "x$PKG_CONFIG" = x; then
-    # @*%&$ Ximian programmers renamed this application
-    AC_PATH_PROG(PKG_CONFIG,pkgconfig)
-    if test "x$PKG_CONFIG" = x; then
-    	AC_MSG_ERROR([Could not find the pkg-config (or pkgconfig) program.],)
-    fi
-fi
-
 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= "2.0")
 AC_SUBST(GCONF_CFLAGS)
 AC_SUBST(GCONF_LIBS)
@@ -417,11 +423,6 @@
 AC_ARG_WITH(qof, [  --with-qof=path           prefix for Query Object Framework - QOF (auto)])
 
 QOF_REQUIRED=0.6.0
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-if test pkg-config = no; then
-        AC_MSG_ERROR([Please install pkgconfig])
-        exit 1
-fi
 if test "$gnc_enable_qof" = yes ; then
   AC_MSG_CHECKING([for QOF, version >= $QOF_REQUIRED])
   if test "$withval" != "yes"; then
@@ -509,14 +510,13 @@
 dnl A: Just _CFLAGS and _LIBS, apparently [pkg.m4]
 
 dnl $4=true => don't die in case of failure.
-PKG_CHECK_MODULES(GSF, libgsf-1 >= 1.12.2
-                       libgsf-gnome-1 >= 1.12.2,,true)
-if $PKG_CONFIG 'libgsf-1 >= 1.12.2'
+PKG_CHECK_MODULES(GSF, libgsf-1 >= 1.12.2 libgsf-gnome-1 >= 1.12.2,,true)
+if $PKG_CONFIG --silence-errors 'libgsf-1 >= 1.12.2'
 then
   AC_DEFINE(HAVE_LIBGSF,1,[System has libgsf-1.12.2 or better])
   HAVE_LIBGSF=yes
 else
-  AC_MSG_NOTICE(using internally-packaged libgsf)
+  AC_MSG_RESULT(using internally-packaged libgsf)
   GSF_CFLAGS='-I${top_srcdir}/lib/libgsf-1.12.3'
   GSF_LIBS='${top_builddir}/lib/libgsf-1.12.3/gsf/libgsf-1.la'
   HAVE_LIBGSF=no
@@ -527,12 +527,12 @@
 
 dnl $4=true => don't die if failure.
 PKG_CHECK_MODULES(GOFFICE, libgoffice-1 >= 0.0.4,,true)
-if $PKG_CONFIG 'libgoffice-1 >= 0.0.4'
+if $PKG_CONFIG --silence-errors 'libgoffice-1 >= 0.0.4'
 then
   AC_DEFINE(HAVE_GOFFICE,1,[System has goffice-0.0.4 or better])
   HAVE_GOFFICE=yes
 else
-  AC_MSG_NOTICE(using internally-packaged goffice)
+  AC_MSG_RESULT(using internally-packaged goffice)
   GOFFICE_CFLAGS='-I${top_srcdir}/lib/goffice-0.0.4'
   GOFFICE_LIBS='${top_builddir}/lib/goffice-0.0.4/goffice/libgoffice-1.la'
   HAVE_GOFFICE=no

Added: gnucash/trunk/macros/pkg.m4
===================================================================
--- gnucash/trunk/macros/pkg.m4	2006-01-12 21:44:08 UTC (rev 12331)
+++ gnucash/trunk/macros/pkg.m4	2006-01-12 22:47:08 UTC (rev 12332)
@@ -0,0 +1,62 @@
+dnl This was originally from pkgconfig
+dnl modified for GnuCash to make it more quiet
+dnl in the face of missing config files.
+dnl also, pkg-config --errors-to-stdout does not work as advertized on FC3
+dnl so we need to redirect stderr to stdout.
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN([PKG_CHECK_MODULES], [
+  succeeded=no
+
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  if test "$PKG_CONFIG" = "no" ; then
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        AC_MSG_CHECKING(for $2)
+
+        if $PKG_CONFIG --silence-errors --exists "$2" ; then
+            AC_MSG_RESULT(yes)
+            succeeded=yes
+
+            AC_MSG_CHECKING($1_CFLAGS)
+            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+            AC_MSG_RESULT($$1_CFLAGS)
+
+            AC_MSG_CHECKING($1_LIBS)
+            $1_LIBS=`$PKG_CONFIG --libs "$2"`
+            AC_MSG_RESULT($$1_LIBS)
+        else
+            $1_CFLAGS=""
+            $1_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but 
+            ## do set a variable so people can do so.
+            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2" 2>&1`
+            ifelse([$4], ,echo $$1_PKG_ERRORS,)
+        fi
+
+        AC_SUBST($1_CFLAGS)
+        AC_SUBST($1_LIBS)
+     else
+        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+        echo "*** See http://www.freedesktop.org/software/pkgconfig"
+     fi
+  fi
+
+  if test $succeeded = yes; then
+     ifelse([$3], , :, [$3])
+  else
+     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+  fi
+])
+
+


Property changes on: gnucash/trunk/macros/pkg.m4
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the gnucash-changes mailing list