[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
expand-before-require bug
From: |
Eric Blake |
Subject: |
expand-before-require bug |
Date: |
Tue, 20 Jan 2009 17:43:18 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
I am about to patch autoconf to issue a syntax warning on instances of
expanding a macro, then later requiring the same macro, from within the same
defun'd body. This is a bug in user code which can lead to silent out-of-order
expansion in older autoconf, and which will cause duplicate expansion in newer
autoconf once I implement Bruno's suggestion of re-expanding the macro as part
of issuing the warning.
When I turned on the warning, I got this message:
configure.ac:35: warning: AC_REQUIRE: `AM_PROG_INSTALL_SH' was expanded before
it was required
aclocal.m4:846: AM_PROG_INSTALL_STRIP is expanded from...
aclocal.m4:408: AM_INIT_AUTOMAKE is expanded from...
configure.ac:35: the top level
In this particular case, we happened to get lucky with no out-of-order
expansion of AM_PROG_INSTALL_SH with older autoconf, because
AM_PROG_INSTALL_STRIP was also directly expanded. But to avoid duplicate
expansion of AM_PROG_INSTALL_SH in newer autoconf, we will need this patch.
Okay to apply to master and the branch?
From: Eric Blake <address@hidden>
Date: Tue, 20 Jan 2009 10:36:49 -0700
Subject: [PATCH] Avoid expand-before-require warning from newer autoconf.
* m4/init.m4 (AM_INIT_AUTOMAKE): Require, rather than directly
expand, AM_PROG_INSTALL_SH and AM_PROG_INSTALL_STRIP.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 6 ++++++
m4/init.m4 | 6 +++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d7a729f..4824872 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-20 Eric Blake <address@hidden>
+
+ Avoid expand-before-require warning from newer autoconf.
+ * m4/init.m4 (AM_INIT_AUTOMAKE): Require, rather than directly
+ expand, AM_PROG_INSTALL_SH and AM_PROG_INSTALL_STRIP.
+
2008-12-29 Chris Pickett <address@hidden> (tiny change)
* doc/automake.texi (LIBOBJS): Clarify overriding of
diff --git a/m4/init.m4 b/m4/init.m4
index 7104dd3..51fe69a 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -1,7 +1,7 @@
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -75,8 +75,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
--
1.6.0.4
- expand-before-require bug,
Eric Blake <=