Merged with tip.
[cacao.git] / configure.ac
index 57f25442f5fbdd4793b7529b5efca23c475ebf0b..1dbd15e1f8afc1490c9d154ec80a75e7f6d86415 100644 (file)
@@ -1,9 +1,7 @@
 dnl configure.ac
 dnl
 dnl configure.ac
 dnl
-dnl Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
-dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-dnl J. Wenninger, Institut f. Computersprachen - TU Wien
+dnl Copyright (C) 1996-2005, 2006, 2007, 2008
+dnl CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 dnl 
 dnl This file is part of CACAO.
 dnl 
 dnl 
 dnl This file is part of CACAO.
 dnl 
@@ -21,17 +19,15 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 dnl 02110-1301, USA.
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 dnl 02110-1301, USA.
-dnl 
-dnl $Id: configure.ac 7596 2007-03-28 21:05:53Z twisti $
 
 dnl Process this file with autoconf to produce a configure script.
 
 
 
 dnl Process this file with autoconf to produce a configure script.
 
 
-AC_INIT(cacao, 0.97+svn, cacao@cacaojvm.org)
+AC_INIT(cacao, 1.1.0pre, cacao@cacaojvm.org)
 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
 AC_CANONICAL_HOST
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
 AC_CANONICAL_HOST
 AC_PREREQ(2.59)
-AM_INIT_AUTOMAKE([1.9.0])
+AM_INIT_AUTOMAKE([1.9.0 dist-bzip2 tar-ustar])
 AM_MAINTAINER_MODE
 
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE
 
 AM_CONFIG_HEADER([config.h])
@@ -39,78 +35,96 @@ AM_CONFIG_HEADER([config.h])
 AC_PREFIX_DEFAULT(/usr/local/cacao)
 
 
 AC_PREFIX_DEFAULT(/usr/local/cacao)
 
 
-dnl set optimization and debugging for all architectures and systems
+dnl Set optimization and debugging for all architectures and systems.
 if test x"$CFLAGS" = "x"; then
 if test x"$CFLAGS" = "x"; then
-    OPT_CFLAGS="-O0 -g3"
+    OPT_CFLAGS="-O0 -g"
 else
     OPT_CFLAGS=$CFLAGS
 fi
 
 else
     OPT_CFLAGS=$CFLAGS
 fi
 
+if test x"$CXXFLAGS" = "x"; then
+    OPT_CXXFLAGS="-O0 -g"
+else
+    OPT_CXXFLAGS=$CXXFLAGS
+fi
+
 dnl system type
 case "$host_cpu" in
 alpha | alphaev56 | alphapca56 )
     ARCH_DIR="alpha"
 dnl system type
 case "$host_cpu" in
 alpha | alphaev56 | alphapca56 )
     ARCH_DIR="alpha"
-    ARCH_CFLAGS="-mieee -D__ALPHA__"
+    ARCH_FLAGS="-mieee -D__ALPHA__"
+    JAVA_ARCH="alpha"
     ;;
 
     ;;
 
-arm | armv4tl | armv5b | armv5l )
+arm | armv4 | armv4tl | armv5b | armv5l )
     ARCH_DIR="arm"
     ARCH_DIR="arm"
-    ARCH_CFLAGS="-D__ARM__"
+    ARCH_FLAGS="-D__ARM__"
+    JAVA_ARCH="arm"
     ;;
 
 hppa2.0 )
     ARCH_DIR="parisc"
     ;;
 
 hppa2.0 )
     ARCH_DIR="parisc"
-    ARCH_CFLAGS="-D__PARISC__"
+    ARCH_FLAGS="-D__PARISC__"
+    JAVA_ARCH="hppa"
     ;;
 
 i386 | i486 | i586 | i686 )
     ARCH_DIR="i386"
     ;;
 
 i386 | i486 | i586 | i686 )
     ARCH_DIR="i386"
-    ARCH_CFLAGS="-D__I386__"
+    ARCH_FLAGS="-D__I386__"
+    JAVA_ARCH="i386"
     ;;
 
 m68k )
     ARCH_DIR="m68k"
     ;;
 
 m68k )
     ARCH_DIR="m68k"
-    ARCH_CFLAGS="-D__M68K__"
+    ARCH_FLAGS="-D__M68K__"
+    JAVA_ARCH="m68k"
     ;;
 
 mips | mipsel )
     ARCH_DIR="mips"
     ;;
 
 mips | mipsel )
     ARCH_DIR="mips"
-    ARCH_CFLAGS="-D__MIPS__"
+    ARCH_FLAGS="-D__MIPS__"
+    dnl Is this correct for mipsel?
+    JAVA_ARCH="mips"
     ;;
 
 powerpc )
     ARCH_DIR="powerpc"
     ;;
 
 powerpc )
     ARCH_DIR="powerpc"
-    ARCH_CFLAGS="-D__POWERPC__"
+    ARCH_FLAGS="-D__POWERPC__"
+    JAVA_ARCH="ppc"
     ;;
 
 powerpc64 )
     ARCH_DIR="powerpc64"
     ;;
 
 powerpc64 )
     ARCH_DIR="powerpc64"
-    ARCH_CFLAGS="-D__POWERPC64__"
+    ARCH_FLAGS="-D__POWERPC64__"
+    JAVA_ARCH="ppc64"
+    ;;
+
+s390 )
+    ARCH_DIR="s390"
+    ARCH_FLAGS="-D__S390__"
+    JAVA_ARCH="s390"
     ;;
 
 sparc | sparc64 )
     ARCH_DIR="sparc64"
     ;;
 
 sparc | sparc64 )
     ARCH_DIR="sparc64"
-    ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
+    ARCH_FLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
+    dnl Is this correct for 64-bits?
+    JAVA_ARCH="sparc"
     ;;
 
 x86_64 )
     ARCH_DIR="x86_64"
     ;;
 
 x86_64 )
     ARCH_DIR="x86_64"
-    ARCH_CFLAGS="-D__X86_64__"
+    ARCH_FLAGS="-m64 -D__X86_64__"
+    JAVA_ARCH="amd64"
     ;;
 
 xdspcore )
     ARCH_DIR="xdspcore"
     ENABLE_STATICVM="yes"
     ;;
 
 xdspcore )
     ARCH_DIR="xdspcore"
     ENABLE_STATICVM="yes"
-    ARCH_CFLAGS="-D__XDSPCORE__"
+    ARCH_FLAGS="-D__XDSPCORE__"
     USE_SCHEDULER="1"
     ;;
 
     USE_SCHEDULER="1"
     ;;
 
-s390 )
-    ARCH_DIR="s390"
-    ARCH_CFLAGS="-D__S390__"
-    ;;
-
-
 * )
     AC_MSG_ERROR($host_cpu systems are not supported at this time)
     ;;
 * )
     AC_MSG_ERROR($host_cpu systems are not supported at this time)
     ;;
@@ -120,59 +134,79 @@ dnl host type
 case "$host_os" in
 *cygwin* )
     OS_DIR="cygwin"
 case "$host_os" in
 *cygwin* )
     OS_DIR="cygwin"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -Wall -Wno-long-long"
-    ARCH_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -ansi -pedantic -Wall -Wno-long-long"
+    OS_FLAGS="-D__WINDOWS__ -D__CYGWIN__"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 *darwin* )
     OS_DIR="darwin"
     ;;
 
 *darwin* )
     OS_DIR="darwin"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
-    ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
+    OS_FLAGS="-D__DARWIN__"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
+    ;;
+
+dnl Must be BEFORE *freebsd*.
+*kfreebsd*-gnu)
+    OS_DIR="freebsd"
+    OS_FLAGS="-D__FREEBSD__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 *freebsd* )
     OS_DIR="freebsd"
     ;;
 
 *freebsd* )
     OS_DIR="freebsd"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
-    ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
+    OS_FLAGS="-D__FREEBSD__ -D_XOPEN_SOURCE_EXTENDED"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 *irix* )
     OS_DIR="irix"
     ;;
 
 *irix* )
     OS_DIR="irix"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
-    ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
-    ;;
-
-*kfreebsd*-gnu)
-    OS_DIR="freebsd"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
-    ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    OS_FLAGS="-D__IRIX__"
+    CC_FLAGS=""
+    CXX_FLAGS=""
+    INTRP_CFLAGS="$ARCH_FLAGS $OS_FLAGS"
     ;;
 
     ;;
 
-dnl must be before *linux*
+dnl Must be BEFORE *linux*.
 *uclinux | *elf )
     OS_DIR="uclinux"
 *uclinux | *elf )
     OS_DIR="uclinux"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
-    ARCH_CFLAGS="$ARCH_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"
+    OS_FLAGS="-D__LINUX__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 *linux* | *Linux* )
     OS_DIR="linux"
     ;;
 
 *linux* | *Linux* )
     OS_DIR="linux"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
-    ARCH_CFLAGS="$ARCH_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"
+    OS_FLAGS="-D__LINUX__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 *netbsd* )
     OS_DIR="netbsd"
     ;;
 
 *netbsd* )
     OS_DIR="netbsd"
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
-    ARCH_CFLAGS="$ARCH_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"
+    OS_FLAGS="-D__NETBSD__ -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 *solaris* )
     OS_DIR="solaris"
     ;;
 
 *solaris* )
     OS_DIR="solaris"
-       dnl on solaris the architecture defines 'sparc','sun','unix' are not set when cpp is called with -ansi
-       dnl therefore we add them here
-    INTRP_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_BSD_SOURCE -Dsparc -Dsun -Dunix"
-    ARCH_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_BSD_SOURCE -Dsparc -Dsun -Dunix"
+    dnl On solaris the architecture defines 'sparc', 'sun', 'unix' are
+    dnl not set when cpp is called with -std=c99, therefore we add them
+    dnl here.
+    OS_FLAGS="-D__SOLARIS__ -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_BSD_SOURCE"
+    CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE=600"
+    CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="-Wall -Wno-long-long $ARCH_FLAGS $OS_FLAGS"
     ;;
 
 * )
     ;;
 
 * )
@@ -182,30 +216,27 @@ esac
 
 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
 dnl we set it properly at the end of this file
 
 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
 dnl we set it properly at the end of this file
-CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
+CFLAGS="$OPT_CFLAGS $ARCH_FLAGS $OS_FLAGS $CC_FLAGS"
+CXXFLAGS="$OPT_CXXFLAGS $ARCH_FLAGS $OS_FLAGS $CXX_FLAGS"
 
 dnl set interpreter flags
 AC_SUBST(INTRP_CFLAGS)
 
 
 dnl set interpreter flags
 AC_SUBST(INTRP_CFLAGS)
 
-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, "$OPT_CFLAGS $ARCH_CFLAGS", [CFLAGS used])
-
-
 dnl define and substitute some architecture specific variables
 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
 dnl define and substitute some architecture specific variables
 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
+AC_DEFINE_UNQUOTED([JAVA_ARCH], "${JAVA_ARCH}", [Java architecture name])
 AC_SUBST(ARCH_DIR)
 AC_SUBST(ARCH_DIR)
+AC_SUBST(JAVA_ARCH)
 AC_SUBST(OS_DIR)
 AC_SUBST(USE_SCHEDULER)
 
 
 dnl Checks for programs.
 AC_PROG_CC
 AC_SUBST(OS_DIR)
 AC_SUBST(USE_SCHEDULER)
 
 
 dnl Checks for programs.
 AC_PROG_CC
