X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=configure.in;h=dd09f8fa3c776e0ca0051bd2af4359e86da78d31;hb=b45701b7997f72dd72d0acd3f3ecf535f1022152;hp=1bdeea1041aece1ed758b1a4bc5e4d53ac8a7961;hpb=9e37326b69b8e8fdec66a9c517106bf867d3a622;p=mono.git diff --git a/configure.in b/configure.in index 1bdeea1041a..dd09f8fa3c7 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,10 @@ # Process this file with autoconf to produce a configure script. #AC_PREREQ([2.62]) -AC_INIT(mono, [3.0.2], +AC_INIT(mono, [3.4.1], [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,8 +13,8 @@ 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_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign subdir-objects]) +AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE API_VER=2.0 @@ -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 @@ -72,6 +78,9 @@ no_version_script=no # Set to yes if Unix sockets cannot be created in an anonymous namespace need_link_unlink=no +#Set to extra linker flags to be passed to the runtime binaries (mono /mono-sgen) +extra_runtime_ldflags="" + # Thread configuration inspired by sleepycat's db AC_MSG_CHECKING([host platform characteristics]) libgc_threads=no @@ -102,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]) @@ -127,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 @@ -160,10 +153,10 @@ case "$host" in libmono_cflags="$PTHREAD_CFLAGS" fi if test "x$PTHREAD_LIBS" = "x"; then - LDFLAGS="$LDFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread -L/usr/local/lib" libmono_ldflags="-pthread" else - LDFLAGS="$LDFLAGS $PTHREAD_LIBS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS -L/usr/local/lib" libmono_ldflags="$PTHREAD_LIBS" fi CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD" @@ -171,13 +164,8 @@ case "$host" in AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer]) libdl= libgc_threads=pthreads - # This doesn't seem to work as of 7.0 on amd64 - with_sigaltstack=no -# TLS is only partially implemented on -CURRENT (compiler support -# but NOT library support) -# - with_tls=pthread use_sigposix=yes + has_dtrace=yes ;; *-*-*openbsd*) host_win32=no @@ -227,6 +215,9 @@ case "$host" in CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR" CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR" + # The configure check can't detect this + AC_DEFINE(HAVE_LARGE_FILE_SUPPORT, 1, [Have large file support]) + # to bypass the underscore linker check, can't work when cross-compiling mono_cv_uscore=yes mono_cv_clang=no @@ -241,6 +232,11 @@ case "$host" in libdl="-ldl" libgc_threads=pthreads use_sigposix=yes + if test "x$cross_compiling" != "xno"; then + # to bypass the underscore linker check, not + # available during cross-compilation + mono_cv_uscore=no + fi ;; *-*-nacl*) host_win32=no @@ -313,20 +309,20 @@ case "$host" in dnl Snow Leopard and newer config.guess reports as this i*86-*-darwin*) BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS" + BROKEN_DARWIN_CPPFLAGS="-D_XOPEN_SOURCE" + CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_CPPFLAGS" CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS" CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS" CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS" - CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS" + CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_CPPFLAGS" CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS" - CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS" + CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS" CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS" ;; + x*64-*-darwin*) + ;; arm*-darwin*) has_dtrace=no - - # Disable the clang check if we're cross compiling - mono_cv_clang=no ;; esac ;; @@ -353,6 +349,7 @@ 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 +AC_SUBST(extra_runtime_ldflags) AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes) AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes) AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux) @@ -365,9 +362,9 @@ AC_PROG_CC AC_CHECK_TOOL(CXX, g++, g++) AC_PROG_CXX AM_PROG_AS -AM_PROG_CC_STDC 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. @@ -486,6 +483,12 @@ AC_TRY_LINK([#include ], [ # 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 ], + [ _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) @@ -493,12 +496,29 @@ AC_CHECK_HEADERS(linux/magic.h) # not 64 bit clean in cross-compile AC_CHECK_SIZEOF(void *, 4) +AC_CACHE_CHECK([for clang], + mono_cv_clang,[ + AC_TRY_COMPILE([], [ + #ifdef __clang__ + #else + #error "FAILED" + #endif + return 0; + ], + [mono_cv_clang=yes], + [mono_cv_clang=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' # 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) @@ -513,7 +533,7 @@ if test x"$GCC" = xyes; then ORIG_CFLAGS=$CFLAGS # Check for the normal version, since gcc ignores unknown -Wno options - CFLAGS="$CFLAGS -Wunused-but-set-variable" + CFLAGS="$CFLAGS -Wunused-but-set-variable -Werror" AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc) AC_TRY_COMPILE([],[ return 0; @@ -524,6 +544,12 @@ if test x"$GCC" = xyes; then AC_MSG_RESULT(no) CFLAGS=$ORIG_CFLAGS ]) + + 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 -Wno-self-assign" + fi else # The Sun Forte compiler complains about inline functions that access static variables # so disable all inlining. @@ -536,22 +562,6 @@ fi CFLAGS="$CFLAGS -g $WARN" CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -g" -AC_CACHE_CHECK([for clang], - mono_cv_clang,[ - AC_TRY_RUN([ - int main () { - #ifdef __clang__ - return 0; - #else - return 1; - #endif - } - ], - [mono_cv_clang=yes], - [mono_cv_clang=no], - []) -]) - # Where's the 'mcs' source tree? if test -d $srcdir/mcs; then mcsdir=mcs @@ -565,6 +575,8 @@ AC_ARG_WITH(mcs-path, [ --with-mcs-path=/path/to/mcs Specify an alternate fi ) +AC_ARG_WITH(jumptables, [ --with-jumptables=yes,no enable/disable support for jumptables (ARM-only for now) (defaults to no)],[],[with_jumptables=no]) + # # A sanity check to catch cases where the package was unpacked # with an ancient tar program (Solaris) @@ -744,9 +756,9 @@ AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compi DISABLED_FEATURES=none AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems. - LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, - reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, - sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.], + LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier, + reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting, + security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.], [ for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do eval "mono_feature_disable_$feature='yes'" @@ -880,6 +892,21 @@ if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then AC_MSG_NOTICE([Disabled Shared perfcounters.]) fi +if test "x$mono_feature_disable_appdomains" = "xyes"; then + AC_DEFINE(DISABLE_APPDOMAINS, 1, [Disable support for multiple appdomains.]) + AC_MSG_NOTICE([Disabled support for multiple appdomains.]) +fi + +if test "x$mono_feature_disable_remoting" = "xyes"; then + AC_DEFINE(DISABLE_REMOTING, 1, [Disable remoting support (This disables type proxies and make com non-functional)]) + AC_MSG_NOTICE([Disabled remoting]) +fi + +if test "x$mono_feature_disable_security" = "xyes"; then + AC_DEFINE(DISABLE_SECURITY, 1, [Disable CAS/CoreCLR security]) + AC_MSG_NOTICE([Disabled CAS/CoreCLR security manager (used e.g. for Moonlight)]) +fi + if test "x$mono_feature_disable_sgen_remset" = "xyes"; then AC_DEFINE(DISABLE_SGEN_REMSET, 1, [Disable wbarrier=remset support in SGEN.]) AC_MSG_NOTICE([Disabled wbarrier=remset support in SGEN.]) @@ -908,6 +935,36 @@ 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) +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 + AC_DEFINE([ENABLE_EXTENSION_MODULE], 1, [Extension module enabled]) + AC_MSG_NOTICE([Enabling mono extension module.]) +fi + +AC_ARG_ENABLE(gsharing, [ --enable-gsharing Enable gsharing], enable_gsharing=$enableval, enable_gsharing=no) +if test x$enable_gsharing = xyes; then + AC_DEFINE(ENABLE_GSHAREDVT,1,[Gsharing]) +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]) +fi + AC_MSG_CHECKING(for visibility __attribute__) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ @@ -1002,6 +1059,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]) @@ -1058,6 +1120,8 @@ AC_TRY_COMPILE([ AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays]) ]) +AC_CHECK_HEADERS(nacl/nacl_dyncode.h) + if test x$target_win32 = xno; then dnl hires monotonic clock support @@ -1113,6 +1177,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) @@ -1204,6 +1270,14 @@ if test x$target_win32 = xno; then dnl ***************************** AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") + case "$host" in + *-*-*freebsd*) + dnl ***************************** + dnl *** Checks for libinotify *** + dnl ***************************** + AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify") + esac + dnl ******************************* dnl *** Checks for MSG_NOSIGNAL *** dnl ******************************* @@ -1219,6 +1293,51 @@ if test x$target_win32 = xno; then AC_MSG_RESULT(no) ]) + dnl ***************************** + dnl *** Checks for IPPROTO_IP *** + dnl ***************************** + AC_MSG_CHECKING(for IPPROTO_IP) + AC_TRY_COMPILE([#include ], [ + int level = IPPROTO_IP; + ], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IPPROTO_IP, 1, [Have IPPROTO_IP]) + ], [ + # We'll have to use getprotobyname + AC_MSG_RESULT(no) + ]) + + dnl ******************************* + dnl *** Checks for IPPROTO_IPV6 *** + dnl ******************************* + AC_MSG_CHECKING(for IPPROTO_IPV6) + AC_TRY_COMPILE([#include ], [ + int level = IPPROTO_IPV6; + ], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IPPROTO_IPV6, 1, [Have IPPROTO_IPV6]) + ], [ + # We'll have to use getprotobyname + AC_MSG_RESULT(no) + ]) + + dnl ****************************** + dnl *** Checks for IPPROTO_TCP *** + dnl ****************************** + AC_MSG_CHECKING(for IPPROTO_TCP) + AC_TRY_COMPILE([#include ], [ + int level = IPPROTO_TCP; + ], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IPPROTO_TCP, 1, [Have IPPROTO_TCP]) + ], [ + # We'll have to use getprotobyname + AC_MSG_RESULT(no) + ]) + dnl ***************************** dnl *** Checks for SOL_IP *** dnl ***************************** @@ -1268,7 +1387,7 @@ if test x$target_win32 = xno; then dnl *** Checks for IP_PKTINFO *** dnl ***************************** AC_MSG_CHECKING(for IP_PKTINFO) - AC_TRY_COMPILE([#include ], [ + AC_TRY_COMPILE([#include ], [ int level = IP_PKTINFO; ], [ # Yes, we have it... @@ -1292,11 +1411,25 @@ if test x$target_win32 = xno; then AC_MSG_RESULT(no) ]) + dnl ********************************** + dnl *** Checks for IP_DONTFRAG *** + dnl ********************************** + AC_MSG_CHECKING(for IP_DONTFRAG) + AC_TRY_COMPILE([#include ], [ + int level = IP_DONTFRAG; + ], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IP_DONTFRAG, 1, [Have IP_DONTFRAG]) + ], [ + AC_MSG_RESULT(no) + ]) + dnl ********************************** dnl *** Checks for IP_DONTFRAGMENT *** dnl ********************************** AC_MSG_CHECKING(for IP_DONTFRAGMENT) - AC_TRY_COMPILE([#include ], [ + AC_TRY_COMPILE([#include ], [ int level = IP_DONTFRAGMENT; ], [ # Yes, we have it... @@ -1310,7 +1443,7 @@ if test x$target_win32 = xno; then dnl *** Checks for IP_MTU_DISCOVER *** dnl ********************************** AC_MSG_CHECKING(for IP_MTU_DISCOVER) - AC_TRY_COMPILE([#include ], [ + AC_TRY_COMPILE([#include ], [ int level = IP_MTU_DISCOVER; ], [ # Yes, we have it... @@ -1320,6 +1453,20 @@ if test x$target_win32 = xno; then AC_MSG_RESULT(no) ]) + dnl ********************************** + dnl *** Checks for IP_PMTUDISC_DO *** + dnl ********************************** + AC_MSG_CHECKING(for IP_PMTUDISC_DO) + AC_TRY_COMPILE([#include ], [ + int level = IP_PMTUDISC_DO; + ], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IP_PMTUDISC_DO, 1, [Have IP_PMTUDISC_DO]) + ], [ + AC_MSG_RESULT(no) + ]) + dnl ********************************* dnl *** Check for struct ip_mreqn *** dnl ********************************* @@ -1433,8 +1580,9 @@ if test x$target_win32 = xno; then ;; esac 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 ], [ @@ -1444,8 +1592,7 @@ if test x$target_win32 = xno; then AC_MSG_RESULT(ok) ], [ AC_MSG_RESULT(no) - AC_MSG_WARN(Using mono_mutex_t for recursive mutexes) - AC_DEFINE(USE_MONO_MUTEX, 1, [Use mono_mutex_t]) + AC_ERROR(Posix system lacks support for recursive mutexes) ]) AC_CHECK_FUNCS(pthread_attr_setstacksize) AC_CHECK_FUNCS(pthread_attr_getstack pthread_attr_getstacksize) @@ -1463,8 +1610,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 __thread int i; static int res1, res2; @@ -1506,6 +1659,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 @@ -1686,17 +1841,19 @@ if test x$target_win32 = xno; then dnl ********************************** dnl *** epoll *** dnl ********************************** - AC_CHECK_HEADERS(sys/epoll.h) - haveepoll=no - AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], ) - if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes" ; then - AC_DEFINE(HAVE_EPOLL, 1, [epoll supported]) + if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xno"; then + AC_CHECK_HEADERS(sys/epoll.h) + haveepoll=no + AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], ) + if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then + AC_DEFINE(HAVE_EPOLL, 1, [epoll supported]) + fi fi havekqueue=no - AC_CHECK_FUNCS(kqueue, , AC_MSG_CHECKING(for kqueue in sys/event.h) - AC_TRY_LINK([#include ], - [ 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: @@ -1705,8 +1862,8 @@ 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 x$platform_darwin = xno; then + if test "x$havekqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"; then + if test "x$platform_darwin" = "xno"; then AC_DEFINE(USE_KQUEUE_FOR_THREADPOOL, 1, [Use kqueue for the threadpool]) fi fi @@ -1861,6 +2018,10 @@ if test x$target_win32 = xno; then AC_CHECK_FUNCS(lockf) AC_CHECK_FUNCS(swab) AC_CHECK_FUNCS(setusershell endusershell) + 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 @@ -1875,6 +2036,8 @@ if test x$target_win32 = xno; then AC_CHECK_TYPES([struct flock], [AC_DEFINE(HAVE_STRUCT_FLOCK)], , [#include #include ]) + AC_CHECK_TYPES([struct iovec], [AC_DEFINE(HAVE_STRUCT_IOVEC)], , + [#include ]) AC_CHECK_TYPES([struct pollfd], [AC_DEFINE(HAVE_STRUCT_POLLFD)], , [#include ]) AC_CHECK_TYPES([struct stat], [AC_DEFINE(HAVE_STRUCT_STAT)], , @@ -1904,6 +2067,11 @@ if test x$target_win32 = xno; then [struct statfs.f_flags],,, [#include #include ]) + AC_CHECK_MEMBERS( + [struct stat.st_atim, struct stat.st_mtim, struct stat.st_ctim],,, + [#include + #include + #include ]) dnl Favour xattr through glibc, but use libattr if we have to AC_CHECK_FUNC(lsetxattr, , @@ -1927,6 +2095,11 @@ if test x$target_win32 = xno; then AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(dirent.h) + dnl ****************************************** + dnl *** Checks for OSX and iOS compilation *** + dnl ****************************************** + AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h) + dnl ********************************* dnl *** Check for Console 2.0 I/O *** dnl ********************************* @@ -1984,6 +2157,13 @@ else ]) ]) AC_CHECK_FUNCS(GetProcessId) + AC_CHECK_DECLS(InterlockedExchange64, [], [], [[#include ]]) + AC_CHECK_DECLS(InterlockedCompareExchange64, [], [], [[#include ]]) + AC_CHECK_DECLS(InterlockedDecrement64, [], [], [[#include ]]) + AC_CHECK_DECLS(InterlockedIncrement64, [], [], [[#include ]]) + AC_CHECK_DECLS(InterlockedAdd, [], [], [[#include ]]) + AC_CHECK_DECLS(InterlockedAdd64, [], [], [[#include ]]) + AC_CHECK_DECLS(__readfsdword, [], [], [[#include ]]) fi dnl socklen_t check @@ -2191,16 +2371,32 @@ AC_ARG_ENABLE(nacl_codegen, [ --enable-nacl-codegen Enable Native Client c AC_ARG_ENABLE(nacl_gc, [ --enable-nacl-gc Enable Native Client garbage collection], enable_nacl_gc=$enableval, enable_nacl_gc=no) AM_CONDITIONAL(NACL_CODEGEN, test x$enable_nacl_codegen != xno) + +dnl +dnl Hack to use system mono for operations in build/install not allowed in NaCl. +dnl +nacl_self_host="" +if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xyes"; then + nacl_self_host="nacl_self_host" +fi +AC_SUBST(nacl_self_host) + if test "x$enable_nacl_codegen" = "xyes"; then MONO_NACL_ALIGN_MASK_OFF=1 - CPPFLAGS="$CPPFLAGS -D__native_client_codegen__" AC_DEFINE(TARGET_NACL, 1, [...]) + AC_DEFINE(__native_client_codegen__, 1, [...]) else MONO_NACL_ALIGN_MASK_OFF=0 - CPPFLAGS="$CPPFLAGS -D__default_codegen__" + AC_DEFINE(__default_codegen__, 1, [...]) fi if test "x$enable_nacl_gc" = "xyes"; then - CPPFLAGS="$CPPFLAGS -finstrument-for-thread-suspension -D__native_client_gc__" + if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then + INSTRUMENT_CFLAG="-finstrument-for-thread-suspension" + else + # Not yet implemented + INSTRUMENT_CFLAG="" + fi + CPPFLAGS="$CPPFLAGS $INSTRUMENT_CFLAG -D__native_client_gc__" fi AC_SUBST(MONO_NACL_ALIGN_MASK_OFF) @@ -2210,11 +2406,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= 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" @@ -2224,25 +2430,42 @@ 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` - LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++" + # 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_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_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` 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 @@ -2285,10 +2508,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; @@ -2335,7 +2554,7 @@ case "$host" in have_visibility_hidden=no sgen_supported=true ;; - cygwin*) + mingw*|cygwin*) sgen_supported=true have_visibility_hidden=no ;; @@ -2359,6 +2578,10 @@ case "$host" in TARGET=AMD64; arch_target=amd64; JIT_SUPPORTED=yes + if test "x$ac_cv_sizeof_void_p" = "x4"; then + AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers]) + sizeof_register=8 + fi case $host_os in linux*) sgen_supported=true @@ -2409,37 +2632,11 @@ case "$host" in fi sgen_supported=true ;; - alpha*-*-linux* | alpha*-*-osf*) - TARGET=ALPHA; - ACCESS_UNALIGNED="no" - JIT_SUPPORTED=yes - arch_target=alpha; - CFLAGS="$CFLAGS -mieee -O0" - case $host_os in - linux*) - LIBC="libc.so.6.1" - INTL="libc.so.6.1" - esac - ;; *-mingw*|*-*-cygwin*) # When this is enabled, it leads to very strange crashes at runtime (gcc-3.4.4) have_visibility_hidden=no INTL="intl" ;; - hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00) - TARGET=HPPA; - arch_target=hppa; - LIBC="libc.sl" - ACCESS_UNALIGNED="no" - INTERP_SUPPORTED=yes - interp_wanted=true - ;; - hppa*linux*) - TARGET=HPPA; - arch_target=hppa; - ACCESS_UNALIGNED="no" - JIT_SUPPORTED=yes - ;; macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \ powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | powerpc-*-freebsd* ) if test "x$ac_cv_sizeof_void_p" = "x8"; then @@ -2463,9 +2660,9 @@ case "$host" in arch_target=arm; ACCESS_UNALIGNED="no" JIT_SUPPORTED=yes - CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1 -D__ARM_EABI__ -DHAVE_ARMV6=1" + CPPFLAGS="$CPPFLAGS -D__ARM_EABI__" # libgc's gc_locks.h depends on this - NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6" + CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC" sgen_supported=true ;; arm*-linux*) @@ -2475,18 +2672,19 @@ case "$host" in JIT_SUPPORTED=yes sgen_supported=true AOT_SUPPORTED="yes" + CPPFLAGS="$CPPFLAGS -D__ARM_EABI__" ;; - s390-*-linux*) - TARGET=S390; - arch_target=s390; - ACCESS_UNALIGNED="yes" - JIT_SUPPORTED=yes - sgen_supported=true - # Required CFLAGS for s390[x]. USE_STRING_INLINES is automatic with gcc 4.1 - CFLAGS="$CFLAGS -mbackchain -D__USE_STRING_INLINES" - ;; +# TODO: make proper support for NaCl host. +# arm*-*nacl) +# TARGET=ARM; +# arch_target=arm; +# ACCESS_UNALIGNED="no" +# JIT_SUPPORTED=yes +# sgen_supported=true +# AOT_SUPPORTED="no" +# ;; s390x-*-linux*) - TARGET=S390x; + TARGET=S390X; arch_target=s390x; ACCESS_UNALIGNED="yes" JIT_SUPPORTED=yes @@ -2506,7 +2704,7 @@ if test "x$host" != "x$target"; then arch_target=arm; ACCESS_UNALIGNED="no" JIT_SUPPORTED=yes - CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1 -D__ARM_EABI__ -DHAVE_ARMV6=1" + CPPFLAGS="$CPPFLAGS -D__ARM_EABI__" jit_wanted=true # Can't use tls, since it depends on the runtime detection of tls offsets # in mono-compiler.h @@ -2540,13 +2738,34 @@ if test "x$host" != "x$target"; then AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers]) sizeof_register=8 ;; - *-*-nacl) +# TODO: make proper support for NaCl target. +# arm*-*nacl) +# TARGET=ARM +# arch_target=arm +# AC_DEFINE(TARGET_ARM, 1, [...]) +# ACCESS_UNALIGNED="no" +# JIT_SUPPORTED=yes +# sizeof_register=4 +# CPPFLAGS="$CPPFLAGS \ +# -D__ARM_EABI__ \ +# -D__arm__ \ +# -D__portable_native_client__ \ +# -Dtimezone=_timezone \ +# -DDISABLE_SOCKETS \ +# -DDISABLE_ATTACH \ +# -DUSE_NEWLIB" +# jit_wanted=true + # Can't use tls, since it depends on the runtime detection of tls offsets + # in mono-compiler.h +# with_tls=pthread +# ;; + i686-*-nacl) TARGET=X86 arch_target=x86 AC_DEFINE(TARGET_X86, 1, [...]) sizeof_register=4 ;; - arm*-unknown-linux-*) + arm*-linux-*) TARGET=ARM; arch_target=arm; AC_DEFINE(TARGET_ARM, 1, [...]) @@ -2561,11 +2780,11 @@ if test "x$host" != "x$target"; then case "$target" in armv7l-unknown-linux-gnueabi*) # TEGRA - CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1" + CPPFLAGS="$CPPFLAGS" ;; armv5-*-linux-androideabi*) AC_DEFINE(TARGET_ANDROID, 1, [...]) - CPPFLAGS="$CPPFLAGS -DARM_FPU_NONE" + CPPFLAGS="$CPPFLAGS" ;; esac ;; @@ -2574,7 +2793,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, [...]) @@ -2592,30 +2810,53 @@ POWERPC64) AC_DEFINE(TARGET_POWERPC, 1, [...]) AC_DEFINE(TARGET_POWERPC64, 1, [...]) ;; -S390x) +S390X) AC_DEFINE(TARGET_S390X, 1, [...]) ;; MIPS) AC_DEFINE(TARGET_MIPS, 1, [...]) ;; +IA64) + AC_DEFINE(TARGET_IA64, 1, [...]) + ;; +SPARC) + AC_DEFINE(TARGET_SPARC, 1, [...]) + ;; +SPARC64) + AC_DEFINE(TARGET_SPARC64, 1, [...]) + ;; esac -if test "x$target_mach" = "xyes"; then - AC_TRY_COMPILE([#include "TargetConditionals.h"],[ - #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1 - #error fail this for ios - #endif - return 0; - ], [ - AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX]) - CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX" - CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX" - ], [ - 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" - ]) +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]) + CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS" + CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS" + else + AC_TRY_COMPILE([#include "TargetConditionals.h"],[ + #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1 + #error fail this for ios + #endif + return 0; + ], [ + AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX]) + CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX" + CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX" + ], [ + 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" + ]) + fi AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms]) fi @@ -2716,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 @@ -2755,39 +2997,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" = "xALPHA" -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" - NESTED_LIBGC_FLAGS="-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]) @@ -2803,11 +3012,6 @@ if test "x$icall_tables" = "xno"; then AC_DEFINE(DISABLE_ICALL_TABLES, 1, [Icall tables disabled]) fi -if test "x$mono_cv_clang" = "xyes"; then - # FIXME: This causes many compilation errors - with_tls=pthread -fi - if test "x$with_tls" = "x__thread"; then AC_DEFINE(HAVE_KW_THREAD, 1, [Have __thread keyword]) # Pass the information to libgc @@ -2816,58 +3020,139 @@ if test "x$with_tls" = "x__thread"; then AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [ ], [ AC_MSG_RESULT(yes) - # CLANG doesn't support this yet, and it prints warnings about it - if test "x$mono_cv_clang" = "xno"; then - AC_DEFINE(HAVE_TLS_MODEL_ATTR, 1, [tld_model available]) - fi + AC_DEFINE(HAVE_TLS_MODEL_ATTR, 1, [tls_model available]) ], [ AC_MSG_RESULT(no) ]) fi -if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_build != xno; then +if test ${TARGET} = ARM; then dnl ****************************************** dnl *** Check to see what FPU is available *** dnl ****************************************** AC_MSG_CHECKING(which FPU to use) + # + # This is a bit tricky: + # + # if (__ARM_PCS_VFP) { + # /* mfloat-abi=hard == VFP with hard ABI */ + # } elif (!__SOFTFP__) { + # /* mfloat-abi=softfp == VFP with soft ABI */ + # } else { + # /* mfloat-abi=soft == no VFP */ + # } + # + # The exception is iOS (w/ GCC) where none of the above + # are defined (but iOS always uses the 'softfp' ABI). + # + # No support for FPA. + # + fpu=NONE - if gcc -v 2>&1 | grep -q -- '--with-float=hard'; then - fpu=VFP_HARD + + # iOS GCC always uses the 'softfp' ABI. + if test x"$GCC" = xyes && test x$platform_darwin = xyes; then + fpu=VFP fi + # Are we using the 'hard' ABI? if test x$fpu = xNONE; then - ORIG_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -mfpu=vfp -mfloat-abi=softfp" - AC_TRY_RUN([ - int main () { __asm__ ("faddd d7, d6, d7"); return 0; } - ], fpu=VFP, fpu=NONE) - CFLAGS=$ORIG_CFLAGS + AC_TRY_COMPILE([], [ + #ifndef __ARM_PCS_VFP + #error "Float ABI is not 'hard'" + #endif + return 0; + ], [ + fpu=VFP_HARD + ], [ + fpu=NONE + ]) fi + # No 'hard' ABI. 'soft' or 'softfp'? if test x$fpu = xNONE; then AC_TRY_COMPILE([], [ - __asm__ ("ldfd f0, [r0]"); - ], fpu=FPA, fpu=NONE) + #ifdef __SOFTFP__ + #error "Float ABI is not 'softfp'" + #endif + return 0; + ], [ + fpu=VFP + ], [ + fpu=NONE + ]) fi AC_MSG_RESULT($fpu) CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1" unset fpu - AC_MSG_CHECKING(for ARMV6) - AC_TRY_RUN([ - int main () { __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); return 0; } - ], armv6=yes, armv6=no) + dnl ********************************************* + dnl *** Check which ARM version(s) we can use *** + dnl ********************************************* + AC_MSG_CHECKING(which ARM version to use) + + AC_TRY_COMPILE([], [ + #if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__) + #error Not on ARM v5. + #endif + return 0; + ], [ + arm_v5=yes + + arm_ver=ARMv5 + ], []) + + AC_TRY_COMPILE([], [ + #if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__) + #error Not on ARM v6. + #endif + return 0; + ], [ + 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__) && !defined(__ARM_ARCH_7S__) + #error Not on ARM v7. + #endif + return 0; + ], [ + 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" + fi + + if test x$arm_v6 = xyes; then + AC_DEFINE(HAVE_ARMV6, 1, [ARM v6]) + CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6=1" + fi - AC_MSG_RESULT($armv6) - if test ${armv6} = yes; then - AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions") - # libgc's gc_locks.h depends on this - NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6" + if test x$arm_v7 = xyes; then + AC_DEFINE(HAVE_ARMV7, 1, [ARM v7]) + CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV7=1" fi fi +if test ${TARGET} = ARM; then + if test "x${with_jumptables}" = "xyes"; then + AC_DEFINE(USE_JUMP_TABLES, 1, Use jump tables in JIT) + fi +fi + if test ${TARGET} = unknown; then CPPFLAGS="$CPPFLAGS -DNO_PORT" AC_MSG_WARN("mono has not been ported to $host: some things may not work.") @@ -2886,7 +3171,7 @@ case "x$gc" in # The problem with this approach, is that during a reconfigure, the main # configure scripts gets invoked with these arguments, so we use separate # variables understood by libgc's configure to pass CPPFLAGS and CFLAGS. - TMP_CPPFLAGS="$CPPFLAGS $NESTED_LIBGC_FLAGS" + TMP_CPPFLAGS="$CPPFLAGS $CPPFLAGS_FOR_LIBGC" if test x$TARGET = xSPARC -o x$TARGET = xSPARC64; then TMP_CPPFLAGS=`echo $TMP_CPPFLAGS | sed -e 's/-D_FILE_OFFSET_BITS=64//g'` fi @@ -2904,7 +3189,7 @@ AC_ARG_WITH(profile4, [ --with-profile4=yes,no If you want to install AC_ARG_WITH(profile4_5,[ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes]) AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no]) AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no,only If you want to build the MonoTouch assemblies (defaults to no)], [], [with_monotouch=no]) -AC_ARG_WITH(mobile, [ --with-mobile=yes,no If you want to build the Mobile assemblies (defaults to no)], [], [with_mobile=no]) +AC_ARG_WITH(xammac, [ --with-xammac=yes,no,only If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no]) OPROFILE=no AC_ARG_WITH(oprofile,[ --with-oprofile=no, Enable oprofile support (defaults to no)],[ @@ -2939,20 +3224,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.]) @@ -2973,10 +3244,14 @@ fi # When --disable-shared is used, libtool transforms libmono-2.0.la into libmono-2.0.so # instead of libmono-static.a -if test "x$enable_shared" = "xno"; then +if test "x$enable_shared" = "xno" -a "x$enable_executables" = "xyes"; then LIBMONO_LA=libmini-static.la else - LIBMONO_LA=libmono-$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) @@ -2990,6 +3265,7 @@ if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then with_profile4_5=no with_monodroid=no with_monotouch=no + with_xammac=no fi if test x$DISABLE_MCS_DOCS = xyes; then @@ -3008,19 +3284,14 @@ 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]) AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"]) AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"]) -AM_CONDITIONAL(INSTALL_MOBILE, [test "x$with_mobile" = xyes]) +AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"]) AM_CONDITIONAL(ONLY_MONOTOUCH, [test "x$with_monotouch" = "xonly"]) +AM_CONDITIONAL(ONLY_XAMMAC, [test "x$with_xammac" = "xonly"]) AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) @@ -3028,16 +3299,12 @@ AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64) AM_CONDITIONAL(X86, test x$TARGET = xX86) AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64) -AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA) AM_CONDITIONAL(IA64, test x$TARGET = xIA64) -AM_CONDITIONAL(M68K, test x$TARGET = xM68K) 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(S390, test x$TARGET = xS390) -AM_CONDITIONAL(S390x, test x$TARGET = xS390x) -AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA) +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) @@ -3151,7 +3418,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']) @@ -3227,13 +3522,10 @@ mono/cil/Makefile mono/arch/Makefile mono/arch/x86/Makefile mono/arch/amd64/Makefile -mono/arch/hppa/Makefile mono/arch/ppc/Makefile mono/arch/sparc/Makefile -mono/arch/s390/Makefile mono/arch/s390x/Makefile mono/arch/arm/Makefile -mono/arch/alpha/Makefile mono/arch/ia64/Makefile mono/arch/mips/Makefile mono/interpreter/Makefile @@ -3246,6 +3538,8 @@ 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 mono/monograph/Makefile mono/io-layer/Makefile @@ -3261,6 +3555,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 @@ -3281,6 +3577,7 @@ data/system.web.mvc.pc data/system.web.mvc2.pc data/system.web.mvc3.pc data/aspnetwebstack.pc +data/reactive.pc samples/Makefile support/Makefile data/config @@ -3304,6 +3601,11 @@ if test x$host_win32 = xyes; then sed -e "s,-mno-cygwin,,g" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool fi +if test x$platform_darwin = xyes; then + # This doesn't seem to be required and it slows down parallel builds + sed -e 's,lock_old_archive_extraction=yes,lock_old_archive_extraction=no,g' < libtool > libtool.new && mv libtool.new libtool && chmod +x libtool +fi + ( case $prefix in NONE) prefix=$ac_default_prefix ;; @@ -3369,8 +3671,8 @@ 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 + if test x$has_extension_module != xno; then + echo "EXTENSION_MODULE = 1" >> $srcdir/$mcsdir/build/config.make fi default_profile=net_2_0 @@ -3383,6 +3685,9 @@ fi if test -z "$INSTALL_MONOTOUCH_TRUE"; then : default_profile=monotouch fi + if test -z "$INSTALL_XAMMAC_TRUE"; then : + default_profile=xammac + fi if test -z "$INSTALL_4_5_TRUE"; then : default_profile=net_4_5 fi @@ -3434,6 +3739,7 @@ echo " .NET 4.5: $with_profile4_5 MonoDroid: $with_monodroid MonoTouch: $with_monotouch + Xamarin.Mac: $with_xammac JNI support: $jdk_headers_found libgdiplus: $libgdiplus_msg zlib: $zlib_msg