From ef309fcd9588574626469b6b0d0e169dbf0e097c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 11 Apr 2011 07:31:18 +0000 Subject: fix for [Bug 3281728]: Tcl sources from 2011-04-06 do not build on GCC9 (RH9) --- ChangeLog | 5 +++++ generic/tcl.h | 2 +- unix/configure | 5 ++++- unix/tcl.m4 | 7 +++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a44ee50..951a993 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-04-11 Jan Nijtmans + * generic/tcl.h: fix for [Bug 3281728]: Tcl sources from 2011-04-06 do + * unix/tcl.m4: not build on GCC9 (RH9) + * unix/configure: + 2011-04-08 Jan Nijtmans * win/tclWinPort.h: fix for [Bug 3280043]: win2k: unresolved DLL imports diff --git a/generic/tcl.h b/generic/tcl.h index 3285c3c..ed63f8f 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -193,7 +193,7 @@ extern "C" { # endif #else # define DLLIMPORT -# if defined(__GNUC__) && !defined(NO_VIZ) && !defined(STATIC_BUILD) +# if defined(__GNUC__) && __GNUC__ > 3 # define DLLEXPORT __attribute__ ((visibility("default"))) # else # define DLLEXPORT diff --git a/unix/configure b/unix/configure index 4fdddd4..2483e4a 100755 --- a/unix/configure +++ b/unix/configure @@ -6479,7 +6479,7 @@ if test "${tcl_cv_cc_visibility_hidden+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$GCC" = yes -a "$SHARED_BUILD" = 1; then + if test "$SHARED_BUILD" = 1; then hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -6492,6 +6492,9 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { +#if !defined(__GNUC__) || __GNUC__ < 4 +#error visibility hidden is not supported for this compiler +#endif ; return 0; diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 9a02e4c..5f4012d 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1044,9 +1044,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_CACHE_CHECK([if compiler supports visibility "hidden"], tcl_cv_cc_visibility_hidden, [ - AS_IF([test "$GCC" = yes -a "$SHARED_BUILD" = 1], [ + AS_IF([test "$SHARED_BUILD" = 1], [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror" - AC_TRY_COMPILE(,, tcl_cv_cc_visibility_hidden=yes, + AC_TRY_COMPILE(,[#if !defined(__GNUC__) || __GNUC__ < 4 +#error visibility hidden is not supported for this compiler +#endif + ], tcl_cv_cc_visibility_hidden=yes, tcl_cv_cc_visibility_hidden=no) CFLAGS=$hold_cflags ], [ -- cgit v0.12