summaryrefslogtreecommitdiff
path: root/sofort/ccenv/ccenv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sofort/ccenv/ccenv.sh')
-rw-r--r--sofort/ccenv/ccenv.sh72
1 files changed, 68 insertions, 4 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index a13aa07..d975c6b 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1118,14 +1118,20 @@ 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#*-}
;;
+ *-*-solaris* )
+ ccenv_os='solaris'
+ ;;
+ *-*-*bsd* | *-*-dragonfly* )
+ ccenv_os='bsd'
+ ;;
+ *-*-*-* )
+ ccenv_tip=${ccenv_cchost%-*}
+ ccenv_os=${ccenv_tip#*-*-}
+ ;;
*-*-* )
ccenv_os=${ccenv_cchost#*-*-}
;;
@@ -1412,6 +1418,42 @@ ccenv_set_os_pe_switches()
;;
esac
fi
+
+ if [ "$ccenv_cc_binfmt" = 'PE' ]; then
+ if ! cfgtest_macro_definition '__PE__'; then
+ ccenv_cflags_os="${ccenv_cflags_os} -D__PE__"
+ fi
+
+ if ! cfgtest_macro_definition '__dllexport'; then
+ ccenv_cflags_os="${ccenv_cflags_os} -D__dllexport=__attribute__\(\(__dllexport__\)\)"
+ fi
+
+ if ! cfgtest_macro_definition '__dllimport'; then
+ ccenv_cflags_os="${ccenv_cflags_os} -D__dllimport=__attribute__\(\(__dllimport__\)\)"
+ fi
+ fi
+}
+
+ccenv_set_os_gate_switches()
+{
+ if [ "$ccenv_os" = 'solaris' ]; then
+ if ! cfgtest_macro_definition 'AT_FDCWD'; then
+ ccenv_cflags_os="${ccenv_cflags_os} -D__EXTENSIONS__"
+ fi
+ 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()
@@ -1654,6 +1696,25 @@ ccenv_set_cc_linker_switch_vars()
done
}
+ccenv_set_cc_attr_visibility_vars()
+{
+ if cfgtest_attr_visibility 'default'; then
+ ccenv_attr_visibility_default="$mb_cfgtest_attr"
+ fi
+
+ if cfgtest_attr_visibility 'hidden'; then
+ ccenv_attr_visibility_hidden="$mb_cfgtest_attr"
+ fi
+
+ if cfgtest_attr_visibility 'internal'; then
+ ccenv_attr_visibility_internal="$mb_cfgtest_attr"
+ fi
+
+ if cfgtest_attr_visibility 'protected'; then
+ ccenv_attr_visibility_protected="$mb_cfgtest_attr"
+ fi
+}
+
ccenv_dso_verify()
{
ccenv_str='int foo(int x){return ++x;}'
@@ -1760,6 +1821,9 @@ ccenv_set_toolchain_variables()
ccenv_set_os_dso_linkage
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
ccenv_clean_up