aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2017-06-20 14:23:42 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-06-20 14:23:45 +0100
commit9b81da393779f78ba192d2e6b7b37f0c7d61a235 (patch)
tree86c58985ce86da6e6243f3e2a89493df84ca8c85
parent20f26e0cd5917344e3182411e353f4bb827b7ef8 (diff)
build-all-archs: support --static flag
Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20170619104655.31104-5-alex.bennee@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-xbuild-all-archs34
1 files changed, 33 insertions, 1 deletions
diff --git a/build-all-archs b/build-all-archs
index 2768727..581a1b4 100755
--- a/build-all-archs
+++ b/build-all-archs
@@ -14,6 +14,38 @@
# So we notice risugen failing even though it's in a pipeline
set -o pipefail
+# Simple usage
+usage() {
+ cat <<-EOF
+ Usage: $0 [options]
+
+ Options include:
+ --static build a static binary
+
+EOF
+ exit 1
+}
+
+while [[ "$1" = -* ]]; do
+ opt="$1"; shift
+ arg=
+ if [[ "$opt" = *=* ]]; then
+ arg="${opt#*=}"
+ opt="${opt%%=*}"
+ fi
+ case "$opt" in
+ --static)
+ CONF="--static"
+ ;;
+ --help)
+ usage
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
# Debian stretch and Ubuntu Xenial have cross compiler packages for
# all of these:
# gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu gcc-m68k-linux-gnu
@@ -36,7 +68,7 @@ for triplet in aarch64-linux-gnu arm-linux-gnueabihf m68k-linux-gnu \
rm -rf build/${triplet}
mkdir -p build/${triplet}
- (cd build/${triplet} && CROSS_PREFIX="${triplet}-" ../../configure)
+ (cd build/${triplet} && CROSS_PREFIX="${triplet}-" ../../configure ${CONF})
make -C build/${triplet} EXTRA_CFLAGS=-Werror
done