Fix PR automake/441:
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 9 Dec 2004 22:07:45 +0000 (22:07 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 9 Dec 2004 22:07:45 +0000 (22:07 +0000)
* lib/am/java.am (install-%DIR%JAVA, uninstall-%DIR%JAVA): Do
not install *.class if "$(%DIR%_JAVA)" is empty.
* tests/java3.test: New file.
* tests/Makefile.am (TESTS): Add it.
Report from Johannes Nicolai.

ChangeLog
THANKS
lib/am/java.am
tests/Makefile.am
tests/Makefile.in
tests/java3.test [new file with mode: 0755]

index 5de9895..c5db82d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-12-09  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       Fix PR automake/441:
+       * lib/am/java.am (install-%DIR%JAVA, uninstall-%DIR%JAVA): Do
+       not install *.class if "$(%DIR%_JAVA)" is empty.
+       * tests/java3.test: New file.
+       * tests/Makefile.am (TESTS): Add it.
+       Report from Johannes Nicolai.
+
        * doc/automake.texi (Java): Mention dist_ and add an example.
        * tests/java.test: Do actually compile java files and run distcheck.
 
diff --git a/THANKS b/THANKS
index 6bc07be..0a4f3df 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -114,6 +114,7 @@ Jochen Kuepper              jochen@uni-duesseldorf.de
 Joel N. Weber II       nemo@koa.iolani.honolulu.hi.us
 Joerg-Martin Schwarz   jms@jms.prima.ruhr.de
 Johan Danielsson       joda@pdc.kth.se
+Johannes Nicolai       johannes.nicolai@student.hpi.uni-potsdam.de
 John Pierce            hawkfan@pyrotechnics.com
 John W. Coomes         jcoomes@eng.Sun.COM
 Josh MacDonald         jmacd@cs.berkeley.edu
index 723df3c..736035c 100644 (file)
@@ -48,7 +48,7 @@ install-%DIR%JAVA: class%DIR%.stamp
 ## A single .java file can be compiled into multiple .class files.  So
 ## we just install all the .class files that got built into this
 ## directory.  This is not optimal, but will have to do for now.
-       for p in *.class; do \
+       @test -z "$(%DIR%_JAVA)" || for p in *.class; do \
          echo " $(INSTALL_DATA) '$$p' '$(DESTDIR)$(%NDIR%dir)/$$p'"; \
          $(INSTALL_DATA) "$$p" "$(DESTDIR)$(%NDIR%dir)/$$p"; \
        done
@@ -63,7 +63,7 @@ if %?INSTALL%
 .PHONY uninstall-am: uninstall-%DIR%JAVA
 uninstall-%DIR%JAVA:
        @$(NORMAL_UNINSTALL)
-       @for p in *.class; do \
+       @test -z "$(%DIR%_JAVA)" || for p in *.class; do \
          echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$p'"; \
          rm -f "$(DESTDIR)$(%NDIR%dir)/$$p"; \
        done
index 527c19e..6753ccb 100644 (file)
@@ -270,6 +270,7 @@ interp.test \
 interp2.test \
 java.test \
 java2.test \
+java3.test \
 javaprim.test \
 javasubst.test \
 ldadd.test \
index 79f0e88..da12762 100644 (file)
@@ -389,6 +389,7 @@ interp.test \
 interp2.test \
 java.test \
 java2.test \
+java3.test \
 javaprim.test \
 javasubst.test \
 ldadd.test \
diff --git a/tests/java3.test b/tests/java3.test
new file mode 100755 (executable)
index 0000000..d4c13d1
--- /dev/null
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 2004  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure that Java rules don't attempt to install *.java files when
+# there are none.
+# Report from Johannes Nicolai (PR/441).
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([WHO_CARES], false)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+if WHO_CARES
+JAVA_FILES = MyClass1.java
+endif
+
+dist_pkgdata_JAVA = $(JAVA_FILES)
+END
+
+: >MyClass1.java
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE distcheck