[gconf] Bug 498934 - general autoconf improvements



commit c0be33190c54de88582536484bc33de8bf0dd044
Author: Gilles Dartiguelongue <gilles dartiguelongue esiee org>
Date:   Tue Apr 28 20:42:55 2009 +0200

    Bug 498934 - general autoconf improvements
    
    * fix whitespace policy in configure.in
     * raise AC_PREREQ to be able to use AS_HELP_STRING and other improvements of autoconf
     * add a configure summary at the end of configure
     * remove unused tests
---
 configure.in |  138 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 64 insertions(+), 74 deletions(-)

diff --git a/configure.in b/configure.in
index 2dae314..9ddbb93 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,13 @@
-AC_INIT([GConf],[2.26.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=GConf],[GConf])
-
-AC_DEFUN([AC_FYI], [echo "FYI: " $1])
+AC_PREREQ(2.60)
+AC_INIT([GConf],
+  [2.26.0],
+  [http://bugzilla.gnome.org/enter_bug.cgi?product=GConf],
+  [GConf])
 
 AC_CONFIG_SRCDIR([gconf/gconf.h])
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
 
-AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
+AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 -Wall])
 
 AM_MAINTAINER_MODE
 
@@ -19,14 +21,14 @@ case "$host" in
     ;;
 esac
 
-AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
+AM_CONDITIONAL(OS_WIN32, [test "x$os_win32" = "xyes"])
 
-if test "$os_win32" = "yes"; then
-  if test x$enable_static = xyes -o x$enable_static = x; then
+if test "x$os_win32" = "xyes"; then
+  if test "x$enable_static" = "xyes" -o "x$enable_static" = "x"; then
     AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
     enable_static=no
   fi
-  if test x$enable_shared = xno; then
+  if test "x$enable_shared" = "xno"; then
     AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
   fi
   enable_shared=yes
@@ -44,19 +46,19 @@ AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 changequote(,)dnl
 if test "x$GCC" = "xyes"; then
   case " $CFLAGS " in
-  *[\ \	]-Wall[\ \	]*) ;;
-  *) CFLAGS="$CFLAGS -Wall" ;;
+    *[\ \	]-Wall[\ \	]*) ;;
+    *) CFLAGS="$CFLAGS -Wall" ;;
   esac
 
   if test "x$enable_ansi" = "xyes"; then
     case " $CFLAGS " in
-    *[\ \	]-ansi[\ \	]*) ;;
-    *) CFLAGS="$CFLAGS -ansi" ;;
+      *[\ \	]-ansi[\ \	]*) ;;
+      *) CFLAGS="$CFLAGS -ansi" ;;
     esac
 
     case " $CFLAGS " in
-    *[\ \	]-pedantic[\ \	]*) ;;
-    *) CFLAGS="$CFLAGS -pedantic" ;;
+      *[\ \	]-pedantic[\ \	]*) ;;
+      *) CFLAGS="$CFLAGS -pedantic" ;;
     esac
   fi
 fi
@@ -76,12 +78,12 @@ dnl libtool versioning for libgconf
 dnl increment if the interface has additions, changes, removals.
 GCONF_CURRENT=5
 
-dnl increment any time the source changes; set to 
+dnl increment any time the source changes; set to
 dnl  0 if you increment CURRENT
 GCONF_REVISION=5
 
 dnl increment if any interfaces have been added; set to 0
-dnl  if any interfaces have been removed. removal has 
+dnl  if any interfaces have been removed. removal has
 dnl  precedence over adding, so set to 0 if both happened.
 GCONF_AGE=1
 
@@ -97,14 +99,16 @@ else
   REAL_PREFIX=$prefix
 fi
 
-AC_ARG_WITH(sysconfsubdir, AC_HELP_STRING([--with-sysconfsubdir],
-            [directory name used under sysconfdir, default=gconf]),
-            sysconfsubdir=${withval}, sysconfsubdir=gconf)
-AC_SUBST(sysconfsubdir)
-if test x"${sysconfsubdir}" != x; then
-    sysgconfdir='${sysconfdir}/${sysconfsubdir}'
+AC_ARG_WITH(sysconfsubdir,
+  AS_HELP_STRING([--with-sysconfsubdir],
+    [directory name used under sysconfdir @<:@default=gconf@:>@]),
+  , with_sysconfsubdir=gconf)
+AC_SUBST(with_sysconfsubdir)
+
+if test "x${with_sysconfsubdir}" != "x"; then
+  sysgconfdir='${sysconfdir}/${with_sysconfsubdir}'
 else
