+2004-04-17 Alexandre Duret-Lutz <adl@gnu.org>
+
+ Fix PR automake/49:
+ * automake.in (scan_autoconf_traces) <AC_CONFIG_AUX_DIR>: Diagnose
+ calls to AC_CONFIG_AUX_DIR followings calls to AM_INIT_AUTOMAKE.
+ * tests/auxdir.test, tests/auxdir2.test, tests/lex5.test,
+ tests/mdate3.test, tests/multlib.test, tests/reqd2.test,
+ tests/symlink.test, tests/txinfo8.test, tests/txinfo22.test,
+ tests/yacc6.test, tests/yacc8.test: Fix to call AC_CONFIG_AUX_DIR
+ before AM_INIT_AUTOMAKE.
+ * tests/auxdir3.test: New file (exercise this diagnostic).
+ * tests/Makefile.am (TESTS): Add auxdir3.test.
+
2004-04-15 Alexandre Duret-Lutz <adl@gnu.org>
* aclocal.in (%map_traced_defs): New variable.
(Calls to AC_PROG_EGREP causing libtool.m4 to be included is the
most famous instance of this bug.)
+* Diagnose AC_CONFIG_AUX_DIR calls following AM_INIT_AUTOMAKE. (PR/49)
+
\f
New in 1.8:
while ($_ = $tracefh->getline)
{
chomp;
- my ($here, @args) = split /::/;
+ my ($here, @args) = split (/::/);
my $where = new Automake::Location $here;
my $macro = $args[0];
}
elsif ($macro eq 'AC_CONFIG_AUX_DIR')
{
+ if ($seen_init_automake)
+ {
+ error ($where, "AC_CONFIG_AUX_DIR must be called before "
+ . "AM_INIT_AUTOMAKE...", partial => 1);
+ error ($seen_init_automake, "... AM_INIT_AUTOMAKE called here");
+ }
$config_aux_dir = $args[1];
$config_aux_dir_set_in_configure_ac = 1;
}
autohdr4.test \
auxdir.test \
auxdir2.test \
+auxdir3.test \
backsl.test \
backsl2.test \
backsl3.test \
autohdr4.test \
auxdir.test \
auxdir2.test \
+auxdir3.test \
backsl.test \
backsl2.test \
backsl3.test \
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
# The "./." is here so we don't have to mess with subdirs.
-cat >> configure.in << 'END'
+cat > configure.in << 'END'
+AC_INIT([auxdir], [1.0])
AC_CONFIG_AUX_DIR(./.)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
END
cat > Makefile.am << 'END'
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
# The "./." is here so we don't have to mess with subdirs.
-cat >> configure.in << 'END'
+cat > configure.in << 'END'
+AC_INIT([auxdir2], [1.0])
AC_CONFIG_AUX_DIR($foo)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
END
: > Makefile.am
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2004 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test to make sure we diagnose misplaced AC_CONFIG_AUX_DIR.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_AUX_DIR(.)
+END
+
+: > Makefile.am
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'AC_CONFIG_AUX_DIR.*AM_INIT_AUTOMAKE' stderr
set -e
-cat >> configure.in << 'END'
+cat > configure.in << 'END'
+AC_INIT([lex5], [1.0])
AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_LEX
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
-cat >> configure.in << 'END'
-AC_CONFIG_AUX_DIR(foo)
+cat > configure.in << 'END'
+AC_INIT([mdate3], [1.0])
+AC_CONFIG_AUX_DIR([foo])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
END
cat > Makefile.am << 'END'
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
set -e
-cat >>configure.in <<'END'
+cat >configure.in <<'END'
+AC_INIT([multlib], [1.0])
AC_CONFIG_SRCDIR(libfoo/foo.c)
AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
AC_CONFIG_SUBDIRS(libfoo)
AC_CONFIG_SUBDIRS(libbar)
AC_OUTPUT
set -e
-cat >>configure.in <<'END'
+cat > configure.in << 'END'
+AC_INIT([req2], [1.0])
AC_CONFIG_AUX_DIR([autoconf])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
AC_PROG_CC
AM_PROG_LIBTOOL
AC_CONFIG_FILES([autoconf/Makefile main/Makefile])
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Foundation, Inc.
#
# This file is part of GNU Automake.
#
cat > configure.in << 'END'
AC_INIT(sub/hello.c)
-AM_INIT_AUTOMAKE(hello,0.23)
dnl Prevent automake from looking in .. and ../..
AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE(hello,0.23)
AC_PROG_CC
AM_PROG_CC_C_O
AM_C_PROTOTYPES
#! /bin/sh
-# Copyright (C) 1996, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
: > Makefile.am
-cat >> configure.in << 'END'
+cat > configure.in << 'END'
+AC_INIT([symlink], [1.0])
AC_CONFIG_AUX_DIR(sub)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
END
$ACLOCAL
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
set -e
-cat >>configure.in <<END
+cat > configure.in << 'END'
+AC_INIT([txinfo22], [1.0])
AC_CONFIG_AUX_DIR(aux)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Foundation, Inc.
#
# This file is part of GNU Automake.
#
cat > configure.in << 'END'
AC_INIT
+AC_CONFIG_AUX_DIR(sub)
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_OUTPUT(Makefile sub/Makefile)
-AC_CONFIG_AUX_DIR(sub)
END
cat > Makefile.am << 'END'
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
set -e
-cat >> configure.in << 'END'
+cat > configure.in << 'END'
+AC_INIT([yacc6], [1.0])
AC_CONFIG_AUX_DIR([aux])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
AC_PROG_CC
AC_PROG_YACC
AC_CONFIG_FILES([sub/Makefile])
#! /bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
set -e
-cat >> configure.in << 'END'
+cat > configure.in << 'END'
+AC_INIT([yacc8], [1.0])
AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_YACC