Import Tcl 8.5.15 (as of svn r89086)
This commit is contained in:
208
macosx/GNUmakefile
Normal file
208
macosx/GNUmakefile
Normal file
@@ -0,0 +1,208 @@
|
||||
########################################################################################################
|
||||
#
|
||||
# Makefile wrapper to build tcl on Mac OS X in a way compatible with the tk/macosx Xcode buildsystem
|
||||
# uses the standard unix build system in tcl/unix (which can be used directly instead of this
|
||||
# if you are not using the tk/macosx projects).
|
||||
#
|
||||
# Copyright (c) 2002-2008 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution of
|
||||
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
########################################################################################################
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
# customizable settings
|
||||
|
||||
DESTDIR ?=
|
||||
INSTALL_ROOT ?= ${DESTDIR}
|
||||
|
||||
BUILD_DIR ?= ${CURDIR}/../../build
|
||||
SYMROOT ?= ${BUILD_DIR}/${PROJECT}
|
||||
OBJROOT ?= ${SYMROOT}
|
||||
|
||||
EXTRA_CONFIGURE_ARGS ?=
|
||||
EXTRA_MAKE_ARGS ?=
|
||||
|
||||
INSTALL_PATH ?= /Library/Frameworks
|
||||
PREFIX ?= /usr/local
|
||||
BINDIR ?= ${PREFIX}/bin
|
||||
LIBDIR ?= ${INSTALL_PATH}
|
||||
MANDIR ?= ${PREFIX}/man
|
||||
|
||||
# set to non-empty value to install manpages in addition to html help:
|
||||
INSTALL_MANPAGES ?=
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
# meta targets
|
||||
|
||||
meta := all install embedded install-embedded clean distclean test
|
||||
|
||||
styles := develop deploy
|
||||
|
||||
all := ${styles}
|
||||
all : ${all}
|
||||
|
||||
install := ${styles:%=install-%}
|
||||
install : ${install}
|
||||
install-%: action := install-
|
||||
|
||||
embedded := ${styles:%=embedded-%}
|
||||
embedded : embedded-deploy
|
||||
install-embedded := ${embedded:%=install-%}
|
||||
install-embedded : install-embedded-deploy
|
||||
|
||||
clean := ${styles:%=clean-%}
|
||||
clean : ${clean}
|
||||
clean-%: action := clean-
|
||||
distclean := ${styles:%=distclean-%}
|
||||
distclean : ${distclean}
|
||||
distclean-%: action := distclean-
|
||||
|
||||
test := ${styles:%=test-%}
|
||||
test : ${test}
|
||||
test-%: action := test-
|
||||
|
||||
targets := $(foreach v,${meta},${$v})
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
# build styles
|
||||
|
||||
BUILD_STYLE =
|
||||
CONFIGURE_ARGS =
|
||||
OBJ_DIR = ${OBJROOT}/${BUILD_STYLE}
|
||||
|
||||
empty :=
|
||||
space := ${empty} ${empty}
|
||||
objdir = $(subst ${space},\ ,${OBJ_DIR})
|
||||
|
||||
develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols
|
||||
deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip \
|
||||
EXTRA_CFLAGS=-DNDEBUG
|
||||
embedded_make_args := EMBEDDED_BUILD=1
|
||||
install_make_args := INSTALL_BUILD=1
|
||||
|
||||
${targets}:
|
||||
${MAKE} ${action}${PROJECT} \
|
||||
$(foreach s,${styles} embedded install,$(if $(findstring $s,$@),${${s}_make_args}))
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
# project specific settings
|
||||
|
||||
PROJECT := tcl
|
||||
PRODUCT_NAME := Tcl
|
||||
|
||||
UNIX_DIR := ${CURDIR}/../unix
|
||||
VERSION := $(shell awk -F= '/^TCL_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.in)
|
||||
TCLSH := tclsh${VERSION}
|
||||
|
||||
BUILD_TARGET := all tcltest
|
||||
INSTALL_TARGET := install
|
||||
|
||||
export CPPROG := cp -p
|
||||
|
||||
INSTALL_TARGETS = install-binaries install-libraries
|
||||
ifeq (${EMBEDDED_BUILD},)
|
||||
INSTALL_TARGETS += install-private-headers
|
||||
endif
|
||||
ifeq (${INSTALL_BUILD}_${EMBEDDED_BUILD}_${BUILD_STYLE},1__Deployment)
|
||||
INSTALL_TARGETS += html-tcl
|
||||
ifneq (${INSTALL_MANPAGES},)
|
||||
INSTALL_TARGETS += install-doc
|
||||
endif
|
||||
endif
|
||||
|
||||
MAKE_VARS := INSTALL_ROOT INSTALL_TARGETS VERSION GENERIC_FLAGS
|
||||
MAKE_ARGS_V = $(foreach v,${MAKE_VARS},$v='${$v}')
|
||||
|
||||
build-${PROJECT}: target = ${BUILD_TARGET}
|
||||
install-${PROJECT}: target = ${INSTALL_TARGET}
|
||||
clean-${PROJECT} distclean-${PROJECT} test-${PROJECT}: \
|
||||
target = $*
|
||||
|
||||
DO_MAKE = +${MAKE} -C "${OBJ_DIR}" ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
# build rules
|
||||
|
||||
${PROJECT}:
|
||||
${MAKE} install-${PROJECT} INSTALL_ROOT="${OBJ_DIR}/"
|
||||
|
||||
${objdir}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \
|
||||
${UNIX_DIR}/tclConfig.sh.in Tcl-Info.plist.in
|
||||
mkdir -p "${OBJ_DIR}" && cd "${OBJ_DIR}" && \
|
||||
if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure -C \
|
||||
--prefix="${PREFIX}" --bindir="${BINDIR}" --libdir="${LIBDIR}" \
|
||||
--mandir="${MANDIR}" --enable-threads --enable-framework --enable-dtrace \
|
||||
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi
|
||||
|
||||
build-${PROJECT}: ${objdir}/Makefile
|
||||
${DO_MAKE}
|
||||
ifeq (${INSTALL_BUILD},)
|
||||
# symolic link hackery to trick
|
||||
# 'make install INSTALL_ROOT=${OBJ_DIR}'
|
||||
# into building Tcl.framework and tclsh in ${SYMROOT}
|
||||
@cd "${OBJ_DIR}" && mkdir -p $(dir $(subst ${space},\ ,./${LIBDIR})) $(dir $(subst ${space},\ ,./${BINDIR})) "${SYMROOT}" && \
|
||||
rm -f "./${LIBDIR}" "./${BINDIR}" && ln -fs "${SYMROOT}" "./${LIBDIR}" && \
|
||||
ln -fs "${SYMROOT}" "./${BINDIR}" && ln -fs "${OBJ_DIR}/tcltest" "${SYMROOT}"
|
||||
endif
|
||||
|
||||
install-${PROJECT}: build-${PROJECT}
|
||||
ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_)
|
||||
@echo "Cannot install-embedded with empty INSTALL_ROOT !" && false
|
||||
endif
|
||||
ifeq (${EMBEDDED_BUILD},1)
|
||||
@rm -rf "${INSTALL_ROOT}/${LIBDIR}/Tcl.framework"
|
||||
endif
|
||||
${DO_MAKE}
|
||||
ifeq (${INSTALL_BUILD},1)
|
||||
ifeq (${EMBEDDED_BUILD},1)
|
||||
# if we are embedding frameworks, don't install tclsh
|
||||
@rm -f "${INSTALL_ROOT}${BINDIR}/${TCLSH}" && \
|
||||
rmdir -p "${INSTALL_ROOT}${BINDIR}" 2>&- || true
|
||||
else
|
||||
# redo prebinding (when not building for Mac OS X 10.4 or later only)
|
||||
@if [ "`echo "$${MACOSX_DEPLOYMENT_TARGET}" | \
|
||||
awk -F '10\\.' '{print int($$2)}'`" -lt 4 -a "`echo "$${CFLAGS}" | \
|
||||
awk -F '-mmacosx-version-min=10\\.' '{print int($$2)}'`" -lt 4 ]; \
|
||||
then cd ${INSTALL_ROOT}/; \
|
||||
if [ ! -d usr/lib ]; then mkdir -p usr && ln -fs /usr/lib usr/ && RM_USRLIB=1; fi; \
|
||||
if [ ! -d System ]; then ln -fs /System . && RM_SYSTEM=1; fi; \
|
||||
redo_prebinding -r . "./${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}/${PRODUCT_NAME}"; \
|
||||
redo_prebinding -r . "./${BINDIR}/${TCLSH}"; \
|
||||
if [ -n "$${RM_USRLIB:-}" ]; then rm -f usr/lib; rmdir -p usr 2>&-; fi; \
|
||||
if [ -n "$${RM_SYSTEM:-}" ]; then rm -f System; fi; fi
|
||||
# install tclsh symbolic link
|
||||
@ln -fs ${TCLSH} "${INSTALL_ROOT}${BINDIR}/tclsh"
|
||||
endif
|
||||
endif
|
||||
ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_)
|
||||
# keep copy of debug library around, so that
|
||||
# Deployment build can be installed on top
|
||||
# of Development build without overwriting
|
||||
# the debug library
|
||||
@cd "${INSTALL_ROOT}${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}" && \
|
||||
ln -f "${PRODUCT_NAME}" "${PRODUCT_NAME}_debug"
|
||||
endif
|
||||
|
||||
clean-${PROJECT}: %-${PROJECT}:
|
||||
${DO_MAKE}
|
||||
rm -rf "${SYMROOT}"/{${PRODUCT_NAME}.framework,${TCLSH},tcltest}
|
||||
rm -f "${OBJ_DIR}"{"${LIBDIR}","${BINDIR}"} && \
|
||||
rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${LIBDIR})) 2>&- || true && \
|
||||
rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${BINDIR})) 2>&- || true
|
||||
|
||||
distclean-${PROJECT}: %-${PROJECT}: clean-${PROJECT}
|
||||
${DO_MAKE}
|
||||
rm -rf "${OBJ_DIR}"
|
||||
|
||||
test-${PROJECT}: %-${PROJECT}: build-${PROJECT}
|
||||
${DO_MAKE}
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
|
||||
.PHONY: ${meta} ${targets} ${PROJECT} build-${PROJECT} install-${PROJECT} \
|
||||
clean-${PROJECT} distclean-${PROJECT}
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------
|
||||
198
macosx/README
Normal file
198
macosx/README
Normal file
@@ -0,0 +1,198 @@
|
||||
Tcl Mac OS X README
|
||||
-------------------
|
||||
|
||||
This is the README file for the Mac OS X/Darwin version of Tcl.
|
||||
|
||||
|
||||
1. Where to go for support
|
||||
--------------------------
|
||||
|
||||
- The tcl-mac mailing list on sourceforge is the best place to ask questions
|
||||
specific to Tcl & Tk on Mac OS X:
|
||||
http://lists.sourceforge.net/lists/listinfo/tcl-mac
|
||||
(this page also has a link to searchable archives of the list, please check them
|
||||
before asking on the list, many questions have already been answered).
|
||||
|
||||
- For general Tcl/Tk questions, the newsgroup comp.lang.tcl is your best bet:
|
||||
http://groups.google.com/group/comp.lang.tcl/
|
||||
|
||||
- The Tcl'ers Wiki also has many pages dealing with Tcl & Tk on Mac OS X, see
|
||||
http://wiki.tcl.tk/_/ref?N=3753
|
||||
http://wiki.tcl.tk/_/ref?N=8361
|
||||
|
||||
- Please report bugs with Tcl on Mac OS X to the tracker:
|
||||
http://core.tcl.tk/tcl/reportlist
|
||||
|
||||
2. Using Tcl on Mac OS X
|
||||
------------------------
|
||||
|
||||
- At a minimum, Mac OS X 10.1 is required to run Tcl, but OS X 10.3 or higher is
|
||||
recommended (certain [file] operations behave incorrectly on earlier releases).
|
||||
|
||||
- Unless weak-linking is used, Tcl built on Mac OS X 10.x will not run on 10.y
|
||||
with y < x; on the other hand Tcl built on 10.y will always run on 10.x with
|
||||
y <= x (but without any of the fixes and optimizations that would be available
|
||||
in a binary built on 10.x).
|
||||
Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl
|
||||
built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2).
|
||||
|
||||
- Tcl extensions can be installed in any of:
|
||||
$HOME/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl
|
||||
$HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks
|
||||
/System/Library/Frameworks (searched in that order).
|
||||
Given a potential package directory $pkg, Tcl on OSX checks for the file
|
||||
$pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl.
|
||||
This allows building extensions as frameworks with all script files contained in
|
||||
the Resources/Scripts directory of the framework.
|
||||
|
||||
- [load]able binary extensions can linked as either ordinary shared libraries
|
||||
(.dylib) or as MachO bundles (since 8.4.10/8.5a3); only bundles can be unloaded,
|
||||
and bundles are also loaded more efficiently from VFS (no temporary copy to the
|
||||
native filesystem required).
|
||||
|
||||
- The 'deploy' target of macosx/GNUmakefile installs the html manpages into the
|
||||
standard documentation location in the Tcl framework:
|
||||
Tcl.framework/Resources/Documentation/Reference/Tcl
|
||||
No nroff manpages are installed by default by the GNUmakefile.
|
||||
|
||||
- The Tcl framework can be installed in any of the system's standard
|
||||
framework directories:
|
||||
$HOME/Library/Frameworks /Library/Frameworks
|
||||
/Network/Library/Frameworks /System/Library/Frameworks
|
||||
|
||||
|
||||
3. Building Tcl on Mac OS X
|
||||
---------------------------
|
||||
|
||||
- At least Mac OS X 10.1 is required to build Tcl, and Apple's Developer Tools
|
||||
need to be installed (only the most recent version matching your OS release is
|
||||
supported). The Developer Tools installer is available on Mac OS X retail disks
|
||||
or is present in /Applications/Installers on Macs that came with OS X
|
||||
preinstalled. The most recent version can be downloaded from the ADC website
|
||||
http://connect.apple.com (after you register for free ADC membership).
|
||||
|
||||
- Tcl is most easily built as a Mac OS X framework via GNUmakefile in tcl/macosx
|
||||
(see below for details), but can also be built with the standard unix configure
|
||||
and make buildsystem in tcl/unix as on any other unix platform (indeed, the
|
||||
GNUmakefile is just a wrapper around the unix buildsystem).
|
||||
The Mac OS X specific configure flags are --enable-framework and
|
||||
--disable-corefoundation (which disables CF and notably reverts to the standard
|
||||
select based notifier).
|
||||
|
||||
- It is also possible to build with Apple's IDE via the projects in tcl/macosx,
|
||||
take care to only use the project matching your DevTools and OS version:
|
||||
* Tcl.pbproj for Xcode or ProjectBuilder on 10.3 and earlier, this has a
|
||||
'Tcl' target that simply calls through to the tcl/macosx/GNUMakefile.
|
||||
* Tcl.xcode for Xcode 2.4 on 10.4 and Xcode 2.5 on 10.4 and later, which
|
||||
additionally has native 'tcltest' and 'tests' targets for debugging and
|
||||
running the testsuite, these targets' 'Debug' build configuration has
|
||||
ZeroLink and Fix&Continue enabled, use the 'DebugNoFixZL' build
|
||||
configuration if you need a debug build without these features. The
|
||||
following build configurations are available:
|
||||
'DebugUnthreaded': debug build with threading turned off.
|
||||
'DebugNoCF': debug build with corefoundation turned off.
|
||||
'DebugNoCFUnthreaded': debug build with corefoundation & threading off.
|
||||
'DebugMemCompile': debug build with memory and bytecode debugging on.
|
||||
'DebugLeaks': debug build with PURIFY defined.
|
||||
'DebugGCov': debug build with generation of gcov data files enabled.
|
||||
'Debug64bit': builds the targets as 64bit with debugging enabled,
|
||||
requires a 64bit capable processor (i.e. G5 or Core2/Xeon).
|
||||
'ReleaseUniversal': builds the targets as universal binaries for the
|
||||
ppc, ppc64, i386 and x86_64 architectures.
|
||||
'ReleaseUniversal10.4uSDK': same as 'ReleaseUniversal' but builds
|
||||
against the 10.4u SDK, required to build universal binaries on
|
||||
PowerPC Tiger (where the system libraries are not universal).
|
||||
'ReleasePPC10.3.9SDK': builds for PowerPC against the 10.3.9 SDK, useful
|
||||
for verifying on Tiger that building on Panther would succeed.
|
||||
'ReleasePPC10.2.8SDK': builds for PowerPC with gcc-3.3 against the
|
||||
10.2.8 SDK, useful to verify on Tiger that building on Jaguar
|
||||
would succeed.
|
||||
* Tcl.xcodeproj for Xcode 3.1 on 10.5 and later, which has the following
|
||||
additional build configurations:
|
||||
'ReleaseUniversal10.5SDK': same as 'ReleaseUniversal' but builds
|
||||
against the 10.5 SDK on Leopard (with 10.5 deployment target).
|
||||
'Debug gcc42': same as 'Debug' but builds with gcc 4.2.
|
||||
'Debug llvmgcc42': same as 'Debug' but builds with llvm-gcc 4.2.
|
||||
'ReleaseUniversal gcc42': same as 'ReleaseUniversal' but builds with
|
||||
gcc 4.2.
|
||||
'ReleaseUniversal llvmgcc42': same as 'ReleaseUniversal' but builds
|
||||
with llvm-gcc 4.2.
|
||||
Note that all non-SDK configurations have 10.5 deployment target.
|
||||
|
||||
Notes about the native targets of the Xcode projects:
|
||||
* the Xcode projects refer to the toplevel tcl source directory through the
|
||||
TCL_SRCROOT user build setting, by default this is set to the
|
||||
project-relative path '../../tcl', if your tcl source directory is named
|
||||
differently, e.g. '../../tcl8.5', you'll need to manually change the
|
||||
TCL_SRCROOT setting by editing your ${USER}.pbxuser file (located inside
|
||||
the Tcl.xcodeproj bundle directory) with a text editor.
|
||||
* the native targets need a version of the unix configure script with config
|
||||
headers enabled, this is automatically generated as tcl/macosx/configure
|
||||
by the project but that requires 2.59 versions of autoconf & autoheader.
|
||||
These are not available on Mac OS X 10.5 by default and need to be
|
||||
installed manually. By default they are assumed to be installed as
|
||||
/usr/local/bin/autoconf-2.59 and /usr/local/bin/autoheader-2.59, set the
|
||||
AUTOCONF and AUTOHEADER build settings in ${USER}.pbxuser to their true
|
||||
locations if necessary.
|
||||
|
||||
- To build universal binaries outside of Tcl.xcodeproj, set CFLAGS as follows:
|
||||
export CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 \
|
||||
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
|
||||
This requires Mac OS X 10.4 and Xcode 2.4 (or Xcode 2.2 if -arch x86_64 is
|
||||
omitted, but _not_ Xcode 2.1) and will work on any of the architectures (the
|
||||
-isysroot flag is only required on PowerPC Tiger).
|
||||
Note that configure requires CFLAGS to contain a least one architecture that can
|
||||
be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386
|
||||
on Core and ppc, i386 or x86_64 on Core2/Xeon).
|
||||
Universal builds of Tcl TEA extensions are also possible with CFLAGS set as
|
||||
above, they will be [load]able by universal as well as thin binaries of Tcl.
|
||||
|
||||
- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable
|
||||
to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g:
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.2
|
||||
This requires Mac OS X 10.2 and gcc 3.1; if you have gcc 4 or later you can set
|
||||
CFLAGS instead:
|
||||
export CFLAGS="-mmacosx-version-min=10.2"
|
||||
The Tcl.xcode project is setup to produce binaries that can run on 10.2 or
|
||||
later (except for the Universal and SDK configurations).
|
||||
Support for weak-linking was added to the code for 8.4.14/8.5a5.
|
||||
|
||||
Detailed Instructions for building with macosx/GNUmakefile
|
||||
----------------------------------------------------------
|
||||
|
||||
- Unpack the tcl source release archive.
|
||||
|
||||
- The following instructions assume the tcl source tree is named "tcl${ver}",
|
||||
where ${ver} is a shell variable containing the tcl version number (for example
|
||||
'8.4.12').
|
||||
Setup the shell variable as follows:
|
||||
set ver="8.4.12" ;: if your shell is csh
|
||||
ver="8.4.12" ;: if your shell is sh
|
||||
The source tree will be named this way only if you are building from a release
|
||||
archive, if you are building from CVS, the version numbers will be missing; so
|
||||
set ${ver} to the empty string instead:
|
||||
set ver="" ;: if your shell is csh
|
||||
ver="" ;: if your shell is sh
|
||||
|
||||
- The following steps will build Tcl from the Terminal, assuming you are located
|
||||
in the directory containing the tcl source tree:
|
||||
make -C tcl${ver}/macosx
|
||||
and the following will then install Tcl onto the root volume (admin password
|
||||
required):
|
||||
sudo make -C tcl${ver}/macosx install
|
||||
if you don't have the admin password, you can install into your home directory,
|
||||
instead by passing an INSTALL_ROOT argument to make:
|
||||
make -C tcl${ver}/macosx install INSTALL_ROOT="${HOME}/"
|
||||
|
||||
- The default Makefile targets will build _both_ debug and optimized versions of
|
||||
the Tcl framework with the standard convention of naming the debug library
|
||||
Tcl.framework/Tcl_debug.
|
||||
This allows switching to the debug libraries at runtime by setting
|
||||
export DYLD_IMAGE_SUFFIX=_debug
|
||||
(c.f. man dyld for more details)
|
||||
|
||||
If you only want to build and install the debug or optimized build, use the
|
||||
'develop' or 'deploy' target variants of the Makefiles, respectively.
|
||||
For example, to build and install only the optimized versions:
|
||||
make -C tcl${ver}/macosx deploy
|
||||
sudo make -C tcl${ver}/macosx install-deploy
|
||||
40
macosx/Tcl-Common.xcconfig
Normal file
40
macosx/Tcl-Common.xcconfig
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Tcl-Common.xcconfig --
|
||||
//
|
||||
// This file contains the Xcode build settings comon to all
|
||||
// project configurations in Tcl.xcodeproj.
|
||||
//
|
||||
// Copyright (c) 2007-2008 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
//
|
||||
// See the file "license.terms" for information on usage and redistribution
|
||||
// of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
HEADER_SEARCH_PATHS = "$(DERIVED_FILE_DIR)/tcl" $(HEADER_SEARCH_PATHS)
|
||||
OTHER_LDFLAGS = -headerpad_max_install_names -sectcreate __TEXT __info_plist "$(DERIVED_FILE_DIR)/tcl/Tclsh-Info.plist" $(OTHER_LDFLAGS)
|
||||
INSTALL_PATH = $(BINDIR)
|
||||
INSTALL_MODE_FLAG = go-w,a+rX
|
||||
GCC_PREFIX_HEADER = $(DERIVED_FILE_DIR)/tcl/tclConfig.h
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
|
||||
GCC_NO_COMMON_BLOCKS = YES
|
||||
GCC_DYNAMIC_NO_PIC = YES
|
||||
GCC = $(DEVELOPER_DIR)/usr/bin/gcc
|
||||
GCC_VERSION = 4.0
|
||||
CC = $(GCC)-$(GCC_VERSION)
|
||||
LD = $(CC)
|
||||
WARNING_CFLAGS_GCC3 = -Wall -Wno-implicit-int -Wno-unused-parameter -Wno-deprecated-declarations
|
||||
WARNING_CFLAGS = -Wextra -Wno-missing-field-initializers -Winit-self -Wpointer-arith -Wcast-align -Wdisabled-optimization -Winline $(WARNING_CFLAGS_GCC3) $(WARNING_CFLAGS)
|
||||
BINDIR = $(PREFIX)/bin
|
||||
CFLAGS = $(CFLAGS)
|
||||
CPPFLAGS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) $(CPPFLAGS)
|
||||
FRAMEWORK_INSTALL_PATH = /Library/Frameworks
|
||||
INCLUDEDIR = $(PREFIX)/include
|
||||
LIBDIR = $(PREFIX)/lib
|
||||
MANDIR = $(PREFIX)/man
|
||||
PER_ARCH_CFLAGS_ppc = -mcpu=G3 -mtune=G4 $(PER_ARCH_CFLAGS_ppc)
|
||||
PER_ARCH_CFLAGS_ppc64 = -mcpu=G5 -mpowerpc64 $(PER_ARCH_CFLAGS_ppc64)
|
||||
PREFIX = /usr/local
|
||||
TCL_CONFIGURE_ARGS = --enable-threads --enable-dtrace
|
||||
TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION)
|
||||
TCL_PACKAGE_PATH = "$(LIBDIR)"
|
||||
TCL_DEFS = HAVE_TCL_CONFIG_H
|
||||
VERSION = 8.5
|
||||
20
macosx/Tcl-Debug.xcconfig
Normal file
20
macosx/Tcl-Debug.xcconfig
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Tcl-Debug.xcconfig --
|
||||
//
|
||||
// This file contains the Xcode build settings for all Debug
|
||||
// project configurations in Tcl.xcodeproj.
|
||||
//
|
||||
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
//
|
||||
// See the file "license.terms" for information on usage and redistribution
|
||||
// of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
#include "Tcl-Common.xcconfig"
|
||||
|
||||
DEBUG_INFORMATION_FORMAT = dwarf
|
||||
DEAD_CODE_STRIPPING = NO
|
||||
DEPLOYMENT_POSTPROCESSING = NO
|
||||
GCC_OPTIMIZATION_LEVEL = 0
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(TCL_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
|
||||
CONFIGURE_ARGS = --enable-symbols $(TCL_CONFIGURE_ARGS) $(CONFIGURE_ARGS)
|
||||
MAKE_TARGET = develop
|
||||
36
macosx/Tcl-Info.plist.in
Normal file
36
macosx/Tcl-Info.plist.in
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!--
|
||||
Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
|
||||
See the file "license.terms" for information on usage and redistribution of
|
||||
this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
-->
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>@TCL_LIB_FILE@</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Tcl @TCL_VERSION@@TCL_PATCH_LEVEL@,
|
||||
Copyright © 1987-@TCL_YEAR@ Tcl Core Team,
|
||||
Copyright © 2001-@TCL_YEAR@ Daniel A. Steffen,
|
||||
Copyright © 2001-2009 Apple Inc.,
|
||||
Copyright © 2001-2002 Jim Ingham & Ian Reid</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.tcltk.tcllibrary</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Tcl @TCL_VERSION@</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@TCL_VERSION@@TCL_PATCH_LEVEL@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>Tcl </string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@TCL_VERSION@@TCL_PATCH_LEVEL@</string>
|
||||
</dict>
|
||||
</plist>
|
||||
20
macosx/Tcl-Release.xcconfig
Normal file
20
macosx/Tcl-Release.xcconfig
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Tcl-Release.xcconfig --
|
||||
//
|
||||
// This file contains the Xcode build settings for all Release
|
||||
// project configurations in Tcl.xcodeproj.
|
||||
//
|
||||
// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
//
|
||||
// See the file "license.terms" for information on usage and redistribution
|
||||
// of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
#include "Tcl-Common.xcconfig"
|
||||
|
||||
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
|
||||
DEAD_CODE_STRIPPING = YES
|
||||
DEPLOYMENT_POSTPROCESSING = YES
|
||||
GCC_OPTIMIZATION_LEVEL = s
|
||||
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG $(TCL_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
|
||||
CONFIGURE_ARGS = --disable-symbols $(TCL_CONFIGURE_ARGS) $(CONFIGURE_ARGS)
|
||||
MAKE_TARGET = deploy
|
||||
173
macosx/Tcl.pbproj/default.pbxuser
Normal file
173
macosx/Tcl.pbproj/default.pbxuser
Normal file
@@ -0,0 +1,173 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
00E2F845016E82EB0ACA28DC = {
|
||||
activeBuildStyle = 00E2F847016E82EB0ACA28DC;
|
||||
activeExecutable = F594E5F1030774B1016F146B;
|
||||
activeTarget = 00E2F84C016E8B780ACA28DC;
|
||||
addToTargets = (
|
||||
);
|
||||
codeSenseManager = F9D167E40610239A0027C147;
|
||||
executables = (
|
||||
F53ACC52031D9AFE016F146B,
|
||||
F594E5F1030774B1016F146B,
|
||||
);
|
||||
sourceControlManager = F9D167E30610239A0027C147;
|
||||
userBuildSettings = {
|
||||
SYMROOT = "${SRCROOT}/../../build/tcl";
|
||||
};
|
||||
};
|
||||
00E2F84C016E8B780ACA28DC = {
|
||||
activeExec = 0;
|
||||
};
|
||||
F53ACC52031D9AFE016F146B = {
|
||||
activeArgIndex = 2147483647;
|
||||
activeArgIndices = (
|
||||
NO,
|
||||
NO,
|
||||
);
|
||||
argumentStrings = (
|
||||
"${SRCROOT}/../../tcl/tests/all.tcl",
|
||||
"-verbose \"\"",
|
||||
);
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
cppStopOnCatchEnabled = 0;
|
||||
cppStopOnThrowEnabled = 0;
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = _debug;
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = YES;
|
||||
name = TCL_LIBRARY;
|
||||
value = "${SRCROOT}/../../tcl/library";
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
);
|
||||
isa = PBXExecutable;
|
||||
launchableReference = F5C37CF303D5BEDF016F146B;
|
||||
libgmallocEnabled = 0;
|
||||
name = tcltest;
|
||||
shlibInfoDictList = (
|
||||
);
|
||||
sourceDirectories = (
|
||||
);
|
||||
startupPath = "<<ProductDirectory>>";
|
||||
};
|
||||
F594E5F1030774B1016F146B = {
|
||||
activeArgIndex = 2147483647;
|
||||
activeArgIndices = (
|
||||
);
|
||||
argumentStrings = (
|
||||
);
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
cppStopOnCatchEnabled = 0;
|
||||
cppStopOnThrowEnabled = 0;
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = _debug;
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
);
|
||||
isa = PBXExecutable;
|
||||
launchableReference = F98F02E608E7EF9A00D0320A;
|
||||
libgmallocEnabled = 0;
|
||||
name = tclsh;
|
||||
shlibInfoDictList = (
|
||||
);
|
||||
sourceDirectories = (
|
||||
);
|
||||
startupPath = "<<ProductDirectory>>";
|
||||
};
|
||||
F5C37CF303D5BEDF016F146B = {
|
||||
isa = PBXFileReference;
|
||||
lastKnownFileType = "compiled.mach-o.executable";
|
||||
path = tcltest;
|
||||
refType = 3;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
F98F02E608E7EF9A00D0320A = {
|
||||
isa = PBXFileReference;
|
||||
lastKnownFileType = "compiled.mach-o.executable";
|
||||
path = tclsh8.5;
|
||||
refType = 3;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
F9D167E30610239A0027C147 = {
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
isSCMEnabled = 0;
|
||||
isa = PBXSourceControlManager;
|
||||
scmConfiguration = {
|
||||
};
|
||||
scmType = scm.cvs;
|
||||
};
|
||||
F9D167E40610239A0027C147 = {
|
||||
indexTemplatePath = "";
|
||||
isa = PBXCodeSenseManager;
|
||||
usesDefaults = 1;
|
||||
wantsCodeCompletion = 1;
|
||||
wantsCodeCompletionAutoSuggestions = 1;
|
||||
wantsCodeCompletionCaseSensitivity = 1;
|
||||
wantsCodeCompletionListAlways = 1;
|
||||
wantsCodeCompletionOnlyMatchingItems = 1;
|
||||
wantsCodeCompletionParametersIncluded = 1;
|
||||
wantsCodeCompletionPlaceholdersInserted = 1;
|
||||
wantsCodeCompletionTabCompletes = 1;
|
||||
wantsIndex = 1;
|
||||
};
|
||||
}
|
||||
173
macosx/Tcl.pbproj/jingham.pbxuser
Normal file
173
macosx/Tcl.pbproj/jingham.pbxuser
Normal file
@@ -0,0 +1,173 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
00E2F845016E82EB0ACA28DC = {
|
||||
activeBuildStyle = 00E2F847016E82EB0ACA28DC;
|
||||
activeExecutable = F594E5F1030774B1016F146B;
|
||||
activeTarget = 00E2F84C016E8B780ACA28DC;
|
||||
addToTargets = (
|
||||
);
|
||||
codeSenseManager = F9D167E40610239A0027C147;
|
||||
executables = (
|
||||
F53ACC52031D9AFE016F146B,
|
||||
F594E5F1030774B1016F146B,
|
||||
);
|
||||
sourceControlManager = F9D167E30610239A0027C147;
|
||||
userBuildSettings = {
|
||||
SYMROOT = "${SRCROOT}/../../build/tcl";
|
||||
};
|
||||
};
|
||||
00E2F84C016E8B780ACA28DC = {
|
||||
activeExec = 0;
|
||||
};
|
||||
F53ACC52031D9AFE016F146B = {
|
||||
activeArgIndex = 2147483647;
|
||||
activeArgIndices = (
|
||||
NO,
|
||||
NO,
|
||||
);
|
||||
argumentStrings = (
|
||||
"${SRCROOT}/../../tcl/tests/all.tcl",
|
||||
"-verbose \"\"",
|
||||
);
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
cppStopOnCatchEnabled = 0;
|
||||
cppStopOnThrowEnabled = 0;
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = _debug;
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = YES;
|
||||
name = TCL_LIBRARY;
|
||||
value = "${SRCROOT}/../../tcl/library";
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
);
|
||||
isa = PBXExecutable;
|
||||
launchableReference = F5C37CF303D5BEDF016F146B;
|
||||
libgmallocEnabled = 0;
|
||||
name = tcltest;
|
||||
shlibInfoDictList = (
|
||||
);
|
||||
sourceDirectories = (
|
||||
);
|
||||
startupPath = "<<ProductDirectory>>";
|
||||
};
|
||||
F594E5F1030774B1016F146B = {
|
||||
activeArgIndex = 2147483647;
|
||||
activeArgIndices = (
|
||||
);
|
||||
argumentStrings = (
|
||||
);
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
cppStopOnCatchEnabled = 0;
|
||||
cppStopOnThrowEnabled = 0;
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = _debug;
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
);
|
||||
isa = PBXExecutable;
|
||||
launchableReference = F98F02E608E7EF9A00D0320A;
|
||||
libgmallocEnabled = 0;
|
||||
name = tclsh;
|
||||
shlibInfoDictList = (
|
||||
);
|
||||
sourceDirectories = (
|
||||
);
|
||||
startupPath = "<<ProductDirectory>>";
|
||||
};
|
||||
F5C37CF303D5BEDF016F146B = {
|
||||
isa = PBXFileReference;
|
||||
lastKnownFileType = "compiled.mach-o.executable";
|
||||
path = tcltest;
|
||||
refType = 3;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
F98F02E608E7EF9A00D0320A = {
|
||||
isa = PBXFileReference;
|
||||
lastKnownFileType = "compiled.mach-o.executable";
|
||||
path = tclsh8.5;
|
||||
refType = 3;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
F9D167E30610239A0027C147 = {
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
isSCMEnabled = 0;
|
||||
isa = PBXSourceControlManager;
|
||||
scmConfiguration = {
|
||||
};
|
||||
scmType = scm.cvs;
|
||||
};
|
||||
F9D167E40610239A0027C147 = {
|
||||
indexTemplatePath = "";
|
||||
isa = PBXCodeSenseManager;
|
||||
usesDefaults = 1;
|
||||
wantsCodeCompletion = 1;
|
||||
wantsCodeCompletionAutoSuggestions = 1;
|
||||
wantsCodeCompletionCaseSensitivity = 1;
|
||||
wantsCodeCompletionListAlways = 1;
|
||||
wantsCodeCompletionOnlyMatchingItems = 1;
|
||||
wantsCodeCompletionParametersIncluded = 1;
|
||||
wantsCodeCompletionPlaceholdersInserted = 1;
|
||||
wantsCodeCompletionTabCompletes = 1;
|
||||
wantsIndex = 1;
|
||||
};
|
||||
}
|
||||
1539
macosx/Tcl.pbproj/project.pbxproj
Normal file
1539
macosx/Tcl.pbproj/project.pbxproj
Normal file
File diff suppressed because it is too large
Load Diff
198
macosx/Tcl.xcode/default.pbxuser
Normal file
198
macosx/Tcl.xcode/default.pbxuser
Normal file
@@ -0,0 +1,198 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
activeBuildConfigurationName = Debug;
|
||||
activeExecutable = F9E61D1C090A4282002B3151 /* tclsh */;
|
||||
activeTarget = F9E61D16090A3E94002B3151 /* Tcl */;
|
||||
codeSenseManager = F944EB9D08F798180049FDD4 /* Code sense */;
|
||||
executables = (
|
||||
F9E61D1C090A4282002B3151 /* tclsh */,
|
||||
F944EB8F08F798100049FDD4 /* tcltest */,
|
||||
);
|
||||
perUserDictionary = {
|
||||
com.apple.ide.smrt.PBXUserSmartGroupsKey.Rev10 = <040b747970656473747265616d8103e88401408484840e4e534d757461626c654172726179008484074e534172726179008484084e534f626a65637400858401690192848484134e534d757461626c6544696374696f6e6172790084840c4e5344696374696f6e6172790095960792848484084e53537472696e67019584012b146162736f6c75746550617468546f42756e646c658692849a9a008692849a9a046e616d658692849a9a14496d706c656d656e746174696f6e2046696c65738692849a9a03636c7a8692849a9a1550425846696c656e616d65536d61727447726f75708692849a9a0b6465736372697074696f6e8692849a9a103c6e6f206465736372697074696f6e3e8692849a9a08676c6f62616c49448692849a9a183143433045413430303433353045463930303434343130428692849a9a195042585472616e7369656e744c6f636174696f6e4174546f708692849a9a06626f74746f6d8692849a9a0b707265666572656e63657386928497960892849a9a1250425850726f6a65637453636f70654b65798692849a9a035945538692849a9a05696d6167658692849a9a0b536d617274466f6c6465728692849a9a0763616e536176658692848484084e534e756d626572008484074e5356616c7565009584012a849696018692849a9a0572656765788692849a9a065c2e286329248692849a9a04726f6f748692849a9a093c50524f4a4543543e8692849a9a097265637572736976658692ad92849a9a0669734c656166869284ae9db096008692849a9a07666e6d617463688692849a9a0086868686>;
|
||||
};
|
||||
sourceControlManager = F944EB9C08F798180049FDD4 /* Source Control */;
|
||||
userBuildSettings = {
|
||||
GCC = "${DEVELOPER_DIR}/usr/bin/gcc";
|
||||
SYMROOT = "${SRCROOT}/../../build/tcl";
|
||||
TCL_SRCROOT = "${SRCROOT}/../../tcl";
|
||||
};
|
||||
};
|
||||
8DD76FA90486AB0100D96B5E /* tcltest */ = {
|
||||
activeExec = 0;
|
||||
executables = (
|
||||
F944EB8F08F798100049FDD4 /* tcltest */,
|
||||
);
|
||||
};
|
||||
F944EB8F08F798100049FDD4 /* tcltest */ = {
|
||||
isa = PBXExecutable;
|
||||
activeArgIndex = 2147483647;
|
||||
activeArgIndices = (
|
||||
NO,
|
||||
NO,
|
||||
NO,
|
||||
);
|
||||
argumentStrings = (
|
||||
"${TCL_SRCROOT}/tests/all.tcl",
|
||||
"-singleproc 1",
|
||||
"-verbose \"bet\"",
|
||||
);
|
||||
autoAttachOnCrash = 1;
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = "";
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = YES;
|
||||
name = TCL_LIBRARY;
|
||||
value = "${TCL_SRCROOT}/library";
|
||||
},
|
||||
{
|
||||
active = YES;
|
||||
name = TCLLIBPATH;
|
||||
value = /Library/Tcl;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocBadFreeAbort;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocLogFile;
|
||||
value = /tmp/malloc.log;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocStackLogging;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocStackLoggingNoCompact;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocPreScribble;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocScribble;
|
||||
value = 1;
|
||||
},
|
||||
);
|
||||
executableSystemSymbolLevel = 0;
|
||||
executableUserSymbolLevel = 0;
|
||||
libgmallocEnabled = 0;
|
||||
name = tcltest;
|
||||
sourceDirectories = (
|
||||
);
|
||||
};
|
||||
F944EB9C08F798180049FDD4 /* Source Control */ = {
|
||||
isa = PBXSourceControlManager;
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
isSCMEnabled = 0;
|
||||
scmConfiguration = {
|
||||
CVSToolPath = /usr/bin/cvs;
|
||||
CVSUseSSH = NO;
|
||||
SubversionToolPath = /usr/local/bin/svn;
|
||||
};
|
||||
scmType = scm.cvs;
|
||||
};
|
||||
F944EB9D08F798180049FDD4 /* Code sense */ = {
|
||||
isa = PBXCodeSenseManager;
|
||||
indexTemplatePath = "";
|
||||
};
|
||||
F97258A50A86873C00096C78 /* tests */ = {
|
||||
activeExec = 0;
|
||||
};
|
||||
F9E61D16090A3E94002B3151 /* Tcl */ = {
|
||||
activeExec = 0;
|
||||
executables = (
|
||||
F9E61D1C090A4282002B3151 /* tclsh */,
|
||||
);
|
||||
};
|
||||
F9E61D1C090A4282002B3151 /* tclsh */ = {
|
||||
isa = PBXExecutable;
|
||||
activeArgIndex = 2147483647;
|
||||
activeArgIndices = (
|
||||
);
|
||||
argumentStrings = (
|
||||
);
|
||||
autoAttachOnCrash = 1;
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = _debug;
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
);
|
||||
executableSystemSymbolLevel = 0;
|
||||
executableUserSymbolLevel = 0;
|
||||
libgmallocEnabled = 0;
|
||||
name = tclsh;
|
||||
sourceDirectories = (
|
||||
);
|
||||
};
|
||||
}
|
||||
2792
macosx/Tcl.xcode/project.pbxproj
Normal file
2792
macosx/Tcl.xcode/project.pbxproj
Normal file
File diff suppressed because it is too large
Load Diff
200
macosx/Tcl.xcodeproj/default.pbxuser
Normal file
200
macosx/Tcl.xcodeproj/default.pbxuser
Normal file
@@ -0,0 +1,200 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
activeBuildConfigurationName = Debug;
|
||||
activeExecutable = F9E61D1C090A4282002B3151 /* tclsh */;
|
||||
activeTarget = F9E61D16090A3E94002B3151 /* Tcl */;
|
||||
codeSenseManager = F944EB9D08F798180049FDD4 /* Code sense */;
|
||||
executables = (
|
||||
F9E61D1C090A4282002B3151 /* tclsh */,
|
||||
F944EB8F08F798100049FDD4 /* tcltest */,
|
||||
);
|
||||
perUserDictionary = {
|
||||
com.apple.ide.smrt.PBXUserSmartGroupsKey.Rev10 = <040b73747265616d747970656481e8038401408484840e4e534d757461626c654172726179008484074e534172726179008484084e534f626a65637400858401690192848484134e534d757461626c6544696374696f6e6172790084840c4e5344696374696f6e6172790095960792848484084e53537472696e67019584012b046e616d658692849a9a14496d706c656d656e746174696f6e2046696c65738692849a9a146162736f6c75746550617468546f42756e646c658692849a9a008692849a9a195042585472616e7369656e744c6f636174696f6e4174546f708692849a9a06626f74746f6d8692849a9a03636c7a8692849a9a1550425846696c656e616d65536d61727447726f75708692849a9a0b6465736372697074696f6e8692849a9a103c6e6f206465736372697074696f6e3e8692849a9a0b707265666572656e63657386928497960892849a9a07666e6d617463688692849a9a008692849a9a05696d6167658692849a9a0b536d617274466f6c6465728692849a9a04726f6f748692849a9a093c50524f4a4543543e8692849a9a0572656765788692849a9a065c2e286329248692849a9a097265637572736976658692848484084e534e756d626572008484074e5356616c7565009584012a849696018692849a9a0669734c656166869284b09db296008692849a9a0763616e536176658692af92849a9a1250425850726f6a65637453636f70654b65798692849a9a03594553868692849a9a08676c6f62616c49448692849a9a18314343304541343030343335304546393030343434313042868686>;
|
||||
};
|
||||
sourceControlManager = F944EB9C08F798180049FDD4 /* Source Control */;
|
||||
userBuildSettings = {
|
||||
AUTOCONF = "/usr/local/bin/autoconf-2.59";
|
||||
AUTOHEADER = "/usr/local/bin/autoheader-2.59";
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
SYMROOT = "${SRCROOT}/../../build/tcl";
|
||||
TCL_SRCROOT = "${SRCROOT}/../../tcl";
|
||||
};
|
||||
};
|
||||
8DD76FA90486AB0100D96B5E /* tcltest */ = {
|
||||
activeExec = 0;
|
||||
executables = (
|
||||
F944EB8F08F798100049FDD4 /* tcltest */,
|
||||
);
|
||||
};
|
||||
F944EB8F08F798100049FDD4 /* tcltest */ = {
|
||||
isa = PBXExecutable;
|
||||
activeArgIndices = (
|
||||
NO,
|
||||
NO,
|
||||
NO,
|
||||
);
|
||||
argumentStrings = (
|
||||
"${TCL_SRCROOT}/tests/all.tcl",
|
||||
"-singleproc 1",
|
||||
"-verbose \"bet\"",
|
||||
);
|
||||
autoAttachOnCrash = 1;
|
||||
breakpointsEnabled = 1;
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = "";
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = YES;
|
||||
name = TCL_LIBRARY;
|
||||
value = "${TCL_SRCROOT}/library";
|
||||
},
|
||||
{
|
||||
active = YES;
|
||||
name = TCLLIBPATH;
|
||||
value = /Library/Tcl;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocBadFreeAbort;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocLogFile;
|
||||
value = /tmp/malloc.log;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocStackLogging;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocStackLoggingNoCompact;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocPreScribble;
|
||||
value = 1;
|
||||
},
|
||||
{
|
||||
active = NO;
|
||||
name = MallocScribble;
|
||||
value = 1;
|
||||
},
|
||||
);
|
||||
executableSystemSymbolLevel = 0;
|
||||
executableUserSymbolLevel = 0;
|
||||
libgmallocEnabled = 0;
|
||||
name = tcltest;
|
||||
sourceDirectories = (
|
||||
);
|
||||
};
|
||||
F944EB9C08F798180049FDD4 /* Source Control */ = {
|
||||
isa = PBXSourceControlManager;
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
isSCMEnabled = 0;
|
||||
scmConfiguration = {
|
||||
CVSToolPath = /usr/bin/cvs;
|
||||
CVSUseSSH = NO;
|
||||
SubversionToolPath = /usr/bin/svn;
|
||||
};
|
||||
scmType = scm.cvs;
|
||||
};
|
||||
F944EB9D08F798180049FDD4 /* Code sense */ = {
|
||||
isa = PBXCodeSenseManager;
|
||||
indexTemplatePath = "";
|
||||
};
|
||||
F97258A50A86873C00096C78 /* tests */ = {
|
||||
activeExec = 0;
|
||||
};
|
||||
F9E61D16090A3E94002B3151 /* Tcl */ = {
|
||||
activeExec = 0;
|
||||
executables = (
|
||||
F9E61D1C090A4282002B3151 /* tclsh */,
|
||||
);
|
||||
};
|
||||
F9E61D1C090A4282002B3151 /* tclsh */ = {
|
||||
isa = PBXExecutable;
|
||||
activeArgIndices = (
|
||||
);
|
||||
argumentStrings = (
|
||||
);
|
||||
autoAttachOnCrash = 1;
|
||||
breakpointsEnabled = 1;
|
||||
configStateDict = {
|
||||
"PBXLSLaunchAction-0" = {
|
||||
PBXLSLaunchAction = 0;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXLSRunLaunchConfig;
|
||||
displayName = "Executable Runner";
|
||||
identifier = com.apple.Xcode.launch.runConfig;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
"PBXLSLaunchAction-1" = {
|
||||
PBXLSLaunchAction = 1;
|
||||
PBXLSLaunchStartAction = 1;
|
||||
PBXLSLaunchStdioStyle = 2;
|
||||
PBXLSLaunchStyle = 0;
|
||||
class = PBXGDB_LaunchConfig;
|
||||
displayName = GDB;
|
||||
identifier = com.apple.Xcode.launch.GDBMI_Config;
|
||||
remoteHostInfo = "";
|
||||
startActionInfo = "";
|
||||
};
|
||||
};
|
||||
customDataFormattersEnabled = 1;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = _debug;
|
||||
enableDebugStr = 0;
|
||||
environmentEntries = (
|
||||
{
|
||||
active = NO;
|
||||
name = DYLD_PRINT_LIBRARIES;
|
||||
},
|
||||
);
|
||||
executableSystemSymbolLevel = 0;
|
||||
executableUserSymbolLevel = 0;
|
||||
libgmallocEnabled = 0;
|
||||
name = tclsh;
|
||||
sourceDirectories = (
|
||||
);
|
||||
};
|
||||
}
|
||||
3035
macosx/Tcl.xcodeproj/project.pbxproj
Normal file
3035
macosx/Tcl.xcodeproj/project.pbxproj
Normal file
File diff suppressed because it is too large
Load Diff
36
macosx/Tclsh-Info.plist.in
Normal file
36
macosx/Tclsh-Info.plist.in
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!--
|
||||
Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
|
||||
See the file "license.terms" for information on usage and redistribution of
|
||||
this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
-->
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>tclsh@TCL_VERSION@</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Tcl Shell @TCL_VERSION@@TCL_PATCH_LEVEL@,
|
||||
Copyright © 1987-@TCL_YEAR@ Tcl Core Team,
|
||||
Copyright © 2001-@TCL_YEAR@ Daniel A. Steffen,
|
||||
Copyright © 2001-2009 Apple Inc.,
|
||||
Copyright © 2001-2002 Jim Ingham & Ian Reid</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.tcltk.tclsh</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>tclsh</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@TCL_VERSION@@TCL_PATCH_LEVEL@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>TclS</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@TCL_VERSION@@TCL_PATCH_LEVEL@</string>
|
||||
</dict>
|
||||
</plist>
|
||||
20237
macosx/configure
vendored
Normal file
20237
macosx/configure
vendored
Normal file
File diff suppressed because it is too large
Load Diff
11
macosx/configure.ac
Normal file
11
macosx/configure.ac
Normal file
@@ -0,0 +1,11 @@
|
||||
#! /bin/bash -norc
|
||||
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.
|
||||
|
||||
dnl Ensure that the config (auto)headers support is used, then just
|
||||
dnl include the configure sources from ../unix:
|
||||
|
||||
m4_include(../unix/aclocal.m4)
|
||||
m4_define(SC_USE_CONFIG_HEADERS)
|
||||
m4_include(../unix/configure.in)
|
||||
40
macosx/license.terms
Normal file
40
macosx/license.terms
Normal file
@@ -0,0 +1,40 @@
|
||||
This software is copyrighted by the Regents of the University of
|
||||
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
|
||||
Corporation and other parties. The following terms apply to all files
|
||||
associated with the software unless explicitly disclaimed in
|
||||
individual files.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
|
||||
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
|
||||
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
|
||||
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
|
||||
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
|
||||
MODIFICATIONS.
|
||||
|
||||
GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
U.S. government, the Government shall have only "Restricted Rights"
|
||||
in the software and related documentation as defined in the Federal
|
||||
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
are acquiring the software on behalf of the Department of Defense, the
|
||||
software shall be classified as "Commercial Computer Software" and the
|
||||
Government shall have only "Restricted Rights" as defined in Clause
|
||||
252.227-7013 (b) (3) of DFARs. Notwithstanding the foregoing, the
|
||||
authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
286
macosx/tclMacOSXBundle.c
Normal file
286
macosx/tclMacOSXBundle.c
Normal file
@@ -0,0 +1,286 @@
|
||||
/*
|
||||
* tclMacOSXBundle.c --
|
||||
*
|
||||
* This file implements functions that inspect CFBundle structures on
|
||||
* MacOS X.
|
||||
*
|
||||
* Copyright 2001-2009, Apple Inc.
|
||||
* Copyright (c) 2003-2009 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tclPort.h"
|
||||
|
||||
#ifdef HAVE_COREFOUNDATION
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#ifndef TCL_DYLD_USE_DLFCN
|
||||
/*
|
||||
* Use preferred dlfcn API on 10.4 and later
|
||||
*/
|
||||
# if !defined(NO_DLFCN_H) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
|
||||
# define TCL_DYLD_USE_DLFCN 1
|
||||
# else
|
||||
# define TCL_DYLD_USE_DLFCN 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TCL_DYLD_USE_NSMODULE
|
||||
/*
|
||||
* Use deprecated NSModule API only to support 10.3 and earlier:
|
||||
*/
|
||||
# if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
|
||||
# define TCL_DYLD_USE_NSMODULE 1
|
||||
# else
|
||||
# define TCL_DYLD_USE_NSMODULE 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if TCL_DYLD_USE_DLFCN
|
||||
#include <dlfcn.h>
|
||||
#if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1040
|
||||
/*
|
||||
* Support for weakly importing dlfcn API.
|
||||
*/
|
||||
extern void *dlsym(void *handle, const char *symbol) WEAK_IMPORT_ATTRIBUTE;
|
||||
extern char *dlerror(void) WEAK_IMPORT_ATTRIBUTE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if TCL_DYLD_USE_NSMODULE
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#if (TCL_DYLD_USE_DLFCN && MAC_OS_X_VERSION_MIN_REQUIRED < 1040) || \
|
||||
(MAC_OS_X_VERSION_MIN_REQUIRED < 1050)
|
||||
MODULE_SCOPE long tclMacOSXDarwinRelease;
|
||||
#endif
|
||||
|
||||
#ifdef TCL_DEBUG_LOAD
|
||||
#define TclLoadDbgMsg(m, ...) do { \
|
||||
fprintf(stderr, "%s:%d: %s(): " m ".\n", \
|
||||
strrchr(__FILE__, '/')+1, __LINE__, __func__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define TclLoadDbgMsg(m, ...)
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_COREFOUNDATION */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_MacOSXOpenBundleResources --
|
||||
*
|
||||
* Given the bundle name for a shared library, this routine sets
|
||||
* libraryPath to the Resources/Scripts directory in the framework
|
||||
* package. If hasResourceFile is true, it will also open the main
|
||||
* resource file for the bundle.
|
||||
*
|
||||
* Results:
|
||||
* TCL_OK if the bundle could be opened, and the Scripts folder found.
|
||||
* TCL_ERROR otherwise.
|
||||
*
|
||||
* Side effects:
|
||||
* libraryVariableName may be set, and the resource file opened.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_MacOSXOpenBundleResources(
|
||||
Tcl_Interp *interp,
|
||||
CONST char *bundleName,
|
||||
int hasResourceFile,
|
||||
int maxPathLen,
|
||||
char *libraryPath)
|
||||
{
|
||||
return Tcl_MacOSXOpenVersionedBundleResources(interp, bundleName,
|
||||
NULL, hasResourceFile, maxPathLen, libraryPath);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_MacOSXOpenVersionedBundleResources --
|
||||
*
|
||||
* Given the bundle and version name for a shared library (version name
|
||||
* can be NULL to indicate latest version), this routine sets libraryPath
|
||||
* to the Resources/Scripts directory in the framework package. If
|
||||
* hasResourceFile is true, it will also open the main resource file for
|
||||
* the bundle.
|
||||
*
|
||||
* Results:
|
||||
* TCL_OK if the bundle could be opened, and the Scripts folder found.
|
||||
* TCL_ERROR otherwise.
|
||||
*
|
||||
* Side effects:
|
||||
* libraryVariableName may be set, and the resource file opened.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_MacOSXOpenVersionedBundleResources(
|
||||
Tcl_Interp *interp,
|
||||
CONST char *bundleName,
|
||||
CONST char *bundleVersion,
|
||||
int hasResourceFile,
|
||||
int maxPathLen,
|
||||
char *libraryPath)
|
||||
{
|
||||
#ifdef HAVE_COREFOUNDATION
|
||||
CFBundleRef bundleRef, versionedBundleRef = NULL;
|
||||
CFStringRef bundleNameRef;
|
||||
CFURLRef libURL;
|
||||
|
||||
libraryPath[0] = '\0';
|
||||
|
||||
bundleNameRef = CFStringCreateWithCString(NULL, bundleName,
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
bundleRef = CFBundleGetBundleWithIdentifier(bundleNameRef);
|
||||
CFRelease(bundleNameRef);
|
||||
|
||||
if (bundleVersion && bundleRef) {
|
||||
/*
|
||||
* Create bundle from bundleVersion subdirectory of 'Versions'.
|
||||
*/
|
||||
|
||||
CFURLRef bundleURL = CFBundleCopyBundleURL(bundleRef);
|
||||
|
||||
if (bundleURL) {
|
||||
CFStringRef bundleVersionRef = CFStringCreateWithCString(NULL,
|
||||
bundleVersion, kCFStringEncodingUTF8);
|
||||
|
||||
if (bundleVersionRef) {
|
||||
CFComparisonResult versionComparison = kCFCompareLessThan;
|
||||
CFStringRef bundleTailRef = CFURLCopyLastPathComponent(
|
||||
bundleURL);
|
||||
|
||||
if (bundleTailRef) {
|
||||
versionComparison = CFStringCompare(bundleTailRef,
|
||||
bundleVersionRef, 0);
|
||||
CFRelease(bundleTailRef);
|
||||
}
|
||||
if (versionComparison != kCFCompareEqualTo) {
|
||||
CFURLRef versURL = CFURLCreateCopyAppendingPathComponent(
|
||||
NULL, bundleURL, CFSTR("Versions"), TRUE);
|
||||
|
||||
if (versURL) {
|
||||
CFURLRef versionedBundleURL =
|
||||
CFURLCreateCopyAppendingPathComponent(
|
||||
NULL, versURL, bundleVersionRef, TRUE);
|
||||
|
||||
if (versionedBundleURL) {
|
||||
versionedBundleRef = CFBundleCreate(NULL,
|
||||
versionedBundleURL);
|
||||
if (versionedBundleRef) {
|
||||
bundleRef = versionedBundleRef;
|
||||
}
|
||||
CFRelease(versionedBundleURL);
|
||||
}
|
||||
CFRelease(versURL);
|
||||
}
|
||||
}
|
||||
CFRelease(bundleVersionRef);
|
||||
}
|
||||
CFRelease(bundleURL);
|
||||
}
|
||||
}
|
||||
|
||||
if (bundleRef) {
|
||||
if (hasResourceFile) {
|
||||
/*
|
||||
* Dynamically acquire address for CFBundleOpenBundleResourceMap
|
||||
* symbol, since it is only present in full CoreFoundation on Mac
|
||||
* OS X and not in CFLite on pure Darwin.
|
||||
*/
|
||||
|
||||
static int initialized = FALSE;
|
||||
static short (*openresourcemap)(CFBundleRef) = NULL;
|
||||
|
||||
if (!initialized) {
|
||||
#if TCL_DYLD_USE_DLFCN
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
|
||||
if (tclMacOSXDarwinRelease >= 8)
|
||||
#endif
|
||||
{
|
||||
const char *errMsg = nil;
|
||||
openresourcemap = dlsym(RTLD_NEXT,
|
||||
"CFBundleOpenBundleResourceMap");
|
||||
if (!openresourcemap) {
|
||||
errMsg = dlerror();
|
||||
TclLoadDbgMsg("dlsym() failed: %s", errMsg);
|
||||
}
|
||||
}
|
||||
if (!openresourcemap)
|
||||
#endif
|
||||
{
|
||||
#if TCL_DYLD_USE_NSMODULE
|
||||
NSSymbol nsSymbol = NULL;
|
||||
if (NSIsSymbolNameDefinedWithHint(
|
||||
"_CFBundleOpenBundleResourceMap",
|
||||
"CoreFoundation")) {
|
||||
nsSymbol = NSLookupAndBindSymbolWithHint(
|
||||
"_CFBundleOpenBundleResourceMap",
|
||||
"CoreFoundation");
|
||||
if (nsSymbol) {
|
||||
openresourcemap = NSAddressOfSymbol(nsSymbol);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
initialized = TRUE;
|
||||
}
|
||||
|
||||
if (openresourcemap) {
|
||||
short refNum;
|
||||
|
||||
refNum = openresourcemap(bundleRef);
|
||||
}
|
||||
}
|
||||
|
||||
libURL = CFBundleCopyResourceURL(bundleRef, CFSTR("Scripts"),
|
||||
NULL, NULL);
|
||||
|
||||
if (libURL) {
|
||||
/*
|
||||
* FIXME: This is a quick fix, it is probably not right for
|
||||
* internationalization.
|
||||
*/
|
||||
|
||||
CFURLGetFileSystemRepresentation(libURL, TRUE,
|
||||
(unsigned char*) libraryPath, maxPathLen);
|
||||
CFRelease(libURL);
|
||||
}
|
||||
if (versionedBundleRef) {
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||
/* Workaround CFBundle bug in Tiger and earlier. [Bug 2569449] */
|
||||
if (tclMacOSXDarwinRelease >= 9)
|
||||
#endif
|
||||
{
|
||||
CFRelease(versionedBundleRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (libraryPath[0]) {
|
||||
return TCL_OK;
|
||||
} else {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#else /* HAVE_COREFOUNDATION */
|
||||
return TCL_ERROR;
|
||||
#endif /* HAVE_COREFOUNDATION */
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
696
macosx/tclMacOSXFCmd.c
Normal file
696
macosx/tclMacOSXFCmd.c
Normal file
@@ -0,0 +1,696 @@
|
||||
/*
|
||||
* tclMacOSXFCmd.c
|
||||
*
|
||||
* This file implements the MacOSX specific portion of file manipulation
|
||||
* subcommands of the "file" command.
|
||||
*
|
||||
* Copyright (c) 2003-2007 Daniel A. Steffen <das@users.sourceforge.net>
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
#ifdef HAVE_GETATTRLIST
|
||||
#include <sys/attr.h>
|
||||
#include <sys/paths.h>
|
||||
#include <libkern/OSByteOrder.h>
|
||||
#endif
|
||||
|
||||
/* Darwin 8 copyfile API. */
|
||||
#ifdef HAVE_COPYFILE
|
||||
#ifdef HAVE_COPYFILE_H
|
||||
#include <copyfile.h>
|
||||
#if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1040
|
||||
/* Support for weakly importing copyfile. */
|
||||
#define WEAK_IMPORT_COPYFILE
|
||||
extern int copyfile(const char *from, const char *to, copyfile_state_t state,
|
||||
copyfile_flags_t flags) WEAK_IMPORT_ATTRIBUTE;
|
||||
#endif /* HAVE_WEAK_IMPORT */
|
||||
#else /* HAVE_COPYFILE_H */
|
||||
int copyfile(const char *from, const char *to, void *state, uint32_t flags);
|
||||
#define COPYFILE_ACL (1<<0)
|
||||
#define COPYFILE_XATTR (1<<2)
|
||||
#define COPYFILE_NOFOLLOW_SRC (1<<18)
|
||||
#if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1040
|
||||
/* Support for weakly importing copyfile. */
|
||||
#define WEAK_IMPORT_COPYFILE
|
||||
extern int copyfile(const char *from, const char *to, void *state,
|
||||
uint32_t flags) WEAK_IMPORT_ATTRIBUTE;
|
||||
#endif /* HAVE_WEAK_IMPORT */
|
||||
#endif /* HAVE_COPYFILE_H */
|
||||
#endif /* HAVE_COPYFILE */
|
||||
|
||||
#include <libkern/OSByteOrder.h>
|
||||
|
||||
/*
|
||||
* Constants for file attributes subcommand. Need to be kept in sync with
|
||||
* tclUnixFCmd.c !
|
||||
*/
|
||||
|
||||
enum {
|
||||
UNIX_GROUP_ATTRIBUTE,
|
||||
UNIX_OWNER_ATTRIBUTE,
|
||||
UNIX_PERMISSIONS_ATTRIBUTE,
|
||||
#ifdef HAVE_CHFLAGS
|
||||
UNIX_READONLY_ATTRIBUTE,
|
||||
#endif
|
||||
#ifdef MAC_OSX_TCL
|
||||
MACOSX_CREATOR_ATTRIBUTE,
|
||||
MACOSX_TYPE_ATTRIBUTE,
|
||||
MACOSX_HIDDEN_ATTRIBUTE,
|
||||
MACOSX_RSRCLENGTH_ATTRIBUTE,
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef u_int32_t OSType;
|
||||
|
||||
static int GetOSTypeFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, OSType *osTypePtr);
|
||||
static Tcl_Obj * NewOSTypeObj(const OSType newOSType);
|
||||
static int SetOSTypeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
static void UpdateStringOfOSType(Tcl_Obj *objPtr);
|
||||
|
||||
static Tcl_ObjType tclOSTypeType = {
|
||||
"osType", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
UpdateStringOfOSType, /* updateStringProc */
|
||||
SetOSTypeFromAny /* setFromAnyProc */
|
||||
};
|
||||
|
||||
enum {
|
||||
kIsInvisible = 0x4000,
|
||||
};
|
||||
|
||||
#define kFinfoIsInvisible (OSSwapHostToBigConstInt16(kIsInvisible))
|
||||
|
||||
typedef struct finderinfo {
|
||||
u_int32_t type;
|
||||
u_int32_t creator;
|
||||
u_int16_t fdFlags;
|
||||
u_int32_t location;
|
||||
u_int16_t reserved;
|
||||
u_int32_t extendedFileInfo[4];
|
||||
} __attribute__ ((__packed__)) finderinfo;
|
||||
|
||||
typedef struct fileinfobuf {
|
||||
u_int32_t info_length;
|
||||
u_int32_t data[8];
|
||||
} fileinfobuf;
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclMacOSXGetFileAttribute
|
||||
*
|
||||
* Gets a MacOSX attribute of a file. Which attribute is controlled by
|
||||
* objIndex. The object will have ref count 0.
|
||||
*
|
||||
* Results:
|
||||
* Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there
|
||||
* is no error.
|
||||
*
|
||||
* Side effects:
|
||||
* A new object is allocated.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclMacOSXGetFileAttribute(
|
||||
Tcl_Interp *interp, /* The interp we are using for errors. */
|
||||
int objIndex, /* The index of the attribute. */
|
||||
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
|
||||
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
|
||||
{
|
||||
#ifdef HAVE_GETATTRLIST
|
||||
int result;
|
||||
Tcl_StatBuf statBuf;
|
||||
struct attrlist alist;
|
||||
fileinfobuf finfo;
|
||||
finderinfo *finder = (finderinfo*)(&finfo.data);
|
||||
off_t *rsrcForkSize = (off_t*)(&finfo.data);
|
||||
const char *native;
|
||||
|
||||
result = TclpObjStat(fileName, &statBuf);
|
||||
|
||||
if (result != 0) {
|
||||
Tcl_AppendResult(interp, "could not read \"",
|
||||
TclGetString(fileName), "\": ", Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (S_ISDIR(statBuf.st_mode) && objIndex != MACOSX_HIDDEN_ATTRIBUTE) {
|
||||
/*
|
||||
* Directories only support attribute "-hidden".
|
||||
*/
|
||||
|
||||
errno = EISDIR;
|
||||
Tcl_AppendResult(interp, "invalid attribute: ",
|
||||
Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
bzero(&alist, sizeof(struct attrlist));
|
||||
alist.bitmapcount = ATTR_BIT_MAP_COUNT;
|
||||
if (objIndex == MACOSX_RSRCLENGTH_ATTRIBUTE) {
|
||||
alist.fileattr = ATTR_FILE_RSRCLENGTH;
|
||||
} else {
|
||||
alist.commonattr = ATTR_CMN_FNDRINFO;
|
||||
}
|
||||
native = Tcl_FSGetNativePath(fileName);
|
||||
result = getattrlist(native, &alist, &finfo, sizeof(fileinfobuf), 0);
|
||||
|
||||
if (result != 0) {
|
||||
Tcl_AppendResult(interp, "could not read attributes of \"",
|
||||
TclGetString(fileName), "\": ", Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
switch (objIndex) {
|
||||
case MACOSX_CREATOR_ATTRIBUTE:
|
||||
*attributePtrPtr = NewOSTypeObj(
|
||||
OSSwapBigToHostInt32(finder->creator));
|
||||
break;
|
||||
case MACOSX_TYPE_ATTRIBUTE:
|
||||
*attributePtrPtr = NewOSTypeObj(
|
||||
OSSwapBigToHostInt32(finder->type));
|
||||
break;
|
||||
case MACOSX_HIDDEN_ATTRIBUTE:
|
||||
*attributePtrPtr = Tcl_NewBooleanObj(
|
||||
(finder->fdFlags & kFinfoIsInvisible) != 0);
|
||||
break;
|
||||
case MACOSX_RSRCLENGTH_ATTRIBUTE:
|
||||
*attributePtrPtr = Tcl_NewWideIntObj(*rsrcForkSize);
|
||||
break;
|
||||
}
|
||||
return TCL_OK;
|
||||
#else
|
||||
Tcl_AppendResult(interp, "Mac OS X file attributes not supported", NULL);
|
||||
return TCL_ERROR;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* TclMacOSXSetFileAttribute --
|
||||
*
|
||||
* Sets a MacOSX attribute of a file. Which attribute is controlled by
|
||||
* objIndex.
|
||||
*
|
||||
* Results:
|
||||
* Standard TCL result.
|
||||
*
|
||||
* Side effects:
|
||||
* As above.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclMacOSXSetFileAttribute(
|
||||
Tcl_Interp *interp, /* The interp for error reporting. */
|
||||
int objIndex, /* The index of the attribute. */
|
||||
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
|
||||
Tcl_Obj *attributePtr) /* New owner for file. */
|
||||
{
|
||||
#ifdef HAVE_GETATTRLIST
|
||||
int result;
|
||||
Tcl_StatBuf statBuf;
|
||||
struct attrlist alist;
|
||||
fileinfobuf finfo;
|
||||
finderinfo *finder = (finderinfo*)(&finfo.data);
|
||||
off_t *rsrcForkSize = (off_t*)(&finfo.data);
|
||||
const char *native;
|
||||
|
||||
result = TclpObjStat(fileName, &statBuf);
|
||||
|
||||
if (result != 0) {
|
||||
Tcl_AppendResult(interp, "could not read \"",
|
||||
TclGetString(fileName), "\": ", Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (S_ISDIR(statBuf.st_mode) && objIndex != MACOSX_HIDDEN_ATTRIBUTE) {
|
||||
/*
|
||||
* Directories only support attribute "-hidden".
|
||||
*/
|
||||
|
||||
errno = EISDIR;
|
||||
Tcl_AppendResult(interp, "invalid attribute: ",
|
||||
Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
bzero(&alist, sizeof(struct attrlist));
|
||||
alist.bitmapcount = ATTR_BIT_MAP_COUNT;
|
||||
if (objIndex == MACOSX_RSRCLENGTH_ATTRIBUTE) {
|
||||
alist.fileattr = ATTR_FILE_RSRCLENGTH;
|
||||
} else {
|
||||
alist.commonattr = ATTR_CMN_FNDRINFO;
|
||||
}
|
||||
native = Tcl_FSGetNativePath(fileName);
|
||||
result = getattrlist(native, &alist, &finfo, sizeof(fileinfobuf), 0);
|
||||
|
||||
if (result != 0) {
|
||||
Tcl_AppendResult(interp, "could not read attributes of \"",
|
||||
TclGetString(fileName), "\": ", Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (objIndex != MACOSX_RSRCLENGTH_ATTRIBUTE) {
|
||||
OSType t;
|
||||
int h;
|
||||
|
||||
switch (objIndex) {
|
||||
case MACOSX_CREATOR_ATTRIBUTE:
|
||||
if (GetOSTypeFromObj(interp, attributePtr, &t) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
finder->creator = OSSwapHostToBigInt32(t);
|
||||
break;
|
||||
case MACOSX_TYPE_ATTRIBUTE:
|
||||
if (GetOSTypeFromObj(interp, attributePtr, &t) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
finder->type = OSSwapHostToBigInt32(t);
|
||||
break;
|
||||
case MACOSX_HIDDEN_ATTRIBUTE:
|
||||
if (Tcl_GetBooleanFromObj(interp, attributePtr, &h) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (h) {
|
||||
finder->fdFlags |= kFinfoIsInvisible;
|
||||
} else {
|
||||
finder->fdFlags &= ~kFinfoIsInvisible;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
result = setattrlist(native, &alist,
|
||||
&finfo.data, sizeof(finfo.data), 0);
|
||||
|
||||
if (result != 0) {
|
||||
Tcl_AppendResult(interp, "could not set attributes of \"",
|
||||
TclGetString(fileName), "\": ",
|
||||
Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
} else {
|
||||
Tcl_WideInt newRsrcForkSize;
|
||||
|
||||
if (Tcl_GetWideIntFromObj(interp, attributePtr,
|
||||
&newRsrcForkSize) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (newRsrcForkSize != *rsrcForkSize) {
|
||||
Tcl_DString ds;
|
||||
|
||||
/*
|
||||
* Only setting rsrclength to 0 to strip a file's resource fork is
|
||||
* supported.
|
||||
*/
|
||||
|
||||
if(newRsrcForkSize != 0) {
|
||||
Tcl_AppendResult(interp,
|
||||
"setting nonzero rsrclength not supported", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct path to resource fork.
|
||||
*/
|
||||
|
||||
Tcl_DStringInit(&ds);
|
||||
Tcl_DStringAppend(&ds, native, -1);
|
||||
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);
|
||||
|
||||
if (result != 0) {
|
||||
Tcl_AppendResult(interp,
|
||||
"could not truncate resource fork of \"",
|
||||
TclGetString(fileName), "\": ",
|
||||
Tcl_PosixError(interp), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TCL_OK;
|
||||
#else
|
||||
Tcl_AppendResult(interp, "Mac OS X file attributes not supported", NULL);
|
||||
return TCL_ERROR;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* TclMacOSXCopyFileAttributes --
|
||||
*
|
||||
* Copy the MacOSX attributes and resource fork (if present) from one
|
||||
* file to another.
|
||||
*
|
||||
* Results:
|
||||
* Standard Tcl result.
|
||||
*
|
||||
* Side effects:
|
||||
* MacOSX attributes and resource fork are updated in the new file to
|
||||
* reflect the old file.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclMacOSXCopyFileAttributes(
|
||||
CONST char *src, /* Path name of source file (native). */
|
||||
CONST char *dst, /* Path name of target file (native). */
|
||||
CONST Tcl_StatBuf *statBufPtr)
|
||||
/* Stat info for source file */
|
||||
{
|
||||
#ifdef WEAK_IMPORT_COPYFILE
|
||||
if (copyfile != NULL) {
|
||||
#endif
|
||||
#ifdef HAVE_COPYFILE
|
||||
if (copyfile(src, dst, NULL, COPYFILE_XATTR |
|
||||
(S_ISLNK(statBufPtr->st_mode) ? COPYFILE_NOFOLLOW_SRC :
|
||||
COPYFILE_ACL)) < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_OK;
|
||||
#endif /* HAVE_COPYFILE */
|
||||
#ifdef WEAK_IMPORT_COPYFILE
|
||||
} else {
|
||||
#endif
|
||||
#if !defined(HAVE_COPYFILE) || defined(WEAK_IMPORT_COPYFILE)
|
||||
#ifdef HAVE_GETATTRLIST
|
||||
struct attrlist alist;
|
||||
fileinfobuf finfo;
|
||||
off_t *rsrcForkSize = (off_t*)(&finfo.data);
|
||||
|
||||
bzero(&alist, sizeof(struct attrlist));
|
||||
alist.bitmapcount = ATTR_BIT_MAP_COUNT;
|
||||
alist.commonattr = ATTR_CMN_FNDRINFO;
|
||||
|
||||
if (getattrlist(src, &alist, &finfo, sizeof(fileinfobuf), 0)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (setattrlist(dst, &alist, &finfo.data, sizeof(finfo.data), 0)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (!S_ISDIR(statBufPtr->st_mode)) {
|
||||
/*
|
||||
* Only copy non-empty resource fork.
|
||||
*/
|
||||
|
||||
alist.commonattr = 0;
|
||||
alist.fileattr = ATTR_FILE_RSRCLENGTH;
|
||||
|
||||
if (getattrlist(src, &alist, &finfo, sizeof(fileinfobuf), 0)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if(*rsrcForkSize > 0) {
|
||||
int result;
|
||||
Tcl_DString ds_src, ds_dst;
|
||||
|
||||
/*
|
||||
* Construct paths to resource forks.
|
||||
*/
|
||||
|
||||
Tcl_DStringInit(&ds_src);
|
||||
Tcl_DStringAppend(&ds_src, src, -1);
|
||||
Tcl_DStringAppend(&ds_src, _PATH_RSRCFORKSPEC, -1);
|
||||
Tcl_DStringInit(&ds_dst);
|
||||
Tcl_DStringAppend(&ds_dst, dst, -1);
|
||||
Tcl_DStringAppend(&ds_dst, _PATH_RSRCFORKSPEC, -1);
|
||||
|
||||
result = TclUnixCopyFile(Tcl_DStringValue(&ds_src),
|
||||
Tcl_DStringValue(&ds_dst), statBufPtr, 1);
|
||||
|
||||
Tcl_DStringFree(&ds_src);
|
||||
Tcl_DStringFree(&ds_dst);
|
||||
|
||||
if (result != 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TCL_OK;
|
||||
#else
|
||||
return TCL_ERROR;
|
||||
#endif /* HAVE_GETATTRLIST */
|
||||
#endif /* !defined(HAVE_COPYFILE) || defined(WEAK_IMPORT_COPYFILE) */
|
||||
#ifdef WEAK_IMPORT_COPYFILE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclMacOSXMatchType --
|
||||
*
|
||||
* This routine is used by the globbing code to check if a file
|
||||
* matches a given mac type and/or creator code.
|
||||
*
|
||||
* Results:
|
||||
* The return value is 1, 0 or -1 indicating whether the file
|
||||
* matches the given criteria, does not match them, or an error
|
||||
* occurred (in wich case an error is left in interp).
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclMacOSXMatchType(
|
||||
Tcl_Interp *interp, /* Interpreter to receive errors. */
|
||||
CONST char *pathName, /* Native path to check. */
|
||||
CONST char *fileName, /* Native filename to check. */
|
||||
Tcl_StatBuf *statBufPtr, /* Stat info for file to check */
|
||||
Tcl_GlobTypeData *types) /* Type description to match against. */
|
||||
{
|
||||
#ifdef HAVE_GETATTRLIST
|
||||
struct attrlist alist;
|
||||
fileinfobuf finfo;
|
||||
finderinfo *finder = (finderinfo*)(&finfo.data);
|
||||
OSType osType;
|
||||
|
||||
bzero(&alist, sizeof(struct attrlist));
|
||||
alist.bitmapcount = ATTR_BIT_MAP_COUNT;
|
||||
alist.commonattr = ATTR_CMN_FNDRINFO;
|
||||
if (getattrlist(pathName, &alist, &finfo, sizeof(fileinfobuf), 0) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((types->perm & TCL_GLOB_PERM_HIDDEN) &&
|
||||
!((finder->fdFlags & kFinfoIsInvisible) || (*fileName == '.'))) {
|
||||
return 0;
|
||||
}
|
||||
if (S_ISDIR(statBufPtr->st_mode) && (types->macType || types->macCreator)) {
|
||||
/* Directories don't support types or creators */
|
||||
return 0;
|
||||
}
|
||||
if (types->macType) {
|
||||
if (GetOSTypeFromObj(interp, types->macType, &osType) != TCL_OK) {
|
||||
return -1;
|
||||
}
|
||||
if (osType != OSSwapBigToHostInt32(finder->type)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (types->macCreator) {
|
||||
if (GetOSTypeFromObj(interp, types->macCreator, &osType) != TCL_OK) {
|
||||
return -1;
|
||||
}
|
||||
if (osType != OSSwapBigToHostInt32(finder->creator)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* GetOSTypeFromObj --
|
||||
*
|
||||
* Attempt to return an OSType from the Tcl object "objPtr".
|
||||
*
|
||||
* Results:
|
||||
* Standard TCL result. If an error occurs during conversion, an error
|
||||
* message is left in interp->objResult.
|
||||
*
|
||||
* Side effects:
|
||||
* The string representation of objPtr will be updated if necessary.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
GetOSTypeFromObj(
|
||||
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
|
||||
Tcl_Obj *objPtr, /* The object from which to get an OSType. */
|
||||
OSType *osTypePtr) /* Place to store resulting OSType. */
|
||||
{
|
||||
int result = TCL_OK;
|
||||
|
||||
if (objPtr->typePtr != &tclOSTypeType) {
|
||||
result = tclOSTypeType.setFromAnyProc(interp, objPtr);
|
||||
};
|
||||
*osTypePtr = (OSType) objPtr->internalRep.longValue;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* NewOSTypeObj --
|
||||
*
|
||||
* Create a new OSType object.
|
||||
*
|
||||
* Results:
|
||||
* The newly created OSType object is returned, it has ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static Tcl_Obj *
|
||||
NewOSTypeObj(
|
||||
const OSType osType) /* OSType used to initialize the new object. */
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
TclNewObj(objPtr);
|
||||
TclInvalidateStringRep(objPtr);
|
||||
objPtr->internalRep.longValue = (long) osType;
|
||||
objPtr->typePtr = &tclOSTypeType;
|
||||
return objPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* SetOSTypeFromAny --
|
||||
*
|
||||
* Attempts to force the internal representation for a Tcl object to
|
||||
* tclOSTypeType, specifically.
|
||||
*
|
||||
* Results:
|
||||
* The return value is a standard object Tcl result. If an error occurs
|
||||
* during conversion, an error message is left in the interpreter's
|
||||
* result unless "interp" is NULL.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
SetOSTypeFromAny(
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
Tcl_Obj *objPtr) /* Pointer to the object to convert */
|
||||
{
|
||||
char *string;
|
||||
int length, result = TCL_OK;
|
||||
Tcl_DString ds;
|
||||
Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman");
|
||||
|
||||
string = Tcl_GetStringFromObj(objPtr, &length);
|
||||
Tcl_UtfToExternalDString(encoding, string, length, &ds);
|
||||
|
||||
if (Tcl_DStringLength(&ds) > 4) {
|
||||
if (interp) {
|
||||
Tcl_AppendResult(interp, "expected Macintosh OS type but got \"",
|
||||
string, "\": ", NULL);
|
||||
}
|
||||
result = TCL_ERROR;
|
||||
} else {
|
||||
OSType osType;
|
||||
char string[4] = {'\0','\0','\0','\0'};
|
||||
memcpy(string, Tcl_DStringValue(&ds),
|
||||
(size_t) Tcl_DStringLength(&ds));
|
||||
osType = (OSType) string[0] << 24 |
|
||||
(OSType) string[1] << 16 |
|
||||
(OSType) string[2] << 8 |
|
||||
(OSType) string[3];
|
||||
TclFreeIntRep(objPtr);
|
||||
objPtr->internalRep.longValue = (long) osType;
|
||||
objPtr->typePtr = &tclOSTypeType;
|
||||
}
|
||||
Tcl_DStringFree(&ds);
|
||||
Tcl_FreeEncoding(encoding);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* UpdateStringOfOSType --
|
||||
*
|
||||
* Update the string representation for an OSType object. Note: This
|
||||
* function does not free an existing old string rep so storage will be
|
||||
* lost if this has not already been done.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's string is set to a valid string that results from the
|
||||
* OSType-to-string conversion.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
UpdateStringOfOSType(
|
||||
register Tcl_Obj *objPtr) /* OSType object whose string rep to update. */
|
||||
{
|
||||
char string[5];
|
||||
OSType osType = (OSType) objPtr->internalRep.longValue;
|
||||
Tcl_DString ds;
|
||||
Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman");
|
||||
|
||||
string[0] = (char) (osType >> 24);
|
||||
string[1] = (char) (osType >> 16);
|
||||
string[2] = (char) (osType >> 8);
|
||||
string[3] = (char) (osType);
|
||||
string[4] = '\0';
|
||||
Tcl_ExternalToUtfDString(encoding, string, -1, &ds);
|
||||
objPtr->bytes = ckalloc((unsigned) Tcl_DStringLength(&ds) + 1);
|
||||
strcpy(objPtr->bytes, Tcl_DStringValue(&ds));
|
||||
objPtr->length = Tcl_DStringLength(&ds);
|
||||
Tcl_DStringFree(&ds);
|
||||
Tcl_FreeEncoding(encoding);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
1999
macosx/tclMacOSXNotify.c
Normal file
1999
macosx/tclMacOSXNotify.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user