+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.
{
$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' : '')));
{
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
## ------------ ##
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%
?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%
## ----------------- ##
## ------------ ##
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
## ------------ ##
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
## ------------ ##
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
## ------------ ##
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
.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)
## ------------ ##
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
## ------------ ##
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
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
done; \
done; rm -f c$${pid}_.???; exit $$bad
endif %?CK-OPTS%
-
## 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%
transform.test \
unused.test \
vars.test \
+vars2.test \
vartar.test \
version.test \
version2.test \
transform.test \
unused.test \
vars.test \
+vars2.test \
vartar.test \
version.test \
version2.test \
_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
--- /dev/null
+#! /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