From: Eric Blake <ebb9@byu.net>
Date: Tue, 30 Dec 2008 03:06:44 +0000 (-0700)
Subject: multiarch: avoid autoconf AC_REQUIRE bug
X-Git-Tag: v0.1~6504
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3d13a239237bd5a750131029dcea37da46abe815;p=gnulib.git

multiarch: avoid autoconf AC_REQUIRE bug

* m4/multiarch.m4 (gl_MULTIARCH): Split body...
(gl_MULTIARCH_BODY): ...into new macro, to work around bug in Autoconf
2.63 and older.
Reported by Bruno Haible, and analyzed in
http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00039.html

Signed-off-by: Eric Blake <ebb9@byu.net>
---

diff --git a/ChangeLog b/ChangeLog
index 0b68f9b92b..516ff9e98b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-29  Eric Blake  <ebb9@byu.net>
+
+	multiarch: avoid autoconf AC_REQUIRE bug
+	* m4/multiarch.m4 (gl_MULTIARCH): Split body...
+	(gl_MULTIARCH_BODY): ...into new macro, to work around bug in Autoconf
+	2.63 and older.
+	Reported by Bruno Haible, and analyzed in
+	http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00039.html
+
 2008-12-29  Bruno Haible  <bruno@clisp.org>
 
 	* gnulib-tool (func_import): When generating sed-ignore-removed, handle
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index d857599d6b..7b73e15ee9 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,4 +1,4 @@
-# multiarch.m4 serial 2
+# multiarch.m4 serial 3
 dnl Copyright (C) 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -20,6 +20,15 @@ dnl with or without modifications, as long as this notice is preserved.
 # beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
 
 AC_DEFUN([gl_MULTIARCH],
+[
+  dnl This AC_REQUIRE is not necessary in theory. It works around a bug in
+  dnl autoconf <= 2.63: AC_REQUIRE invocations inside AC_REQUIREd macros are
+  dnl being handled better than AC_REQUIRE invocations inside normally invoked
+  dnl macros.
+  AC_REQUIRE([gl_MULTIARCH_BODY])
+])
+
+AC_DEFUN([gl_MULTIARCH_BODY],
 [
   dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
   gl_cv_c_multiarch=no