From f52f319373aa7d4b4c5c41376308a60063ce559d Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 6 Jul 2002 12:11:12 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ m4/header.m4 | 5 +++++ tests/confh5.test | 29 +++++++++++++++++++++++------ 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b9a98e..994177a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 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. * lib/Automake/Makefile.am (dist_perllib_DATA): Add Channels.pm. * automake.in: Use Automake::Channels and register some channels diff --git a/m4/header.m4 b/m4/header.m4 index 850341b..9f2e234 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 a91b0ee..4e460da 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 -- 2.7.4