+AC_PROG_CXX
 AM_PROG_AS
 AC_PROG_LD
 AC_PROG_LD_GNU
 AM_PROG_AS
 AC_PROG_LD
 AC_PROG_LD_GNU
-AC_PROG_RANLIB
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AM_PROG_MKDIR_P
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AM_PROG_MKDIR_P
@@ -213,20 +244,32 @@ AM_PROG_MKDIR_P
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
+
+dnl Crucial header files.
+AC_CHECK_HEADERS([stdbool.h],, [AC_MSG_ERROR(cannot find stdbool.h)])
+AC_CHECK_HEADERS([stdint.h],, [AC_MSG_ERROR(cannot find stdint.h)])
+
+dnl keep them alpha-sorted!
+AC_CHECK_HEADERS([assert.h])
+AC_CHECK_HEADERS([errno.h])
 AC_CHECK_HEADERS([fcntl.h])
 AC_CHECK_HEADERS([fcntl.h])
-AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_HEADERS([libgen.h])
+AC_CHECK_HEADERS([netdb.h])
+AC_CHECK_HEADERS([stdint.h])
+AC_CHECK_HEADERS([stdio.h])
+AC_CHECK_HEADERS([stdlib.h])
+AC_CHECK_HEADERS([string.h])
+AC_CHECK_HEADERS([time.h])
+AC_CHECK_HEADERS([ucontext.h])
 AC_CHECK_HEADERS([unistd.h])
 AC_CHECK_HEADERS([sys/ioctl.h])
 AC_CHECK_HEADERS([unistd.h])
 AC_CHECK_HEADERS([sys/ioctl.h])
-
-dnl this is for fdlibm
-AC_CHECK_HEADERS([stdint.h])
-AC_CHECK_HEADERS([inttypes.h])
-AC_CHECK_HEADERS([sys/config.h])
+AC_CHECK_HEADERS([sys/mman.h])
+AC_CHECK_HEADERS([sys/resource.h])
+AC_CHECK_HEADERS([sys/select.h])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([sys/stat.h])
+AC_CHECK_HEADERS([sys/time.h])
 AC_CHECK_HEADERS([sys/types.h])
 AC_CHECK_HEADERS([sys/types.h])
-AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
-AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
-AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
-AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -237,15 +280,84 @@ AC_TYPE_SIZE_T
 AC_HEADER_TIME
 AC_STRUCT_TM
 
 AC_HEADER_TIME
 AC_STRUCT_TM
 
+dnl Checks for libraries (NOTE: Should be done before function checks,
+dnl as some functions may be in libraries we check for).
+
+case "${OS_DIR}" in
+    solaris )
+         AC_CHECK_LIB([socket], [gethostname],, [AC_MSG_ERROR(cannot find libsocket)])
+         ;;
+esac
+
 dnl Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
 AC_TYPE_SIGNAL
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP
 dnl Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
 AC_TYPE_SIGNAL
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP
-AC_CHECK_FUNCS([calloc mmap getpagesize free])
-AC_CHECK_FUNCS([getcwd gettimeofday])
-AC_CHECK_FUNCS([scandir])
+
+dnl keep them alpha-sorted!
+AC_CHECK_FUNCS([abort])
+AC_CHECK_FUNCS([accept])
+AC_CHECK_FUNCS([access])
+AC_CHECK_FUNCS([atoi])
+AC_CHECK_FUNCS([atol])
+AC_CHECK_FUNCS([calloc])
+AC_CHECK_FUNCS([close])
+AC_CHECK_FUNCS([confstr])
+AC_CHECK_FUNCS([connect])
+AC_CHECK_FUNCS([dirname])
+AC_CHECK_FUNCS([fclose])
+AC_CHECK_FUNCS([fflush])
+AC_CHECK_FUNCS([fopen])
+AC_CHECK_FUNCS([fprintf])
+AC_CHECK_FUNCS([fread])
+AC_CHECK_FUNCS([free])
+AC_CHECK_FUNCS([fstat])
+AC_CHECK_FUNCS([fsync])
+AC_CHECK_FUNCS([ftruncate])
+AC_CHECK_FUNCS([getcwd])
+AC_CHECK_FUNCS([gethostbyname])
+AC_CHECK_FUNCS([gethostname])
+AC_CHECK_FUNCS([getpagesize])
+AC_CHECK_FUNCS([getrusage])
+AC_CHECK_FUNCS([getsockname])
+AC_CHECK_FUNCS([getsockopt])
+AC_CHECK_FUNCS([gettimeofday])
+AC_CHECK_FUNCS([htons])
+AC_CHECK_FUNCS([ioctl])
 AC_CHECK_FUNCS([isnan])
 AC_CHECK_FUNCS([isnan])
+AC_CHECK_FUNCS([listen])
+AC_CHECK_FUNCS([localtime])
+AC_CHECK_FUNCS([localtime_r])
+AC_CHECK_FUNCS([lseek])
+AC_CHECK_FUNCS([malloc])
+AC_CHECK_FUNCS([memcpy])
+AC_CHECK_FUNCS([memset])
+AC_CHECK_FUNCS([mmap])
+AC_CHECK_FUNCS([mprotect])
+AC_CHECK_FUNCS([open])
+AC_CHECK_FUNCS([read])
+AC_CHECK_FUNCS([readlink])
+AC_CHECK_FUNCS([realloc])
+AC_CHECK_FUNCS([recv])
+AC_CHECK_FUNCS([scandir])
+AC_CHECK_FUNCS([select])
+AC_CHECK_FUNCS([send])
+AC_CHECK_FUNCS([setsockopt])
+AC_CHECK_FUNCS([shutdown])
+AC_CHECK_FUNCS([socket])
+AC_CHECK_FUNCS([stat])
+AC_CHECK_FUNCS([strcat])
+AC_CHECK_FUNCS([strchr])
+AC_CHECK_FUNCS([strcpy])
+AC_CHECK_FUNCS([strdup])
+AC_CHECK_FUNCS([strerror])
+AC_CHECK_FUNCS([strlen])
+AC_CHECK_FUNCS([strncmp])
+AC_CHECK_FUNCS([strstr])
+AC_CHECK_FUNCS([time])
+AC_CHECK_FUNCS([write])
+
 
 dnl Checks for libraries.
 
 
 dnl Checks for libraries.
 
@@ -275,408 +387,37 @@ AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation pref
 AC_SUBST(CACAO_LIBDIR)
 
 
 AC_SUBST(CACAO_LIBDIR)
 
 
-dnl Features
-
+AC_CHECK_ENABLE_DL
 AC_CHECK_ENABLE_JAVA
 AC_CHECK_ENABLE_JAVA
-AC_CHECK_ENABLE_JIT
-
-dnl with-options
-AC_CHECK_WITH_CACAOH
-
-dnl check for stuff that should be done in software
-AC_CHECK_SOFTFLOAT
-AC_CHECK_SOFT_FLOAT_CMP
-AC_CHECK_SOFT_DOUBLE_CMP
-
 
 
-dnl check for interpreter
-AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
-
-AC_MSG_CHECKING(whether interpreter should be compiled)
-if test x"$enable_intrp" = "xyes"; then
-    AC_MSG_RESULT(yes)
-    AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
-    AM_CONDITIONAL([ENABLE_INTRP], [true])
-    ENABLE_INTRP=yes
-
-    AC_ASM_SKIP16
-
-    dnl check for libffi
-    AC_ARG_WITH([ffi],
-                [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
-                [WITH_FFI=yes
-                 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
-                 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
-                 AC_DEFINE([WITH_FFI], 1, [use libffi])],
-                [WITH_FFI=no])
-
-    dnl check for libffcall
-    AC_ARG_WITH([ffcall],
-                [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
-                [WITH_FFCALL=yes
-                 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
-                 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
-                 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
-                [WITH_FFCALL=no])
-
-    dnl check for libffi or libffcall
-    if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
-        AC_ERROR(Enable only libffi or libffcall.)
-    fi
-    if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
-        AC_ERROR(Enable one of libffi or libffcall.)
-    fi
-
-else
-    AC_MSG_RESULT(no)
-    AM_CONDITIONAL([ENABLE_INTRP], [false])
-    ENABLE_INTRP="no"
-fi
+AC_CHECK_ENABLE_JIT
+AC_CHECK_ENABLE_INTRP
 
 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
     AC_ERROR(You have to enable at least the JIT or the interpreter.)
 fi
 
 
 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
     AC_ERROR(You have to enable at least the JIT or the interpreter.)
 fi
 
+AC_CHECK_SOFTFLOAT
+AC_CHECK_SOFT_FLOAT_CMP
+AC_CHECK_SOFT_DOUBLE_CMP
 
 
-dnl check for garbage collector usage
-AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
-AC_MSG_CHECKING(whether GC should be enabled)
-enable_gc=${enable_gc:-boehm}
-case "$enable_gc" in
-no | none)
-    AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
-    ENABLE_GC=none
-    AC_MSG_RESULT(no)
-    ;;
-
-boehm)
-    AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
-    ENABLE_GC=boehm
-    AC_MSG_RESULT(yes, boehm-gc)
-    ;;
-
-cacao)
-    AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
-    ENABLE_GC=cacao
-    AC_MSG_RESULT(yes, cacao-gc)
-    ;;
-
-*)
-    AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
-    ;;
-esac
-AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
-AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
-AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
-
-
-
-dnl check for dump memory usage
-AC_MSG_CHECKING(whether dump memory should be disabled)
-AC_ARG_ENABLE([dump],
-              [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
-              [case "${enableval}" in
-                   no)
-                       DISABLE_DUMP=yes
-                       AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
-                       ;;
-                   *) DISABLE_DUMP=no;;
-               esac],
-               [DISABLE_DUMP=no])
-AC_MSG_RESULT(${DISABLE_DUMP})
-
-
-dnl check for debug
-AC_MSG_CHECKING(whether debug code generation should be enabled)
-AC_ARG_ENABLE([debug],
-              [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
-              [case "${enableval}" in
-                   no) NDEBUG=yes
-                       AC_DEFINE([NDEBUG], 1, [disable debug code])
-                       ;;
-                   *) NDEBUG=no;;
-               esac],
-              [NDEBUG=no])
-
-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 memcheck support
-AC_MSG_CHECKING(whether debugging memory checks should be enabled)
-AC_ARG_ENABLE([memcheck],
-              [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_MEMCHECK=yes;;
-                   *) ENABLE_MEMCHECK=no;;
-               esac],
-              [ENABLE_MEMCHECK=no])
-AC_MSG_RESULT(${ENABLE_MEMCHECK})
-AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
-
-if test x"${ENABLE_MEMCHECK}" = "xyes"; then
-    AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
-fi
-
-
-dnl check for disassembler support
-AC_MSG_CHECKING(whether disassembler should be enabled)
-AC_ARG_ENABLE([disassembler],
-              [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_DISASSEMBLER=yes;;
-                   *) ENABLE_DISASSEMBLER=no;;
-               esac],
-              [ENABLE_DISASSEMBLER=no])
-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
-    case "${ARCH_DIR}" in
-        arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390 | m68k)
-            AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
-            AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
-            AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
-            AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
-
-            case "${OS_DIR}" in
-                cygwin | darwin | netbsd | solaris)
-                     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 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])
-            ;;
-        * )
-            AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
-            ;;
-    esac
-else
-    AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
-fi
-
-
-dnl check for statistics
-AC_MSG_CHECKING(whether statistics generation should be enabled)
-AC_ARG_ENABLE([statistics],
-              [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_STATISTICS=yes;;
-                   *) ENABLE_STATISTICS=no;;
-               esac],
-              [ENABLE_STATISTICS=no])
-AC_MSG_RESULT(${ENABLE_STATISTICS})
-AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
-
-if test x"${ENABLE_STATISTICS}" = "xyes"; then
-    AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
-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],
-              [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_JVMTI=yes;;
-                   *) ENABLE_JVMTI=no;;
-               esac],
-              [ENABLE_JVMTI=no])
-AC_MSG_RESULT(${ENABLE_JVMTI})
-AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
-
-if test x"${ENABLE_JVMTI}" = "xyes"; then
-    AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
-fi
-
-
-dnl threads
-AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,native) [[default=native]])])
-AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
-
-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([ENABLE_THREADS], [false])
-    ;;
-
-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)
-
-    ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
-
-    dnl we changed ARCH_CFLAGS, set CFLAGS again
-    CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
-
-    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)
-    ;;
-esac
-
-
-dnl Check whether the compiler supports the __thread keyword.
-if test "x$use__thread" != xno; then
-  AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
-  [cat > conftest.c <<\EOF
-__thread int a = 42;
-EOF
-  if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
-    ac_cv_gcc___thread=yes 
-  else
-    ac_cv_gcc___thread=no
-  fi
-  rm -f conftest*])
-  if test "$ac_cv_gcc___thread" = yes; then
-    AC_DEFINE([HAVE___THREAD], 1, [have __thread])
-  fi
-else
-  ac_cv_gcc___thread=no
-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(--enable-inlining,enable method inlining [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_INLINING=yes;;
-                   *) ENABLE_INLINING=no;;
-               esac],
-              [ENABLE_INLINING=no])
-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 inlining debug options
-AC_MSG_CHECKING(whether method inlining debug options should be enabled)
-AC_ARG_ENABLE([inlining-debug],
-              [AS_HELP_STRING(--enable-inlining-debug,enable method inlining debug options [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_INLINING_DEBUG=yes;;
-                   *) ENABLE_INLINING_DEBUG=no;;
-               esac],
-              [ENABLE_INLINING_DEBUG=no])
-AC_MSG_RESULT(${ENABLE_INLINING_DEBUG})
-AM_CONDITIONAL([ENABLE_INLINING_DEBUG], test x"${ENABLE_INLINING_DEBUG}" = "xyes")
-
-if test x"${ENABLE_INLINING_DEBUG}" = "xyes"; then
-    AC_DEFINE([ENABLE_INLINING_DEBUG], 1, [enable method inlining debug options])
-fi
-
-
-dnl check for replacement
-AC_MSG_CHECKING(whether on-stack replacement should be supported)
-AC_ARG_ENABLE([replacement],
-              [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
-              [case "${enableval}" in
-                   yes) ENABLE_REPLACEMENT=yes;;
-                   *) ENABLE_REPLACEMENT=no;;
-               esac],
-              [ENABLE_REPLACEMENT=no])
-AC_MSG_RESULT(${ENABLE_REPLACEMENT})
-AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
-
-if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
-    AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
-fi
-
+AC_CHECK_ENABLE_GC
+AC_CHECK_ENABLE_DEBUG
+AC_CHECK_ENABLE_DUMP
+AC_CHECK_ENABLE_MEMCHECK
+AC_CHECK_ENABLE_HANDLES
+AC_CHECK_ENABLE_VMLOG
+AC_CHECK_ENABLE_DISASSEMBLER
+AC_CHECK_ENABLE_STATISTICS
+AC_CHECK_ENABLE_VERIFIER
+AC_CHECK_ENABLE_RT_TIMING
+AC_CHECK_ENABLE_CYCLE_STATS
+AC_CHECK_ENABLE_JVMTI
+AC_CHECK_ENABLE_THREADS
+AC_CHECK_ENABLE_IFCONV
+AC_CHECK_ENABLE_INLINING
+AC_CHECK_ENABLE_INLINING_DEBUG
+AC_CHECK_ENABLE_REPLACEMENT
 
 dnl check for loop optimization
 AC_MSG_CHECKING(whether loop optimization should be supported)
 
 dnl check for loop optimization
 AC_MSG_CHECKING(whether loop optimization should be supported)
