+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])
+ ;;
+
+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 and classpath to
+ dnl synchronize VM threads portably
+ ac_configure_args="$ac_configure_args --enable-boehm-threads=posix --enable-portable-native-sync"
+ AM_CONDITIONAL([NATIVE_THREADS], [true])
+
+ else
+ AC_MSG_RESULT(yes, green)
+
+ dnl no threads for boehm
+ ac_configure_args="$ac_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 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