-    sysgconfdir='${sysconfdir}'
+  sysgconfdir='${sysconfdir}'
 fi
 AC_SUBST(sysgconfdir)
 
@@ -112,24 +116,29 @@ dnl Save flags to aclocal
 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
 
 dnl Default to debug spew in unstable branch
-AC_ARG_ENABLE(debug, 
-            [  --enable-debug=[no/yes/minimum]      Compile with debug checks.],,enable_debug=minimum)
+AC_ARG_ENABLE(debug,
+  AS_HELP_STRING([--enable-debug],
+    [Compile with debug checks. @<:@no/yes/minimum, default=minimum@:>@]),
+  , enable_debug=minimum)
 
 if test "x$enable_debug" = "xyes"; then
-        CFLAGS="$CFLAGS -DGCONF_ENABLE_DEBUG=1"
-        AC_FYI("Will build with debugging spew and checks")
+  CFLAGS="$CFLAGS -DGCONF_ENABLE_DEBUG=1"
+  AC_MSG_NOTICE([Will build with debugging spew and checks])
 else
   if test "x$enable_debug" = "xno"; then
-          CFLAGS="$CFLAGS -DG_DISABLE_CHECKS=1 -DG_DISABLE_ASSERT=1"
-          AC_FYI("Will build without *any* debugging code")
+    CFLAGS="$CFLAGS -DG_DISABLE_CHECKS=1 -DG_DISABLE_ASSERT=1"
+    AC_MSG_NOTICE([Will build without *any* debugging code])
   else
-          AC_FYI("Will build with debug checks but no debug spew")
+    AC_MSG_NOTICE([Will build with debug checks but no debug spew])
   fi
 fi
 
 GTK_DOC_CHECK([1.0])
 
-AC_ARG_ENABLE(gtk, [  --enable-gtk          Enable GTK+ support (for gconf-sanity-check) [default=auto]], enable_gtk="$enableval", enable_gtk=auto)
+AC_ARG_ENABLE(gtk,
+  AS_HELP_STRING([--enable-gtk],
+    [Enable GTK+ support (for gconf-sanity-check) @<:@default=auto@:>@]),
+  , enable_gtk=auto)
 
 PKGCONFIG_MODULES='glib-2.0 > 2.14.0 gmodule-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0 ORBit-2.0 >= 2.4.0 dbus-1 >= 1.0.0 dbus-glib-1 >= 0.74'
 PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0"
@@ -141,8 +150,7 @@ PKG_CHECK_MODULES(DEPENDENT_WITH_XML, $PKGCONFIG_MODULES_WITH_XML)
 
 if test "x$enable_gtk" != "xno"; then
   PKG_CHECK_MODULES(DEPENDENT_WITH_GTK, $PKGCONFIG_MODULES_WITH_GTK, HAVE_GTK=yes, HAVE_GTK=no)
-  PKG_CHECK_MODULES(DEPENDENT_WITH_XML_AND_GTK, $PKGCONFIG_MODULES_WITH_XML_AND_GTK, ,
-                    DEPENDENT_WITH_XML_AND_GTK_CFLAGS=$DEPENDENT_WITH_XML_CFLAGS DEPENDENT_WITH_XML_AND_GTK_LIBS=$DEPENDENT_WITH_XML_LIBS)
+  PKG_CHECK_MODULES(DEPENDENT_WITH_XML_AND_GTK, $PKGCONFIG_MODULES_WITH_XML_AND_GTK, , DEPENDENT_WITH_XML_AND_GTK_CFLAGS=$DEPENDENT_WITH_XML_CFLAGS DEPENDENT_WITH_XML_AND_GTK_LIBS=$DEPENDENT_WITH_XML_LIBS)
 
   if test "x$enable_gtk" = "xyes" && test "x$HAVE_GTK" = "xno"; then
     AC_MSG_ERROR([[
@@ -155,7 +163,7 @@ else
   DEPENDENT_WITH_XML_AND_GTK_LIBS=$DEPENDENT_WITH_XML_LIBS
 fi
 
-AM_CONDITIONAL(GTK, test x$HAVE_GTK != xno)
+AM_CONDITIONAL(GTK, [test "x$HAVE_GTK" != "xno"])
 
 AC_SUBST(DEPENDENT_LIBS)
 AC_SUBST(DEPENDENT_CFLAGS)
@@ -166,19 +174,19 @@ AC_SUBST(DEPENDENT_WITH_GTK_CFLAGS)
 AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_LIBS)
 AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_CFLAGS)
 
+enable_defaults_service=no
+HAVE_POLKIT=no
 AC_ARG_ENABLE(defaults-service,
-              [AC_HELP_STRING([--enable-defaults-service],
-                              [build the defaults DBus service [default=auto]])],
-              [enable_defaults_service="$enableval"],
-              [enable_defaults_service=auto])
+  AS_HELP_STRING([--enable-defaults-service],
+    [build the defaults DBus service @<:@default=auto@:>@]),
+  , enable_defaults_service=auto)
+
 if test "x$enable_defaults_service" != "xno" ; then
