From 976f64d932bc5fac8d18dd95feddcfb4f3782551 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sat, 6 Dec 2014 18:59:25 -0600 Subject: [PATCH] read all library versions directly from files This makes building and testing easier because the library Makefile.am files are use directly rather than as templates. Thanks to Wouter Clarie for the idea. --- .gitignore | 7 ++++--- configure.ac | 4 ++++ crypto/{Makefile.am.tpl => Makefile.am} | 4 +++- ssl/{Makefile.am.tpl => Makefile.am} | 3 ++- tls/{Makefile.am.tpl => Makefile.am} | 3 ++- update.sh | 7 +++---- 6 files changed, 18 insertions(+), 10 deletions(-) rename crypto/{Makefile.am.tpl => Makefile.am} (99%) rename ssl/{Makefile.am.tpl => Makefile.am} (95%) rename tls/{Makefile.am.tpl => Makefile.am} (83%) diff --git a/.gitignore b/.gitignore index 02704fe..03ff4da 100644 --- a/.gitignore +++ b/.gitignore @@ -84,12 +84,13 @@ INSTALL /stamp-h1 /stamp-h2 -crypto/Makefile.am include/openssl/Makefile.am -ssl/Makefile.am -tls/Makefile.am tests/Makefile.am +crypto/VERSION +ssl/VERSION +tls/VERSION + ssl/*.c ssl/*.h tls/*.c diff --git a/configure.ac b/configure.ac index 491e4b8..2cc7477 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,8 @@ AC_INIT([libressl], m4_esyscmd([tr -d '\n' < VERSION])) +AC_SUBST([LIBCRYPTO_VERSION], m4_esyscmd([tr -d '\n' < crypto/VERSION])) +AC_SUBST([LIBSSL_VERSION], m4_esyscmd([tr -d '\n' < ssl/VERSION])) +AC_SUBST([LIBTLS_VERSION], m4_esyscmd([tr -d '\n' < tls/VERSION])) + AC_CANONICAL_HOST AM_INIT_AUTOMAKE([subdir-objects]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/crypto/Makefile.am.tpl b/crypto/Makefile.am similarity index 99% rename from crypto/Makefile.am.tpl rename to crypto/Makefile.am index 07a4fc6..39b143d 100644 --- a/crypto/Makefile.am.tpl +++ b/crypto/Makefile.am @@ -6,8 +6,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes lib_LTLIBRARIES = libcrypto.la +EXTRA_DIST = VERSION + +libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la -libcrypto_la_LDFLAGS = -version-info libcrypto-version libcrypto_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) -DOPENSSL_NO_HW_PADLOCK noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la diff --git a/ssl/Makefile.am.tpl b/ssl/Makefile.am similarity index 95% rename from ssl/Makefile.am.tpl rename to ssl/Makefile.am index c8f72d1..52a29b8 100644 --- a/ssl/Makefile.am.tpl +++ b/ssl/Makefile.am @@ -2,8 +2,9 @@ include $(top_srcdir)/Makefile.am.common lib_LTLIBRARIES = libssl.la -libssl_la_LDFLAGS = -version-info libssl-version +EXTRA_DIST = VERSION +libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ libssl_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) libssl_la_SOURCES = bio_ssl.c diff --git a/tls/Makefile.am.tpl b/tls/Makefile.am similarity index 83% rename from tls/Makefile.am.tpl rename to tls/Makefile.am index 55461c6..7f65ea5 100644 --- a/tls/Makefile.am.tpl +++ b/tls/Makefile.am @@ -3,8 +3,9 @@ include $(top_srcdir)/Makefile.am.common if ENABLE_LIBTLS lib_LTLIBRARIES = libtls.la -libtls_la_LDFLAGS = -version-info libtls-version +EXTRA_DIST = VERSION +libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ libtls_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) libtls_la_SOURCES = tls.c diff --git a/update.sh b/update.sh index a4a938d..47e2e22 100755 --- a/update.sh +++ b/update.sh @@ -31,14 +31,17 @@ openssl_app_src=$dir/openbsd/src/usr.bin/openssl source $libcrypto_src/crypto/shlib_version libcrypto_version=$major:$minor:0 echo "libcrypto version $libcrypto_version" +echo $libcrypto_version > crypto/VERSION source $libssl_src/ssl/shlib_version libssl_version=$major:$minor:0 echo "libssl version $libssl_version" +echo $libssl_version > ssl/VERSION source $libtls_src/shlib_version libtls_version=$major:$minor:0 echo "libtls version $libtls_version" +echo $libtls_version > tls/VERSION CP='cp -p' @@ -91,8 +94,6 @@ copy_hdrs ssl "srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h" # copy libcrypto source rm -f crypto/*.c crypto/*.h -sed -e "s/libcrypto-version/${libcrypto_version}/" \ - crypto/Makefile.am.tpl > crypto/Makefile.am for i in `awk '/SOURCES|HEADERS/ { print $3 }' crypto/Makefile.am` ; do dir=`dirname $i` mkdir -p crypto/$dir @@ -107,7 +108,6 @@ $CP crypto/compat/ui_openssl_win.c crypto/ui # copy libtls source rm -f tls/*.c tls/*.h -sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do cp $libtls_src/$i tls done @@ -123,7 +123,6 @@ done # copy libssl source rm -f ssl/*.c ssl/*.h -sed -e "s/libssl-version/${libssl_version}/" ssl/Makefile.am.tpl > ssl/Makefile.am for i in `awk '/SOURCES|HEADERS/ { print $3 }' ssl/Makefile.am` ; do cp $libssl_src/src/ssl/$i ssl done