dnl Process this file with autoconf to produce a configure script.
-AC_INIT(cacao, 0.96+svn, cacao@cacaojvm.org)
+AC_INIT(cacao, 0.97+svn, cacao@cacaojvm.org)
AC_CONFIG_SRCDIR(src/cacao/cacao.c)
AC_CANONICAL_HOST
AC_PREREQ(2.59)
ARCH_CFLAGS="-D__ARM__"
;;
+hppa2.0 )
+ ARCH_DIR="parisc"
+ ARCH_CFLAGS="-D__PARISC__"
+ ;;
+
i386 | i486 | i586 | i686 )
ARCH_DIR="i386"
ARCH_CFLAGS="-D__I386__"
;;
-mips )
+mips | mipsel )
ARCH_DIR="mips"
ARCH_CFLAGS="-D__MIPS__"
;;
dnl host type
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"
+ ;;
+
*darwin* )
OS_DIR="darwin"
INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
esac
-dnl temporary set the CFLAGS for configure tests
+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 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([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
AC_SUBST(ARCH_DIR)
AC_SUBST(OS_DIR)
-AC_SUBST(INTRP_CFLAGS)
AC_SUBST(USE_SCHEDULER)
dnl check for garbage collector usage
-AC_MSG_CHECKING(whether GC should be disabled)
-AC_ARG_ENABLE([gc],
- [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])],
- [case "${enableval}" in
- no) DISABLE_GC=yes
- AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
- ;;
- *) DISABLE_GC=no;;
- esac],
- [DISABLE_GC=no])
-AC_MSG_RESULT(${DISABLE_GC})
-AM_CONDITIONAL([DISABLE_GC], test x"${DISABLE_GC}" = "xyes")
+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
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],
dnl threads
-AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
+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)
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"
;;
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],
*) ENABLE_LSRA=no;;
esac],
[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
[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],
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
[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/native/vm/Makefile]
[src/scripts/Makefile]
[src/scripts/java]
- [src/scripts/rmic]
- [src/scripts/rmiregistry]
[src/threads/Makefile]
[src/threads/native/Makefile]
[src/threads/none/Makefile]
[src/vm/jit/alpha/freebsd/Makefile]
[src/vm/jit/alpha/linux/Makefile]
[src/vm/jit/i386/Makefile]
+ [src/vm/jit/i386/cygwin/Makefile]
+ [src/vm/jit/i386/darwin/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]
[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/parisc/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]
[tests/Makefile]
[tests/regression/Makefile]
[tests/regression/codepatching/Makefile]
+ [tests/regression/jasmin/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/mm/boehm-gc)
+
+
AC_OUTPUT