summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authordas <das>2007-02-04 02:51:47 (GMT)
committerdas <das>2007-02-04 02:51:47 (GMT)
commit9e82d733ad8686a5be07242f19d30fd459df5bd9 (patch)
treebe519e1bca00c1b4656352770ac97a0c25aaa048 /unix/tcl.m4
parent564a18890f8852cc78182cfec2cabfb6cb61b2e7 (diff)
downloadtk-9e82d733ad8686a5be07242f19d30fd459df5bd9.zip
tk-9e82d733ad8686a5be07242f19d30fd459df5bd9.tar.gz
tk-9e82d733ad8686a5be07242f19d30fd459df5bd9.tar.bz2
* unix/tcl.m4: use gcc4's __attribute__((__visibility__("hidden"))) if
available to define MODULE_SCOPE effective on all platforms. * unix/configure.in: add caching to -pipe check. * unix/configure: autoconf-2.59 * unix/tkConfig.h.in: autoheader-2.59
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m425
1 files changed, 23 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 4e90aaf..1a19fce 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1086,6 +1086,25 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
do64bit=yes
fi
+ # Step 0.c: Check if gcc visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ if test "$GCC" = "yes" ; then
+ AC_CACHE_CHECK([if gcc supports visibility "hidden"],
+ tcl_cv_cc_visibility_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])
+ if test $tcl_cv_cc_visibility_hidden = yes; then
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ fi
+ fi
+
# Step 1: set the variable "system" to hold the name and version number
# for the system.
@@ -1691,9 +1710,11 @@ dnl AC_CHECK_TOOL(AR, ar)
fi
fi
fi
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then
+ AC_DEFINE(MODULE_SCOPE, [__private_extern__],
+ [Compiler support for module scope symbols])
+ fi
AC_DEFINE(MAC_OSX_TCL, 1, [Is this a Mac I see before me?])
- AC_DEFINE(MODULE_SCOPE, __private_extern__,
- [Linker support for module scope symbols])
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""