changeset 1134:7f335937eca4

Add support for native ecj. 2008-10-20 Andrew John Hughes <gnu_andrew@member.fsf.org> * Makefile.am: Build native ecj for ecj builds when gcj is available. * acinclude.m4: Make configure output more explicit and readable. * configure.ac: Check for gcj, and make output more explicit and readable. * javac.in: Use native ecj when available.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Mon, 20 Oct 2008 13:48:45 +0100
parents 1fddd063617e
children 0a1e75999e5a
files ChangeLog Makefile.am acinclude.m4 configure.ac javac.in
diffstat 5 files changed, 85 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 20 12:25:28 2008 +0100
+++ b/ChangeLog	Mon Oct 20 13:48:45 2008 +0100
@@ -1,3 +1,15 @@
+2008-10-20  Andrew John Hughes  <gnu_andrew@member.fsf.org>
+
+	* Makefile.am:
+	Build native ecj for ecj builds when
+	gcj is available.
+	* acinclude.m4:
+	Make configure output more explicit and readable.
+	* configure.ac:
+	Check for gcj, and make output more explicit
+	and readable.
+	* javac.in: Use native ecj when available.
+
 2008-10-20  Andrew John Hughes  <gnu_andrew@member.fsf.org>
 
 	* Makefile.am:
--- a/Makefile.am	Mon Oct 20 12:25:28 2008 +0100
+++ b/Makefile.am	Mon Oct 20 13:48:45 2008 +0100
@@ -863,7 +863,7 @@
 # ===============================
 
 # bootstrap/ecj.
-stamps/bootstrap-directory-ecj.stamp:
+stamps/bootstrap-directory-ecj.stamp: stamps/native-ecj.stamp
 	mkdir -p bootstrap/ecj/bin stamps/
 	ln -sf $(JAVA) bootstrap/ecj/bin/java
 	ln -sf $(JAVAH) bootstrap/ecj/bin/javah
@@ -1097,6 +1097,14 @@
 # OpenJDK ecj Targets
 # ===================
 
+stamps/native-ecj.stamp: 
+	mkdir -p stamps ; \
+	if test "x${GCJ}" != x; then \
+	  ${GCJ} ${CFLAGS} -Wl,-Bsymbolic -o native-ecj \
+	    --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR} ; \
+	fi ; \
+	touch stamps/native-ecj.stamp
+
 stamps/icedtea-ecj.stamp: stamps/hotspot-tools.stamp stamps/plugs.stamp \
 	stamps/ports-ecj.stamp stamps/patch-ecj.stamp stamps/cacao.stamp
 	$(MAKE) \
@@ -1704,6 +1712,8 @@
 
 icedtea-ecj: stamps/icedtea-ecj.stamp
 
+native-ecj: stamps/native-ecj.stamp
+
 patch-ecj: stamps/patch-ecj.stamp
 
 patch: stamps/patch.stamp
