]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Build all shared libraries with -no-undefined and link them properly
authorTobias Brunner <tobias@strongswan.org>
Wed, 4 Sep 2013 12:25:22 +0000 (14:25 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 11 Sep 2013 23:44:49 +0000 (01:44 +0200)
The flag is required to convince libtool on Cygwin to build DLLs. But on
Windows these shared libraries can not have undefined symbols, so we have to
link them explicitly to the libraries they reference.

For plugins this is currently not done, so only the monolithic build is
supported.  The plugin loader wouldn't be able to load DLLs anyway, as
it tries to load files that don't exist on Cygwin.

12 files changed:
src/libcharon/Makefile.am
src/libfast/Makefile.am
src/libhydra/Makefile.am
src/libimcv/Makefile.am
src/libipsec/Makefile.am
src/libpts/Makefile.am
src/libpttls/Makefile.am
src/libradius/Makefile.am
src/libsimaka/Makefile.am
src/libstrongswan/Makefile.am
src/libtls/Makefile.am
src/libtnccs/Makefile.am

index 9c7f67690fd858b2aafcc7ae924e1c8706d8d3ab..5ee047b9c7d24c4b14051f32964ad8c01d251ca9 100644 (file)
@@ -136,7 +136,13 @@ AM_CPPFLAGS = \
        -DIPSEC_DIR=\"${ipsecdir}\" \
        -DIPSEC_PIDDIR=\"${piddir}\"
 
-libcharon_la_LIBADD = -lm $(PTHREADLIB) $(DLLIB) $(SOCKLIB)
+AM_LDFLAGS = \
+  -no-undefined
+
+libcharon_la_LIBADD = \
+  $(top_builddir)/src/libstrongswan/libstrongswan.la \
+  $(top_builddir)/src/libhydra/libhydra.la \
+  -lm $(PTHREADLIB) $(DLLIB) $(SOCKLIB)
 
 EXTRA_DIST = Android.mk
 
index edc2ab1cab3f5a177f2e59689c70507832838d51..41a489b3d0bb51dd67603b331726343f121cf96f 100644 (file)
@@ -5,6 +5,9 @@ AM_CPPFLAGS = \
 AM_CFLAGS = \
        -rdynamic
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libfast.la
 
 libfast_la_SOURCES = \
@@ -17,5 +20,6 @@ nobase_fast_include_HEADERS = \
        fast_request.h fast_session.h fast_smtp.h
 endif
 
-libfast_la_LIBADD = $(top_builddir)/src/libstrongswan/libstrongswan.la \
-  -lfcgi $(clearsilver_LIBS) $(PTHREADLIB)
+libfast_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       -lfcgi $(clearsilver_LIBS) $(PTHREADLIB)
index a2a164bd99facf30307e72237606b95c7dc42c2d..f7ae37f982098781b5b43ad9247bf22cc860d8f9 100644 (file)
@@ -11,7 +11,8 @@ kernel/kernel_ipsec.c kernel/kernel_ipsec.h \
 kernel/kernel_net.c kernel/kernel_net.h \
 kernel/kernel_listener.h
 
-libhydra_la_LIBADD =
+libhydra_la_LIBADD = \
+  $(top_builddir)/src/libstrongswan/libstrongswan.la
 
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan \
@@ -19,6 +20,9 @@ AM_CPPFLAGS = \
        -DPLUGINDIR=\"${plugindir}\" \
        -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
 
+AM_LDFLAGS = \
+  -no-undefined
+
 EXTRA_DIST = Android.mk
 
 # build optional plugins
index e1e6541aa2d38ab0bf21946705226f1141c8038c..86f172dd8f6156ba4d2fdaee9bf13f3c4cdedf52 100644 (file)
@@ -4,7 +4,12 @@ AM_CPPFLAGS = \
 
 ipseclib_LTLIBRARIES = libimcv.la
 
-libimcv_la_LIBADD = $(top_builddir)/src/libtncif/libtncif.la
+libimcv_la_LDFLAGS = \
+       -no-undefined
+
+libimcv_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libtncif/libtncif.la
 
 libimcv_la_SOURCES = \
        imcv.h imcv.c \
index 74379f1d5095f46c58bda00ec4fc186da69ad498..41f5ae9378e76a0854dbed101387131bed3b7ebd 100644 (file)
@@ -13,11 +13,15 @@ ipsec_processor.c ipsec_processor.h \
 ipsec_sa.c ipsec_sa.h \
 ipsec_sa_mgr.c ipsec_sa_mgr.h
 
-libipsec_la_LIBADD =
+libipsec_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la
 
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan
 
+AM_LDFLAGS = \
+       -no-undefined
+
 EXTRA_DIST = Android.mk
 
 # build optional plugins
index 2c02fd18ac4554687124b94efdd062fcbebbc0f8..48bb46c7a704cdaca671cbd75dc5098bc67b7fc3 100644 (file)
@@ -3,9 +3,15 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libtncif \
        -I$(top_srcdir)/src/libimcv
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libpts.la
 
-libpts_la_LIBADD = $(top_builddir)/src/libimcv/libimcv.la
+libpts_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libtncif/libtncif.la \
+       $(top_builddir)/src/libimcv/libimcv.la
 
 if USE_TROUSERS
   libpts_la_LIBADD += -ltspi
index 225d0e48f3f085a851b97d9ff58f424100c54399..f2bcf44d562d7abab92cca0078629df8d2bc3c35 100644 (file)
@@ -4,8 +4,15 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libtncif \
        -I$(top_srcdir)/src/libtnccs
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libpttls.la
-libpttls_la_LIBADD = $(top_builddir)/src/libtls/libtls.la
+
+libpttls_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libtls/libtls.la
+
 libpttls_la_SOURCES = pt_tls.c pt_tls.h \
        pt_tls_client.c pt_tls_client.h \
        pt_tls_server.c pt_tls_server.h \
index 91ded23e3a5945f646aa885b837bd9985a5f17a1..4706f270d250d55bba52c962cd6dffdcb3bf1d8d 100644 (file)
@@ -1,7 +1,14 @@
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libradius.la
+
+libradius_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la
+
 libradius_la_SOURCES = \
        radius_message.h radius_message.c \
        radius_socket.h radius_socket.c \
index 8aaac7de0f08e4c6a7a6901229731330985f9566..6878133f30cc993b93f3a20e7c6ec88da29a03e3 100644 (file)
@@ -3,7 +3,14 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libhydra \
        -I$(top_srcdir)/src/libcharon
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libsimaka.la
+
+libsimaka_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la
+
 libsimaka_la_SOURCES = simaka_message.h simaka_message.c \
   simaka_crypto.h simaka_crypto.c simaka_manager.h simaka_manager.c \
   simaka_card.h simaka_provider.h simaka_hooks.h
index dfe6e7e000e76531e57b6349785839c18237aedb..78e4ce2e1b7daab57bae4cb7043ead48b9d658a8 100644 (file)
@@ -95,6 +95,9 @@ AM_CPPFLAGS = \
 AM_CFLAGS = \
        @COVERAGE_CFLAGS@
 
+AM_LDFLAGS = \
+       -no-undefined
+
 if USE_LEAK_DETECTIVE
   AM_CPPFLAGS += -DLEAK_DETECTIVE
   libstrongswan_la_SOURCES += utils/leak_detective.c
index 9e3712abe6dfd9b4c0e64dda24b2c17647f20039..b83ea8ebaa747c59d7b33677874e32a9264d22ce 100644 (file)
@@ -1,12 +1,18 @@
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libtls.la
 libtls_la_SOURCES = \
        tls_protection.c tls_compression.c tls_fragmentation.c tls_alert.c \
        tls_crypto.c tls_prf.c tls_socket.c tls_eap.c tls_cache.c tls_peer.c \
        tls_server.c tls.c
 
+libtls_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la
+
 if USE_DEV_HEADERS
 tls_includedir = ${dev_headers}/tls
 nobase_tls_include_HEADERS = \
index d1f8825dee22461ca2fdeb83f0ea1a1e6dfb6cc8..22a3b93b0254f2766e0caabaa82daf535679f408 100644 (file)
@@ -3,9 +3,14 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libtncif \
        -I$(top_srcdir)/src/libtls
 
+AM_LDFLAGS = \
+       -no-undefined
+
 ipseclib_LTLIBRARIES = libtnccs.la
 
-libtnccs_la_LIBADD = $(top_builddir)/src/libtncif/libtncif.la
+libtnccs_la_LIBADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libtncif/libtncif.la
 
 libtnccs_la_SOURCES = \
 tnc/tnc.h tnc/tnc.c \