src/vm/vm.c (vm_exit): only set JVMTI_PHASE_DEAD if a jvmti agent or a jvmti environm...
[cacao.git] / configure.ac
index 2438a184d42e2f78adf7ad094662e6706696b66d..db2f33a4c8794c5a26143a9b458ba022c32927fb 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(cacao, 0.94, cacao@cacaojvm.org)
+AC_INIT(cacao, 0.95+svn, cacao@cacaojvm.org)
 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
 AC_CANONICAL_HOST
 AC_PREREQ(2.59)
@@ -14,80 +14,96 @@ AC_PREFIX_DEFAULT(/usr/local/cacao)
 
 dnl set optimization and debugging for all architectures and systems
 if test x"$CFLAGS" = "x"; then
-       CFLAGS="-O2 -g3"
+    CFLAGS="-O0 -g3"
 fi
 
 dnl system type
 case "$host_cpu" in
 alpha | alphaev56 | alphapca56 )
-       ARCH_DIR="alpha"
-       CFLAGS="$CFLAGS -mieee -D__ALPHA__"
-       ;;
+    ARCH_DIR="alpha"
+    CFLAGS="$CFLAGS -mieee -D__ALPHA__"
+    ;;
 
-arm | armv4tl | armv5b )
-       ARCH_DIR="arm"
-       CFLAGS="$CFLAGS -D__ARM__"
-       ;;
+arm | armv4tl | armv5b | armv5l )
+    ARCH_DIR="arm"
+    CFLAGS="$CFLAGS -D__ARM__"
+    ;;
 
 i386 | i486 | i586 | i686 )
-       ARCH_DIR="i386"
-       CFLAGS="$CFLAGS -D__I386__"
-       ;;
+    ARCH_DIR="i386"
+    CFLAGS="$CFLAGS -D__I386__"
+    ;;
 
 mips )
-       ARCH_DIR="mips"
-       CFLAGS="$CFLAGS -D__MIPS__"
-       ;;
+    ARCH_DIR="mips"
+    CFLAGS="$CFLAGS -D__MIPS__"
+    ;;
 
 powerpc )
-       ARCH_DIR="powerpc"
-       CFLAGS="$CFLAGS -D__POWERPC__"
-       ;;
+    ARCH_DIR="powerpc"
+    CFLAGS="$CFLAGS -D__POWERPC__"
+    ;;
 
 powerpc64 )
-       ARCH_DIR="powerpc64"
-       CFLAGS="$CFLAGS -D__POWERPC64__"
-       ;;
+    ARCH_DIR="powerpc64"
+    CFLAGS="$CFLAGS -D__POWERPC64__"
+    ;;
 
 x86_64 )
-       ARCH_DIR="x86_64"
-       CFLAGS="$CFLAGS -D__X86_64__"
-       ;;
+    ARCH_DIR="x86_64"
+    CFLAGS="$CFLAGS -D__X86_64__"
+    ;;
 
 xdspcore )
-       ARCH_DIR="xdspcore"
-       ENABLE_STATICVM="yes"
-       CFLAGS="$CFLAGS -D__XDSPCORE__"
-       USE_SCHEDULER="1"
-       ;;
+    ARCH_DIR="xdspcore"
+    ENABLE_STATICVM="yes"
+    CFLAGS="$CFLAGS -D__XDSPCORE__"
+    USE_SCHEDULER="1"
+    ;;
+
 * )
-       AC_MSG_ERROR($host_cpu systems are not supported at this time)
-        ;;
+    AC_MSG_ERROR($host_cpu systems are not supported at this time)
+    ;;
 esac
 
 dnl host type
 case "$host_os" in
-*linux* | *Linux* )
-       OS_DIR="linux"
-        CFLAGS="$CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
-       ;;
 *darwin* )
-       OS_DIR="darwin"
-        CFLAGS="$CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
-        ;;
+    OS_DIR="darwin"
+    CFLAGS="$CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
+    ;;
+
 *freebsd* )
-       OS_DIR="freebsd"
-       CFLAGS="$CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
-       ;;
+    OS_DIR="freebsd"
+    CFLAGS="$CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
+    ;;
+
 *irix* )
-       OS_DIR="irix"
-        CFLAGS="$CFLAGS -D__IRIX__"
-        ;;
+    OS_DIR="irix"
+    CFLAGS="$CFLAGS -D__IRIX__"
+    ;;
+
+*linux* | *Linux* )
+    OS_DIR="linux"
+    CFLAGS="$CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    ;;
+
+*netbsd* )
+    OS_DIR="netbsd"
+    CFLAGS="$CFLAGS -D__NETBSD__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    ;;
+
 * )
-       ;;
+    ;;
 esac
 
 
+dnl define some stuff required for --fullversion
+AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
+AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
+AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$CFLAGS", [CFLAGS used])
+
+
 dnl define and substitute some architecture specific variables
 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
 AC_SUBST(ARCH_DIR)
@@ -101,15 +117,10 @@ AM_PROG_AS
 AC_PROG_LD
 AC_PROG_LD_GNU
 AC_PROG_RANLIB
-AC_DISABLE_SHARED
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AM_PROG_MKDIR_P
 
-dnl libtool stuff
-AC_LIBTOOL_DLOPEN
-AC_PROG_LIBTOOL
-
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
@@ -154,15 +165,6 @@ AC_CHECK_SIZEOF(void *)
 AC_C_BIGENDIAN
 
 
-dnl check which ld flags are required to export symbols
-if test x"$with_gnu_ld" = "xyes"; then
-    EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic"
-else
-    EXPORT_SYMBOLS_FLAGS=""
-fi
-AC_SUBST(EXPORT_SYMBOLS_FLAGS)
-
-
 dnl define install prefix
 if test "x$prefix" = "xNONE"; then
     CACAO_PREFIX=$ac_default_prefix
@@ -194,6 +196,22 @@ if test x"${ENABLE_JIT}" = "xyes"; then
 fi
 
 
+dnl check if softfloat should be used
+AC_MSG_CHECKING(whether softfloat should be used)
+AC_ARG_ENABLE([softfloat],
+              [AS_HELP_STRING(--enable-softfloat,use softfloat [[default=no]])],
+              [case "${enableval}" in
+                  yes) ENABLE_SOFTFLOAT=yes;;
+                  *) ENABLE_SOFTFLOAT=no;;
+               esac],
+              [ENABLE_SOFTFLOAT=no])
+AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
+
+if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
+    AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
+fi
+
+
 dnl check for interpreter
 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
 
@@ -287,6 +305,26 @@ AC_ARG_ENABLE([debug],
 
 if test x"${NDEBUG}" = "xno"; then
     AC_MSG_RESULT(yes)
+else
+    AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
+
+
+dnl check for disassembler support
+AC_MSG_CHECKING(whether disassembler should be enabled)
+AC_ARG_ENABLE([disassembler],
+              [AS_HELP_STRING(--disable-disassembler,disable disassembler [[default=yes]])],
+              [case "${enableval}" in
+                   no) ENABLE_DISASSEMBLER=no;;
+                   *) ENABLE_DISASSEMBLER=yes;;
+               esac],
+              [ENABLE_DISASSEMBLER=yes])
+AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
+AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
+
+if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
+    AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
 
     dnl check for binutils headers and libraries on some architectures for the
     dnl disassembler
@@ -298,14 +336,14 @@ if test x"${NDEBUG}" = "xno"; then
             AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
 
             case "${OS_DIR}" in
-                cygwin | darwin )
-                     AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from bintuils))])
+                cygwin | darwin | netbsd )
+                     AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
                      ;;
             esac
 
-            AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from bintuils))])
-            AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from bintuils))])
-            AC_CHECK_LIB(opcodes, init_disassemble_info,, [AC_MSG_ERROR(cannot find libopcodes (from bintuils))])
+            AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
+            AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
+            AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
             AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
             ;;
