changeset in /hg/icedtea: Cleanup #01: Reduce JDK options to one...

Andrew John Hughes ahughes at redhat.com
Fri Jul 17 18:03:00 PDT 2009


changeset f13e31f619e2 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=f13e31f619e2
description:
	Cleanup #01: Reduce JDK options to one and prefer JDK binaries.

	2009-07-17  Andrew John Hughes  <ahughes at redhat.com>

		* Makefile.am:
		Remove use of WITH_OPENJDK, WITH_ICEDTEA
		and SYSTEM_GCJ_DIR replacing with BOOTSTRAPPING
		and SYSTEM_JDK_DIR as appropriate.
		* acinclude.m4:
		(FIND_JAVAC): Search for generic 'javac' first.
		(IT_FIND_ECJ): Only use ecj as javac if JAVA is unset.
		(FIND_JAVAH): Try javah in SYSTEM_JDK_DIR before searching.
		(FIND_JAR): Likewise for jar.
		(FIND_RMIC): Likewise for rmic.
		(IT_CHECK_IF_BOOTSTRAPPING): Allow bootstrapping to be disabled.
		Replaces --with-icedtea/--with-openjdk.
		(IT_CHECK_FOR_JDK): Find JDK to use.  Replaces --with-gcj-jdk,
		--with-icedtea-home, --with-openjdk-home.  At present, only checks
		for gcj jdks if not bootstrapping.
		(AC_CHECK_FOR_OPENJDK): Removed.
		(AC_CHECK_FOR_ICEDTEA): Removed.
		(AC_CHECK_FOR_GCJ_JDK): Removed.
		* configure.ac:
		Remove --with-icedtea and --with-openjdk.  Always check
		for a JDK and then allow individual binaries to be overridden
		by --with-x.
		* javac.in:
		Replace SYSTEM_GCJ_DIR with SYSTEM_JDK_DIR.

diffstat:

5 files changed, 188 insertions(+), 280 deletions(-)
ChangeLog    |   27 ++++
Makefile.am  |   36 ++----
acinclude.m4 |  315 ++++++++++++++++++++++++----------------------------------
configure.ac |   88 ++--------------
javac.in     |    2 

diffs (truncated from 699 to 500 lines):

diff -r 2341c4735ea7 -r f13e31f619e2 ChangeLog
--- a/ChangeLog	Wed Jul 15 13:39:06 2009 +0100
+++ b/ChangeLog	Sat Jul 18 02:04:40 2009 +0100
@@ -1,3 +1,30 @@ 2009-07-15  Andrew John Hughes  <ahughes
+2009-07-17  Andrew John Hughes  <ahughes at redhat.com>
+
+	* Makefile.am:
+	Remove use of WITH_OPENJDK, WITH_ICEDTEA
+	and SYSTEM_GCJ_DIR replacing with BOOTSTRAPPING
+	and SYSTEM_JDK_DIR as appropriate.
+	* acinclude.m4:
+	(FIND_JAVAC): Search for generic 'javac' first.
+	(IT_FIND_ECJ): Only use ecj as javac if JAVA is unset.
+	(FIND_JAVAH): Try javah in SYSTEM_JDK_DIR before searching.
+	(FIND_JAR): Likewise for jar.
+	(FIND_RMIC): Likewise for rmic.
+	(IT_CHECK_IF_BOOTSTRAPPING): Allow bootstrapping to be disabled.
+	Replaces --with-icedtea/--with-openjdk.
+	(IT_CHECK_FOR_JDK): Find JDK to use.  Replaces --with-gcj-jdk,
+	--with-icedtea-home, --with-openjdk-home.  At present, only checks
+	for gcj jdks if not bootstrapping.
+	(AC_CHECK_FOR_OPENJDK): Removed.
+	(AC_CHECK_FOR_ICEDTEA): Removed.
+	(AC_CHECK_FOR_GCJ_JDK): Removed.
+	* configure.ac:
+	Remove --with-icedtea and --with-openjdk.  Always check
+	for a JDK and then allow individual binaries to be overridden
+	by --with-x.
+	* javac.in:
+	Replace SYSTEM_GCJ_DIR with SYSTEM_JDK_DIR.
+
 2009-07-15  Andrew John Hughes  <ahughes at redhat.com>
 
 	* Makefile.am:
