* src/vm/jit/powerpc/asmpart.S (asm_call_jit_compiler): We don't save
[cacao.git] / configure.ac
index db2f33a4c8794c5a26143a9b458ba022c32927fb..9d1b56af85aa07e4ff0f75d59e1a736b64f42c6d 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(cacao, 0.95+svn, cacao@cacaojvm.org)
+AC_INIT(cacao, 0.96+svn, cacao@cacaojvm.org)
 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
 AC_CANONICAL_HOST
 AC_PREREQ(2.59)
@@ -14,50 +14,57 @@ AC_PREFIX_DEFAULT(/usr/local/cacao)
 
 dnl set optimization and debugging for all architectures and systems
 if test x"$CFLAGS" = "x"; then
-    CFLAGS="-O0 -g3"
+    OPT_CFLAGS="-O0 -g3"
+else
+    OPT_CFLAGS=$CFLAGS
 fi
 
 dnl system type
 case "$host_cpu" in
 alpha | alphaev56 | alphapca56 )
     ARCH_DIR="alpha"
-    CFLAGS="$CFLAGS -mieee -D__ALPHA__"
+    ARCH_CFLAGS="-mieee -D__ALPHA__"
     ;;
 
 arm | armv4tl | armv5b | armv5l )
     ARCH_DIR="arm"
-    CFLAGS="$CFLAGS -D__ARM__"
+    ARCH_CFLAGS="-D__ARM__"
     ;;
 
 i386 | i486 | i586 | i686 )
     ARCH_DIR="i386"
-    CFLAGS="$CFLAGS -D__I386__"
+    ARCH_CFLAGS="-D__I386__"
     ;;
 
 mips )
     ARCH_DIR="mips"
-    CFLAGS="$CFLAGS -D__MIPS__"
+    ARCH_CFLAGS="-D__MIPS__"
     ;;
 
 powerpc )
     ARCH_DIR="powerpc"
-    CFLAGS="$CFLAGS -D__POWERPC__"
+    ARCH_CFLAGS="-D__POWERPC__"
     ;;
 
 powerpc64 )
     ARCH_DIR="powerpc64"
-    CFLAGS="$CFLAGS -D__POWERPC64__"
+    ARCH_CFLAGS="-D__POWERPC64__"
+    ;;
+
+sparc64 )
+    ARCH_DIR="sparc64"
+    ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
     ;;
 
 x86_64 )
     ARCH_DIR="x86_64"
-    CFLAGS="$CFLAGS -D__X86_64__"
+    ARCH_CFLAGS="-D__X86_64__"
     ;;
 
 xdspcore )
     ARCH_DIR="xdspcore"
     ENABLE_STATICVM="yes"
-    CFLAGS="$CFLAGS -D__XDSPCORE__"
+    ARCH_CFLAGS="-D__XDSPCORE__"
     USE_SCHEDULER="1"
     ;;
 
@@ -70,27 +77,32 @@ dnl host type
 case "$host_os" in
 *darwin* )
     OS_DIR="darwin"
-    CFLAGS="$CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
+    INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
+    ARCH_CFLAGS="$ARCH_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"
+    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"
     ;;
 
 *irix* )
     OS_DIR="irix"
-    CFLAGS="$CFLAGS -D__IRIX__"
+    INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
+    ARCH_CFLAGS="$ARCH_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"
+    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"
     ;;
 
 *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"
+    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"
     ;;
 
 * )
@@ -98,16 +110,22 @@ case "$host_os" in
 esac
 
 
+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"
+
+
 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])
+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])
 AC_SUBST(ARCH_DIR)
 AC_SUBST(OS_DIR)
+AC_SUBST(INTRP_CFLAGS)
 AC_SUBST(USE_SCHEDULER)
 
 
@@ -152,10 +170,10 @@ dnl Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
 AC_TYPE_SIGNAL
 AC_FUNC_MEMCMP
-AC_CHECK_FUNCS([calloc mprotect getpagesize free])
+AC_FUNC_MMAP
+AC_CHECK_FUNCS([calloc mmap getpagesize free])
 AC_CHECK_FUNCS([getcwd gettimeofday])
 AC_CHECK_FUNCS([scandir])
-AC_CHECK_FUNCS([mmap])
 AC_CHECK_FUNCS([isnan])
 
 dnl Checks for libraries.
@@ -174,6 +192,17 @@ fi
 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
 AC_SUBST(CACAO_PREFIX)
 
+dnl define libdir prefix
+if test "x$libdir" = "xNONE"; then
+    CACAO_LIBDIR=$ac_default_libdir
+else
+    CACAO_LIBDIR=$libdir
+fi
+dnl expand CACAO_LIBDIR to something that is usable in C code
+AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
+AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
+AC_SUBST(CACAO_LIBDIR)
+
 
 dnl Features
 
@@ -314,12 +343,12 @@ 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]])],
+              [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
               [case "${enableval}" in
-                   no) ENABLE_DISASSEMBLER=no;;
-                   *) ENABLE_DISASSEMBLER=yes;;
+                   yes) ENABLE_DISASSEMBLER=yes;;
+                   *) ENABLE_DISASSEMBLER=no;;
                esac],
-              [ENABLE_DISASSEMBLER=yes])
+              [ENABLE_DISASSEMBLER=no])
 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
 
@@ -329,7 +358,7 @@ if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
     dnl check for binutils headers and libraries on some architectures for the
     dnl disassembler
     case "${ARCH_DIR}" in
-        arm | i386 | powerpc | x86_64 )
+        arm | i386 | powerpc | x86_64 | sparc64 | powerpc64)
             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)])
@@ -462,9 +491,12 @@ native | posix | pthreads)
     
     AC_MSG_RESULT(yes, native)
     AC_CHECK_LIB(pthread, main)
-    
-    CFLAGS="$CFLAGS -D_REENTRANT"
-    
+
+    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"
     ;;
@@ -481,7 +513,7 @@ if test "x$use__thread" != xno; then
   [cat > conftest.c <<\EOF
 __thread int a = 42;
 EOF
-  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
+  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
@@ -515,12 +547,12 @@ 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]])],
+              [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
               [case "${enableval}" in
-                   no) ENABLE_INLINING=no;;
-                   *) ENABLE_INLINING=yes;;
+                   yes) ENABLE_INLINING=yes;;
+                   *) ENABLE_INLINING=no;;
                esac],
-              [ENABLE_INLINING=yes])
+              [ENABLE_INLINING=no])
 AC_MSG_RESULT(${ENABLE_INLINING})
 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
 
@@ -546,18 +578,42 @@ if test x"${ENABLE_LOOP}" = "xyes"; then
 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],
+              [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
+              [case "${enableval}" in
+                   no) ENABLE_SSA=no;;
+                   *) ENABLE_SSA=yes;;
+               esac],
+              [ENABLE_SSA=no])
+AC_MSG_RESULT(${ENABLE_SSA})
+AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
+
+if test x"${ENABLE_SSA}" = "xyes"; then
+    AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
+    ENABLE_LSRA="no"
+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(--disable-lsra,disable linear scan register allocator [[default=yes]])],
+              [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
               [case "${enableval}" in
-                   no) ENABLE_LSRA=no;;
-                   *) ENABLE_LSRA=yes;;
+                   yes) ENABLE_LSRA=yes;;
+                   *) ENABLE_LSRA=no;;
                esac],
-              [ENABLE_LSRA=yes])
+              [ENABLE_LSRA=no])
+   
+if test x"${ENABLE_LSRA}" = "xyes"; then
+    if test x"${ENABLE_SSA}" = "xyes"; then
+        ENABLE_LSRA="no"
+    fi
+fi
 AC_MSG_RESULT(${ENABLE_LSRA})
 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
-   
 if test x"${ENABLE_LSRA}" = "xyes"; then
     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
 fi
@@ -566,12 +622,12 @@ 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]])],
+              [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
               [case "${enableval}" in
-                   no) ENABLE_PROFILING=no;;
-                   *) ENABLE_PROFILING=yes;;
+                   yes) ENABLE_PROFILING=yes;;
+                   *) ENABLE_PROFILING=no;;
                esac],
-              [ENABLE_PROFILING=yes])
+              [ENABLE_PROFILING=no])
 AC_MSG_RESULT(${ENABLE_PROFILING})
 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
    
@@ -618,12 +674,7 @@ 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")
 
 
@@ -672,6 +723,17 @@ AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
 AC_SUBST(ENABLE_STATICVM)
 
 
