Revert "Merge branch 'master' of https://github.com/mono/mono"
[mono.git] / configure.in
index 6b9deddfb4bac2260ecb6c3f7fc8378ad95deba2..efa860b17ef53ab73d88ea985b6a65da47082efc 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 #AC_PREREQ([2.62])
 
-AC_INIT(mono, [3.2.7],
+AC_INIT(mono, m4_esyscmd([tr -d '\r\n' <  MONO_VERSION]),
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
 AC_CONFIG_SRCDIR([README.md])
@@ -516,6 +516,9 @@ if test x"$GCC" = xyes; then
                # The runtime code does not respect ANSI C strict aliasing rules
                CFLAGS="$CFLAGS -fno-strict-aliasing"
 
+               # We rely on signed overflow to behave
+               CFLAGS="$CFLAGS -fwrapv"
+
                ORIG_CFLAGS=$CFLAGS
                CFLAGS="$CFLAGS -Wdeclaration-after-statement"
                AC_MSG_CHECKING(for -Wdeclaration-after-statement option to gcc)
@@ -545,7 +548,7 @@ if test x"$GCC" = xyes; then
                if test "x$mono_cv_clang" = "xyes"; then
                   # https://bugzilla.samba.org/show_bug.cgi?id=8118
                   WARN="$WARN -Qunused-arguments"
-                  WARN="$WARN -Wno-unused-function -Wno-tautological-compare"
+                  WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign"
                fi
 else
        # The Sun Forte compiler complains about inline functions that access static variables
@@ -1579,7 +1582,7 @@ if test x$target_win32 = xno; then
        AC_CHECK_HEADERS(pthread.h)
        AC_CHECK_HEADERS(pthread_np.h)
        AC_CHECK_FUNCS(pthread_mutex_timedlock)
-       AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
+       AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_setname_np)
        AC_CHECK_FUNCS(pthread_kill)
        AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
        AC_TRY_COMPILE([ #include <pthread.h>], [
@@ -1860,7 +1863,7 @@ if test x$target_win32 = xno; then
        dnl * back 
        dnl **************************************
        if test "x$havekqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"; then
-               if x$platform_darwin = xno; then
+               if test "x$platform_darwin" = "xno"; then
                        AC_DEFINE(USE_KQUEUE_FOR_THREADPOOL, 1, [Use kqueue for the threadpool])
                fi
        fi
@@ -2433,13 +2436,15 @@ if test "x$enable_llvm" = "xyes"; then
    # from LLVM classes.
    LLVM_CXXFLAGS="`$LLVM_CONFIG --cxxflags` -fno-rtti"
    LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
+   # This might include empty lines
+   LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
    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++"
+   LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_LIBS -lstdc++"
 
    expected_llvm_version="3.4svn-mono-mono/e656cac"
 
@@ -2447,16 +2452,20 @@ if test "x$enable_llvm" = "xyes"; then
    llvm_version=`$LLVM_CONFIG --version`
    major_version=`echo $llvm_version | cut -c 1`
    minor_version=`echo $llvm_version | cut -c 3`
+   llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
    AC_MSG_CHECKING(LLVM version)
    AC_MSG_RESULT($llvm_version)
    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
+         if test "x$llvm_api_version" = "x"; then
+               LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_API_VERSION=0"
+         else
+               LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_API_VERSION=$llvm_api_version"
+         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
@@ -2948,8 +2957,9 @@ case "$host" in
        ;;
     *-*-*linux*)
        AC_PATH_X
+       dlsearch_path=`(libtool --config ; echo eval echo \\$sys_lib_dlsearch_path_spec) | sh`
        AC_MSG_CHECKING(for the soname of libX11.so)
-       for i in $x_libraries /usr/lib /usr/lib64; do
+       for i in $x_libraries $dlsearch_path; do
                for r in 4 5 6; do
                        if test -f $i/libX11.so.$r; then
                                X11=libX11.so.$r
@@ -3529,6 +3539,7 @@ 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
 mono/monograph/Makefile
 mono/io-layer/Makefile