Fixes automake bug#8461.
* automake.in (handle_java): Remove inappropriate "java" argument
from the calls to `&am_install_var' and `&am_primary_prefixes'.
* tests/instdir-java.test (Makefile.am): Define `$(javadir)'.
* tests/javadir-undefined.test: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS: Update.
+2011-09-18 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ java: complain if java_JAVA is used but $(javadir) is undefined
+ Fixes automake bug#8461.
+ * automake.in (handle_java): Remove inappropriate "java" argument
+ from the calls to `&am_install_var' and `&am_primary_prefixes'.
+ * tests/instdir-java.test (Makefile.am): Define `$(javadir)'.
+ * tests/javadir-undefined.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+ * NEWS: Update.
+
2011-09-12 Stefano Lattarini <stefano.lattarini@gmail.com>
cosmetics: fix various typos and grammaros
- Java sources specified with check_JAVA are not compiled anymore upon
"make all", but only upon "make check".
+ - An usage like "java_JAVA = foo.java" will now cause Automake to warn
+ and error out if `javadir' is undefined, instead of silently producing
+ a broken Makefile.in.
+
- Now aclocal and automake, when they've to spawn autoconf or autom4te
processes, honour the configure-time definitions of AUTOCONF and
AUTOM4TE.
{
my @sourcelist = &am_install_var ('-candist',
'java', 'JAVA',
- 'java', 'noinst', 'check');
+ 'noinst', 'check');
return if ! @sourcelist;
my @prefixes = am_primary_prefixes ('JAVA', 1,
- 'java', 'noinst', 'check');
+ 'noinst', 'check');
my $dir;
my @java_sources = ();
java3.test \
java-check.test \
java-empty-classpath.test \
+javadir-undefined.test \
javaprim.test \
javasubst.test \
java-clean.test \
java3.test \
java-check.test \
java-empty-classpath.test \
+javadir-undefined.test \
javaprim.test \
javasubst.test \
java-clean.test \
END
cat >Makefile.am <<'END'
+javadir = $(datarootdir)/java
java_JAVA = foo.java
END
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program 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.
+#
+# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Use of JAVA primary should not allow the use of the `java_' prefix
+# when $(javadir) is undefined. Otherwise, we could silently end up
+# with a broken Makefile.in (where "make install" doesn't install
+# the *.class files).
+# See automake bug#8461.
+
+. ./defs || Exit 1
+
+set -e
+
+$ACLOCAL
+
+echo java_JAVA = a.java > Makefile.am
+AUTOMAKE_fails
+grep '^Makefile\.am:1:.*java_JAVA.*javadir.* undefined' stderr
+$EGREP '(uninitialized|line) ' stderr && Exit 1
+
+echo javadir = a-dummy-value >> Makefile.am
+$AUTOMAKE
+
+: