summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COPYING.SOFORT2
-rw-r--r--sofort/ccenv/ccenv.sh25
-rw-r--r--sofort/cfgtest/cfgtest.sh2
3 files changed, 23 insertions, 6 deletions
diff --git a/COPYING.SOFORT b/COPYING.SOFORT
index 75a98e1..1c8a6c1 100644
--- a/COPYING.SOFORT
+++ b/COPYING.SOFORT
@@ -2,7 +2,7 @@
/* */
/* sofort: portable software project skeleton */
/* */
-/* Copyright (C) 2015--2023 SysDeer Technologies, LLC */
+/* Copyright (C) 2015--2024 SysDeer Technologies, LLC */
/* */
/* sofort provides a build system that can be incorporated into Works */
/* which may or may not be covered by a copyleft license. THE FOLLOWING */
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
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index 8e1db07..7bb27a0 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -423,7 +423,7 @@ cfgtest_interface_presence()
# init
cfgtest_prolog 'interface' "${1}"
- cfgtest_code_snippet=$(printf 'void * addr = &%s;\n' "${1}")
+ cfgtest_code_snippet=$(printf 'void (*addr)() = (void (*)())&%s;\n' "${1}")
cfgtest_common_init