summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-03-02 23:42:09 (GMT)
committernijtmans <nijtmans>2010-03-02 23:42:09 (GMT)
commitf201d409293ee10e5c0cb84ffb88d234a46a2d9a (patch)
tree8e3355f60ef52b6cf292f7d98fa182fb8a03da6a /unix
parent988b0c027264354bc42b3e992ec794f7b88747f8 (diff)
downloadtk-f201d409293ee10e5c0cb84ffb88d234a46a2d9a.zip
tk-f201d409293ee10e5c0cb84ffb88d234a46a2d9a.tar.gz
tk-f201d409293ee10e5c0cb84ffb88d234a46a2d9a.tar.bz2
[Enh 2959069] Support for -fvisibility=hidden
Diffstat (limited to 'unix')
-rwxr-xr-xunix/configure64
-rw-r--r--unix/tcl.m418
2 files changed, 73 insertions, 9 deletions
diff --git a/unix/configure b/unix/configure
index eeaeb8c..382c284 100755
--- a/unix/configure
+++ b/unix/configure
@@ -4315,6 +4315,62 @@ if test "${tcl_cv_cc_visibility_hidden+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_cc_visibility_hidden=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_visibility_hidden=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5
+echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6
+ if test $tcl_cv_cc_visibility_hidden = yes; then
+
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+
+else
+
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -4365,10 +4421,7 @@ fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$hold_cflags
-fi
-echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5
-echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6
- if test $tcl_cv_cc_visibility_hidden = yes; then
+ if test $tcl_cv_cc_visibility_hidden = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -4379,6 +4432,9 @@ _ACEOF
fi
+fi
+
+
# Step 0.d: Disable -rpath support?
echo "$as_me:$LINENO: checking if rpath support is requested" >&5
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?