changeset 1980:92838f870914

Cleanup #07: Remove source/target from javac.in, unset JAVA_HOME and QUIETLY. 2009-08-17 Andrew John Hughes <ahughes@redhat.com> * Makefile.am: Add variables for source, target and other javac settings so they are standardised across the build. Set JAVA_HOME and JDK_HOME to "" to avoid build failures. Set QUIETLY to "" to display HotSpot javac invocations. Remove duplicate javac invocations now targets depend on INITIAL_BOOTSTRAP_LINK_STAMP. * javac.in: Remove 1.7 setting. Add ecj_parms so same parameters are used for all ecj invocations. * patches/ecj/icedtea-hotspot-default.patch: Make SA_CLASSPATH contain the whole CLASSPATH and use SA_TOOLS_JAR and SA_RT_JAR for the individual files.
author Andrew John Hughes <ahughes@redhat.com>
date Fri, 21 Aug 2009 20:02:09 +0100
parents 939e978ee73a
children 26c1a149107b
files ChangeLog Makefile.am javac.in patches/ecj/icedtea-hotspot-default.patch
diffstat 4 files changed, 93 insertions(+), 104 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Aug 17 16:34:18 2009 +0100
+++ b/ChangeLog	Fri Aug 21 20:02:09 2009 +0100
@@ -1,3 +1,21 @@
+2009-08-17  Andrew John Hughes  <ahughes@redhat.com>
+
+	* Makefile.am:
+	Add variables for source, target and other
+	javac settings so they are standardised across
+	the build.  Set JAVA_HOME and JDK_HOME to ""
+	to avoid build failures.  Set QUIETLY to ""
+	to display HotSpot javac invocations. Remove
+	duplicate javac invocations now targets depend
+	on INITIAL_BOOTSTRAP_LINK_STAMP.
+	* javac.in:
+	Remove 1.7 setting.  Add ecj_parms so same
+	parameters are used for all ecj invocations.
+	* patches/ecj/icedtea-hotspot-default.patch:
+	Make SA_CLASSPATH contain the whole CLASSPATH
+	and use SA_TOOLS_JAR and SA_RT_JAR for the individual
+	files.
+
 2009-08-17  Andrew John Hughes  <ahughes@redhat.com>
 
 	* Makefile.am:
--- a/Makefile.am	Mon Aug 17 16:34:18 2009 +0100
+++ b/Makefile.am	Fri Aug 21 20:02:09 2009 +0100
@@ -76,6 +76,11 @@
 
 SOURCEPATH_DIRS = $(abs_top_builddir)/generated:$(OPENJDK_SOURCEPATH_DIRS)
 
+IT_LANGUAGE_SOURCE_VERSION=5
+IT_CLASS_TARGET_VERSION=5
+IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS)
+IT_JAVACFLAGS=$(IT_JAVAC_SETTINGS) -source $(IT_LANGUAGE_SOURCE_VERSION) -target $(IT_CLASS_TARGET_VERSION)
+
 # Top-Level Targets
 # =================
 
@@ -1567,6 +1572,9 @@
 	ALT_PARALLEL_COMPILE_JOBS="$(PARALLEL_JOBS)" \
 	HOTSPOT_BUILD_JOBS="$(PARALLEL_JOBS)" \
 	JAVAC="" \
+	JAVA_HOME="" \
+	JDK_HOME="" \
+	QUIETLY="" \
 	ANT_RESPECT_JAVA_HOME="TRUE" \
 	RHINO_JAR="$(RHINO_JAR)" \
 	DISTRIBUTION_ID="$(DIST_ID)" \
@@ -1651,6 +1659,9 @@
 	ALT_PARALLEL_COMPILE_JOBS="$(PARALLEL_JOBS)" \
 	HOTSPOT_BUILD_JOBS="$(PARALLEL_JOBS)" \
 	JAVAC="" \
+	JAVA_HOME="" \
+	JDK_HOME="" \
+	QUIETLY="" \
 	RHINO_JAR="$(RHINO_JAR)" \
 	JAR_KNOWS_ATFILE="$(JAR_KNOWS_ATFILE)" \
 	JAR_KNOWS_J_OPTIONS="$(JAR_KNOWS_J_OPTIONS)" \
@@ -3003,19 +3014,11 @@
 
 stamps/hotspot-tools-class-files.stamp: hotspot-tools-source-files.txt \
 	$(INITIAL_BOOTSTRAP_LINK_STAMP)
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-	then \
-	  $(JAVAC) $(MEMORY_LIMIT) -g -d lib/hotspot-tools \
-            -sourcepath \
-	      'hotspot-tools:$(abs_top_srcdir)/netx:$(SOURCEPATH_DIRS)' \
-            -bootclasspath \'\' @$< ; \
-	else \
-	  $(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) -g \
-	    -d lib/hotspot-tools \
-	    -sourcepath \
-	      'hotspot-tools:$(abs_top_srcdir)/netx:$(SOURCEPATH_DIRS)' \
-	    -bootclasspath \'\' @$< ; \
-	fi
+	$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) $(IT_JAVACFLAGS) \
+	  -d lib/hotspot-tools \
+	  -sourcepath \
+	    'hotspot-tools:$(abs_top_srcdir)/netx:$(SOURCEPATH_DIRS)' \
+	  -bootclasspath \'\' @$< ;
 	mkdir -p stamps
 	touch stamps/hotspot-tools-class-files.stamp
 
@@ -3028,17 +3031,10 @@
 # tools.jar
 bootstrap/jdk1.7.0/lib/tools.jar: stamps/hotspot-tools-class-files.stamp
 	mkdir -p bootstrap/jdk1.7.0/lib/
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-        then \
-	  $(JAR) cf $@ -C lib/hotspot-tools com -C lib/hotspot-tools sun \
-	    -C lib/hotspot-tools org -C lib/hotspot-tools java \
-	    -C lib/hotspot-tools javax ; \
-	else \
-	  $(ICEDTEA_BOOT_DIR)/bin/jar cf $@ -C lib/hotspot-tools com \
-	    -C lib/hotspot-tools sun \
-            -C lib/hotspot-tools org -C lib/hotspot-tools java \
-            -C lib/hotspot-tools javax ; \
-	fi
+	$(ICEDTEA_BOOT_DIR)/bin/jar cf $@ -C lib/hotspot-tools com \
+	  -C lib/hotspot-tools sun \
+          -C lib/hotspot-tools org -C lib/hotspot-tools java \
+          -C lib/hotspot-tools javax ;
 	if test -d bootstrap/ecj ; \
 	then \
 	  mkdir -p bootstrap/ecj/lib/; \
@@ -3053,18 +3049,10 @@
 
 stamps/rt-class-files.stamp: rt-source-files.txt stamps/hotspot-tools.stamp
 	mkdir -p lib/rt
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-        then \
-	  $(JAVAC) $(MEMORY_LIMIT) -g -d lib/rt \
-	    -classpath $(abs_top_builddir)/lib/hotspot-tools \
-	    -sourcepath '$(SOURCEPATH_DIRS)' \
-	    -bootclasspath \'\' @$< ; \
-	else \
-	  $(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) -g -d lib/rt \
-	    -classpath $(abs_top_builddir)/lib/hotspot-tools \
-            -sourcepath '$(SOURCEPATH_DIRS)' \
-            -bootclasspath \'\' @$< ; \
-	fi
+	$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) $(IT_JAVACFLAGS) -d lib/rt \
+	  -classpath $(abs_top_builddir)/lib/hotspot-tools \
+          -sourcepath '$(SOURCEPATH_DIRS)' \
+          -bootclasspath \'\' @$< ;
 	mkdir -p stamps
 	touch stamps/rt-class-files.stamp
 
