2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / configure.in
index 1be638dccc4d6d0440733b3fbdd8bba91fdf35aa..828876e1d583d078a703c37eab3db709e24da728 100644 (file)
@@ -226,7 +226,15 @@ AC_ARG_WITH(gc, [  --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default]
 # Enable support for NPTL only features like fast thread-local storage
 # We can't reliably detect nptl at compile & run time
 # so this option will stay until nptl becomes more widespread
-AC_ARG_WITH(nptl, [  --with-nptl Enable support for NPTL])
+AC_ARG_WITH(nptl, [  --with-nptl=yes,no      enable/disable support for NPTL],[],[with_nptl=yes])
+
+# Enable support for using sigaltstack for SIGSEGV and stack overflow handling
+# This does not work on some platforms (bug #55253)
+AC_ARG_WITH(sigaltstack, [  --with-sigaltstack=yes,no      enable/disable support for sigaltstack],[],[with_sigaltstack=yes])
+
+if test x$with_sigaltstack = "xyes"; then
+       AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
+fi
 
 # assembly bundle support, see metadata/make-bundle.pl for more info
 AC_ARG_WITH(bundle, [  --with-bundle=bundle_template],[
@@ -260,6 +268,10 @@ case "x$gc" in
                if test "x$found_gcj_malloc" = "xyes"; then
                        AC_DEFINE(HAVE_GC_GCJ_MALLOC)
                fi
+               AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
+               if test "x$found_gc_enable" = "xyes"; then
+                       AC_DEFINE(HAVE_GC_ENABLE)
+               fi
                ;;
 
        xincluded)
@@ -281,6 +293,7 @@ case "x$gc" in
 
                # The included libgc contains GCJ support
                AC_DEFINE(HAVE_GC_GCJ_MALLOC)
+               AC_DEFINE(HAVE_GC_ENABLE)
                ;;
 
        xnone)
@@ -469,6 +482,8 @@ if test x$platform_win32 = xno; then
                # Yes, we have it...
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
+       ], [
+               AC_MSG_RESULT(no)
        ])
 
        dnl *****************************
@@ -594,7 +609,7 @@ if test x$platform_win32 = xno; then
                        return !(res1 + res2 == 2);
                }
        ], [
-                       if test "x$with_nptl" = "x"; then
+                       if test "x$with_nptl" != "xyes"; then
                                AC_MSG_RESULT(disabled)
                        else
                                AC_MSG_RESULT(yes)
@@ -694,9 +709,17 @@ ac_cv_c_socklen_t=yes
 AC_CHECK_FUNCS(truncl, , AC_MSG_CHECKING(for truncl in math.h)
        AC_TRY_LINK([#include <math.h>], 
        [ truncl(0.0); ], 
-       AC_DEFINE(HAVE_TRUNCL) AC_MSG_RESULT(yes),
+       [
+               AC_DEFINE(HAVE_TRUNCL) 
+               AC_MSG_RESULT(yes)
+               ac_cv_truncl=yes
+       ],
        AC_MSG_RESULT(no)))
 
+if test "x$ac_cv_truncl" != "xyes"; then
+   AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
+fi
+
 dnl ****************************
 dnl *** Look for /dev/random ***
 dnl ****************************
@@ -802,9 +825,15 @@ case "$host" in
                arch_target=x86;
                JIT_SUPPORTED=yes
                ;;
+       x86_64-*-* | amd64-*-*)
+               TARGET=AMD64;
+               arch_target=amd64;
+               JIT_SUPPORTED=no
+               ;;
        sparc*-*-*)
                TARGET=SPARC;
                arch_target=sparc;
+               JIT_SUPPORTED=yes
                ACCESS_UNALIGNED="no"
                ;;
 #       alpha*-*-linux* | alpha*-*-osf*)
@@ -847,6 +876,15 @@ case "$host" in
                ;;
 esac
 
+libsuffix=".so"
+
+case "$host" in
+     powerpc-*-darwin*)
+       libsuffix=".dylib"
+       ;;
+esac
+AC_SUBST(libsuffix)
+
 if test ${TARGET} = ARM; then
        dnl ******************************************
        dnl *** Check to see what FPU is available ***
@@ -879,6 +917,7 @@ AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
 AM_CONDITIONAL(X86, test x$TARGET = xX86)
+AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
@@ -929,7 +968,7 @@ mono/profiler/Makefile
 runtime/Makefile
 scripts/Makefile
 man/Makefile
-doc/Makefile
+web/Makefile
 docs/Makefile
 data/Makefile
 samples/Makefile
@@ -941,4 +980,6 @@ echo "
 
        GC:     $gc
        ICU:    $enable_icu
+       NPTL:   $with_nptl
+       SIGALTSTACK: $with_sigaltstack
 "