summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-09-04 12:48:57 (GMT)
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-25 13:41:36 (GMT)
commit330c57ce57eca2ae63a7afee0d0eac32c4bda2b7 (patch)
tree9a9da66871da608588fb5c108add15138ffd95fc
parent5c26ce121680bb012ecd7d314b038475ea0107b4 (diff)
downloaddefinitions-330c57ce57eca2ae63a7afee0d0eac32c4bda2b7.tar.gz
gnu-toolchain: Rework linux-api-headers arch conditions and support ppc64b
It's better to use BuildStream arch conditionals than to use shell code, because in the latter case any change will trigger rebuilds for all architectures regardless of which ones it actually affects.
-rw-r--r--elements/gnu-toolchain/linux-api-headers.bst58
-rw-r--r--elements/gnu-toolchain/stage2-linux-api-headers.bst56
2 files changed, 78 insertions, 36 deletions
diff --git a/elements/gnu-toolchain/linux-api-headers.bst b/elements/gnu-toolchain/linux-api-headers.bst
index dff7866..a8096b3 100644
--- a/elements/gnu-toolchain/linux-api-headers.bst
+++ b/elements/gnu-toolchain/linux-api-headers.bst
@@ -11,29 +11,51 @@ depends:
type: build
- gnu-toolchain/fhs-dirs.bst
+variables:
+ kernel-arch: unsupported
+
+arches:
+ armv5:
+ variables:
+ kernel-arch: arm
+ armv7b:
+ variables:
+ kernel-arch: arm
+ armv7l:
+ variables:
+ kernel-arch: arm
+ armv7lhf:
+ variables:
+ kernel-arch: arm
+ armv8l64:
+ variables:
+ kernel-arch: arm64
+ armv8b64:
+ variables:
+ kernel-arch: arm64
+ ppc64b:
+ variables:
+ kernel-arch: powerpc
+ ppc64l:
+ variables:
+ kernel-arch: powerpc
+ x86_32:
+ variables:
+ kernel-arch: i386
+ x86_64:
+ variables:
+ kernel-arch: x86_64
+
environment:
PATH: /usr/bin:/bin:/usr/sbin:/sbin:/tools/bin:/tools/sbin
config:
install-commands:
- |
- case "%{bst-target-arch}" in
- armv5l)
- ARCH="arm" ;;
- armv7b|armv7l|armv7lhf)
- ARCH="arm" ;;
- armv8l64|armv8b64)
- ARCH="arm64" ;;
- x86_32)
- ARCH="i386" ;;
- x86_64)
- ARCH="x86_64" ;;
- ppc64)
- ARCH="powerpc" ;;
- *)
- echo "Error: unsupported architecture: %{bst-target-arch}" >&2
- exit 1
- esac
- ARCH=$ARCH make INSTALL_HDR_PATH=dest headers_install
+ if [ '%{kernel-arch}' == 'unsupported' ]; then
+ echo "Error: unsupported architecture: %{bst-target-arch}" >&2
+ exit 1
+ fi
+ ARCH=%{kernel-arch} make INSTALL_HDR_PATH=dest headers_install
- install -d "%{install-root}%{includedir}"
- cp -r dest/include/* "%{install-root}%{includedir}"
diff --git a/elements/gnu-toolchain/stage2-linux-api-headers.bst b/elements/gnu-toolchain/stage2-linux-api-headers.bst
index 2cc6e17..6759687 100644
--- a/elements/gnu-toolchain/stage2-linux-api-headers.bst
+++ b/elements/gnu-toolchain/stage2-linux-api-headers.bst
@@ -12,6 +12,39 @@ depends:
variables:
prefix: /tools
+ kernel-arch: unsupported
+
+arches:
+ armv5:
+ variables:
+ kernel-arch: arm
+ armv7b:
+ variables:
+ kernel-arch: arm
+ armv7l:
+ variables:
+ kernel-arch: arm
+ armv7lhf:
+ variables:
+ kernel-arch: arm
+ armv8l64:
+ variables:
+ kernel-arch: arm64
+ armv8b64:
+ variables:
+ kernel-arch: arm64
+ ppc64b:
+ variables:
+ kernel-arch: powerpc
+ ppc64l:
+ variables:
+ kernel-arch: powerpc
+ x86_32:
+ variables:
+ kernel-arch: i386
+ x86_64:
+ variables:
+ kernel-arch: x86_64
environment:
PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin
@@ -19,23 +52,10 @@ environment:
config:
install-commands:
- |
- case "%{bst-target-arch}" in
- armv5l)
- ARCH="arm" ;;
- armv7b|armv7l|armv7lhf)
- ARCH="arm" ;;
- armv8l64|armv8b64)
- ARCH="arm64" ;;
- x86_32)
- ARCH="i386" ;;
- x86_64)
- ARCH="x86_64" ;;
- ppc64b|ppc64l)
- ARCH="powerpc" ;;
- *)
- echo "Error: unsupported architecture: %{bst-target-arch}" >&2
- exit 1
- esac
- ARCH=$ARCH make INSTALL_HDR_PATH=dest headers_install
+ if [ '%{kernel-arch}' == 'unsupported' ]; then
+ echo "Error: unsupported architecture: %{bst-target-arch}" >&2
+ exit 1
+ fi
+ ARCH=%{kernel-arch} make INSTALL_HDR_PATH=dest headers_install
- install -d "%{install-root}%{includedir}"
- cp -r dest/include/* "%{install-root}%{includedir}"