Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / configure.ac
index 7a4803a3f6977ac348689539cd73eed175bcd65c..f02e6526f9e7966753e57442c62e01c3364c3ebe 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 #AC_PREREQ([2.62])
 
-AC_INIT(mono, [4.1.0],
+AC_INIT(mono, [4.3.0],
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
 AC_CONFIG_SRCDIR([README.md])
@@ -41,12 +41,6 @@ esac
 #
 libgc_configure_args=
 
-if test -d $srcdir/libgc ; then
-  libgc_default=included
-else
-  libgc_default=boehm
-fi
-
 # These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
 # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
 CPPFLAGS_FOR_LIBGC=$CPPFLAGS
@@ -96,30 +90,27 @@ platform_android=no
 platform_darwin=no
 case "$host" in
        *-mingw*|*-*-cygwin*)
-               AC_DEFINE(HOST_WIN32,1,[Host 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])
                host_win32=yes
                mono_cv_clang=no
                if test "x$cross_compiling" = "xno"; then
-                       target_win32=yes
                        if test "x$host" == "x$build" -a "x$host" == "x$target"; then
-                               AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
+                               target_win32=yes
                        fi
                else
-                       target_win32=yes
-                       AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW])
-                       AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
+                       if test "x$host" == "x$target"; then
+                               target_win32=yes
+                       fi
                fi
                HOST_CC="gcc"
-               # Windows XP SP2 is required
-               CPPFLAGS="$CPPFLAGS -DWINVER=0x0502 -D_WIN32_WINNT=0x0502 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
+               # Windows Vista or later is required
+               CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
                LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32 -liphlpapi"
                libmono_cflags="-mms-bitfields -mwindows"
                libmono_ldflags="-mms-bitfields -mwindows"
                libdl=
                libgc_threads=win32
-               libgc_default=included
                with_sigaltstack=no
                with_tls=pthread
                LN_S=cp
@@ -185,7 +176,6 @@ case "$host" in
                need_link_unlink=yes
                AC_DEFINE(PTHREAD_POINTER_ID)
                libdl=
-               libgc_default=boehm
                libgc_threads=pthreads
                with_sigaltstack=no
                use_sigposix=yes
@@ -260,7 +250,6 @@ case "$host" in
                libmono_cflags="-D_REENTRANT"
                libdl=
                libgc_threads=pthreads
-               libgc_default=boehm
                use_sigposix=yes
                ikvm_native=no
                AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
@@ -360,6 +349,14 @@ if test x$need_link_unlink = xyes; then
    AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
 fi
 
+if test x$host_win32 = xyes; then
+   AC_DEFINE(HOST_WIN32, 1, [Host Platform is Win32])
+fi
+
+if test x$target_win32 = xyes; then
+   AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
+fi
+
 AC_SUBST(extra_runtime_ldflags)
 AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
 AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
@@ -519,13 +516,13 @@ AC_CACHE_CHECK([for clang],
        [])
 ])
 
-AC_ARG_ENABLE(visiblity-hidden,
-[  --disable-visibility-hidden    disable usage of -fvisiblity=hidden]
-   disable_visibility_hidden=no, disable_visibility_hidden=yes)
+AC_ARG_ENABLE(visibility-hidden,
+[  --disable-visibility-hidden    disable usage of -fvisiblity=hidden],
+   disable_visibility_hidden=yes, disable_visibility_hidden=no)
 
 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 -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value'
+        WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes'
 
                # We require C99 with some GNU extensions, e.g. `linux` macro
                CFLAGS="$CFLAGS -std=gnu99"
@@ -631,17 +628,6 @@ fi
 AC_SUBST([mcs_topdir])
 AC_SUBST([mcs_topdir_from_srcdir])
 
-# Where's the 'olive' source tree?
-if test -d $srcdir/olive; then
-  olivedir=olive
-else
-  olivedir=../olive
-fi
-
-if test -d $srcdir/$olivedir; then
-olive_topdir='$(top_srcdir)/'$olivedir
-fi
-
 # gettext: prepare the translation directories. 
 # we do not configure the full gettext, as we consume it dynamically from C#
 AM_PO_SUBDIRS
