From 33ff088a6065cfbafe2f7b870595dc392832cdcb Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sat, 6 Dec 2014 10:21:23 -0600 Subject: [PATCH] simplify packaging for libtls. Derive the file list from the Makefile.am template itself (DRY), ensure manpage is packaged with the final tarball. --- dist.sh | 2 +- tls/Makefile.am.tpl | 11 +++++++++-- update.sh | 15 ++------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/dist.sh b/dist.sh index 6ed275b..5cb08d4 100755 --- a/dist.sh +++ b/dist.sh @@ -3,5 +3,5 @@ set -e rm -f man/*.1 man/*.3 ./autogen.sh -./configure +./configure --enable-libtls make dist diff --git a/tls/Makefile.am.tpl b/tls/Makefile.am.tpl index 7c4bf5c..55461c6 100644 --- a/tls/Makefile.am.tpl +++ b/tls/Makefile.am.tpl @@ -1,10 +1,17 @@ include $(top_srcdir)/Makefile.am.common +if ENABLE_LIBTLS lib_LTLIBRARIES = libtls.la libtls_la_LDFLAGS = -version-info libtls-version libtls_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) -libtls_la_SOURCES = -noinst_HEADERS = +libtls_la_SOURCES = tls.c +libtls_la_SOURCES += tls_client.c +libtls_la_SOURCES += tls_config.c +libtls_la_SOURCES += tls_server.c +libtls_la_SOURCES += tls_util.c +libtls_la_SOURCES += tls_verify.c +noinst_HEADERS = tls_internal.h +endif diff --git a/update.sh b/update.sh index bb651a4..c7eefb9 100755 --- a/update.sh +++ b/update.sh @@ -393,21 +393,10 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am ) rm -f tls/*.c tls/*.h -for i in tls_internal.h tls.c tls_server.c tls_client.c tls_util.c \ - tls_config.c tls_verify.c; do +for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am.tpl` ; do cp $libtls_src/$i tls done -(cd tls - sed -e "s/libtls-version/${libtls_version}/" Makefile.am.tpl > Makefile.am - echo "if ENABLE_LIBTLS" >> Makefile.am - for i in `ls -1 *.c|sort`; do - echo "libtls_la_SOURCES += $i" >> Makefile.am - done - for i in `ls -1 *.h|sort`; do - echo "noinst_HEADERS += $i" >> Makefile.am - done - echo "endif" >> Makefile.am -) +sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am # do not directly compile C files that are included in other C files crypto_excludes=(