summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-03-02 23:39:33 (GMT)
committernijtmans <nijtmans>2010-03-02 23:39:33 (GMT)
commit618503676d9bd1174c263775d6a2aeef4a838ae1 (patch)
tree096796c0784d9508574b1e81e36e8f34a595a4bf /unix/tcl.m4
parentf73c7daa07ce0b9759ce82a413ebd06b5fa86003 (diff)
downloadtcl-618503676d9bd1174c263775d6a2aeef4a838ae1.zip
tcl-618503676d9bd1174c263775d6a2aeef4a838ae1.tar.gz
tcl-618503676d9bd1174c263775d6a2aeef4a838ae1.tar.bz2
[Enh 2959069] Support for -fvisibility=hidden
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m418
1 files changed, 13 insertions, 5 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 34a06bd..c5045c7 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1052,16 +1052,24 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if compiler supports visibility "hidden"],
tcl_cv_cc_visibility_hidden, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden"
+ AC_TRY_COMPILE(,, tcl_cv_cc_visibility_hidden=yes,
+ tcl_cv_cc_visibility_hidden=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ ], [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
AC_TRY_LINK([
extern __attribute__((__visibility__("hidden"))) void f(void);
void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
tcl_cv_cc_visibility_hidden=no)
- CFLAGS=$hold_cflags])
- AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
- AC_DEFINE(MODULE_SCOPE,
- [extern __attribute__((__visibility__("hidden")))],
- [Compiler support for module scope symbols])
+ CFLAGS=$hold_cflags
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ ])
])
# Step 0.d: Disable -rpath support?