Update Automake and CMake test scripts

This commit is contained in:
Jeffrey Walton 2019-10-14 22:20:47 -04:00
parent 6b1fec4c14
commit b046313841
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 33 additions and 38 deletions

View File

@ -50,23 +50,15 @@ fi
#############################################################################
echo "Downloading configure.ac"
if ! wget -O configure.ac -q --no-check-certificate 'https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/configure.ac'; then
echo "configure.ac download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
files=(configure.ac Makefile.am libcryptopp.pc.in)
echo "Downloading Makefile.am"
if ! wget -O Makefile.am -q --no-check-certificate 'https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/Makefile.am'; then
echo "Makefile.am download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
echo "Downloading libcryptopp.pc.in"
if ! wget -O libcryptopp.pc.in -q --no-check-certificate 'https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/libcryptopp.pc.in'; then
echo "libcryptopp.pc.in download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
for file in "${files[@]}"; do
echo "Downloading $file"
if ! wget -O "$file" -q --no-check-certificate "https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/$file"; then
echo "$file download failed"
exit 1
fi
done
mkdir -p m4/
@ -91,13 +83,13 @@ fi
echo "Running autoupdate"
if ! autoupdate &>/dev/null; then
echo "autoupdate failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
echo "Running libtoolize"
if ! "$LIBTOOLIZE" --force --install &>/dev/null; then
echo "libtoolize failed... skipping."
# [[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
# exit 1
fi
# Run autoreconf twice on failure. Also see
@ -107,7 +99,7 @@ if ! autoreconf --force --install &>/dev/null; then
echo "autoreconf failed, running again."
if ! autoreconf --force --install; then
echo "autoreconf failed, again."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
fi
@ -147,7 +139,7 @@ echo ""
if ! ./configure; then
echo "configure failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
"$MAKE" clean 2>/dev/null
@ -156,17 +148,17 @@ fi
if ! "$MAKE" -j2 -f Makefile; then
echo "make failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
if ! ./cryptest v; then
echo "cryptest v failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
if ! ./cryptest tv all; then
echo "cryptest tv all failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
# Return success

View File

@ -24,31 +24,34 @@ if [[ -z "$CMAKE" ]]; then
CMAKE=cmake
fi
# Feth the three required files
if ! wget --no-check-certificate https://raw.githubusercontent.com/noloader/cryptopp-cmake/master/CMakeLists.txt -O CMakeLists.txt; then
echo "CMakeLists.txt download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
#############################################################################
if ! wget --no-check-certificate https://github.com/noloader/cryptopp-cmake/blob/master/cryptopp-config.cmake -O cryptopp-config.cmake; then
echo "cryptopp-config.cmake download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
files=(CMakeLists.txt cryptopp-config.cmake)
for file in "${files[@]}"; do
echo "Downloading $file"
if ! wget -O "$file" -q --no-check-certificate "https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/$file"; then
echo "$file download failed"
exit 1
fi
done
rm -rf "$PWD_DIR/cmake_build"
mkdir -p "$PWD_DIR/cmake_build"
cd "$PWD_DIR/cmake_build"
#############################################################################
if [[ ! -z "$CXX" ]];
then
if ! CXX="$CXX" "$CMAKE" -DCMAKE_CXX_COMPILER="$CXX" ../; then
echo "cmake failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
else
if ! "$CMAKE" ../; then
echo "cmake failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
fi
@ -56,18 +59,18 @@ fi
if ! "$MAKE" -j2 -f Makefile VERBOSE=1; then
echo "make failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
if ! ./cryptest.exe v; then
echo "cryptest.exe v failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
if ! ./cryptest.exe tv all; then
echo "cryptest.exe v failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
exit 1
fi
# Return success
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0
exit 0