From: Alexandre Duret-Lutz Date: Sat, 6 Jul 2002 12:11:12 +0000 (+0000) Subject: * m4/header.m4 (AM_CONFIG_HEADER): New macro. X-Git-Tag: Release-1-6b~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f52f319373aa7d4b4c5c41376308a60063ce559d;p=thirdparty%2Fautomake.git * m4/header.m4 (AM_CONFIG_HEADER): New macro. * tests/confh5.test: Make sure that Autoconf complains if AM_CONFIG_HEADER or AC_CONFIG_HEADERS is called before AM_INIT_AUTOMAKE. --- diff --git a/ChangeLog b/ChangeLog index 0b9a98eb1..994177a7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-07-06 Alexandre Duret-Lutz + + * m4/header.m4 (AM_CONFIG_HEADER): New macro. + * tests/confh5.test: Make sure that Autoconf complains if + AM_CONFIG_HEADER or AC_CONFIG_HEADERS is called before + AM_INIT_AUTOMAKE. + 2002-07-06 Alexandre Duret-Lutz * lib/Automake/Channels.pm: New file. diff --git a/m4/header.m4 b/m4/header.m4 index 850341b32..9f2e2348f 100644 --- a/m4/header.m4 +++ b/m4/header.m4 @@ -76,6 +76,11 @@ AC_DEFUN([_AM_CONFIG_HEADERS], [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) ])# _AM_CONFIG_HEADERS +# This is a false definition of AM_CONFIG_HEADER that will be +# overridden by the real definition when _AM_CONFIG_HEADER_INSINUATE +# is called (i.e. during AM_INIT_AUTOMAKE). +AC_DEFUN([AM_CONFIG_HEADER], +[m4_fatal([AM_CONFIG_HEADER called before AM_INIT_AUTOMAKE])]) # _AM_CONFIG_HEADER_INSINUATE # --------------------------- diff --git a/tests/confh5.test b/tests/confh5.test index a91b0ee51..4e460da71 100755 --- a/tests/confh5.test +++ b/tests/confh5.test @@ -1,19 +1,36 @@ #! /bin/sh -# Make sure Autoconf complains if AC_CONFIG_HEADERS appears -# before AM_INIT_AUTOMAKE. +# Make sure that calling AM_CONFIG_HEADER or AC_CONFIG_HEADERS +# before AM_INIT_AUTOMAKE is not allowed and that the error +# message says so. . $srcdir/defs || exit 1 cat > configure.in << 'END' -AC_INIT +AC_INIT(nonesuch, nonesuch) AC_CONFIG_HEADERS(config.h) -AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AM_INIT_AUTOMAKE AC_OUTPUT END : > config.h.in $ACLOCAL || exit 1 -$AUTOCONF 2>&1 | grep AC_CONFIG_HEADERS || exit 1 -: +# Autoconf (at least up to 2.53) treats this error as a warning. +# Hence we don't `&& exit 1'. +$AUTOCONF >output 2>&1 +cat output +grep 'AC_CONFIG_HEADERS.*before.*AM_INIT_AUTOMAKE' output || exit 1 + + +cat > configure.in << 'END' +AC_INIT(nonesuch, nonesuch) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE +AC_OUTPUT +END + +$ACLOCAL || exit 1 +$AUTOCONF >output 2>&1 && exit 1 +cat output +grep 'AM_CONFIG_HEADER.*before.*AM_INIT_AUTOMAKE' output || exit 1