From 4259f9d8e8ae928c05dc2435bf5d3e73cc7d0463 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 22 Apr 2012 18:36:33 -0400 Subject: Look up build GNU architecture name. --- (limited to 'src') diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 8d6e14a..6881546 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -200,7 +200,17 @@ if [ ! -f "@@DATADIR@@/opkhelper/archtab" ]; then exit 1 fi -# Look up GNU architecture name and set toolchain environment variables. +# Look up build GNU architecture name. +export OH_BUILD_ARCH_GNU="$(sed -n \ + "s/^${OH_BUILD_ARCH_DIST}[ \\t][ \\t]*\\(.*\\)$/\\1/p" \ + "@@DATADIR@@/opkhelper/archtab")" +if [ -z "${OH_BUILD_ARCH_GNU}" ]; then + printf 'opkbuild: Error: "%s" not found in architecture table.\n' \ + "${OH_BUILD_ARCH_DIST}" >&2 + exit 1 +fi + +# Look up host GNU architecture name. export OH_HOST_ARCH_GNU="$(sed -n \ "s/^${OH_HOST_ARCH_DIST}[ \\t][ \\t]*\\(.*\\)$/\\1/p" \ "@@DATADIR@@/opkhelper/archtab")" @@ -209,6 +219,8 @@ if [ -z "${OH_HOST_ARCH_GNU}" ]; then "${OH_HOST_ARCH_DIST}" >&2 exit 1 fi + +# Set toolchain environment variables. # NB: This is written for GNU Binutils and GCC and won't work for, e.g., LLVM. export AR="${OH_HOST_ARCH_GNU}-ar" export AS="${OH_HOST_ARCH_GNU}-as" -- cgit v0.9.1