[PATCH] glib configure.in patches



Hi.

I thought I'd toss this patc out and see if there is any interest
in the "fixes" it contains. As the configure.in script for
glib requires autoconf-2.5X, I modified the configure.in file
to better follow the recommended macros in the latest autoconf.

Most of the changes below simply change obsolete forms of
various macros to they're newer form, such as

AC_INIT(filename)

becoming

AC_INIT([package], [version])
AC_CONFIF_SRCDIR(filename)

and

AC_OUTPUT( ... bunch of files ...)

becomes

AC_CONFIG_FILES( ... bunch of files ...)
AC_OUTPUT

The AC_INIT([package], [version]) format also allows change
AM_INIT_AUTOMAKE to the version seen in the patch.

I've also added usage of the AC_HELP_STRING macro to
format the help strings - the "@<:@" and "@:>@" characters
expand out to "[" and "]". For more info see the "Quadrigraphs"
section in the autoconf documentation. I commented out
a couple of obsolete macros, and added some explicit
quoting in others. The autoconf documentation has
more info on the AC_HELP_STRING macro, and why it
isn't quoted when used within another macro.

This patch is against the glib-2-branch, not against the
head. I don't know whether or not the patch applies directly
to the head, as I'm sticking with the branch for now. I
also have similar patches for atk, pango, and gtk+ which
I'll be glad to forward along if there's interest. 

Note that some of these changes could have been done by
using the autoupdate script, but I've found that converting
an old-style configure script to a new one still requires
a little hand editing. Adding things like AC_HELP_STRING()
and some of the other tweeks only get done manually.

Thanks for all the work on glib!

Art Haas

Index: configure.in
===================================================================
RCS file: /cvs/gnome/glib/configure.in,v
retrieving revision 1.279.2.11
diff -u -r1.279.2.11 configure.in
--- configure.in	18 Jun 2002 18:28:25 -0000	1.279.2.11
+++ configure.in	21 Jun 2002 20:36:39 -0000
@@ -9,7 +9,8 @@
 AC_PREREQ(2.52)
 
 # Process this file with autoconf to produce a configure script.
-AC_INIT(glib/glib.h)
+AC_INIT([glib], [2.0.4])
+AC_CONFIG_SRCDIR(glib/glib.h)
 
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
@@ -61,7 +62,7 @@
 VERSION=$GLIB_VERSION
 PACKAGE=glib
 
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
+AM_INIT_AUTOMAKE
 
 # Specify a configuration file
 AM_CONFIG_HEADER(config.h)
@@ -148,14 +149,36 @@
 ])
 
 dnl declare --enable-* args and collect ac_help strings
-AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
-AC_ARG_ENABLE(gc_friendly, [  --enable-gc-friendly    turn on garbage collector friendliness [default=no]],,enable_gc_friendly=no)
-AC_ARG_ENABLE(mem_pools, [  --disable-mem-pools     disable all glib memory pools],,disable_mem_pools=no)
-AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
-		    , enable_ansi=no)
-AC_ARG_ENABLE(threads, [  --enable-threads        turn on basic thread support [default=yes]
-                          ([=no] will override --with-threads)],,enable_threads=yes)
-AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
+AC_ARG_ENABLE([debug],
+              AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
+	                     [turn on debugging @<:@default=$debug_default@:>@]),
+	      [],
+	      [enable_debug=$debug_default])
+AC_ARG_ENABLE([gc_friendly],
+              AC_HELP_STRING([--enable-gc-friendly],
+	                     [turn on garbage collector friendliness @<:@default=no@:>@]),
+	      [],
+	      [enable_gc_friendly=no])
+AC_ARG_ENABLE([mem_pools],
+              AC_HELP_STRING([--disable-mem-pools],
+	                     [disable all glib memory pools]),
+	      [],
+	      [disable_mem_pools=no])
+AC_ARG_ENABLE([ansi],
+              AC_HELP_STRING([--enable-ansi],
+	                     [turn on strict ansi @<:@default=no@:>@]),
+	      [],
+	      [enable_ansi=no])
+AC_ARG_ENABLE([threads],
+              AC_HELP_STRING([--enable-threads],
+	                     [turn on basic thread support @<:@default=yes@:>@ (=no will override --with-threads)]),
+	      [],
+	      [enable_threads=yes])
+AC_ARG_ENABLE([rebuilds],
+              AC_HELP_STRING([--disable-rebuilds],
+	                     [disable all source autogeneration rules]),
+	      [],
+	      [enable_rebuilds=yes])
 
 if test "x$enable_threads" != "xyes"; then
   enable_threads=no
