summaryrefslogtreecommitdiffstats
path: root/unix/configure
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/configure
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/configure')
-rwxr-xr-xunix/configure105
1 files changed, 92 insertions, 13 deletions
diff --git a/unix/configure b/unix/configure
index f062a2d..d9d80cc 100755
--- a/unix/configure
+++ b/unix/configure
@@ -3469,13 +3469,15 @@ fi
# It makes compiling go faster. (This is only a performance feature.)
#------------------------------------------------------------------------
-if test -z "$no_pipe"; then
-if test -n "$GCC"; then
- echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5
+if test -z "$no_pipe" && test -n "$GCC"; then
+ echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5
echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6
- OLDCC="$CC"
- CC="$CC -pipe"
- cat >conftest.$ac_ext <<_ACEOF
+if test "${tcl_cv_cc_pipe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3512,18 +3514,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ tcl_cv_cc_pipe=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-CC="$OLDCC"
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+tcl_cv_cc_pipe=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
+echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5
+echo "${ECHO_T}$tcl_cv_cc_pipe" >&6
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
fi
#------------------------------------------------------------------------
@@ -4619,6 +4624,78 @@ echo "${ECHO_T}$do64bitVIS" >&6
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
+ echo "$as_me:$LINENO: checking if gcc supports visibility \"hidden\"" >&5
+echo $ECHO_N "checking if gcc supports visibility \"hidden\"... $ECHO_C" >&6
+if test "${tcl_cv_cc_visibility_hidden+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}
+int
+main ()
+{
+f();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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_exeext'
+ { (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_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
+
+cat >>confdefs.h <<\_ACEOF
+#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
+_ACEOF
+
+ fi
+ fi
+
# Step 1: set the variable "system" to hold the name and version number
# for the system.
@@ -6081,14 +6158,16 @@ _ACEOF
fi
fi
fi
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then
cat >>confdefs.h <<\_ACEOF
-#define MAC_OSX_TCL 1
+#define MODULE_SCOPE __private_extern__
_ACEOF
+ fi
cat >>confdefs.h <<\_ACEOF
-#define MODULE_SCOPE __private_extern__
+#define MAC_OSX_TCL 1
_ACEOF
;;