dnl * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * dnl * This file is part of SableVM. * dnl * See the file "LICENSE" for Copyright information and the * dnl * terms and conditions for copying, distribution and * dnl * modification of SableVM. * dnl * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * AC_INIT([sablevm], [1.0.5], [http://www.sablevm.org/]) AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(src/include/config.h) AC_CONFIG_SRCDIR([src/sablevm/sablevm.c]) AC_SUBST(LIBRARY_VERSION, [1:5:0]) AC_DEFINE_UNQUOTED(_SABLEVM_PACKAGE_NAME, "AC_PACKAGE_TARNAME", package name) AC_DEFINE_UNQUOTED(_SABLEVM_PACKAGE_VERSION, "AC_PACKAGE_VERSION", package version) AC_DEFINE(_REENTRANT,1,link with reentrant library functions) AC_DEFINE(_POSIX_C_SOURCE,199506L,link with POSIX library functions) dnl *** uncomment if you want to insert a magic value in every object instance for debugging *** dnl AC_DEFINE(MAGIC,1,put "SableVM" in every instance) dnl *** uncomment to print some statistics on VM exit *** dnl AC_DEFINE(STATISTICS,1,print statistics on VM exit) AC_DISABLE_STATIC dnl debugging features AC_ARG_ENABLE(debugging-features, [ --enable-debugging-features Add compiler and runtime checks],, [enable_debugging_features=no]) case "$enable_debugging_features" in no) AC_DEFINE(NDEBUG,1,turn off runtime assertions) ;; yes) ;; *) AC_MSG_ERROR(bad value \"${enable_debugging_features}\" for --enable-debugging-features) ;; esac dnl signals for exceptions AC_ARG_ENABLE(signals-for-exceptions, [ --disable-signals-for-exceptions Do not use signals to detect some exceptions (NullPointerException, ArithmeticException, etc.)],, [if test "$enable_debugging_features" = no; then enable_signals_for_exceptions=yes; else enable_signals_for_exceptions=no fi]) case "$enable_signals_for_exceptions" in no) ;; yes) AC_DEFINE(_SABLEVM_SIGNALS_FOR_EXCEPTIONS,1,use signals to detect exceptions) ;; *) AC_MSG_ERROR(bad value \"${enable_signals_for_exceptions}\" for --enable-signals-for-exceptions) ;; esac dnl garbage collection AC_ARG_WITH(gc, [ --with-gc=TYPE Use given garbage collector (none,copying)],, [if test "$enable_debugging_features" = no; then with_gc=copying else with_gc=copying fi]) case "$with_gc" in none) AC_DEFINE(_SABLEVM_NO_GC,1,no collector) ;; copying) AC_DEFINE(_SABLEVM_COPY_GC,1,copying collector) ;; *) AC_MSG_ERROR(bad value \"${with_gc}\" for --with-gc) ;; esac dnl object layout AC_ARG_WITH(obj-layout, [ --with-obj-layout=TYPE Use given object layout (bidirectional,traditional)],, [if test "$enable_debugging_features" = no; then with_obj_layout=bidirectional else with_obj_layout=bidirectional fi]) case "$with_obj_layout" in traditional) AC_DEFINE(_SABLEVM_TRADITIONAL_OBJECT_LAYOUT,1,traditional object layout) ;; bidirectional) AC_DEFINE(_SABLEVM_BIDIRECTIONAL_OBJECT_LAYOUT,1,bidirectional object layout) ;; *) AC_MSG_ERROR(bad value \"${with_obj_layout}\" for --with-obj-layout) ;; esac AC_CANONICAL_HOST dnl threading flavor AC_ARG_WITH(threading, [ --with-threading=TYPE Use given interpreter threading flavor (inlined,direct,switch)],, [if test "$enable_debugging_features" = no; then case $host in i*86-*-gnu) with_threading=inlined ;; *) with_threading=direct ;; esac else with_threading=switch fi]) case "$with_threading" in switch) AC_DEFINE(_SABLEVM_SWITCH_THREADED_INTERPRETER,1,switch threaded interpreter) ;; direct) AC_DEFINE(_SABLEVM_DIRECT_THREADED_INTERPRETER,1,direct threaded interpreter) ;; inlined) AC_DEFINE(_SABLEVM_INLINED_THREADED_INTERPRETER,1,inlined threaded interpreter) ;; *) AC_MSG_ERROR(bad value \"${with_threading}\" for --with-threading) ;; esac dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL dnl Checks for libraries. AC_CHECK_LIB(ffi,ffi_prep_cif,echo -n,echo ***ERROR: libffi is missing; exit 1) AC_CHECK_LIB(ltdl,lt_dlinit,echo -n,echo ***ERROR: libltdl is missing; exit 1) AC_CHECK_LIB(m,fmod,echo -n,echo ***ERROR: libm is missing; exit 1) AC_CHECK_LIB(popt,poptGetContext,echo -n,echo ***ERROR: libpopt is missing; exit 1) AC_CHECK_LIB(pthread,pthread_self,echo -n,echo ***ERROR: libpthread is missing; exit 1) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([errno.h fcntl.h stdlib.h string.h sys/time.h unistd.h], echo -n,echo ***ERROR: missing header file; exit 1) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_HEADER_TIME dnl Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([getcwd gettimeofday memmove memset munmap strchr], echo -n,echo ***ERROR: missing library function; exit 1) dnl GCC specific options if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -fno-gcse -Wno-unused" dnl -fverbose-asm -save-temps -fstack-check -funroll-loops if test "$with_threading" = "switch"; then CFLAGS="$CFLAGS -std=iso9899:1990 -pedantic" fi if test "$enable_debugging_features" = "yes"; then CFLAGS="$CFLAGS -O0 -Werror -W \ -fno-builtin -Wshadow \ -Wpointer-arith -Wbad-function-cast \ -Wundef -Wcast-align -Wwrite-strings \ -Wsign-compare -Wstrict-prototypes \ -Wmissing-prototypes \ -Wmissing-declarations \ -Wnested-externs -Wlong-long" fi fi dnl -Wid-clash-LEN -Wlarger-than-LEN -Wredundant-decls -Wconversion -Wcast-qual dnl -Wmissing-noreturn -Wtraditional -Waggregate-return -ansi -pedantic -Wunreachable-code AC_CONFIG_FILES([Makefile src/Makefile src/include/Makefile src/libsablevm/Makefile src/libsablevm/include/Makefile src/sablevm/Makefile]) AC_OUTPUT