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)
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.
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
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"
;;
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_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/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/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]
[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/boehm-gc)
+
+
AC_OUTPUT