@@ -313,22 +351,20 @@ if test x"${NDEBUG}" = "xno"; then
             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
             ;;
     esac
-
 else
-    AC_MSG_RESULT(no)
+    AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
 fi
-AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xno")
 
 
 dnl check for statistics
 AC_MSG_CHECKING(whether statistics generation should be enabled)
 AC_ARG_ENABLE([statistics],
-              [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])],
+              [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
               [case "${enableval}" in
-                   no) ENABLE_STATISTICS=no;;
-                   *) ENABLE_STATISTICS=yes;;
+                   yes) ENABLE_STATISTICS=yes;;
+                   *) ENABLE_STATISTICS=no;;
                esac],
-              [ENABLE_STATISTICS=yes])
+              [ENABLE_STATISTICS=no])
 AC_MSG_RESULT(${ENABLE_STATISTICS})
 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
 
@@ -337,6 +373,57 @@ if test x"${ENABLE_STATISTICS}" = "xyes"; then
 fi
 
 
+dnl check for verifier
+AC_MSG_CHECKING(whether classfile verification should be enabled)
+AC_ARG_ENABLE([verifier],
+              [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
+              [case "${enableval}" in
+                   no) ENABLE_VERIFIER=no;;
+                   *) ENABLE_VERIFIER=yes;;
+               esac],
+              [ENABLE_VERIFIER=yes])
+AC_MSG_RESULT(${ENABLE_VERIFIER})
+AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
+
+if test x"${ENABLE_VERIFIER}" = "xyes"; then
+    AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
+fi
+
+
+dnl check for compiler timing
+AC_MSG_CHECKING(whether real-time timing should be enabled)
+AC_ARG_ENABLE([rt-timing],
+              [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
+              [case "${enableval}" in
+                   yes) ENABLE_RT_TIMING=yes;;
+                   *) ENABLE_RT_TIMING=no;;
+               esac],
+              [ENABLE_RT_TIMING=no])
+AC_MSG_RESULT(${ENABLE_RT_TIMING})
+AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
+
+if test x"${ENABLE_RT_TIMING}" = "xyes"; then
+    AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
+fi
+
+
+dnl check for cycle count statistics
+AC_MSG_CHECKING(whether cycle count statistics should be enabled)
+AC_ARG_ENABLE([cycles-stats],
+              [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
+              [case "${enableval}" in
+                   yes) ENABLE_CYCLES_STATS=yes;;
+                   *) ENABLE_CYCLES_STATS=no;;
+               esac],
+              [ENABLE_CYCLES_STATS=no])
+AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
+AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
+
+if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
+    AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
+fi
+
+
 dnl check for JVMTI
 AC_MSG_CHECKING(whether to compile JVMTI support)
 AC_ARG_ENABLE([jvmti],
@@ -362,37 +449,26 @@ AC_MSG_CHECKING(whether to include threads support)
 enable_threads=${enable_threads:-native}
 case "$enable_threads" in
 no | none | single)
-       AC_MSG_RESULT(no)
-       dnl no threads for boehm
-       ac_configure_args="$ac_configure_args --disable-boehm-threads"
-       AM_CONDITIONAL([USE_THREADS], [false])
-       AM_CONDITIONAL([NATIVE_THREADS], [false])
-       ;;
-
-green | native | posix | pthreads)
-       AC_DEFINE([USE_THREADS], 1, [use threads])
-
-       AM_CONDITIONAL([USE_THREADS], [true])
-
-       if test x"$enable_threads" != "xgreen"; then
-               AC_MSG_RESULT(yes, native)
-                AC_CHECK_LIB(pthread, main)
-               AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
-
-               CFLAGS="$CFLAGS -D_REENTRANT"
-
-               dnl tell boehm to support threads as well
-               ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
-               AM_CONDITIONAL([NATIVE_THREADS], [true])
-
-       else
-               AC_MSG_RESULT(yes, green)
+    AC_MSG_RESULT(no)
+    dnl no threads for boehm
+    ac_configure_args="$ac_configure_args --disable-boehm-threads"
+    AM_CONDITIONAL([ENABLE_THREADS], [false])
+    ;;
 
-               dnl no threads for boehm
-               ac_configure_args="$ac_configure_args --disable-boehm-threads"
-               AM_CONDITIONAL([NATIVE_THREADS], [false])
-       fi
+native | posix | pthreads)
+    AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
+    
+    AM_CONDITIONAL([ENABLE_THREADS], [true])
+    
+    AC_MSG_RESULT(yes, native)
+    AC_CHECK_LIB(pthread, main)
+    
+    CFLAGS="$CFLAGS -D_REENTRANT"
+    
+    dnl tell boehm to support threads as well
+    ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
     ;;
+
 *)
     AC_MSG_ERROR($enable_threads is an unknown thread package)
     ;;
@@ -419,10 +495,61 @@ else
 fi
 
 
+dnl check if if-conversion should be supported
+AC_MSG_CHECKING(whether if-conversion should be supported)
+AC_ARG_ENABLE([ifconv],
+              [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
+              [case "${enableval}" in
+                   no) ENABLE_IFCONV=no;;
+                   *) ENABLE_IFCONV=yes;;
+               esac],
+              [ENABLE_IFCONV=yes])
+AC_MSG_RESULT(${ENABLE_IFCONV})
+AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
+   
+if test x"${ENABLE_IFCONV}" = "xyes"; then
+    AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
+fi
+
+
+dnl check for inlining
+AC_MSG_CHECKING(whether method inlining should be supported)
+AC_ARG_ENABLE([inlining],
+              [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])],
+              [case "${enableval}" in
+                   no) ENABLE_INLINING=no;;
+                   *) ENABLE_INLINING=yes;;
+               esac],
+              [ENABLE_INLINING=yes])
+AC_MSG_RESULT(${ENABLE_INLINING})
+AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
+
+if test x"${ENABLE_INLINING}" = "xyes"; then
+    AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
+fi
+
+
+dnl check for loop optimization
+AC_MSG_CHECKING(whether loop optimization should be supported)
+AC_ARG_ENABLE([loop],
+              [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
+              [case "${enableval}" in
+                   yes) ENABLE_LOOP=yes;;
+                   *) ENABLE_LOOP=no;;
+               esac],
+              [ENABLE_LOOP=no])
+AC_MSG_RESULT(${ENABLE_LOOP})
+AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
+
+if test x"${ENABLE_LOOP}" = "xyes"; then
+    AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
+fi
+
+
 dnl check if linear scan register allocator(lsra) should be used
 AC_MSG_CHECKING(whether lsra should be supported)
 AC_ARG_ENABLE([lsra],
-              [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])],
+              [AS_HELP_STRING(--disable-lsra,disable linear scan register allocator [[default=yes]])],
               [case "${enableval}" in
                    no) ENABLE_LSRA=no;;
                    *) ENABLE_LSRA=yes;;
@@ -436,18 +563,21 @@ if test x"${ENABLE_LSRA}" = "xyes"; then
 fi
 
 
-dnl check for inlining
-dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])])
-
-dnl AC_MSG_CHECKING(whether method inlining should be disabled)
-dnl if test x"$enable_inlining" = "xno"; then
-dnl    AC_MSG_RESULT(yes)
-dnl    AM_CONDITIONAL([USE_INLINING], [false])
-dnl else
-dnl    AC_MSG_RESULT(no)
-       AC_DEFINE([USE_INLINING], 1, [use method inlining])
-       AM_CONDITIONAL([USE_INLINING], [true])
-dnl fi
+dnl check if profiling should be supported
+AC_MSG_CHECKING(whether profiling should be supported)
+AC_ARG_ENABLE([profiling],
+              [AS_HELP_STRING(--disable-profiling,disable profiling [[default=yes]])],
+              [case "${enableval}" in
+                   no) ENABLE_PROFILING=no;;
+                   *) ENABLE_PROFILING=yes;;
+               esac],
+              [ENABLE_PROFILING=yes])
+AC_MSG_RESULT(${ENABLE_PROFILING})
+AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
+   
+if test x"${ENABLE_PROFILING}" = "xyes"; then
+    AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
+fi
 
 
 dnl check for instruction scheduler
