Use LINK_LIBRARY in cryptest-symbols.sh script (GH #866)

pull/867/head
Jeffrey Walton 2019-07-21 03:16:01 -04:00
parent dfaf2fc453
commit ed7f4a0493
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 18 additions and 34 deletions

View File

@ -18,7 +18,7 @@ fi
PWD_DIR=$(pwd) PWD_DIR=$(pwd)
function cleanup { function cleanup {
rm -f adhoc.cpp *.a *.o *.so *.dylib GNUmakefile-symbols rm -f adhoc.cpp *.a *.o *.so *.dylib
cd "$PWD_DIR" cd "$PWD_DIR"
} }
trap cleanup EXIT trap cleanup EXIT
@ -26,7 +26,7 @@ trap cleanup EXIT
############################################ ############################################
# Tags to test # Tags to test
OLD_VERSION_TAG=CRYPTOPP_8_3_0 OLD_VERSION_TAG=CRYPTOPP_8_2_0
NEW_VERSION_TAG=master NEW_VERSION_TAG=master
############################################ ############################################
@ -40,7 +40,7 @@ if [[ ! (-z "$DIRTY") ]]; then
read -p "Type 'Y' to proceed or 'N' to exit. Proceed? " -n 1 -r read -p "Type 'Y' to proceed or 'N' to exit. Proceed? " -n 1 -r
echo # (optional) move to a new line echo # (optional) move to a new line
if [[ !($REPLY =~ ^[Yy]$) ]]; then if [[ !($REPLY =~ ^[Yy]$) ]]; then
[[ "$0" = "$BASH_SOURCE" ]] && exit 0 || return 0 exit 0
fi fi
else else
echo echo
@ -222,29 +222,13 @@ fi
"$MAKE" distclean &>/dev/null "$MAKE" distclean &>/dev/null
rm -f GNUmakefile-symbols
git checkout master -f &>/dev/null git checkout master -f &>/dev/null
cp GNUmakefile GNUmakefile-symbols
git checkout "$OLD_VERSION_TAG" -f &>/dev/null git checkout "$OLD_VERSION_TAG" -f &>/dev/null
if [[ "$?" -ne "0" ]]; then if [[ "$?" -ne "0" ]]; then
echo "Failed to checkout $OLD_VERSION_TAG" echo "Failed to checkout $OLD_VERSION_TAG"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 exit 1
fi
echo
echo "****************************************************************"
echo "Patching makefile for dynamic linking by cryptest.exe"
echo "****************************************************************"
if [[ "$IS_DARWIN" -ne "0" ]]; then
"$SED" "$SED_OPTS" -e 's|libcryptopp.a $(TESTOBJS)|libcryptopp.dylib $(TESTOBJS)|g' GNUmakefile-symbols
"$SED" "$SED_OPTS" -e 's|$(TESTOBJS) ./libcryptopp.a |$(TESTOBJS) ./libcryptopp.dylib |g' GNUmakefile-symbols
else
"$SED" "$SED_OPTS" -e 's|libcryptopp.a $(TESTOBJS)|libcryptopp.so $(TESTOBJS)|g' GNUmakefile-symbols
"$SED" "$SED_OPTS" -e 's|$(TESTOBJS) ./libcryptopp.a |$(TESTOBJS) ./libcryptopp.so |g' GNUmakefile-symbols
fi fi
echo echo
@ -253,17 +237,17 @@ echo "Building dynamic library for $OLD_VERSION_TAG"
echo "****************************************************************" echo "****************************************************************"
echo echo
"$MAKE" "${MAKEARGS[@]}" -f GNUmakefile-symbols dynamic
if [[ "$IS_DARWIN" -ne "0" ]]; then if [[ "$IS_DARWIN" -ne "0" ]]; then
LIBNAME=libcryptopp.dylib LINK_LIBRARY=libcryptopp.dylib
else else
LIBNAME=libcryptopp.so LINK_LIBRARY=libcryptopp.so
fi fi
if [[ ! -f "$LIBNAME" ]]; then LINK_LIBRARY="$LINK_LIBRARY" "$MAKE" "${MAKEARGS[@]}" -f GNUmakefile dynamic
if [[ ! -f "$LINK_LIBRARY" ]]; then
echo "Failed to make $OLD_VERSION_TAG library" echo "Failed to make $OLD_VERSION_TAG library"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 exit 1
fi fi
echo echo
@ -272,11 +256,11 @@ echo "Building cryptest.exe for $OLD_VERSION_TAG"
echo "****************************************************************" echo "****************************************************************"
echo echo
"$MAKE" "${MAKEARGS[@]}" -f GNUmakefile-symbols cryptest.exe "$MAKE" "${MAKEARGS[@]}" -f GNUmakefile cryptest.exe
if [[ ! -f "cryptest.exe" ]]; then if [[ ! -f "cryptest.exe" ]]; then
echo "Failed to make cryptest.exe" echo "Failed to make cryptest.exe"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 exit 1
fi fi
echo echo
@ -304,7 +288,7 @@ git checkout "$NEW_VERSION_TAG" -f &>/dev/null
if [[ "$?" -ne "0" ]]; then if [[ "$?" -ne "0" ]]; then
echo "Failed to checkout $OLD_VERSION_TAG" echo "Failed to checkout $OLD_VERSION_TAG"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 exit 1
fi fi
echo echo
@ -313,11 +297,11 @@ echo "Building dynamic library for $NEW_VERSION_TAG"
echo "****************************************************************" echo "****************************************************************"
echo echo
"$MAKE" "${MAKEARGS[@]}" -f GNUmakefile-symbols dynamic LINK_LIBRARY="$LINK_LIBRARY" "$MAKE" "${MAKEARGS[@]}" -f GNUmakefile dynamic
if [[ ! -f "$LIBNAME" ]]; then if [[ ! -f "$LINK_LIBRARY" ]]; then
echo "Failed to make $NEW_VERSION_TAG library" echo "Failed to make $NEW_VERSION_TAG library"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 exit 1
fi fi
echo echo
@ -338,7 +322,7 @@ git checkout master -f &>/dev/null
if [[ "$?" -ne "0" ]]; then if [[ "$?" -ne "0" ]]; then
echo "Failed to checkout Master" echo "Failed to checkout Master"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 exit 1
fi fi
[[ "$0" = "$BASH_SOURCE" ]] && exit 0 || return 0 exit 0