Merged revisions 7797-7917 via svnmerge from
[cacao.git] / configure.ac
index 327d6171e944322c9be3bcf6c7589d4c657b11ca..62b76eb92258b3241ffa17c9e805271b2cfbeb15 100644 (file)
@@ -22,7 +22,7 @@ dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 dnl 02110-1301, USA.
 dnl 
-dnl $Id: configure.ac 7796 2007-04-23 20:04:44Z twisti $
+dnl $Id: configure.ac 7902 2007-05-11 22:33:15Z twisti $
 
 dnl Process this file with autoconf to produce a configure script.
 
@@ -212,10 +212,16 @@ AM_PROG_MKDIR_P
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
+
+dnl keep them alpha-sorted!
 AC_CHECK_HEADERS([fcntl.h])
-AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_HEADERS([string.h])
+AC_CHECK_HEADERS([time.h])
 AC_CHECK_HEADERS([unistd.h])
 AC_CHECK_HEADERS([sys/ioctl.h])
+AC_CHECK_HEADERS([sys/mman.h])
+AC_CHECK_HEADERS([sys/resource.h])
+AC_CHECK_HEADERS([sys/time.h])
 
 dnl this is for fdlibm
 AC_CHECK_HEADERS([stdint.h])
@@ -241,10 +247,23 @@ AC_PROG_GCC_TRADITIONAL
 AC_TYPE_SIGNAL
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP
-AC_CHECK_FUNCS([calloc mmap getpagesize free])
-AC_CHECK_FUNCS([getcwd gettimeofday])
-AC_CHECK_FUNCS([scandir])
+
+dnl keep them alpha-sorted!
+AC_CHECK_FUNCS([calloc])
+AC_CHECK_FUNCS([getpagesize])
+AC_CHECK_FUNCS([free])
+AC_CHECK_FUNCS([getcwd])
+AC_CHECK_FUNCS([gettimeofday])
+AC_CHECK_FUNCS([getrusage])
 AC_CHECK_FUNCS([isnan])
+AC_CHECK_FUNCS([localtime])
+AC_CHECK_FUNCS([localtime_r])
+AC_CHECK_FUNCS([mmap])
+AC_CHECK_FUNCS([mprotect])
+AC_CHECK_FUNCS([scandir])
+AC_CHECK_FUNCS([strdup])
+AC_CHECK_FUNCS([time])
+
 
 dnl Checks for libraries.
 
@@ -569,61 +588,7 @@ if test x"${ENABLE_JVMTI}" = "xyes"; then
 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
+AC_CHECK_ENABLE_THREADS
 
 
 dnl check if if-conversion should be supported
@@ -982,6 +947,7 @@ AC_CONFIG_FILES([Makefile]
                [src/vm/jit/mips/Makefile]
                [src/vm/jit/mips/irix/Makefile]
                [src/vm/jit/mips/linux/Makefile]
+               [src/vm/jit/mips/uclinux/Makefile]
                [src/vm/jit/optimizing/Makefile]
                [src/vm/jit/parisc/Makefile]
                [src/vm/jit/parisc/linux/Makefile]