aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2020-08-20 09:30:21 -0500
committerBrent Cook <busterb@gmail.com>2020-10-04 03:50:18 -0500
commitfe42a8011b25797afa48cf0359c7e2753b2ece5f (patch)
tree71b7ae8e5f29f90bbd7b24ac6bab81f4990b555a
parent17c88164016df821df2dff4b2b1291291ec4f28a (diff)
downloadportable-fe42a8011b25797afa48cf0359c7e2753b2ece5f.tar.gz
portable-fe42a8011b25797afa48cf0359c7e2753b2ece5f.tar.bz2
portable-fe42a8011b25797afa48cf0359c7e2753b2ece5f.zip
Configure libtls and nc(1) to statically link to libcrypto/ssl
An issue that Reyk Floeter noted while building a Debian package for LibreSSL is that installing libtls along with OpenSSL causes linker issues since it will often pick up the wrong libcrypto/libssl. This change makes libtls statically link the object files it needs rather than relying on the shared libraries, effectively making libtls self-contained and able to be packaged independently. This should make it possible for other projects that also use libtls to be able to package support without requiring the target OS to ship libcrypto / libssl from LibreSSL. https://salsa.debian.org/reyk-guest/libressl/-/commit/678278df55ce866f2f363998ca690442fa786c66
-rw-r--r--apps/nc/Makefile.am6
-rw-r--r--configure.ac3
-rw-r--r--libtls.pc.in3
-rw-r--r--tls/Makefile.am6
4 files changed, 8 insertions, 10 deletions
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am
index 4b5b561..135ff4b 100644
--- a/apps/nc/Makefile.am
+++ b/apps/nc/Makefile.am
@@ -12,9 +12,9 @@ endif
12EXTRA_DIST = nc.1 12EXTRA_DIST = nc.1
13EXTRA_DIST += CMakeLists.txt 13EXTRA_DIST += CMakeLists.txt
14 14
15nc_LDADD = $(abs_top_builddir)/crypto/libcrypto.la 15nc_LDFLAGS = $(abs_top_builddir)/crypto/.libs/libcompat.a
16nc_LDADD += $(abs_top_builddir)/ssl/libssl.la 16
17nc_LDADD += $(abs_top_builddir)/tls/libtls.la 17nc_LDADD = $(abs_top_builddir)/tls/libtls.la
18nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD) 18nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)
19 19
20AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat 20AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat
diff --git a/configure.ac b/configure.ac
index 75b88fe..3aca617 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,8 +29,7 @@ USER_CFLAGS="$CFLAGS"
29AC_PROG_CC([cc gcc]) 29AC_PROG_CC([cc gcc])
30AC_PROG_CC_STDC 30AC_PROG_CC_STDC
31AM_PROG_CC_C_O 31AM_PROG_CC_C_O
32AC_PROG_LIBTOOL 32LT_INIT([pic-only])
33LT_INIT
34 33
35CHECK_OS_OPTIONS 34CHECK_OS_OPTIONS
36 35
diff --git a/libtls.pc.in b/libtls.pc.in
index 82a6a71..0d4e625 100644
--- a/libtls.pc.in
+++ b/libtls.pc.in
@@ -9,8 +9,7 @@ Name: LibreSSL-libtls
9Description: Secure communications using the TLS socket protocol. 9Description: Secure communications using the TLS socket protocol.
10Version: @VERSION@ 10Version: @VERSION@
11Requires: 11Requires:
12Requires.private: libcrypto libssl
13Conflicts: 12Conflicts:
14Libs: -L${libdir} -ltls 13Libs: -L${libdir} -ltls
15Libs.private: @LIBS@ -lcrypto -lssl @PLATFORM_LDADD@ 14Libs.private: @LIBS@ @PLATFORM_LDADD@
16Cflags: -I${includedir} 15Cflags: -I${includedir}
diff --git a/tls/Makefile.am b/tls/Makefile.am
index 942abf9..c4790a4 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -7,9 +7,9 @@ EXTRA_DIST += CMakeLists.txt
7EXTRA_DIST += tls.sym 7EXTRA_DIST += tls.sym
8 8
9libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym 9libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym
10libtls_la_LIBADD = $(abs_top_builddir)/ssl/libssl.la 10libtls_la_LDFLAGS += $(abs_top_builddir)/ssl/.libs/libssl.a
11libtls_la_LIBADD += $(abs_top_builddir)/crypto/libcrypto.la 11libtls_la_LDFLAGS += $(abs_top_builddir)/crypto/.libs/libcrypto.a
12libtls_la_LIBADD += $(PLATFORM_LDADD) 12libtls_la_LIBADD = $(PLATFORM_LDADD)
13 13
14libtls_la_CPPFLAGS = $(AM_CPPFLAGS) 14libtls_la_CPPFLAGS = $(AM_CPPFLAGS)
15if OPENSSLDIR_DEFINED 15if OPENSSLDIR_DEFINED