diff options
Diffstat (limited to 'erts/configure.in')
-rw-r--r-- | erts/configure.in | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/erts/configure.in b/erts/configure.in index bad748d8fe..3b4c46d4a5 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -406,6 +406,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 +455,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 @@ -3616,6 +3627,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 +3635,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 +3752,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) |