@@ -473,12 +603,12 @@ fi
 
 
 dnl check if zlib should be used
-AC_MSG_CHECKING(whether zip archives should be supported)
+AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
 AC_ARG_ENABLE([zlib],
-              [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])],
+              [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
               [case "${enableval}" in
-                  no) ENABLE_ZLIB=yes;;
-                  *) ENABLE_ZLIB=no;;
+                  no) ENABLE_ZLIB=no;;
+                  *) ENABLE_ZLIB=yes;;
                esac],
               [ENABLE_ZLIB=yes])
 AC_MSG_RESULT(${ENABLE_ZLIB})
@@ -488,30 +618,56 @@ if test x"${ENABLE_ZLIB}" = "xyes"; then
     AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
     AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
     AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
+    VM_ZIP_STRING=vm.zip
+else
+    VM_ZIP_STRING=classes/
 fi
+AC_DEFINE_UNQUOTED(VM_ZIP_STRING, "${VM_ZIP_STRING}", [define to the string base name of the VM zip file])
+AC_SUBST(VM_ZIP_STRING)
 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
 
 
+dnl check if a libjvm.so should be built
+AC_MSG_CHECKING(whether to build a libjvm.so)
+AC_ARG_ENABLE([libjvm],
+              [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
+              [case "${enableval}" in
+                  no) ENABLE_LIBJVM=no;;
+                  *) ENABLE_LIBJVM=yes;;
+               esac],
+              [ENABLE_LIBJVM=yes])
+AC_MSG_RESULT(${ENABLE_LIBJVM})
+AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
+AC_SUBST(ENABLE_LIBJVM)
+
+if test x"${ENABLE_LIBJVM}" = "xyes"; then
+    AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
+
+    dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
+    enable_shared=yes
+    enable_static=no
+else
+    enable_shared=no
+    enable_static=yes
+fi
+
+dnl libtool stuff
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+
+
 dnl check if CACAO should be linked statically
-AC_MSG_CHECKING(whether to link GNU classpath native libraries statically into CACAO)
+AC_MSG_CHECKING(whether to link CACAO statically)
 AC_ARG_ENABLE([staticvm],
-              [AS_HELP_STRING(--enable-staticvm, link GNU classpath native libraries statically into CACAO [[default=no]])],
+              [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
               [case "${enableval}" in
-                  yes) ENABLE_STATICVM=yes;;
+                  yes) ENABLE_STATICVM=yes
+                       AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
+                       ;;
                   *) ENABLE_STATICVM=no;;
                esac],
               [ENABLE_STATICVM=no])
 AC_MSG_RESULT(${ENABLE_STATICVM})
-
-if test x"${ENABLE_STATICVM}" = "xyes"; then
-    AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
-
-    dnl check for some classpath related stuff when we link statically
-    AM_ICONV_LINK
-else
-    AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
-    AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
-fi
 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
 AC_SUBST(ENABLE_STATICVM)
 
@@ -536,28 +692,60 @@ AC_MSG_RESULT(${CLASSPATH_LIBDIR})
 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [GNU Classpath libraries installation directory])
-
 AC_SUBST(CLASSPATH_LIBDIR)
 