+dnl where is CACAO's vm.zip
+AC_MSG_CHECKING(where CACAO's vm.zip is installed)
+AC_ARG_WITH([vm-zip],
+            [AS_HELP_STRING(--with-vm-zip,path to CACAO's vm.zip (includes the name of the file and may be flat) [[default=/usr/local/cacao/share/cacao/vm.zip]])],
+            [CACAO_VM_ZIP=${withval}],
+            [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
+AC_MSG_RESULT(${CACAO_VM_ZIP})
+AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
+AC_SUBST(CACAO_VM_ZIP)
+
+
 dnl is GNU classpath installed somewhere different
 AC_MSG_CHECKING(where GNU Classpath is installed)
 AC_ARG_WITH([classpath-prefix],
@@ -682,6 +744,19 @@ AC_MSG_RESULT(${CLASSPATH_PREFIX})
 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [GNU Classpath installation directory])
 AC_SUBST(CLASSPATH_PREFIX)
 
+
+dnl where is GNU Classpath's glibj.zip
+AC_MSG_CHECKING(where GNU Classpath's glibj.zip is installed)
+AC_ARG_WITH([classpath-glibj-zip],
+            [AS_HELP_STRING(--with-classpath-glibj-zip,path to GNU Classpath's glibj.zip (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
+            [CLASSPATH_GLIBJ_ZIP=${withval}],
+            [CLASSPATH_GLIBJ_ZIP=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
+AC_MSG_RESULT(${CLASSPATH_GLIBJ_ZIP})
+AC_DEFINE_UNQUOTED([CLASSPATH_GLIBJ_ZIP], "${CLASSPATH_GLIBJ_ZIP}", [GNU Classpath's glibj.zip])
+AC_SUBST(CLASSPATH_GLIBJ_ZIP)
+
+
+dnl where are the GNU Classpath libraries installed
 AC_MSG_CHECKING(where GNU Classpath libraries are installed)
 AC_ARG_WITH([classpath-libdir],
             [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of GNU Classpath libraries [[default=/usr/local/classpath/lib]])],
@@ -694,6 +769,8 @@ AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [GNU Classpath libraries installation directory])
 AC_SUBST(CLASSPATH_LIBDIR)
 
+
+dnl where are the GNU Classpath headers installed
 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]])],
@@ -730,28 +807,15 @@ 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)])
-
-if test x"$with_flat_classpath" = "x"; then
-    GLIBJ_ZIP_STRING=glibj.zip
-else
-    GLIBJ_ZIP_STRING=
-fi
-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_PROG_JAR
 
 
-dnl now configure subpackages
-dnl the export is not my favorite (is there another way?)
-export CFLAGS
-AC_CONFIG_SUBDIRS(src/boehm-gc)
+dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
+CFLAGS=$OPT_CFLAGS
+AM_CFLAGS=$ARCH_CFLAGS
+AC_SUBST(AM_CFLAGS)
 
 
 AC_CONFIG_FILES([Makefile]
@@ -773,13 +837,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/native/Makefile]
+               [src/threads/none/Makefile]
                [src/toolbox/Makefile]
                [src/vm/Makefile]
                [src/vm/jit/Makefile]
@@ -788,6 +851,7 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/alpha/freebsd/Makefile]
                [src/vm/jit/alpha/linux/Makefile]
                [src/vm/jit/i386/Makefile]
+               [src/vm/jit/i386/darwin/Makefile]
                [src/vm/jit/i386/freebsd/Makefile]
                [src/vm/jit/i386/linux/Makefile]
                [src/vm/jit/ifconv/Makefile]
@@ -797,12 +861,17 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/mips/Makefile]
                [src/vm/jit/mips/irix/Makefile]
                [src/vm/jit/mips/linux/Makefile]
+                [src/vm/jit/optimizing/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/powerpc64/Makefile]
+               [src/vm/jit/powerpc64/linux/Makefile]
                [src/vm/jit/profile/Makefile]
                [src/vm/jit/schedule/Makefile]
+               [src/vm/jit/sparc64/Makefile]
+               [src/vm/jit/sparc64/linux/Makefile]
                [src/vm/jit/tools/Makefile]
                [src/vm/jit/verify/Makefile]
                [src/vm/jit/x86_64/Makefile]
@@ -811,6 +880,13 @@ AC_CONFIG_FILES([Makefile]
                [tests/regression/codepatching/Makefile]
                [tests/regression/native/Makefile])
 
+
+dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
+export OPT_CFLAGS
+export ARCH_CFLAGS
+AC_CONFIG_SUBDIRS(src/boehm-gc)
+
+
 AC_OUTPUT