diff -r 2341c4735ea7 -r f13e31f619e2 Makefile.am
--- a/Makefile.am	Wed Jul 15 13:39:06 2009 +0100
+++ b/Makefile.am	Sat Jul 18 02:04:40 2009 +0100
@@ -1630,7 +1630,7 @@ ICEDTEA_ENV_ECJ = \
 	"BOOTCLASSPATH_CLS_RT=-bootclasspath \
 	  $(ICEDTEA_CLS_DIR_ECJ):$(ICEDTEA_RT)" \
 	"BOOTCLASSPATH_CLS=-bootclasspath $(ICEDTEA_CLS_DIR_ECJ)" \
-	"BOOTCLASSPATH_RT_LIBGCJ=-bootclasspath $(ICEDTEA_RT):$(SYSTEM_GCJ_DIR)/jre/lib/rt.jar" \
+	"BOOTCLASSPATH_RT_LIBGCJ=-bootclasspath $(ICEDTEA_RT):$(SYSTEM_JDK_DIR)/jre/lib/rt.jar" \
 	"CLASSPATH=" \
 	"LD_LIBRARY_PATH=" \
 	"GENSRCDIR=$(abs_top_builddir)/generated" \
@@ -2577,20 +2577,14 @@ clean-bootstrap-directory:
 	rm -f stamps/bootstrap-directory.stamp
 	rm -rf bootstrap/icedtea
 
-if WITH_OPENJDK
-  BOOTSTRAP_DIRECTORY_STAMP =
-  ICEDTEA_HOME = $(SYSTEM_OPENJDK_DIR)
-  INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink.stamp
-else
-if WITH_ICEDTEA
-  BOOTSTRAP_DIRECTORY_STAMP =
-  ICEDTEA_HOME = $(SYSTEM_ICEDTEA_DIR)
-  INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink.stamp
-else
+if BOOTSTRAPPING
   BOOTSTRAP_DIRECTORY_STAMP = stamps/bootstrap-directory.stamp
   ICEDTEA_HOME = $(abs_top_builddir)/bootstrap/icedtea
   INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink-ecj.stamp
-endif
+else
+  BOOTSTRAP_DIRECTORY_STAMP =
+  ICEDTEA_HOME = $(SYSTEM_JDK_DIR)
+  INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink.stamp
 endif
 
 # bootstrap/jdk1.6.0 to bootstrap/icedtea symlink.
@@ -2629,9 +2623,9 @@ stamps/bootstrap-directory-ecj.stamp: st
 	  bootstrap/ecj/lib/endorsed/xalan-j2-serializer.jar
 	ln -sf $(XERCES2_JAR) bootstrap/ecj/lib/endorsed/xerces-j2.jar
 	mkdir -p bootstrap/ecj/jre/lib; \
-	ln -sf $(SYSTEM_GCJ_DIR)/jre/lib/rt.jar \
+	ln -sf $(SYSTEM_JDK_DIR)/jre/lib/rt.jar \
 	  bootstrap/ecj/jre/lib/rt-system.jar; \
-	ln -sf $(SYSTEM_GCJ_DIR)/jre/lib/$(JRE_ARCH_DIR) \
+	ln -sf $(SYSTEM_JDK_DIR)/jre/lib/$(JRE_ARCH_DIR) \
 	  bootstrap/ecj/jre/lib/; \
 	if ! test -d bootstrap/ecj/jre/lib/$(INSTALL_ARCH_DIR); \
 	  then \
