From a64e292ce25a68d4a1ebfa014286010a6416508b Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 21 May 2022 14:13:18 +0200 Subject: [PATCH] build: Also use stage0_cpu detection in bootstrap.sh build. * build-aux/build-scaffold.sh: Include cflags.sh. (stage0_cpu): Move to... * build-aux/cflags.sh (stage0_cpu): ...here. * build-aux/build.sh.in (stage0_cpu): Remove. --- build-aux/build-scaffold.sh | 22 ++-------------------- build-aux/build.sh.in | 19 ------------------- build-aux/cflags.sh | 21 ++++++++++++++++++++- 3 files changed, 22 insertions(+), 40 deletions(-) diff --git a/build-aux/build-scaffold.sh b/build-aux/build-scaffold.sh index 665297aa..96dbf4bd 100755 --- a/build-aux/build-scaffold.sh +++ b/build-aux/build-scaffold.sh @@ -1,7 +1,7 @@ #! /bin/sh # GNU Mes --- Maxwell Equations of Software -# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen +# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen # # This file is part of GNU Mes. # @@ -29,6 +29,7 @@ fi . ./config.sh . ${srcdest}build-aux/trace.sh +. ${srcdest}build-aux/cflags.sh if $courageous; then set +e @@ -42,25 +43,6 @@ else } fi -case "$mes_cpu" in - arm) - stage0_arch=40 - stage0_cpu=armv7l - ;; - x86_64) - stage0_arch=2 - stage0_cpu=amd64 - ;; - x86) - stage0_arch=1 - stage0_cpu=x86 - ;; - *) - stage0_arch=1 - stage0_cpu=$mes_cpu - ;; -esac - trace "CCLD ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/exit-42.S" $CC\ -nostdlib\ -g\ diff --git a/build-aux/build.sh.in b/build-aux/build.sh.in index d089754d..f4a6a264 100644 --- a/build-aux/build.sh.in +++ b/build-aux/build.sh.in @@ -38,25 +38,6 @@ set -u . ./config.sh . ${srcdest}build-aux/cflags.sh -case "$mes_cpu" in - arm) - stage0_arch=40 - stage0_cpu=armv7l - ;; - x86_64) - stage0_arch=2 - stage0_cpu=amd64 - ;; - x86) - stage0_arch=1 - stage0_cpu=x86 - ;; - *) - stage0_arch=1 - stage0_cpu=$mes_cpu - ;; -esac - if $courageous; then echo "Applying courage" set +e diff --git a/build-aux/cflags.sh b/build-aux/cflags.sh index 93c8263c..344e4cf8 100644 --- a/build-aux/cflags.sh +++ b/build-aux/cflags.sh @@ -1,5 +1,5 @@ # GNU Mes --- Maxwell Equations of Software -# Copyright © 2018,2019,2020 Jan (janneke) Nieuwenhuizen +# Copyright © 2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen # # This file is part of GNU Mes. # @@ -16,6 +16,25 @@ # You should have received a copy of the GNU General Public License # along with GNU Mes. If not, see . +case "$mes_cpu" in + arm) + stage0_arch=40 + stage0_cpu=armv7l + ;; + x86_64) + stage0_arch=2 + stage0_cpu=amd64 + ;; + x86) + stage0_arch=1 + stage0_cpu=x86 + ;; + *) + stage0_arch=1 + stage0_cpu=$mes_cpu + ;; +esac + AM_CPPFLAGS=" -D HAVE_CONFIG_H=1 -I ${srcdest}include