summaryrefslogtreecommitdiff
path: root/sofort/ccenv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-18 06:33:00 +0000
committermidipix <writeonce@midipix.org>2024-02-18 07:49:53 +0000
commit787a42e5b85f83a5bf7cdaa97daad5c865e66128 (patch)
treed2fd320a18256ba76e6f7da92ebb10c74631ef0a /sofort/ccenv
parent4f855f4f8887576b27f9797c3decb2a1d4b90126 (diff)
downloadbcparser-787a42e5b85f83a5bf7cdaa97daad5c865e66128.tar.bz2
bcparser-787a42e5b85f83a5bf7cdaa97daad5c865e66128.tar.xz
build system: ccenv: detect compiler support of visibility attributes.
Diffstat (limited to 'sofort/ccenv')
-rw-r--r--sofort/ccenv/ccenv.in7
-rw-r--r--sofort/ccenv/ccenv.sh20
-rw-r--r--sofort/ccenv/ccenv.vars6
3 files changed, 32 insertions, 1 deletions
diff --git a/sofort/ccenv/ccenv.in b/sofort/ccenv/ccenv.in
index 441f8ab..0daff84 100644
--- a/sofort/ccenv/ccenv.in
+++ b/sofort/ccenv/ccenv.in
@@ -84,8 +84,13 @@ PKGCONF = @ccenv_pkgconf@
AS = @ccenv_as@
LD = @ccenv_ld@
+# @ccenv_cfgtype@ visibility attributes
+CFLAGS_ATTR_VISIBILITY_DEFAULT = -D_ATTR_VISIBILITY_DEFAULT=@ccenv_attr_visibility_default@
+CFLAGS_ATTR_VISIBILITY_HIDDEN = -D_ATTR_VISIBILITY_HIDDEN=@ccenv_attr_visibility_hidden@
+CFLAGS_ATTR_VISIBILITY_INTERNAL = -D_ATTR_VISIBILITY_INTERNAL=@ccenv_attr_visibility_internal@
+CFLAGS_ATTR_VISIBILITY_PROTECTED = -D_ATTR_VISIBILITY_PROTECTED=@ccenv_attr_visibility_protected@
+
# @ccenv_cfgtype@ cflags
CFLAGS_OS += -DOS_LIB_SUFFIX=\"@ccenv_os_lib_suffix@\"
CFLAGS_OS += @ccenv_cflags_os@
CFLAGS_PIC += @ccenv_cflags_pic@
-
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index a13aa07..0f7f486 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1654,6 +1654,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 +1779,7 @@ ccenv_set_toolchain_variables()
ccenv_set_os_dso_linkage
ccenv_set_os_dso_patterns
ccenv_set_os_pe_switches
+ ccenv_set_cc_attr_visibility_vars
ccenv_output_defs
ccenv_clean_up
diff --git a/sofort/ccenv/ccenv.vars b/sofort/ccenv/ccenv.vars
index 41eb327..054b638 100644
--- a/sofort/ccenv/ccenv.vars
+++ b/sofort/ccenv/ccenv.vars
@@ -82,6 +82,12 @@ ccenv_windrc=
ccenv_pkgconf=
+# visibility attributes
+ccenv_attr_visibility_default=
+ccenv_attr_visibility_hidden=
+ccenv_attr_visibility_internal=
+ccenv_attr_visibility_protected=
+
# cflags
ccenv_cflags_os=
ccenv_cflags_pic=