2007-05-03 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / configure.in
index 2b7ec73f47839d5c7caceaf1ff35822d40c153a4..2ee73442bd558adb6597df9c8857c25b6e9c299d 100644 (file)
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,1.2)
+AM_INIT_AUTOMAKE(mono,1.2.4)
 AM_MAINTAINER_MODE
 
 API_VER=1.0
@@ -44,12 +44,13 @@ libmono_cflags=""
 libmono_ldflags=""
 AC_SUBST(libmono_cflags)
 AC_SUBST(libmono_ldflags)
+export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+AC_SUBST(export_ldflags)
 
 # Variable to have relocatable .pc files (lib, or lib64)
 reloc_libdir=`basename ${libdir}`
 AC_SUBST(reloc_libdir)
 
-
 dnl if linker handles the version script
 no_version_script=no
 
@@ -69,7 +70,7 @@ case "$host" in
                        export CC
                fi
                HOST_CC="gcc"
-               CPPFLAGS="$CPPFLAGS -DWIN32_THREADS -DFD_SETSIZE=1024"
+               CPPFLAGS="$CPPFLAGS -DWIN32_THREADS -DFD_SETSIZE=1024 -DUNICODE -D_UNICODE"
                libmono_cflags="-mno-cygwin"
                libmono_ldflags="-mno-cygwin"
                libdl=
@@ -82,14 +83,15 @@ case "$host" in
                ;;
        *-*-*netbsd*)
                platform_win32=no
-               CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+               CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
                libmono_cflags="-D_REENTRANT"
                LDFLAGS="$LDFLAGS -pthread"
                CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
                libmono_ldflags="-pthread"
                need_link_unlink=yes
-               libdl=
-               libgc_threads=no
+               libdl="-ldl"
+               libgc_threads=pthreads
+               with_sigaltstack=no
                ;;
 # these flags will work for all versions of -STABLE
 #
@@ -299,6 +301,28 @@ AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
 
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h)
 
+AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
+if test x$have_zlib = xyes; then
+   AC_TRY_COMPILE([#include <zlib.h>], [
+   void main () {
+   #if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
+   }
+   #else
+   #error No good zlib found
+   #endif
+   ],[
+       AC_MSG_RESULT(Using system zlib)
+       zlib_msg="system zlib"
+   ],[
+       AC_MSG_RESULT(Using embedded zlib)
+       have_zlib=no
+       zlib_msg="bundled zlib"
+   ])
+fi
+
+AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
+AC_DEFINE(HAVE_ZLIB,1,[Have system zlib])
+
 # for mono/metadata/debug-symfile.c
 AC_CHECK_HEADERS(elf.h)
 
@@ -876,20 +900,48 @@ if test x$platform_win32 = xno; then
        ])
 
        dnl *****************************
-    dnl *** Checks for IPV6_PKTINFO ***
-    dnl *****************************
-    AC_MSG_CHECKING(for IPV6_PKTINFO)
-    AC_TRY_COMPILE([#include <netdb.h>], [
-        int level = IPV6_PKTINFO;
-    ], [
-        # Yes, we have it...
-        AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_IPV6_PKTINFO)
-    ], [
-        AC_MSG_RESULT(no)
-    ])
-       dnl *********************************
+       dnl *** Checks for IPV6_PKTINFO ***
+       dnl *****************************
+       AC_MSG_CHECKING(for IPV6_PKTINFO)
+       AC_TRY_COMPILE([#include <netdb.h>], [
+               int level = IPV6_PKTINFO;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IPV6_PKTINFO)
+       ], [
+               AC_MSG_RESULT(no)
+       ])
+
+       dnl **********************************
+       dnl *** Checks for IP_DONTFRAGMENT ***
+       dnl **********************************
+       AC_MSG_CHECKING(for IP_DONTFRAGMENT)
+       AC_TRY_COMPILE([#include <netdb.h>], [
+               int level = IP_DONTFRAGMENT;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IP_DONTFRAGMENT)
+       ], [
+               AC_MSG_RESULT(no)
+       ])
+
+       dnl **********************************
+       dnl *** Checks for IP_MTU_DISCOVER ***
+       dnl **********************************
+       AC_MSG_CHECKING(for IP_MTU_DISCOVER)
+       AC_TRY_COMPILE([#include <netdb.h>], [
+               int level = IP_MTU_DISCOVER;
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IP_MTU_DISCOVER)
+       ], [
+               AC_MSG_RESULT(no)
+       ])
+
+       dnl *********************************
        dnl *** Check for struct ip_mreqn ***
        dnl *********************************
        AC_MSG_CHECKING(for struct ip_mreqn)
@@ -1371,6 +1423,7 @@ 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?))
        AC_CHECK_LIB(ole32, main, LIBS="$LIBS -lole32", AC_ERROR(bad mingw install?))
+       AC_CHECK_LIB(winmm, main, LIBS="$LIBS -lwinmm", AC_ERROR(bad mingw install?))
        AC_CHECK_LIB(oleaut32, main, LIBS="$LIBS -loleaut32", AC_ERROR(bad mingw install?))
 
        dnl *********************************
@@ -1556,6 +1609,10 @@ case "$host" in
                  solaris*)
                        LIBC="libc.so"
                        INTL="libintl.so"
+                       if test "x$ac_cv_sizeof_void_p" = "x8"; then
+                               TARGET=AMD64
+                               arch_target=amd64
+                       fi
 
                        # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. A test case:
                        # int astruct __attribute__ ((visibility ("hidden")));
@@ -1569,7 +1626,6 @@ case "$host" in
                        # ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
                        have_visibility_hidden=no
 
-                       libmono_ldflags="$libmono_ldflags $LIBS"
                esac
                ;;
        x86_64-*-* | amd64-*-*)
@@ -1603,7 +1659,6 @@ case "$host" in
                  *)
                        LIBC="libc.so"
                        INTL="libintl.so"
-                       libmono_ldflags="$libmono_ldflags $LIBS"
                esac
                jit_wanted=true
                if test x"$GCC" = xyes; then
@@ -1860,6 +1915,8 @@ AC_ARG_WITH(preview, [ --with-preview=yes,no     If you want to install the 2.0
        fi
 ])
 
+libmono_ldflags="$libmono_ldflags $LIBS"
+
 AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
 
 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
@@ -1957,6 +2014,20 @@ AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
     cd $depth
 ],[LN_S='$LN_S'])
 
+AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
+[   depth=../../..
+    case $srcdir in
+    [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
+    .) reldir=$depth ;;
+    *) reldir=$depth/$srcdir ;;
+    esac
+    $ac_aux_dir/install-sh -d runtime/etc/mono/
+    cd runtime/etc/mono/
+    rm -f browscap.ini
+    $LN_S $reldir/data/browscap.ini browscap.ini
+    cd $depth
+],[LN_S='$LN_S'])
+
 AC_OUTPUT([
 Makefile
 mint.pc
@@ -2014,6 +2085,7 @@ data/config
 tools/Makefile
 tools/locale-builder/Makefile
 runtime/Makefile
+msvc/Makefile
 ])
 
 if test x$platform_win32 = xyes; then
@@ -2077,6 +2149,7 @@ echo "
        2.0 Alpha:   $PREVIEW
        JNI support: $jdk_headers_found
        libgdiplus:  $libgdiplus_msg
+       zlib:        $zlib_msg
        $disabled
 
 "