From 26de384ed94b8277523f3f60068e53b2b01036df Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 9 Dec 2004 22:07:45 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ THANKS | 1 + lib/am/java.am | 4 ++-- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/java3.test | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 60 insertions(+), 2 deletions(-) create mode 100755 tests/java3.test diff --git a/ChangeLog b/ChangeLog index 5de9895ae..c5db82dda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-12-09 Alexandre Duret-Lutz + 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 6bc07be0f..0a4f3df5c 100644 --- 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 diff --git a/lib/am/java.am b/lib/am/java.am index 723df3c23..736035c24 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 527c19e26..6753ccbba 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -270,6 +270,7 @@ interp.test \ interp2.test \ java.test \ java2.test \ +java3.test \ javaprim.test \ javasubst.test \ ldadd.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 79f0e885b..da127626d 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..d4c13d158 --- /dev/null +++ b/tests/java3.test @@ -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 -- 2.47.2