mirror of https://github.com/wolfSSL/wolfssl.git
Clean up the 'async-check.sh' script
Far too many times I got burned by passing the wrong argument and things getting set up wrong.pull/6764/head
parent
f8f66191e3
commit
f9e5e4d08a
|
@ -407,7 +407,7 @@ libFuzzer
|
||||||
XXX-fips-test
|
XXX-fips-test
|
||||||
|
|
||||||
# ASYNC
|
# ASYNC
|
||||||
async
|
/wolfAsyncCrypt
|
||||||
|
|
||||||
# Generated user_settings_asm.h.
|
# Generated user_settings_asm.h.
|
||||||
user_settings_asm.h
|
user_settings_asm.h
|
||||||
|
|
117
async-check.sh
117
async-check.sh
|
@ -13,22 +13,21 @@
|
||||||
# or make
|
# or make
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Fail on any error in script
|
||||||
|
set -e
|
||||||
|
|
||||||
ASYNC_REPO=https://github.com/wolfSSL/wolfAsyncCrypt.git
|
ASYNC_REPO=https://github.com/wolfSSL/wolfAsyncCrypt.git
|
||||||
|
ASYNC_DIR=${ASYNC_DIR:-wolfAsyncCrypt}
|
||||||
|
|
||||||
function Usage() {
|
function Usage() {
|
||||||
printf '\n%s\n\n' "Usage: $0 [keep|clean|setup]"
|
printf "Usage: $0 [install|uninstall|test|remove]\n"
|
||||||
printf '%s\n' "Where \"keep\" means keep (default off) async files around for inspection"
|
printf "\tinstall - get and set up links to wolfAsyncCrypt files\n"
|
||||||
printf '%s\n' "Where \"clean\" means only clean (default off) the async files"
|
printf "\tuninstall - remove the links to wolfAsyncCrypt\n"
|
||||||
printf '%s\n\n' "Where \"setup\" means only setup (default off) the async files"
|
printf "\ttest - install and run 'make check'\n"
|
||||||
printf '%s\n' "EXAMPLE:"
|
printf "\tremove - uninstall and remove wolfAsyncCrypt\n"
|
||||||
printf '%s\n' "---------------------------------"
|
|
||||||
printf '%s\n' "./async-check.sh keep"
|
|
||||||
printf '%s\n' "./async-check.sh clean"
|
|
||||||
printf '%s\n' "./async-check.sh setup"
|
|
||||||
printf '%s\n\n' "---------------------------------"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function CleanUp() {
|
function UnlinkFiles() {
|
||||||
unlink ./wolfcrypt/src/async.c
|
unlink ./wolfcrypt/src/async.c
|
||||||
unlink ./wolfssl/wolfcrypt/async.h
|
unlink ./wolfssl/wolfcrypt/async.h
|
||||||
unlink ./wolfcrypt/src/port/intel/quickassist.c
|
unlink ./wolfcrypt/src/port/intel/quickassist.c
|
||||||
|
@ -40,8 +39,6 @@ function CleanUp() {
|
||||||
unlink ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
|
unlink ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
|
||||||
unlink ./wolfcrypt/src/port/cavium/README.md
|
unlink ./wolfcrypt/src/port/cavium/README.md
|
||||||
|
|
||||||
rm -rf ./async
|
|
||||||
|
|
||||||
# restore original README.md files
|
# restore original README.md files
|
||||||
git checkout -- wolfcrypt/src/port/cavium/README.md
|
git checkout -- wolfcrypt/src/port/cavium/README.md
|
||||||
git checkout -- wolfcrypt/src/port/intel/README.md
|
git checkout -- wolfcrypt/src/port/intel/README.md
|
||||||
|
@ -49,16 +46,46 @@ function CleanUp() {
|
||||||
|
|
||||||
function LinkFiles() {
|
function LinkFiles() {
|
||||||
# link files
|
# link files
|
||||||
ln -s -f ../../async/wolfcrypt/src/async.c ./wolfcrypt/src/async.c
|
ln -s -f ../../${ASYNC_DIR}/wolfcrypt/src/async.c ./wolfcrypt/src/async.c
|
||||||
ln -s -f ../../async/wolfssl/wolfcrypt/async.h ./wolfssl/wolfcrypt/async.h
|
ln -s -f ../../${ASYNC_DIR}/wolfssl/wolfcrypt/async.h ./wolfssl/wolfcrypt/async.h
|
||||||
ln -s -f ../../../../async/wolfcrypt/src/port/intel/quickassist.c ./wolfcrypt/src/port/intel/quickassist.c
|
ln -s -f ../../../../${ASYNC_DIR}/wolfcrypt/src/port/intel/quickassist.c ./wolfcrypt/src/port/intel/quickassist.c
|
||||||
ln -s -f ../../../../async/wolfcrypt/src/port/intel/quickassist_mem.c ./wolfcrypt/src/port/intel/quickassist_mem.c
|
ln -s -f ../../../../${ASYNC_DIR}/wolfcrypt/src/port/intel/quickassist_mem.c ./wolfcrypt/src/port/intel/quickassist_mem.c
|
||||||
ln -s -f ../../../../async/wolfcrypt/src/port/intel/README.md ./wolfcrypt/src/port/intel/README.md
|
ln -s -f ../../../../${ASYNC_DIR}/wolfcrypt/src/port/intel/README.md ./wolfcrypt/src/port/intel/README.md
|
||||||
ln -s -f ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist.h ./wolfssl/wolfcrypt/port/intel/quickassist.h
|
ln -s -f ../../../../${ASYNC_DIR}/wolfssl/wolfcrypt/port/intel/quickassist.h ./wolfssl/wolfcrypt/port/intel/quickassist.h
|
||||||
ln -s -f ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist_mem.h ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h
|
ln -s -f ../../../../${ASYNC_DIR}/wolfssl/wolfcrypt/port/intel/quickassist_mem.h ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h
|
||||||
ln -s -f ../../../../async/wolfcrypt/src/port/cavium/cavium_nitrox.c ./wolfcrypt/src/port/cavium/cavium_nitrox.c
|
ln -s -f ../../../../${ASYNC_DIR}/wolfcrypt/src/port/cavium/cavium_nitrox.c ./wolfcrypt/src/port/cavium/cavium_nitrox.c
|
||||||
ln -s -f ../../../../async/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
|
ln -s -f ../../../../${ASYNC_DIR}/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
|
||||||
ln -s -f ../../../../async/wolfcrypt/src/port/cavium/README.md ./wolfcrypt/src/port/cavium/README.md
|
ln -s -f ../../../../${ASYNC_DIR}/wolfcrypt/src/port/cavium/README.md ./wolfcrypt/src/port/cavium/README.md
|
||||||
|
}
|
||||||
|
|
||||||
|
function Install() {
|
||||||
|
if [ -d $ASYNC_DIR ];
|
||||||
|
then
|
||||||
|
echo "Using existing async repo"
|
||||||
|
else
|
||||||
|
# make a clone of the wolfAsyncCrypt repository
|
||||||
|
git clone --depth 1 $ASYNC_REPO $ASYNC_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
# setup auto-conf
|
||||||
|
./autogen.sh
|
||||||
|
LinkFiles
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uninstall() {
|
||||||
|
UnlinkFiles
|
||||||
|
}
|
||||||
|
|
||||||
|
function Test() {
|
||||||
|
Install
|
||||||
|
./configure --enable-asynccrypt --enable-all
|
||||||
|
make check
|
||||||
|
}
|
||||||
|
|
||||||
|
function Remove() {
|
||||||
|
UnlinkFiles
|
||||||
|
|
||||||
|
rm -rf ./async
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$#" -gt 1 ]; then
|
if [ "$#" -gt 1 ]; then
|
||||||
|
@ -66,19 +93,18 @@ if [ "$#" -gt 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
KEEP=no
|
|
||||||
ONLY_SETUP=no
|
|
||||||
|
|
||||||
case "x$1" in
|
case "x$1" in
|
||||||
"xkeep")
|
"xinstall")
|
||||||
KEEP=yes
|
Install
|
||||||
;;
|
;;
|
||||||
"xclean")
|
"xuninstall")
|
||||||
CleanUp
|
Uninstall
|
||||||
exit 0
|
|
||||||
;;
|
;;
|
||||||
"xsetup")
|
"xremove")
|
||||||
ONLY_SETUP=yes
|
Remove
|
||||||
|
;;
|
||||||
|
"xtest")
|
||||||
|
Test
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
Usage
|
Usage
|
||||||
|
@ -86,28 +112,3 @@ case "x$1" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Fail on any error in script from now on
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ -d ./async ];
|
|
||||||
then
|
|
||||||
echo "Using existing async repo"
|
|
||||||
else
|
|
||||||
# make a clone of the wolfAsyncCrypt repository
|
|
||||||
git clone --depth 1 $ASYNC_REPO async
|
|
||||||
fi
|
|
||||||
|
|
||||||
# setup auto-conf
|
|
||||||
./autogen.sh
|
|
||||||
LinkFiles
|
|
||||||
if [ "x$ONLY_SETUP" == "xno" ];
|
|
||||||
then
|
|
||||||
./configure --enable-asynccrypt --enable-all
|
|
||||||
make check
|
|
||||||
# Clean up
|
|
||||||
if [ "x$KEEP" == "xno" ];
|
|
||||||
then
|
|
||||||
CleanUp
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue