aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in109
1 files changed, 89 insertions, 20 deletions
diff --git a/erts/configure.in b/erts/configure.in
index bad748d8fe..8d245252b5 100644
--- a/erts/configure.in
+++ b/erts/configure.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,6 +135,13 @@ 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)]),
@@ -406,6 +414,17 @@ 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)
dnl ----------------------------------------------------------------------
dnl Checks for programs.
@@ -444,7 +463,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
@@ -1211,6 +1230,13 @@ 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_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
else
# Threads enabled for emulator
EMU_THR_LIB_NAME=$ETHR_LIB_NAME
@@ -1229,7 +1255,17 @@ 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_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+
disable_child_waiter_thread=no
case $host_os in
solaris*)
@@ -1325,7 +1361,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")
@@ -1361,24 +1397,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
@@ -3616,6 +3672,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
@@ -3623,11 +3680,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
@@ -3737,6 +3797,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,10 +3852,16 @@ if test "$enable_dtrace_test" = "yes" ; then
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
+
+ $RM -f dtest.{o,c}
+ cat > dtest.c <<_DTEST
+ #include "foo-dtrace.h"
+ int main(void) { ERLANG_DIST_PORT_BUSY_ENABLED(); return 0; }
+_DTEST
+ $CC $CFLAGS -c -o dtest.o dtest.c
$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 && \
+ if dtrace -G $DTRACE_CPP $DTRACE_BITS_FLAG -Iemulator/beam -o $DTRACE_2STEP_TEST -s emulator/beam/erlang_dtrace.d dtest.o && \
test -f $DTRACE_2STEP_TEST ; then
rm $DTRACE_2STEP_TEST
DTRACE_ENABLED_2STEP=yes
@@ -3802,6 +3869,8 @@ if test "$enable_dtrace_test" = "yes" ; then
else
AC_MSG_NOTICE([dtrace precompilation for 1-stage DTrace successful])
fi
+ $RM -f dtest.{o,c} foo-dtrace.h
+
DTRACE_ENABLED=yes
case $OPSYS in
linux)