almost all required function implemented - first integration with jdwp - nothing...
[cacao.git] / configure.in
index af7de1a1278b67f37bfa79decdfa7f96fffc124a..14f38e0eb0fd1a4e2d51cafb141136419c9d8b0d 100644 (file)
@@ -12,50 +12,47 @@ AM_CONFIG_HEADER([config.h])
 AC_PREFIX_DEFAULT(/usr/local/cacao)
 
 
+dnl set optimization and debugging for all architectures and systems
+if test x"$CFLAGS" = "x"; then
+       CFLAGS="-O0 -g3"
+fi
+
 dnl system type
 case "$host_cpu" in
 alpha | alphaev56 | alphapca56 )
        ARCH_DIR="alpha"
-       CFLAGS="-mieee -D__ALPHA__"
+       CFLAGS="$CFLAGS -mieee -D__ALPHA__"
        ;;
 
 arm | armv4tl | armv5b )
        ARCH_DIR="arm"
-       CFLAGS="-D__ARM__"
+       CFLAGS="$CFLAGS -D__ARM__"
        ;;
 
 i386 | i486 | i586 | i686 )
        ARCH_DIR="i386"
-       CFLAGS="-D__I386__"
+       CFLAGS="$CFLAGS -D__I386__"
        ;;
 
 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"
+       CFLAGS="$CFLAGS -D__MIPS__"
        ;;
 
 powerpc )
        ARCH_DIR="powerpc"
-       CFLAGS="-D__POWERPC__"
+       CFLAGS="$CFLAGS -D__POWERPC__"
        ;;
 
 x86_64 )
        ARCH_DIR="x86_64"
-       CFLAGS="-D__X86_64__"
+       CFLAGS="$CFLAGS -D__X86_64__"
        ;;
 
 xdspcore )
        ARCH_DIR="xdspcore"
        ENABLE_STATICVM="yes"
-       CFLAGS="-D__XDSPCORE__"
+       CFLAGS="$CFLAGS -D__XDSPCORE__"
        USE_SCHEDULER="1"
        ;;
 * )
@@ -63,23 +60,19 @@ xdspcore )
         ;;
 esac
 
-
-dnl set optimization and debugging for all architectures and systems
-CFLAGS="-O0 -g3 $CFLAGS"
-
-
+dnl host type
 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"
+        CFLAGS="$CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -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__"
+        CFLAGS="$CFLAGS __DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
         ;;
 *freebsd* )
        OS_DIR="freebsd"
-       CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__FREEBSD__ -D_XOPEN_SOURCE_EXTENDED"
+       CFLAGS="$CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
        ;;
 *irix* )
        OS_DIR="irix"
@@ -121,6 +114,16 @@ AC_CHECK_HEADERS([sys/time.h])
 AC_CHECK_HEADERS([unistd.h])
 AC_CHECK_HEADERS([sys/ioctl.h])
 
+dnl this is for fdlibm
+AC_CHECK_HEADERS([stdint.h])
+AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_HEADERS([sys/config.h])
+AC_CHECK_HEADERS([sys/types.h])
+AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
+AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
+AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
+AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_C_INLINE
@@ -132,10 +135,10 @@ AC_STRUCT_TM
 
 dnl Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MEMCMP
-AC_FUNC_MMAP
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(calloc mprotect getpagesize free)
+AC_CHECK_FUNCS(getcwd gettimeofday)
 
 dnl Checks for libraries.
 
