automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: diagnose misplaced AC_CONFIG_AUX_DIR (PR/49)


From: Alexandre Duret-Lutz
Subject: FYI: diagnose misplaced AC_CONFIG_AUX_DIR (PR/49)
Date: Sat, 17 Apr 2004 20:45:48 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

I'm installing this on HEAD and closing the PR.

2004-04-17  Alexandre Duret-Lutz  <address@hidden>

        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.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.266
diff -u -r1.266 NEWS
--- NEWS        15 Apr 2004 07:51:46 -0000      1.266
+++ NEWS        17 Apr 2004 18:42:59 -0000
@@ -42,6 +42,8 @@
   (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)
+
 
 New in 1.8:
 
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1552
diff -u -r1.1552 automake.in
--- automake.in 12 Apr 2004 22:16:21 -0000      1.1552
+++ automake.in 17 Apr 2004 18:43:03 -0000
@@ -4596,7 +4596,7 @@
   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 @@
        }
       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: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.555
diff -u -r1.555 Makefile.am
--- tests/Makefile.am   15 Apr 2004 07:51:47 -0000      1.555
+++ tests/Makefile.am   17 Apr 2004 18:43:05 -0000
@@ -53,6 +53,7 @@
 autohdr4.test \
 auxdir.test \
 auxdir2.test \
+auxdir3.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
Index: tests/auxdir.test
===================================================================
RCS file: /cvs/automake/automake/tests/auxdir.test,v
retrieving revision 1.7
diff -u -r1.7 auxdir.test
--- tests/auxdir.test   14 Nov 2003 21:25:58 -0000      1.7
+++ tests/auxdir.test   17 Apr 2004 18:43:05 -0000
@@ -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.
 #
@@ -23,8 +23,11 @@
 . ./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: tests/auxdir2.test
===================================================================
RCS file: /cvs/automake/automake/tests/auxdir2.test,v
retrieving revision 1.4
diff -u -r1.4 auxdir2.test
--- tests/auxdir2.test  14 Nov 2003 21:25:58 -0000      1.4
+++ tests/auxdir2.test  17 Apr 2004 18:43:05 -0000
@@ -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.
 #
@@ -24,8 +24,11 @@
 . ./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
Index: tests/auxdir3.test
===================================================================
RCS file: tests/auxdir3.test
diff -N tests/auxdir3.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/auxdir3.test  17 Apr 2004 18:43:05 -0000
@@ -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: tests/lex5.test
===================================================================
RCS file: /cvs/automake/automake/tests/lex5.test,v
retrieving revision 1.7
diff -u -r1.7 lex5.test
--- tests/lex5.test     22 Jan 2004 22:11:04 -0000      1.7
+++ tests/lex5.test     17 Apr 2004 18:43:06 -0000
@@ -25,8 +25,11 @@
 
 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: tests/mdate3.test
===================================================================
RCS file: /cvs/automake/automake/tests/mdate3.test,v
retrieving revision 1.5
diff -u -r1.5 mdate3.test
--- tests/mdate3.test   14 Nov 2003 21:25:59 -0000      1.5
+++ tests/mdate3.test   17 Apr 2004 18:43:06 -0000
@@ -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.
 #
@@ -22,8 +22,11 @@
 
 . ./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: tests/multlib.test
===================================================================
RCS file: /cvs/automake/automake/tests/multlib.test,v
retrieving revision 1.1
diff -u -r1.1 multlib.test
--- tests/multlib.test  23 Jul 2003 21:04:17 -0000      1.1
+++ tests/multlib.test  17 Apr 2004 18:43:06 -0000
@@ -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 @@
 
 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: tests/reqd2.test
===================================================================
RCS file: /cvs/automake/automake/tests/reqd2.test,v
retrieving revision 1.3
diff -u -r1.3 reqd2.test
--- tests/reqd2.test    12 Apr 2004 22:16:22 -0000      1.3
+++ tests/reqd2.test    17 Apr 2004 18:43:06 -0000
@@ -27,8 +27,11 @@
 
 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: tests/subobj3.test
===================================================================
RCS file: /cvs/automake/automake/tests/subobj3.test,v
retrieving revision 1.15
diff -u -r1.15 subobj3.test
--- tests/subobj3.test  14 Nov 2003 21:26:01 -0000      1.15
+++ tests/subobj3.test  17 Apr 2004 18:43:06 -0000
@@ -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 @@
 
 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: tests/symlink.test
===================================================================
RCS file: /cvs/automake/automake/tests/symlink.test,v
retrieving revision 1.6
diff -u -r1.6 symlink.test
--- tests/symlink.test  3 Jul 2003 18:58:50 -0000       1.6
+++ tests/symlink.test  17 Apr 2004 18:43:06 -0000
@@ -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 @@
 
 : > 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: tests/txinfo22.test
===================================================================
RCS file: /cvs/automake/automake/tests/txinfo22.test,v
retrieving revision 1.2
diff -u -r1.2 txinfo22.test
--- tests/txinfo22.test 29 Nov 2003 18:02:40 -0000      1.2
+++ tests/txinfo22.test 17 Apr 2004 18:43:06 -0000
@@ -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 @@
 
 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: tests/txinfo8.test
===================================================================
RCS file: /cvs/automake/automake/tests/txinfo8.test,v
retrieving revision 1.2
diff -u -r1.2 txinfo8.test
--- tests/txinfo8.test  14 Nov 2003 21:26:01 -0000      1.2
+++ tests/txinfo8.test  17 Apr 2004 18:43:06 -0000
@@ -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: tests/yacc6.test
===================================================================
RCS file: /cvs/automake/automake/tests/yacc6.test,v
retrieving revision 1.6
diff -u -r1.6 yacc6.test
--- tests/yacc6.test    18 Nov 2003 20:06:44 -0000      1.6
+++ tests/yacc6.test    17 Apr 2004 18:43:06 -0000
@@ -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 @@
 
 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: tests/yacc8.test
===================================================================
RCS file: /cvs/automake/automake/tests/yacc8.test,v
retrieving revision 1.13
diff -u -r1.13 yacc8.test
--- tests/yacc8.test    18 Nov 2003 20:06:44 -0000      1.13
+++ tests/yacc8.test    17 Apr 2004 18:43:06 -0000
@@ -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 @@
 
 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

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]