[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: autoheader -vs- AC_CONFIG_HEADERS (Was: Re: Conditionally compiling
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: autoheader -vs- AC_CONFIG_HEADERS (Was: Re: Conditionally compiling Java) |
Date: |
13 Jun 2002 21:24:48 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
>>> "Braden" == Braden McDaniel <address@hidden> writes:
[...]
Braden> Looks promising; however, when I try to use the CVS
Braden> version of automake, I get an error from autoheader:
Braden> autoheader: error: AC_CONFIG_HEADERS not found in configure.ac
Braden> I am in fact using the macro AM_CONFIG_HEADER, but changing to
Braden> AC_CONFIG_HEADERS has no effect. Yeah, I know: autoheader comes with
Braden> autoconf, not automake. So, any idea what might be triggering this?
Thanks. I'm checking in the following fix.
2002-06-13 Alexandre Duret-Lutz <address@hidden>
* m4/header.m4 (_AM_CONFIG_HEADER_INSINUATE): Use m4_copy instead
of m4_rename so that AC_CONFIG_HEADER is never undefined and
therefore still traced after the redefinition.
* tests/defs (AUTOHEADER): Define.
* tests/autoheader.test: New file.
* tests/Makefile.am (TESTS): Add autoheader.test.
Reported by Braden McDaniel.
Index: m4/header.m4
===================================================================
RCS file: /cvs/automake/automake/m4/header.m4,v
retrieving revision 1.15
diff -u -r1.15 header.m4
--- m4/header.m4 19 Apr 2002 10:13:30 -0000 1.15
+++ m4/header.m4 13 Jun 2002 19:42:23 -0000
@@ -87,8 +87,10 @@
dnl make sure AC_CONFIG_HEADERS is not called before.
AC_BEFORE([AM_INIT_AUTOMAKE], [AC_CONFIG_HEADERS])dnl
dnl Save the previous AC_CONFIG_HEADERS definition
-m4_rename([AC_CONFIG_HEADERS], [_AM_AC_CONFIG_HEADERS])dnl
-dnl Setup ours.
+dnl (Beware: this must be m4_copy, not m4_rename, because we will
+dnl lose the --trace bit of AC_CONFIG_HEADERS if we undefine it.)
+m4_copy([AC_CONFIG_HEADERS], [_AM_AC_CONFIG_HEADERS])dnl
+dnl Override AC_CONFIG_HEADERS with ours.
dnl (Don't use m4_copy because we are tracing AM_CONFIG_HEADER.)
AC_DEFUN([AC_CONFIG_HEADERS], [AM_CONFIG_HEADER($][@)])dnl
])
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.406
diff -u -r1.406 Makefile.am
--- tests/Makefile.am 12 Jun 2002 07:52:34 -0000 1.406
+++ tests/Makefile.am 13 Jun 2002 19:42:25 -0000
@@ -30,6 +30,7 @@
ansi7.test \
ar.test \
asm.test \
+autoheader.test \
auxdir.test \
auxdir2.test \
backsl.test \
Index: tests/autoheader.test
===================================================================
RCS file: tests/autoheader.test
diff -N tests/autoheader.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/autoheader.test 13 Jun 2002 19:42:25 -0000
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Check that autoheaders works, despite our AC_CONFIG_HEADERS hack.
+
+. $srcdir/defs
+
+set -e
+
+cat >>configure.in <<EOF
+AC_CONFIG_HEADERS([thisfile.h])
+EOF
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOHEADER
+
+test -f thisfile.h.in
Index: tests/defs
===================================================================
RCS file: /cvs/automake/automake/tests/defs,v
retrieving revision 1.50
diff -u -r1.50 defs
--- tests/defs 10 Jun 2002 09:39:14 -0000 1.50
+++ tests/defs 13 Jun 2002 19:42:26 -0000
@@ -83,6 +83,7 @@
# User can set which tools from Autoconf to use.
test -z "$AUTOCONF" && AUTOCONF=autoconf
+test -z "$AUTOHEADER" && AUTOHEADER=autoheader
echo "=== Running test $0"
--
Alexandre Duret-Lutz