@@ -1015,7 +1001,7 @@ dnl
 dnl Boehm GC configuration
 dnl
 
-AC_ARG_WITH(libgc,   [  --with-gc=boehm,included,none  Controls the Boehm GC config, default=included],[libgc=$with_gc],[libgc=$libgc_default])
+AC_ARG_WITH(libgc,   [  --with-gc=included,none  Controls the Boehm GC config, default=included],[libgc=$with_gc],[libgc=included])
 
 AC_ARG_ENABLE(boehm, [  --disable-boehm            Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
 AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
@@ -1025,55 +1011,13 @@ if test x$enable_parallel_mark = xyes; then
        libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
 fi
 
-gc_headers=no
 gc_msg=""
-use_included_gc=no
 LIBGC_CPPFLAGS=
 LIBGC_LIBS=
 LIBGC_STATIC_LIBS=
 libgc_dir=
 case "x$libgc" in
-       xboehm|xbohem|xyes)
-               AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
-               AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
-
-               if test "x$found_boehm" != "xyes"; then
-                       AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
-               fi
-               if test "x$gc_headers" != "xyes"; then
-                       AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
-               fi
-
-               LIBGC_LIBS="-lgc $libdl"
-               LIBGC_STATIC_LIBS="$LIBGC_LIBS"
-               libmono_ldflags="$libmono_ldflags -lgc"
-               BOEHM_DEFINES="-DHAVE_BOEHM_GC"
-
-               # AC_CHECK_FUNCS does not work for some reason...
-               AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
-               if test "x$found_gcj_malloc" = "xyes"; then
-                       BOEHM_DEFINES="-DHAVE_GC_GCJ_MALLOC $BOEHM_DEFINES"
-                       AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "System Boehm (with typed GC)", [GC description])
-                       gc_msg="System Boehm with typed GC"
-               else
-                       AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "System Boehm (no typed GC)", [GC description])
-                       gc_msg="System Boehm (without typed GC)"
-               fi
-               AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
-               if test "x$found_gc_enable" = "xyes"; then
-                       BOEHM_DEFINES="-DHAVE_GC_ENABLE $BOEHM_DEFINES"
-               fi
-
-               # check whether we need to explicitly allow
-               # thread registering
-               AC_CHECK_LIB(gc, GC_allow_register_threads, found_allow_register_threads="yes",,$libdl)
-               if test "x$found_allow_register_threads" = "xyes"; then
-                  AC_DEFINE(HAVE_GC_ALLOW_REGISTER_THREADS, 1, [GC requires thread registration])
-               fi
-               ;;
-
        xincluded)
-               use_included_gc=yes
                if test "x$support_boehm" = "xyes"; then
                        libgc_dir=libgc
                fi
@@ -1082,7 +1026,7 @@ case "x$libgc" in
                LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
                LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
 
-               BOEHM_DEFINES="-DHAVE_BOEHM_GC -DHAVE_GC_H -DUSE_INCLUDED_LIBGC -DHAVE_GC_GCJ_MALLOC -DHAVE_GC_ENABLE"
+               BOEHM_DEFINES="-DHAVE_BOEHM_GC"
 
                if test x$target_win32 = xyes; then
                        BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
@@ -1098,6 +1042,10 @@ case "x$libgc" in
                fi
                ;;
 
+       xboehm|xbohem|xyes)
+               AC_MSG_WARN("External Boehm is no longer supported")
+               ;;
+
        xsgen)
                AC_MSG_WARN("Use --with-sgen instead, --with-gc= controls Boehm configuration")
                ;;
@@ -1118,7 +1066,6 @@ if test "x$large_heap" = "xyes"; then
    CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
 fi
 
-AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
 AC_SUBST(LIBGC_CPPFLAGS)
 AC_SUBST(LIBGC_LIBS)
 AC_SUBST(LIBGC_STATIC_LIBS)
@@ -1154,7 +1101,7 @@ dnl ***********************************
 AC_CHECK_HEADERS(signal.h)
 AC_CHECK_FUNCS(sigaction)
 
