Wed Feb 24 15:47:16 CET 2010 Paolo Molaro <lupus@ximian.com>
[mono.git] / configure.in
index c8be62612ada2b10955c3beacbd950e73ff27461..5e34f9d203cc64a5a895c746d0dc854803ca54af 100644 (file)
@@ -9,7 +9,7 @@ AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(mono,2.7)
 AM_MAINTAINER_MODE
 
-API_VER=1.0
+API_VER=2.0
 AC_SUBST(API_VER)
 
 AC_PROG_LN_S
@@ -85,7 +85,9 @@ case "$host" in
                host_win32=yes
                if test "x$cross_compiling" = "xno"; then
                        target_win32=yes
-                       AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
+                       if test "x$host" == "x$target"; then
+                               AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
+                       fi
                        CC="gcc -mno-cygwin -g"
                        CXX="g++ -mno-cygwin -g"
                        # So libgc configure gets -mno-cygwin
@@ -95,7 +97,7 @@ case "$host" in
                HOST_CC="gcc"
                # Windows 2000 is required that includes Internet Explorer 5.01
                CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
-               LDFLAGS="$LDFLAGS -lmswsock"
+               LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm"
                libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
                libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
                libdl=
@@ -202,6 +204,7 @@ case "$host" in
                with_tls=pthread
                has_dtrace=yes
                use_sigposix=yes
+               enable_solaris_tar_check=yes
                ;;
        *-*-darwin*)
                parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
@@ -259,6 +262,7 @@ AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
 
 AC_CHECK_TOOL(CC, gcc, gcc)
 AC_PROG_CC
+AC_CHECK_TOOL(CXX, g++, g++)
 AC_PROG_CXX
 AM_PROG_AS
 AM_PROG_CC_STDC
@@ -271,6 +275,16 @@ dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
 AC_SUBST(CCAS)
 AC_SUBST(CCASFLAGS)
 
+# AC_PROG_CXX helpfully sets CXX to g++ even if no c++ compiler is found so check
+# GXX instead. See http://lists.gnu.org/archive/html/bug-autoconf/2002-04/msg00056.html
+if test "x$CXX" = "xg++"; then
+       if test "x$GXX" != "xyes"; then
+               # automake/libtool is so broken, it requires g++ even if the c++ sources
+               # are inside automake conditionals
+               AC_MSG_ERROR([You need to install g++])
+       fi
+fi
+
 AC_CHECK_PROG(BISON, bison,yes,no)
 if test "x$BISON" = "xno";
 then
@@ -415,7 +429,7 @@ AC_ARG_ENABLE(solaris-tar-check,
 [  --disable-solaris-tar-check    disable solaris tar check],
    do_solaris_tar_check=no, do_solaris_tar_check=yes)
 
-if test x"$do_solaris_tar_check" = xyes; then
+if test x"$do_solaris_tar_check" = xyes -a x"$enable_solaris_tar_check" = xyes; then
        AC_MSG_CHECKING(integrity of package)
        if test -f $srcdir/$mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
        then
@@ -1909,7 +1923,11 @@ if test "x$enable_llvm" = "xyes"; then
          AC_MSG_ERROR([llvm-config not found.])
    fi
 
-   LLVM_CXXFLAGS=`$LLVM_CONFIG --cflags`
+   # The output of --cflags seems to include optimizations flags too
+   LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+   # LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
+   # from LLVM classes.
+   LLVM_CXXFLAGS="`$LLVM_CONFIG --cxxflags` -fno-rtti"
    LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
    LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit x86codegen`
    LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
@@ -1926,6 +1944,7 @@ if test "x$enable_llvm" = "xyes"; then
    # llvm's config.h
    LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MAJOR_VERSION=$major_version -DLLVM_MINOR_VERSION=$minor_version"
 
+   AC_SUBST(LLVM_CFLAGS)
    AC_SUBST(LLVM_CXXFLAGS)
    AC_SUBST(LLVM_LIBS)
    AC_SUBST(LLVM_LDFLAGS)
@@ -2303,16 +2322,19 @@ if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
 fi
 
 mono_debugger_supported=no
-if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86" -o "x$TARGET" = "xALPHA"; then
-       if test x$use_included_gc = xyes; then
-               case "$host" in
-               *-*-*linux*)
-                       mono_debugger_supported=yes
-                       ;;
-               *86-apple-darwin*)
-                       mono_debugger_supported=yes
-                       ;;              
-               esac
+AC_ARG_ENABLE(mono-debugger, [  --disable-mono-debugger disable support for the mdb debugger], try_mono_debugger=$enableval, try_mono_debugger=yes)
+if test "x$try_mono_debugger" = "xyes"; then
+       if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86" -o "x$TARGET" = "xALPHA"; then
+               if test x$use_included_gc = xyes; then
+                       case "$host" in
+                       *-*-*linux*)
+                               mono_debugger_supported=yes
+                               ;;
+                       *86-apple-darwin*)
+                               mono_debugger_supported=yes
+                               ;;              
+                       esac
+               fi
        fi
 fi
 
@@ -2482,7 +2504,7 @@ if test x$host_win32 = xyes; then
   if test "x$cross_compiling" = "xno"; then
     mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
   else
-    mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\\'`\\etc
+    mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\'`\\etc
   fi
 else
   mono_cfg_dir=$mono_cfg_root/etc
@@ -2645,7 +2667,7 @@ data/net_2_0/Makefile
 data/net_4_0/Makefile
 data/net_2_0/Browsers/Makefile
 data/mint.pc
-data/mono.pc
+data/mono-2.pc
 data/mono-cairo.pc
 data/mono-nunit.pc
 data/mono-options.pc