X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=configure.in;h=b6a8421622fd64c45f798394520324ede5b229e3;hb=c9ce732ed49438bfa6c84be8157b0882fb89400f;hp=35a938c70e8d0685b0e5a670cdfa5ad919147f5e;hpb=58e000941ac12767be82007ad5c75cff69706a5d;p=cacao.git diff --git a/configure.in b/configure.in index 35a938c70..b6a842162 100644 --- a/configure.in +++ b/configure.in @@ -1,55 +1,127 @@ -dnl autoconf; autoheader; automake - dnl Process this file with autoconf to produce a configure script. -AC_INIT(compiler.c) + +AC_INIT(cacao, 0.92cvs, cacao@cacaojvm.org) +AC_CONFIG_SRCDIR(src/cacao/cacao.c) AC_CANONICAL_HOST +AC_PREREQ(2.59) +AM_INIT_AUTOMAKE([1.9.0]) +AM_MAINTAINER_MODE -AM_INIT_AUTOMAKE(cacao, 0.40) -AM_CONFIG_HEADER(config.h) +AM_CONFIG_HEADER([config.h]) AC_PREFIX_DEFAULT(/usr/local/cacao) -dnl system type +dnl system type case "$host_cpu" in -alpha* ) - SYSDEP_DIR="alpha" - CFLAGS="-ieee -O2 -g3" - COMPILER_SOURCES="compiler.h compiler.c" - COMPILER_OBJECTS="compiler.o" - AC_DEFINE(OLD_COMPILER) +alpha | alphaev56 ) + ARCH_DIR="alpha" + STATIC_CLASSPATH="0" + CFLAGS="-mieee -D__ALPHA__" + ;; + +arm ) + ARCH_DIR="arm" + STATIC_CLASSPATH="1" + CFLAGS="-D__ARM__" + ;; + +i386 | i486 | i586 | i686 ) + ARCH_DIR="i386" + CFLAGS="-D__I386__ $CFLAGS" + ;; + +mips ) + ARCH_DIR="mips" + +dnl for MIPSPro Compiler +dnl CFLAGS="-64 -OPT:Olimit=0 -woff 1110,1164,1515 -D__MIPS__ -D__MIPSEB__" + CFLAGS="-64 -OPT:Olimit=0 -D__MIPS__ -D__MIPSEB__" +dnl CFLAGS="-D__MIPS__ -D__MIPSEB__" + +dnl for GCC +dnl CFLAGS="-mabi=64 -D__MIPS__ -D__MIPSEB__" +dnl LDFLAGS="-mabi=64" + ;; + +powerpc ) + ARCH_DIR="powerpc" + CFLAGS="-D__POWERPC__" + ;; + +x86_64 ) + ARCH_DIR="x86_64" + CFLAGS="-D__X86_64__" ;; -mips* ) - SYSDEP_DIR="mips" - CFLAGS="-64 -g -DMAP_ANONYMOUS=0 -woff 1048,1110,1164,1515" - LIBS="-lelfutil" - COMPILER_SOURCES="" - COMPILER_OBJECTS="" +xdspcore ) + ARCH_DIR="xdspcore" + STATIC_CLASSPATH="1" + CFLAGS="-D__XDSPCORE__" + USE_SCHEDULER="1" ;; +* ) + AC_MSG_ERROR($host_cpu systems are not supported at this time) + ;; +esac + -sparc* | powerpc* | ppc* | * ) - AC_MSG_ERROR($host-cpu systems are not supported at this time) ;; +dnl set optimization and debugging for all architectures and systems +CFLAGS="-O0 -g3 $CFLAGS" + +case "$host_os" in +*linux* | *Linux* ) + OS_DIR="linux" + CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__LINUX__ -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE" + ;; +*darwin* ) + OS_DIR="darwin" + CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__DARWIN__" + ;; +*freebsd* ) + OS_DIR="freebsd" + CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__FREEBSD__ -D_XOPEN_SOURCE_EXTENDED" + ;; +*irix* ) + OS_DIR="irix" + CFLAGS="$CFLAGS -D__IRIX__" + ;; +* ) + ;; esac -AC_SUBST(COMPILER_SOURCES) -AC_SUBST(COMPILER_OBJECTS) -AC_DEFINE_UNQUOTED(SYSDEP_DIR, "$SYSDEP_DIR") -AC_SUBST(SYSDEP_DIR) +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(USE_SCHEDULER) + dnl Checks for programs. AC_PROG_CC +AM_PROG_AS +AC_PROG_LD +AC_PROG_LD_GNU AC_PROG_RANLIB +AC_DISABLE_SHARED +AC_PROG_LN_S +AC_PROG_MAKE_SET -dnl Checks for libraries. -AC_CHECK_LIB(m, sin) +dnl libtool stuff +AC_LIBTOOL_DLOPEN +AC_LIBLTDL_CONVENIENCE +AC_PROG_LIBTOOL +AC_SUBST(LIBLTDL) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h) +AC_CHECK_HEADERS([fcntl.h]) +AC_CHECK_HEADERS([sys/time.h]) +AC_CHECK_HEADERS([unistd.h]) +AC_CHECK_HEADERS([sys/ioctl.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -66,6 +138,13 @@ AC_FUNC_MMAP AC_TYPE_SIGNAL AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket) +dnl Checks for libraries. +AC_CHECK_LIB(m, fmod) + +dnl Checking sizeof void * +AC_COMPILE_CHECK_SIZEOF(void *) +AC_C_BIGENDIAN + dnl Check for mmap header anomalies (missing MAP_FAILED, etc.) if test $ac_cv_func_mmap_fixed_mapped = yes; then AC_CACHE_CHECK(whether MAP_FAILED is defined, @@ -88,57 +167,365 @@ if test $ac_cv_func_mmap_fixed_mapped = yes; then ac_cv_map_anonymous=yes, ac_cv_map_anonymous=no)) + AC_CACHE_CHECK(whether MAP_ANON is defined, + ac_cv_map_anon, + AC_EGREP_CPP(yes, + [#include + #ifdef MAP_ANON + yes + #endif], + ac_cv_map_anon=yes, + ac_cv_map_anon=no)) + if test $ac_cv_map_failed = yes; then - AC_DEFINE(HAVE_MAP_FAILED) + AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if defines MAP_FAILED]) fi - if test $ac_cv_map_failed = yes; then - AC_DEFINE(HAVE_MAP_ANONYMOUS) + if test $ac_cv_map_anonymous = yes; then + AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if defines MAP_ANONYMOUS]) + fi + + if test $ac_cv_map_anon = yes; then + AC_DEFINE([HAVE_MAP_ANON], 1, [Define if defines MAP_ANON]) fi fi +dnl check which ld flags are required to export symbols +if test x"$with_gnu_ld" = "xyes"; then + EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic" +else + EXPORT_SYMBOLS_FLAGS="" +fi +AC_SUBST(EXPORT_SYMBOLS_FLAGS) + + +dnl define install prefix +if test "x$prefix" = "xNONE"; then + CACAO_INSTALL_PREFIX=$ac_default_prefix +else + CACAO_INSTALL_PREFIX=$prefix +fi +AC_DEFINE_UNQUOTED([CACAO_INSTALL_PREFIX], "${CACAO_INSTALL_PREFIX}", [Installation prefix]) +AC_SUBST(CACAO_INSTALL_PREFIX) + + dnl Features dnl check arguments -AC_ARG_ENABLE(threads, [ --enable-threads enable threads support]) -AC_ARG_ENABLE(gc2, [ --enable-gc2 enable new garbage collector]) + +dnl check for garbage collector +AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-gc,disable garbage collector [[default=yes]])]) + +AC_MSG_CHECKING(whether GC should be disabled) +if test x"$enable_gc" = "xno"; then + AC_MSG_RESULT(yes) + AM_CONDITIONAL([DISABLE_GC], [true]) +else + AC_MSG_RESULT(no) + AM_CONDITIONAL([DISABLE_GC], [false]) +fi + +dnl check for statistics +AC_ARG_ENABLE([statistics], [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])]) + +AC_MSG_CHECKING(whether statistics generation should be enabled) +if test x"$enable_statistics" = "xno"; then + AC_MSG_RESULT(no) + AM_CONDITIONAL([STATISTICS], [false]) +else + AC_MSG_RESULT(yes) + AC_DEFINE([STATISTICS], 1, [use statistics]) + AM_CONDITIONAL([STATISTICS], [true]) +fi + dnl threads +AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,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) -if test x"$enable_threads" = "xno"; then +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([USE_THREADS], [false]) + AM_CONDITIONAL([NATIVE_THREADS], [false]) + ;; + +green | native | posix | pthreads) + AC_DEFINE([USE_THREADS], 1, [use threads]) + AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow]) + AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first]) + + AM_CONDITIONAL([USE_THREADS], [true]) + + if test x"$enable_threads" != "xgreen"; then + AC_MSG_RESULT(yes, native) + AC_CHECK_LIB(pthread, main) + AC_DEFINE([NATIVE_THREADS], 1, [use pthreads]) + + CFLAGS="$CFLAGS -D_REENTRANT" + + dnl tell boehm to support threads as well + CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-boehm-threads=posix" + AM_CONDITIONAL([NATIVE_THREADS], [true]) + + else + AC_MSG_RESULT(yes, green) + + dnl no threads for boehm + CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-boehm-threads" + AM_CONDITIONAL([NATIVE_THREADS], [false]) + fi + ;; +*) + 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} $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 linear scan register allocator(lsra) should be used +AC_ARG_ENABLE([lsra], [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])]) + +AC_MSG_CHECKING(whether lsra should be supported) +if test x"$enable_lsra" = "xno"; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(yes) + AC_DEFINE([LSRA], 1, [use lsra]) +fi + + +dnl check for inlining +dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])]) + +dnl AC_MSG_CHECKING(whether method inlining should be disabled) +dnl if test x"$enable_inlining" = "xno"; then +dnl AC_MSG_RESULT(yes) +dnl AM_CONDITIONAL([USE_INLINING], [false]) +dnl else +dnl AC_MSG_RESULT(no) + AC_DEFINE([USE_INLINING], 1, [use method inlining]) + AM_CONDITIONAL([USE_INLINING], [true]) +dnl fi + + +dnl check for instruction scheduler +AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])]) + +AC_MSG_CHECKING(whether instruction scheduler should be supported) +if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then + case "${ARCH_DIR}" in + xdspcore ) + ;; + * ) + AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator) + ;; + esac + + AC_MSG_RESULT(yes) + AC_DEFINE([USE_SCHEDULER], 1, [use scheduler]) + AM_CONDITIONAL([USE_SCHEDULER], [true]) +else AC_MSG_RESULT(no) + AM_CONDITIONAL([USE_SCHEDULER], [false]) +fi + + +dnl check if zlib should be used +AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])]) + +AC_MSG_CHECKING(whether zip archives should be supported) +if test x"$enable_zlib" = "xno"; then + AC_MSG_RESULT(no) + AM_CONDITIONAL([USE_ZLIB], [false]) +else + AC_MSG_RESULT(yes) + AC_DEFINE([USE_ZLIB], 1, [use zlib]) + AC_CHECK_HEADERS([zlib.h]) + AC_CHECK_LIB(z, main) + AM_CONDITIONAL([USE_ZLIB], [true]) +fi + + +dnl check if classpath should be linked statically with CACAO +AC_ARG_ENABLE([dynamicclasspath], [AS_HELP_STRING(--disable-dynamicclasspath, link classpath native code static even on platforms supporting dynamic loading)], [use_dynamicclasspath=$enableval], [use_dynamicclasspath=yes]) + +AC_MSG_CHECKING(whether to link GNU classpath statically) +if test x"$use_dynamicclasspath" = "xno"; then + STATIC_CLASSPATH="1" +fi + +if test x"${STATIC_CLASSPATH}" = "x1"; then + AC_MSG_RESULT(yes) + AM_CONDITIONAL([STATIC_CLASSPATH], [true]) else + AC_MSG_RESULT(no) + AM_CONDITIONAL([STATIC_CLASSPATH], [false]) +fi +AC_SUBST(STATIC_CLASSPATH) + + +dnl enable gtk peer +AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [[default=no]])]) + +AC_MSG_CHECKING(whether to use GTK awt peers) +if test x"$enable_gtk_peer" = "xyes"; then AC_MSG_RESULT(yes) + AC_DEFINE([USE_GTK], 1, [use gtk]) + AM_CONDITIONAL([USE_GTK_PEER], [true]) + USE_GTK_PEER=yes +else + AC_MSG_RESULT(no) + AM_CONDITIONAL([USE_GTK_PEER], [false]) + CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-gtk-peer" + USE_GTK_PEER=no +fi +AC_SUBST(USE_GTK_PEER) + + +dnl pass configure options to classpath +if test x"${STATIC_CLASSPATH}" = "x1"; then + AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked]) + AM_CONDITIONAL([STATIC_CLASSPATH], [true]) + CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-static --disable-shared" - AC_DEFINE(USE_THREADS) - AC_DEFINE(EXTERNAL_OVERFLOW) - AC_DEFINE(DONT_FREE_FIRST) + dnl check for some classpath related stuff when we link statically + AM_ICONV_LINK - LIBTHREAD="libthreads.a" - THREAD_OBJ="threads/libthreads.a" - AC_SUBST(LIBTHREAD) - AC_SUBST(THREAD_OBJ) + dnl taken from GNU classpath configure.ac + if test x"${USE_GTK_PEER}" = "xyes"; then + AC_ERROR(XXX this is not supported yet) + AC_PATH_XTRA + if test "$no_x" = yes; then + AC_MSG_ERROR([GTK+ peers requested but no X library available]) + fi + dnl We explicitly want the XTest Extension for Robot support. + AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true], + [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])], + [${X_LIBS}]) + PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 libart-2.0 gdk-pixbuf-2.0) + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + + AC_SUBST(CAIRO_LIBS) + AC_SUBST(CAIRO_CFLAGS) + PKG_CHECK_MODULES(PANGOFT2, pangoft2) + AC_SUBST(PANGOFT2_LIBS) + AC_SUBST(PANGOFT2_CFLAGS) + fi +else + AM_CONDITIONAL([STATIC_CLASSPATH], [false]) + CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-static --enable-shared" fi -dnl garbage collector version -AC_MSG_CHECKING(which garbage collector to use) -if test x"$enable_gc2" = "xno"; then - AC_MSG_RESULT(old garbage collector) - GC_OBJ="mm/libmm_old.a" + +dnl should we use an external classpath installation +AC_ARG_WITH([external-classpath], [AS_HELP_STRING(--with-external-classpath=,installation directory of external GNU classpath [[default=no]])]) + +AC_MSG_CHECKING(whether to use an external GNU classpath) +if test x"$with_external_classpath" != "x"; then + if test x"$with_external_classpath" = "xyes"; then + AC_MSG_ERROR(please specify the installation prefix) + fi + AC_MSG_RESULT($with_external_classpath) + AC_DEFINE([WITH_EXTERNAL_CLASSPATH], 1, [external classpath]) + AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [true]) + EXTERNAL_CLASSPATH_PREFIX="$with_external_classpath" + AC_DEFINE_UNQUOTED([EXTERNAL_CLASSPATH_PREFIX], "${EXTERNAL_CLASSPATH_PREFIX}", [external classpath directory]) + AC_SUBST(EXTERNAL_CLASSPATH_PREFIX) else - AC_MSG_RESULT(new garbage collector) - GC_OBJ="mm/libmm_new.a" + AC_MSG_RESULT(no) + AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [false]) fi -AC_SUBST(GC_OBJ) - - -AC_OUTPUT(Makefile \ - toolbox/Makefile \ - mm/Makefile \ - threads/Makefile \ - jit/Makefile \ - alpha/Makefile \ - mips/Makefile \ - nat/Makefile \ - comp/Makefile ) + + +dnl set some essential classpath options, even if their classpath default is +dnl suitable for us +ac_configure_args="$ac_configure_args --libdir=${CACAO_INSTALL_PREFIX}/jre/lib/${ARCH_DIR} --enable-jni --disable-cni --disable-regen-headers ${CONFIGURE_ARGS}" + + +dnl now configure boehm gc and gnu classpath +dnl the export is not my favorite (is there another way?) +export CFLAGS +AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath src/libltdl) + + +AC_CONFIG_FILES([Makefile] + [doc/Makefile] + [doc/handbook/Makefile] + [man/Makefile] + [src/Makefile] + [src/cacao/Makefile] + [src/cacaoh/Makefile] + [src/lib/Makefile] + [src/mm/Makefile] + [src/native/Makefile] + [src/native/include/Makefile] + [src/native/tools/Makefile] + [src/native/vm/Makefile] + [src/scripts/Makefile] + [src/scripts/cacao] + [src/scripts/java] + [src/scripts/kjc] + [src/scripts/rmic] + [src/scripts/rmiregistry] + [src/threads/Makefile] + [src/threads/green/Makefile] + [src/threads/native/Makefile] + [src/toolbox/Makefile] + [src/vm/Makefile] + [src/vm/jit/Makefile] + [src/vm/jit/alpha/Makefile] + [src/vm/jit/arm/Makefile] + [src/vm/jit/i386/Makefile] + [src/vm/jit/i386/linux/Makefile] + [src/vm/jit/i386/freebsd/Makefile] + [src/vm/jit/inline/Makefile] + [src/vm/jit/loop/Makefile] + [src/vm/jit/mips/Makefile] + [src/vm/jit/powerpc/Makefile] + [src/vm/jit/powerpc/darwin/Makefile] + [src/vm/jit/powerpc/linux/Makefile] + [src/vm/jit/schedule/Makefile] + [src/vm/jit/tools/Makefile] + [src/vm/jit/verify/Makefile] + [src/vm/jit/x86_64/Makefile] + [tests/Makefile] + [tests/codepatching/Makefile] + [tests/kaffe/Makefile] + [tests/native/Makefile]) + +AC_OUTPUT + + +## Local variables: +## mode: m4 +## indent-tabs-mode: t +## c-basic-offset: 4 +## tab-width: 8 +## compile-command: "automake --add-missing" +## End: