aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-08-13 17:14:11 +0200
committerLukas Larsson <[email protected]>2013-08-21 15:20:04 +0200
commit20e0509d4e04fada3019639bc82d78b89f06b0fc (patch)
treed780872721c18782e4bdb7d9fc0f340363acbe38 /erts/configure.in
parenta27e9776c839aa9fed9e71e3d06a33720377e293 (diff)
downloadotp-20e0509d4e04fada3019639bc82d78b89f06b0fc.tar.gz
otp-20e0509d4e04fada3019639bc82d78b89f06b0fc.tar.bz2
otp-20e0509d4e04fada3019639bc82d78b89f06b0fc.zip
erts: Add option to include nifs statically
Both crypto and asn1 are supported.
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 64436e933c..3b4417d10e 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -419,6 +419,11 @@ else
esac
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)
dnl ----------------------------------------------------------------------
dnl Checks for programs.
@@ -457,7 +462,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
@@ -3597,6 +3602,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
@@ -3604,11 +3610,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
@@ -3718,6 +3727,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)