@@ -698,7 +439,7 @@ fi
 dnl check if linear scan register allocator(lsra) with SSA should be used
 AC_MSG_CHECKING(whether lsra with ssa should be supported)
 AC_ARG_ENABLE([ssa],
 dnl check if linear scan register allocator(lsra) with SSA should be used
 AC_MSG_CHECKING(whether lsra with ssa should be supported)
 AC_ARG_ENABLE([ssa],
-              [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
+              [AS_HELP_STRING(--disable-ssa,disable ssa [[default=disabled]])],
               [case "${enableval}" in
                    no) ENABLE_SSA=no;;
                    *) ENABLE_SSA=yes;;
               [case "${enableval}" in
                    no) ENABLE_SSA=no;;
                    *) ENABLE_SSA=yes;;
@@ -706,9 +447,15 @@ AC_ARG_ENABLE([ssa],
               [ENABLE_SSA=no])
 AC_MSG_RESULT(${ENABLE_SSA})
 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
               [ENABLE_SSA=no])
 AC_MSG_RESULT(${ENABLE_SSA})
 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
+AM_CONDITIONAL([ENABLE_ESCAPE], test x"${ENABLE_SSA}" = "xyes")
+AM_CONDITIONAL([ENABLE_ESCAPE_CHECK], test x"${ENABLE_SSA}" = "xyes")
+AM_CONDITIONAL([ENABLE_TLH], test x"${ENABLE_SSA}" = "xyes")
 
 if test x"${ENABLE_SSA}" = "xyes"; then
     AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
 
 if test x"${ENABLE_SSA}" = "xyes"; then
     AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
+    AC_DEFINE([ENABLE_ESCAPE], 1, [enable escape analysis with ssa])
+    AC_DEFINE([ENABLE_ESCAPE_CHECK], 1, [enable generating code to validate escape analysis results])
+    AC_DEFINE([ENABLE_TLH], 1, [enable thread local heap])
     ENABLE_LSRA="no"
 fi
 
     ENABLE_LSRA="no"
 fi
 
@@ -735,7 +482,6 @@ if test x"${ENABLE_LSRA}" = "xyes"; then
     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
 fi
 
     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
 fi
 
-
 dnl check if profiling should be supported
 AC_MSG_CHECKING(whether profiling should be supported)
 AC_ARG_ENABLE([profiling],
 dnl check if profiling should be supported
 AC_MSG_CHECKING(whether profiling should be supported)
 AC_ARG_ENABLE([profiling],
@@ -775,73 +521,21 @@ else
 fi
 
 
 fi
 
 
-dnl check if zlib should be used
-AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
-AC_ARG_ENABLE([zlib],
-              [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
-              [case "${enableval}" in
-                  no) ENABLE_ZLIB=no;;
-                  *) ENABLE_ZLIB=yes;;
-               esac],
-              [ENABLE_ZLIB=yes])
-AC_MSG_RESULT(${ENABLE_ZLIB})
-
-if test x"${ENABLE_ZLIB}" = "xyes"; then
-    AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
-    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])
-fi
-AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
-
+AC_CHECK_ENABLE_ZLIB
 
 dnl check for stuff to be built
 AC_CHECK_ENABLE_JNI
 
 dnl check for stuff to be built
 AC_CHECK_ENABLE_JNI
+AC_CHECK_ENABLE_LIBJVM
 
 
-
-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
+dnl ATTENTION: These check must be after setting
+dnl enable_shared/enable_static (happens in AC_CHECK_ENABLE_LIBJVM),
+dnl because libtool uses them to build the correct libraries.
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
 
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
 
-
-dnl check if CACAO should be linked statically
-AC_MSG_CHECKING(whether to link CACAO statically)
-AC_ARG_ENABLE([staticvm],
-              [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
-              [case "${enableval}" in
-                  yes) ENABLE_STATICVM=yes
-                       AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
-                       ;;
-                  *) ENABLE_STATICVM=no;;
-               esac],
-              [ENABLE_STATICVM=no])
-AC_MSG_RESULT(${ENABLE_STATICVM})
-AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
-AC_SUBST(ENABLE_STATICVM)
+AC_CHECK_ENABLE_STATICVM
+AC_CHECK_ENABLE_ANNOTATIONS
+AC_CHECK_ENABLE_ASSERTION
 
 
 dnl where is CACAO's vm.zip
 
 
 dnl where is CACAO's vm.zip
@@ -855,162 +549,127 @@ AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
 AC_SUBST(CACAO_VM_ZIP)
 
 
 AC_SUBST(CACAO_VM_ZIP)
 
 