@@ -3076,14 +3064,8 @@
 # rt-closed.jar.
 bootstrap/jdk1.7.0/jre/lib/rt-closed.jar: stamps/rt-class-files.stamp
 	mkdir -p bootstrap/jdk1.7.0/jre/lib
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-	then \
-	  $(JAR) cf $@ -C lib/rt com -C lib/rt java \
-	    -C lib/rt javax -C lib/rt sun ; \
-	else \
-	  $(ICEDTEA_BOOT_DIR)/bin/jar cf $@ -C lib/rt com -C lib/rt java \
-	    -C lib/rt javax -C lib/rt sun ; \
-	fi
+	$(ICEDTEA_BOOT_DIR)/bin/jar cf $@ -C lib/rt com -C lib/rt java \
+	  -C lib/rt javax -C lib/rt sun ;
 	if test -d bootstrap/ecj/jre/lib ; \
 	then \
 	  cp bootstrap/jdk1.7.0/jre/lib/rt-closed.jar \
@@ -3096,20 +3078,11 @@
 
 stamps/extra-class-files.stamp: extra-source-files.txt stamps/netx.stamp
 	mkdir -p extra-lib
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-	then \
-	  $(JAVAC) $(MEMORY_LIMIT) -g -d extra-lib \
-	    -classpath $(abs_top_builddir)/lib/hotspot-tools \
-	    -sourcepath $(abs_top_srcdir)/extra:$(SOURCEPATH_DIRS) \
-	    -bootclasspath \'\' \
-	    @extra-source-files.txt ; \
-	else \
-	  $(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) -g -d extra-lib \
-	    -classpath $(abs_top_builddir)/lib/hotspot-tools \
-	    -sourcepath $(abs_top_srcdir)/extra:$(SOURCEPATH_DIRS) \
-	    -bootclasspath \'\' \
-	    @extra-source-files.txt ; \
-	fi
+	$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) $(IT_JAVACFLAGS) -d extra-lib \
+	  -classpath $(abs_top_builddir)/lib/hotspot-tools \
+	  -sourcepath $(abs_top_srcdir)/extra:$(SOURCEPATH_DIRS) \
+	  -bootclasspath \'\' \
+	  @extra-source-files.txt ; \
 	cp -r $(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources \
 	  extra-lib/net/sourceforge/jnlp/about	
 	find extra-lib/net/sourceforge/jnlp/about -type f -exec chmod 640 '{}' ';' \
@@ -3139,7 +3112,7 @@
 
 stamps/netx.stamp: netx-source-files.txt stamps/hotspot-tools.stamp
 	mkdir -p $(abs_top_builddir)/netx.build
-	$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) -g \
+	$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) $(IT_JAVACFLAGS) \
 	    -d $(abs_top_builddir)/netx.build \
 	    -classpath $(abs_top_builddir)/lib/hotspot-tools \
 	    -sourcepath $(abs_top_srcdir)/netx:$(SOURCEPATH_DIRS): \
@@ -3308,12 +3281,7 @@
 stamps/pulse-java-jar.stamp: stamps/pulse-java-class.stamp
 if ENABLE_PULSE_JAVA
 	mkdir -p $(PULSE_JAVA_CLASS_DIR);
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-	then \
-	  $(JAR) cf pulse-java.jar -C $(PULSE_JAVA_CLASS_DIR) .; \
-	else \
-	  $(ICEDTEA_BOOT_DIR)/bin/jar cf pulse-java.jar -C $(PULSE_JAVA_CLASS_DIR) .; \
-	fi
+	$(ICEDTEA_BOOT_DIR)/bin/jar cf pulse-java.jar -C $(PULSE_JAVA_CLASS_DIR) .;
 endif
 	mkdir -p stamps
 	touch stamps/pulse-java-jar.stamp
