summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-12 13:45:53 +0000
committermidipix <writeonce@midipix.org>2021-06-12 14:56:04 +0000
commit6e5f4b9cd32633871625fc2987bb29dfa676428b (patch)
tree9c7f96c148c00acda5c4c29eec2460710bce8f2c
parent1b3f4fa80b5c96821740a5747a34183f4d5afad9 (diff)
downloadw32lib-6e5f4b9cd32633871625fc2987bb29dfa676428b.tar.bz2
w32lib-6e5f4b9cd32633871625fc2987bb29dfa676428b.tar.xz
build system: ccenv: added and integrated ccenv_set_cc_sysroot_vars().
-rwxr-xr-xconfigure4
-rw-r--r--sofort/ccenv/ccenv.sh30
2 files changed, 32 insertions, 2 deletions
diff --git a/configure b/configure
index 0982754..20fde7a 100755
--- a/configure
+++ b/configure
@@ -651,11 +651,11 @@ common_defaults()
# sysroot
if [ -n "$mb_sysroot" ]; then
if [ -z "$mb_cflags_sysroot" ]; then
- mb_cflags_sysroot="--sysroot=$mb_sysroot"
+ mb_cflags_sysroot='$(_CFLAGS_SYSROOT)'
fi
if [ -z "$mb_ldflags_sysroot" ]; then
- mb_ldflags_sysroot="--sysroot=$mb_sysroot"
+ mb_ldflags_sysroot='$(_LDFLAGS_SYSROOT)'
fi
fi
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 99a98ef..cf45cb2 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1495,6 +1495,35 @@ ccenv_output_defs()
eval 'ccenv_'${ccenv_cfgtype}'_pkgconf'=\'$ccenv_pkgconf\'
}
+ccenv_set_cc_sysroot_vars()
+{
+ if [ "$ccenv_cfgtype" = 'native' ] || [ -z "$mb_sysroot" ]; then
+ return 0
+ fi
+
+ cfgtest_host_section
+ ccenv_switch_var="--sysroot=${mb_sysroot}"
+
+ if cfgtest_compiler_switch_arg "${ccenv_switch_var}"; then
+ printf '\n# %s sysroot: cflags and ldflags\n' "$ccenv_cfgtype" \
+ >> "$ccenv_mk"
+
+ for ccenv_make_var in '_CFLAGS_SYSROOT' '_LDFLAGS_SYSROOT'; do
+ printf '%-40s= %s\n' "${ccenv_make_var}" "${ccenv_switch_var}" \
+ >> "$ccenv_mk"
+ done
+ else
+ printf '\n# %s sysroot: cflags and ldflags %s\n' "$ccenv_cfgtype" \
+ '(not supported: see config.log)' \
+ >> "$ccenv_mk"
+
+ for ccenv_make_var in '_CFLAGS_SYSROOT' '_LDFLAGS_SYSROOT'; do
+ printf '%-40s=\n' "${ccenv_make_var}" \
+ >> "$ccenv_mk"
+ done
+ fi
+}
+
ccenv_set_cc_switch_vars()
{
printf '\n# %s cflags: supported compiler switches\n' "$ccenv_cfgtype" \
@@ -1707,6 +1736,7 @@ ccenv_set_toolchain_variables()
ccenv_output_defs
ccenv_clean_up
+ ccenv_set_cc_sysroot_vars
ccenv_set_cc_switch_vars
ccenv_set_cc_linker_switch_vars
}