diff options
author | midipix <writeonce@midipix.org> | 2024-03-18 18:38:10 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-03-18 18:52:20 +0000 |
commit | 36413e54dc749f635b3bfc4ef05be9a43ee1e062 (patch) | |
tree | b5160467cf911cb0447609f06fbe2929e21aef54 /sofort | |
parent | 23c0ccc54abdc3536d43a4e87fc091b11de75713 (diff) | |
download | bcparser-36413e54dc749f635b3bfc4ef05be9a43ee1e062.tar.bz2 bcparser-36413e54dc749f635b3bfc4ef05be9a43ee1e062.tar.xz |
build system: ccenv.sh: bsd targets: define __BSD_VISIBLE as needed.
Diffstat (limited to 'sofort')
-rw-r--r-- | sofort/ccenv/ccenv.sh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index fdba47e..d975c6b 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -1118,10 +1118,6 @@ ccenv_set_os() fi case "$ccenv_cchost" in - *-*-*-* ) - ccenv_tip=${ccenv_cchost%-*} - ccenv_os=${ccenv_tip#*-*-} - ;; *-*-musl | *-*-gnu ) ccenv_tip=${ccenv_cchost%-*} ccenv_os=${ccenv_tip#*-} @@ -1129,6 +1125,13 @@ ccenv_set_os() *-*-solaris* ) ccenv_os='solaris' ;; + *-*-*bsd* | *-*-dragonfly* ) + ccenv_os='bsd' + ;; + *-*-*-* ) + ccenv_tip=${ccenv_cchost%-*} + ccenv_os=${ccenv_tip#*-*-} + ;; *-*-* ) ccenv_os=${ccenv_cchost#*-*-} ;; @@ -1440,6 +1443,19 @@ ccenv_set_os_gate_switches() fi } +ccenv_set_os_bsd_switches() +{ + if [ "$ccenv_os" = 'bsd' ]; then + mb_cfgtest_headers='sys/mman.h' + + if ! cfgtest_macro_definition 'MAP_ANON'; then + ccenv_cflags_os="${ccenv_cflags_os} -D__BSD_VISIBLE" + fi + + mb_cfgtest_headers= + fi +} + ccenv_output_defs() { ccenv_in="$mb_project_dir/sofort/ccenv/ccenv.in" @@ -1806,6 +1822,7 @@ ccenv_set_toolchain_variables() ccenv_set_os_dso_patterns ccenv_set_os_pe_switches ccenv_set_os_gate_switches + ccenv_set_os_bsd_switches ccenv_set_cc_attr_visibility_vars ccenv_output_defs |