New tests.
[mono.git] / libgc / configure.in
index 96acc156697b8f1b26bf1130ebdee547c8f7bdef..2f7e173189b28e73b847343718fbfe356f6e6963 100644 (file)
@@ -39,12 +39,21 @@ AM_MAINTAINER_MODE
 
 . [$]{srcdir}/configure.host
 
+# We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono 
+# configure, because of autoconf brokeness
+if test "x$CPPFLAGS_FOR_LIBGC" != "x"; then
+   CPPFLAGS=$CPPFLAGS_FOR_LIBGC
+fi
+if test "x$CFLAGS_FOR_LIBGC" != "x"; then
+   CFLAGS=$CFLAGS_FOR_LIBGC
+fi
+
 GC_CFLAGS=${gc_cflags}
 AC_SUBST(GC_CFLAGS)
 
 case $enable_embed_check in
 no) ;;
-*) AC_MSG_ERROR([This module is now part of `mono' and can't be built as a stand-alone module any longer.]) ;;
+*) AC_MSG_ERROR([This module is now part of 'mono' and cannot be built as a stand-alone module any longer.]) ;;
 esac
 
 THREADS=$with_libgc_threads
@@ -75,7 +84,7 @@ case "$THREADS" in
     ;;
  posix | pthreads)
     THREADS=posix
-    THREADDLLIBS=-lpthread
+    AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,)
     case "$host" in
      x86-*-linux* | ia64-*-linux* | i386-*-linux* | i486-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha*-*-linux* | s390*-*-linux* | sparc*-*-linux* | powerpc-*-linux*)
        AC_DEFINE(GC_LINUX_THREADS)
@@ -103,29 +112,9 @@ case "$THREADS" in
        AC_DEFINE(THREAD_LOCAL_ALLOC)
        THREADDLLIBS="-lpthread -lrt"
        ;;
-     *-*-freebsd4*)
-       AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
-       AC_DEFINE(GC_FREEBSD_THREADS)
-       if test "x$PTHREAD_CFLAGS" = "x"; then
-               INCLUDES="$INCLUDES -pthread"
-       else
-               INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
-       fi
-       if test "x$PTHREAD_LIBS" = "x"; then
-               THREADDLLIBS=-pthread
-       else
-               THREADDLLIBS=$PTHREAD_LIBS
-       fi
-       ;;
-     *-*-freebsd5*)
-       AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
+      *-*-freebsd*)
        AC_DEFINE(GC_FREEBSD_THREADS)
-       INCLUDES="$INCLUDES -pthread"
-       THREADDLLIBS=-pthread
-       ;;
-        *-*-freebsd6*)
-        AC_DEFINE(GC_FREEBSD_THREADS)
-        if test "x$PTHREAD_CFLAGS" != "x"; then
+       if test "x$PTHREAD_CFLAGS" != "x"; then
                INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
        fi
        if test "x$PTHREAD_LIBS" = "x"; then
@@ -151,6 +140,13 @@ case "$THREADS" in
          AC_DEFINE(PARALLEL_MARK)
        fi
        ;;
+     *-*-netbsd*)
+       AC_DEFINE(GC_NETBSD_THREADS)
+       if test "${enable_parallel_mark}" = yes; then
+         AC_DEFINE(PARALLEL_MARK)
+       fi
+       AC_DEFINE(THREAD_LOCAL_ALLOC)
+       ;;
      *-*-osf*)
        AC_DEFINE(GC_OSF1_THREADS)
         if test "${enable_parallel_mark}" = yes; then