diff mbox

[RISU,v5,04/13] build-all-archs: support --static flag

Message ID 20170619104655.31104-5-alex.bennee@linaro.org
State New
Headers show

Commit Message

Alex Bennée June 19, 2017, 10:46 a.m. UTC
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v5
  - swap with docker patch so later can be dropped if not wanted
---
 build-all-archs | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

Comments

Peter Maydell June 20, 2017, 2:07 p.m. UTC | #1
On 19 June 2017 at 11:46, Alex Bennée <alex.bennee@linaro.org> wrote:
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> ---
> v5
>   - swap with docker patch so later can be dropped if not wanted
> ---

Applied to master, thanks.

-- PMM
diff mbox

Patch

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