2009-04-07 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / configure.in
index 134939150e766e2aceb57cb84193b56183fc219c..4cab90f7044d482ace4343939eb372bab27d52a0 100644 (file)
@@ -64,10 +64,13 @@ need_link_unlink=no
 AC_MSG_CHECKING([host platform characteristics])
 libgc_threads=no
 has_dtrace=no
+parallel_mark=yes
 case "$host" in
        *-*-mingw*|*-*-cygwin*)
                platform_win32=yes
                AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
+               AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
+               AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
                if test "x$cross_compiling" = "xno"; then
                        CC="gcc -mno-cygwin -g"
                        # So libgc configure gets -mno-cygwin
@@ -97,6 +100,7 @@ case "$host" in
                libdl="-ldl"
                libgc_threads=pthreads
                with_sigaltstack=no
+               use_sigposix=yes
                ;;
        *-*-*freebsd*)
                platform_win32=no
@@ -125,10 +129,11 @@ case "$host" in
 # but NOT library support)
 #
                with_tls=pthread
+               use_sigposix=yes
                ;;
        *-*-*openbsd*)
                platform_win32=no
-               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
+               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD"
                libmono_cflags="-D_THREAD_SAFE"
                LDFLAGS="$LDFLAGS -pthread"
                libmono_ldflags="-pthread"
@@ -136,6 +141,7 @@ case "$host" in
                AC_DEFINE(PTHREAD_POINTER_ID)
                libdl=
                libgc_threads=pthreads
+               use_sigposix=yes
                ;;
        *-*-linux*)
                platform_win32=no
@@ -145,9 +151,10 @@ case "$host" in
                libdl="-ldl"
                libgc_threads=pthreads
                AOT_SUPPORTED="yes"
+               use_sigposix=yes
                ;;
        *-*-hpux*)
-        platform_win32=no
+               platform_win32=no
                CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
                # +ESdbgasm only valid on bundled cc on RISC
                # silently ignored for ia64
@@ -163,6 +170,7 @@ case "$host" in
                libmono_ldflags="-lpthread"
                libgc_threads=pthreads
                need_link_unlink=yes
+               use_sigposix=yes
                ;;
        *-*-solaris*)
                platform_win32=no
@@ -173,8 +181,10 @@ case "$host" in
                # This doesn't seem to work on solaris/x86, but the configure test runs
                with_tls=pthread
                has_dtrace=yes
+               use_sigposix=yes
                ;;
        *-*-darwin*)
+               parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
                platform_win32=no
                platform_darwin=yes
                CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
@@ -207,9 +217,12 @@ fi
 
 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
 AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
+AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
+AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
 
 AC_CHECK_TOOL(CC, gcc, gcc)
 AC_PROG_CC
+AC_PROG_CXX
 AM_PROG_AS
 AM_PROG_CC_STDC
 AC_PROG_INSTALL
@@ -322,7 +335,7 @@ AC_CHECK_SIZEOF(void *, 4)
 
 WARN=''
 if test x"$GCC" = xyes; then
-        WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
+        WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings'
                # The runtime code does not respect ANSI C strict aliasing rules
                CFLAGS="$CFLAGS -fno-strict-aliasing"
 
@@ -640,7 +653,7 @@ AC_TRY_COMPILE([], [
    AC_MSG_RESULT(no)
 ])
 
-AC_ARG_ENABLE(parallel-mark, [  --enable-parallel-mark     Enables GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=yes)
+AC_ARG_ENABLE(parallel-mark, [  --enable-parallel-mark     Enables GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
 if test x$enable_parallel_mark = xyes; then
        libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
 fi
@@ -1361,6 +1374,7 @@ if test x$platform_win32 = xno; then
        AC_CHECK_HEADERS(net/if.h)
        AC_MSG_CHECKING(for ifreq)
        AC_TRY_COMPILE([
+               #include <stdio.h>
                #include <sys/ioctl.h>
                #include <net/if.h>
                ], [
@@ -1750,6 +1764,30 @@ fi
 AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
 AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
 
+dnl **************
+dnl ***  LLVM  ***
+dnl **************
+
+AC_ARG_ENABLE(llvm,[  --enable-llvm    Enable the experimental LLVM back-end], enable_llvm=$enableval, enable_llvm=no)
+
+if test "x$enable_llvm" = "xyes"; then
+   AC_PATH_PROG(LLVM_CONFIG, llvm-config, no)
+   if test "x$LLVM_CONFIG" = "xno"; then
+         AC_MSG_ERROR([llvm-config not found.])
+   fi
+
+   LLVM_CXXFLAGS=`$LLVM_CONFIG --cflags`
+   LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
+   LLVM_LIBS=`$LLVM_CONFIG --libs core engine`
+   LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
+
+   AC_SUBST(LLVM_CXXFLAGS)
+   AC_SUBST(LLVM_LIBS)
+   AC_DEFINE(ENABLE_LLVM, 1, [Enable the LLVM back end])
+fi
+
+AM_CONDITIONAL(ENABLE_LLVM, [test x$enable_llvm = xyes])
+
 TARGET="unknown"
 ACCESS_UNALIGNED="yes"
 
@@ -2170,6 +2208,14 @@ AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no  Use malloc for each
        fi
 ])
 
+
+DISABLE_MCS_DOCS=no
+AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no  If you want to build the documentation under mcs (defaults to YES)],[
+       if test x$with_mcs_docs != xyes; then
+               DISABLE_MCS_DOCS=yes
+       fi
+])
+
 AM_CONDITIONAL(HAVE_OPROFILE, test x$OPROFILE = xyes)
 AC_SUBST(OPROFILE_CFLAGS)
 AC_SUBST(OPROFILE_LIBS)
@@ -2324,7 +2370,6 @@ mono/metadata/Makefile
 mono/dis/Makefile
 mono/cil/Makefile
 mono/arch/Makefile
-mono/os/Makefile
 mono/arch/x86/Makefile
 mono/arch/amd64/Makefile
 mono/arch/hppa/Makefile
@@ -2367,13 +2412,14 @@ data/mono-nunit.pc
 data/mono-options.pc
 data/mono-lineeditor.pc
 data/monodoc.pc
+data/mono.web.pc
 data/dotnet.pc
 data/dotnet35.pc
 data/wcf.pc
 data/cecil.pc
-data/smcs.pc
 data/system.web.extensions_1.0.pc
 data/system.web.extensions.design_1.0.pc
+data/system.web.mvc.pc
 samples/Makefile
 support/Makefile
 data/config
@@ -2461,6 +2507,10 @@ fi
       fi
     fi
   fi
+
+  if test x$DISABLE_MCS_DOCS = xyes; then
+       echo "DISABLE_MCS_DOCS = yes" >> $srcdir/$mcsdir/build/config.make
+  fi
 )
 
 libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
@@ -2482,6 +2532,7 @@ echo "
        BigArrays:     $enable_big_arrays
        DTrace:        $enable_dtrace
        Parallel Mark: $enable_parallel_mark
+       LLVM Back End: $enable_llvm
        $disabled
 
 "
@@ -2497,3 +2548,9 @@ if test x$gc = xsgen; then
        echo IMPORTANT:
        echo IMPORTANT: There are known problems with it, use at your own risk.
 fi
+
+if test x$enable_llvm = xyes; then
+   echo IMPORTANT:
+   echo IMPORTANT: The LLVM Back End is experimental and does not work yet.
+   echo IMPORTANT:
+fi