summaryrefslogtreecommitdiffhomepage
path: root/sofort/ccenv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-09 17:32:28 +0000
committermidipix <writeonce@midipix.org>2021-06-09 17:35:22 +0000
commit8ed1b0e265bddef4a0d3e97e6e4b6051327e9955 (patch)
treef469adc7d0b60713fec195d5b18d1d00724f8d6e /sofort/ccenv
parent9c8bfd60fc82c01572dc39df3a4f8be5ec8725b6 (diff)
downloadperk-8ed1b0e265bddef4a0d3e97e6e4b6051327e9955.tar.bz2
perk-8ed1b0e265bddef4a0d3e97e6e4b6051327e9955.tar.xz
build system: ccenv_set_cc(): no -dumpmachine compilers: improved logic.
Diffstat (limited to 'sofort/ccenv')
-rw-r--r--sofort/ccenv/ccenv.sh22
1 files changed, 19 insertions, 3 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 61d3c58..332e12f 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -501,11 +501,20 @@ ccenv_set_cc()
ccenv_errors=
if [ "$ccenv_cfgtype" = 'native' ]; then
- if [ -n "$ccenv_dumpmachine_switch" ]; then
+ if [ -n "$mb_native_host" ]; then
+ ccenv_host="$mb_native_host"
+
+ elif [ -n "$ccenv_dumpmachine_switch" ]; then
ccenv_host=$(eval $ccenv_cc $(printf '%s' "$ccenv_cflags") \
$ccenv_dumpmachine_switch 2>&3)
else
- ccenv_host=$(printf '%s' $(uname -m)-$(uname -p)-$(uname -o) \
+ ccenv_machine=$(uname -m 2>/dev/null)
+ ccenv_system=$(uname -s 2>/dev/null)
+
+ ccenv_machine="${ccenv_machine:-unknown}"
+ ccenv_system="${ccenv_system:-anyos}"
+
+ ccenv_host=$(printf '%s' "${ccenv_machine}-unknown-${ccenv_system}" \
| tr '[[:upper:]]' '[[:lower:]]')
fi
@@ -529,8 +538,15 @@ ccenv_set_cc()
elif [ -z "$ccenv_host" ]; then
# assume that no -dumpmachine support means native build (fixme)
- ccenv_host=$(printf '%s' $(uname -m)-$(uname -p)-$(uname -o) \
+ ccenv_machine=$(uname -m 2>/dev/null)
+ ccenv_system=$(uname -s 2>/dev/null)
+
+ ccenv_machine="${ccenv_machine:-unknown}"
+ ccenv_system="${ccenv_system:-anyos}"
+
+ ccenv_host=$(printf '%s' "${ccenv_machine}-unknown-${ccenv_system}" \
| tr '[[:upper:]]' '[[:lower:]]')
+
ccenv_cchost=$ccenv_host
elif [ -n "$ccenv_dumpmachine_switch" ]; then