aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/Makefile.in
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-10-22 18:22:23 +0200
committerSverker Eriksson <[email protected]>2012-10-22 18:22:23 +0200
commitb7b4abaeac8e559a3a4f587d46dc0014332b517e (patch)
tree48c5918b1bdc4187ba5aab841cee299f06bd6ebb /lib/crypto/c_src/Makefile.in
parent8d502f8f98a89678448d16a8a15e744d65603f01 (diff)
downloadotp-b7b4abaeac8e559a3a4f587d46dc0014332b517e.tar.gz
otp-b7b4abaeac8e559a3a4f587d46dc0014332b517e.tar.bz2
otp-b7b4abaeac8e559a3a4f587d46dc0014332b517e.zip
crypto: Link crypto_callback statically
if static linking of openssl is used.
Diffstat (limited to 'lib/crypto/c_src/Makefile.in')
-rw-r--r--lib/crypto/c_src/Makefile.in15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in
index f7e2193cec..e19d6617f3 100644
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -59,8 +59,6 @@ TYPE_FLAGS = $(CFLAGS)
endif
endif
-ALL_CFLAGS = $(TYPE_FLAGS) $(INCLUDES)
-
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
@@ -89,11 +87,18 @@ DYNAMIC_CRYPTO_LIB=@SSL_DYNAMIC_ONLY@
ifeq ($(DYNAMIC_CRYPTO_LIB),yes)
SSL_DED_LD_RUNTIME_LIBRARY_PATH = @SSL_DED_LD_RUNTIME_LIBRARY_PATH@
CRYPTO_LINK_LIB=$(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) -l$(SSL_CRYPTO_LIBNAME)
+EXTRA_FLAGS = -DHAVE_DYNAMIC_CRYPTO_LIB
else
SSL_DED_LD_RUNTIME_LIBRARY_PATH=
CRYPTO_LINK_LIB=$(SSL_LIBDIR)/lib$(SSL_CRYPTO_LIBNAME).a
+EXTRA_FLAGS =
+CRYPTO_OBJS := $(CRYPTO_OBJS) $(CALLBACK_OBJS)
+CALLBACK_OBJS =
+CALLBACK_LIB =
endif
+ALL_CFLAGS = $(TYPE_FLAGS) $(EXTRA_FLAGS) $(INCLUDES)
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
@@ -114,6 +119,7 @@ $(LIBDIR)/crypto$(TYPEMARKER).dll: $(CRYPTO_OBJS)
$(INSTALL_DIR) $(LIBDIR)
$(LD) $(LDFLAGS) -o $@ $(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) $(CRYPTO_OBJS) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME)
+ifeq ($(DYNAMIC_CRYPTO_LIB),yes)
$(LIBDIR)/crypto_callback$(TYPEMARKER).so: $(CALLBACK_OBJS)
$(INSTALL_DIR) $(LIBDIR)
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
@@ -121,6 +127,7 @@ $(LIBDIR)/crypto_callback$(TYPEMARKER).so: $(CALLBACK_OBJS)
$(LIBDIR)/crypto_callback$(TYPEMARKER).dll: $(CALLBACK_OBJS)
$(INSTALL_DIR) $(LIBDIR)
$(LD) $(LDFLAGS) -o $@ $(CALLBACK_OBJS)
+endif
clean:
@@ -157,9 +164,11 @@ release_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
$(INSTALL_DATA) $(NIF_MAKEFILE) "$(RELSYSDIR)/priv/obj"
$(INSTALL_PROGRAM) $(CRYPTO_OBJS) "$(RELSYSDIR)/priv/obj"
- $(INSTALL_PROGRAM) $(CALLBACK_OBJS) "$(RELSYSDIR)/priv/obj"
$(INSTALL_PROGRAM) $(NIF_LIB) "$(RELSYSDIR)/priv/lib"
+ifeq ($(DYNAMIC_CRYPTO_LIB),yes)
+ $(INSTALL_PROGRAM) $(CALLBACK_OBJS) "$(RELSYSDIR)/priv/obj"
$(INSTALL_PROGRAM) $(CALLBACK_LIB) "$(RELSYSDIR)/priv/lib"
+endif
release_docs_spec: