]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix for PR automake/291:
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 8 Jul 2002 19:41:24 +0000 (19:41 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 8 Jul 2002 19:41:24 +0000 (19:41 +0000)
* automake.in (macro_define): Catch variable names starting
with `_'.
(handle_installdirs): Rename _am_installdirs to am__installdirs.
* lib/am/data.am, lib/am/install.am, lib/am/libs.am,
lib/am/lisp.am, lib/am/ltlibs.am, lib/am/mans.am,
lib/am/progs.am, lib/am/python.am, lib/am/scripts.am,
lib/am/texinfos.am: Likewise.
* tests/canon5.test: Use -Wno-portability.
* tests/vars2.test: New file.
* tests/Makefile.am (TESTS): Add vars2.test.

17 files changed:
ChangeLog
automake.in
lib/am/data.am
lib/am/install.am
lib/am/java.am
lib/am/libs.am
lib/am/lisp.am
lib/am/ltlib.am
lib/am/mans.am
lib/am/progs.am
lib/am/python.am
lib/am/scripts.am
lib/am/texinfos.am
tests/Makefile.am
tests/Makefile.in
tests/canon5.test
tests/vars2.test [new file with mode: 0755]

index 0a63bc314b7946b3095481d2c2b9a5757cfd8363..8f075c1164f35953223b47107b1a00a55d422ac8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-07-08  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       Fix for PR automake/291:
+       * automake.in (macro_define): Catch variable names starting
+       with `_'.
+       (handle_installdirs): Rename _am_installdirs to am__installdirs.
+       * lib/am/data.am, lib/am/install.am, lib/am/libs.am,
+       lib/am/lisp.am, lib/am/ltlibs.am, lib/am/mans.am,
+       lib/am/progs.am, lib/am/python.am, lib/am/scripts.am,
+       lib/am/texinfos.am: Likewise.
+       * tests/canon5.test: Use -Wno-portability.
+       * tests/vars2.test: New file.
+       * tests/Makefile.am (TESTS): Add vars2.test.
+
 2002-07-08  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * tests/defs (AUTOMAKE): Add -Wall.
index 84231bd707a19531ec5ead1003ce1d9684e11b1a..9b4775c32719c34e42a48a9ca4318f54363516ea 100755 (executable)
@@ -4371,8 +4371,8 @@ sub handle_installdirs ()
 {
     $output_rules .=
       &file_contents ('install',
-                     ('_am_installdirs'
-                      => variable_value ('_am_installdirs') || '',
+                     ('am__installdirs'
+                      => variable_value ('am__installdirs') || '',
                       'installdirs-local'
                       => (target_defined ('installdirs-local')
                           ? ' installdirs-local' : '')));
@@ -5927,9 +5927,14 @@ sub macro_define ($$$$$$)
 {
   my ($var, $var_is_am, $type, $cond, $value, $where) = @_;
 
-  err $where, "bad characters in macro name `$var'"
+  err $where, "bad characters in variable name `$var'"
     if $var !~ /$MACRO_PATTERN/o;
 
+  # NEWS-OS 4.2R complains if a Makefile variable begins with `_'.
+  msg ('portability', $where,
+       "$var: variable names starting with `_' are not portable")
+    if $var =~ /^_/;
+
   $cond ||= 'TRUE';
 
   # An Automake variable must be consistently defined with the same
index 3187e06891ba5c587d3902198fc3ae57e37268b6..49e133d5a05c9e038aea7dd20f7e62b70dede493 100644 (file)
@@ -21,7 +21,7 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%%PRIMARY%_INSTALL = $(INSTALL_%ONE_PRIMARY%)
 ?!BASE?%DIR%%PRIMARY%_INSTALL = $(install_sh_DATA)
 ?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
index 1f3351eee2ea46f584d7bf0ed0fc1abac52bdaf7..f45a8ec00f12351a43991213d2bc179df1536f92 100644 (file)
 ?SUBDIRS?.PHONY: installdirs installdirs-am installdirs-recursive
 ?SUBDIRS?installdirs: installdirs-recursive
 ?SUBDIRS?installdirs-am:%installdirs-local%
-?SUBDIRS??_am_installdirs?     $(mkinstalldirs) %_am_installdirs%
+?SUBDIRS??am__installdirs?     $(mkinstalldirs) %am__installdirs%
 
 ?!SUBDIRS?.PHONY: installdirs
 ?!SUBDIRS?installdirs:%installdirs-local%
-?!SUBDIRS??_am_installdirs?    $(mkinstalldirs) %_am_installdirs%
+?!SUBDIRS??am__installdirs?    $(mkinstalldirs) %am__installdirs%
 
 
 ## ----------------- ##
index 9fb5c72700825ea7df54e4c329237b3400527fa8..9e2f974d73a01530f7033bcb9a17fc5b6f50da2a 100644 (file)
@@ -40,7 +40,7 @@ class%DIR%.stamp: $(%DIR%_JAVA)
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?EXEC?.PHONY install-exec-am: install-%DIR%JAVA
 ?!EXEC?.PHONY install-data-am: install-%DIR%JAVA
 install-%DIR%JAVA: class%DIR%.stamp
index 906d5e5ee0727c4e9840c8395709f3eea335e8bb..ba7fd53cbda6ec562acb09098fa040a5da6102d8 100644 (file)
@@ -32,7 +32,7 @@ endif %?FIRST%
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%LIBRARIES_INSTALL = $(INSTALL_DATA)
 ?!BASE?%DIR%LIBRARIES_INSTALL = $(install_sh_DATA)
 ?EXEC?.PHONY install-exec-am: install-%DIR%LIBRARIES
index b0378613eee23fb787426f3cf0d7537ad9a7d0c5..fa7ed0308c41748600ff3815bc0a1da3333f26f9 100644 (file)
@@ -32,7 +32,7 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%LISP_INSTALL = $(INSTALL_DATA)
 ?!BASE?%DIR%LISP_INSTALL = $(install_sh_DATA)
 ?EXEC?.PHONY install-exec-am: install-%DIR%LISP
index d9044cc2d274b23cb8897cc77e54e0697dc20310..03c8e10d652874fbbb2c90148b5e26df060afe3a 100644 (file)
@@ -22,7 +22,7 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%LTLIBRARIES_INSTALL = $(INSTALL)
 ?!BASE?%DIR%LTLIBRARIES_INSTALL = $(install_sh) -c
 ?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
index b6fa21aa57b7a6228bbdb5945920502c1abdbdc7..9be711a9f437c793ce5cdad3066a3e6a7415f574 100644 (file)
@@ -27,7 +27,7 @@ man%SECTION%dir = $(mandir)/man%SECTION%
 
 .PHONY: install-man
 ?INSTALL-MAN?install-data-am: install-man
-?INSTALL-MAN?_am_installdirs += $(DESTDIR)$(man%SECTION%dir)
+?INSTALL-MAN?am__installdirs += $(DESTDIR)$(man%SECTION%dir)
 .PHONY install-man: install-man%SECTION%
 install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS)
        @$(NORMAL_INSTALL)
index 7b0b323af30b0e174b556977b3eda84d41d3b67f..b923e7f1ca585574f26931f17b2c5f058e0cf0a4 100644 (file)
@@ -23,7 +23,7 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%PROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 ?!BASE?%DIR%PROGRAMS_INSTALL = $(install_sh_PROGRAM)
 ?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
index cfe5d52baf1b0546fc337c6b4ccd9d853976d6d4..ddf6974e1c69fd1e8d53a23553d0c7ca7faa364f 100644 (file)
@@ -22,7 +22,7 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%PYTHON_INSTALL = $(INSTALL_DATA)
 ?!BASE?%DIR%PYTHON_INSTALL = $(install_sh_DATA)
 ?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON
index 0f5cd5d24ae7c00af3bc5fb971c9be7944572092..9d4ea7ba058ff0a215722d2a9e76a946c29d5871 100644 (file)
@@ -23,7 +23,7 @@
 
 if %?INSTALL%
 ## if doesn't work properly for Automake variables yet.
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?BASE?%DIR%SCRIPT_INSTALL = $(INSTALL_SCRIPT)
 ?!BASE?%DIR%SCRIPT_INSTALL = $(install_sh_SCRIPT)
 ?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
@@ -93,4 +93,3 @@ installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
          done; \
        done; rm -f c$${pid}_.???; exit $$bad
 endif %?CK-OPTS%
-
index 89c00fe39e6777b53ef41070d088e3e15edc78c1..59deefe111ec6871e912d01a093c15542a546f61 100644 (file)
@@ -101,7 +101,7 @@ endif ! %?LOCAL-TEXIS%
 ## is hard coded.
 if %?INSTALL-INFO%
 if %?LOCAL-TEXIS%
-_am_installdirs += $(DESTDIR)$(infodir)
+am__installdirs += $(DESTDIR)$(infodir)
 install-data-am: install-info-am
 endif %?LOCAL-TEXIS%
 if %?SUBDIRS%
index b4700009791000f485d61e3209f05f0968379671..415f058dc436fc9248eaf59a1320b1b729192057 100644 (file)
@@ -380,6 +380,7 @@ texinfo10.test \
 transform.test \
 unused.test \
 vars.test \
+vars2.test \
 vartar.test \
 version.test \
 version2.test \
index 33e5e8f3eddf8f5ae33da233b2519c13fa33cd4e..f1b97acca73f8f54fff52e53a21d7d0b49088b45 100644 (file)
@@ -467,6 +467,7 @@ texinfo10.test \
 transform.test \
 unused.test \
 vars.test \
+vars2.test \
 vartar.test \
 version.test \
 version2.test \
index b05ced44589bbba09988d8eb02b57c8d40a248f3..9102bfd9f61ea45d341e01507a77bb0bd144a229 100755 (executable)
@@ -20,18 +20,21 @@ bin_PROGRAMS = _foo
 _foo_SOURCES = foo.c
 END
 
-$AUTOMAKE || exit 1
+# Variables starting with `_' are not portable.
+$AUTOMAKE -Wno-portability || exit 1
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = ,foo
 ,foo_SOURCES = foo.c
 END
 
-$AUTOMAKE && exit 1
+# Variables starting with `_' are not portable.
+$AUTOMAKE -Wno-portability && exit 1
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = ,foo
 _foo_SOURCES = foo.c
 END
 
-$AUTOMAKE
+# Variables starting with `_' are not portable.
+$AUTOMAKE -Wno-portability
diff --git a/tests/vars2.test b/tests/vars2.test
new file mode 100755 (executable)
index 0000000..19cfcab
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# Check that Automake warns about variables starting with `_'.
+# PR/291
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >Makefile.am <<EOF
+GOOD_ = 1
+_BAD  = 2
+ _bad = 3
+EOF
+
+$ACLOCAL
+# Make sure this warning is print in the `portability' category.
+$AUTOMAKE -Wno-error -Wnone -Wportability 2>stderr
+cat stderr
+grep GOOD stderr && exit 1
+grep _BAD stderr
+grep _bad stderr