Link crypto and ssl object files directly instead of static library

- Output object files list variable for libcrypto and libssl to .mk file.
- Include object files list variable .mk from tls/Makefile
- Link .lo files directly instead of static library for libtls.
This commit is contained in:
kinichiro 2020-09-20 13:37:52 +09:00 committed by Brent Cook
parent fe42a8011b
commit 5a29b0472d
4 changed files with 31 additions and 4 deletions

View File

@ -12,7 +12,7 @@ endif
EXTRA_DIST = nc.1
EXTRA_DIST += CMakeLists.txt
nc_LDFLAGS = $(abs_top_builddir)/crypto/.libs/libcompat.a
nc_LDFLAGS = $(abs_top_builddir)/crypto/.libs/libcrypto.a
nc_LDADD = $(abs_top_builddir)/tls/libtls.la
nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)

View File

@ -20,6 +20,7 @@ EXTRA_DIST += compat/strcasecmp.c
BUILT_SOURCES = crypto_portable.sym
CLEANFILES = crypto_portable.sym
CLEANFILES += libcrypto_la_objects.mk
crypto_portable.sym: crypto.sym Makefile
-echo "generating crypto_portable.sym ..."
@ -93,8 +94,20 @@ if HOST_WIN
-mv crypto_portable.sym.tmp crypto_portable.sym
endif
libcrypto_la_objects.mk: Makefile
@echo "libcrypto_la_objects= $(libcrypto_la_OBJECTS)" \
| sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \
> libcrypto_la_objects.mk
@echo "libcompat_la_objects= $(libcompat_la_OBJECTS)" \
| sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \
>> libcrypto_la_objects.mk
@echo "libcompatnoopt_la_objects= $(libcompatnoopt_la_OBJECTS)" \
| sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \
>> libcrypto_la_objects.mk
libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym
EXTRA_libcrypto_la_DEPENDENCIES = crypto_portable.sym
EXTRA_libcrypto_la_DEPENDENCIES += libcrypto_la_objects.mk
libcrypto_la_LIBADD = libcompat.la
if !HAVE_EXPLICIT_BZERO
libcrypto_la_LIBADD += libcompatnoopt.la

View File

@ -6,6 +6,15 @@ EXTRA_DIST = VERSION
EXTRA_DIST += CMakeLists.txt
EXTRA_DIST += ssl.sym
CLEANFILES = libssl_la_objects.mk
EXTRA_libssl_la_DEPENDENCIES = libssl_la_objects.mk
libssl_la_objects.mk: Makefile
@echo "libssl_la_objects= $(libssl_la_OBJECTS)" \
| sed 's/ */ $$\(abs_top_builddir\)\/ssl\//g' \
> libssl_la_objects.mk
libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined -export-symbols $(top_srcdir)/ssl/ssl.sym
libssl_la_LIBADD = $(abs_top_builddir)/crypto/libcrypto.la $(PLATFORM_LDADD)

View File

@ -1,5 +1,8 @@
include $(top_srcdir)/Makefile.am.common
-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
-include $(abs_top_builddir)/ssl/libssl_la_objects.mk
lib_LTLIBRARIES = libtls.la
EXTRA_DIST = VERSION
@ -7,9 +10,11 @@ EXTRA_DIST += CMakeLists.txt
EXTRA_DIST += tls.sym
libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym
libtls_la_LDFLAGS += $(abs_top_builddir)/ssl/.libs/libssl.a
libtls_la_LDFLAGS += $(abs_top_builddir)/crypto/.libs/libcrypto.a
libtls_la_LIBADD = $(PLATFORM_LDADD)
libtls_la_LIBADD = $(libcrypto_la_objects)
libtls_la_LIBADD += $(libcompat_la_objects)
libtls_la_LIBADD += $(libcompatnoopt_la_objects)
libtls_la_LIBADD += $(libssl_la_objects)
libtls_la_LIBADD += $(PLATFORM_LDADD)
libtls_la_CPPFLAGS = $(AM_CPPFLAGS)
if OPENSSLDIR_DEFINED