+AC_MSG_CHECKING(where GNU Classpath headers are installed)
+AC_ARG_WITH([classpath-includedir],
+            [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of GNU Classpath headers [[default=/usr/local/classpath/include]])],
+            [CLASSPATH_INCLUDEDIR=${withval}],
+            [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
+AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
+
+AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
+                [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [GNU Classpath jni.h header])],
+                [AC_MSG_ERROR(cannot find jni.h)])
+
+
+dnl check if GNU Classpath should be linked statically into CACAO
+AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
+AC_ARG_WITH([static-classpath],
+            [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
+            [case "${enableval}" in
+                yes) WITH_STATIC_CLASSPATH=yes;;
+                *) WITH_STATIC_CLASSPATH=no;;
+             esac],
+            [WITH_STATIC_CLASSPATH=no])
+AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
+
+if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
+    AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
+
+    dnl check for some classpath related stuff when we link statically
+    AM_ICONV_LINK
+else
+    AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
+    AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
+fi
+AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
+AC_SUBST(WITH_STATIC_CLASSPATH)
 
 
 dnl Maybe the user has Classpath installed 'flat'.
-AC_ARG_WITH([flat-classpath], [AS_HELP_STRING(--with-flat-classpath, GNU Classpath is not zipped in the install directory)])
+AC_ARG_WITH([flat-classpath],
+            [AS_HELP_STRING(--with-flat-classpath, GNU Classpath is not zipped in the install directory)])
+
 if test x"$with_flat_classpath" = "x"; then
-       GLIBJZ=glibj.zip
+    GLIBJ_ZIP_STRING=glibj.zip
 else
-       GLIBJZ=
+    GLIBJ_ZIP_STRING=
 fi
-AC_SUBST(GLIBJZ)
-AC_DEFINE_UNQUOTED(GLIBJZ_STRING, "$GLIBJZ", [define to the string base name of the classpath zip file])
+AC_SUBST(GLIBJ_ZIP_STRING)
+AC_DEFINE_UNQUOTED(GLIBJ_ZIP_STRING, "$GLIBJ_ZIP_STRING", [define to the string base name of the classpath zip file])
 
 
 dnl check for some programs we need
 AC_PROG_JAVAC
-AC_PATH_PROG(ZIP, zip)
-if test -z "${ZIP}"; then
-    AC_MSG_ERROR([cannot find zip])
-fi
+AC_PROG_JAR
 
 
 dnl now configure subpackages
@@ -565,6 +753,7 @@ dnl the export is not my favorite (is there another way?)
 export CFLAGS
 AC_CONFIG_SUBDIRS(src/boehm-gc)
 
+
 AC_CONFIG_FILES([Makefile]
                [contrib/Makefile]
                [contrib/setenvinstalled]
@@ -584,10 +773,12 @@ AC_CONFIG_FILES([Makefile]
                [src/native/tools/Makefile]
                [src/native/vm/Makefile]
                [src/scripts/Makefile]
+               [src/scripts/jarsigner]
                [src/scripts/java]
+               [src/scripts/keytool]
+               [src/scripts/rmic]
                [src/scripts/rmiregistry]
                [src/threads/Makefile]
-               [src/threads/green/Makefile]
                [src/threads/native/Makefile]
                [src/toolbox/Makefile]
                [src/vm/Makefile]
@@ -599,6 +790,7 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/i386/Makefile]
                [src/vm/jit/i386/freebsd/Makefile]
                [src/vm/jit/i386/linux/Makefile]
+               [src/vm/jit/ifconv/Makefile]
                [src/vm/jit/intrp/Makefile]
                [src/vm/jit/inline/Makefile]
                [src/vm/jit/loop/Makefile]
@@ -608,6 +800,8 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/powerpc/Makefile]
                [src/vm/jit/powerpc/darwin/Makefile]
                [src/vm/jit/powerpc/linux/Makefile]
+               [src/vm/jit/powerpc/netbsd/Makefile]
+               [src/vm/jit/profile/Makefile]
                [src/vm/jit/schedule/Makefile]
                [src/vm/jit/tools/Makefile]
                [src/vm/jit/verify/Makefile]