Backport improved autoconf semantics of AC_DEFUN_ONCE.
authorEric Blake <ebb9@byu.net>
Mon, 26 Jan 2009 16:08:48 +0000 (09:08 -0700)
committerEric Blake <ebb9@byu.net>
Mon, 26 Jan 2009 16:08:48 +0000 (09:08 -0700)
* m4/00gnulib.m4: New file.
* gnulib-tool (func_get_filelist): Always use it.
* m4/gnulib-common.m4 (gl_COMMON): Force the file to be used.
Reported by Bruno Haible, with suggestions from Paolo Bonzini.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
gnulib-tool
m4/00gnulib.m4 [new file with mode: 0644]
m4/gnulib-common.m4

index 78f8aa3e15de9663ac6a5e9fdc772aa2a1558902..a8f6e1d48573eb84370ce0b553c77c998b616c2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-26  Eric Blake  <ebb9@byu.net>
+
+       Backport improved autoconf semantics of AC_DEFUN_ONCE.
+       * m4/00gnulib.m4: New file.
+       * gnulib-tool (func_get_filelist): Always use it.
+       * m4/gnulib-common.m4 (gl_COMMON): Force the file to be used.
+       Reported by Bruno Haible, with suggestions from Paolo Bonzini.
+
 2009-01-25  Bruno Haible  <bruno@clisp.org>
 
        Make test-quotearg work on MacOS X and AIX.
index c6725d3dca908f3c4f7007b6df528b00f9078351..a044ead5c237665a89083295dd9ee3b3fe27f1ed 100755 (executable)
@@ -1378,6 +1378,7 @@ func_get_filelist ()
 {
   func_lookup_file "modules/$1"
   sed -n -e "/^Files$sed_extract_prog" < "$lookedup_file"
+  echo m4/00gnulib.m4
   echo m4/gnulib-common.m4
   case "$autoconf_minversion" in
     2.59)
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
new file mode 100644 (file)
index 0000000..a6b5e21
--- /dev/null
@@ -0,0 +1,30 @@
+# 00gnulib.m4 serial 1
+dnl Copyright (C) 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts before all other
+dnl gnulib-provided .m4 files.  It is needed until such time as we can
+dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics.
+
+# AC_DEFUN_ONCE(NAME, VALUE)
+# --------------------------
+# Define NAME to expand to VALUE on the first use (whether by direct
+# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
+# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier.  This
+# definition is slower than the version in Autoconf 2.64, because it
+# can only use interfaces that existed since 2.59; but it achieves the
+# same effect.  Quoting is necessary to avoid confusing Automake.
+m4_version_prereq([2.63.263], [],
+[m4_define([AC][_DEFUN_ONCE],
+  [AC][_DEFUN([$1],
+    [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
+      [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
+[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
+
+# gl_00GNULIB
+# -----------
+# Witness macro that this file has been included.  Needed to force
+# Automake to include this file prior to all other gnulib .m4 files.
+AC_DEFUN([gl_00GNULIB])
index cfd1b99f82ed204e10cf865c4e3bb511a711c138..fff9d0f9675e0dd412141766ba360a2157c13f50 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 8
+# gnulib-common.m4 serial 9
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
 # is expanded unconditionally through gnulib-tool magic.
 AC_DEFUN([gl_COMMON], [
   dnl Use AC_REQUIRE here, so that the code is expanded once only.
+  AC_REQUIRE([gl_00GNULIB])
   AC_REQUIRE([gl_COMMON_BODY])
 ])
 AC_DEFUN([gl_COMMON_BODY], [