@@ -3321,22 +3289,11 @@
 stamps/pulse-java-class.stamp: $(INITIAL_BOOTSTRAP_LINK_STAMP)
 if ENABLE_PULSE_JAVA
 	mkdir -p $(PULSE_JAVA_CLASS_DIR)
-	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
-	then \
-		(cd $(PULSE_JAVA_JAVA_SRCDIR); \
-		 $(JAVAC) -g -d $(PULSE_JAVA_CLASS_DIR) \
-		-bootclasspath  \
-	        '$(OPENJDK_SOURCEPATH_DIRS):$(abs_top_builddir)/generated' \
-		org/classpath/icedtea/pulseaudio/*.java\
-		) \
-        else \
-		(cd $(PULSE_JAVA_JAVA_SRCDIR); \
-		$(ICEDTEA_BOOT_DIR)/bin/javac -g -d $(PULSE_JAVA_CLASS_DIR)\
-		-bootclasspath \
-	        '$(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar' \
-		org/classpath/icedtea/pulseaudio/*.java\
-		) \
-        fi
+	(cd $(PULSE_JAVA_JAVA_SRCDIR); \
+	 $(ICEDTEA_BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) -d $(PULSE_JAVA_CLASS_DIR)\
+	 -bootclasspath '$(ICEDTEA_BOOT_DIR)/jre/lib/rt.jar' \
+	org/classpath/icedtea/pulseaudio/*.java\
+	)
 	cp  -r $(PULSE_JAVA_JAVA_SRCDIR)/META-INF $(PULSE_JAVA_CLASS_DIR)
 	chmod -R ug+w $(PULSE_JAVA_CLASS_DIR)/META-INF
 endif
@@ -3487,8 +3444,8 @@
 stamps/jtreg.stamp: stamps/icedtea.stamp
 	rm -rf test/jtreg/classes
 	mkdir -p test/jtreg/classes
-	$(ICEDTEA_BOOT_DIR)/bin/javac -g -d test/jtreg/classes -source 1.5 \
-	   -encoding iso-8859-1 `find $(abs_top_srcdir)/test/jtreg/com -name '*.java'`
+	$(ICEDTEA_BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) -d test/jtreg/classes \
+	   `find $(abs_top_srcdir)/test/jtreg/com -name '*.java'`
 	(cd $(abs_top_srcdir)/test/jtreg; \
 	 $(ICEDTEA_BOOT_DIR)/bin/jar cfm $(abs_top_builddir)/test/jtreg.jar \
 	   META-INF/MANIFEST.MF \
--- a/javac.in	Mon Aug 17 16:34:18 2009 +0100
+++ b/javac.in	Fri Aug 21 20:02:09 2009 +0100
@@ -19,6 +19,7 @@
 my @bcoption;
 push @bcoption, '-bootclasspath', glob '@SYSTEM_JDK_DIR@/jre/lib/rt.jar'
     unless grep {$_ eq '-bootclasspath'} @ARGV;
+my @ecj_parms = ($ECJ_WARNINGS, @bcoption);
 
 # Work around ecj's inability to handle duplicate command-line
 # options.
@@ -47,14 +48,14 @@
 if ( -e "@abs_top_builddir@/native-ecj" )
 {
     my @ecj_args = gen_ecj_opts( \@ARGV );
-    exec '@abs_top_builddir@/native-ecj', '-1.7', $ECJ_WARNINGS, @bcoption, @ecj_args ;
+    exec '@abs_top_builddir@/native-ecj', @ecj_parms, @ecj_args ;
 }
 elsif ( -e "@JAVAC@" )
 {
     if ("@USING_ECJ@" eq "yes")
     {
 	my @ecj_args = gen_ecj_opts( \@ARGV );
-	exec '@JAVAC@', '-1.7', $ECJ_WARNINGS, @bcoption, @ecj_args ;
+	exec '@JAVAC@', @ecj_parms, @ecj_args ;
     }
     else
     {
@@ -67,6 +68,5 @@
     my @CLASSPATH = ('@ECJ_JAR@');
     push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
     $ENV{"CLASSPATH"} = join ':', @CLASSPATH;
-    exec '@JAVA@', 'org.eclipse.jdt.internal.compiler.batch.Main', '-1.7',
-    $ECJ_WARNINGS, @bcoption, @ecj_args;
+    exec '@JAVA@', 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @ecj_args;
 }
--- a/patches/ecj/icedtea-hotspot-default.patch	Mon Aug 17 16:34:18 2009 +0100
+++ b/patches/ecj/icedtea-hotspot-default.patch	Fri Aug 21 20:02:09 2009 +0100
@@ -1,7 +1,7 @@
 diff -Nru openjdk-ecj.orig/hotspot/make/linux/Makefile openjdk-ecj/hotspot/make/linux/Makefile
---- openjdk-ecj.orig/hotspot/make/linux/Makefile	2008-10-24 10:16:06.000000000 +0100
-+++ openjdk-ecj/hotspot/make/linux/Makefile	2008-10-24 13:32:48.000000000 +0100
-@@ -263,28 +263,24 @@
+--- openjdk-ecj.orig/hotspot/make/linux/Makefile	2009-08-18 17:44:09.000000000 +0100
++++ openjdk-ecj/hotspot/make/linux/Makefile	2009-08-18 18:56:52.000000000 +0100
+@@ -274,28 +274,24 @@
  
  $(TARGETS_C2):  $(SUBDIRS_C2)
  	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
@@ -31,18 +31,32 @@
  	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
  endif
 diff -Nru openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make openjdk-ecj/hotspot/make/linux/makefiles/sa.make
---- openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make	2008-10-24 10:16:06.000000000 +0100
-+++ openjdk-ecj/hotspot/make/linux/makefiles/sa.make	2008-10-24 13:32:48.000000000 +0100
-@@ -74,8 +74,8 @@
- 	  mkdir -p $(SA_CLASSDIR);        \
- 	fi
+--- openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make	2009-08-18 17:35:29.000000000 +0100
++++ openjdk-ecj/hotspot/make/linux/makefiles/sa.make	2009-08-18 19:54:42.000000000 +0100
+@@ -38,7 +38,9 @@
+ GENERATED = $(TOPDIR)/../generated
+ 
+ # tools.jar is needed by the JDI - SA binding
+-SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
++SA_TOOLS_JAR = $(BOOT_JAVA_HOME)/lib/tools.jar
++SA_RT_JAR = $(BOOT_JAVA_HOME)/jre/lib/rt.jar
++SA_CLASSPATH = $(SA_TOOLS_JAR):$(SA_RT_JAR)
  
--	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES1)
--	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES2)
-+	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES1)
-+	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -sourcepath $(AGENT_SRC_DIR) -g -d $(SA_CLASSDIR) $(AGENT_FILES2)
- 
- 	$(QUIETLY) $(REMOTE) $(COMPILE.RMIC)  -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
- 	$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
-
-
+ # gnumake 3.78.1 does not accept the *s that
+ # are in AGENT_FILES1 and AGENT_FILES2, so use the shell to expand them
+@@ -65,8 +67,13 @@
+ 	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
+ 	  exit 1; \
+ 	fi
+-	$(QUIETLY) if [ ! -f $(SA_CLASSPATH) ] ; then \
+-	  echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
++	$(QUIETLY) if [ ! -f $(SA_TOOLS_JAR) ] ; then \
++	  echo "Missing $(SA_TOOLS_JAR) file. Use 1.6.0 or later version of JDK";\
++	  echo ""; \
++	  exit 1; \
++	fi
++	$(QUIETLY) if [ ! -f $(SA_RT_JAR) ] ; then \
++	  echo "Missing $(SA_RT_JAR) file. Use 1.6.0 or later version of JDK";\
+ 	  echo ""; \
+ 	  exit 1; \
+ 	fi