Merge branch 'master' into msbuilddll2
[mono.git] / configure.in
index 15d3387657dbf394d1569241f41c7543704f5102..d62e6a3f6beded6eb70ca239e8890952a0ecb759 100644 (file)
@@ -1,10 +1,10 @@
 # Process this file with autoconf to produce a configure script.
 #AC_PREREQ([2.62])
 
-AC_INIT(mono, [3.1.1],
+AC_INIT(mono, [3.2.7],
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
-AC_CONFIG_SRCDIR([README])
+AC_CONFIG_SRCDIR([README.md])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_SYSTEM
 AC_CANONICAL_HOST
@@ -13,7 +13,7 @@ AC_CANONICAL_HOST
 # The extra brackets are to foil regex-based scans.
 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
 
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign])
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign subdir-objects])
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE
 
@@ -24,6 +24,12 @@ AC_PROG_LN_S
 
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+case $host_os in
+*cygwin* )
+                echo "Run configure using ./configure --host=i686-pc-mingw32"
+                exit 1
+esac
+
 # In case of cygwin, override LN_S, irrespective of what it determines.
 # The build uses cygwin, but the actual runtime doesn't.
 case $host_os in
@@ -105,22 +111,6 @@ case "$host" in
                        if test "x$host" == "x$build" -a "x$host" == "x$target"; then
                                AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
                        fi
-                       #
-                       # gcc-3/g++-3 are from the gcc-core/gcc-g++ cygwin packages.
-                       # Other gcc packages will not work:
-                       # - the gcc-4 packages no longer support -mno-cygwin
-                       # - the mingw-gcc packages produce executables which depends on a libgcc<...>
-                       # dll, which means we would have to distribute that file too.
-                       #
-                       if test "x$CC" != "x"; then
-                               AC_ERROR(Don't set CC. mono can only be compiled with gcc-3 from the 'gcc-core' package)
-                       fi
-                       CC="gcc-3.exe -mno-cygwin -g"
-                       CXX="g++-3.exe -mno-cygwin -g"
-                       # So libgc configure gets -mno-cygwin
-                       export CC
-                       export CXX
-                       CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB -mno-cygwin"
                else
                        target_win32=yes
                        AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW])
@@ -130,8 +120,8 @@ case "$host" in
                # 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 -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32"
-               libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
-               libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
+               libmono_cflags="-mms-bitfields -mwindows"
+               libmono_ldflags="-mms-bitfields -mwindows"
                libdl=
                libgc_threads=win32
                gc_default=included
@@ -325,10 +315,8 @@ case "$host" in
                                CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
                                CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS"
                                CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
-                               extra_runtime_ldflags="-stack_size,0x800000"
                                ;;
                        x*64-*-darwin*)
-                               extra_runtime_ldflags="-stack_size,0x800000"
                                ;;
                        arm*-darwin*)
                                has_dtrace=no
@@ -373,6 +361,7 @@ AC_PROG_CXX
 AM_PROG_AS
 AC_PROG_INSTALL
 AC_PROG_AWK
+AM_PROG_CC_C_O
 dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
 : ${CCAS='$(CC)'}
 # Set ASFLAGS if not already set.
@@ -491,6 +480,12 @@ AC_TRY_LINK([#include <math.h>], [
        # We'll have to use signals
        AC_MSG_RESULT(no)
 ])
