[vlc-commits] Contrib: add ARCH variable
Rémi Denis-Courmont
git at videolan.org
Tue Jun 28 18:45:29 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 25 14:45:30 2011 +0300| [4453dfc4f5d4b34423b17ab4ba1b0744212bc869] | committer: Rémi Denis-Courmont
Contrib: add ARCH variable
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4453dfc4f5d4b34423b17ab4ba1b0744212bc869
---
contrib/src/get-arch.sh | 26 ++++++++++++++++++++++++++
contrib/src/main.mak | 1 +
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/contrib/src/get-arch.sh b/contrib/src/get-arch.sh
new file mode 100755
index 0000000..8495ddb
--- /dev/null
+++ b/contrib/src/get-arch.sh
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+HOST="$1"
+if test -z "$HOST"; then
+ echo "Usage: $0 <target machine>" >&2
+ exit 1
+fi
+
+case "$HOST" in
+ i[3456]86-*)
+ ARCH="i386"
+ ;;
+ powerpc-*|ppc-*)
+ ARCH="ppc"
+ ;;
+ powerpc64-*|ppc64-*)
+ ARCH="ppc64"
+ ;;
+ *-*)
+ ARCH="${HOST%%-*}"
+ ;;
+ *)
+ echo "$HOST: invalid machine specification" >&2
+ exit 1
+esac
+echo $ARCH
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 2dfad1d..36841ed 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -27,6 +27,7 @@ PREFIX := $(abspath $(PREFIX))
ifneq ($(HOST),$(BUILD))
HAVE_CROSS_COMPILE = 1
endif
+ARCH := $(shell $(SRC)/get-arch.sh $(HOST))
ifdef HAVE_CROSS_COMPILE
need_pkg = 1
More information about the vlc-commits
mailing list