qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RISU PATCH v5 04/13] build-all-archs: support --static fla


From: Alex Bennée
Subject: [Qemu-devel] [RISU PATCH v5 04/13] build-all-archs: support --static flag
Date: Mon, 19 Jun 2017 11:46:46 +0100

Signed-off-by: Alex Bennée <address@hidden>

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

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
-- 
2.13.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]