@@ -2639,11 +2633,11 @@ stamps/bootstrap-directory-ecj.stamp: st
 	    bootstrap/ecj/jre/lib/$(INSTALL_ARCH_DIR); \
 	fi; \
 	mkdir -p bootstrap/ecj/include; \
-	for i in $(SYSTEM_GCJ_DIR)/include/*; do \
+	for i in $(SYSTEM_JDK_DIR)/include/*; do \
 	  test -r $$i | continue; \
 	  i=`basename $$i`; \
 	  rm -f bootstrap/ecj/include/$$i; \
-	  ln -s $(SYSTEM_GCJ_DIR)/include/$$i bootstrap/ecj/include/$$i; \
+	  ln -s $(SYSTEM_JDK_DIR)/include/$$i bootstrap/ecj/include/$$i; \
 	done; \
 	if test -f $(abs_top_builddir)/bootstrap/jdk1.7.0/lib/tools.jar ; \
 	then \
@@ -2680,14 +2674,10 @@ clean-bootstrap-directory-symlink-ecj:
 # OpenJDK Targets
 # ===============
 
-if WITH_ICEDTEA
+if BOOTSTRAPPING
+  MEMORY_LIMIT =
+else
   MEMORY_LIMIT = -J-Xmx1024m
-else
-if WITH_OPENJDK
-  MEMORY_LIMIT = -J-Xmx512m
-else
-  MEMORY_LIMIT =
-endif
 endif
 
 if WITH_CACAO
diff -r 2341c4735ea7 -r f13e31f619e2 acinclude.m4
--- a/acinclude.m4	Wed Jul 15 13:39:06 2009 +0100
+++ b/acinclude.m4	Sat Jul 18 02:04:40 2009 +0100
@@ -91,42 +91,46 @@ AC_DEFUN([SET_OS_DIRS],
 
 AC_DEFUN([FIND_JAVAC],
 [
-  user_specified_javac=
-
-  CLASSPATH_WITH_ECJ
-  CLASSPATH_WITH_JAVAC
-
-  if test "x${ECJ}" = x && test "x${JAVAC}" = x && test "x${user_specified_javac}" != xecj; then
-      AC_MSG_ERROR([cannot find javac, try --with-ecj])
-  fi
-])
-
-AC_DEFUN([CLASSPATH_WITH_ECJ],
+  JAVAC=${SYSTEM_JDK_DIR}/bin/javac
+  IT_FIND_JAVAC
+  IT_FIND_ECJ
+
+  if test "x${JAVAC}" = x; then
+      AC_MSG_ERROR([cannot find a Java compiler, try --with-javac or --with-ecj])
+  fi
+  AC_SUBST(JAVAC)
+])
+
+AC_DEFUN([IT_FIND_ECJ],
 [
   AC_ARG_WITH([ecj],
 	      [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)],
   [
     if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
-      CLASSPATH_CHECK_ECJ(${withval})
+      IT_CHECK_ECJ(${withval})
     else
       if test "x${withval}" != xno; then
-        CLASSPATH_CHECK_ECJ
+        IT_CHECK_ECJ
       fi
     fi
-    user_specified_javac=ecj
   ],
   [ 
-    CLASSPATH_CHECK_ECJ
-  ])
-  JAVAC="${ECJ} -nowarn"
-  AC_SUBST(JAVAC)
-])
-
-AC_DEFUN([CLASSPATH_CHECK_ECJ],
+    IT_CHECK_ECJ
+  ])
+  if test "x${JAVAC}" = "x"; then
+    if test "x{ECJ}" != "x"; then
+      JAVAC="${ECJ} -nowarn"
+    fi
+  fi
+])
+
+AC_DEFUN([IT_CHECK_ECJ],
 [
   if test "x$1" != x; then
     if test -f "$1"; then
+      AC_MSG_CHECKING(for ecj)
       ECJ="$1"
+      AC_MSG_RESULT(${ECJ})
     else
       AC_PATH_PROG(ECJ, "$1")
     fi
@@ -144,31 +148,31 @@ AC_DEFUN([CLASSPATH_CHECK_ECJ],
   fi
 ])
 
-AC_DEFUN([CLASSPATH_WITH_JAVAC],
+AC_DEFUN([IT_FIND_JAVAC],
 [
   AC_ARG_WITH([javac],
 	      [AS_HELP_STRING(--with-javac,bytecode compilation with javac)],
   [
     if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
-      CLASSPATH_CHECK_JAVAC(${withval})
+      IT_CHECK_JAVAC(${withval})
     else
       if test "x${withval}" != xno; then
-        CLASSPATH_CHECK_JAVAC
+        IT_CHECK_JAVAC(${JAVAC})
       fi
     fi
-    user_specified_javac=javac
   ],
   [ 
-    CLASSPATH_CHECK_JAVAC
-  ])
-  AC_SUBST(JAVAC)
-])
-
-AC_DEFUN([CLASSPATH_CHECK_JAVAC],
+    IT_CHECK_JAVAC(${JAVAC})
+  ])
+])
+
+AC_DEFUN([IT_CHECK_JAVAC],
 [
   if test "x$1" != x; then
     if test -f "$1"; then
+      AC_MSG_CHECKING(for javac)
       JAVAC="$1"
+      AC_MSG_RESULT(${JAVAC})
     else
       AC_PATH_PROG(JAVAC, "$1")
     fi
@@ -179,20 +183,18 @@ AC_DEFUN([CLASSPATH_CHECK_JAVAC],
 
 AC_DEFUN([FIND_JAVA],
 [
+  AC_MSG_CHECKING(for java)
   AC_ARG_WITH([java],
               [AS_HELP_STRING(--with-java,specify location of the 1.5 java vm)],
   [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(java)
-      JAVA="${withval}"
-      AC_MSG_RESULT(${withval})
-    else
-      AC_PATH_PROG(JAVA, "${withval}")
-    fi
-  ],
-  [
-    JAVA=
-  ])
+    JAVA="${withval}"
+  ],
+  [
+    JAVA=${SYSTEM_JDK_DIR}/bin/java
+  ])
+  if ! test -f "${JAVA}"; then
+    AC_PATH_PROG(JAVA, "${JAVA}")
+  fi
   if test -z "${JAVA}"; then
     AC_PATH_PROG(JAVA, "gij")
   fi
@@ -202,6 +204,7 @@ AC_DEFUN([FIND_JAVA],
   if test -z "${JAVA}"; then
     AC_MSG_ERROR("A 1.5-compatible Java VM is required.")
   fi
+  AC_MSG_RESULT(${JAVA})
   AC_SUBST(JAVA)
 ])
 
@@ -277,20 +280,18 @@ AC_DEFUN([AC_CHECK_GCC_VERSION],
 
 AC_DEFUN([FIND_JAVAH],
 [
+  AC_MSG_CHECKING(for javah)
   AC_ARG_WITH([javah],
-              [AS_HELP_STRING(--with-javah,specify location of the javah)],
-  [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(for javah)
-      JAVAH="${withval}"
-      AC_MSG_RESULT(${withval})
-    else
-      AC_PATH_PROG(JAVAH, "${withval}")
-    fi
-  ],
-  [
-    JAVAH=
-  ])
+              [AS_HELP_STRING(--with-javah,specify location of the Java header generator)],
+  [
+    JAVAH="${withval}"
+  ],
+  [
+    JAVAH=${SYSTEM_JDK_DIR}/bin/javah
+  ])
+  if ! test -f "${JAVAH}"; then
+    AC_PATH_PROG(JAVAH, "${JAVAH}")
+  fi
   if test -z "${JAVAH}"; then
     AC_PATH_PROG(JAVAH, "gjavah")
   fi
@@ -298,27 +299,26 @@ AC_DEFUN([FIND_JAVAH],
     AC_PATH_PROG(JAVAH, "javah")
   fi
   if test -z "${JAVAH}"; then
-    AC_MSG_ERROR("javah was not found.")
-  fi
+    AC_MSG_ERROR("A Java header generator was not found.")
+  fi
+  AC_MSG_RESULT(${JAVAH})
   AC_SUBST(JAVAH)
 ])
 
 AC_DEFUN([FIND_JAR],
 [
+  AC_MSG_CHECKING(for jar)
   AC_ARG_WITH([jar],
-              [AS_HELP_STRING(--with-jar,specify location of the jar)],
-  [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(for jar)
-      JAR="${withval}"
-      AC_MSG_RESULT(${withval})
-    else
-      AC_PATH_PROG(JAR, "${withval}")
-    fi
-  ],
-  [
-    JAR=
-  ])
+              [AS_HELP_STRING(--with-jar,specify location of the Java archive tool (jar))],
+  [
+    JAR="${withval}"
+  ],
+  [
+    JAR=${SYSTEM_JDK_DIR}/bin/jar
+  ])
+  if ! test -f "${JAR}"; then
+    AC_PATH_PROG(JAR, "${JAR}")
+  fi
   if test -z "${JAR}"; then
     AC_PATH_PROG(JAR, "gjar")
   fi
@@ -326,8 +326,9 @@ AC_DEFUN([FIND_JAR],
     AC_PATH_PROG(JAR, "jar")
   fi
   if test -z "${JAR}"; then
-    AC_MSG_ERROR("jar was not found.")
-  fi
+    AC_MSG_ERROR("No Java archive tool was found.")
+  fi
+  AC_MSG_RESULT(${JAR})
   AC_MSG_CHECKING([whether jar supports @<file> argument])
   touch _config.txt
   cat >_config.list <<EOF
@@ -366,20 +367,18 @@ EOF
 
 AC_DEFUN([FIND_RMIC],
 [
+  AC_MSG_CHECKING(for rmic)
   AC_ARG_WITH([rmic],
-              [AS_HELP_STRING(--with-rmic,specify location of the rmic)],
-  [
-    if test -f "${withval}"; then
-      AC_MSG_CHECKING(for rmic)
-      RMIC="${withval}"
-      AC_MSG_RESULT(${withval})
-    else
-      AC_PATH_PROG(RMIC, "${withval}")
-    fi
-  ],
-  [
-    RMIC=
-  ])
+              [AS_HELP_STRING(--with-rmic,specify location of the RMI compiler)],
+  [
+    RMIC="${withval}"
+  ],
+  [
+    RMIC=${SYSTEM_JDK_DIR}/bin/rmic
+  ])
+  if ! test -f "${RMIC}"; then
+    AC_PATH_PROG(RMIC, "${RMIC}")
+  fi
   if test -z "${RMIC}"; then
     AC_PATH_PROG(RMIC, "grmic")
   fi
@@ -387,8 +386,9 @@ AC_DEFUN([FIND_RMIC],
     AC_PATH_PROG(RMIC, "rmic")
   fi
   if test -z "${RMIC}"; then
-    AC_MSG_ERROR("rmic was not found.")
-  fi
+    AC_MSG_ERROR("An RMI compiler was not found.")
+  fi
+  AC_MSG_RESULT(${RMIC})
   AC_SUBST(RMIC)
 ])
 
@@ -1155,116 +1155,67 @@ AC_DEFUN([AC_CHECK_WITH_HG_REVISION],
   AM_CONDITIONAL(WITH_HGREV, test "x${HGREV}" != "x")
 ])
 
-AC_DEFUN([AC_CHECK_FOR_GCJ_JDK],
-[
-  AC_MSG_CHECKING([for a GCJ JDK home directory])
-  AC_ARG_WITH([gcj-home],
-	      [AS_HELP_STRING([--with-gcj-home],
-                              [gcj home directory \
-                               (default is /usr/lib/jvm/java-gcj or /usr/lib/jvm/gcj-jdk)])],
+AC_DEFUN([IT_CHECK_IF_BOOTSTRAPPING],
+[
+  AC_MSG_CHECKING([whether to build a bootstrap version first])
+  AC_ARG_ENABLE([bootstrap],
+                [AS_HELP_STRING(--disable-bootstrap, don't build a bootstrap version [[default=no]])],
+  [
+    case "${enableval}" in
+      no)
+	enable_bootstrap=no
+        ;;
+      *)
+        enable_bootstrap=yes
+        ;;
+    esac
+  ],
+  [
+        enable_bootstrap=yes
+  ])
+  AC_MSG_RESULT([${enable_bootstrap}])
+  AM_CONDITIONAL([BOOTSTRAPPING], test x"${enable_bootstrap}" = "xyes")
+])
+
+AC_DEFUN([IT_CHECK_FOR_JDK],
+[
+  AC_MSG_CHECKING([for a JDK home directory])
+  AC_ARG_WITH([jdk-home],
+	      [AS_HELP_STRING([--with-jdk-home],
+                              [jdk home directory \
+                               (default is first predefined JDK found)])],
               [
                 if test "x${withval}" = xyes
                 then
-                  SYSTEM_GCJ_DIR=
+                  SYSTEM_JDK_DIR=
                 elif test "x${withval}" = xno
                 then
-	          SYSTEM_GCJ_DIR=
+	          SYSTEM_JDK_DIR=
 	        else
-                  SYSTEM_GCJ_DIR=${withval}
+                  SYSTEM_JDK_DIR=${withval}
                 fi
               ],
               [
-	        SYSTEM_GCJ_DIR=
+	        SYSTEM_JDK_DIR=
               ])
-  if test -z "${SYSTEM_GCJ_DIR}"; then
-    for dir in /usr/lib/jvm/java-gcj /usr/lib/jvm/gcj-jdk /usr/lib/jvm/cacao ; do
+  if test -z "${SYSTEM_JDK_DIR}"; then
+    if test "x${enable_bootstrap}" = "xyes"; then
+      BOOTSTRAP_VMS="/usr/lib/jvm/java-gcj /usr/lib/jvm/gcj-jdk /usr/lib/jvm/cacao";
+    fi
+    for dir in ${BOOTSTRAP_VMS} /usr/lib/jvm/java-openjdk \
+    	       /usr/lib/jvm/icedtea6 /usr/lib/jvm/java-6-openjdk \
+	       /usr/lib/jvm/openjdk /usr/lib/jvm/java-icedtea ; do
        if test -d $dir; then
-         SYSTEM_GCJ_DIR=$dir
+         SYSTEM_JDK_DIR=$dir
 	 break
        fi
     done
   fi
-  AC_MSG_RESULT(${SYSTEM_GCJ_DIR})
-  if ! test -d "${SYSTEM_GCJ_DIR}"; then
-    AC_MSG_ERROR("A GCJ JDK home directory could not be found.")
-  fi
-  AC_SUBST(SYSTEM_GCJ_DIR)
-])
-
-AC_DEFUN([AC_CHECK_FOR_OPENJDK],
-[
-  AC_MSG_CHECKING([for an existing OpenJDK installation])
-  AC_ARG_WITH([openjdk-home],
-              [AS_HELP_STRING([--with-openjdk-home],
-                              [OpenJDK home directory \
-                               (default is /usr/lib/jvm/java-openjdk)])],
-              [
-                if test "x${withval}" = xyes
-                then
-                  SYSTEM_OPENJDK_DIR=
-                elif test "x${withval}" = xno
-                then
-	          SYSTEM_OPENJDK_DIR=
-	        else
-                  SYSTEM_OPENJDK_DIR=${withval}
-                fi
-              ],
-              [
-                SYSTEM_OPENJDK_DIR=
-              ])
-  if test -z "${SYSTEM_OPENJDK_DIR}"; then



More information about the distro-pkg-dev mailing list