jamvm

changeset 400:5baaa2bcac6b

Support flipping between GNU Classpath and OpenJDK using configure (thanks to twisti).

2008-08-04 Andrew John Hughes <gnu_andrew@member.fsf.org>

* configure.ac:
Add --with-java-runtime-library from CACAO and
change --with-classpath-install-dir to
--with-java-runtime-library-install-dir.
* lib/Makefile.am,
* src/class.h,
* src/dll.c:
Define class library and native libs location
depending on value of --with-java-runtime-library.
author andrew
date Tue Aug 05 04:48:38 2008 +0100 (2008-08-05)
parents 2b94bfbe7ec6
children 3ca4c2fbbd7f
files ChangeLog configure.ac lib/Makefile.am src/class.h src/dll.c
line diff
     1.1 --- a/ChangeLog	Tue Aug 05 04:08:33 2008 +0100
     1.2 +++ b/ChangeLog	Tue Aug 05 04:48:38 2008 +0100
     1.3 @@ -5,6 +5,18 @@
     1.4  ==============
     1.5  2008-08-04  Andrew John Hughes  <gnu_andrew@member.fsf.org>
     1.6  
     1.7 +	* configure.ac:
     1.8 +	Add --with-java-runtime-library from CACAO and
     1.9 +	change --with-classpath-install-dir to
    1.10 +	--with-java-runtime-library-install-dir.
    1.11 +	* lib/Makefile.am,
    1.12 +	* src/class.h,
    1.13 +	* src/dll.c:
    1.14 +	Define class library and native libs location
    1.15 +	depending on value of --with-java-runtime-library.
    1.16 +
    1.17 +2008-08-04  Andrew John Hughes  <gnu_andrew@member.fsf.org>
    1.18 +
    1.19  	* lib/java/security/VMAccessController.java:
    1.20  	Remove ambiguity in call to java.security.CodeSource
    1.21  	constructor introduced by recent API changes.
     2.1 --- a/configure.ac	Tue Aug 05 04:08:33 2008 +0100
     2.2 +++ b/configure.ac	Tue Aug 05 04:48:38 2008 +0100
     2.3 @@ -193,15 +193,40 @@
     2.4          enable_ffi=no
     2.5       fi])
     2.6  
     2.7 -AC_ARG_WITH(classpath-install-dir,
     2.8 -    [AS_HELP_STRING(--with-classpath-install-dir=<dir>,installation directory of GNU classpath
     2.9 +AC_MSG_CHECKING(which Java runtime library to use)
    2.10 +AC_ARG_WITH([java-runtime-library],
    2.11 +            [AS_HELP_STRING(--with-java-runtime-library=<type>,specifies which type of classpath to use as Java runtime library (classpath,openjdk) [[default=classpath]])],
    2.12 +            [case "${withval}" in
    2.13 +	        gnuclasspath)
    2.14 +                    WITH_JAVA_RUNTIME_LIBRARY=classpath
    2.15 +                    AC_DEFINE([WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH], 1, [use GNU Classpath])
    2.16 +                    AC_SUBST(WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH)
    2.17 +                    ;;
    2.18 +                openjdk)
    2.19 +                    WITH_JAVA_RUNTIME_LIBRARY=openjdk
    2.20 +                    AC_DEFINE([WITH_JAVA_RUNTIME_LIBRARY_OPENJDK], 1, [use OpenJDK's Java SE classes])
    2.21 +                    AC_SUBST(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
    2.22 +                    ;;
    2.23 +                *)
    2.24 +                    AC_MSG_ERROR(unknown classpath ${withval})
    2.25 +                    ;;
    2.26 +             esac],
    2.27 +            [WITH_JAVA_RUNTIME_LIBRARY=classpath
    2.28 +             AC_DEFINE([WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH], 1, [use GNU Classpath])
    2.29 +             AC_SUBST(WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH)])
    2.30 +AC_MSG_RESULT(${WITH_JAVA_RUNTIME_LIBRARY})
    2.31 +AM_CONDITIONAL([WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH], test x"${WITH_JAVA_RUNTIME_LIBRARY}" = "xclasspath")
    2.32 +AM_CONDITIONAL([WITH_JAVA_RUNTIME_LIBRARY_OPENJDK], test x"${WITH_JAVA_RUNTIME_LIBRARY}" = "xopenjdk")
    2.33 +
    2.34 +AC_ARG_WITH(java-runtime-library-install-dir,
    2.35 +    [AS_HELP_STRING(--with-java-runtime-library-install-dir=<dir>,installation directory of Java runtime library
    2.36                     (default /usr/local/classpath))],,
    2.37 -    [with_classpath_install_dir=/usr/local/classpath])
    2.38 +    [with_runtime_install_dir=/usr/local/classpath])
    2.39  
    2.40 -AC_DEFINE_UNQUOTED(CLASSPATH_INSTALL_DIR, "$with_classpath_install_dir",
    2.41 -    [GNU Classpath installation directory (prefix)])
    2.42 +AC_DEFINE_UNQUOTED(RUNTIME_INSTALL_DIR, "$with_runtime_install_dir",
    2.43 +    [Java runtime library installation directory (prefix)])
    2.44  
    2.45 -AC_SUBST(with_classpath_install_dir)
    2.46 +AC_SUBST(with_runtime_install_dir)
    2.47  
    2.48  if test "$prefix" = "NONE"; then
    2.49      install_dir=$ac_default_prefix
     3.1 --- a/lib/Makefile.am	Tue Aug 05 04:08:33 2008 +0100
     3.2 +++ b/lib/Makefile.am	Tue Aug 05 04:48:38 2008 +0100
     3.3 @@ -19,8 +19,15 @@
     3.4  ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     3.5  ##
     3.6  
     3.7 -CP_LIB_DIR = ${with_classpath_install_dir}/share/classpath
     3.8 +if WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH
     3.9 +CP_LIB_DIR = ${with_runtime_install_dir}/share/classpath
    3.10  GLIBJ_ZIP  = ${CP_LIB_DIR}/glibj.zip
    3.11 +else
    3.12 +if WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
    3.13 +CP_LIB_DIR = ${with_runtime_install_dir}/jre/lib
    3.14 +GLIBJ_ZIP  = ${CP_LIB_DIR}/rt.jar
    3.15 +endif
    3.16 +endif
    3.17  
    3.18  SUBDIRS = jamvm java gnu sun
    3.19  EXTRA_DIST = classes.zip README
     4.1 --- a/src/class.h	Tue Aug 05 04:08:33 2008 +0100
     4.2 +++ b/src/class.h	Tue Aug 05 04:48:38 2008 +0100
     4.3 @@ -40,10 +40,18 @@
     4.4  
     4.5  #ifdef USE_ZIP
     4.6  #define JAMVM_CLASSES INSTALL_DIR"/share/jamvm/classes.zip"
     4.7 -#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath/glibj.zip"
     4.8 +#ifdef WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH
     4.9 +#define CLASSPATH_CLASSES RUNTIME_INSTALL_DIR"/share/classpath/glibj.zip"
    4.10 +#elif WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
    4.11 +#define CLASSPATH_CLASSES RUNTIME_INSTALL_DIR"/jre/lib/rt.jar"
    4.12 +#endif
    4.13  #else
    4.14  #define JAMVM_CLASSES INSTALL_DIR"/share/jamvm/classes"
    4.15 -#define CLASSPATH_CLASSES CLASSPATH_INSTALL_DIR"/share/classpath"
    4.16 +#ifdef WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH
    4.17 +#define CLASSPATH_CLASSES RUNTIME_INSTALL_DIR"/share/classpath"
    4.18 +#elif WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
    4.19 +#define CLASSPATH_CLASSES RUNTIME_INSTALL_DIR"/jre/lib"
    4.20 +#endif
    4.21  #endif
    4.22  
    4.23  #define DFLT_BCP JAMVM_CLASSES":"CLASSPATH_CLASSES
     5.1 --- a/src/dll.c	Tue Aug 05 04:08:33 2008 +0100
     5.2 +++ b/src/dll.c	Tue Aug 05 04:48:38 2008 +0100
     5.3 @@ -306,7 +306,14 @@
     5.4  }
     5.5  
     5.6  char *getBootDllPath() {
     5.7 -    return CLASSPATH_INSTALL_DIR"/lib/classpath";
     5.8 +#ifdef WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH
     5.9 +    return RUNTIME_INSTALL_DIR"/lib/classpath";
    5.10 +#elif WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
    5.11 +    if (strncmp(OS_ARCH, "x86_64", 6) == 0)
    5.12 +      return RUNTIME_INSTALL_DIR"/jre/lib/amd64";
    5.13 +    else
    5.14 +      return RUNTIME_INSTALL_DIR"/jre/lib/"OS_ARCH;
    5.15 +#endif
    5.16  }
    5.17  
    5.18  char *getDllName(char *name) {