This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: Makefile.am -vs- `gcj -C' failure
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: Makefile.am -vs- `gcj -C' failure
- From: Tom Tromey <tromey at redhat dot com>
- Date: 25 Jul 2001 11:04:26 -0600
- Reply-To: tromey at redhat dot com
Bryce pointed out that `make' in libgcj will keep going even if a
bytecode compilation fails. This patch fixes the problem. I'm
checking this in on the trunk.
The problem was that the `while' was being run in a subshell, so the
test at the end always saw `$fail' as `no'. Putting the while and the
test into a subshell fixes this.
Tested on my x86 RH Linux 6.2 box.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (libgcj.jar): Correctly fail when bytecode
compilation fails.
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.157
diff -u -r1.157 Makefile.am
--- Makefile.am 2001/07/23 20:01:28 1.157
+++ Makefile.am 2001/07/25 16:35:31
@@ -180,12 +180,12 @@
@: $(shell echo Creating list of files to compile...) $(shell rm -f tmp-list || :) $(shell touch tmp-list) $(foreach source,$?,$(shell echo $(source) >> tmp-list))
@set fnord $(MAKEFLAGS); amf=$$2; fail=no; \
javac="$(JAVAC)"; \
- cat tmp-list | while read f; do \
+ cat tmp-list | (while read f; do \
echo $$javac $(JCFLAGS) -classpath $(here):$(srcdir) -d $(here) $$f; \
$$javac $(JCFLAGS) -classpath $(here):$(srcdir) -d $(here) $$f \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \
done; \
- test "$$fail" = no
+ test "$$fail" = no)
-@rm -f tmp-list libgcj.jar
## Note that we explicitly want to include directory information.
find java gnu org -type d -o -type f -name '*.class' | \
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.in,v
retrieving revision 1.168
diff -u -r1.168 Makefile.in
--- Makefile.in 2001/07/23 20:01:28 1.168
+++ Makefile.in 2001/07/25 16:35:33
@@ -2454,12 +2454,12 @@
@: $(shell echo Creating list of files to compile...) $(shell rm -f tmp-list || :) $(shell touch tmp-list) $(foreach source,$?,$(shell echo $(source) >> tmp-list))
@set fnord $(MAKEFLAGS); amf=$$2; fail=no; \
javac="$(JAVAC)"; \
- cat tmp-list | while read f; do \
+ cat tmp-list | (while read f; do \
echo $$javac $(JCFLAGS) -classpath $(here):$(srcdir) -d $(here) $$f; \
$$javac $(JCFLAGS) -classpath $(here):$(srcdir) -d $(here) $$f \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \
done; \
- test "$$fail" = no
+ test "$$fail" = no)
-@rm -f tmp-list libgcj.jar
find java gnu org -type d -o -type f -name '*.class' | \
sed -e '/\/\./d' -e '/\/xlib/d' | \