This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: Makefile.am -vs- `gcj -C' failure


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' | \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]