Make bootstrap more robust

Change-Id: I67cc22752b34dd49c277e247f0b648047927a02b
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8532
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
R. Diez 2024-11-01 09:46:05 +01:00 committed by Antonio Borneo
parent 564b24e7f8
commit 6d60ac5c08
1 changed files with 18 additions and 10 deletions

View File

@ -3,8 +3,8 @@
# Run the autotools bootstrap sequence to create the configure script # Run the autotools bootstrap sequence to create the configure script
# Abort execution on error set -e # Abort execution on error.
set -e set -u # Abort if you reference an undefined variable.
if which libtoolize > /dev/null; then if which libtoolize > /dev/null; then
libtoolize="libtoolize" libtoolize="libtoolize"
@ -15,13 +15,21 @@ else
exit 1 exit 1
fi fi
if [ "$1" = "nosubmodule" ]; then SKIP_SUBMODULE=0
SKIP_SUBMODULE=1
elif [ -n "$1" ]; then case "$#" in
echo "$0: Illegal argument $1" 0) ;;
echo "USAGE: $0 [nosubmodule]" 1) if [ "$1" = "nosubmodule" ]; then
exit 1 SKIP_SUBMODULE=1
fi else
echo "$0: Illegal argument $1" >&2
echo "USAGE: $0 [nosubmodule]" >&2
exit 1
fi;;
*) echo "$0: Wrong number of command-line arguments." >&2
echo "USAGE: $0 [nosubmodule]" >&2
exit 1;;
esac
# bootstrap the autotools # bootstrap the autotools
( (
@ -34,7 +42,7 @@ autoheader --warnings=all
automake --warnings=all --gnu --add-missing --copy automake --warnings=all --gnu --add-missing --copy
) )
if [ -n "$SKIP_SUBMODULE" ]; then if [ "$SKIP_SUBMODULE" -ne 0 ]; then
echo "Skipping submodule setup" echo "Skipping submodule setup"
else else
echo "Setting up submodules" echo "Setting up submodules"