Remove spec file as we don't use it anymore.
[mono.git] / configure.ac
index 7b9f3fabe10508c3e852ce213b10ab8c826d64d3..8e0f7c924b09759374d2d663574fe51d8dc7e4b1 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 #AC_PREREQ([2.62])
 
-AC_INIT(mono, [3.99.0],
+AC_INIT(mono, [4.1.0],
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
 AC_CONFIG_SRCDIR([README.md])
@@ -70,9 +70,6 @@ AC_SUBST(libmono_ldflags)
 reloc_libdir=`basename ${libdir}`
 AC_SUBST(reloc_libdir)
 
-dnl if linker handles the version script
-no_version_script=no
-
 # Set to yes if Unix sockets cannot be created in an anonymous namespace
 need_link_unlink=no
 
@@ -310,7 +307,6 @@ case "$host" in
                need_link_unlink=yes
                AC_DEFINE(PTHREAD_POINTER_ID)
                AC_DEFINE(USE_MACH_SEMA, 1, [...])
-               no_version_script=yes
                libdl=
                libgc_threads=pthreads
                has_dtrace=yes
@@ -432,16 +428,11 @@ AC_SUBST(export_ldflags)
 # Test whenever ld supports -version-script
 AC_PROG_LD
 AC_PROG_LD_GNU
-if test "x$lt_cv_prog_gnu_ld" = "xno"; then
-   no_version_script=yes
-fi
 
 AM_ICONV()
 
-AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
-
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h)
-AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h)
+AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h)
 AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
                   [], [], [#include <stddef.h>
                  #include <sys/socket.h>
@@ -454,6 +445,8 @@ AC_CHECK_HEADERS(sys/user.h, [], [],
 #endif
 ])
 
