* 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 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ 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 <meyering@lucent.com>
* automake.in (@common_files): Add config.rpath.
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
"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
Not every sort of object can be installed in every directory. Automake
will flag those attempts it finds in error.
-@c FIXME: This is broken today: &am_primary_prefix will allow data_PROGRAMS
-@c because $datadir is defined before Makefile.am is parsed. This
-@c means that passing the list of allowed directory suffix to
-@c &am_install_var or &am_primary_prefix is absolutely useless (except
-@c for 'noinst', 'check' and friends).
Automake will also diagnose obvious misspellings in directory names.
@cindex Extending list of installation directories
-@set UPDATED 21 February 2002
-@set UPDATED-MONTH February 2002
+@set UPDATED 5 March 2002
+@set UPDATED-MONTH March 2002
@set EDITION 1.5e
@set VERSION 1.5e
depend2.test \
depend3.test \
depend4.test \
+dirforbid.test \
dirname.test \
discover.test \
distcommon.test \
java.test \
javaprim.test \
javasubst.test \
-listval.test \
ldadd.test \
ldflags.test \
lex.test \
link_f_cxx.test \
link_f_only.test \
lisp.test \
+listval.test \
ltdeps.test \
ltlibobjs.test \
make.test \
mkinst2.test \
mkinstall.test \
nobase.test \
-nodep.test \
-nodepcomp.test \
nodefine.test \
nodefine2.test \
+nodep.test \
+nodepcomp.test \
nodist.test \
nodist2.test \
noinst.test \
pluseq8.test \
ppf77.test \
pr2.test \
+pr9.test \
+pr72.test \
+pr87.test \
pr204.test \
pr211.test \
pr220.test \
pr279.test \
pr279-2.test \
pr287.test \
-pr9.test \
-pr72.test \
-pr87.test \
prefix.test \
primary.test \
primary2.test \
depend2.test \
depend3.test \
depend4.test \
+dirforbid.test \
dirname.test \
discover.test \
distcommon.test \
java.test \
javaprim.test \
javasubst.test \
-listval.test \
ldadd.test \
ldflags.test \
lex.test \
link_f_cxx.test \
link_f_only.test \
lisp.test \
+listval.test \
ltdeps.test \
ltlibobjs.test \
make.test \
mkinst2.test \
mkinstall.test \
nobase.test \
-nodep.test \
-nodepcomp.test \
nodefine.test \
nodefine2.test \
+nodep.test \
+nodepcomp.test \
nodist.test \
nodist2.test \
noinst.test \
pluseq8.test \
ppf77.test \
pr2.test \
+pr9.test \
+pr72.test \
+pr87.test \
pr204.test \
pr211.test \
pr220.test \
pr279.test \
pr279-2.test \
pr287.test \
-pr9.test \
-pr72.test \
-pr87.test \
prefix.test \
primary.test \
primary2.test \
--- /dev/null
+#! /bin/sh
+
+# All primaries cannot be used with all directories.
+# Automake should flag them as errors.
+# For PR/294
+
+. $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
+:
-@set UPDATED 21 February 2002
-@set UPDATED-MONTH February 2002
+@set UPDATED 5 March 2002
+@set UPDATED-MONTH March 2002
@set EDITION 1.5e
@set VERSION 1.5e