--- a/acinclude.m4	Mon Oct 20 12:25:28 2008 +0100
+++ b/acinclude.m4	Mon Oct 20 13:48:45 2008 +0100
@@ -180,7 +180,7 @@
 
 AC_DEFUN([WITH_OPENJDK_SRC_DIR],
 [
-  AC_MSG_CHECKING(openjdk sources)
+  AC_MSG_CHECKING(for an OpenJDK source directory)
   AC_ARG_WITH([openjdk-src-dir],
               [AS_HELP_STRING(--with-openjdk-src-dir,specify the location of the openjdk sources)],
   [
@@ -203,7 +203,7 @@
               [AS_HELP_STRING(--with-ecj-jar,specify location of the ECJ jar)],
   [
     if test -f "${withval}"; then
-      AC_MSG_CHECKING(ecj jar)
+      AC_MSG_CHECKING(for an ecj jar)
       ECJ_JAR="${withval}"
       AC_MSG_RESULT(${withval})
     fi
@@ -245,7 +245,7 @@
               [AS_HELP_STRING(--with-libgcj-jar,specify location of the libgcj 4.3.x jar)],
   [
     if test -f "${withval}"; then
-      AC_MSG_CHECKING(libgcj jar)
+      AC_MSG_CHECKING(for libgcj jar)
       LIBGCJ_JAR="${withval}"
       AC_MSG_RESULT(${withval})
     fi
@@ -284,7 +284,7 @@
               [AS_HELP_STRING(--with-javah,specify location of the javah)],
   [
     if test -f "${withval}"; then
-      AC_MSG_CHECKING(javah)
+      AC_MSG_CHECKING(for javah)
       JAVAH="${withval}"
       AC_MSG_RESULT(${withval})
     else
@@ -312,7 +312,7 @@
               [AS_HELP_STRING(--with-jar,specify location of the jar)],
   [
     if test -f "${withval}"; then
-      AC_MSG_CHECKING(jar)
+      AC_MSG_CHECKING(for jar)
       JAR="${withval}"
       AC_MSG_RESULT(${withval})
     else
@@ -331,7 +331,7 @@
   if test -z "${JAR}"; then
     AC_MSG_ERROR("jar was not found.")
   fi
-  AC_MSG_CHECKING([wether jar supports @<file> argument])
+  AC_MSG_CHECKING([whether jar supports @<file> argument])
   touch _config.txt
   cat >_config.list <<EOF
 _config.txt
@@ -363,7 +363,7 @@
               [AS_HELP_STRING(--with-rmic,specify location of the rmic)],
   [
     if test -f "${withval}"; then
-      AC_MSG_CHECKING(rmic)
+      AC_MSG_CHECKING(for rmic)
       RMIC="${withval}"
       AC_MSG_RESULT(${withval})
     else
@@ -387,13 +387,16 @@
 
 AC_DEFUN([FIND_ENDORSED_JARS],
 [
+  AC_MSG_CHECKING(for endorsed jars dir)
   AC_ARG_WITH([endorsed-dir],
               [AS_HELP_STRING(--with-endorsed-dir,specify directory of endorsed jars (xalan-j2.jar, xalan-j2-serializer.jar, xerces-j2.jar))],
   [
-    if test -f "${withval}/xalan-j2.jar"; then
+    if test "x${withval}" = "xno"; then
+        ENDORSED_JARS="${withval}"
+        AC_MSG_RESULT(${withval})
+    else if test -f "${withval}/xalan-j2.jar"; then
       if test -f "${withval}/xalan-j2-serializer.jar"; then
         if test -f "${withval}/xerces-j2.jar"; then
-          AC_MSG_CHECKING(endorsed jars dir)
           ENDORSED_JARS="${withval}"
           AC_MSG_RESULT(${withval})
         fi
@@ -404,7 +407,6 @@
     ENDORSED_JARS=
   ])
   if test -z "${ENDORSED_JARS}"; then
-    AC_MSG_CHECKING(for endorsed jars dir)
     if test -f "/usr/share/java/xalan-j2.jar"; then
       if test -f "/usr/share/java/xalan-j2-serializer.jar"; then
         if test -f "/usr/share/java/xerces-j2.jar"; then
@@ -425,7 +427,7 @@
 
 AC_DEFUN([WITH_OPENJDK_SRC_ZIP],
 [
-  AC_MSG_CHECKING(openjdk source zip)
+  AC_MSG_CHECKING(for an OpenJDK source zip)
   AC_ARG_WITH([openjdk-src-zip],
               [AS_HELP_STRING(--with-openjdk-src-zip,specify the location of the openjdk source zip)],
   [
@@ -442,7 +444,7 @@
 
 AC_DEFUN([WITH_VISUALVM_SRC_ZIP],
 [
-  AC_MSG_CHECKING(visualvm source zip)
+  AC_MSG_CHECKING(for a VisualVM source zip)
   AC_ARG_WITH([visualvm-src-zip],
               [AS_HELP_STRING(--with-visualvm-src-zip, specify the location of the visualvm source zip)],
   [
@@ -459,9 +461,9 @@
 
 AC_DEFUN([WITH_NETBEANS_PROFILER_SRC_ZIP],
 [
-  AC_MSG_CHECKING(netbeans profiler source zip)
+  AC_MSG_CHECKING(for a NetBeans profiler source zip)
   AC_ARG_WITH([netbeans-profiler-src-zip],
-              [AS_HELP_STRING(--with-netbeans-src-zip, specify the location of the netbeans profiler source zip)],
+              [AS_HELP_STRING(--with-netbeans-profiler-src-zip, specify the location of the netbeans profiler source zip)],
   [
     ALT_NETBEANS_PROFILER_SRC_ZIP=${withval}
     AM_CONDITIONAL(USE_ALT_NETBEANS_PROFILER_SRC_ZIP, test x = x)
@@ -476,7 +478,7 @@
 
 AC_DEFUN([WITH_NETBEANS_BASIC_CLUSTER_SRC_ZIP],
 [
-  AC_MSG_CHECKING(netbeans basic cluster zip)
+  AC_MSG_CHECKING(for a NetBeans basic cluster source zip)
   AC_ARG_WITH([netbeans-basic-cluster-src-zip],
               [AS_HELP_STRING(--with-netbeans-basic-cluster-src-zip, specify the location of the netbeans basic cluster source zip)],
   [
@@ -493,7 +495,7 @@
 
 AC_DEFUN([WITH_ALT_JAR_BINARY],
 [
-  AC_MSG_CHECKING(alternate jar command)
+  AC_MSG_CHECKING(for an alternate jar command)
   AC_ARG_WITH([alt-jar],
               [AS_HELP_STRING(--with-alt-jar, specify the location of an alternate jar binary to use for building)],
   [
@@ -510,29 +512,24 @@
 
 AC_DEFUN([FIND_XALAN2_JAR],
 [
+  AC_MSG_CHECKING(xalan2 jar)
   AC_ARG_WITH([xalan2-jar],
               [AS_HELP_STRING(--with-xalan2-jar,specify location of the xalan2 jar)],
   [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(xalan2 jar)
+    if test -f "${withval}" ; then
       XALAN2_JAR="${withval}"
-      AC_MSG_RESULT(${withval})
     fi
   ],
   [
     XALAN2_JAR=
   ])
   if test -z "${XALAN2_JAR}"; then
-    AC_MSG_CHECKING(for xalan2 jar)
     if test -e "/usr/share/java/xalan-j2.jar"; then
       XALAN2_JAR=/usr/share/java/xalan-j2.jar
-      AC_MSG_RESULT(${XALAN2_JAR})
     elif test -e "/usr/share/java/xalan2.jar"; then
       XALAN2_JAR=/usr/share/java/xalan2.jar
-      AC_MSG_RESULT(${XALAN2_JAR})
     elif test -e "/usr/share/xalan/lib/xalan.jar"; then
       XALAN2_JAR=/usr/share/xalan/lib/xalan.jar
-      AC_MSG_RESULT(${XALAN2_JAR})
     else
       AC_MSG_RESULT(no)
     fi
@@ -540,34 +537,30 @@
   if test -z "${XALAN2_JAR}"; then
     AC_MSG_ERROR("A xalan2 jar was not found.")
   fi
+  AC_MSG_RESULT(${XALAN2_JAR})
   AC_SUBST(XALAN2_JAR)
 ])
 
 AC_DEFUN([FIND_XALAN2_SERIALIZER_JAR],
 [
+  AC_MSG_CHECKING(for xalan2 serializer jar)
   AC_ARG_WITH([xalan2-serializer-jar],
               [AS_HELP_STRING(--with-xalan2-serializer-jar,specify location of the xalan2-serializer jar)],
   [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(xalan2 serializer jar)
+    if test -f "${withval}" ; then
       XALAN2_SERIALIZER_JAR="${withval}"
-      AC_MSG_RESULT(${withval})
     fi
   ],
   [
     XALAN2_SERIALIZER_JAR=
   ])
   if test -z "${XALAN2_SERIALIZER_JAR}"; then
-    AC_MSG_CHECKING(for xalan2-serializer jar)
     if test -e "/usr/share/java/xalan-j2-serializer.jar"; then
       XALAN2_SERIALIZER_JAR=/usr/share/java/xalan-j2-serializer.jar
-      AC_MSG_RESULT(${XALAN2_SERIALIZER_JAR})
     elif test -e "/usr/share/xalan-serializer/lib/serializer.jar"; then
       XALAN2_SERIALIZER_JAR=/usr/share/xalan-serializer/lib/serializer.jar
-      AC_MSG_RESULT(${XALAN2_SERIALIZER_JAR})
     elif test -e "/usr/share/java/serializer.jar"; then
       XALAN2_SERIALIZER_JAR=/usr/share/java/serializer.jar
-      AC_MSG_RESULT(${XALAN2_SERIALIZER_JAR})
     else
       AC_MSG_RESULT(no)
     fi
@@ -575,37 +568,32 @@
   if test -z "${XALAN2_SERIALIZER_JAR}"; then
     AC_MSG_ERROR("A xalan2-serializer jar was not found.")
   fi
+  AC_MSG_RESULT(${XALAN2_SERIALIZER_JAR})
   AC_SUBST(XALAN2_SERIALIZER_JAR)
 ])
 
 AC_DEFUN([FIND_XERCES2_JAR],
 [
+  AC_MSG_CHECKING(for xerces2 jar)
   AC_ARG_WITH([xerces2-jar],
               [AS_HELP_STRING(--with-xerces2-jar,specify location of the xerces2 jar)],
   [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(xerces2 jar)
+    if test -f "${withval}" ; then
       XERCES2_JAR="${withval}"
-      AC_MSG_RESULT(${withval})
     fi
   ],
   [
     XERCES2_JAR=
   ])
   if test -z "${XERCES2_JAR}"; then
-    AC_MSG_CHECKING(for xerces2 jar)
     if test -e "/usr/share/java/xerces-j2.jar"; then
       XERCES2_JAR=/usr/share/java/xerces-j2.jar
-      AC_MSG_RESULT(${XERCES2_JAR})
     elif test -e "/usr/share/java/xerces2.jar"; then
       XERCES2_JAR=/usr/share/java/xerces2.jar
-      AC_MSG_RESULT(${XERCES2_JAR})
     elif test -e "/usr/share/xerces-2/lib/xercesImpl.jar"; then
       XERCES2_JAR=/usr/share/xerces-2/lib/xercesImpl.jar
-      AC_MSG_RESULT(${XERCES2_JAR})
     elif test -e "/usr/share/java/xercesImpl.jar"; then
       XERCES2_JAR=/usr/share/java/xercesImpl.jar
-      AC_MSG_RESULT(${XERCES2_JAR})
     else
       AC_MSG_RESULT(no)
     fi
@@ -613,6 +601,7 @@
   if test -z "${XERCES2_JAR}"; then
     AC_MSG_ERROR("A xerces2 jar was not found.")
   fi
+  AC_MSG_RESULT(${XERCES2_JAR})
   AC_SUBST(XERCES2_JAR)
 ])
 
@@ -867,7 +856,7 @@
 
 AC_DEFUN([AC_CHECK_WITH_CACAO_HOME],
 [
-  AC_MSG_CHECKING(CACAO home directory)
+  AC_MSG_CHECKING(for CACAO home directory)
   AC_ARG_WITH([cacao-home],
               [AS_HELP_STRING([--with-cacao-home],
                               [CACAO home directory [[default=/usr/local/cacao]]])],
@@ -892,7 +881,7 @@
 
 AC_DEFUN([AC_CHECK_WITH_CACAO_SRC_ZIP],
 [
-  AC_MSG_CHECKING(CACAO source zip)
+  AC_MSG_CHECKING(for a CACAO source zip)
   AC_ARG_WITH([cacao-src-zip],
               [AS_HELP_STRING(--with-cacao-src-zip,specify the location of the CACAO source zip)],
   [
--- a/configure.ac	Mon Oct 20 12:25:28 2008 +0100
+++ b/configure.ac	Mon Oct 20 13:48:45 2008 +0100
@@ -32,7 +32,10 @@
 FIND_TOOL([GAWK], [gawk])
 AC_PATH_TOOL([HG],[hg])
 AC_SUBST([HG])
+AC_PATH_TOOL([GCJ],[gcj])
+AC_SUBST([GCJ])
 
+AC_MSG_CHECKING([for a JDK home directory])
 AC_ARG_WITH([gcj-home],
 	    [AS_HELP_STRING([--with-gcj-home],
                             [gcj home directory \
@@ -48,8 +51,10 @@
             [
               SYSTEM_GCJ_DIR=/usr/lib/jvm/java-gcj
             ])
+AC_MSG_RESULT(${SYSTEM_GCJ_DIR})
 AC_SUBST(SYSTEM_GCJ_DIR)
 
+AC_MSG_CHECKING([for an existing OpenJDK installation])
 AC_ARG_WITH([openjdk-home],
             [AS_HELP_STRING([--with-openjdk-home],
                             [OpenJDK home directory \
@@ -65,8 +70,10 @@
             [
               SYSTEM_OPENJDK_DIR=/usr/lib/jvm/java-openjdk
             ])
+AC_MSG_RESULT(${SYSTEM_OPENJDK_DIR})
 AC_SUBST(SYSTEM_OPENJDK_DIR)
 
+AC_MSG_CHECKING(for an existing IcedTea installation)
 AC_ARG_WITH([icedtea-home],
             [AS_HELP_STRING([--with-icedtea-home],
                             [IcedTea home directory \
@@ -82,8 +89,10 @@
             [
               SYSTEM_ICEDTEA_DIR=/usr/lib/jvm/java-icedtea
             ])
+AC_MSG_RESULT(${SYSTEM_ICEDTEA_DIR})
 AC_SUBST(SYSTEM_ICEDTEA_DIR)
 
+AC_MSG_CHECKING([for a NetBeans installation])
 AC_ARG_WITH([netbeans-home],
 	    [AS_HELP_STRING([--with-netbeans-home],
                             [NetBeans home directory (default is /usr/share/netbeans)])],
@@ -98,8 +107,10 @@
             [
               SYSTEM_NETBEANS_DIR=/usr/share/netbeans
             ])
+AC_MSG_RESULT([${SYSTEM_NETBEANS_DIR}])
 AC_SUBST(SYSTEM_NETBEANS_DIR)
 
+AC_MSG_CHECKING(for Ant home directory)
 AC_ARG_WITH([ant-home],
             [AS_HELP_STRING([--with-ant-home],
                             [Ant home directory (default is /usr/share/ant)])],
@@ -115,31 +126,41 @@
               SYSTEM_ANT_DIR=/usr/share/ant
             ])
 AC_SUBST(SYSTEM_ANT_DIR)
+AC_MSG_RESULT(${SYSTEM_ANT_DIR})
 
+AC_MSG_CHECKING([whether to build the LiveConnect plugin])
 AC_ARG_ENABLE([liveconnect],
               [AS_HELP_STRING([--disable-liveconnect],
                               [Disable compilation of browser plugin])],
               [enable_plugin="${enableval}"], [enable_plugin="yes"])
 AM_CONDITIONAL(ENABLE_PLUGIN, test "x${enable_plugin}" = "xyes")
+AC_MSG_RESULT(${enable_plugin})
 
+AC_MSG_CHECKING([whether to build gcjwebplugin])
 AC_ARG_ENABLE([gcjwebplugin],
               [AS_HELP_STRING([--enable-gcjwebplugin],
                               [Build the GCJ Web Plugin plugin (deprecated)])],
               [enable_gcjwebplugin="${enableval}"], [enable_gcjwebplugin="no"])
 AM_CONDITIONAL(ENABLE_GCJWEBPLUGIN, test "x${enable_gcjwebplugin}" = "xyes")
+AC_MSG_RESULT(${enable_gcjwebplugin})
 
+AC_MSG_CHECKING([whether to include PulseAudio support])
 AC_ARG_ENABLE([pulse-java],
               [AS_HELP_STRING([--enable-pulse-java],
                               [Enable pulse-java - an audio mixer spi that uses PulseAudio])],
               [enable_pulse_java="${enableval}"], [enable_pulse_java="no"])
 AM_CONDITIONAL(ENABLE_PULSE_JAVA, test "x${enable_pulse_java}" = "xyes")
+AC_MSG_RESULT(${enable_pulse_java})
 
+AC_MSG_CHECKING(whether to build documentation)
 AC_ARG_ENABLE([docs],
 	      [AS_HELP_STRING([--disable-docs],
 	      		      [Disable generation of documentation])],
 	      [ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='yes'])
 AM_CONDITIONAL([ENABLE_DOCS], [test x$ENABLE_DOCS = xyes])
+AC_MSG_RESULT(${ENABLE_DOCS})
 
+AC_MSG_CHECKING(whether to build VisualVM)
 AC_ARG_ENABLE([visualvm],
               [AS_HELP_STRING([--enable-visualvm],
 			                  [Enable compilation of visualvm.])],
@@ -166,7 +187,9 @@
           with_icedtea=false
         ])
 AM_CONDITIONAL(WITH_ICEDTEA, test "${with_icedtea}" = true)
+AC_MSG_RESULT(${with_icedtea})
 
+AC_MSG_CHECKING(whether to build using an existing installation of OpenJDK)
 AC_ARG_WITH([openjdk],
         [AS_HELP_STRING([--with-openjdk],
                         [build IcedTea with system-installed OpenJDK])],
@@ -182,7 +205,9 @@
           with_openjdk=false
         ])
 AM_CONDITIONAL(WITH_OPENJDK, test "${with_openjdk}" = true)
+AC_MSG_RESULT(${with_openjdk})
 
+AC_MSG_CHECKING(how many parallel build jobs to execute)
 AC_ARG_WITH([parallel-jobs],
 	[AS_HELP_STRING([--with-parallel-jobs],
 			[build IcedTea using the specified number of parallel jobs])],
@@ -197,6 +222,7 @@
         [
           PARALLEL_JOBS=2
         ])
+AC_MSG_RESULT(${PARALLEL_JOBS})
 AC_SUBST(PARALLEL_JOBS)
 
 SET_ARCH_DIRS
--- a/javac.in	Mon Oct 20 12:25:28 2008 +0100
+++ b/javac.in	Mon Oct 20 13:48:45 2008 +0100
@@ -30,5 +30,10 @@
   NEW_ARGS=`echo $NEW_ARGS | sed -e 's/-Werror//1'`
 fi
 
-CLASSPATH=@ECJ_JAR@${CLASSPATH:+:}$CLASSPATH \
-  @JAVA@ org.eclipse.jdt.internal.compiler.batch.Main -1.5 -nowarn $bcoption $NEW_ARGS
+if [ -e @abs_top_builddir@/native-ecj ] ; then
+    @abs_top_builddir@/native-ecj -1.5 -nowarn $bcoption $NEW_ARGS ;
+else
+    CLASSPATH=@ECJ_JAR@${CLASSPATH:+:}$CLASSPATH \
+     @JAVA@ org.eclipse.jdt.internal.compiler.batch.Main -1.5 -nowarn $bcoption $NEW_ARGS
+fi
+