-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
-