summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordas <das>2005-11-27 02:33:48 (GMT)
committerdas <das>2005-11-27 02:33:48 (GMT)
commit869ae625bcbb07adbc4ebdbea88b0997540c0eb4 (patch)
tree0b3ddbb9d4e905eaba0c0baa102ace44b84277a5 /unix
parent4108d5e746022cd525e93215aeb41eb0a1ab3b7a (diff)
downloadtcl-869ae625bcbb07adbc4ebdbea88b0997540c0eb4.zip
tcl-869ae625bcbb07adbc4ebdbea88b0997540c0eb4.tar.gz
tcl-869ae625bcbb07adbc4ebdbea88b0997540c0eb4.tar.bz2
* unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to configure (flag can't be present twice, so can't be in both CFLAGS and LDFLAGS during configure), don't use -prebind when deploying on 10.4, define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542). (SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete autoconf macros. Sync with tk/unix/tcl.m4. * unix/configure.in: fix obsolete autoconf macros, sync gratuitous formatting/ordering differences with tk/unix/configure.in. * unix/Makefile.in: add CFLAGS to tclsh/tcltest link to make executable linking the same as during configure (needed to avoid loosing any linker relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS). Avoid concurrent linking of tclsh and compiling of tclTestInit.o or xtTestInit.o during parallel make. (checkstubs, checkdoc, checkexports): dependency and Darwin fixes (dist): add new macosx files. * unix/tclLoadDyld.c (TclpDlopen): use NSADDIMAGE_OPTION_WITH_SEARCHING on second NSAddImage only. [Bug 1204237] (TclGuessPackageName): should not be MODULE_SCOPE. (TclpLoadMemory): ppc64 and endian (i386) fixes, add support for loading universal (fat) bundles from memory. * unix/tclUnixFCmd.c: * macosx/tclMacOSXFCmd.c: ppc64 and endian (i386) fixes. (TclMacOSXCopyFileAttributes): add support for new Tiger copyfile() API to enable copying of xattrs & ACLs by [file copy]. * generic/tcl.h: add Darwin specifc configure overrides for TCL_WIDE defines to support fat compiles of ppc and ppc64 at the same time, (replaces Darwin CVS fix by emoy, rdar://3693001). add/correct location of version numbers in macosx files. * generic/tclInt.h: clarify fat compile comment. * unix/tclUnixPort.h: add Darwin specifc configure overrides to support fat compiles, where configure runs only once for multiple architectures (replaces Darwin CVS fix by emoy, rdar://3693001). * macosx/tclMacOSXBundle.c: * macosx/tclMacOSXNotify.c: * unix/tclUnixNotfy.c: * unix/tclUnixPort.h: fix #include order to support compile time override of HAVE_COREFOUNDATION in tclUnixPort.h when building for ppc64 * macosx/Tcl.pbproj/default.pbxuser (new file): * macosx/Tcl.pbproj/jingham.pbxuser: * macosx/Tcl.pbproj/project.pbxproj: * macosx/Tcl.xcode/default.pbxuser (new file): * macosx/Tcl.xcode/project.pbxproj (new file): * macosx/Tcl.xcodeproj/default.pbxuser (new file): * macosx/Tcl.xcodeproj/project.pbxproj (new file): new/updated projects for Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with native tcltest targets and support for universal (fat) compiles. * macosx/README: clarification/cleanup, document new Xcode projects and universal (fat) builds via CFLAGS (i.e. all of ppc ppc64 i386 at once). * unix/Makefile.in: * unix/aclocal.m4: * unix/configure.in: * unix/dltest/Makefile.in: * macosx/configure.ac (new file): add support for inclusion of unix/configure.in by macosx/configure.ac, allows generation of a config headers enabled configure script in macosx (required by Xcode projects). * macosx/GNUmakefile: rename from Makefile to avoid overwriting by configure run in tcl/macosx, add support for reusing configure cache, build target fixes, remove GENERIC_FLAGS override now handled by tcl.m4. * generic/tcl.decls: add Tcl_Main declaration as comment to avoid 'checkstubs' target complaining about it missing from stubs. * generic/regex.h: * generic/tclDate.c: * generic/tclEnv.c: * generic/tclGetDate.y: * generic/tclIOUtil.c: * generic/tclObj.c: * generic/tclStubInit.c: * generic/tclStubLib.c: * generic/tclPathObj.c: * generic/tclThreadAlloc.c: * generic/tclThreadStorage.c: * generic/tclTrace.c: * generic/tclVar.c: * generic/tommath.h: * tools/fix_tommath_h.tcl: * unix/tclUnixFCmd.c: ensure externally visible symbols not contained in stubs table are declared as MODULE_SCOPE (or as static if not used outside of own source file). These changes allow 'make checkstubs' to complete without error on Darwin with gcc 4. * generic/rege_dfa.c (getvacant): * generic/regexec.c (cfind): * generic/tclCompExpr.c (CompileSubExpr): * generic/tclNamesp.c (NamespaceEnsembleCmd): * unix/tclUnixChan.c (TclUnixWaitForFile): initialise variables to silence gcc 4 warnings. * generic/tclExecute.c (TclExecuteByteCode): fix unused variable warning when NO_WIDE_TYPE is defined. * generic/regguts.h: only #define NDEBUG if not already #defined. * unix/tclUnixNotfy.c: * macosx/tclMacOSXNotify.c: sync whitespace & comments. * unix/tclUnixPort.h: * win/tclWinPort.h: remove declaration of obsolete&unused TclpMutex API. * unix/configure: * unix/tclConfig.h.in: regen.
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in52
-rw-r--r--unix/aclocal.m42
-rwxr-xr-xunix/configure455
-rw-r--r--unix/configure.in66
-rw-r--r--unix/dltest/Makefile.in4
-rw-r--r--unix/tcl.m452
-rw-r--r--unix/tclConfig.h.in32
-rw-r--r--unix/tclLoadDyld.c68
-rw-r--r--unix/tclUnixChan.c4
-rw-r--r--unix/tclUnixFCmd.c7
-rw-r--r--unix/tclUnixNotfy.c23
-rw-r--r--unix/tclUnixPort.h37
12 files changed, 597 insertions, 205 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index ded10ae..24177d2 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -5,7 +5,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.177 2005/11/21 17:19:56 andreas_kupries Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.178 2005/11/27 02:33:50 das Exp $
VERSION = @TCL_VERSION@
MAJOR_VERSION = @TCL_MAJOR_VERSION@
@@ -168,7 +168,7 @@ SHELL = /bin/sh
INSTALL_STRIP_PROGRAM = -s
INSTALL_STRIP_LIBRARY = -S -S
-INSTALL = @srcdir@/install-sh -c
+INSTALL = @srcdir@/../unix/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
@@ -244,7 +244,7 @@ GENERIC_DIR = $(TOP_DIR)/generic
TOMMATH_DIR = $(TOP_DIR)/libtommath
COMPAT_DIR = $(TOP_DIR)/compat
TOOL_DIR = $(TOP_DIR)/tools
-UNIX_DIR = $(SRC_DIR)
+UNIX_DIR = $(TOP_DIR)/unix
MAC_OSX_DIR = $(TOP_DIR)/macosx
# Must be absolute because of the cd dltest $(DLTEST_DIR)/configure below.
DLTEST_DIR = @TCL_SRC_DIR@/unix/dltest
@@ -570,7 +570,7 @@ objs: ${OBJS}
tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE}
- ${CC} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
+ ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
${CC_SEARCH_FLAGS} -o tclsh
# Resetting the LIB_RUNTIME_DIR below is required so that
@@ -582,7 +582,7 @@ tcltest: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${BUILD_DLTEST}
$(MAKE) tcltest-real LIB_RUNTIME_DIR=`pwd`
tcltest-real:
- ${CC} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
+ ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
${CC_SEARCH_FLAGS} -o tcltest
# Note, in the target below TCL_LIBRARY needs to be set or else
@@ -717,8 +717,8 @@ install-binaries: binaries
else true; \
fi; \
done;
- @if test ! -x $(SRC_DIR)/install-sh; then \
- chmod +x $(SRC_DIR)/install-sh; \
+ @if test ! -x $(SRC_DIR)../unix/install-sh; then \
+ chmod +x $(SRC_DIR)/../unix/install-sh; \
fi
@echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/"
@@INSTALL_LIB@
@@ -757,8 +757,8 @@ install-libraries: libraries install-tzdata install-msgs
else true; \
fi; \
done;
- @if test ! -x $(SRC_DIR)/install-sh; then \
- chmod +x $(SRC_DIR)/install-sh; \
+ @if test ! -x $(SRC_DIR)/../unix/install-sh; then \
+ chmod +x $(SRC_DIR)/../unix/install-sh; \
fi
@echo "Installing header files";
@for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \
@@ -850,8 +850,8 @@ install-private-headers: libraries
else true; \
fi; \
done;
- @if test ! -x $(SRC_DIR)/install-sh; then \
- chmod +x $(SRC_DIR)/install-sh; \
+ @if test ! -x $(SRC_DIR)/../unix/install-sh; then \
+ chmod +x $(SRC_DIR)/../unix/install-sh; \
fi
@echo "Installing private header files";
@for i in $(GENERIC_DIR)/tclInt.h $(GENERIC_DIR)/tclIntDecls.h \
@@ -886,8 +886,12 @@ depend:
# complicated because they are compiled from tclAppInit.c. Can't use
# the "-o" option because this doesn't work on some strange compilers
# (e.g. UnixWare).
+# To enable concurrent parallel make of tclsh and tcltest resp xttest, these
+# targets have to depend on tclsh, this ensures that linking of tclsh with
+# tclAppInit.o does not execute concurrently with the renaming and recompiling
+# of that same object file in the targets below.
-tclTestInit.o: $(UNIX_DIR)/tclAppInit.c
+tclTestInit.o: $(UNIX_DIR)/tclAppInit.c tclsh
@if test -f tclAppInit.o ; then \
rm -f tclAppInit.sav; \
mv tclAppInit.o tclAppInit.sav; \
@@ -901,7 +905,7 @@ tclTestInit.o: $(UNIX_DIR)/tclAppInit.c
mv tclAppInit.sav tclAppInit.o; \
fi;
-xtTestInit.o: $(UNIX_DIR)/tclAppInit.c
+xtTestInit.o: $(UNIX_DIR)/tclAppInit.c tclsh
@if test -f tclAppInit.o ; then \
rm -f tclAppInit.sav; \
mv tclAppInit.o tclAppInit.sav; \
@@ -1513,12 +1517,13 @@ genstubs:
# tables.
#
-checkstubs:
- -@for i in `nm -p $(TCL_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \
+checkstubs: $(TCL_LIB_FILE)
+ -@for i in `nm -p $(TCL_LIB_FILE) \
+ | awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \
| sort -n`; do \
match=0; \
for j in $(TCL_DECLS); do \
- if [ `grep -c $$i $$j` -gt 0 ]; then \
+ if [ `grep -c "$$i *(" $$j` -gt 0 ]; then \
match=1; \
fi; \
done; \
@@ -1531,7 +1536,7 @@ checkstubs:
# manpages.
#
-checkdoc:
+checkdoc: $(TCL_LIB_FILE)
-@for i in `nm -p $(TCL_LIB_FILE) | awk '$$3 ~ /Tcl_/ { print $$3 }' \
| grep -v 'Cmd$$' | sort -n`; do \
match=0; \
@@ -1556,7 +1561,9 @@ checkuchar:
#
checkexports: $(TCL_LIB_FILE)
- -nm -p $(TCL_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]cl'
+ -@nm -p $(TCL_LIB_FILE) \
+ | awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \
+ | sort -n | grep -E -v '^[Tt]cl' || true
#
# Target to create a Tcl RPM for Linux. Requires that you be on a Linux
@@ -1663,12 +1670,15 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in
cp -p $(TOP_DIR)/win/README $(DISTDIR)/win
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win
mkdir $(DISTDIR)/macosx
- cp -p $(TOP_DIR)/macosx/Makefile \
+ cp -p $(TOP_DIR)/macosx/GNUmakefile $(TOP_DIR)/macosx/README \
$(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.in \
- $(DISTDIR)/macosx
+ $(TOP_DIR)/macosx/*.ac $(DISTDIR)/macosx
mkdir $(DISTDIR)/macosx/Tcl.pbproj
cp -p $(TOP_DIR)/macosx/Tcl.pbproj/*.pbx* $(DISTDIR)/macosx/Tcl.pbproj
- cp -p $(TOP_DIR)/macosx/README $(DISTDIR)/macosx
+ mkdir $(DISTDIR)/macosx/Tcl.xcode
+ cp -p $(TOP_DIR)/macosx/Tcl.xcode/*.pbx* $(DISTDIR)/macosx/Tcl.xcode
+ mkdir $(DISTDIR)/macosx/Tcl.xcodeproj
+ cp -p $(TOP_DIR)/macosx/Tcl.xcodeproj/*.pbx* $(DISTDIR)/macosx/Tcl.xcodeproj
mkdir $(DISTDIR)/unix/dltest
cp -p $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \
$(UNIX_DIR)/dltest/README \
diff --git a/unix/aclocal.m4 b/unix/aclocal.m4
index bc7540d..90d2e39 100644
--- a/unix/aclocal.m4
+++ b/unix/aclocal.m4
@@ -1 +1 @@
-builtin(include,tcl.m4)
+builtin(include,../unix/tcl.m4)
diff --git a/unix/configure b/unix/configure
index dd3785d..2f721f3 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1328,6 +1328,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
TCL_VERSION=8.5
TCL_MAJOR_VERSION=8
TCL_MINOR_VERSION=5
@@ -1344,6 +1345,8 @@ fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
+# Make sure srcdir is fully qualified!
+srcdir=`cd $srcdir ; pwd`
TCL_SRC_DIR=`cd $srcdir/..; pwd`
#------------------------------------------------------------------------
@@ -4224,6 +4227,68 @@ done
#------------------------------------------------------------------------
+# If we're using GCC, see if the compiler understands -pipe. If so, use it.
+# 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
+echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6
+ OLDCC="$CC"
+ CC="$CC -pipe"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 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_objext'
+ { (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
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+
+#------------------------------------------------------------------------
# Threads support
#------------------------------------------------------------------------
@@ -5070,68 +5135,6 @@ _ACEOF
fi
-#------------------------------------------------------------------------
-# If we're using GCC, see if the compiler understands -pipe. If so, use it.
-# 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
-echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6
- OLDCC="$CC"
- CC="$CC -pipe"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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_objext'
- { (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
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-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
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-
#--------------------------------------------------------------------
# Look for libraries that we will need when compiling the Tcl shell
#--------------------------------------------------------------------
@@ -6967,7 +6970,6 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
-
SHLIB_LD="${CC} -shared"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -7097,7 +7099,7 @@ rm -f conftest*
SHLIB_CFLAGS="-fpic";;
esac
SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
- SHLIB_LD_LIBS=""
+ SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7165,7 +7167,11 @@ rm -f conftest*
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
- SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
+ if test $do64bit = yes; then
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ fi
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5
echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6
if test "${tcl_cv_ld_single_module+set}" = set; then
@@ -7231,7 +7237,12 @@ echo "${ECHO_T}$tcl_cv_ld_single_module" >&6
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
- LDFLAGS="$LDFLAGS -prebind -headerpad_max_install_names"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test -z "${MACOSX_DEPLOYMENT_TARGET}" -o \
+ `echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'` -lt 4; then
+ LDFLAGS="$LDFLAGS -prebind"
+ fi
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5
echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6
if test "${tcl_cv_ld_search_paths_first+set}" = set; then
@@ -7316,7 +7327,13 @@ if test "${tcl_cv_lib_corefoundation+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- hold_libs=$LIBS
+ hold_libs=$LIBS; hold_cflags=$CFLAGS
+ if test $do64bit_ok = no ; then
+ # remove -arch ppc64 from CFLAGS while testing presence
+ # of CF, otherwise all archs will have CF disabled.
+ # CF for ppc64 is disabled in tclUnixPort.h instead.
+ CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/'`"
+ fi
LIBS="$LIBS -framework CoreFoundation"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -7364,7 +7381,7 @@ tcl_cv_lib_corefoundation=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LIBS=$hold_libs
+ LIBS=$hold_libs; CFLAGS=$hold_cflags
fi
echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5
echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6
@@ -7630,6 +7647,258 @@ fi
done
+for ac_header in copyfile.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 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_objext'
+ { (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
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in copyfile
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ 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
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
cat >>confdefs.h <<\_ACEOF
#define MAC_OSX_TCL 1
_ACEOF
@@ -7654,6 +7923,11 @@ cat >>confdefs.h <<\_ACEOF
#define TCL_LOAD_FROM_MEMORY 1
_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING 1
+_ACEOF
+
# prior to Darwin 7, realpath is not threadsafe, so don't
# use it when threads are enabled, c.f. bug # 711232:
echo "$as_me:$LINENO: checking for realpath" >&5
@@ -7747,7 +8021,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_func_realpath" >&5
echo "${ECHO_T}$ac_cv_func_realpath" >&6
- if test "$ac_cv_func_realpath" = yes -a "${TCL_THREADS}" = 1 \
+ 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
@@ -10552,7 +10826,7 @@ fi
echo "$as_me:$LINENO: result: $tcl_cv_type_fd_set" >&5
echo "${ECHO_T}$tcl_cv_type_fd_set" >&6
-tk_ok=$tcl_cv_type_fd_set
+tcl_ok=$tcl_cv_type_fd_set
if test $tcl_cv_type_fd_set = no; then
echo "$as_me:$LINENO: checking for fd_mask in sys/select" >&5
echo $ECHO_N "checking for fd_mask in sys/select... $ECHO_C" >&6
@@ -10586,10 +10860,10 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_SELECT_H 1
_ACEOF
- tk_ok=yes
+ tcl_ok=yes
fi
fi
-if test $tk_ok = no; then
+if test $tcl_ok = no; then
cat >>confdefs.h <<\_ACEOF
#define NO_FD_SET 1
@@ -11306,7 +11580,7 @@ _ACEOF
#
echo "$as_me:$LINENO: checking long timezone variable" >&5
echo $ECHO_N "checking long timezone variable... $ECHO_C" >&6
- if test "${tcl_cv_var_timezone+set}" = set; then
+ if test "${tcl_cv_timezone_long+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -13737,8 +14011,7 @@ fi;
HAVE_LANGINFO=0
if test "$langinfo_ok" = "yes"; then
- if test "$langinfo_ok" = "yes"; then
- if test "${ac_cv_header_langinfo_h+set}" = set; then
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
echo "$as_me:$LINENO: checking for langinfo.h" >&5
echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
if test "${ac_cv_header_langinfo_h+set}" = set; then
@@ -13882,12 +14155,14 @@ else
fi
- fi
fi
echo "$as_me:$LINENO: checking whether to use nl_langinfo" >&5
echo $ECHO_N "checking whether to use nl_langinfo... $ECHO_C" >&6
if test "$langinfo_ok" = "yes"; then
- cat >conftest.$ac_ext <<_ACEOF
+ if test "${tcl_cv_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -13924,27 +14199,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- langinfo_ok=yes
+ tcl_cv_langinfo_h=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-langinfo_ok=no
+tcl_cv_langinfo_h=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- if test "$langinfo_ok" = "no"; then
- langinfo_ok="no (could not compile with nl_langinfo)";
- fi
- if test "$langinfo_ok" = "yes"; then
+fi
+
+ echo "$as_me:$LINENO: result: $tcl_cv_langinfo_h" >&5
+echo "${ECHO_T}$tcl_cv_langinfo_h" >&6
+ if test $tcl_cv_langinfo_h = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_LANGINFO 1
_ACEOF
fi
- fi
- echo "$as_me:$LINENO: result: $langinfo_ok" >&5
+ else
+ echo "$as_me:$LINENO: result: $langinfo_ok" >&5
echo "${ECHO_T}$langinfo_ok" >&6
+ fi
#--------------------------------------------------------------------
@@ -14784,7 +15061,7 @@ TCL_SHARED_BUILD=${SHARED_BUILD}
- ac_config_files="$ac_config_files Makefile dltest/Makefile tclConfig.sh"
+ ac_config_files="$ac_config_files Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -15333,9 +15610,9 @@ do
case "$ac_config_target" in
# Handling of arguments.
"Tcl-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tcl-Info.plist:../macosx/Tcl-Info.plist.in" ;;
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "dltest/Makefile" ) CONFIG_FILES="$CONFIG_FILES dltest/Makefile" ;;
- "tclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tclConfig.sh" ;;
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;;
+ "dltest/Makefile" ) CONFIG_FILES="$CONFIG_FILES dltest/Makefile:../unix/dltest/Makefile.in" ;;
+ "tclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tclConfig.sh:../unix/tclConfig.sh.in" ;;
"Tcl.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tcl.framework" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
diff --git a/unix/configure.in b/unix/configure.in
index 4f521e4..f64e499 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,16 +3,26 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.137 2005/08/23 18:13:50 mdejong Exp $
+# RCS: @(#) $Id: configure.in,v 1.138 2005/11/27 02:33:50 das Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.59)
-dnl AC_CONFIG_HEADERS([tclConfig.h])
-dnl AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TCL_CONFIG_H -imacros tclConfig.h"])
-dnl AH_TOP([#ifndef _TCLCONFIG
-dnl #define _TCLCONFIG])
-dnl AH_BOTTOM([#endif /* _TCLCONFIG */])
+dnl This is only used when included from macosx/configure.ac
+m4_ifdef([SC_USE_CONFIG_HEADERS], [
+ AC_CONFIG_HEADERS([tclConfig.h:../unix/tclConfig.h.in])
+ AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TCL_CONFIG_H -imacros tclConfig.h"])
+ AH_TOP([
+ #ifndef _TCLCONFIG
+ #define _TCLCONFIG])
+ AH_BOTTOM([
+ /* Undef unused package specific autoheader defines so that we can
+ * include both tclConfig.h and tkConfig.h at the same time: */
+ /* override */ #undef PACKAGE_NAME
+ /* override */ #undef PACKAGE_STRING
+ /* override */ #undef PACKAGE_TARNAME
+ #endif /* _TCLCONFIG */])
+])
TCL_VERSION=8.5
TCL_MAJOR_VERSION=8
@@ -30,6 +40,8 @@ fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
+# Make sure srcdir is fully qualified!
+srcdir=`cd $srcdir ; pwd`
TCL_SRC_DIR=`cd $srcdir/..; pwd`
#------------------------------------------------------------------------
@@ -61,18 +73,6 @@ AC_PROG_CC
SC_MISSING_POSIX_HEADERS
#------------------------------------------------------------------------
-# Threads support
-#------------------------------------------------------------------------
-
-SC_ENABLE_THREADS
-
-#------------------------------------------------------------------------
-# Embedded configuration information, encoding to use for the values, TIP #59
-#------------------------------------------------------------------------
-
-SC_TCL_CFG_ENCODING
-
-#------------------------------------------------------------------------
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
# It makes compiling go faster. (This is only a performance feature.)
#------------------------------------------------------------------------
@@ -89,6 +89,18 @@ if test -n "$GCC"; then
fi
fi
+#------------------------------------------------------------------------
+# Threads support
+#------------------------------------------------------------------------
+
+SC_ENABLE_THREADS
+
+#------------------------------------------------------------------------
+# Embedded configuration information, encoding to use for the values, TIP #59
+#------------------------------------------------------------------------
+
+SC_TCL_CFG_ENCODING
+
#--------------------------------------------------------------------
# Look for libraries that we will need when compiling the Tcl shell
#--------------------------------------------------------------------
@@ -165,19 +177,19 @@ AC_CACHE_VAL(tcl_cv_type_fd_set,
AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no))
AC_MSG_RESULT($tcl_cv_type_fd_set)
-tk_ok=$tcl_cv_type_fd_set
+tcl_ok=$tcl_cv_type_fd_set
if test $tcl_cv_type_fd_set = no; then
AC_MSG_CHECKING([for fd_mask in sys/select])
AC_CACHE_VAL(tcl_cv_grep_fd_mask,
- AC_HEADER_EGREP(fd_mask, sys/select.h,
+ AC_EGREP_HEADER(fd_mask, sys/select.h,
tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing))
AC_MSG_RESULT($tcl_cv_grep_fd_mask)
if test $tcl_cv_grep_fd_mask = present; then
- AC_DEFINE(HAVE_SYS_SELECT_H, 1, [May we include <sys/select.h>?])
- tk_ok=yes
+ AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Should we include <sys/select.h>?])
+ tcl_ok=yes
fi
fi
-if test $tk_ok = no; then
+if test $tcl_ok = no; then
AC_DEFINE(NO_FD_SET, 1, [Do we have fd_set?])
fi
@@ -207,7 +219,7 @@ AC_FUNC_MEMCMP
#--------------------------------------------------------------------
AC_CHECK_FUNC(memmove, , [
AC_DEFINE(NO_MEMMOVE, 1, [Do we have memmove()?])
- AC_DEFINE(NO_STRING_H, 1, [May we include <string.h>?]) ])
+ AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?]) ])
#--------------------------------------------------------------------
# On some systems strstr is broken: it returns a pointer even
@@ -642,5 +654,9 @@ AC_SUBST(EXTRA_BUILD_HTML)
dnl Disable the automake-friendly normalization of LIBOBJS
dnl performed by autoconf 2.53 and later. It's not correct for us.
define([_AC_LIBOBJS_NORMALIZE],[])
-AC_CONFIG_FILES([Makefile dltest/Makefile tclConfig.sh])
+AC_CONFIG_FILES([
+ Makefile:../unix/Makefile.in
+ dltest/Makefile:../unix/dltest/Makefile.in
+ tclConfig.sh:../unix/tclConfig.sh.in
+])
AC_OUTPUT
diff --git a/unix/dltest/Makefile.in b/unix/dltest/Makefile.in
index 92fe4a4..f151262 100644
--- a/unix/dltest/Makefile.in
+++ b/unix/dltest/Makefile.in
@@ -1,7 +1,7 @@
# This Makefile is used to create several test cases for Tcl's load
# command. It also illustrates how to take advantage of configuration
# exported by Tcl to set up Makefiles for shared libraries.
-# RCS: @(#) $Id: Makefile.in,v 1.18 2005/05/10 18:35:29 kennykb Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.19 2005/11/27 02:33:50 das Exp $
CC = @CC@
LIBS = @TCL_BUILD_STUB_LIB_SPEC@ @TCL_LIBS@
@@ -10,7 +10,7 @@ SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
-SRC_DIR = @srcdir@
+SRC_DIR = @TCL_SRC_DIR@/unix/dltest
BUILD_DIR = @builddir@
TCL_VERSION= @TCL_VERSION@
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 657f48c..571d836 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -721,22 +721,20 @@ AC_DEFUN(SC_ENABLE_LANGINFO, [
HAVE_LANGINFO=0
if test "$langinfo_ok" = "yes"; then
- if test "$langinfo_ok" = "yes"; then
- AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
- fi
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
fi
AC_MSG_CHECKING([whether to use nl_langinfo])
if test "$langinfo_ok" = "yes"; then
- AC_TRY_COMPILE([#include <langinfo.h>],
- [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no])
- if test "$langinfo_ok" = "no"; then
- langinfo_ok="no (could not compile with nl_langinfo)";
- fi
- if test "$langinfo_ok" = "yes"; then
+ AC_CACHE_VAL(tcl_cv_langinfo_h,
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no]))
+ AC_MSG_RESULT($tcl_cv_langinfo_h)
+ if test $tcl_cv_langinfo_h = yes; then
AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
fi
+ else
+ AC_MSG_RESULT([$langinfo_ok])
fi
- AC_MSG_RESULT([$langinfo_ok])
])
#--------------------------------------------------------------------
@@ -1273,7 +1271,6 @@ dnl AC_CHECK_TOOL(AR, ar)
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
-
SHLIB_LD="${CC} -shared"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -1383,7 +1380,7 @@ dnl AC_CHECK_TOOL(AR, ar)
SHLIB_CFLAGS="-fpic";;
esac
SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
- SHLIB_LD_LIBS=""
+ SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1435,7 +1432,11 @@ dnl AC_CHECK_TOOL(AR, ar)
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
- SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
+ if test $do64bit = yes; then
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ fi
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
@@ -1448,7 +1449,12 @@ dnl AC_CHECK_TOOL(AR, ar)
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
- LDFLAGS="$LDFLAGS -prebind -headerpad_max_install_names"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test -z "${MACOSX_DEPLOYMENT_TARGET}" -o \
+ `echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print [$]2}'` -lt 4; then
+ LDFLAGS="$LDFLAGS -prebind"
+ fi
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
@@ -1470,12 +1476,18 @@ dnl AC_CHECK_TOOL(AR, ar)
AC_MSG_RESULT([$tcl_corefoundation])
if test $tcl_corefoundation = yes; then
AC_CACHE_CHECK([for CoreFoundation.framework], tcl_cv_lib_corefoundation, [
- hold_libs=$LIBS
+ hold_libs=$LIBS; hold_cflags=$CFLAGS
+ if test $do64bit_ok = no ; then
+ # remove -arch ppc64 from CFLAGS while testing presence
+ # of CF, otherwise all archs will have CF disabled.
+ # CF for ppc64 is disabled in tclUnixPort.h instead.
+ CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/'`"
+ fi
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])
+ LIBS=$hold_libs; CFLAGS=$hold_cflags])
if test $tcl_cv_lib_corefoundation = yes; then
LIBS="$LIBS -framework CoreFoundation"
AC_DEFINE(HAVE_COREFOUNDATION, 1,
@@ -1484,16 +1496,20 @@ dnl AC_CHECK_TOOL(AR, ar)
fi
AC_CHECK_HEADERS(libkern/OSAtomic.h)
AC_CHECK_FUNCS(OSSpinLockLock)
+ AC_CHECK_HEADERS(copyfile.h)
+ AC_CHECK_FUNCS(copyfile)
AC_DEFINE(MAC_OSX_TCL, 1, [Is this a Mac I see before me?])
AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?])
AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8",
[Are we to override what our default encoding is?])
AC_DEFINE(MODULE_SCOPE, __private_extern__, [Linker support for module scope symbols])
AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1, [Can this platform load code from memory?])
+ AC_DEFINE(TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING, 1,
+ [Use better emulation of non-blocking channels for channels without BlockModeProc?])
# 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 \
+ 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
@@ -2322,7 +2338,7 @@ AC_DEFUN(SC_TIME_HANDLER, [
# (like convex) have timezone functions, etc.
#
AC_MSG_CHECKING([long timezone variable])
- AC_CACHE_VAL(tcl_cv_var_timezone,
+ AC_CACHE_VAL(tcl_cv_timezone_long,
AC_TRY_COMPILE([#include <time.h>],
[extern long timezone;
timezone += 1;
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 51aa0ed..98d4908 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -1,7 +1,8 @@
-/* tclConfig.h.in. Generated from configure.in by autoheader. */
+/* ../unix/tclConfig.h.in. Generated from configure.ac by autoheader. */
-#ifndef _TCLCONFIG
-#define _TCLCONFIG
+
+ #ifndef _TCLCONFIG
+ #define _TCLCONFIG
/* Is pthread_attr_get_np() declared in <pthread.h>? */
#undef ATTRGETNP_NOT_DECLARED
@@ -18,6 +19,12 @@
/* Define to 1 if you have the `chflags' function. */
#undef HAVE_CHFLAGS
+/* Define to 1 if you have the `copyfile' function. */
+#undef HAVE_COPYFILE
+
+/* Define to 1 if you have the <copyfile.h> header file. */
+#undef HAVE_COPYFILE_H
+
/* Do we have access to Darwin CoreFoundation.framework ? */
#undef HAVE_COREFOUNDATION
@@ -130,7 +137,7 @@
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
-/* May we include <sys/select.h>? */
+/* Should we include <sys/select.h>? */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/stat.h> header file. */
@@ -213,7 +220,7 @@
/* Do we have strerror() */
#undef NO_STRERROR
-/* May we include <string.h>? */
+/* Do we have <string.h>? */
#undef NO_STRING_H
/* Do we have <sys/wait.h>? */
@@ -279,6 +286,10 @@
/* Is Tcl built as a framework? */
#undef TCL_FRAMEWORK
+/* Use better emulation of non-blocking channels for channels without
+ BlockModeProc? */
+#undef TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING
+
/* Can this platform load code from memory? */
#undef TCL_LOAD_FROM_MEMORY
@@ -343,6 +354,9 @@
/* Add the _LARGEFILE64_SOURCE flag when building */
#undef _LARGEFILE64_SOURCE
+/* Add the _LARGEFILE_SOURCE64 flag when building */
+#undef _LARGEFILE_SOURCE64
+
/* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */
#undef _OE_SOCKETS
@@ -387,4 +401,10 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
-#endif /* _TCLCONFIG */
+
+ /* Undef unused package specific autoheader defines so that we can
+ * include both tclConfig.h and tkConfig.h at the same time: */
+ /* override */ #undef PACKAGE_NAME
+ /* override */ #undef PACKAGE_STRING
+ /* override */ #undef PACKAGE_TARNAME
+ #endif /* _TCLCONFIG */
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index b963e43..8d776a0 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -12,11 +12,14 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclLoadDyld.c,v 1.20 2005/11/11 23:46:34 dkf Exp $
+ * RCS: @(#) $Id: tclLoadDyld.c,v 1.21 2005/11/27 02:33:50 das Exp $
*/
#include "tclInt.h"
#include <mach-o/dyld.h>
+#include <mach-o/fat.h>
+#include <mach-o/swap.h>
+#include <mach-o/arch.h>
#include <mach/mach.h>
typedef struct Tcl_DyldModuleHandle {
@@ -118,8 +121,7 @@ TclpDlopen(
*/
native = Tcl_FSGetNativePath(pathPtr);
- dyldLibHeader = NSAddImage(native, NSADDIMAGE_OPTION_WITH_SEARCHING |
- NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ dyldLibHeader = NSAddImage(native, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
if (!dyldLibHeader) {
NSLinkEditErrors editError;
@@ -146,8 +148,8 @@ TclpDlopen(
if (!dyldLibHeader) {
NSLinkEditError(&editError, &errorNumber, &name, &msg);
}
- } else if ((editError==NSLinkEditFileFormatError
- && errorNumber==EBADMACHO)
+ } else if ((editError == NSLinkEditFileFormatError
+ && errorNumber == EBADMACHO)
|| editError == NSLinkEditOtherError){
/*
* The requested file was found but was not of type MH_DYLIB,
@@ -354,7 +356,7 @@ TclpUnloadFile(
*----------------------------------------------------------------------
*/
-MODULE_SCOPE int
+int
TclGuessPackageName(
CONST char *fileName, /* Name of file containing package (already
* translated to local form if needed). */
@@ -463,15 +465,57 @@ TclpLoadMemory(
if (codeSize >= 0) {
NSObjectFileImageReturnCode err = NSObjectFileImageSuccess;
-
+ CONST struct fat_header *fh = buffer;
+ uint32_t ms = 0;
#ifndef __LP64__
- struct mach_header *mh = buffer;
- if (codeSize < sizeof(struct mach_header) || mh->magic != MH_MAGIC
+ CONST struct mach_header *mh = NULL;
+ #define mh_magic OSSwapHostToBigInt32(MH_MAGIC)
+ #define mh_size sizeof(struct mach_header)
#else
- struct mach_header_64 *mh = buffer;
- if (codeSize < sizeof(struct mach_header_64) || mh->magic != MH_MAGIC_64
+ CONST struct mach_header_64 *mh = NULL;
+ #define mh_magic OSSwapHostToBigInt32(MH_MAGIC_64)
+ #define mh_size sizeof(struct mach_header_64)
#endif
- || mh->filetype != MH_BUNDLE) {
+
+ if (codeSize >= sizeof(struct fat_header)
+ && fh->magic == OSSwapHostToBigInt32(FAT_MAGIC)) {
+ /*
+ * Fat binary, try to find mach_header for our architecture
+ */
+ uint32_t fh_nfat_arch = OSSwapBigToHostInt32(fh->nfat_arch);
+
+ if (codeSize >= sizeof(struct fat_header) +
+ fh_nfat_arch * sizeof(struct fat_arch)) {
+ void *fatarchs = buffer + sizeof(struct fat_header);
+ CONST NXArchInfo *arch = NXGetLocalArchInfo();
+ struct fat_arch *fa;
+
+ if (fh->magic != FAT_MAGIC) {
+ swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder);
+ }
+ fa = NXFindBestFatArch(arch->cputype, arch->cpusubtype,
+ fatarchs, fh_nfat_arch);
+ if (fa) {
+ mh = buffer + fa->offset;
+ ms = fa->size;
+ } else {
+ err = NSObjectFileImageInappropriateFile;
+ }
+ if (fh->magic != FAT_MAGIC) {
+ swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder);
+ }
+ } else {
+ err = NSObjectFileImageInappropriateFile;
+ }
+ } else {
+ /*
+ * Thin binary
+ */
+ mh = buffer;
+ ms = codeSize;
+ }
+ if (ms && !(ms >= mh_size && mh->magic == mh_magic &&
+ mh->filetype == OSSwapHostToBigInt32(MH_BUNDLE))) {
err = NSObjectFileImageInappropriateFile;
}
if (err == NSObjectFileImageSuccess) {
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 364bd54..42dbcbe 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixChan.c,v 1.63 2005/11/11 23:46:34 dkf Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.64 2005/11/27 02:33:50 das Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -3151,7 +3151,7 @@ TclUnixWaitForFile(
* at all, and a value of -1 means wait
* forever. */
{
- Tcl_Time abortTime, now;
+ Tcl_Time abortTime = {0, 0}, now; /* silence gcc 4 warning */
struct timeval blockTime, *timeoutPtr;
int index, bit, numFound, result = 0;
fd_mask readyMasks[3*MASK_SIZE];
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 9bb0b1f..c65bbec 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFCmd.c,v 1.48 2005/11/09 00:53:33 hobbs Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.49 2005/11/27 02:33:50 das Exp $
*
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
@@ -128,6 +128,7 @@ enum {
UNIX_INVALID_ATTRIBUTE /* lint - last enum value needs no trailing , */
};
+MODULE_SCOPE CONST char *tclpFileAttrStrings[];
CONST char *tclpFileAttrStrings[] = {
"-group", "-owner", "-permissions",
#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
@@ -139,6 +140,7 @@ CONST char *tclpFileAttrStrings[] = {
NULL
};
+MODULE_SCOPE CONST TclFileAttrProcs tclpFileAttrProcs[];
CONST TclFileAttrProcs tclpFileAttrProcs[] = {
{GetGroupAttribute, SetGroupAttribute},
{GetOwnerAttribute, SetOwnerAttribute},
@@ -422,6 +424,9 @@ DoCopyFile(
if (symlink(link, dst) < 0) { /* INTL: Native. */
return TCL_ERROR;
}
+#ifdef MAC_OSX_TCL
+ TclMacOSXCopyFileAttributes(src, dst, &srcStatBuf);
+#endif
break;
}
#endif
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 46c39e9..fb51d1b 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -10,12 +10,12 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixNotfy.c,v 1.29 2005/11/02 23:26:50 dkf Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.30 2005/11/27 02:33:50 das Exp $
*/
+#include "tclInt.h"
#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
* in tclMacOSXNotify.c */
-#include "tclInt.h"
#include <signal.h>
/*
@@ -60,7 +60,6 @@ typedef struct FileHandlerEvent {
} FileHandlerEvent;
/*
- *
* The following structure contains a set of select() masks to track readable,
* writable, and exceptional conditions.
*/
@@ -99,7 +98,7 @@ typedef struct ThreadSpecificData {
/* All threads that are currently waiting on
* an event have their ThreadSpecificData
* structure on a doubly-linked listed formed
- * from these pointers. You must hold the
+ * from these pointers. You must hold the
* notifierMutex lock before accessing these
* fields. */
Tcl_Condition waitCV; /* Any other thread alerts a notifier that an
@@ -164,7 +163,7 @@ TCL_DECLARE_MUTEX(notifierMutex)
static Tcl_Condition notifierCV;
/*
- * The pollState bits:
+ * The pollState bits
* POLL_WANT is set by each thread before it waits on its condition
* variable. It is checked by the notifier before it does select.
* POLL_DONE is set by the notifier if it goes into select after seeing
@@ -277,8 +276,9 @@ Tcl_FinalizeNotifier(
if (notifierCount == 0) {
int result;
+
if (triggerPipe < 0) {
- Tcl_Panic("Tcl_FinalizeNotifier: notifier pipe not initialized");
+ Tcl_Panic("Tcl_FinalizeNotifier: notifier pipe not initialized.");
}
/*
@@ -297,9 +297,10 @@ Tcl_FinalizeNotifier(
while(triggerPipe >= 0) {
Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
}
+
result = Tcl_JoinThread(notifierThread, NULL);
if (result) {
- Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier thread");
+ Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier thread.");
}
}
@@ -431,7 +432,8 @@ Tcl_CreateFileHandler(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
FileHandler *filePtr;
- if (tclStubs.tcl_CreateFileHandler != tclOriginalNotifier.createFileHandlerProc) {
+ if (tclStubs.tcl_CreateFileHandler !=
+ tclOriginalNotifier.createFileHandlerProc) {
tclStubs.tcl_CreateFileHandler(fd, mask, proc, clientData);
return;
}
@@ -502,7 +504,8 @@ Tcl_DeleteFileHandler(
int i;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- if (tclStubs.tcl_DeleteFileHandler != tclOriginalNotifier.deleteFileHandlerProc) {
+ if (tclStubs.tcl_DeleteFileHandler !=
+ tclOriginalNotifier.deleteFileHandlerProc) {
tclStubs.tcl_DeleteFileHandler(fd);
return;
}
@@ -512,7 +515,7 @@ Tcl_DeleteFileHandler(
*/
for (prevPtr = NULL, filePtr = tsdPtr->firstFileHandlerPtr; ;
- prevPtr = filePtr, filePtr = filePtr->nextPtr) {
+ prevPtr = filePtr, filePtr = filePtr->nextPtr) {
if (filePtr == NULL) {
return;
}
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index eb4dbda..d2a64e1 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -19,7 +19,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixPort.h,v 1.42 2005/05/14 20:46:48 das Exp $
+ * RCS: @(#) $Id: tclUnixPort.h,v 1.43 2005/11/27 02:33:50 das Exp $
*/
#ifndef _TCLUNIXPORT
@@ -502,6 +502,24 @@ extern double strtod();
#define TclpPanic ((Tcl_PanicProc *) NULL)
/*
+ * Darwin specifc configure overrides (to support fat compiles, where
+ * configure runs only once for multiple architectures):
+ */
+
+#ifdef __APPLE__
+# ifdef __LP64__
+# undef HAVE_COREFOUNDATION
+# endif /* __LP64__ */
+# ifdef __DARWIN_UNIX03
+# define USE_TERMIOS 1
+# undef HAVE_PUTENV_THAT_COPIES
+# else /* !__DARWIN_UNIX03 */
+# undef USE_TERMIOS
+# define HAVE_PUTENV_THAT_COPIES 1
+# endif /* __DARWIN_UNIX03 */
+#endif /* __APPLE__ */
+
+/*
*---------------------------------------------------------------------------
* The following macros and declarations represent the interface between
* generic and unix-specific parts of Tcl. Some of the macros may override
@@ -543,19 +561,7 @@ typedef int socklen_t;
#define TclpExit exit
-/*
- * Platform specific mutex definition used by memory allocators.
- * These mutexes are statically allocated and explicitly initialized.
- * Most modules do not use this, but instead use Tcl_Mutex types and
- * Tcl_MutexLock and Tcl_MutexUnlock that are self-initializing.
- */
-
#ifdef TCL_THREADS
-# include <pthread.h>
-typedef pthread_mutex_t TclpMutex;
-EXTERN void TclpMutexInit _ANSI_ARGS_((TclpMutex *mPtr));
-EXTERN void TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr));
-EXTERN void TclpMutexUnlock _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN struct tm * TclpLocaltime(CONST time_t *);
EXTERN struct tm * TclpGmtime(CONST time_t *);
EXTERN char * TclpInetNtoa(struct in_addr);
@@ -580,11 +586,6 @@ EXTERN int pthread_getattr_np _ANSI_ARGS_((pthread_t, pthread_attr_t *));
# endif
# endif /* HAVE_PTHREAD_GETATTR_NP */
# endif /* HAVE_PTHREAD_ATTR_GET_NP */
-#else
-typedef int TclpMutex;
-# define TclpMutexInit(a)
-# define TclpMutexLock(a)
-# define TclpMutexUnlock(a)
#endif /* TCL_THREADS */
#endif /* _TCLUNIXPORT */