summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/expat/conftools/expatcfg-compiler-supports-visibility.m4
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/expat/conftools/expatcfg-compiler-supports-visibility.m4')
-rw-r--r--3rdparty/expat/conftools/expatcfg-compiler-supports-visibility.m439
1 files changed, 39 insertions, 0 deletions
diff --git a/3rdparty/expat/conftools/expatcfg-compiler-supports-visibility.m4 b/3rdparty/expat/conftools/expatcfg-compiler-supports-visibility.m4
new file mode 100644
index 00000000000..45d07edfd2c
--- /dev/null
+++ b/3rdparty/expat/conftools/expatcfg-compiler-supports-visibility.m4
@@ -0,0 +1,39 @@
+# expatcfg-compiler-supports-visibility.m4 --
+#
+# SYNOPSIS
+#
+# EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([ACTION-IF-YES],
+# [ACTION-IF-NO])
+#
+# DESCRIPTION
+#
+# Check if the selected compiler supports the "visibility" attribute
+# and set the variable "expatcfg_cv_compiler_supports_visibility"
+# accordingly to "yes" or "no".
+#
+# In addition, execute ACTION-IF-YES or ACTION-IF-NO.
+#
+# LICENSE
+#
+# Copyright (c) 2018 The Expat Authors.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+AC_DEFUN([EXPATCFG_COMPILER_SUPPORTS_VISIBILITY],
+ [AC_CACHE_CHECK([whether compiler supports visibility],
+ [expatcfg_cv_compiler_supports_visibility],
+ [AS_VAR_SET([expatcfg_cv_compiler_supports_visibility],[no])
+ AS_VAR_COPY([OLDFLAGS],[CFLAGS])
+ AS_VAR_APPEND([CFLAGS],[" -fvisibility=hidden -Wall -Werror -Wno-unknown-warning-option"])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ void __attribute__((visibility("default"))) foo(void);
+ void foo(void) {}
+ ]])],
+ [AS_VAR_SET([expatcfg_cv_compiler_supports_visibility],[yes])])
+ AS_VAR_COPY([CFLAGS],[OLDFLAGS])])
+ AS_IF([test "$expatcfg_cv_compiler_supports_visibility" = yes],[$1],[$2])])
+
+# end of file