summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authordas <das>2005-05-14 20:52:30 (GMT)
committerdas <das>2005-05-14 20:52:30 (GMT)
commit65286b9f063c3c50f48935273423c3157b0c2926 (patch)
tree5bd963b54e43eebbac431fc6523841b4b3eed7a3 /unix/tcl.m4
parent059da8747325b6904a2b0a2be8bc25294ef6f782 (diff)
downloadtcl-65286b9f063c3c50f48935273423c3157b0c2926.zip
tcl-65286b9f063c3c50f48935273423c3157b0c2926.tar.gz
tcl-65286b9f063c3c50f48935273423c3157b0c2926.tar.bz2
* macosx/tclMacOSXBundle.c:
* unix/tclUnixInit.c: * unix/tcl.m4 (Darwin): made use of CoreFoundation API configurable and added test of CoreFoundation availablility to allow building on ppc64, replaced HAVE_CFBUNDLE by HAVE_COREFOUNDATION; test for availability of Tiger or later OSSpinLockLock API. * unix/tclUnixNotfy.c: * unix/Makefile.in: * macosx/tclMacOSXNotify.c (new file): when CoreFoundation is available, use new CFRunLoop based notifier: allows easy integration with other event loops on Mac OS X, in particular the TkAqua Carbon event loop is now integrated via a standard tcl event source (instead of TkAqua upon loading having to finalize the exsting notifier and replace it with its custom version). [Patch 1202052] * tests/unixNotfy.test: don't run unthreaded tests on Darwin since notifier may be using threads even in unthreaded core. * unix/tclUnixPort.h: * unix/tcl.m4 (Darwin): test for thread-unsafe realpath durning configure, as Darwin 7 and later realpath is threadsafe. * macosx/tclMacOSXBundle.c: * unix/tclLoadDyld.c: * unix/tclUnixInit.c: fixed gcc 4.0 warnings. * unix/configure: autoconf-2.13
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m432
1 files changed, 30 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 8239fb8..73fb065 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -387,6 +387,10 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [
AC_MSG_WARN("Frameworks can only be built if --enable-shared is yes")
FRAMEWORK_BUILD=0
fi
+ if test $tcl_corefoundation = no; then
+ AC_MSG_WARN("Frameworks can only be used when CoreFoundation is available")
+ FRAMEWORK_BUILD=0
+ fi
else
AC_MSG_RESULT([standard shared library])
FRAMEWORK_BUILD=0
@@ -1389,11 +1393,35 @@ dnl AC_CHECK_TOOL(AR, ar)
PLAT_SRCS=\$\(MAC\_OSX_SRCS\)
TCL_SHLIB_LD_EXTRAS='-compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000'
TK_SHLIB_LD_EXTRAS=' -compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)'
- LIBS="$LIBS -framework CoreFoundation"
+ AC_MSG_CHECKING([whether to use CoreFoundation])
+ AC_ARG_ENABLE(corefoundation, [ --enable-corefoundation use CoreFoundation API [--enable-corefoundation]],
+ [tcl_corefoundation=$enableval], [tcl_corefoundation=yes])
+ AC_MSG_RESULT([$tcl_corefoundation])
+ if test $tcl_corefoundation = yes; then
+ AC_CACHE_CHECK([for CoreFoundation.framework], tcl_cv_lib_corefoundation, [
+ hold_libs=$LIBS
+ LIBS="$LIBS -framework CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
+ [CFBundleRef b = CFBundleGetMainBundle();],
+ tcl_cv_lib_corefoundation=yes, tcl_cv_lib_corefoundation=no)
+ LIBS=$hold_libs])
+ if test $tcl_cv_lib_corefoundation = yes; then
+ LIBS="$LIBS -framework CoreFoundation"
+ AC_DEFINE(HAVE_COREFOUNDATION)
+ fi
+ fi
+ AC_CHECK_HEADERS(libkern/OSAtomic.h)
+ AC_CHECK_FUNCS(OSSpinLockLock)
AC_DEFINE(MAC_OSX_TCL)
- AC_DEFINE(HAVE_CFBUNDLE)
AC_DEFINE(USE_VFORK)
AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8")
+ # prior to Darwin 7, realpath is not threadsafe, so don't
+ # use it when threads are enabled, c.f. bug # 711232:
+ AC_CHECK_FUNC(realpath)
+ if test "$ac_cv_func_realpath" = yes -a "${TCL_THREADS}" = 1 \
+ -a `uname -r | awk -F. '{print [$]1}'` -lt 7 ; then
+ ac_cv_func_realpath=no
+ fi
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""