-dnl which Java core library are we using?
-AC_MSG_CHECKING(which Java core library to use)
-AC_ARG_WITH([classpath],
-            [AS_HELP_STRING(--with-classpath=<type>,specifies which type of classpath to use as Java core library (gnu) [[default=gnu]])],
-            [case "${withval}" in
-                cldc1.1)
-                    WITH_CLASSPATH=cldc1.1
-                    AC_DEFINE([WITH_CLASSPATH_CLDC1_1], 1, [use Sun's CLDC1.1 classes])
-                    AC_SUBST(WITH_CLASSPATH_CLDC1_1)
-                    ;;
-                gnu)
-                    WITH_CLASSPATH=gnu
-                    AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
-                    AC_SUBST(WITH_CLASSPATH_GNU)
-                    ;;
-                *)
-                    AC_MSG_ERROR(unknown classpath ${withval})
-                    ;;
-             esac],
-            [WITH_CLASSPATH=gnu
-             AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
-             AC_SUBST(WITH_CLASSPATH_GNU)])
-AC_MSG_RESULT(${WITH_CLASSPATH})
-AM_CONDITIONAL([WITH_CLASSPATH_CLDC1_1], test x"${WITH_CLASSPATH}" = "xcldc1.1")
-AM_CONDITIONAL([WITH_CLASSPATH_GNU], test x"${WITH_CLASSPATH}" = "xgnu")
-
-
-dnl where is Java core library installed?
-AC_MSG_CHECKING(where Java core library is installed)
-AC_ARG_WITH([classpath-prefix],
-            [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of Java core library [[default=/usr/local/classpath]])],
-            [CLASSPATH_PREFIX=${withval}],
-            [CLASSPATH_PREFIX=/usr/local/classpath])
-AC_MSG_RESULT(${CLASSPATH_PREFIX})
-AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [Java core library installation directory])
-AC_SUBST(CLASSPATH_PREFIX)
-
-
-dnl where are Java core library classes installed?
-AC_MSG_CHECKING(where Java core library classes are installed)
-AC_ARG_WITH([classpath-classes],
-            [AS_HELP_STRING(--with-classpath-classes=<path>,path to Java core library classes (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
-            [CLASSPATH_CLASSES=${withval}],
-            [CLASSPATH_CLASSES=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
-AC_MSG_RESULT(${CLASSPATH_CLASSES})
-AC_DEFINE_UNQUOTED([CLASSPATH_CLASSES], "${CLASSPATH_CLASSES}", [Java core library classes])
-AC_SUBST(CLASSPATH_CLASSES)
-
-
-dnl where are Java core library native libraries installed?
-AC_MSG_CHECKING(where Java core library native libraries are installed)
-AC_ARG_WITH([classpath-libdir],
-            [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of Java core library native libraries [[default=/usr/local/classpath/lib]])],
-            [CLASSPATH_LIBDIR=${withval}],
-            [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
-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}", [Java core library native libraries installation directory])
-AC_SUBST(CLASSPATH_LIBDIR)
-
-
-dnl where are Java core library headers installed?
-AC_MSG_CHECKING(where Java core library headers are installed)
-AC_ARG_WITH([classpath-includedir],
-            [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of Java core library 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", [Java core library jni.h header])],
-                [AC_MSG_ERROR(cannot find jni.h)])
-
-
-dnl if we compile for a JRE-style directory layout
-AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
-AC_ARG_WITH([jre-layout],
-            [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
-            [case "${enableval}" in
-                yes) WITH_JRE_LAYOUT=yes
-                     AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
-                     ;;
-                *) WITH_JRE_LAYOUT=no;;
-             esac],
-            [WITH_JRE_LAYOUT=no])
-AC_MSG_RESULT(${WITH_JRE_LAYOUT})
-
-
-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
-    dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
-    if test x"${ENABLE_STATICVM}" = "xyes"; then
-        AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
-    fi
+AC_CHECK_WITH_CACAOH
+AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY
+
+dnl Now we check for jre-layout so we can skip some checks that are
+dnl not required.
+AC_CHECK_ENABLE_JRE_LAYOUT
 
 
-    AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
-    AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
+AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_PREFIX
+AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_CLASSES
+AC_CHECK_WITH_BUILD_JAVA_RUNTIME_LIBRARY_CLASSES
+
+if test x"${ENABLE_JRE_LAYOUT}" = "xno"; then
+   AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_LIBDIR
 fi
 fi
-AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
-AC_SUBST(WITH_STATIC_CLASSPATH)
 
 
+dnl The check for jni_md.h must be before jni.h.
+AC_CHECK_WITH_JNI_MD_H
+AC_CHECK_WITH_JNI_H
+
+dnl HPI is only required for OpenJDK
+case "${WITH_JAVA_RUNTIME_LIBRARY}" in
+    openjdk)
+        AC_CHECK_WITH_HPI_MD_H
+        AC_CHECK_WITH_HPI_H
+        ;;
+    *)
+        ;;
+esac
 
 dnl check for some programs we need
 
 dnl check for some programs we need
-AC_PROG_JAVAC
-AC_PROG_JAR
 
 
+case "${WITH_JAVA_RUNTIME_LIBRARY}" in
+    cldc1.1 | gnuclasspath)
+        AC_PROG_JAVAC
+        AC_PROG_JAR
+        ;;
+    openjdk)
+        ;;
+    *)
+        AC_MSG_ERROR(unknown classpath configuration ${WITH_JAVA_RUNTIME_LIBRARY})
+        ;;
+esac
+
+AC_CHECK_WITH_JASMIN_JAR
+AC_CHECK_WITH_JUNIT_JAR
+
+AC_CHECK_HEADERS(
+       [regex.h], 
+       [
+               dnl If debug build and regex.h available, enable debug filter
+               if test x"${NDEBUG}" = "xno"; then
+                       AC_DEFINE(ENABLE_DEBUG_FILTER, 1, [debug filter])
+               fi
+               dnl If vmlog enambled and regex.h available, enable vmlogfilter
+               AM_CONDITIONAL([ENABLE_VMLOGFILTER], [test x"${ENABLE_VMLOG}" = "xyes"])
+       ],
+       [
+               AM_CONDITIONAL([ENABLE_VMLOGFILTER], [false])
+       ]
+)
+
+dnl python
+
+AZ_PYTHON_DEFAULT
+AZ_PYTHON_ENABLE
+AZ_PYTHON_WITH
+AZ_PYTHON_VERSION_ENSURE( [2.4] )
+AZ_PYTHON_CSPEC
+AZ_PYTHON_LSPEC
+
+
+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_CXX, "$CXX", [CXX used])
+AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS $CC_FLAGS $CPPFLAGS", [CFLAGS used])
+AC_DEFINE_UNQUOTED(VERSION_CXXFLAGS, "$OPT_CXXFLAGS $ARCH_CXXFLAGS $CXX_FLAGS $CPPFLAGS", [CXXFLAGS used])
+
+
+dnl Finally pass flags to Makefiles.
+CFLAGS="$OPT_CFLAGS"
+CXXFLAGS="$OPT_CXXFLAGS"
+
+AM_CFLAGS="$CC_FLAGS $ARCH_FLAGS $OS_FLAGS"
+AM_CXXFLAGS="$CXX_FLAGS $ARCH_FLAGS $OS_FLAGS"
+AM_CPPFLAGS="$CPPFLAGS"
 
 
-dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
-CFLAGS=$OPT_CFLAGS
-AM_CFLAGS=$ARCH_CFLAGS
 AC_SUBST(AM_CFLAGS)
 AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_CXXFLAGS)