+# mingw
+AC_CHECK_FUNCS(_finite, , AC_MSG_CHECKING(for _finite in math.h)
+       AC_TRY_LINK([#include <math.h>], 
+       [ _finite(0.0); ], 
+       AC_DEFINE(HAVE__FINITE, 1, [Have _finite in -lm]) AC_MSG_RESULT(yes),
+       AC_MSG_RESULT(no)))
 
 # for Linux statfs support
 AC_CHECK_HEADERS(linux/magic.h)
@@ -934,7 +929,19 @@ fi
 AC_ARG_ENABLE(executables, [  --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
 AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
 
-AC_ARG_ENABLE(extension-module, [  --enable-extension-module enables usage of the extension module], has_extension_module=$enableval, has_extension_module=no)
+has_extension_module=no
+AC_ARG_ENABLE(extension-module, [  --enable-extension-module=LIST enable the core-extensions from LIST],
+[
+       for extension in `echo "$enable_extension_module" | sed -e "s/,/ /g"`; do
+               if test x$extension = xdefault ; then
+                       has_extension_module=yes;
+               fi
+       done
+       if test x$enable_extension_module = xyes; then
+               has_extension_module=yes;
+       fi
+], [])
+
 AM_CONDITIONAL([HAS_EXTENSION_MODULE], [test x$has_extension_module != xno])
 
 if test x$has_extension_module != xno ; then
@@ -1037,6 +1044,11 @@ case "x$gc" in
 
                BOEHM_DEFINES="-DHAVE_BOEHM_GC -DHAVE_GC_H -DUSE_INCLUDED_LIBGC -DHAVE_GC_GCJ_MALLOC -DHAVE_GC_ENABLE"
 
+               if test x$target_win32 = xyes; then
+                       BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
+                       CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DGC_BUILD -DGC_NOT_DLL"
+               fi
+
                gc_msg="bundled Boehm GC with typed GC"
                if test x$enable_parallel_mark = xyes; then
                        AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
@@ -1150,6 +1162,8 @@ if test x$target_win32 = xno; then
 
        AC_CHECK_HEADERS(execinfo.h)
 
+       AC_CHECK_HEADERS(sys/auxv.h)
+
        AC_CHECK_FUNCS(getgrgid_r)
        AC_CHECK_FUNCS(getgrnam_r)
        AC_CHECK_FUNCS(getpwnam_r)
@@ -1581,8 +1595,14 @@ if test x$target_win32 = xno; then
        AC_MSG_CHECKING(for working __thread)
        if test "x$with_tls" != "x__thread"; then
                AC_MSG_RESULT(disabled)
+       elif test "x$cross_compiling" = "xyes"; then
+               AC_MSG_RESULT(cross compiling, assuming yes)
        else
                AC_TRY_RUN([
+                       #if defined(__APPLE__) && defined(__clang__)
+                       #error "__thread does not currently work with clang on Mac OS X"
+                       #endif
+                       
                        #include <pthread.h>
                        __thread int i;
                        static int res1, res2;
@@ -1624,6 +1644,8 @@ if test x$target_win32 = xno; then
        AC_MSG_CHECKING(for working sigaltstack)
        if test "x$with_sigaltstack" != "xyes"; then
                AC_MSG_RESULT(disabled)
+       elif test "x$cross_compiling" = "xyes"; then
+               AC_MSG_RESULT(cross compiling, assuming yes)
        else
                AC_TRY_RUN([
                        #include <stdio.h>
@@ -1814,9 +1836,9 @@ if test x$target_win32 = xno; then
        fi
 
        havekqueue=no
-        AC_CHECK_FUNCS(kqueue, , AC_MSG_CHECKING(for kqueue in sys/event.h)
-                AC_TRY_LINK([#include <sys/event.h>], 
-                [ kqueue(); ],[havekqueue=yes],[]))
+
+       AC_CHECK_HEADERS(sys/event.h)
+       AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
 
        dnl **************************************
        dnl * Darwin has a race that prevents us from using reliably:
@@ -1825,7 +1847,7 @@ if test x$target_win32 = xno; then
        dnl * and very few folks run Mono on large web servers on OSX, falling
        dnl * back 
        dnl **************************************
-       if test x$havekqueue = xyes; then
+       if test "x$havekqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"; then
                if x$platform_darwin = xno; then
                        AC_DEFINE(USE_KQUEUE_FOR_THREADPOOL, 1, [Use kqueue for the threadpool])
                fi
@@ -1984,6 +2006,7 @@ if test x$target_win32 = xno; then
        AC_CHECK_FUNCS(futimens utimensat)
        AC_CHECK_FUNCS(fstatat mknodat readlinkat)
        AC_CHECK_FUNCS(readv writev preadv pwritev)
+       AC_CHECK_FUNCS(setpgid)
        AC_CHECK_SIZEOF(size_t)
        AC_CHECK_TYPES([blksize_t], [AC_DEFINE(HAVE_BLKSIZE_T)], , 
                [#include <sys/types.h>
@@ -2119,6 +2142,13 @@ else
                ])
        ])
        AC_CHECK_FUNCS(GetProcessId)
+       AC_CHECK_DECLS(InterlockedExchange64, [], [], [[#include <windows.h>]])
+       AC_CHECK_DECLS(InterlockedCompareExchange64, [], [], [[#include <windows.h>]])
+       AC_CHECK_DECLS(InterlockedDecrement64, [], [], [[#include <windows.h>]])
+       AC_CHECK_DECLS(InterlockedIncrement64, [], [], [[#include <windows.h>]])
+       AC_CHECK_DECLS(InterlockedAdd, [], [], [[#include <windows.h>]])
+       AC_CHECK_DECLS(InterlockedAdd64, [], [], [[#include <windows.h>]])
+       AC_CHECK_DECLS(__readfsdword, [], [], [[#include <windows.h>]])
 fi
 
 dnl socklen_t check
@@ -2361,11 +2391,21 @@ dnl **************
 
 AC_ARG_ENABLE(llvm,[  --enable-llvm    Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=no)
 AC_ARG_ENABLE(loadedllvm,[  --enable-loadedllvm        Load the LLVM back-end dynamically], enable_llvm=$enableval && enable_loadedllvm=$enableval, enable_loadedllvm=no)
+AC_ARG_ENABLE(llvm-version-check,[  --enable-llvm-version-check Check that the LLVM matches the version expected by mono], enable_llvm_version_check=$enableval, enable_llvm_version_check=no)
+
+AC_ARG_WITH(llvm, [  --with-llvm=<llvm prefix>    Enable the LLVM back-end], enable_llvm=yes,)
 
 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.])
+   if test "x$with_llvm" != "x"; then
+         LLVM_CONFIG=$with_llvm/bin/llvm-config
+         if test ! -x $LLVM_CONFIG; then
+                AC_MSG_ERROR([LLVM executable $LLVM_CONFIG not found.])
+      fi
+   else
+      AC_PATH_PROG(LLVM_CONFIG, llvm-config, no)
+      if test "x$LLVM_CONFIG" = "xno"; then
+            AC_MSG_ERROR([llvm-config not found.])
+      fi
    fi
 
    llvm_codegen="x86codegen"
@@ -2375,16 +2415,22 @@ if test "x$enable_llvm" = "xyes"; then
                ;;
    esac
 
-
    # 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 mcjit $llvm_codegen`
+   if test "x$host" != "x$target"; then
+      # No need for jit libs
+      LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter`
+   else
+      LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
+   fi
    LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
 
+   expected_llvm_version="3.4svn-mono-mono/e656cac"
+
    # Should be something like '2.6' or '2.7svn'
    llvm_version=`$LLVM_CONFIG --version`
    major_version=`echo $llvm_version | cut -c 1`
@@ -2394,6 +2440,11 @@ if test "x$enable_llvm" = "xyes"; then
    if echo $llvm_version | grep -q 'mono'; then
          AC_DEFINE(LLVM_MONO_BRANCH, 1, [Whenever we are using the mono branch of LLVM])
          LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MONO_BRANCH"       
+         if test "x$enable_llvm_version_check" == "xyes"; then
+                if test "$llvm_version" != "$expected_llvm_version"; then
+                       AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
+                fi
+         fi
    else
          AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
    fi
@@ -2436,10 +2487,6 @@ jit_wanted=true
 interp_wanted=false
 sgen_supported=false
 case "$host" in
-#      mips-sgi-irix5.* | mips-sgi-irix6.*)
-#              TARGET=MIPS;
-#              ACCESS_UNALIGNED="no"
-#              ;;
        mips*)
                TARGET=MIPS;
                arch_target=mips;
@@ -2486,7 +2533,7 @@ case "$host" in
                        have_visibility_hidden=no
                        sgen_supported=true
                        ;;
-                 cygwin*)
+                 mingw*|cygwin*)
                        sgen_supported=true
                        have_visibility_hidden=no                 
                        ;;
@@ -2725,7 +2772,6 @@ if test "x$host" != "x$target"; then
        esac
 fi
 
-# FIXME: Define the others as well
 case "$TARGET" in
 X86)
        AC_DEFINE(TARGET_X86, 1, [...])
@@ -2760,6 +2806,15 @@ SPARC64)
        ;;
 esac
 
+dnl Use GCC atomic ops if they work on the target.
+if test x$GCC = "xyes"; then
+       case $TARGET in
+       X86 | AMD64 | ARM | POWERPC | POWERPC64 | MIPS | S390X | SPARC | SPARC64)
+               AC_DEFINE(USE_GCC_ATOMIC_OPS, 1, [...])
+               ;;
+       esac
+fi
+
 if test "x$target_mach" = "xyes"; then
    if test "x$TARGET" = "xARM"; then
          AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
@@ -2920,39 +2975,6 @@ if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
        fi
 fi
 
-mono_debugger_supported=no
-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" = "xS390x"; 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
-
-# disable the debugger entirely when building with moonlight
-if test "x$with_moonlight" != "xno"; then
-       mono_debugger_supported=no
-fi
-
-# mdb support for sgen is broken, disable it until further notice.
-mono_debugger_supported=no
-
-AC_MSG_CHECKING(if the Mono Debugger is supported on this platform)
-if test "x$mono_debugger_supported" = "xyes"; then
-       BOEHM_DEFINES="$BOEHM_DEFINES -DMONO_DEBUGGER_SUPPORTED"
-       CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DMONO_DEBUGGER_SUPPORTED"
-fi
-AM_CONDITIONAL(MONO_DEBUGGER_SUPPORTED, test x$mono_debugger_supported = xyes)
-AC_MSG_RESULT($mono_debugger_supported)
-
 AC_ARG_ENABLE(icall-symbol-map,[  --enable-icall-symbol-map Generate tables which map icall functions to their C symbols], icall_symbol_map=$enableval, icall_symbol_map=no)
 if test "x$icall_symbol_map" = "xyes"; then
    AC_DEFINE(ENABLE_ICALL_SYMBOL_MAP, 1, [Icall symbol map enabled])
@@ -3056,6 +3078,8 @@ if test ${TARGET} = ARM; then
                return 0;
        ], [
                arm_v5=yes
+
+               arm_ver=ARMv5
        ], [])
 
        AC_TRY_COMPILE([], [
@@ -3066,10 +3090,12 @@ if test ${TARGET} = ARM; then
        ], [
                arm_v5=yes
                arm_v6=yes
+
+               arm_ver=ARMv6
        ], [])
 
        AC_TRY_COMPILE([], [
-               #if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__)
+               #if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
                #error Not on ARM v7.
                #endif
                return 0;
@@ -3077,8 +3103,12 @@ if test ${TARGET} = ARM; then
                arm_v5=yes
                arm_v6=yes
                arm_v7=yes
+
+               arm_ver=ARMv7
        ], [])
 
+       AC_MSG_RESULT($arm_ver)
+
        if test x$arm_v5 = xyes; then
                AC_DEFINE(HAVE_ARMV5, 1, [ARM v5])
                CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV5=1"
@@ -3172,20 +3202,6 @@ if test x$with_profile4 != xyes; then
        DISABLE_MCS_DOCS=yes
 fi
 
-MOONLIGHT_DEFINES=
-AC_ARG_WITH(moonlight, [  --with-moonlight=yes|no|only         If you want to build Mono for Moonlight (defaults to no)],[
-       if test x$with_moonlight != xno; then
-        MOONLIGHT_DEFINES="-DMOONLIGHT -DDISABLE_ASSEMBLY_REMAPPING "
-       fi
-], [with_moonlight=no])
-AC_SUBST(MOONLIGHT_DEFINES)
-
-AC_ARG_WITH(moon_gc, [  --with-moon-gc=boehm,sgen              Select the gc to use with Moonlight (defaults to boehm)],[
-       if test "x$with_moon_gc" != "xsgen"; then
-               with_moon_gc=boehm
-       fi
-], [with_moon_gc=boehm])
-
 AC_ARG_WITH(lazy_gc_thread_creation, [  --with-lazy-gc-thread-creation=yes|no      Enable lazy runtime thread creation, embedding host must do it explicitly (defaults to no)],[
        if test x$with_lazy_gc_thread_creation != xno ; then
                AC_DEFINE(LAZY_GC_THREAD_CREATION,1,[Enable lazy gc thread creation by the embedding host.])
@@ -3209,7 +3225,11 @@ fi
 if test "x$enable_shared" = "xno" -a "x$enable_executables" = "xyes"; then
    LIBMONO_LA=libmini-static.la
 else
-   LIBMONO_LA=libmonosgen-$API_VER.la
+   if test x$buildsgen = xyes; then
+      LIBMONO_LA=libmonosgen-$API_VER.la
+   else
+      LIBMONO_LA=libmonoboehm-$API_VER.la
+   fi
 fi
 AC_SUBST(LIBMONO_LA)
 
@@ -3241,12 +3261,6 @@ AC_SUBST(OPROFILE_LIBS)
 
 libmono_ldflags="$libmono_ldflags $LIBS"
 
-AM_CONDITIONAL(MOONLIGHT, [test "x$with_moonlight" != "xno"])
-
-AM_CONDITIONAL(ONLY_MOONLIGHT, [test "x$with_moonlight" = "xonly"])
-AM_CONDITIONAL(MOONLIGHT_BOEHM, [test "x$with_moon_gc" = "xboehm"])
-AM_CONDITIONAL(MOONLIGHT_SGEN, [test "x$with_moon_gc" = "xsgen"])
-
 AM_CONDITIONAL(INSTALL_2_0, [test "x$with_profile2" = xyes])
 AM_CONDITIONAL(INSTALL_4_0, [test "x$with_profile4" = xyes])
 AM_CONDITIONAL(INSTALL_4_5, [test "x$with_profile4_5" = xyes])
@@ -3266,7 +3280,7 @@ AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
 AM_CONDITIONAL(POWERPC64, test x$TARGET = xPOWERPC64)
 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
-AM_CONDITIONAL(S390X, test x$TARGET = xS390x)
+AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
 AM_CONDITIONAL(HOST_X86, test x$HOST = xX86)
 AM_CONDITIONAL(HOST_AMD64, test x$HOST = xAMD64)
 AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
@@ -3380,7 +3394,35 @@ AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
     $ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
     cd runtime/etc/mono/2.0/Browsers
     rm -f Compat.browser
-    $LN_S $reldir/data/net_2_0/Browsers/Compat.browser Compat.browser
+    $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
+    cd $depth
+],[LN_S='$LN_S'])
+
+AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/Browsers/Compat.browser],
+[   depth=../../../../..
+    case $srcdir in
+    [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
+    .) reldir=$depth ;;
+    *) reldir=$depth/$srcdir ;;
+    esac
+    $ac_aux_dir/install-sh -d runtime/etc/mono/4.0/Browsers/
+    cd runtime/etc/mono/4.0/Browsers
+    rm -f Compat.browser
+    $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
+    cd $depth
+],[LN_S='$LN_S'])
+
+AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/Browsers/Compat.browser],
+[   depth=../../../../..
+    case $srcdir in
+    [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
+    .) reldir=$depth ;;
+    *) reldir=$depth/$srcdir ;;
+    esac
+    $ac_aux_dir/install-sh -d runtime/etc/mono/4.5/Browsers/
+    cd runtime/etc/mono/4.5/Browsers
+    rm -f Compat.browser
+    $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
     cd $depth
 ],[LN_S='$LN_S'])
 
@@ -3488,6 +3530,8 @@ data/net_2_0/Makefile
 data/net_4_0/Makefile
 data/net_4_5/Makefile
 data/net_2_0/Browsers/Makefile
+data/net_4_0/Browsers/Makefile
+data/net_4_5/Browsers/Makefile
 data/mint.pc
 data/mono-2.pc
 data/monosgen-2.pc
@@ -3602,10 +3646,6 @@ fi
       echo "DISABLE_MCS_DOCS = yes" >> $mcs_topdir/build/config.make
     fi
 
-    if test x$with_moonlight != xno; then
-      echo "MOONLIGHT = 1" >> $srcdir/$mcsdir/build/config.make
-    fi
-
     if test x$has_extension_module != xno; then
         echo "EXTENSION_MODULE = 1" >> $srcdir/$mcsdir/build/config.make
     fi