mirror of https://github.com/wolfSSL/wolfssh.git
commit
cec90f8cec
46
autogen.sh
46
autogen.sh
|
@ -2,52 +2,8 @@
|
||||||
#
|
#
|
||||||
# Create configure and makefile stuff...
|
# Create configure and makefile stuff...
|
||||||
|
|
||||||
# Check environment
|
|
||||||
if [ -n "$WSL_DISTRO_NAME" ]; then
|
|
||||||
# we found a non-blank WSL environment distro name
|
|
||||||
current_path="$(pwd)"
|
|
||||||
pattern="/mnt/?"
|
|
||||||
if [ "$(echo "$current_path" | grep -E "^$pattern")" ]; then
|
|
||||||
# if we are in WSL and shared Windows file system, 'ln' does not work.
|
|
||||||
no_links=true
|
|
||||||
else
|
|
||||||
no_links=
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Git hooks should come before autoreconf.
|
|
||||||
if [ -d .git ]; then
|
|
||||||
if [ ! -d .git/hooks ]; then
|
|
||||||
mkdir .git/hooks || exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$no_links" ]; then
|
|
||||||
echo "Linux ln does not work on shared Windows file system in WSL."
|
|
||||||
if [ ! -e .git/hooks/pre-commit ]; then
|
|
||||||
echo "The pre-commit.sh file will not be copied to .git/hooks/pre-commit"
|
|
||||||
# shell scripts do not work on Windows; TODO create equivalent batch file
|
|
||||||
# cp ./pre-commit.sh .git/hooks/pre-commit || exit $?
|
|
||||||
fi
|
|
||||||
# unlike wolfssl, wolfssh is not using pre-push.sh at this time. Enable as needed:
|
|
||||||
# if [ ! -e .git/hooks/pre-push ]; then
|
|
||||||
# echo "The pre-push.sh file will not be copied to .git/hooks/pre-commit"
|
|
||||||
# # shell scripts do not work on Windows; TODO create equivalent batch file
|
|
||||||
# # cp ./pre-push.sh .git/hooks/pre-push || exit $?
|
|
||||||
# fi
|
|
||||||
else
|
|
||||||
if [ ! -e .git/hooks/pre-commit ]; then
|
|
||||||
ln -sf ../../scripts/pre-commit.sh .git/hooks/pre-commit || exit $?
|
|
||||||
fi
|
|
||||||
# unlike wolfssl, wolfssh is not using pre-push.sh at this time Enable as needed:
|
|
||||||
# if [ ! -e .git/hooks/pre-push ]; then
|
|
||||||
# ln -s ../../pre-push.sh .git/hooks/pre-push || exit $?
|
|
||||||
# fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If this is a source checkout then call autoreconf with error as well
|
# If this is a source checkout then call autoreconf with error as well
|
||||||
if test -e .git
|
if [ -e .git ]; then
|
||||||
then
|
|
||||||
WARNINGS="all,error"
|
WARNINGS="all,error"
|
||||||
else
|
else
|
||||||
WARNINGS="all"
|
WARNINGS="all"
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# commit-tests.sh
|
|
||||||
|
|
||||||
# make sure current config is ok
|
|
||||||
echo "Testing current config..."
|
|
||||||
if ! make clean check
|
|
||||||
then
|
|
||||||
echo "Current config make test failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# make sure basic config is ok
|
|
||||||
echo "Testing basic config..."
|
|
||||||
if ! ./configure
|
|
||||||
then
|
|
||||||
echo "Basic config ./configure failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! make check
|
|
||||||
then
|
|
||||||
echo "Basic config make test failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make sure the all enabled config is ok
|
|
||||||
echo "Testing enabled all config..."
|
|
||||||
if ! ./configure --enable-all
|
|
||||||
then
|
|
||||||
echo "Enabled all config ./configure failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! make check
|
|
||||||
then
|
|
||||||
echo "Enabled all config make test failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,34 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Our "pre-commit" hook.
|
|
||||||
|
|
||||||
# save current config
|
|
||||||
echo "\n\nSaving current config\n\n"
|
|
||||||
cp config.status tmp.status
|
|
||||||
|
|
||||||
# stash modified files not part of this commit, don't test them
|
|
||||||
echo "\n\nStashing any modified files not part of commit\n\n"
|
|
||||||
git stash -q --keep-index
|
|
||||||
|
|
||||||
# do the commit tests
|
|
||||||
echo "\n\nRunning commit tests...\n\n"
|
|
||||||
./scripts/commit-tests.sh
|
|
||||||
RESULT=$?
|
|
||||||
|
|
||||||
# restore modified files not part of this commit
|
|
||||||
echo "\n\nPopping any stashed modified files not part of commit\n"
|
|
||||||
git stash pop -q
|
|
||||||
|
|
||||||
# restore current config
|
|
||||||
echo "\nRestoring current config\n"
|
|
||||||
mv tmp.status config.status
|
|
||||||
# don't show output incase error from above
|
|
||||||
./config.status >/dev/null 2>&1
|
|
||||||
make clean >/dev/null 2>&1
|
|
||||||
make -j 8 >/dev/null 2>&1
|
|
||||||
|
|
||||||
[ $RESULT -ne 0 ] && echo "\nOops, your commit failed\n" && exit 1
|
|
||||||
|
|
||||||
echo "\nCommit tests passed!\n"
|
|
||||||
exit 0
|
|
Loading…
Reference in New Issue