diff options
Diffstat (limited to 'erts/configure.in')
-rw-r--r-- | erts/configure.in | 249 |
1 files changed, 204 insertions, 45 deletions
diff --git a/erts/configure.in b/erts/configure.in index 3ed1238319..9ebb56e3bc 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 1997-2013. All Rights Reserved. +dnl Copyright Ericsson AB 1997-2014. All Rights Reserved. dnl dnl The contents of this file are subject to the Erlang Public License, dnl Version 1.1, (the "License"); you may not use this file except in @@ -101,7 +101,7 @@ ERL_XCOMP_SYSROOT_INIT AC_ISC_POSIX -AC_CONFIG_HEADER($host/config.h:config.h.in include/internal/$host/ethread_header_config.h:include/internal/ethread_header_config.h.in include/$host/erl_int_sizes_config.h:include/erl_int_sizes_config.h.in) +AC_CONFIG_HEADER($host/config.h:config.h.in include/internal/$host/ethread_header_config.h:include/internal/ethread_header_config.h.in include/$host/erl_int_sizes_config.h:include/erl_int_sizes_config.h.in include/$host/erl_native_features_config.h:include/erl_native_features_config.h.in) dnl ---------------------------------------------------------------------- dnl Optional features. dnl ---------------------------------------------------------------------- @@ -123,6 +123,7 @@ AS_HELP_STRING([--enable-bootstrap-only], with_ssl_zlib=no enable_hipe=no enable_sctp=no + enable_dirty_schedulers=no fi ]) @@ -134,9 +135,16 @@ AS_HELP_STRING([--disable-threads], [disable async thread support]), *) enable_threads=yes ;; esac ], enable_threads=unknown) +AC_ARG_ENABLE(dirty-schedulers, +AS_HELP_STRING([--enable-dirty-schedulers], [enable dirty scheduler support]), +[ case "$enableval" in + no) enable_dirty_schedulers=no ;; + *) enable_dirty_schedulers=yes ;; + esac ], enable_dirty_schedulers=no) + AC_ARG_ENABLE(halfword-emulator, AS_HELP_STRING([--enable-halfword-emulator], - [enable halfword emulator (only for 64bit builds)]), + [enable halfword emulator (only for 64bit builds). Note: Halfword emulator is marked as deprecated and scheduled for removal in future major release.]), [ case "$enableval" in no) enable_halfword_emualtor=no ;; *) enable_halfword_emulator=yes ;; @@ -339,6 +347,25 @@ AS_HELP_STRING([--enable-clock-gettime], *) clock_gettime_correction=yes ;; esac ], clock_gettime_correction=unknown) +AC_ARG_WITH(assumed-cache-line-size, +AS_HELP_STRING([--with-assumed-cache-line-size=SIZE], + [specify assumed cache line size in bytes (valid values are powers of two between and including 16 and 8192; default is 64)])) + +dnl Require the assumed cache-line size to be a power of two between 16 and 8192 +case "$with_assumed_cache_line_size" in + ""|no|yes) + with_assumed_cache_line_size=64;; + 16|32|64|128|256|512|1024|2048|4096|8192) + ;; + *) + AC_MSG_ERROR([Invalid assumed cache-line size of $with_assumed_cache_line_size bytes]) + ;; +esac + +AC_DEFINE_UNQUOTED(ASSUMED_CACHE_LINE_SIZE, + $with_assumed_cache_line_size, + [Assumed cache-line size (in bytes)]) + dnl Magic test for clearcase. OTP_RELEASE= if test "${ERLANG_COMMERCIAL_BUILD}" != ""; then @@ -349,6 +376,16 @@ else fi AC_SUBST(OTP_RELEASE) +AC_MSG_CHECKING([OTP release]) +[SYSTEM_VSN=`cat $ERL_TOP/OTP_VERSION | sed "s|\([0-9]*\).*|\1|"`] +AC_MSG_RESULT([$SYSTEM_VSN]) +AC_SUBST(SYSTEM_VSN) + +AC_MSG_CHECKING([OTP version]) +[OTP_VERSION=`cat $ERL_TOP/OTP_VERSION`] +AC_MSG_RESULT([$OTP_VERSION]) +AC_SUBST(OTP_VERSION) + dnl OK, we might have darwin switches off different kinds, lets dnl check it all before continuing. TMPSYS=`uname -s`-`uname -m` @@ -406,6 +443,28 @@ else fi fi +AC_ARG_ENABLE(static-nifs, +AS_HELP_STRING([--enable-static-nifs], [link nifs statically. If yes then all nifs in all Erlang/OTP applications will be statically linked into the main binary. It is also possible to give a list of nifs that should be linked statically. The list should be a comma seperated and contain the absolute path to a .a archive for each nif that is to be statically linked. The name of the .a archive has to be the same as the name of the nif. Note that you have to link any external dependencies that the nifs have to the main binary, so for the crypto nif you want to pass LIBS=-lcrypto to configure.]), + STATIC_NIFS="$enableval", + STATIC_NIFS=no) +AC_SUBST(STATIC_NIFS) + +AC_ARG_ENABLE(static-drivers, +AS_HELP_STRING([--enable-static-drivers], [comma seperated list of linked-in drivers to link statically with the main binary. The list should contain the absolute path to a .a archive for each driver that is to be statically linked. The name of the .a archive has to be the same as the name of the driver.]), + STATIC_DRIVERS="$enableval", + STATIC_DRIVERS=no) +AC_SUBST(STATIC_DRIVERS) + +AC_ARG_WITH(ets-write-concurrency-locks, + AS_HELP_STRING([--with-ets-write-concurrency-locks={8,16,32,64,128,256}], + [specify how many locks the write_concurrency option for ets should use.]) + AS_HELP_STRING([--without-ets-write-concurrency-locks], + [use the default number of write_concurrency locks (default)])) + +if test X"$with_ets_write_concurrency_locks" != X""; then + AC_DEFINE_UNQUOTED(ERTS_DB_HASH_LOCK_CNT,$with_ets_write_concurrency_locks, + [Define to override the default number of write_concurrency locks]) +fi dnl ---------------------------------------------------------------------- dnl Checks for programs. @@ -444,7 +503,7 @@ dnl extra_flags="-I${ERL_TOP}/erts/$host $OTP_EXTRA_FLAGS" CFLAGS="$CFLAGS $extra_flags" -DEBUG_CFLAGS="-g $CPPFLAGS $extra_flags" +DEBUG_CFLAGS="-g $CPPFLAGS $extra_flags $DEBUG_CFLAGS" DEBUG_FLAGS=-g dnl @@ -757,6 +816,16 @@ if test "$enable_halfword_emulator" = "yes"; then [Define if building a halfword-heap 64bit emulator]) ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS halfword" AC_MSG_RESULT([yes]) + + test -f "$ERL_TOP/erts/CONF_INFO" || + echo "" > "$ERL_TOP/erts/CONF_INFO" + cat >> $ERL_TOP/erts/CONF_INFO <<EOF + + The HALFWORD emulator has been enabled. + This is a DEPRECATED feature scheduled for removal + in a future major release. + +EOF else AC_MSG_ERROR(no; halfword emulator not supported on this architecture) fi @@ -886,7 +955,10 @@ dnl what the user say. This might not be the right way to do it, but dnl for now that is the way we do it. USER_LD=$LD USER_LDFLAGS="$LDFLAGS" -LD='$(CC)' +case $host in + *ose) ;; + *) LD='$(CC)' ;; +esac AC_SUBST(LD) LDFLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH" @@ -897,12 +969,15 @@ dnl AC_CYGWIN is deprecated AC_EXEEXT AC_OBJEXT -dnl This is the os flavour, should be unix, vxworks or win32 -if test "X$host" = "Xwin32"; then - ERLANG_OSTYPE=win32 -else - ERLANG_OSTYPE=unix -fi +dnl This is the os flavour, should be unix, ose, vxworks or win32 +case $host in + win32) + ERLANG_OSTYPE=win32 ;; + *ose) + ERLANG_OSTYPE=ose ;; + *) + ERLANG_OSTYPE=unix ;; +esac AC_SUBST(ERLANG_OSTYPE) @@ -1088,7 +1163,7 @@ fi AC_SUBST(ERTS_BUILD_SMP_EMU) -AC_CHECK_FUNCS([posix_fadvise]) +AC_CHECK_FUNCS([posix_fadvise closefrom]) AC_CHECK_HEADERS([linux/falloc.h]) dnl * Old glibcs have broken fallocate64(). Make sure not to use it. AC_CACHE_CHECK([whether fallocate() works],i_cv_fallocate_works,[ @@ -1189,7 +1264,7 @@ case "$enable_threads"-"$found_threads" in AC_MSG_RESULT(yes; enabled by user) ;; unknown-yes) case $host_os in - solaris*|linux*|darwin*|win32) + solaris*|linux*|darwin*|win32|ose) emu_threads=yes AC_MSG_RESULT(yes; default on this platform) ;; @@ -1213,6 +1288,14 @@ esac if test $emu_threads != yes; then enable_lock_check=no enable_lock_count=no + AC_MSG_CHECKING(whether dirty schedulers should be enabled) + if test "x$enable_dirty_schedulers" != "xno"; then + AC_DEFINE(ERL_NIF_DIRTY_SCHEDULER_SUPPORT, 1, [Dirty scheduler support]) + AC_DEFINE(ERL_DRV_DIRTY_SCHEDULER_SUPPORT, 1, [Dirty scheduler support]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi else # Threads enabled for emulator EMU_THR_LIB_NAME=$ETHR_LIB_NAME @@ -1231,7 +1314,18 @@ else if test "x$enable_lock_count" != "xno"; then EMU_THR_DEFS="$EMU_THR_DEFS -DERTS_ENABLE_LOCK_COUNT" fi - + + AC_MSG_CHECKING(whether dirty schedulers should be enabled) + if test "x$enable_dirty_schedulers" != "xno"; then + EMU_THR_DEFS="$EMU_THR_DEFS -DERTS_DIRTY_SCHEDULERS" + AC_DEFINE(ERTS_DIRTY_SCHEDULERS, 1, [Define if the emulator supports dirty schedulers]) + AC_DEFINE(ERL_NIF_DIRTY_SCHEDULER_SUPPORT, 1, [Dirty scheduler support]) + AC_DEFINE(ERL_DRV_DIRTY_SCHEDULER_SUPPORT, 1, [Dirty scheduler support]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + disable_child_waiter_thread=no case $host_os in solaris*) @@ -1252,7 +1346,7 @@ else enable_child_waiter_thread=no fi ;; - win32) + win32|ose) # Child waiter thread cannot be enabled disable_child_waiter_thread=yes enable_child_waiter_thread=no @@ -1327,7 +1421,7 @@ TERMCAP_LIB= if test "x$with_termcap" != "xno" && test "X$host" != "Xwin32"; then # try these libs - termcap_libs="ncurses curses termcap termlib" + termcap_libs="tinfo ncurses curses termcap termlib" for termcap_lib in $termcap_libs; do AC_CHECK_LIB($termcap_lib, tgetent, TERMCAP_LIB="-l$termcap_lib") @@ -1363,24 +1457,44 @@ dnl ------------- dnl zlib dnl ------------- -AC_ARG_ENABLE(shared-zlib, -AS_HELP_STRING([--enable-shared-zlib], [enable using shared zlib library]), -[ case "$enableval" in - no) enable_shared_zlib=no ;; - *) enable_shared_zlib=yes ;; - esac ], enable_shared_zlib=no) +AC_ARG_ENABLE(builtin-zlib, + AS_HELP_STRING([--enable-builtin-zlib], + [force use of our own built-in zlib]), + [ case "$enableval" in + no) enable_builtin_zlib=no ;; + *) enable_builtin_zlib=yes ;; + esac ], enable_builtin_zlib=no) Z_LIB= -if test "x$enable_shared_zlib" = "xyes" ; then - AC_CHECK_LIB(z, adler32_combine, - [Z_LIB="-lz" - AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if you have the `z' library (-lz).])], - [AC_MSG_ERROR([cannot find any shared zlib])]) +if test "x$enable_builtin_zlib" = "xyes"; then + AC_MSG_NOTICE([Using our own built-in zlib source]) else - AC_MSG_NOTICE([Using own zlib source]) +AC_MSG_CHECKING(for zlib 1.2.5 or higher) +zlib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include "zlib.h" +]],[[ +#if ZLIB_VERNUM >= 0x1250 + Bytef s[1]; + s[0] = 0; + (void) adler32((uLong)0, s, 1); +#else +#error "No zlib 1.2.5 or higher found" +error +#endif +]])], +[ + Z_LIB="-lz" + AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if you have the `z' library (-lz).]) + AC_MSG_RESULT(yes) +],[ + AC_MSG_RESULT(no) +]) +LIBS=$zlib_save_LIBS fi - AC_SUBST(Z_LIB) dnl @@ -1966,7 +2080,7 @@ AC_CHECK_FUNCS([getipnodebyname getipnodebyaddr gethostbyname2]) AC_CHECK_FUNCS([ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \ pread pwrite memmove strerror strerror_r strncasecmp \ gethrtime localtime_r gmtime_r inet_pton \ - mmap mremap memcpy mallopt sbrk _sbrk __sbrk brk _brk __brk \ + memcpy mallopt sbrk _sbrk __sbrk brk _brk __brk \ flockfile fstat strlcpy strlcat setsid posix2time time2posix \ setlocale nl_langinfo poll mlockall]) @@ -2007,6 +2121,17 @@ case $host_os in AC_CHECK_FUNCS([writev]) ;; esac +case $host_os in + *ose) + AC_MSG_CHECKING([for mmap]) + AC_MSG_RESULT(not using for OSE) + AC_MSG_CHECKING([for mremap]) + AC_MSG_RESULT(not using for OSE) ;; + *) + AC_CHECK_FUNCS([mmap mremap]) ;; +esac + + AC_CHECK_DECLS([posix2time, time2posix],,,[#include <time.h>]) disable_vfork=false @@ -2715,6 +2840,9 @@ esac if test X${enable_fp_exceptions} = Xauto ; then case $host_os in + *linux*) + enable_fp_exceptions=no + AC_MSG_NOTICE([Floating point exceptions disabled by default on Linux]) ;; darwin*) enable_fp_exceptions=no AC_MSG_NOTICE([Floating point exceptions disabled by default on MacOS X]) ;; @@ -3620,6 +3748,7 @@ fi DED_EMU_THR_DEFS=$EMU_THR_DEFS DED_CFLAGS="$CFLAGS $CPPFLAGS" if test "x$GCC" = xyes; then + DED_STATIC_CFLAGS="$DED_CFLAGS" DED_CFLAGS="$DED_CFLAGS -fPIC" fi @@ -3627,11 +3756,14 @@ DED_EXT=so case $host_os in win32) DED_EXT=dll;; darwin*) - DED_CFLAGS="$DED_CFLAGS -fno-common";; + DED_CFLAGS="$DED_CFLAGS -fno-common" + DED_STATIC_CFLAGS="$DED_STATIC_CFLAGS -fno-common";; *) ;; esac +DED_STATIC_CFLAGS="$DED_STATIC_CFLAGS -DSTATIC_ERLANG_NIF -DSTATIC_ERLANG_DRIVER" + # If DED_LD is set in environment, we expect all DED_LD* variables # to be specified (cross compiling) if test "x$DED_LD" = "x"; then @@ -3741,6 +3873,7 @@ fi AC_SUBST(DED_EXT) AC_SUBST(DED_SYS_INCLUDE) AC_SUBST(DED_CFLAGS) +AC_SUBST(DED_STATIC_CFLAGS) AC_SUBST(DED_LD) AC_SUBST(DED_LDFLAGS) AC_SUBST(DED_LD_FLAG_RUNTIME_LIBRARY_PATH) @@ -3791,21 +3924,27 @@ esac if test "$enable_dtrace_test" = "yes" ; then if test "$DTRACE" = "dtrace" ; then AC_CHECK_HEADERS(sys/sdt.h) + AC_MSG_CHECKING([for 1-stage DTrace precompilation]) # The OS X version of dtrace prints a spurious line here. if ! dtrace -h $DTRACE_CPP -Iemulator/beam -o ./foo-dtrace.h -s emulator/beam/erlang_dtrace.d; then AC_MSG_ERROR([Could not precompile erlang_dtrace.d: dtrace -h failed]) fi - rm -f foo-dtrace.h + AC_MSG_RESULT([yes]) - $RM -f $DTRACE_2STEP_TEST - if dtrace -G $DTRACE_CPP $DTRACE_BITS_FLAG -Iemulator/beam -o $DTRACE_2STEP_TEST -s emulator/beam/erlang_dtrace.d 2> /dev/null && \ - test -f $DTRACE_2STEP_TEST ; then - rm $DTRACE_2STEP_TEST + AC_MSG_CHECKING([for 2-stage DTrace precompilation]) + AC_TRY_COMPILE([ #include "foo-dtrace.h" ], + [ERLANG_DIST_PORT_BUSY_ENABLED();], + [$RM -f $DTRACE_2STEP_TEST + dtrace -G $DTRACE_CPP $DTRACE_BITS_FLAG -Iemulator/beam -o $DTRACE_2STEP_TEST -s emulator/beam/erlang_dtrace.d conftest.$OBJEXT 2>&AS_MESSAGE_LOG_FD + if test -f $DTRACE_2STEP_TEST; then + rm $DTRACE_2STEP_TEST DTRACE_ENABLED_2STEP=yes - AC_MSG_NOTICE([dtrace precompilation for 2-stage DTrace successful]) - else - AC_MSG_NOTICE([dtrace precompilation for 1-stage DTrace successful]) - fi + fi], + []) + AS_IF([test "x$DTRACE_ENABLED_2STEP" = "xyes"], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + DTRACE_ENABLED=yes case $OPSYS in linux) @@ -3847,7 +3986,7 @@ AC_SUBST(STATIC_KERBEROS_LIBS) AC_SUBST(SSL_LINK_WITH_ZLIB) AC_SUBST(STATIC_ZLIB_LIBS) -std_ssl_locations="/usr/local /usr/sfw /usr /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl" +std_ssl_locations="/usr/local /usr/sfw /usr /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl /" AC_ARG_WITH(ssl-zlib, AS_HELP_STRING([--with-ssl-zlib=PATH], @@ -3954,6 +4093,7 @@ for a in ssl crypto ssh; do done SSL_DYNAMIC_ONLY=$enable_dynamic_ssl +SSL_STATIC_ONLY=no case "$erl_xcomp_without_sysroot-$with_ssl" in yes-* | no-no) @@ -4073,6 +4213,10 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in else is_real_ssl=no fi + elif test -f "$dir/lib/powerpc/libsslcrypto.a"; then + SSL_CRYPTO_LIBNAME=sslcrypto + SSL_LIBDIR="$dir/lib/powerpc/" + SSL_RUNTIME_LIBDIR="$rdir/lib/powerpc/" else if test "x$ac_cv_sizeof_void_p" = "x8"; then if test -f "$dir/lib64/libcrypto.a"; then @@ -4096,8 +4240,10 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in SSL_LIBDIR="$dir/lib" fi fi - if test '!' -f $SSL_LIBDIR/libcrypto.a; then + if test '!' -f "$SSL_LIBDIR/lib${SSL_CRYPTO_LIBNAME}.a"; then SSL_DYNAMIC_ONLY=yes + elif test '!' -f "$SSL_LIBDIR/lib${SSL_CRYPTO_LIBNAME}.so" -a '!' -f "$SSL_LIBDIR/lib${SSL_CRYPTO_LIBNAME}.dylib"; then + SSL_STATIC_ONLY=yes fi SSL_BINDIR="$rdir/bin" if test "x$is_real_ssl" = "xyes" ; then @@ -4119,13 +4265,20 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in if test "x$ssl_found" = "xyes"; then if test "x$MIXED_CYGWIN" = "xyes" -o "x$MIXED_MSYS" = "xyes"; then ssl_linkable=yes + elif test "x${SSL_CRYPTO_LIBNAME}" = "xsslcrypto"; then + # This should only be triggered seen OSE + ssl_linkable=yes else saveCFLAGS="$CFLAGS" saveLDFLAGS="$LDFLAGS" saveLIBS="$LIBS" CFLAGS="$CFLAGS $SSL_INCLUDE" - LDFLAGS="$LDFLAGS -L$SSL_LIBDIR" - LIBS="-lcrypto" + if test "x$SSL_STATIC_ONLY" = "xyes"; then + LIBS="${SSL_LIBDIR}/lib${SSL_CRYPTO_LIBNAME}.a" + else + LDFLAGS="$LDFLAGS -L$SSL_LIBDIR" + LIBS="$LIBS -l${SSL_CRYPTO_LIBNAME}" + fi AC_TRY_LINK([ #include <stdio.h> #include <openssl/hmac.h>], @@ -4253,6 +4406,9 @@ dnl so it is - be adoptable # This probably wont work, but that's what the user said, so... SSL_LIBDIR="$with_ssl/lib" fi + elif test -f "$dir/lib/powerpc/libsslcrypto.a"; then + SSL_CRYPTO_LIBNAME=sslcrypto + SSL_LIBDIR="$with_ssl/lib/powerpc/" elif test "x$ac_cv_sizeof_void_p" = "x8"; then if test -f "$with_ssl/lib64/libcrypto.a"; then SSL_LIBDIR="$with_ssl/lib64" @@ -4268,8 +4424,10 @@ dnl so it is - be adoptable else SSL_LIBDIR="$with_ssl/lib" fi - if test '!' -f $SSL_LIBDIR/libcrypto.a; then + if test '!' -f "${SSL_LIBDIR}/lib${SSL_CRYPTO_LIBNAME}.a"; then SSL_DYNAMIC_ONLY=yes + elif test '!' -f ${SSL_LIBDIR}/lib${SSL_CRYPTO_LIBNAME}.so -a '!' -f "$SSL_LIBDIR/lib${SSL_CRYPTO_LIBNAME}.dylib"; then + SSL_STATIC_ONLY=yes fi SSL_INCLUDE="-I$with_ssl/include" SSL_APP=ssl @@ -4663,6 +4821,7 @@ AC_OUTPUT( Makefile:Makefile.in ../make/$host/otp.mk:../make/otp.mk.in ../make/$host/otp_ded.mk:../make/otp_ded.mk.in + ../make/$host/ose_lm.mk:../make/ose_lm.mk.in dnl dnl The ones below should be moved to their respective lib dnl |