+AC_CHECK_HEADERS(linux/serial.h)
+
 AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
 if test x$have_zlib = xyes; then
    AC_TRY_COMPILE([#include <zlib.h>], [
@@ -526,26 +519,30 @@ 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)
+
 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'
+
+               # We require C99 with some GNU extensions, e.g. `linux` macro
+               CFLAGS="$CFLAGS -std=gnu99"
+
                # 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)
-               AC_TRY_COMPILE([],[
-                               return 0;
-               ], [
-                  AC_MSG_RESULT(yes)
-               ], [
-                  AC_MSG_RESULT(no)
-                  CFLAGS=$ORIG_CFLAGS
-               ])
+               CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
+               if test x"$disable_visibility_hidden" = xno; then
+                  # Don't export any symbols by default
+                  SHARED_CFLAGS="-fvisibility=hidden"
+                  CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB -fvisibility=hidden"
+                  CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+               fi
 
                ORIG_CFLAGS=$CFLAGS
                # Check for the normal version, since gcc ignores unknown -Wno options
@@ -677,6 +674,7 @@ if test x$werror_flag = xyes; then
        WERROR_CFLAGS="-Werror"
 fi
 AC_SUBST([WERROR_CFLAGS])
+AC_SUBST([SHARED_CFLAGS])
 
 ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
 AC_CONFIG_SUBDIRS(eglib)
@@ -974,6 +972,12 @@ if test x$enable_gsharing = xyes; then
        AC_DEFINE(ENABLE_GSHAREDVT,1,[Gsharing])
 fi
 
+# A synonym
+AC_ARG_ENABLE(gsharedvt, [  --enable-gsharedvt Enable generic valuetype sharing], enable_gsharedvt=$enableval, enable_gsharedvt=no)
+if test x$enable_gsharedvt = xyes; then
+       AC_DEFINE(ENABLE_GSHAREDVT,1,[Gsharedvt])
+fi
+
 AC_ARG_ENABLE(native-types, [  --enable-native-types Enable native types], enable_native_types=$enableval, enable_native_types=no)
 if test x$enable_native_types = xyes; then
        AC_DEFINE(MONO_NATIVE_TYPES,1,[native types])
@@ -1144,6 +1148,12 @@ AC_TRY_COMPILE([
 
 AC_CHECK_HEADERS(nacl/nacl_dyncode.h)
 
+dnl ***********************************
+dnl *** Checks for signals
+dnl ***********************************
+AC_CHECK_HEADERS(signal.h)
+AC_CHECK_FUNCS(sigaction)
+
 if test x$target_win32 = xno; then
 
        dnl hires monotonic clock support
@@ -1704,11 +1714,23 @@ if test x$target_win32 = xno; then
        AC_CHECK_FUNCS(pthread_attr_getstack pthread_attr_getstacksize)
        AC_CHECK_FUNCS(pthread_get_stacksize_np pthread_get_stackaddr_np)
 
-       dnl ***********************************
-       dnl *** Checks for signals
-       dnl ***********************************
-       AC_CHECK_HEADERS(signal.h)
-       AC_CHECK_FUNCS(sigaction)
+       dnl **********************************
+       dnl *** Check for mincore ***
+       dnl **********************************
+       AC_MSG_CHECKING(for mincore)
+               AC_TRY_LINK([
+               #include <stdio.h>
+               #include <sys/types.h>
+               #include <sys/mman.h>
+       ], [
+               mincore(NULL, 0, NULL);
+       ], [
+               # Yes, we have it...
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MINCORE, 1, [Have mincore])
+       ], [
+               AC_MSG_RESULT(no)
+       ])
 
        dnl ***********************************
        dnl *** Checks for working __thread ***
@@ -2496,6 +2518,12 @@ fi
 
 AC_ARG_ENABLE(bcl-opt, [  --disable-bcl-opt    BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
 
+AC_ARG_ENABLE(perf-events, [  --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
+if test "x$test_perf_events" == "xyes"; then
+       AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
+       AC_SUBST(ENABLE_PERF_EVENTS)
+fi
+
 AC_MSG_CHECKING([if big-arrays are to be enabled])
 AC_ARG_ENABLE(big-arrays,  [  --enable-big-arrays      Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no)
 if test "x$enable_big_arrays" = "xyes" ; then
@@ -2688,7 +2716,9 @@ if test "x$enable_llvm" = "xyes"; then
          -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore \
          -lLLVMSupport -lstdc++"
        LLVM_LIBS="$LLVM_LIBS $LLVM_SYSTEM_LIBS"
-       llvm_api_version=1
+
+       llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
+       llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
    fi  
 
    if test "x$llvm_api_version" = "x"; then
@@ -3019,6 +3049,18 @@ if test "x$host" != "x$target"; then
                with_tls=pthread
                target_mach=no
                ;;
+   x86_64*-linux-*)
+               TARGET=AMD64;
+               arch_target=amd64;
+               AC_DEFINE(TARGET_AMD64, 1, [...])
+               AC_DEFINE(TARGET_ANDROID, 1, [...])
+               CPPFLAGS="$CPPFLAGS"
+               sgen_supported=true
+               # Can't use tls, since it depends on the runtime detection of tls offsets
+               # in mono-compiler.h
+               with_tls=pthread
+               target_mach=no
+               ;;
    aarch64*-linux-*)
                TARGET=ARM64;
                arch_target=arm64;
@@ -3513,6 +3555,12 @@ AC_ARG_WITH(lazy_gc_thread_creation, [  --with-lazy-gc-thread-creation=yes|no
        fi
 ], [with_lazy_gc_thread_creation=no])
 
+AC_ARG_WITH(cooperative_gc, [  --with-cooperative-gc=yes|no      Enable cooperative stop-the-world garbage collection (sgen only) (defaults to no)],[
+       if test x$with_cooperative_gc != xno ; then
+               AC_DEFINE(USE_COOP_GC,1,[Enable cooperative stop-the-world garbage collection.])
+       fi
+], [with_cooperative_gc=no])
+
 AC_CHECK_HEADER([malloc.h], 
                [AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1], 
                        [Define to 1 if you have /usr/include/malloc.h.])],,)
@@ -3785,10 +3833,10 @@ AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/web.config],
 ],[LN_S='$LN_S'])
 
 AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/echo "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
+AC_CONFIG_COMMANDS([nolock-libtool], [sed -e 's/lock_old_archive_extraction=yes/lock_old_archive_extraction=no/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
 
 AC_OUTPUT([
 Makefile
-mono-core.spec
 mono-uninstalled.pc
 scripts/mono-find-provides
 scripts/mono-find-requires