@@ -237,8 +260,8 @@
   fi
 fi
 
-AC_CYGWIN
-AC_EXEEXT
+dnl AC_CYGWIN
+dnl AC_EXEEXT
 
 # define a MAINT-like variable REBUILD which is set if Perl
 # and awk are found, so autogenerated sources can be rebuilt
@@ -270,7 +293,11 @@
 dnl
 dnl We do this before the gettext checks, to avoid distortion
 
-AC_ARG_WITH(libiconv, [  --with-libiconv=[no/gnu/native] use the libiconv library ],,with_libiconv=maybe)
+AC_ARG_WITH([libiconv],
+            AC_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@],
+                           [use the libiconv library]),
+            [],
+            [with_libiconv=maybe])
 
 found_iconv=no
 case $with_libiconv in
@@ -751,7 +778,9 @@
 if test "$gtk_ok" = "yes"; then
     AC_MSG_RESULT([yes, found in sys/types.h])
 else
-    AC_EGREP_HEADER(fd_set, sys/select.h, gtk_ok=yes)
+    AC_EGREP_HEADER([fd_set],
+                    [sys/select.h],
+                    [gtk_ok=yes])
     if test "$gtk_ok" = "yes"; then
 	# *** FIXME: give it a different name
         AC_DEFINE(HAVE_SYS_SELECT_H,1,[found fd_set in sys/select.h])
@@ -1015,7 +1044,7 @@
         G_MODULE_SUPPORTED=true
 fi
 
-AC_MSG_CHECKING(for the suffix of shared libraries)
+AC_MSG_CHECKING([for the suffix of shared libraries])
 case "$host_os" in
   hpux9* | hpux10* | hpux11*)  # taken from ltconfig
     glib_gmodule_suffix='sl'
@@ -1116,13 +1145,17 @@
 dnl *** g_thread checks ***
 dnl ***********************
 
-AC_ARG_WITH(threads, [  --with-threads=[none/posix/dce/solaris/win32] specify a thread implementation to use],
+AC_ARG_WITH([threads],
+            AC_HELP_STRING([--with-threads=@<:@none/posix/dce/solaris/win32@:>@],
+                           [specify a thread implementation to use]),
+[
 	if test "x$with_threads" = x; then
 		want_threads=yes
 	else
 		want_threads=$with_threads
-	fi,
-	want_threads=yes)
+	fi
+],
+	    [want_threads=yes])
 if test "x$enable_threads" = "xno"; then
         want_threads=no
 fi
@@ -1208,7 +1241,7 @@
 	have_threads=none
 fi
 
-AC_MSG_CHECKING(for thread implementation)
+AC_MSG_CHECKING([for thread implementation])
 
 if test "x$have_threads" = xno && test "x$want_threads" != xno; then
 	AC_MSG_RESULT(none available)
@@ -1655,7 +1688,9 @@
 dnl *** Checks for gtk-doc ***
 dnl **************************
 
-AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs])
+AC_ARG_WITH([html-dir],
+            AC_HELP_STRING([--with-html-dir=PATH],
+                           [path to installed docs]))
 
 if test "x$with_html_dir" = "x" ; then
   HTML_DIR='${datadir}/gtk-doc/html'
@@ -1689,7 +1724,11 @@
 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
 dnl Let people disable the gtk-doc stuff.
-AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
+AC_ARG_ENABLE([gtk-doc],
+              AC_HELP_STRING([--enable-gtk-doc],
+	                     [use gtk-doc to build documentation @<:@default=auto@:>@]),
+	      [enable_gtk_doc="$enableval"],
+	      [enable_gtk_doc=no])
 
 if test x$enable_gtk_doc = xyes ; then
   if test x$GTKDOC = xtrue ; then
@@ -2250,7 +2289,7 @@
 esac
 ])
 
-AC_OUTPUT([
+AC_CONFIG_FILES([
 glib-2.0.pc
 glib-2.0-uninstalled.pc
 gmodule-2.0.pc
@@ -2281,3 +2320,5 @@
 tests/Makefile
 m4macros/Makefile
 ])
+
+AC_OUTPUT
-- 
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
 -- Benjamin Franklin, Historical Review of Pennsylvania, 1759



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