diff options
author | das <das> | 2007-01-19 01:03:58 (GMT) |
---|---|---|
committer | das <das> | 2007-01-19 01:03:58 (GMT) |
commit | 34a3970c39dead78485d1bd7b7f4b858922c8f69 (patch) | |
tree | 8c889dd8b584c804f47a564d9fc3ed74243866d6 /macosx | |
parent | 79321316d659aa0a2e5790798db88d38b8a9a835 (diff) | |
download | tcl-34a3970c39dead78485d1bd7b7f4b858922c8f69.zip tcl-34a3970c39dead78485d1bd7b7f4b858922c8f69.tar.gz tcl-34a3970c39dead78485d1bd7b7f4b858922c8f69.tar.bz2 |
* macosx/tclMacOSXFCmd.c (TclMacOSXSetFileAttribute): on some versions
of Mac OS X, truncate() fails on resource forks, in that case use
open() with O_TRUNC instead.
* macosx/tclMacOSXNotify.c: accommodate changes to prototypes of
OSSpinLock(Un)Lock API.
* macosx/Tcl.xcodeproj/project.pbxproj: ensure HOME and USER env vars
* macosx/Tcl.xcodeproj/default.pbxuser: are defined when running
testsuite from Xcode.
* tests/env.test: add extra system env vars that need to be preserved
on some Mac OS X versions for testsuite to work.
* unix/Makefile.in: move libtommath defines into configure.in to avoid
* unix/configure.in: replicating them across multiple buildsystems.
* macosx/Tcl.xcodeproj/project.pbxproj:
* unix/tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861]
(Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when
present in CFLAGS to avoid discrepancies between what headers configure
sees during preprocessing tests and compiling tests.
* unix/configure: autoconf-2.59
* unix/tclConfig.h.in: autoheader-2.59
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Tcl.xcodeproj/default.pbxuser | 19 | ||||
-rw-r--r-- | macosx/Tcl.xcodeproj/project.pbxproj | 10 | ||||
-rw-r--r-- | macosx/tclMacOSXFCmd.c | 13 | ||||
-rw-r--r-- | macosx/tclMacOSXNotify.c | 20 |
4 files changed, 44 insertions, 18 deletions
diff --git a/macosx/Tcl.xcodeproj/default.pbxuser b/macosx/Tcl.xcodeproj/default.pbxuser index 4a2e8aa..e425112 100644 --- a/macosx/Tcl.xcodeproj/default.pbxuser +++ b/macosx/Tcl.xcodeproj/default.pbxuser @@ -73,11 +73,26 @@ value = "${SRCROOT}/../../tcl/library"; }, { - active = NO; + active = YES; name = TCLLIBPATH; value = /Library/Tcl; }, { + active = YES; + name = HOME; + value = "/Users/${USER}"; + }, + { + active = YES; + name = USER; + value = "${USER}"; + }, + { + active = YES; + name = MallocBadFreeAbort; + value = 1; + }, + { active = NO; name = DYLD_PRINT_LIBRARIES; }, @@ -90,6 +105,8 @@ }; sourceDirectories = ( ); + variableFormatDictionary = { + }; }; F944EB9C08F798180049FDD4 /* Source Control */ = { isa = PBXSourceControlManager; diff --git a/macosx/Tcl.xcodeproj/project.pbxproj b/macosx/Tcl.xcodeproj/project.pbxproj index 14e3501..75ec251 100644 --- a/macosx/Tcl.xcodeproj/project.pbxproj +++ b/macosx/Tcl.xcodeproj/project.pbxproj @@ -1939,7 +1939,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "if [ \"${ACTION:-build}\" == \"build\" ]; then\ncd \"${TARGET_TEMP_DIR}\"; rm -rf \"${DERIVED_FILE_DIR}\"; mkdir -p \"${DERIVED_FILE_DIR}\"\nprintf '%s%s%s%s%s' '\npackage require tcltest 2.2\nnamespace import tcltest::*\nconfigure -testdir [file normalize {' \"${TCL_SRCROOT}\" '/tests}]\nconfigure -tmpdir [file normalize {' \"${DERIVED_FILE_DIR}\" '}]\nconfigure -verbose [concat [configure -verbose] line]\n# following test only fails when testsuite is run from inside Xcode, so skip it\nconfigure -skip [concat [configure -skip] stack-3.1]\nrunAllTests\n' | \"${TEST_RIG}\"; TEST_RIG_RESULT=$?\n[ ${TEST_RIG_RESULT} -ne 0 ] && echo \"tcltest:0: error: tcltest exited abnormally with code ${TEST_RIG_RESULT}.\"\nexit ${TEST_RIG_RESULT}\nfi"; + shellScript = "if [ \"${ACTION:-build}\" == \"build\" ]; then\nif [ -z \"${HOME}\" ]; then export HOME=\"$(echo ~)\"; fi\ncd \"${TARGET_TEMP_DIR}\"; rm -rf \"${DERIVED_FILE_DIR}\"; mkdir -p \"${DERIVED_FILE_DIR}\"\nprintf '%s%s%s%s%s' '\npackage require tcltest 2.2\nnamespace import tcltest::*\nconfigure -testdir [file normalize {' \"${TCL_SRCROOT}\" '/tests}]\nconfigure -tmpdir [file normalize {' \"${DERIVED_FILE_DIR}\" '}]\nconfigure -verbose [concat [configure -verbose] line]\n# following test only fails when testsuite is run from inside Xcode, so skip it\nconfigure -skip [concat [configure -skip] stack-3.1]\nrunAllTests\n' | \"${TEST_RIG}\"; TEST_RIG_RESULT=$?\n[ ${TEST_RIG_RESULT} -ne 0 ] && echo \"tcltest:0: error: tcltest exited abnormally with code ${TEST_RIG_RESULT}.\"\nexit ${TEST_RIG_RESULT}\nfi"; }; F9A5C5F508F651A2008AE941 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2175,8 +2175,6 @@ GCC_PREFIX_HEADER = "${DERIVED_FILE_DIR}/tcl/tclConfig.h"; GCC_PREPROCESSOR_DEFINITIONS = ( HAVE_TCL_CONFIG_H, - TCL_TOMMATH, - "MP_PREC=4", "${GCC_PREPROCESSOR_DEFINITIONS}", ); GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -2281,8 +2279,6 @@ GCC_PREFIX_HEADER = "${DERIVED_FILE_DIR}/tcl/tclConfig.h"; GCC_PREPROCESSOR_DEFINITIONS = ( HAVE_TCL_CONFIG_H, - TCL_TOMMATH, - "MP_PREC=4", "${GCC_PREPROCESSOR_DEFINITIONS}", ); GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -2331,8 +2327,6 @@ GCC_PREFIX_HEADER = "${DERIVED_FILE_DIR}/tcl/tclConfig.h"; GCC_PREPROCESSOR_DEFINITIONS = ( HAVE_TCL_CONFIG_H, - TCL_TOMMATH, - "MP_PREC=4", "${GCC_PREPROCESSOR_DEFINITIONS}", ); GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; @@ -2381,8 +2375,6 @@ GCC_PREFIX_HEADER = "${DERIVED_FILE_DIR}/tcl/tclConfig.h"; GCC_PREPROCESSOR_DEFINITIONS = ( HAVE_TCL_CONFIG_H, - TCL_TOMMATH, - "MP_PREC=4", "${GCC_PREPROCESSOR_DEFINITIONS}", ); GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 65352c2..6b32726 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.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: tclMacOSXFCmd.c,v 1.10 2006/08/18 07:45:31 das Exp $ + * RCS: @(#) $Id: tclMacOSXFCmd.c,v 1.11 2007/01/19 01:03:59 das Exp $ */ #include "tclInt.h" @@ -333,6 +333,17 @@ TclMacOSXSetFileAttribute( Tcl_DStringAppend(&ds, _PATH_RSRCFORKSPEC, -1); result = truncate(Tcl_DStringValue(&ds), (off_t)0); + if (result != 0) { + /* + * truncate() on a valid resource fork path may fail with + * a permission error in some OS releases, try truncating + * with open() instead: + */ + int fd = open(Tcl_DStringValue(&ds), O_WRONLY | O_TRUNC); + if (fd > 0) { + result = close(fd); + } + } Tcl_DStringFree(&ds); diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 23b858b..af2fa65 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.11 2006/08/21 03:50:50 das Exp $ + * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.12 2007/01/19 01:03:59 das Exp $ */ #include "tclInt.h" @@ -168,12 +168,18 @@ static int receivePipe = -1; /* Output end of triggerPipe */ * Support for weakly importing spinlock API. */ #define WEAK_IMPORT_SPINLOCKLOCK -extern void OSSpinLockLock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; -extern void OSSpinLockUnlock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; -extern void _spin_lock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; -extern void _spin_unlock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; -static void (* lockLock)(OSSpinLock *lock) = NULL; -static void (* lockUnlock)(OSSpinLock *lock) = NULL; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 +#define VOLATILE volatile +#else +#define VOLATILE +#endif +extern void OSSpinLockLock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; +extern void OSSpinLockUnlock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; +extern void _spin_lock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; +extern void _spin_unlock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE; +static void (* lockLock)(VOLATILE OSSpinLock *lock) = NULL; +static void (* lockUnlock)(VOLATILE OSSpinLock *lock) = NULL; +#undef VOLATILE static pthread_once_t spinLockLockInitControl = PTHREAD_ONCE_INIT; static void SpinLockLockInit(void) { lockLock = OSSpinLockLock != NULL ? OSSpinLockLock : _spin_lock; |