Merge pull request #1056 from ranma42/vc-compat-C90
[mono.git] / configure.in
index 65b27c5a2108ff43dac8ec48d35fa91f4d2150c8..32c3efee89e43209a25f5489f241c61cdd1080f1 100644 (file)
@@ -237,6 +237,12 @@ case "$host" in
                        # available during cross-compilation
                        mono_cv_uscore=no
                 fi
+               case "$host" in
+               aarch64-*)
+                       support_boehm=no
+                       with_gc=sgen
+                       ;;
+               esac
                ;;
        *-*-nacl*)
                host_win32=no
@@ -548,7 +554,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 -Wno-parentheses-equality"
+                  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
@@ -2452,16 +2458,22 @@ 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_CFLAGS="$LLVM_CFLAGS -DLLVM_API_VERSION=0"
+               LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_API_VERSION=0"
+         else
+               LLVM_CFLAGS="$LLVM_CFLAGS -DLLVM_API_VERSION=$llvm_api_version"
+               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
@@ -2497,12 +2509,14 @@ INTL="libc.so.6"
 SQLITE="libsqlite.so.0"
 SQLITE3="libsqlite3.so.0"
 X11="libX11.so"
+XINERAMA="libXinerama.so"
 
 sizeof_register="SIZEOF_VOID_P"
 
 jit_wanted=true
 interp_wanted=false
 sgen_supported=false
+boehm_supported=true
 case "$host" in
        mips*)
                TARGET=MIPS;
@@ -2679,6 +2693,14 @@ case "$host" in
 #              sgen_supported=true
 #              AOT_SUPPORTED="no"
 #              ;;
+       aarch64-*)
+               # https://lkml.org/lkml/2012/7/15/133
+               TARGET=ARM64
+               arch_target=arm64
+               JIT_SUPPORTED=yes
+               sgen_supported=true
+               boehm_supported=false
+               ;;
        s390x-*-linux*)
                TARGET=S390X;
                arch_target=s390x;
@@ -2765,6 +2787,7 @@ if test "x$host" != "x$target"; then
                TARGET=ARM;
                arch_target=arm;
                AC_DEFINE(TARGET_ARM, 1, [...])
+               AC_DEFINE(TARGET_ANDROID, 1, [...])
                ACCESS_UNALIGNED="no"
                JIT_SUPPORTED=yes
                CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
@@ -2779,11 +2802,15 @@ if test "x$host" != "x$target"; then
                        CPPFLAGS="$CPPFLAGS"
                        ;;
                armv5-*-linux-androideabi*)
-                       AC_DEFINE(TARGET_ANDROID, 1, [...])
                        CPPFLAGS="$CPPFLAGS"
                        ;;
                esac
                ;;
+       aarch64-*)
+               TARGET=ARM64
+               JIT_SUPPORTED=yes
+               jit_wanted=true
+               ;;
        *)
                AC_MSG_ERROR([Cross compiling is not supported for target $target])
        esac
@@ -2799,6 +2826,9 @@ AMD64)
 ARM)
        AC_DEFINE(TARGET_ARM, 1, [...])
        ;;
+ARM64)
+       AC_DEFINE(TARGET_ARM64, 1, [...])
+       ;;
 POWERPC)
        AC_DEFINE(TARGET_POWERPC, 1, [...])
        ;;
@@ -2826,14 +2856,14 @@ 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)
+       X86 | AMD64 | ARM | ARM64 | 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
+   if test "x$TARGET" = "xARM" -o "x$TARGET" = "xARM64"; then
          AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
          CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
          CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
@@ -2968,6 +2998,18 @@ case "$host" in
                AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? Assuming libX11.so.6...]);
                X11=libX11.so.6
        fi
+       AC_MSG_CHECKING(for the soname of libXinerama.so)
+       for i in $x_libraries $dlsearch_path; do
+               for r in 1 2 3; do
+                       if test -f $i/libXinerama.so.$r; then
+                               XINERAMA=libXinerama.so.$r
+                               AC_MSG_RESULT($XINERAMA)
+                       fi
+               done
+       done
+       if test "x$XINERAMA" = "xlibXinerama.so"; then
+               AC_MSG_WARN([Could not find Xinerama development libs. Support for multiple monitors might not work...]);
+       fi
        ;;
 esac
 
@@ -3300,10 +3342,12 @@ 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(ARM64, test x$TARGET = xARM64)
 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)
+AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
 AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
 
 AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
@@ -3315,6 +3359,7 @@ AC_SUBST(INTL)
 AC_SUBST(SQLITE)
 AC_SUBST(SQLITE3)
 AC_SUBST(X11)
+AC_SUBST(XINERAMA)
 AC_DEFINE_UNQUOTED(ARCHITECTURE,"$arch_target",[The architecture this is running on])
 AC_SUBST(arch_target)
 AC_SUBST(CFLAGS)
@@ -3522,6 +3567,7 @@ mono/arch/ppc/Makefile
 mono/arch/sparc/Makefile
 mono/arch/s390x/Makefile
 mono/arch/arm/Makefile
+mono/arch/arm64/Makefile
 mono/arch/ia64/Makefile
 mono/arch/mips/Makefile
 mono/interpreter/Makefile
@@ -3562,7 +3608,6 @@ 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