-  PKG_CHECK_MODULES(DEFAULTS, glib-2.0 gobject-2.0 dbus-1 dbus-glib-1 polkit-dbus, HAVE_POLKIT=yes, HAVE_POLKIT=no)
+  PKG_CHECK_MODULES(DEFAULTS, glib-2.0 gobject-2.0 dbus-1 dbus-glib-1 polkit-dbus, HAVE_POLKIT=yes)
   if test "x$HAVE_POLKIT" = "xno"; then
     if test "x$enable_defaults_service" = "xyes" ; then
       AC_MSG_ERROR([[
 *** Could not find PolicyKit.]])
-    else
-      enable_defaults_service=no
     fi
   else
     enable_defaults_service=yes
@@ -189,9 +197,10 @@ if test "x$enable_defaults_service" != "xno" ; then
   AC_DEFINE(ENABLE_DEFAULTS_SERVICE, 1, [enable defaults DBus service])
 
   AC_CHECK_PROG([POLKIT_POLICY_FILE_VALIDATE],
-                [polkit-policy-file-validate], [polkit-policy-file-validate])
+    [polkit-policy-file-validate], [polkit-policy-file-validate])
+
   if test -z "$POLKIT_POLICY_FILE_VALIDATE"; then
-      AC_MSG_ERROR([polkit-policy-file-validate not found])
+    AC_MSG_ERROR([polkit-policy-file-validate not found])
   fi
 fi
 
@@ -201,7 +210,7 @@ ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
 AC_SUBST(ORBIT_IDL)
 
 AC_CHECK_HEADER(pthread.h, have_pthreads=yes)
-AM_CONDITIONAL(PTHREADS, test -n "$have_pthreads")
+AM_CONDITIONAL(PTHREADS, [test -n "$have_pthreads"])
 
 AC_CHECK_HEADERS(syslog.h sys/wait.h)
 
@@ -214,7 +223,7 @@ dnl **************************************************
 AC_ARG_WITH(openldap,
   AS_HELP_STRING([--with-openldap],
     [Enable LDAP backend @<:@default=auto@:>@]),
-  ,with_openldap=auto)
+  , with_openldap=auto)
 
 LDAP_LIBS=
 
@@ -273,34 +282,6 @@ AC_SUBST(LDFLAGS)
 absolute_top_srcdir=`pwd`
 AC_SUBST(absolute_top_srcdir)
 
-# define a MAINT-like variable REBUILD which is set if Perl
-# and awk are found, so autogenerated sources can be rebuilt
-
-AC_PROG_AWK
-AC_CHECK_PROGS(PERL, perl5 perl)
-
-# We would like indent, but don't require it.
-AC_CHECK_PROG(INDENT, indent, indent)
-
-_found_perl=0
-if test -n "$PERL" && $PERL -v | grep 'version 5.' > /dev/null ; then
-  _found_perl=1
-else
-  # The version string for perl changed for 'version 5' to 'v5' in
-  # perl 5.6 or therabouts
-  if test -n "$PERL" && $PERL -v | grep 'v5.' > /dev/null ; then
-    _found_perl=1
-  fi
-fi
-
-REBUILD=\#
-if test $_found_perl -eq 1; then
-  if test -n "$AWK" ; then 
-    REBUILD=
-  fi
-fi
-AC_SUBST(REBUILD)
-
 AC_CONFIG_FILES([
 Makefile
 gconf-2.m4
@@ -317,3 +298,12 @@ gconf-2.0.pc
 ])
 
 AC_OUTPUT
+
+echo "
+	sysconfsubdir:	${with_sysconfsubdir}
+
+	gtk+:		${HAVE_GTK}
+	ldap:		${have_ldap}
+	policykit:	${HAVE_POLKIT}
+
+"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]