diff options
author | nijtmans <nijtmans> | 2010-03-29 22:31:53 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-03-29 22:31:53 (GMT) |
commit | 1800bb7cff79bda28c05c8702f44b3fe5d069716 (patch) | |
tree | eff66796a786683d5d37ecc0e2ada204fa740b21 /unix | |
parent | 1df0c99376f51c3ea31e38fb947ba43057cafa9a (diff) | |
download | tcl-1800bb7cff79bda28c05c8702f44b3fe5d069716.zip tcl-1800bb7cff79bda28c05c8702f44b3fe5d069716.tar.gz tcl-1800bb7cff79bda28c05c8702f44b3fe5d069716.tar.bz2 |
Only test for -visibility=hidden with gcc
(Second remark in [Bug 2976508])
Diffstat (limited to 'unix')
-rwxr-xr-x | unix/configure | 17 | ||||
-rw-r--r-- | unix/tcl.m4 | 13 |
2 files changed, 22 insertions, 8 deletions
diff --git a/unix/configure b/unix/configure index d0fcd74..0396443 100755 --- a/unix/configure +++ b/unix/configure @@ -6434,8 +6434,10 @@ 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 -Werror" - cat >conftest.$ac_ext <<_ACEOF + if test "$GCC" = yes; then + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6480,7 +6482,15 @@ 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 + CFLAGS=$hold_cflags + +else + + tcl_cv_cc_visibility_hidden=no + +fi + + fi echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6 @@ -6490,7 +6500,6 @@ echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6 else - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d6769af..06b6ae6 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1052,10 +1052,15 @@ 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 -Werror" - AC_TRY_COMPILE(,, tcl_cv_cc_visibility_hidden=yes, - tcl_cv_cc_visibility_hidden=no) - CFLAGS=$hold_cflags]) + AS_IF([test "$GCC" = yes], [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror" + AC_TRY_COMPILE(,, tcl_cv_cc_visibility_hidden=yes, + tcl_cv_cc_visibility_hidden=no) + CFLAGS=$hold_cflags + ], [ + tcl_cv_cc_visibility_hidden=no + ]) + ]) AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [ CFLAGS="$CFLAGS -fvisibility=hidden" ], [ |