summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--strata/build-essential/linux-api-headers.morph16
-rw-r--r--strata/build-essential/stage1-gcc.morph10
-rw-r--r--strata/build-essential/stage2-gcc.morph10
-rw-r--r--strata/build-essential/stage2-linux-api-headers.morph15
4 files changed, 47 insertions, 4 deletions
diff --git a/strata/build-essential/linux-api-headers.morph b/strata/build-essential/linux-api-headers.morph
index e1ff2638..0f7ce171 100644
--- a/strata/build-essential/linux-api-headers.morph
+++ b/strata/build-essential/linux-api-headers.morph
@@ -1,6 +1,20 @@
name: linux-api-headers
kind: chunk
install-commands:
-- ARCH=$(./morph-arch) make INSTALL_HDR_PATH=dest headers_install
+- |
+ case "$MORPH_ARCH" in
+ armv7b|armv7l|armv7lhf)
+ ARCH="arm" ;;
+ x86_32)
+ ARCH="i386" ;;
+ x86_64)
+ ARCH="x86_64" ;;
+ ppc64)
+ ARCH="powerpc" ;;
+ *)
+ echo "Error: unsupported Morph architecture: $MORPH_ARCH" >&2
+ exit 1
+ esac
+ ARCH=$ARCH make INSTALL_HDR_PATH=dest headers_install
- install -d "$DESTDIR${PREFIX-/usr}/include"
- cp -r dest/include/* "$DESTDIR/${PREFIX-/usr}/include"
diff --git a/strata/build-essential/stage1-gcc.morph b/strata/build-essential/stage1-gcc.morph
index 0cb03568..eb44c5dc 100644
--- a/strata/build-essential/stage1-gcc.morph
+++ b/strata/build-essential/stage1-gcc.morph
@@ -15,9 +15,17 @@ configure-commands:
# without an existing libc, and generally try to keep this build as
# simple as possible.
- |
+ case "$MORPH_ARCH" in
+ armv7lhf) ARCH_FLAGS="--with-arch=armv7-a \
+ --with-cpu=cortex-a9 \
+ --with-tune=cortex-a9 \
+ --with-fpu=vfpv3-d16 \
+ --with-float=hard" ;;
+ armv7*) ARCH_FLAGS="--with-arch=armv7-a" ;;
+ esac
cd o &&
../configure \
- $(../morph-arch-config) \
+ $ARCH_FLAGS \
--build=$(sh ../config.guess) --host=$(sh ../config.guess) \
--target=$TARGET_STAGE1 \
--prefix="$PREFIX" \
diff --git a/strata/build-essential/stage2-gcc.morph b/strata/build-essential/stage2-gcc.morph
index bf6378c1..4130dc4d 100644
--- a/strata/build-essential/stage2-gcc.morph
+++ b/strata/build-essential/stage2-gcc.morph
@@ -21,11 +21,19 @@ configure-commands:
# 4. C++ is built in stage 3.
# 5. Standard flags. See gcc.morph.
- |
+ case "$MORPH_ARCH" in
+ armv7lhf) ARCH_FLAGS="--with-arch=armv7-a \
+ --with-cpu=cortex-a9 \
+ --with-tune=cortex-a9 \
+ --with-fpu=vfpv3-d16 \
+ --with-float=hard" ;;
+ armv7*) ARCH_FLAGS="--with-arch=armv7-a" ;;
+ esac
export STAGE2_SYSROOT="$(dirname $(pwd))"
export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT"
export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
cd o && ../configure \
- $(../morph-arch-config) \
+ $ARCH_FLAGS \
`# [1]` --build=$(sh ../config.guess) \
--host=$TARGET_STAGE1 \
--target=$TARGET_STAGE1 \
diff --git a/strata/build-essential/stage2-linux-api-headers.morph b/strata/build-essential/stage2-linux-api-headers.morph
index 5cbf2f05..914def1f 100644
--- a/strata/build-essential/stage2-linux-api-headers.morph
+++ b/strata/build-essential/stage2-linux-api-headers.morph
@@ -2,7 +2,20 @@ name: stage2-linux-api-headers
kind: chunk
install-commands:
- |
- export ARCH=$(./morph-arch)
+ case "$MORPH_ARCH" in
+ armv7b|armv7l|armv7lhf)
+ ARCH="arm" ;;
+ x86_32)
+ ARCH="i386" ;;
+ x86_64)
+ ARCH="x86_64" ;;
+ ppc64)
+ ARCH="powerpc" ;;
+ *)
+ echo "Error: unsupported Morph architecture: $MORPH_ARCH" >&2
+ exit 1
+ esac
+ export ARCH=$ARCH
make INSTALL_HDR_PATH=dest headers_install
- install -d "$DESTDIR${PREFIX-/usr}/include"
- cp -r dest/include/* "$DESTDIR/${PREFIX-/usr}/include"