summaryrefslogtreecommitdiff
path: root/sofort/ccenv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-13 07:28:30 +0000
committermidipix <writeonce@midipix.org>2021-06-13 07:29:09 +0000
commita5c3be8d89a683956ec6ad85571d3c48b2524a8a (patch)
treec454d820144250e36ee3cd0f7a46a50b8c07d270 /sofort/ccenv
parentd41a72fe4fbba0f9ae7a69398c6aee5946a0ca33 (diff)
downloadbcparser-a5c3be8d89a683956ec6ad85571d3c48b2524a8a.tar.bz2
bcparser-a5c3be8d89a683956ec6ad85571d3c48b2524a8a.tar.xz
build system: configure, ccenv: enhanced --sysroot logic.
Diffstat (limited to 'sofort/ccenv')
-rw-r--r--sofort/ccenv/ccenv.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 464b309..a13aa07 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -28,8 +28,10 @@
# variables available to cfgdefs.sh and cfgfini.sh:
# ccenv_host_cflags: expanded cflags, valid for the host compiler
# ccenv_host_ldflags: expanded ldflags, valid for the host compiler
+# ccenv_host_sysroot: host sysroot, as reported by the host compiler
# ccenv_native_cflags: expanded cflags, valid for the native compiler
# ccenv_native_ldflags: expanded ldflags, valid for the native compiler
+# ccenv_native_sysroot: native sysroot, as reported by the native compiler
ccenv_usage()
{
@@ -1507,8 +1509,12 @@ ccenv_output_defs()
ccenv_cflags="${ccenv_cflags#*: }"
ccenv_ldflags="${ccenv_ldflags#*: }"
+ ccenv_sysroot=$(eval $ccenv_cc $(printf '%s' "$ccenv_cflags") \
+ -print-sysroot 2>/dev/null || true)
+
eval 'ccenv_'${ccenv_cfgtype}'_cflags'=\'$ccenv_cflags\'
eval 'ccenv_'${ccenv_cfgtype}'_ldflags'=\'$ccenv_ldflags\'
+ eval 'ccenv_'${ccenv_cfgtype}'_sysroot'=\'$ccenv_sysroot\'
eval 'ccenv_'${ccenv_cfgtype}'_cc'=\'$ccenv_cc\'
eval 'ccenv_'${ccenv_cfgtype}'_cc_environment'=\'$ccenv_cc_environment\'