-if test x$target_win32 = xno; then
+if test x$host_win32 = xno; then
 
        dnl hires monotonic clock support
        AC_SEARCH_LIBS(clock_gettime, rt)
@@ -2375,6 +2322,24 @@ else
                AC_MSG_RESULT(no)
        ])
 
+       dnl **********************************
+       dnl *** Check for inet_pton ***
+       dnl **********************************
+       AC_MSG_CHECKING(for inet_pton)
+               AC_TRY_LINK([
+               #include <stdio.h>
+               #include <winsock2.h>
+               #include <ws2tcpip.h>
+       ], [
+               inet_pton (0, NULL, NULL);
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_INET_PTON, 1, [Have inet_pton])
+       ], [
+               AC_MSG_RESULT(no)
+       ])
+
        AC_CHECK_DECLS(InterlockedExchange64, [], [], [[#include <windows.h>]])
        AC_CHECK_DECLS(InterlockedCompareExchange64, [], [], [[#include <windows.h>]])
        AC_CHECK_DECLS(InterlockedDecrement64, [], [], [[#include <windows.h>]])
@@ -2645,7 +2610,7 @@ AC_ARG_WITH(llvm, [  --with-llvm=<llvm prefix>    Enable the LLVM back-end], ena
 if test "x$enable_llvm" = "xyes"; then
    if test "x$with_llvm" != "x"; then
          LLVM_CONFIG=$with_llvm/bin/llvm-config
-         if test x$target_win32 = xyes; then
+         if test x$host_win32 = xyes; then
                LLVM_CONFIG=$LLVM_CONFIG.exe
          fi
          if test ! -x $LLVM_CONFIG; then
@@ -2665,7 +2630,7 @@ if test "x$enable_llvm" = "xyes"; then
                ;;
    esac
 
-   if test "x$target_win32" = "xno"; then
+   if test "x$host_win32" = "xno"; then
 
    # 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'`
@@ -3072,6 +3037,7 @@ if test "x$host" != "x$target"; then
                # in mono-compiler.h
                with_tls=pthread
                target_mach=no
+               target_win32=no
                ;;
    aarch64*-linux-*)
                TARGET=ARM64;
@@ -3651,8 +3617,6 @@ AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
 AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
 AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
 
-AM_CONDITIONAL(INCLUDED_LIBGC, test x$libgc = xincluded)
-
 AC_SUBST(LIBC)
 AC_SUBST(INTL)
 AC_SUBST(SQLITE)
@@ -3867,15 +3831,10 @@ mono/arch/arm/Makefile
 mono/arch/arm64/Makefile
 mono/arch/ia64/Makefile
 mono/arch/mips/Makefile
+mono/sgen/Makefile
 mono/tests/Makefile
 mono/tests/tests-config
 mono/tests/assemblyresolve/Makefile
-mono/tests/cas/Makefile
-mono/tests/cas/assembly/Makefile
-mono/tests/cas/demand/Makefile
-mono/tests/cas/inheritance/Makefile
-mono/tests/cas/linkdemand/Makefile
-mono/tests/cas/threads/Makefile
 mono/tests/gc-descriptors/Makefile
 mono/unit-tests/Makefile
 mono/benchmark/Makefile
@@ -4029,22 +3988,6 @@ fi
 
   fi
 
-  # if we have an olive folder, override the default settings
-  if test -d $olivedir; then
-
-    if test x$cross_compiling = xno && test x$enable_olive_build != xno; then
-
-      test -w $srcdir/$olivedir/build || chmod +w $srcdir/$olivedir/build
-
-      echo "prefix=$prefix" > $srcdir/$olivedir/build/config.make
-      echo "exec_prefix=$exec_prefix" >> $srcdir/$olivedir/build/config.make
-      echo 'mono_libdir=${exec_prefix}/lib' >> $srcdir/$olivedir/build/config.make
-      echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$olivedir/build/config.make
-      echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$olivedir/build/config.make
-      echo "MONO_VERSION = $myver" >> $srcdir/$olivedir/build/config.make
-    fi
-  fi
-
 )
 
 libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}