@@ -143,52 +146,6 @@ 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,
-                      ac_cv_map_failed,
-                      AC_EGREP_CPP(yes, 
-                                   [#include <sys/mman.h>
-                                    #ifdef MAP_FAILED
-                                       yes
-                                    #endif],
-                                   ac_cv_map_failed=yes,
-                                   ac_cv_map_failed=no))
-
-       AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
-                      ac_cv_map_anonymous,
-                      AC_EGREP_CPP(yes, 
-                                   [#include <sys/mman.h>
-                                    #ifdef MAP_ANONYMOUS
-                                       yes
-                                    #endif],
-                                   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 <sys/mman.h>
-                                    #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], 1, [Define if <sys/mman.h> defines MAP_FAILED])
-       fi
-
-       if test $ac_cv_map_anonymous = yes; then
-               AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
-       fi
-
-       if test $ac_cv_map_anon = yes; then
-               AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> 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"
@@ -329,14 +286,14 @@ green | native | posix | pthreads)
                CFLAGS="$CFLAGS -D_REENTRANT"
 
                dnl tell boehm to support threads as well
-               CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-boehm-threads=posix"
+               ac_configure_args="$ac_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"
+               ac_configure_args="$ac_configure_args --disable-boehm-threads"
                AM_CONDITIONAL([NATIVE_THREADS], [false])
        fi
     ;;
@@ -450,109 +407,51 @@ fi
 AC_SUBST(ENABLE_STATICVM)
 
 
-dnl check if we build gtk peers
-AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers [[default=yes]])])
-
-AC_MSG_CHECKING(whether to compile GTK awt peers)
-if test x"$enable_gtk_peer" = "xno"; then
-       AC_MSG_RESULT(no)
-       AM_CONDITIONAL([USE_GTK_PEER], [false])
-       CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-gtk-peer"
-       USE_GTK_PEER=no
-else
-       AC_MSG_RESULT(yes)
-       AC_DEFINE([USE_GTK], 1, [use gtk])
-       AM_CONDITIONAL([USE_GTK_PEER], [true])
-       USE_GTK_PEER=yes
-fi
-AC_SUBST(USE_GTK_PEER)
-
-
 dnl pass configure options to classpath
 if test x"${ENABLE_STATICVM}" = "xyes"; then
         AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
        AM_CONDITIONAL([ENABLE_STATICVM], [true])
-       CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-static --disable-shared"
 
        dnl check for some classpath related stuff when we link statically
        AM_ICONV_LINK
-
-       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([ENABLE_STATICVM], [false])
-       CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-static --enable-shared"
 fi
 
 
-dnl should we use an external classpath installation
-AC_ARG_WITH([external-classpath], [AS_HELP_STRING(--with-external-classpath=<dir>,installation directory of external GNU classpath [[default=no]])])
+dnl is GNU classpath installed somewhere different
+AC_ARG_WITH([classpath-install-dir], [AS_HELP_STRING(--with-classpath-install-dir=<dir>,installation directory of GNU classpath [[default=/usr/local/classpath]])])
 
-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_CHECKING(where GNU classpath is installed)
+if test x"$with_classpath_install_dir" != "x"; then
+       if test x"$with_classpath_install_dir" = "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)
+       CLASSPATH_INSTALL_DIR="$with_classpath_install_dir"
 else
-       AC_MSG_RESULT(no)
-       AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [false])
+       CLASSPATH_INSTALL_DIR="/usr/local/classpath"
 fi
+AC_MSG_RESULT(${CLASSPATH_INSTALL_DIR})
+AC_DEFINE_UNQUOTED([CLASSPATH_INSTALL_DIR], "${CLASSPATH_INSTALL_DIR}", [GNU classpath installation directory])
+AC_SUBST(CLASSPATH_INSTALL_DIR)
 
 
-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 subpackages
 dnl the export is not my favorite (is there another way?)
 export CFLAGS
-if test x"${DISABLE_GC}" = "xno"; then
-       AC_CONFIG_SUBDIRS(src/boehm-gc)
-fi
-
-AC_CONFIG_SUBDIRS(src/classpath)
-
-if test x"${ENABLE_STATICVM}" = "xno"; then
-       AC_CONFIG_SUBDIRS(src/libltdl)
-fi
-if test x"${ENABLE_INTRP}" = "xyes"; then
-       AC_CONFIG_SUBDIRS(src/libffi)
-fi
-
+AC_CONFIG_SUBDIRS(src/boehm-gc src/libltdl src/libffi)
 
 AC_CONFIG_FILES([Makefile]
                [contrib/Makefile]
+               [contrib/setenvinstalled]
+               [contrib/setenvsource]
                [doc/Makefile]
                [doc/handbook/Makefile]
                [man/Makefile]
                [src/Makefile]
                [src/cacao/Makefile]
                [src/cacaoh/Makefile]
+               [src/fdlibm/Makefile]
                [src/lib/Makefile]
                [src/mm/Makefile]
                [src/native/Makefile]
@@ -561,9 +460,7 @@ AC_CONFIG_FILES([Makefile]
                [src/native/tools/Makefile]
                [src/native/vm/Makefile]
                [src/scripts/Makefile]
-               [src/scripts/cacao]
                [src/scripts/java]
-               [src/scripts/javac]
                [src/scripts/rmiregistry]
                [src/threads/Makefile]
                [src/threads/green/Makefile]
@@ -580,6 +477,7 @@ AC_CONFIG_FILES([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/powerpc/Makefile]
                [src/vm/jit/powerpc/darwin/Makefile]
                [src/vm/jit/powerpc/linux/Makefile]