2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / configure.in
index f0fad45e37cc36f3dac1d55b3b4e08e2de94d656..cff12ce6e51fd7f8c8dcc96d69110aa3a1b47c51 100644 (file)
@@ -58,7 +58,7 @@ case "$host" in
                ;;
        *-*-*freebsd*|*-*-*openbsd*)
                platform_win32=no
-               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
                libmono_cflags="-D_THREAD_SAFE"
                LDFLAGS="$LDFLAGS -pthread"
                libmono_ldflags="-pthread"
@@ -349,10 +349,15 @@ if test x$platform_win32 = xno; then
                        else
                        if test -d $with_jdk_dir/include/solaris; then
                                jdk_platform=solaris
+                       else
+                       if test -f $with_jdk_dir/include/jni_md.h; then
+                               # GNU Classpath sources
+                               jdk_platform=
                        else
                                jdk_headers_found=no
                        fi
                        fi
+                       fi
                else
                        jdk_headers_found=no
                fi
@@ -849,29 +854,40 @@ if test x$platform_win32 = xno; then
                AC_MSG_RESULT(no)
        ]) 
 
-       dnl *********************
-       dnl * Check for scandir *
-       dnl *********************
-       AC_CHECK_FUNCS(scandir)
-
        dnl *********************
        dnl *** Check for AIO ***
        dnl *********************
-       AC_CHECK_HEADERS(aio.h sys/aio.h)
-       AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
-       SIGVAL_PTR="undefined"
-       if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
-               AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
-                               #include <sys/signal.h>
-                               ])
-               AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
-                               #include <sys/signal.h>
-                               ])
-               if test "$SIGVAL_PTR" = "undefined" ; then
-                       AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
+       AC_MSG_CHECKING([for SIGEV_THREAD definition])
+       dnl Some systems (FreeBSD at least) may have aio_read
+       dnl but don't support/define SIGEV_THREAD.
+       AC_TRY_COMPILE([
+       #include <sys/signal.h>
+       ],[
+       int x = SIGEV_THREAD;
+       ],[
+               ac_cv_c_sigev_thread=yes
+               AC_MSG_RESULT(yes)
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       if test "$ac_cv_c_sigev_thread" = "yes" ; then
+               AC_CHECK_HEADERS(aio.h sys/aio.h)
+               AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
+               SIGVAL_PTR="undefined"
+               if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
+                       AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
+                                       #include <sys/signal.h>
+                                       ])
+                       AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
+                                       #include <sys/signal.h>
+                                       ])
+                       if test "$SIGVAL_PTR" = "undefined" ; then
+                               AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
+                       fi
                fi
+               AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
        fi
-       AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
 else
        AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
        AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
@@ -1038,6 +1054,7 @@ case "$host" in
                arch_target=sparc;
                JIT_SUPPORTED=yes
                ACCESS_UNALIGNED="no"
+               LIBC="libc.so"
                jit_wanted=true
                ;;
 #       alpha*-*-linux* | alpha*-*-osf*)
@@ -1060,6 +1077,7 @@ case "$host" in
        hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
                TARGET=HPPA;
                arch_target=hppa; 
+               LIBC="libc.sl"
                ACCESS_UNALIGNED="no"
                ;;
        macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
@@ -1068,7 +1086,6 @@ case "$host" in
                arch_target=ppc;
                JIT_SUPPORTED=yes
                jit_wanted=true
-               LIBC="libc.dylib"
                ;;
        arm-*-linux-* | armv4l-*-linux-*)
                TARGET=ARM;
@@ -1106,6 +1123,7 @@ libsuffix=".so"
 case "$host" in
      powerpc-*-darwin*)
        libsuffix=".dylib"
+       LIBC="libc.dylib"
        ;;
 esac
 AC_SUBST(libsuffix)