automake-patches
[Top][All Lists]
Advanced

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

FYI: patch for PR/294


From: Alexandre Duret-Lutz
Subject: FYI: patch for PR/294
Date: Tue, 05 Mar 2002 17:53:51 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i386-debian-linux-gnu)

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:
>>> "Tom" == Tom Tromey <address@hidden> writes:
[...]
 Tom> PR 294 is a regression, but maybe not an important one.
[...]
 adl> Fortunately it seems it can be fixed easily (by listing all
 adl> standard directories in the relevant sub).  I'll try to do that.

Here is what I'll commit (make check is running).

Another idea would be to replace `exists $standard_prefix{$X}'
by `$var_is_am{"${X}dir"}', but this would stop working when
using traces.

Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1772
diff -u -r1.1772 ChangeLog
--- ChangeLog   2002/03/05 14:36:36     1.1772
+++ ChangeLog   2002/03/05 16:38:39
@@ -1,3 +1,13 @@
+2002-03-05  Alexandre Duret-Lutz  <address@hidden>
+
+       Fix for PR automake/294:
+       * tests/dirforbid.test: New file.
+       * tests/Makefile.am (TESTS): Add it.
+       * automake.in (standard_prefix): New hash.
+       (am_primary_prefixes): Forbid standard_prefixes which are not
+       explicitely allowed.
+       * automake.texi (Uniform): Remove FIXME.
+
 2002-03-05  Jim Meyering  <address@hidden>
 
        * automake.in (@common_files): Add config.rpath.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1279
diff -u -r1.1279 automake.in
--- automake.in 2002/03/05 14:34:36     1.1279
+++ automake.in 2002/03/05 16:38:42
@@ -215,6 +215,15 @@
 my @common_sometimes =
     qw(aclocal.m4 acconfig.h config.h.top config.h.bot stamp-vti);
 
+# Standard directories from the GNU Coding Standards, and additional
+# pkg* directories from Automake.  Stored in a hash for fast member check.
+my %standard_prefix =
+    map { $_ => 1 } (qw(bin data exec include info lib libexec lisp
+                       localstate man man1 man2 man3 man4 man5 man6
+                       man7 man8 man9 oldinclude pkgdatadir
+                       pkgincludedir pkglibdir sbin sharedstate
+                       sysconf));
+
 # Copyright on generated Makefile.ins.
 my $gen_copyright = "\
 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
@@ -7670,7 +7679,10 @@
                            "invalid variable `$varname': `dist' is forbidden")
                  if ! exists $configure_vars{$varname};
            }
-           elsif (! defined $valid{$X} && ! variable_defined ("${X}dir"))
+           # A not-explicitely-allowed prefix X is allowed if Xdir
+           # has been defined and X is not a standard prefix.
+           elsif (! defined $valid{$X} && (! variable_defined ("${X}dir")
+                                           || exists $standard_prefix{$X}))
            {
                # Note that a configure variable is always legitimate.
                # It is natural to name such variables after the
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.267
diff -u -r1.267 automake.texi
--- automake.texi       2002/02/20 18:10:19     1.267
+++ automake.texi       2002/03/05 16:38:49
@@ -423,11 +423,6 @@
 
 Not every sort of object can be installed in every directory.  Automake
 will flag those attempts it finds in error.
address@hidden FIXME: This is broken today: &am_primary_prefix will allow 
data_PROGRAMS
address@hidden because $datadir is defined before Makefile.am is parsed.  This
address@hidden means that passing the list of allowed directory suffix to
address@hidden &am_install_var or &am_primary_prefix is absolutely useless 
(except
address@hidden for 'noinst', 'check' and friends).
 Automake will also diagnose obvious misspellings in directory names.
 
 @cindex Extending list of installation directories
Index: stamp-vti
===================================================================
RCS file: /cvs/automake/automake/stamp-vti,v
retrieving revision 1.166
diff -u -r1.166 stamp-vti
--- stamp-vti   2002/02/25 11:00:30     1.166
+++ stamp-vti   2002/03/05 16:38:51
@@ -1,4 +1,4 @@
address@hidden UPDATED 21 February 2002
address@hidden UPDATED-MONTH February 2002
address@hidden UPDATED 5 March 2002
address@hidden UPDATED-MONTH March 2002
 @set EDITION 1.5e
 @set VERSION 1.5e
Index: version.texi
===================================================================
RCS file: /cvs/automake/automake/version.texi,v
retrieving revision 1.239
diff -u -r1.239 version.texi
--- version.texi        2002/02/25 11:00:31     1.239
+++ version.texi        2002/03/05 16:38:51
@@ -1,4 +1,4 @@
address@hidden UPDATED 21 February 2002
address@hidden UPDATED-MONTH February 2002
address@hidden UPDATED 5 March 2002
address@hidden UPDATED-MONTH March 2002
 @set EDITION 1.5e
 @set VERSION 1.5e
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.377
diff -u -r1.377 Makefile.am
--- Makefile.am 2002/02/25 11:00:34     1.377
+++ Makefile.am 2002/03/05 16:38:54
@@ -119,6 +119,7 @@
 depend2.test \
 depend3.test \
 depend4.test \
+dirforbid.test \
 dirname.test \
 discover.test \
 distcommon.test \
@@ -177,7 +178,6 @@
 java.test \
 javaprim.test \
 javasubst.test \
-listval.test \
 ldadd.test \
 ldflags.test \
 lex.test \
@@ -206,6 +206,7 @@
 link_f_cxx.test        \
 link_f_only.test \
 lisp.test \
+listval.test \
 ltdeps.test \
 ltlibobjs.test \
 make.test \
@@ -219,10 +220,10 @@
 mkinst2.test \
 mkinstall.test \
 nobase.test \
-nodep.test \
-nodepcomp.test \
 nodefine.test \
 nodefine2.test \
+nodep.test \
+nodepcomp.test \
 nodist.test \
 nodist2.test \
 noinst.test \
@@ -250,6 +251,9 @@
 pluseq8.test \
 ppf77.test \
 pr2.test \
+pr9.test \
+pr72.test \
+pr87.test \
 pr204.test \
 pr211.test \
 pr220.test \
@@ -260,9 +264,6 @@
 pr279.test \
 pr279-2.test \
 pr287.test \
-pr9.test \
-pr72.test \
-pr87.test \
 prefix.test \
 primary.test \
 primary2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.489
diff -u -r1.489 Makefile.in
--- Makefile.in 2002/02/25 11:00:34     1.489
+++ Makefile.in 2002/03/05 16:38:54
@@ -194,6 +194,7 @@
 depend2.test \
 depend3.test \
 depend4.test \
+dirforbid.test \
 dirname.test \
 discover.test \
 distcommon.test \
@@ -252,7 +253,6 @@
 java.test \
 javaprim.test \
 javasubst.test \
-listval.test \
 ldadd.test \
 ldflags.test \
 lex.test \
@@ -281,6 +281,7 @@
 link_f_cxx.test        \
 link_f_only.test \
 lisp.test \
+listval.test \
 ltdeps.test \
 ltlibobjs.test \
 make.test \
@@ -294,10 +295,10 @@
 mkinst2.test \
 mkinstall.test \
 nobase.test \
-nodep.test \
-nodepcomp.test \
 nodefine.test \
 nodefine2.test \
+nodep.test \
+nodepcomp.test \
 nodist.test \
 nodist2.test \
 noinst.test \
@@ -325,6 +326,9 @@
 pluseq8.test \
 ppf77.test \
 pr2.test \
+pr9.test \
+pr72.test \
+pr87.test \
 pr204.test \
 pr211.test \
 pr220.test \
@@ -335,9 +339,6 @@
 pr279.test \
 pr279-2.test \
 pr287.test \
-pr9.test \
-pr72.test \
-pr87.test \
 prefix.test \
 primary.test \
 primary2.test \
Index: tests/dirforbid.test
===================================================================
RCS file: dirforbid.test
diff -N dirforbid.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ dirforbid.test      Tue Mar  5 08:38:54 2002
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# All primaries cannot be used with all directories.
+# Automake should flag them as errors.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+END
+
+# Try some (not all) disallowed variables
+for i in data_PROGRAMS lib_HEADERS ; do
+  cat > Makefile.am << END
+$i = foo
+END
+  $ACLOCAL
+  $AUTOMAKE -a && exit 1
+done
+:

-- 
Alexandre Duret-Lutz




reply via email to

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