]> sourceware.org Git - automake.git/commitdiff
Fix PR automake/49:
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 17 Apr 2004 18:46:05 +0000 (18:46 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 17 Apr 2004 18:46:05 +0000 (18:46 +0000)
* 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.

18 files changed:
ChangeLog
NEWS
automake.in
tests/Makefile.am
tests/Makefile.in
tests/auxdir.test
tests/auxdir2.test
tests/auxdir3.test [new file with mode: 0755]
tests/lex5.test
tests/mdate3.test
tests/multlib.test
tests/reqd2.test
tests/subobj3.test
tests/symlink.test
tests/txinfo22.test
tests/txinfo8.test
tests/yacc6.test
tests/yacc8.test

index 9122883ba6ca2da144cb6598c0f15163d4142341..bb1e15b5c5cd5d1e73e6e13a07289583bcb801ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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.
diff --git a/NEWS b/NEWS
index 44221972d09daa6e5598752113000c96c92326cd..58da99272b96cf882d65b41475f46f8edcdb6646 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,8 @@ New in 1.8a:
   (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:
 
index 00be104df4f83ce763fb6ab183d3940e91bce4a9..afdb051b424059b611b427c8a7628bf81f94f326 100755 (executable)
@@ -4596,7 +4596,7 @@ sub scan_autoconf_traces ($)
   while ($_ = $tracefh->getline)
     {
       chomp;
-      my ($here, @args) = split /::/;
+      my ($here, @args) = split (/::/);
       my $where = new Automake::Location $here;
       my $macro = $args[0];
 
@@ -4626,6 +4626,12 @@ sub scan_autoconf_traces ($)
        }
       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;
        }
index cebf448af64194380d133848e8212c26437e7e2b..817dff18f68ce15151fc1a1fcca94630fd2c2e4a 100644 (file)
@@ -53,6 +53,7 @@ autohdr3.test \
 autohdr4.test \
 auxdir.test \
 auxdir2.test \
+auxdir3.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
index f457c2b736cbed83f283eac67bcc8435df2efaaf..8583b2415230510cf49209b055a1961d5671e54c 100644 (file)
@@ -168,6 +168,7 @@ autohdr3.test \
 autohdr4.test \
 auxdir.test \
 auxdir2.test \
+auxdir3.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
index 2046d03c541d528487c957ec6776bfdcda3bd141..8feaea8bd55783cb388e1b7153c75b1236b1082c 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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'
index 4313825d906febba38ffb9bc7e28787c5d2489c5..5e1d766d417987f89fb3b4d7f1ce9189e673fac2 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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
diff --git a/tests/auxdir3.test b/tests/auxdir3.test
new file mode 100755 (executable)
index 0000000..f04ec36
--- /dev/null
@@ -0,0 +1,35 @@
+#! /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
index 60e36a2ce5322b0f95194ece5d1f33461e012fad..71554cddc0908d5cd4af74dc1d5c1123bfe1a756 100755 (executable)
@@ -25,8 +25,11 @@ required='gcc GNUmake gzip flex'
 
 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
index 177519f436f468567b3b92d273d259145c638b45..900ef5f21a3a82cf5cbcbde971e7a9de2cba6347 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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'
index 61c4f0a45642639f1a20045f56b721825de218d0..c64bce0f2ab5d57170385c3aa0ff3e5f7b44829c 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -26,9 +26,12 @@ required='gcc GNUmake'
 
 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
index 12cf1f45c5ba12b5ac4cd5cbdc14dd9dcb1b78a4..cce80231c8cd9f9e2befb50850253634863bca24 100755 (executable)
@@ -27,8 +27,11 @@ required='libtoolize'
 
 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])
index 925769525dfe7e345c0736e6238f5b6fbe07cbc8..7255392a4ef82788bc5077d3f635c1a31e37e689 100755 (executable)
@@ -1,5 +1,6 @@
 #! /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.
 #
@@ -25,9 +26,9 @@ required=gcc
 
 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
index 597336d9e5fe100e974ee71ccbb1044403cf547c..974edb6f778ba0ffc70390c384112284ecea3dc5 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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.
 #
@@ -30,8 +30,11 @@ rm -f mkinstalldirs
 
 : > 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
index a2cf051d263c5a9b92570a06c27c1145bfe954f3..8607431e7ecf16717cac1df44838e5fffc8fc2b1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -28,8 +28,11 @@ required='makeinfo tex'
 
 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
 
index edc9b117d6c9d37c6df9fff1a802831a970271c2..a429985642fc25b850a6591a65c1d42fb250cbe6 100755 (executable)
@@ -1,5 +1,6 @@
 #! /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.
 #
@@ -26,9 +27,9 @@
 
 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'
index 108bc20b63a3e53415d073ea2ab6ac61488c25a5..c25a2e5a1066538b80d086043722a3e28a5b6a76 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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.
 #
@@ -28,8 +28,11 @@ required='gcc bison'
 
 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])
index 40009b863468e4a4a7145d82edf0f3b890354fa4..5f1eaea6aae4df6cf79b2b4fa6d92e5db4d0ceb2 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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.
 #
@@ -26,8 +26,11 @@ required="gcc bison"
 
 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
This page took 0.069729 seconds and 5 git commands to generate.