+AC_SUBST(AM_CPPFLAGS)
 
 
 AC_CONFIG_FILES([Makefile]
                [contrib/Makefile]
                [contrib/setenvinstalled]
                [contrib/setenvsource]
 
 
 AC_CONFIG_FILES([Makefile]
                [contrib/Makefile]
                [contrib/setenvinstalled]
                [contrib/setenvsource]
+               [contrib/vmlog/Makefile]
+               [contrib/vmlog/t/Makefile]
                [doc/Makefile]
                [doc/Makefile]
+               [doc/doxygen/Makefile]
                [doc/handbook/Makefile]
                [man/Makefile]
                [src/Makefile]
                [src/cacao/Makefile]
                [src/cacaoh/Makefile]
                [doc/handbook/Makefile]
                [man/Makefile]
                [src/Makefile]
                [src/cacao/Makefile]
                [src/cacaoh/Makefile]
+               [src/classes/Makefile]
                [src/fdlibm/Makefile]
                [src/fdlibm/Makefile]
-               [src/lib/Makefile]
                [src/mm/Makefile]
                [src/mm/cacao-gc/Makefile]
                [src/native/Makefile]
                [src/native/include/Makefile]
                [src/native/jvmti/Makefile]
                [src/mm/Makefile]
                [src/mm/cacao-gc/Makefile]
                [src/native/Makefile]
                [src/native/include/Makefile]
                [src/native/jvmti/Makefile]
-               [src/native/tools/Makefile]
                [src/native/vm/Makefile]
                [src/native/vm/cldc1.1/Makefile]
                [src/native/vm/Makefile]
                [src/native/vm/cldc1.1/Makefile]
-               [src/native/vm/gnu/Makefile]
+               [src/native/vm/gnuclasspath/Makefile]
+               [src/native/vm/openjdk/Makefile]
                [src/scripts/Makefile]
                [src/scripts/java]
                [src/threads/Makefile]
                [src/scripts/Makefile]
                [src/scripts/java]
                [src/threads/Makefile]
-               [src/threads/native/Makefile]
                [src/threads/none/Makefile]
                [src/threads/none/Makefile]
+               [src/threads/posix/Makefile]
                [src/toolbox/Makefile]
                [src/vm/Makefile]
                [src/vm/jit/Makefile]
                [src/toolbox/Makefile]
                [src/vm/Makefile]
                [src/vm/jit/Makefile]
@@ -1027,12 +686,14 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/i386/linux/Makefile]
                [src/vm/jit/intrp/Makefile]
                [src/vm/jit/inline/Makefile]
                [src/vm/jit/i386/linux/Makefile]
                [src/vm/jit/intrp/Makefile]
                [src/vm/jit/inline/Makefile]
+               [src/vm/jit/ir/Makefile]
                [src/vm/jit/loop/Makefile]
                [src/vm/jit/m68k/Makefile]
                [src/vm/jit/m68k/linux/Makefile]
                [src/vm/jit/mips/Makefile]
                [src/vm/jit/mips/irix/Makefile]
                [src/vm/jit/mips/linux/Makefile]
                [src/vm/jit/loop/Makefile]
                [src/vm/jit/m68k/Makefile]
                [src/vm/jit/m68k/linux/Makefile]
                [src/vm/jit/mips/Makefile]
                [src/vm/jit/mips/irix/Makefile]
                [src/vm/jit/mips/linux/Makefile]
+               [src/vm/jit/mips/uclinux/Makefile]
                [src/vm/jit/optimizing/Makefile]
                [src/vm/jit/parisc/Makefile]
                [src/vm/jit/parisc/linux/Makefile]
                [src/vm/jit/optimizing/Makefile]
                [src/vm/jit/parisc/Makefile]
                [src/vm/jit/parisc/linux/Makefile]
@@ -1047,7 +708,6 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/sparc64/Makefile]
                [src/vm/jit/sparc64/linux/Makefile]
                [src/vm/jit/sparc64/solaris/Makefile]
                [src/vm/jit/sparc64/Makefile]
                [src/vm/jit/sparc64/linux/Makefile]
                [src/vm/jit/sparc64/solaris/Makefile]
-               [src/vm/jit/tools/Makefile]
                [src/vm/jit/verify/Makefile]
                [src/vm/jit/x86_64/Makefile]
                [src/vm/jit/x86_64/freebsd/Makefile]
                [src/vm/jit/verify/Makefile]
                [src/vm/jit/x86_64/Makefile]
                [src/vm/jit/x86_64/freebsd/Makefile]
@@ -1055,19 +715,21 @@ AC_CONFIG_FILES([Makefile]
                [src/vmcore/Makefile]
                [tests/Makefile]
                [tests/regression/Makefile]
                [src/vmcore/Makefile]
                [tests/Makefile]
                [tests/regression/Makefile]
-               [tests/regression/codepatching/Makefile]
+               [tests/regression/assertion/Makefile]
+               [tests/regression/base/Makefile]
+               [tests/regression/bugzilla/Makefile]
                [tests/regression/jasmin/Makefile]
                [tests/regression/native/Makefile]
                [tests/regression/resolving/Makefile]
                [tests/regression/resolving/classes1/Makefile]
                [tests/regression/resolving/classes2/Makefile]
                [tests/regression/resolving/classes3/Makefile]
                [tests/regression/jasmin/Makefile]
                [tests/regression/native/Makefile]
                [tests/regression/resolving/Makefile]
                [tests/regression/resolving/classes1/Makefile]
                [tests/regression/resolving/classes2/Makefile]
                [tests/regression/resolving/classes3/Makefile]
-               )
+)
 
 
 
 
-dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
-export OPT_CFLAGS
-export ARCH_CFLAGS
+dnl We only build the shared library objects but we use it as
+dnl noinst_LTLIBRARIES.
+ac_configure_args="$ac_configure_args --disable-static"
 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
 
 
 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)