2004-05-05 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / configure.in
index 8a89fd6b31e67e7fc547f4aaa8f62636629be834..b07a6d3c17def8eaf3e8767b493b08d0eca8b831 100644 (file)
@@ -1,7 +1,7 @@
 AC_INIT(README)
 AC_CANONICAL_SYSTEM
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,0.31.99)
+AM_INIT_AUTOMAKE(mono,0.91)
 AM_MAINTAINER_MODE
 
 dnl
@@ -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
@@ -857,21 +862,37 @@ if test x$platform_win32 = xno; then
        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 +1059,7 @@ case "$host" in
                arch_target=sparc;
                JIT_SUPPORTED=yes
                ACCESS_UNALIGNED="no"
+               LIBC="libc.so"
                jit_wanted=true
                ;;
 #       alpha*-*-linux* | alpha*-*-osf*)
@@ -1105,6 +1127,7 @@ libsuffix=".so"
 case "$host" in
      powerpc-*-darwin*)
        libsuffix=".dylib"
+       LIBC="libc.dylib"
        ;;
 esac
 AC_SUBST(libsuffix)
@@ -1222,5 +1245,6 @@ echo "
        SIGALTSTACK: $with_sigaltstack
        Engine:      $jit_status
        2.0 Alpha:   $PREVIEW
-       
+       JNI support: $jdk_headers_found
+
 "