diff options
-rw-r--r-- | ChangeLog | 36 | ||||
-rw-r--r-- | macosx/Makefile | 295 | ||||
-rw-r--r-- | macosx/README | 63 | ||||
-rw-r--r-- | macosx/Tk-Info.plist.in | 27 | ||||
-rw-r--r-- | macosx/Wish-Info.plist.in | 46 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 63 | ||||
-rw-r--r-- | unix/Makefile.in | 475 | ||||
-rwxr-xr-x | unix/configure | 864 | ||||
-rw-r--r-- | unix/configure.in | 258 | ||||
-rw-r--r-- | unix/tcl.m4 | 3 | ||||
-rw-r--r-- | unix/tkUnixInit.c | 45 |
11 files changed, 1583 insertions, 592 deletions
@@ -1,3 +1,39 @@ +2005-05-24 Daniel Steffen <das@users.sourceforge.net> + + * generic/tkTest.c: disable commands not available on TkAqua. + + * macosx/Makefile: + * macosx/README: + * macosx/Tk-Info.plist.in (new file): + * macosx/Wish-Info.plist.in (new file): + * unix/Makefile.in: + * unix/configure.in: + * unix/tcl.m4: + * unix/tkUnixInit.c: moved all Darwin framework and TkAqua build + support from macosx/Wish.pbproj and macosx/Makefile into the standard + unix configure/make buildsystem, the project and macosx/Makefile are + no longer required to build Tk.framework and/or TkAqua. TkAqua is now + enabled by the --enable-aqua configure option, and static and + non-framework builds of TkAqua are now available via the standard + configure switches. Tk/X11 can also be built as a framework. The + macosx/Makefile now wraps the unix buildsystem and no longer uses the + projects, embedded builds are still only available via this Makefile, + but for other builds it is not longer required (but its current + functionality is still available for backwards compatibility). The + projects currently do not call through to the Makefile to build + (unlike Tcl.pbproj) so project builds may differ from makefile builds. + Due to issues with spaces in pathnames, 'Wish Shell.app' has been + renamed to 'Wish.app', the macosx/Makefile installs backwards + compatibility symlinks for the old name. + * macosx/tkMacOSXInit.c (TkpInit): added support for Tk resource file + in non-framework and static builds: the resource file is copied into a + __tk_rsrc MachO segment of the library or executable at link time and + extracted into a temporary location at initialization. + * unix/configure: autoconf-2.13 + + * macosx/Wish.pbproj/project.pbxproj: + * macosx/tkAboutDlg.r: updated copyright years to 2005. + 2005-05-15 Jim Ingham <jingham@apple.com> Fixes from Michael Kirkham: diff --git a/macosx/Makefile b/macosx/Makefile index ad5b4c9..ca29ead 100644 --- a/macosx/Makefile +++ b/macosx/Makefile @@ -1,13 +1,14 @@ -################################################################################ +######################################################################################################## # -# Makefile to build AquaTk on Mac OS X packaged as a Framework -# uses Project Builder command line tool 'pbxbuild' +# Makefile wrapper to build tk on Mac OS X in a way compatible with the tk/macosx Xcode buildsystem +# uses the standard unix build system in tk/unix (which can be used directly instead of this +# if you are not using the tk/macosx projects). # -# RCS: @(#) $Id: Makefile,v 1.7.2.7 2004/11/11 01:26:42 das Exp $ +# RCS: @(#) $Id: Makefile,v 1.7.2.8 2005/05/24 04:21:32 das Exp $ # -################################################################################ +######################################################################################################## -#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------------------------------- # customizable settings DESTDIR ?= @@ -17,117 +18,263 @@ BUILD_DIR ?= ${CURDIR}/../../build SYMROOT ?= ${BUILD_DIR}/${PROJECT} OBJROOT ?= ${SYMROOT} +EXTRA_CONFIGURE_ARGS ?= EXTRA_MAKE_ARGS ?= INSTALL_PATH ?= /Library/Frameworks APPLICATION_INSTALL_PATH ?= /Applications/Utilities - -PREFIX ?= /usr +PREFIX ?= /usr/local BINDIR ?= ${PREFIX}/bin +LIBDIR ?= ${INSTALL_PATH} MANDIR ?= ${PREFIX}/man -TCL_FRAMEWORK_DIR ?= ${BUILD_DIR}/tcl -TCLSH_DIR ?= ${TCL_FRAMEWORK_DIR} +# tcl build directory (containing tclConfig.sh and Makefile) +TCL_BUILD_DIR ?= ${BUILD_DIR}/tcl/${BUILD_STYLE} +# location of installed tcl, only used if tcl in TCL_BUILD_DIR can't be found +TCL_FRAMEWORK_DIR ?= /Library/Frameworks +TCLSH_DIR ?= ${PREFIX} # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= -#------------------------------------------------------------------------------- +# set to non-empty value to build TkX11 instead of TkAqua: +TK_X11 ?= -PROJECT = tk -TARGET = Wish +#------------------------------------------------------------------------------------------------------- +# meta targets -DEVBUILDSTYLE = Development -DEPBUILDSTYLE = Deployment +meta := all install embedded install-embedded clean distclean test -PBXBUILD = /usr/bin/pbxbuild -XCODEBUILD = /usr/bin/xcodebuild +styles := develop deploy -BUILDCMD = `if [ -f $(XCODEBUILD) ]; then \ - echo "$(XCODEBUILD) -project $$(ls -d *.pbproj)"; \ - else echo "$(PBXBUILD)"; fi` +all := ${styles} +all : ${all} -MAKE_VARS := SYMROOT OBJROOT BINDIR APPLICATION_INSTALL_PATH \ - TCL_FRAMEWORK_DIR TCLSH_DIR -MAKE_ARGS_V = $(foreach v,${MAKE_VARS},$v=${$v}) +install := ${styles:%=install-%} +install : ${install} +install-%: action := install- -BUILD = ${BUILDCMD} -target "${TARGET}" ${MAKE_ARGS_V} \ - DYLIB_INSTALL_PATH="${INSTALL_PATH}" \ - ${EXTRA_MAKE_ARGS} ${MAKEOVERRIDES} +embedded := ${styles:%=embedded-%} +embedded : embedded-deploy +install-embedded := ${embedded:%=install-%} +install-embedded : install-embedded-deploy -DEVBUILD = ${BUILD} -buildstyle "${DEVBUILDSTYLE}" -DEPBUILD = ${BUILD} -buildstyle "${DEPBUILDSTYLE}" +clean := ${styles:%=clean-%} +clean : ${clean} +clean-%: action := clean- +distclean := ${styles:%=distclean-%} +distclean : ${distclean} +distclean-%: action := distclean- -INSTALLOPTS = INSTALL_ROOT="${INSTALL_ROOT}" +test := ${styles:%=test-%} +test : ${test} +test-%: action := test- -EMBEDDEDOPTS = EMBEDDED_BUILD=1 +targets := $(foreach v,${meta},${$v}) -################################################################################ +#------------------------------------------------------------------------------------------------------- +# build styles -all: develop deploy +BUILD_STYLE = +CONFIGURE_ARGS = +OBJ_DIR = ${OBJROOT}/${BUILD_STYLE} -install: install-develop install-deploy +develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols +deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip +embedded_make_args := EMBEDDED_BUILD=1 +install_make_args := INSTALL_BUILD=1 -embedded: embedded-deploy +${targets}: + ${MAKE} ${action}${PROJECT} \ + $(foreach s,${styles} embedded install,$(if $(findstring $s,$@),${${s}_make_args})) -install-embedded: install-embedded-deploy cleanup-embedded +#------------------------------------------------------------------------------------------------------- +# project specific settings -clean: clean-develop clean-deploy +PROJECT := tk +PRODUCT_NAME := Tk -################################################################################ +UNIX_DIR := ${CURDIR}/../unix +VERSION := $(shell awk -F= '/^TK_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.in) +WISH = wish${VERSION} -develop: - ${DEVBUILD} +BUILD_TARGET := wish +INSTALL_TARGET := install -deploy: - ${DEPBUILD} +ifneq ($(wildcard ${TCL_BUILD_DIR}/tclConfig.sh),) +TCL_DIR := ${TCL_BUILD_DIR} +TCL_FRAMEWORK_DIR := ${TCL_BUILD_DIR}/.. +else +TCL_DIR := ${TCL_FRAMEWORK_DIR}/Tcl.framework +TCL_EXE := ${TCLSH_DIR}/tclsh${VERSION} +MAKE_VARS = TCL_EXE +export DYLD_FRAMEWORK_PATH := ${TCL_FRAMEWORK_DIR} +endif +export CPPROG := cp -p -install-develop: - ${DEVBUILD} install ${INSTALLOPTS} +ifeq (${TK_X11},) +override CONFIGURE_ARGS := ${CONFIGURE_ARGS} --enable-aqua +else +VERSION := ${VERSION}-X11 +endif -install-deploy: - ${DEPBUILD} install ${INSTALLOPTS} +INSTALL_TARGETS = install-binaries install-libraries +ifeq (${EMBEDDED_BUILD},) +INSTALL_TARGETS += install-private-headers install-demos +endif +ifeq (${INSTALL_BUILD}_${EMBEDDED_BUILD}_${BUILD_STYLE},1__Deployment) +INSTALL_TARGETS += html-tk ifneq (${INSTALL_MANPAGES},) -# install manpages - ${MAKE} -C "$(CURDIR)/../unix" -f Makefile.in install-doc \ - SRC_DIR="$(CURDIR)/.." UNIX_DIR="$(CURDIR)/../unix" \ - mandir="$(MANDIR)" ${INSTALLOPTS} ${EXTRA_MAKE_ARGS} +INSTALL_TARGETS += install-doc endif +endif + +MAKE_VARS += INSTALL_ROOT INSTALL_TARGETS VERSION +MAKE_ARGS_V = $(foreach v,${MAKE_VARS},$v='${$v}') -embedded-develop: - ${DEVBUILD} ${EMBEDDEDOPTS} +build-${PROJECT}: target = ${TARGET} +install-${PROJECT}: target = ${INSTALL_TARGET} +clean-${PROJECT} distclean-${PROJECT} test-${PROJECT}: \ + target = $* -embedded-deploy: - ${DEPBUILD} ${EMBEDDEDOPTS} +DO_MAKE = +${MAKE} -C ${OBJ_DIR} ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA_MAKE_ARGS} -install-embedded-develop: - ${DEVBUILD} install ${INSTALLOPTS} ${EMBEDDEDOPTS} +${PROJECT}: override INSTALL_ROOT := ${OBJ_DIR}/ -install-embedded-deploy: - ${DEPBUILD} install ${INSTALLOPTS} ${EMBEDDEDOPTS} +#------------------------------------------------------------------------------------------------------- +# locations for custom tk install actions -clean-develop: - ${DEVBUILD} clean +ifeq (${INSTALL_BUILD},1) +TOP_DIR := ${INSTALL_ROOT}/ +APP_DIR := ${APPLICATION_INSTALL_PATH} +FMWK_DIR := ${LIBDIR} +else +TOP_DIR := ${SYMROOT} +APP_DIR := . +FMWK_DIR := . +endif -clean-deploy: - ${DEPBUILD} clean +TCL_FMWK_DIR := ${FMWK_DIR}/Tcl.framework/Versions/${VERSION} +TK_FMWK_DIR := ${FMWK_DIR}/${PRODUCT_NAME}.framework/Versions/${VERSION} + +#------------------------------------------------------------------------------------------------------- +# build rules + +${PROJECT}: install-${PROJECT} + +${OBJ_DIR}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure + mkdir -p ${OBJ_DIR} && cd ${OBJ_DIR} && ${UNIX_DIR}/configure \ + --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} \ + --mandir=${MANDIR} --enable-threads --enable-framework \ + --with-tcl=${TCL_DIR} \ + ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} + +build-${PROJECT}: ${OBJ_DIR}/Makefile + ${DO_MAKE} +# symolic link hackery to trick +# 'make install INSTALL_ROOT=${OBJ_DIR}' +# into building Tk.framework and wish in ${SYMROOT} + @cd ${OBJ_DIR} && mkdir -p $(dir ./${LIBDIR}) $(dir ./${BINDIR}) ${SYMROOT} && \ + rm -rf ./${LIBDIR} ./${BINDIR} && ln -fs ${SYMROOT} ./${LIBDIR} && \ + ln -fs ${SYMROOT} ./${BINDIR} && ln -fs ${OBJ_DIR}/tktest ${SYMROOT} +ifeq (${TK_X11},) + @rm -f ${OBJ_DIR}/${BINDIR} +endif +# Create symbolic link to Tcl.framework in ${SYMROOT}if necessary + @cd ${SYMROOT} && if [ ! -e Tcl.framework -o -L Tcl.framework ]; then \ + rm -f Tcl.framework && ln -s ${TCL_FRAMEWORK_DIR}/Tcl.framework . ; fi + +install-${PROJECT}: build-${PROJECT} +ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_) + @echo "Cannot install-embedded with empty INSTALL_ROOT !" && false +else + @rm -rf "${INSTALL_ROOT}/${LIBDIR}/Tk.framework" +endif + ${DO_MAKE} +ifeq (${INSTALL_BUILD},1) +ifeq (${EMBEDDED_BUILD},1) +# if we are embedding frameworks, don't install wish + @rm -f "${INSTALL_ROOT}${BINDIR}/${WISH}" && \ + rmdir -p "${INSTALL_ROOT}${BINDIR}" 2>&- || true +else +# redo prebinding + @cd ${INSTALL_ROOT}/ && \ + if [ ! -d usr/lib ]; then mkdir -p usr && ln -fs /usr/lib usr/ && RM_USRLIB=1; fi; \ + if [ -n "${TK_X11}" -a ! -d usr/X11R6 ]; then mkdir -p usr && ln -fs /usr/X11R6 usr/ && RM_USRX11=1; fi; \ + if [ ! -d System ]; then ln -fs /System . && RM_SYSTEM=1; fi; \ + if [ ! -d ./${LIBDIR}/Tcl.framework ]; then ln -fs ${TCL_FRAMEWORK_DIR}/Tcl.framework ./${LIBDIR}; RM_TCL=1; fi; \ + redo_prebinding -r . "./${TK_FMWK_DIR}/${PRODUCT_NAME}"; \ + if [ -z "${TK_X11}" ]; then redo_prebinding -r . "./${TK_FMWK_DIR}/Resources/Wish.app/Contents/MacOS/Wish"; \ + else redo_prebinding -r . "./${BINDIR}/${WISH}"; fi; \ + if [ -n "$${RM_USRLIB:-}" ]; then rm -f usr/lib; rmdir -p usr 2>&-; fi; \ + if [ -n "$${RM_USRX11:-}" ]; then rm -f usr/X11R6; rmdir -p usr 2>&-; fi; \ + if [ -n "$${RM_SYSTEM:-}" ]; then rm -f System; fi; \ + if [ -n "$${RM_TCL:-}" ]; then rm -f ./${LIBDIR}/Tcl.framework; fi +# install wish symbolic link + @ln -fs ${WISH} ${INSTALL_ROOT}${BINDIR}/wish +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 +ifeq (${TK_X11},) +ifeq (${EMBEDDED_BUILD},) +# install Wish.app link in APPLICATION_INSTALL_PATH and setup 'Wish Shell' compatibility links + @cd ${TOP_DIR} && mkdir -p "./${APP_DIR}" && \ + ln -fsh "$$(echo ./${APP_DIR} | sed -e 's#/[^/][^/]*#/..#g')/${TK_FMWK_DIR}/Resources/Wish.app" "./${APP_DIR}" && \ + ln -fsh Wish.app "./${APP_DIR}/Wish Shell.app" && \ + ln -fsh Wish.app "./${TK_FMWK_DIR}/Resources/Wish Shell.app" && \ + ln -fsh Wish "./${TK_FMWK_DIR}/Resources/Wish.app/Contents/MacOS/Wish Shell" +else +# if we are embedding frameworks, move them into the app and fix their install names + @cd ${TOP_DIR} && \ + rm -rf "./${APP_DIR}/Wish.app" && mkdir -p "./${APP_DIR}" && \ + mv -f "./${TK_FMWK_DIR}/Resources/Wish.app" "./${APP_DIR}" && \ + ln -fsh Wish.app "./${APP_DIR}/Wish Shell.app" && \ + rm -rf "./${APP_DIR}/Wish.app/Contents/Frameworks" && \ + mkdir -p "./${APP_DIR}/Wish.app/Contents/Frameworks" && \ + mv -f "./${FMWK_DIR}"/T{cl,k}.framework "./${APP_DIR}/Wish.app/Contents/Frameworks" && \ + rmdir -p "./${FMWK_DIR}" 2>&- || true && cd "./${APP_DIR}/Wish.app/Contents" && \ + rm -rf Frameworks/T{cl,k}.framework/{,/Versions/$(VERSION)}/{Headers,PrivateHeaders,*_debug,lib*.a,*Config.sh} && \ + fix_install_id ( ) { \ + chmod -RH a+w "$$1"; \ + install_name_tool -id $$(otool -L "$$1" | awk "/$$2\.framework.*[^:]\$$/ {sub(\"^.*/Frameworks\",\"@executable_path/../Frameworks\",\$$1); print \$$1}") "$$1"; \ + chmod -RH a-w "$$1"; \ + } && \ + fix_install_name ( ) { \ + chmod -RH a+w "$$1"; \ + install_name_tool -change $$(otool -L "$$1" | awk "/$$2\.framework.*[^:]\$$/ {print \$$1; sub(\"^.*/Frameworks\",\"@executable_path/../Frameworks\",\$$1); print \$$1}") "$$1"; \ + chmod -RH a-w "$$1"; \ + } && \ + fix_install_id Frameworks/Tcl.framework/Tcl Tcl && fix_install_id Frameworks/Tk.framework/Tk Tk && \ + fix_install_name MacOS/Wish Tcl && fix_install_name MacOS/Wish Tk +endif +endif -################################################################################ +clean-${PROJECT}: %-${PROJECT}: + ${DO_MAKE} + rm -rf ${SYMROOT}/{${PRODUCT_NAME}.framework,${WISH},tktest} + rm -f ${OBJ_DIR}{${LIBDIR},${BINDIR}} && \ + rmdir -p ${OBJ_DIR}$(dir ${LIBDIR}) 2>&- || true && \ + rmdir -p ${OBJ_DIR}$(dir ${BINDIR}) 2>&- || true -cleanup-embedded: - @-cd ${INSTALL_ROOT}/; \ - chmod -RH u+w Library/Frameworks/Tcl.framework; \ - rm -rf Library/Frameworks/Tcl.framework; \ - chmod -RH u+w Library/Frameworks/Tk.framework; \ - rm -rf Library/Frameworks/Tk.framework; \ - rmdir -p Library/Frameworks 2>&-; +distclean-${PROJECT}: %-${PROJECT}: clean-${PROJECT} + ${DO_MAKE} + rm -rf ${OBJ_DIR} + +test-${PROJECT}: %-${PROJECT}: build-${PROJECT} + ${DO_MAKE} -################################################################################ +#------------------------------------------------------------------------------------------------------- -.PHONY: all install embedded clean develop deploy install-develop install-deploy \ -embedded-develop embedded-deploy install-embedded-develop install-embedded-deploy \ -clean-develop clean-deploy cleanup-embedded +.PHONY: ${meta} ${targets} ${PROJECT} build-${PROJECT} install-${PROJECT} \ + clean-${PROJECT} distclean-${PROJECT} .NOTPARALLEL: -################################################################################ +#------------------------------------------------------------------------------------------------------- diff --git a/macosx/README b/macosx/README index 6f31535..70d1961 100644 --- a/macosx/README +++ b/macosx/README @@ -1,7 +1,7 @@ TclTkAqua README ---------------- -RCS: @(#) $Id: README,v 1.6.2.7 2005/04/09 15:39:39 das Exp $ +RCS: @(#) $Id: README,v 1.6.2.8 2005/05/24 04:21:32 das Exp $ This is the README file for the Mac OS X native versions of Tcl & Tk. @@ -47,7 +47,7 @@ OS9 TclTk droplets. - If standard input is a special file of zero length (e.g. /dev/null), Wish brings up the tk console window at startup. This is the case when double -clicking Wish in the Finder (or using 'open Wish\ Shell.app' from the Terminal). +clicking Wish in the Finder (or using 'open Wish.app' from the Terminal). - Tcl extensions will be found in any of: $HOME/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl @@ -68,12 +68,12 @@ No manpages are installed by default for either tcl or tk. system's standard framework directories: $HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks -and 'Wish Shell' as well as /usr/bin/tclsh will work. +and 'Wish' as well as /usr/bin/tclsh will work. -- /usr/bin/wish is a script that calls a copy of 'Wish Shell' contained in +- /usr/bin/wish is a script that calls a copy of 'Wish' contained in Tk.framework/Resources -- if 'Wish Shell' is started from the Finder or via 'open', $argv contains a +- if 'Wish' is started from the Finder or via 'open', $argv contains a "-psn_XXXX" argument. This is the Wish's carbon process serial number, you may need to filter it out for cross platform compatibility of your scripts. @@ -143,14 +143,14 @@ have come with Mac OS X retail or should be present as a disk image on new macs that came with OSX preinstalled. It can also be downloaded from http://connect.apple.com (after you register for free ADC membership). -- Tcl is built as a Mac OS X framework via the Makefile in tcl/macosx, but can -also be built from Apple's ProjectBuilder IDE using the Tcl.pbproj project (which -calls through to the Makefile). +- Tcl and Tk are built as a Mac OS X frameworks via the Makefiles in tcl/macosx +and tk/macosx, but can also be built directly with the standard unix configure +and make buildsystem in tcl/unix resp. tk/unix. -- TkAqua is built as a Mac OS X frameworks using Apple's ProjectBuilder -IDE, but you do not have to deal with the IDE if you don't want to, the -Makefile in tk/macosx takes care of calling the ProjectBuilder command line tool -with all the details taken care of. +- It is still possible to build with Apple's Xcode IDE using the Tcl.pbproj and +Wish.pbproj projects but this is not recommended anymore (currently Tcl.pbproj +calls through to the tcl/macosx/Makefile; but Wish.pbproj doesn't, so there could +be build differences). - Unpack the tcl and tk source release archives and place the tcl and tk source trees in a common parent directory. @@ -172,9 +172,7 @@ set ${ver} to the empty string instead: set ver="" ;: if your shell is csh ver="" ;: if your shell is sh -- If you're only interested in _building_ TclTkAqua and don't plan on doing -development with the ProjectBuilder projects, using the Makefiles is easiest. -The following steps will build Tcl and Tk from the Terminal, assuming you are +- The following steps will build Tcl and Tk from the Terminal, assuming you are located in the directory containing the tcl and tk source trees: make -C tcl${ver}/macosx make -C tk${ver}/macosx @@ -202,11 +200,11 @@ For example, to build and install only the optimized versions: sudo make -C tcl${ver}/macosx install-deploy sudo make -C tk${ver}/macosx install-deploy -- The Makefiles can also build a version of 'Wish Shell' that has the Tcl and Tk +- The Makefiles can also build a version of 'Wish' that has the Tcl and Tk frameworks embedded in its application package. This allows for standalone deployment of the application with no installation required, e.g. from read-only media. To build & install in this manner, use the 'embedded' target variants of -the Makefiles. For example, to build a standalone 'Wish Shell.app' +the Makefiles. For example, to build a standalone 'Wish.app' in ./embedded/Applications/Utilities: make -C tcl${ver}/macosx embedded make -C tk${ver}/macosx embedded @@ -217,32 +215,19 @@ Notes: require any new compiling or linking, so you can skip the first two makes. (making relinking unnecessary was added in 8.4.2) * the embedded frameworks include only optimized builds and no documentation. - * the standalone Wish has the directory Wish\ Shell.app/Contents/lib in its + * the standalone Wish has the directory Wish.app/Contents/lib in its auto_path. Thus you can place tcl extensions in this directory (i.e. embed them in the app package) and load them with [package require]. -- It is possible to build Tk without without the tcl sourcetree; but in that -case you need to tell the Tk Makefile where the copies of 'Tcl.framework' and -'tclsh8.4' are located that you want to build & link against -(their default location is ${BUILD_DIR}/tcl). - -For instance to use their default systemwide install locations: +- It is possible to build Tk against an installed Tcl.framework; but you will +still need a tcl sourcetree in the location specified in TCL_SRC_DIR in +Tcl.framework/tclConfig.sh. Also, linking with Tcl.framework has to work +exactly as indicated in TCL_LIB_SPEC in Tcl.framework/tclConfig.sh. +If you used non-default install locations for Tcl.framework, specify them as +make overrides to the tk/macosx Makefile, e.g. make -C tk${ver}/macosx \ - TCL_FRAMEWORK_DIR=/Library/Frameworks TCLSH_DIR=/usr/bin + TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin sudo make -C tk${ver}/macosx install \ - TCL_FRAMEWORK_DIR=/Library/Frameworks TCLSH_DIR=/usr/bin -[ of course this will only work if /Library/Frameworks does indeed contain a ] -[ Tcl.framework corresponding in version to the Tk.framework you're trying to ] -[ build, and if TCLSH_DIR contains a corresponding /usr/bin/tclsh8.4 ] - -or to use an earlier install of Tcl into INSTALL_ROOT="${TCLTK}/" : - make -C tk${ver}/macosx \ - TCL_FRAMEWORK_DIR=${TCLTK}/Library/Frameworks TCLSH_DIR=${TCLTK}/usr/bin - sudo make -C tk${ver}/macosx install INSTALL_ROOT="${TCLTK}/" \ - TCL_FRAMEWORK_DIR=${TCLTK}/Library/Frameworks TCLSH_DIR=${TCLTK}/usr/bin + TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added in Tk 8.4.3. - -Note that html help in Tk.framework is only built if TCL_FRAMEWORK_DIR contains -the tcl Makefile (as is the case for the default value of TCL_FRAMEWORK_DIR). - diff --git a/macosx/Tk-Info.plist.in b/macosx/Tk-Info.plist.in new file mode 100644 index 0000000..a392991 --- /dev/null +++ b/macosx/Tk-Info.plist.in @@ -0,0 +1,27 @@ +<?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"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>@TK_LIB_FILE@</string> + <key>CFBundleGetInfoString</key> + <string>Tk @TK_WINDOWINGSYSTEM@ Library @TK_VERSION@, Copyright © @TK_YEAR@ Tcl Core Team. +Initial MacOS X Port by Jim Ingham <jingham@apple.com> & Ian Reid, Copyright © 2001-2002, Apple Computer, Inc.</string> + <key>CFBundleIdentifier</key> + <string>com.tcltk.tklibrary</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>Tk @TK_WINDOWINGSYSTEM@ Library @TK_VERSION@</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> + <key>CFBundleSignature</key> + <string>Tk </string> + <key>CFBundleVersion</key> + <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> +</dict> +</plist> diff --git a/macosx/Wish-Info.plist.in b/macosx/Wish-Info.plist.in new file mode 100644 index 0000000..08fff5a --- /dev/null +++ b/macosx/Wish-Info.plist.in @@ -0,0 +1,46 @@ +<?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"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleDocumentTypes</key> + <array> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>*</string> + </array> + <key>CFBundleTypeName</key> + <string>NSStringPboardType</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>TEXT</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + </dict> + </array> + <key>CFBundleExecutable</key> + <string>Wish</string> + <key>CFBundleGetInfoString</key> + <string>Wish Shell @TK_VERSION@, Copyright © @TK_YEAR@ Tcl Core Team. +Initial MacOS X Port by Jim Ingham <jingham@apple.com> & Ian Reid, Copyright © 2001-2002, Apple Computer, Inc.</string> + <key>CFBundleIconFile</key> + <string>Wish.icns</string> + <key>CFBundleIdentifier</key> + <string>com.tcltk.wish</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>Wish</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> + <key>CFBundleSignature</key> + <string>WiSH</string> + <key>CFBundleVersion</key> + <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> +</dict> +</plist> diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index f3f785f..7b469a7 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.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: tkMacOSXInit.c,v 1.3.2.5 2005/05/14 20:53:31 das Exp $ + * RCS: @(#) $Id: tkMacOSXInit.c,v 1.3.2.6 2005/05/24 04:21:32 das Exp $ */ #include "tkInt.h" @@ -18,6 +18,7 @@ #include "tclInt.h" #include <sys/stat.h> #include <mach-o/dyld.h> +#include <mach-o/getsect.h> /* * The Init script (common to Windows and Unix platforms) is @@ -158,8 +159,64 @@ TkpInit(interp) * FIXME: Should we come up with a more generic way of doing this? */ - Tcl_MacOSXOpenVersionedBundleResources(interp, - "com.tcltk.tklibrary", TK_VERSION, 1, 1024, tkLibPath); +#ifdef TK_FRAMEWORK + if (Tcl_MacOSXOpenVersionedBundleResources(interp, + "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 1, PATH_MAX, tkLibPath) != TCL_OK) +#endif + { + /* Tk.framework not found, check if resource file is open */ + Handle rsrc = Get1NamedResource('CURS', "\phand"); + if (rsrc) { + ReleaseResource(rsrc); + } else { + struct mach_header *image; + char *data = NULL; + unsigned long size; + int fd = -1; + char fileName[L_tmpnam + 15]; + + /* Get resource data from __tk_rsrc section of tk library file */ +#ifdef HAVE__DYLD_GET_IMAGE_HEADER_CONTAINING_ADDRESS + image = _dyld_get_image_header_containing_address((unsigned long)&TkpInit); + if (image) { + data = getsectdatafromheader(image, SEG_TEXT, "__tk_rsrc", &size); + } +#else + int i, n = _dyld_image_count(); + for (i = 0; i < n; i++) { + image = _dyld_get_image_header(i); + if (image) { + data = getsectdatafromheader(image, SEG_TEXT, "__tk_rsrc", &size); + } + if (data) break; + } +#endif + while (data) { + OSStatus err; + FSRef ref; + SInt16 refNum; + + /* Write resource data to temporary file and open it */ + strcpy(fileName, P_tmpdir); + if (fileName[strlen(fileName) - 1] != '/') { + strcat(fileName, "/"); + } + strcat(fileName, "tkMacOSX_XXXXXX"); + fd = mkstemp(fileName); + if (fd == -1) break; + fcntl(fd, F_SETFD, FD_CLOEXEC); + if (write(fd, data, size) == -1) break; + err = FSPathMakeRef(fileName, &ref, NULL); + if (err != noErr) break; + err = FSOpenResourceFile(&ref, 0, NULL, fsRdPerm, &refNum); + break; + } + if (fd != -1) { + unlink(fileName); + close(fd); + } + } + } /* * If we don't have a TTY and stdin is a special character file of length 0, diff --git a/unix/Makefile.in b/unix/Makefile.in index 696e7c4..7c75800 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,12 +5,12 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.87.2.8 2005/04/26 00:49:50 das Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.87.2.9 2005/05/24 04:21:32 das Exp $ # Current Tk version; used in various names. TCLVERSION = @TCL_VERSION@ -VERSION = @TK_VERSION@ +VERSION = @TK_VERSION@ MAJOR_VERSION = @TK_MAJOR_VERSION@ MINOR_VERSION = @TK_MINOR_VERSION@ PATCH_LEVEL = @TK_PATCH_LEVEL@ @@ -27,7 +27,8 @@ LOCALES = @LOCALES@ # specific files (exec_prefix) and machine-independent files such # as scripts (prefix). The values specified here may be overridden # at configure-time with the --exec-prefix and --prefix options -# to the "configure" script. +# to the "configure" script. The *dir vars are standard configure +# substitutions that are based off prefix and exec_prefix. prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -41,12 +42,12 @@ mandir = @mandir@ # to be different than those used for actually reference files at # run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix # when installing files. -INSTALL_ROOT = +INSTALL_ROOT = $(DESTDIR) # Directory from which applications will reference the library of Tcl # scripts (note: you can set the TK_LIBRARY environment variable at # run-time to override the compiled-in location): -TK_LIBRARY = $(prefix)/lib/tk$(VERSION) +TK_LIBRARY = @TK_LIBRARY@ # Path to use at runtime to refer to LIB_INSTALL_DIR: LIB_RUNTIME_DIR = $(libdir) @@ -57,13 +58,19 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tk library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) -# Path name to use when installing library scripts: +# Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) # Directory in which to install the include file tk.h: INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) -# Top-level directory for manual entries: +# Path to the private tk header dir: +PRIVATE_INCLUDE_DIR = @PRIVATE_INCLUDE_DIR@ + +# Directory in which to (optionally) install the private tk headers: +PRIVATE_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(PRIVATE_INCLUDE_DIR) + +# Top-level directory in which to install manual entries: MAN_INSTALL_DIR = $(INSTALL_ROOT)$(mandir) # Directory in which to install manual entry for wish: @@ -77,6 +84,12 @@ MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 # Tcl commands implemented by Tk: MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann +# Path to the html documentation dir: +HTML_DIR = @HTML_DIR@ + +# Directory in which to install html documentation: +HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR) + # The directory containing the Tcl sources and headers appropriate # for this version of Tk ("srcdir" will be replaced or has already # been replaced by the configure script): @@ -95,8 +108,11 @@ TK_DBGX = @TK_DBGX@ # Flag, 1: we're building a shared lib, 0 we're not TK_SHARED_BUILD = @TK_SHARED_BUILD@ +# Subdirectory of $(libdir) containing the pkgIndex.tcl file for loadable Tk +TK_PKG_DIR = @TK_PKG_DIR@ + # Directory in which to install the pkgIndex.tcl file for loadable Tk -PKG_INSTALL_DIR = $(LIB_INSTALL_DIR)/tk$(VERSION)$(TK_DBGX) +PKG_INSTALL_DIR = $(LIB_INSTALL_DIR)/$(TK_PKG_DIR) # Package index file for loadable Tk PKG_INDEX = $(PKG_INSTALL_DIR)/pkgIndex.tcl @@ -126,6 +142,8 @@ LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@ # include files are accessible via /usr/include). X11_INCLUDES = @XINCLUDES@ +AQUA_INCLUDES = -I$(MAC_OSX_DIR) -I$(XLIB_DIR) + # Linker switch(es) to use to link with the X11 library archive (the # configure script will try to set this value automatically, but you # can override it). @@ -144,7 +162,7 @@ PROTO_FLAGS = #PROTO_FLAGS = -DNO_PROTOTYPE # To enable memory debugging reverse the comment characters on the following -# lines. or call configure with --enable-symbols=mem +# lines or call configure with --enable-symbols=mem # Warning: if you enable memory debugging, you must do it *everywhere*, # including all the code that calls Tcl, and you must use ckalloc and # ckfree everywhere instead of malloc and free. @@ -188,10 +206,9 @@ INSTALL_DATA = ${INSTALL} -m 644 # make dist. TCL_EXE = tclsh -# The symbols below provide support for dynamic loading and shared -# libraries. The values of the symbols are normally set by the -# configure script. You shouldn't normally need to modify any of -# these definitions by hand. +# The symbol below provides support for dynamic loading and shared +# libraries. See configure.in for a description of what it means. +# The value of the symbol is normally set by the configure script. SHLIB_CFLAGS = @SHLIB_CFLAGS@ @@ -228,11 +245,13 @@ TCL_STUB_FLAGS = @TCL_STUB_FLAGS@ # Libraries to use when linking. This definition is determined by the # configure script. LIBS = @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ +WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ @EXTRA_WISH_LIBS@ -# The symbol below provides support for dynamic loading and shared -# libraries. See configure.in for a description of what it means. -# The values of the symbolis normally set by the configure script. +# The symbols below provide support for dynamic loading and shared +# libraries. See configure.in for a description of what the +# symbols mean. The values of the symbols are normally set by the +# configure script. You shouldn't normally need to modify any of +# these definitions by hand. STLIB_LD = @STLIB_LD@ SHLIB_LD = @SHLIB_LD@ @@ -248,6 +267,12 @@ LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@ # support for embedded libraries on Darwin / Mac OS X DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR} +# support for building the Aqua resource file +TK_RSRC_FILE = @TK_RSRC_FILE@ +WISH_RSRC_FILE = @WISH_RSRC_FILE@ +REZ = @REZ@ +REZ_SWITCHES = @REZ_FLAGS@ -i $(GENERIC_DIR) -i $(TCL_GENERIC_DIR) + #---------------------------------------------------------------- # The information below is modified by the configure script when # Makefile is generated from Makefile.in. You shouldn't normally @@ -257,12 +282,14 @@ DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR} AC_FLAGS = @DEFS@ AR = @AR@ RANLIB = @RANLIB@ -SRC_DIR = @srcdir@/.. -TOP_DIR = @srcdir@/.. +SRC_DIR = @srcdir@ +TOP_DIR = $(SRC_DIR)/.. GENERIC_DIR = $(TOP_DIR)/generic -UNIX_DIR = @srcdir@ +UNIX_DIR = $(SRC_DIR) BMAP_DIR = $(TOP_DIR)/bitmaps TOOL_DIR = @TCL_SRC_DIR@/tools +MAC_OSX_DIR = $(TOP_DIR)/macosx +XLIB_DIR = $(TOP_DIR)/xlib #---------------------------------------------------------------- # The information below should be usable as is. The configure @@ -272,61 +299,77 @@ TOOL_DIR = @TCL_SRC_DIR@/tools # Flags to be passed to installManPage to control whether the manpages # should be compressed and linked with softlinks -MAN_FLAGS = @MAN_FLAGS@ +MAN_FLAGS = @MAN_FLAGS@ CC = @CC@ CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I${UNIX_DIR} -I${GENERIC_DIR} \ --I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} \ +-I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \ ${AC_FLAGS} ${PROTO_FLAGS} \ -${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS} +${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@ CC_SWITCHES = ${CC_SWITCHES_NO_STUBS} ${TCL_STUB_FLAGS} DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \ -I${BMAP_DIR} \ --I${TCL_GENERIC_DIR} ${X11_INCLUDES} \ +-I${TCL_GENERIC_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \ ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \ -${KEYSYM_FLAGS} +${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ WISH_OBJS = tkAppInit.o TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o -WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ +WIDG_OBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o \ tkPanedWindow.o tkScale.o tkScrollbar.o -CANVOBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \ +CANV_OBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \ tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o \ tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o -IMAGEOBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o +IMAGE_OBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o -TEXTOBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ +TEXT_OBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ tkTextMark.o tkTextTag.o tkTextWind.o -UNIXOBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ - tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \ - tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ - tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ - tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o +GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o \ + tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o \ + tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o \ + tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ + tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o + +STUB_OBJS = tkStubInit.o tkStubLib.o STUB_LIB_OBJS = tkStubLib.o tkStubImg.o -OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o \ - tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o \ - tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o \ - tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ - tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o \ - $(UNIXOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS) +X11_OBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ + tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \ + tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ + tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ + tkUnixSend.o tkUnixWm.o tkUnixXId.o + +AQUA_OBJS = tkMacOSXBitmap.o tkMacOSXButton.o tkMacOSXClipboard.o \ + tkMacOSXColor.o tkMacOSXConfig.o tkMacOSXCursor.o tkMacOSXDebug.o \ + tkMacOSXDialog.o tkMacOSXDraw.o tkMacOSXEmbed.o tkMacOSXEntry.o \ + tkMacOSXEvent.o tkMacOSXFont.o tkMacOSXHLEvents.o tkMacOSXInit.o \ + tkMacOSXKeyboard.o tkMacOSXKeyEvent.o tkMacOSXMenu.o \ + tkMacOSXMenubutton.o tkMacOSXMenus.o tkMacOSXMouseEvent.o \ + tkMacOSXNotify.o tkMacOSXRegion.o tkMacOSXScrlbr.o tkMacOSXSend.o \ + tkMacOSXSubwindows.o tkMacOSXTest.o tkMacOSXWindowEvent.o \ + tkMacOSXWm.o tkMacOSXXStubs.o \ + tkFileFilter.o tkMacWinMenu.o tkPointer.o tkUnix3d.o tkUnixScale.o \ + xcolors.o xdraw.o xgc.o ximage.o xutil.o + +OBJS = $(GENERIC_OBJS) $(WIDG_OBJS) $(CANV_OBJS) $(IMAGE_OBJS) $(TEXT_OBJS) \ + $(STUB_OBJS) $(@TK_WINDOWINGSYSTEM@_OBJS) @PLAT_OBJS@ TK_DECLS = \ $(GENERIC_DIR)/tk.decls \ $(GENERIC_DIR)/tkInt.decls -SRCS = \ +GENERIC_SRCS = \ $(GENERIC_DIR)/tk3d.c $(GENERIC_DIR)/tkArgv.c \ $(GENERIC_DIR)/tkAtom.c $(GENERIC_DIR)/tkBind.c \ $(GENERIC_DIR)/tkBitmap.c $(GENERIC_DIR)/tkClipboard.c \ @@ -364,7 +407,9 @@ SRCS = \ $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ $(GENERIC_DIR)/tkOldConfig.c \ $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ - $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c \ + $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c + +X11_SRCS = \ $(UNIX_DIR)/tkAppInit.c $(UNIX_DIR)/tkUnix.c \ $(UNIX_DIR)/tkUnix3d.c \ $(UNIX_DIR)/tkUnixButton.c $(UNIX_DIR)/tkUnixColor.c \ @@ -381,6 +426,42 @@ SRCS = \ $(UNIX_DIR)/tkUnixSend.c $(UNIX_DIR)/tkUnixWm.c \ $(UNIX_DIR)/tkUnixXId.c +AQUA_SRCS = \ + $(MAC_OSX_DIR)/tkMacOSXBitmap.c $(MAC_OSX_DIR)/tkMacOSXButton.c \ + $(MAC_OSX_DIR)/tkMacOSXClipboard.c $(MAC_OSX_DIR)/tkMacOSXColor.c \ + $(MAC_OSX_DIR)/tkMacOSXConfig.c $(MAC_OSX_DIR)/tkMacOSXCursor.c \ + $(MAC_OSX_DIR)/tkMacOSXDebug.c $(MAC_OSX_DIR)/tkMacOSXDialog.c \ + $(MAC_OSX_DIR)/tkMacOSXDraw.c $(MAC_OSX_DIR)/tkMacOSXEmbed.c \ + $(MAC_OSX_DIR)/tkMacOSXEntry.c $(MAC_OSX_DIR)/tkMacOSXEvent.c \ + $(MAC_OSX_DIR)/tkMacOSXFont.c $(MAC_OSX_DIR)/tkMacOSXHLEvents.c \ + $(MAC_OSX_DIR)/tkMacOSXInit.c $(MAC_OSX_DIR)/tkMacOSXKeyboard.c \ + $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c $(MAC_OSX_DIR)/tkMacOSXMenu.c \ + $(MAC_OSX_DIR)/tkMacOSXMenubutton.c $(MAC_OSX_DIR)/tkMacOSXMenus.c \ + $(MAC_OSX_DIR)/tkMacOSXMouseEvent.c $(MAC_OSX_DIR)/tkMacOSXNotify.c \ + $(MAC_OSX_DIR)/tkMacOSXRegion.c $(MAC_OSX_DIR)/tkMacOSXScrlbr.c \ + $(MAC_OSX_DIR)/tkMacOSXSend.c $(MAC_OSX_DIR)/tkMacOSXSubwindows.c \ + $(MAC_OSX_DIR)/tkMacOSXTest.c $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c \ + $(MAC_OSX_DIR)/tkMacOSXWm.c $(MAC_OSX_DIR)/tkMacOSXXStubs.c \ + $(GENERIC_DIR)/tkFileFilter.c $(GENERIC_DIR)/tkMacWinMenu.c \ + $(GENERIC_DIR)/tkPointer.c $(UNIX_DIR)/tkUnix3d.c \ + $(UNIX_DIR)/tkUnixScale.c $(XLIB_DIR)/xcolors.c $(XLIB_DIR)/xdraw.c \ + $(XLIB_DIR)/xgc.c $(XLIB_DIR)/ximage.c $(XLIB_DIR)/xutil.c + +SRCS = $(GENERIC_SRCS) $(@TK_WINDOWINGSYSTEM@_SRCS) @PLAT_SRCS@ + +AQUA_RESOURCES = \ + $(MAC_OSX_DIR)/tkAboutDlg.r $(MAC_OSX_DIR)/tkMacOSXCursors.r \ + $(MAC_OSX_DIR)/tkMacOSXMenu.r $(MAC_OSX_DIR)/tkMacOSXXCursors.r + +AQUA_WISH_RESOURCES = $(MAC_OSX_DIR)/tkMacOSXAETE.r + +AQUA_HDRS = $(MAC_OSX_DIR)/tkMacOSX.h $(GENERIC_DIR)/tkIntXlibDecls.h + +AQUA_XLIB_HDRS = $(XLIB_DIR)/X11/*.h $(XLIB_DIR)/xbytes.h + +AQUA_PRIVATE_HDRS = $(MAC_OSX_DIR)/tkMacOSXPort.h $(MAC_OSX_DIR)/tkMacOSXInt.h + +X11_PRIVATE_HDRS = $(UNIX_DIR)/tkUnixPort.h $(UNIX_DIR)/tkUnixInt.h HDRS = bltList.h \ default.h ks_names.h tkPatch.h tk.h tkButton.h tkCanvas.h tkInt.h \ @@ -394,15 +475,15 @@ binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish libraries: -$(SRC_DIR)/doc/man.macros: +$(TOP_DIR)/doc/man.macros: chmod +x $(UNIX_DIR)/install-sh - $(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(SRC_DIR)/doc/man.macros + $(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(TOP_DIR)/doc/man.macros -doc: $(SRC_DIR)/doc/man.macros +doc: $(TOP_DIR)/doc/man.macros # The following target is configured by autoconf to generate either # a shared library or non-shared library for Tk. -${LIB_FILE}: ${OBJS} +${LIB_FILE}: ${OBJS} ${STUB_LIB_FILE} @LIB_RSRC_FILE@ rm -f $@ @MAKE_LIB@ @@ -410,18 +491,28 @@ ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} rm -f $@ @MAKE_STUB_LIB@ +# Build Aqua resource files +${TK_RSRC_FILE}: $(AQUA_RESOURCES) + rm -f $@ + if test "$(REZ)" != ""; then \ + $(REZ) -o $@ $(REZ_SWITCHES) $(AQUA_RESOURCES); fi + +${WISH_RSRC_FILE}: $(AQUA_WISH_RESOURCES) + rm -f $@ + if test "$(REZ)" != ""; then \ + $(REZ) -o $@ $(REZ_SWITCHES) $(AQUA_WISH_RESOURCES); fi + # Make target which outputs the list of the .o contained in the Tk lib # usefull to build a single big shared library containing Tcl/Tk and other # extensions. used for the Tcl Plugin. -- dl tkLibObjs: @echo ${OBJS} - # This targets actually build the objects needed for the lib in the above # case objs: ${OBJS} -wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) +wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ $(CC) $(LDFLAGS) $(WISH_OBJS) \ @TK_BUILD_LIB_SPEC@ \ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish @@ -436,8 +527,7 @@ tktest: $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR=`pwd`:$(TCL_BIN_DIR) tktest-real: - ${CC} $(LDFLAGS) $(TKTEST_OBJS) \ - @TK_BUILD_LIB_SPEC@ \ + ${CC} $(LDFLAGS) $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest # FIXME: This xttest rule seems to be broken in a number of ways. @@ -457,7 +547,7 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) # % make test TESTFLAGS="-verbose bps -file fileName.test" test: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -466,7 +556,7 @@ test: tktest # Tests with different languages testlang: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -479,7 +569,7 @@ testlang: tktest # Useful target to launch a built tktest with the proper path,... runtest: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -488,7 +578,7 @@ runtest: tktest # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` shell: wish - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -496,16 +586,18 @@ shell: wish # This target can be used to run wish inside either gdb or insight gdb: wish - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run gdb ./wish --command=gdb.run rm gdb.run -install: all install-binaries install-libraries install-demos install-doc +INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@ + +install: $(INSTALL_TARGETS) install-strip: - $(MAKE) install \ + $(MAKE) $(INSTALL_TARGETS) \ INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \ INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}" @@ -523,8 +615,8 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish else true; \ fi; \ done; - @if test ! -x $(UNIX_DIR)/install-sh; then \ - chmod +x $(UNIX_DIR)/install-sh; \ + @if test ! -x $(SRC_DIR)/install-sh; then \ + chmod +x $(SRC_DIR)/install-sh; \ fi @if test "x$(TK_SHARED_BUILD)" = "x1"; then \ echo "Creating package index $(PKG_INDEX)"; \ @@ -532,29 +624,33 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish (\ echo "if {[package vcompare [package provide Tcl]\ $(TCLVERSION)] != 0} { return }";\ - echo "package ifneeded Tk $(VERSION)\ - [list load [file join \$$dir .. $(TK_LIB_FILE)] Tk]";\ + relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)\ + [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ ) > $(PKG_INDEX); \ fi @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/" @@INSTALL_LIB@ @chmod 555 $(LIB_INSTALL_DIR)/$(LIB_FILE) - @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)" - @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION) - @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/" - @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh @if test "$(TK_BUILD_EXP_FILE)" != ""; then \ echo "Installing $(TK_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \ $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \ $(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \ - fi + fi + @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)" + @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION) + @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/" + @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ fi + @EXTRA_INSTALL_BINARIES@ -install-libraries: - @for i in $(INCLUDE_INSTALL_DIR) \ +install-libraries: libraries + @if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \ + XLIB_INCLUDE_INSTALL_DIR=$(INCLUDE_INSTALL_DIR)/X11; fi; \ + for i in $(INCLUDE_INSTALL_DIR) $${XLIB_INCLUDE_INSTALL_DIR} \ $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \ $(SCRIPT_INSTALL_DIR)/msgs; \ do \ @@ -565,30 +661,34 @@ install-libraries: else true; \ fi; \ done; - @if test ! -x $(UNIX_DIR)/install-sh; then \ - chmod +x $(UNIX_DIR)/install-sh; \ + @if test ! -x $(SRC_DIR)/install-sh; then \ + chmod +x $(SRC_DIR)/install-sh; \ fi @echo "Installing header files"; @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \ - $(GENERIC_DIR)/tkPlatDecls.h ; \ + $(GENERIC_DIR)/tkPlatDecls.h $(@TK_WINDOWINGSYSTEM@_HDRS) ; \ do \ $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ done; + @for i in $(@TK_WINDOWINGSYSTEM@_XLIB_HDRS) ; \ + do \ + $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR)/X11; \ + done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; - @for i in $(SRC_DIR)/library/*.tcl $(GENERIC_DIR)/prolog.ps \ - $(SRC_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \ + @for i in $(TOP_DIR)/library/*.tcl $(GENERIC_DIR)/prolog.ps \ + $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \ do \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \ done; @echo "Installing library images directory"; - @for i in $(SRC_DIR)/library/images/*; \ + @for i in $(TOP_DIR)/library/images/*; \ do \ if [ -f $$i ] ; then \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/images; \ fi; \ done; @echo "Installing translation directory"; - @for i in $(SRC_DIR)/library/msgs/*.msg; \ + @for i in $(TOP_DIR)/library/msgs/*.msg; \ do \ if [ -f $$i ] ; then \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/msgs; \ @@ -608,7 +708,7 @@ install-demos: fi; \ done; @echo "Installing demos to $(SCRIPT_INSTALL_DIR)/demos/"; - @for i in $(SRC_DIR)/library/demos/*; \ + @for i in $(TOP_DIR)/library/demos/*; \ do \ if [ -f $$i ] ; then \ sed -e '3 s|exec wish|exec wish$(VERSION)|' \ @@ -620,7 +720,7 @@ install-demos: chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \ done; @echo "Installing demo images"; - @for i in $(SRC_DIR)/library/demos/images/*; \ + @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/demos/images; \ @@ -646,25 +746,50 @@ install-doc: done @echo "Installing and cross-linking C API (.3) docs"; - @for i in $(SRC_DIR)/doc/*.3; do \ + @for i in $(TOP_DIR)/doc/*.3; do \ $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN3_INSTALL_DIR); \ done @echo "Installing and cross-linking command (.n) docs"; - @for i in $(SRC_DIR)/doc/*.n; do \ + @for i in $(TOP_DIR)/doc/*.n; do \ $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MANN_INSTALL_DIR); \ done +# Optional target to install private headers +install-private-headers: libraries + @for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \ + do \ + if [ ! -d $$i ] ; then \ + echo "Making directory $$i"; \ + mkdir -p $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done; + @if test ! -x $(SRC_DIR)/install-sh; then \ + chmod +x $(SRC_DIR)/install-sh; \ + fi + @echo "Installing private header files"; + @for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ + $(GENERIC_DIR)/tkIntPlatDecls.h $(GENERIC_DIR)/tkPort.h \ + $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS); \ + do \ + $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \ + done; + @if test -f tkConfig.h; then\ + $(INSTALL_DATA) tkConfig.h $(PRIVATE_INCLUDE_INSTALL_DIR); \ + fi; + Makefile: $(UNIX_DIR)/Makefile.in $(SHELL) config.status clean: - rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out errors \ - tktest wish config.info lib.exp + rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ + errors wish tktest lib.exp Tk *.rsrc distclean: clean - rm -f Makefile config.status config.cache config.log tkConfig.sh \ - $(PACKAGE).* prototype + rm -rf Makefile config.status config.cache config.log tkConfig.sh \ + $(PACKAGE).* prototype *.plist Tk.framework depend: makedepend -- $(DEPEND_SWITCHES) -- $(SRCS) @@ -974,27 +1099,125 @@ tkUnixWm.o: $(UNIX_DIR)/tkUnixWm.c tkUnixXId.o: $(UNIX_DIR)/tkUnixXId.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixXId.c -.c.o: - $(CC) -c $(CC_SWITCHES) $< +tkMacOSXBitmap.o: $(MAC_OSX_DIR)/tkMacOSXBitmap.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXBitmap.c -# -# Target to check for proper usage of UCHAR macro. -# +tkMacOSXButton.o: $(MAC_OSX_DIR)/tkMacOSXButton.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXButton.c -checkuchar: - -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR +tkMacOSXClipboard.o: $(MAC_OSX_DIR)/tkMacOSXClipboard.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXClipboard.c -# -# Target to make sure that only symbols with "Tk" prefixes are -# exported. -# +tkMacOSXColor.o: $(MAC_OSX_DIR)/tkMacOSXColor.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXColor.c -checkexports: $(TK_LIB_FILE) - -nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k' +tkMacOSXConfig.o: $(MAC_OSX_DIR)/tkMacOSXConfig.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXConfig.c + +tkMacOSXCursor.o: $(MAC_OSX_DIR)/tkMacOSXCursor.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXCursor.c + +tkMacOSXDebug.o: $(MAC_OSX_DIR)/tkMacOSXDebug.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXDebug.c + +tkMacOSXDialog.o: $(MAC_OSX_DIR)/tkMacOSXDialog.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXDialog.c + +tkMacOSXDraw.o: $(MAC_OSX_DIR)/tkMacOSXDraw.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXDraw.c + +tkMacOSXEmbed.o: $(MAC_OSX_DIR)/tkMacOSXEmbed.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEmbed.c + +tkMacOSXEntry.o: $(MAC_OSX_DIR)/tkMacOSXEntry.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEntry.c + +tkMacOSXEvent.o: $(MAC_OSX_DIR)/tkMacOSXEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEvent.c + +tkMacOSXFont.o: $(MAC_OSX_DIR)/tkMacOSXFont.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXFont.c + +tkMacOSXHLEvents.o: $(MAC_OSX_DIR)/tkMacOSXHLEvents.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXHLEvents.c + +tkMacOSXInit.o: $(MAC_OSX_DIR)/tkMacOSXInit.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXInit.c + +tkMacOSXKeyboard.o: $(MAC_OSX_DIR)/tkMacOSXKeyboard.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXKeyboard.c + +tkMacOSXKeyEvent.o: $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c + +tkMacOSXMenu.o: $(MAC_OSX_DIR)/tkMacOSXMenu.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMenu.c + +tkMacOSXMenubutton.o: $(MAC_OSX_DIR)/tkMacOSXMenubutton.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMenubutton.c + +tkMacOSXMenus.o: $(MAC_OSX_DIR)/tkMacOSXMenus.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMenus.c + +tkMacOSXMouseEvent.o: $(MAC_OSX_DIR)/tkMacOSXMouseEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMouseEvent.c + +tkMacOSXNotify.o: $(MAC_OSX_DIR)/tkMacOSXNotify.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXNotify.c + +tkMacOSXRegion.o: $(MAC_OSX_DIR)/tkMacOSXRegion.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXRegion.c + +tkMacOSXScrlbr.o: $(MAC_OSX_DIR)/tkMacOSXScrlbr.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXScrlbr.c + +tkMacOSXSend.o: $(MAC_OSX_DIR)/tkMacOSXSend.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXSend.c + +tkMacOSXSubwindows.o: $(MAC_OSX_DIR)/tkMacOSXSubwindows.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXSubwindows.c + +tkMacOSXTest.o: $(MAC_OSX_DIR)/tkMacOSXTest.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXTest.c +tkMacOSXWindowEvent.o: $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c + +tkMacOSXWm.o: $(MAC_OSX_DIR)/tkMacOSXWm.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXWm.c + +tkMacOSXXStubs.o: $(MAC_OSX_DIR)/tkMacOSXXStubs.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXXStubs.c + +tkFileFilter.o: $(GENERIC_DIR)/tkFileFilter.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkFileFilter.c + +tkMacWinMenu.o: $(GENERIC_DIR)/tkMacWinMenu.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMacWinMenu.c + +tkPointer.o: $(GENERIC_DIR)/tkPointer.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPointer.c + +xcolors.o: $(XLIB_DIR)/xcolors.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xcolors.c + +xdraw.o: $(XLIB_DIR)/xdraw.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xdraw.c + +xgc.o: $(XLIB_DIR)/xgc.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xgc.c + +ximage.o: $(XLIB_DIR)/ximage.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/ximage.c + +xutil.o: $(XLIB_DIR)/xutil.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xutil.c + +.c.o: + $(CC) -c $(CC_SWITCHES) $< # -# Regenerate the stubs files. +# Target to regenerate header files and stub files from the *.decls tables. # $(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \ @@ -1024,6 +1247,20 @@ checkstubs: if [ $$match -eq 0 ]; then echo $$i; fi \ done +# +# Target to check for proper usage of UCHAR macro. +# + +checkuchar: + -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR + +# +# Target to make sure that only symbols with "Tk" prefixes are +# exported. +# + +checkexports: $(TK_LIB_FILE) + -nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k' # # Target to create a Tk RPM for Linux. Requires that you be on a Linux @@ -1047,15 +1284,14 @@ rpm: all /bin/rpm # DISTROOT = /tmp/dist -DISTNAME = tk${VERSION}${PATCH_LEVEL} -ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip -DISTDIR = $(DISTROOT)/$(DISTNAME) -TCLDIR = @TCL_SRC_DIR@ +DISTNAME = tk${VERSION}${PATCH_LEVEL} +ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip +DISTDIR = $(DISTROOT)/$(DISTNAME) +TCLDIR = @TCL_SRC_DIR@ dist: rm -rf $(DISTDIR) - mkdir -p $(DISTDIR) - mkdir $(DISTDIR)/unix + mkdir -p $(DISTDIR)/unix cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix cp $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix chmod 664 $(DISTDIR)/unix/Makefile.in @@ -1115,7 +1351,7 @@ dist: cp -p $(TOP_DIR)/mac/*.tcl $(DISTDIR)/mac mkdir $(DISTDIR)/macosx cp -p $(TOP_DIR)/macosx/Makefile $(TOP_DIR)/macosx/Wish.icns \ - $(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.h \ + $(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.h $(TOP_DIR)/macosx/*.in \ $(TOP_DIR)/macosx/*.r $(TOP_DIR)/macosx/*.tcl $(DISTDIR)/macosx mkdir $(DISTDIR)/macosx/Wish.pbproj cp -p $(TOP_DIR)/macosx/Wish.pbproj/*.pbx* \ @@ -1187,8 +1423,8 @@ alldist: dist # The target below is similar to "alldist" except it works for patch # releases. It is needed because patch releases are peculiar: the # patch designation appears in the name of the compressed file -# (e.g. tcl8.0p1.tar.gz) but the extracted source directory doesn't -# include the patch designation (e.g. tcl8.0). +# (e.g. tk8.0p1.tar.gz) but the extracted source directory doesn't +# include the patch designation (e.g. tk8.0). # allpatch: dist @@ -1201,6 +1437,33 @@ allpatch: dist mv $(DISTROOT)/old $(DISTROOT)/tk${VERSION} # +# This target creates the HTML folder for Tcl & Tk and places it +# in DISTDIR/html. It uses the tcltk-man2html.tcl tool from +# the Tcl group's tool workspace. It depends on the Tcl & Tk being +# in directories called tcl8.3 & tk8.3 up two directories from the +# TOOL_DIR. +# + +html: + $(BUILD_HTML) + @EXTRA_BUILD_HTML@ +html-tcl: + $(BUILD_HTML) --tcl + @EXTRA_BUILD_HTML@ +html-tk: + $(BUILD_HTML) --tk + @EXTRA_BUILD_HTML@ + +BUILD_HTML = \ + @if test -f $(TCL_BIN_DIR)/tclsh; then \ + @LD_LIBRARY_PATH_VAR@=$(TCL_BIN_DIR):$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ + TCLSH="$(TCL_BIN_DIR)/tclsh"; else \ + TCLSH="$(TCL_EXE)"; fi ;\ + $${TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \ + --srcdir=$(TOP_DIR)/.. + +# # Target to create a Macintosh version of the distribution. This will # do a normal distribution and then massage the output to prepare it # for moving to the Mac platform. This requires a few scripts and diff --git a/unix/configure b/unix/configure index 0d3c427..5788eb3 100755 --- a/unix/configure +++ b/unix/configure @@ -37,7 +37,11 @@ ac_help="$ac_help ac_help="$ac_help --enable-symbols build with debugging symbols [--disable-symbols]" ac_help="$ac_help + --enable-aqua enable Aqua windowingsystem on Mac OS X [--disable-aqua]" +ac_help="$ac_help --with-x use the X Window System" +ac_help="$ac_help + --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -578,7 +582,7 @@ if test "${with_tcl+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:582: checking for Tcl configuration" >&5 +echo "configure:586: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -659,7 +663,7 @@ fi echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:663: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "configure:667: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 @@ -724,8 +728,6 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi -# libdir must be a fully qualified path and (not ${exec_prefix}/lib) -eval libdir="$libdir" # Make sure srcdir is fully qualified! srcdir=`cd $srcdir ; pwd` TK_SRC_DIR=`cd $srcdir/..; pwd` @@ -736,7 +738,7 @@ TK_SRC_DIR=`cd $srcdir/..; pwd` echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6 -echo "configure:740: checking whether to use symlinks for manpages" >&5 +echo "configure:742: checking whether to use symlinks for manpages" >&5 # Check whether --enable-man-symlinks or --disable-man-symlinks was given. if test "${enable_man_symlinks+set}" = set; then enableval="$enable_man_symlinks" @@ -748,7 +750,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking whether to compress the manpages""... $ac_c" 1>&6 -echo "configure:752: checking whether to compress the manpages" >&5 +echo "configure:754: checking whether to compress the manpages" >&5 # Check whether --enable-man-compression or --disable-man-compression was given. if test "${enable_man_compression+set}" = set; then enableval="$enable_man_compression" @@ -761,7 +763,7 @@ fi echo "$ac_t""$enableval" 1>&6 if test "$enableval" != "no"; then echo $ac_n "checking for compressed file suffix""... $ac_c" 1>&6 -echo "configure:765: checking for compressed file suffix" >&5 +echo "configure:767: checking for compressed file suffix" >&5 touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` @@ -771,7 +773,7 @@ echo "configure:765: checking for compressed file suffix" >&5 fi echo $ac_n "checking whether to add a package name suffix for the manpages""... $ac_c" 1>&6 -echo "configure:775: checking whether to add a package name suffix for the manpages" >&5 +echo "configure:777: checking whether to add a package name suffix for the manpages" >&5 # Check whether --enable-man-suffix or --disable-man-suffix was given. if test "${enable_man_suffix+set}" = set; then enableval="$enable_man_suffix" @@ -799,7 +801,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:803: checking for $ac_word" >&5 +echo "configure:805: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -829,7 +831,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:833: checking for $ac_word" >&5 +echo "configure:835: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -880,7 +882,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:884: checking for $ac_word" >&5 +echo "configure:886: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -912,7 +914,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:916: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:918: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -923,12 +925,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 927 "configure" +#line 929 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -954,12 +956,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:960: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:963: checking whether we are using GNU C" >&5 +echo "configure:965: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -968,7 +970,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -987,7 +989,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:991: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:993: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1020,7 +1022,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1024: checking how to run the C preprocessor" >&5 +echo "configure:1026: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1035,13 +1037,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1039 "configure" +#line 1041 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1052,13 +1054,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1056 "configure" +#line 1058 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1069,13 +1071,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1073 "configure" +#line 1075 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1103,17 +1105,17 @@ for ac_hdr in unistd.h limits.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1107: checking for $ac_hdr" >&5 +echo "configure:1109: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1112 "configure" +#line 1114 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1140,26 +1142,26 @@ fi done -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ if test -z "$no_pipe"; then if test -n "$GCC"; then echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6 -echo "configure:1152: checking if the compiler understands -pipe" >&5 +echo "configure:1154: checking if the compiler understands -pipe" >&5 OLDCC="$CC" CC="$CC -pipe" cat > conftest.$ac_ext <<EOF -#line 1156 "configure" +#line 1158 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:1163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1179,7 +1181,7 @@ fi echo $ac_n "checking for building with threads""... $ac_c" 1>&6 -echo "configure:1183: checking for building with threads" >&5 +echo "configure:1185: checking for building with threads" >&5 # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" @@ -1221,7 +1223,7 @@ EOF EOF echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6 -echo "configure:1225: checking for pthread_mutex_init in -lpthread" >&5 +echo "configure:1227: checking for pthread_mutex_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1229,7 +1231,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <<EOF -#line 1233 "configure" +#line 1235 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1240,7 +1242,7 @@ int main() { pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1268,7 +1270,7 @@ fi # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6 -echo "configure:1272: checking for __pthread_mutex_init in -lpthread" >&5 +echo "configure:1274: checking for __pthread_mutex_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1276,7 +1278,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <<EOF -#line 1280 "configure" +#line 1282 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1287,7 +1289,7 @@ int main() { __pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1315,7 +1317,7 @@ fi THREADS_LIBS=" -lpthread" else echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:1319: checking for pthread_mutex_init in -lpthreads" >&5 +echo "configure:1321: checking for pthread_mutex_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1323,7 +1325,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <<EOF -#line 1327 "configure" +#line 1329 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1334,7 +1336,7 @@ int main() { pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1360,7 +1362,7 @@ fi THREADS_LIBS=" -lpthreads" else echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6 -echo "configure:1364: checking for pthread_mutex_init in -lc" >&5 +echo "configure:1366: checking for pthread_mutex_init in -lc" >&5 ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1368,7 +1370,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <<EOF -#line 1372 "configure" +#line 1374 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1379,7 +1381,7 @@ int main() { pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1402,7 +1404,7 @@ fi if test "$tcl_ok" = "no"; then echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6 -echo "configure:1406: checking for pthread_mutex_init in -lc_r" >&5 +echo "configure:1408: checking for pthread_mutex_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1410,7 +1412,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <<EOF -#line 1414 "configure" +#line 1416 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1421,7 +1423,7 @@ int main() { pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1461,12 +1463,12 @@ fi for ac_func in pthread_attr_setstacksize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1465: checking for $ac_func" >&5 +echo "configure:1467: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1470 "configure" +#line 1472 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1489,7 +1491,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1516,12 +1518,12 @@ done for ac_func in pthread_atfork do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1520: checking for $ac_func" >&5 +echo "configure:1522: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1525 "configure" +#line 1527 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1544,7 +1546,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1572,12 +1574,12 @@ done for ac_func in readdir_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1576: checking for $ac_func" >&5 +echo "configure:1578: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1581 "configure" +#line 1583 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1600,7 +1602,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1626,14 +1628,14 @@ done if test "x$ac_cv_func_readdir_r" = "xyes"; then echo $ac_n "checking how many args readdir_r takes""... $ac_c" 1>&6 -echo "configure:1630: checking how many args readdir_r takes" >&5 +echo "configure:1632: checking how many args readdir_r takes" >&5 # IRIX 5.3 has a 2 arg version of readdir_r # while other systems have a 3 arg version. if eval "test \"`echo '$''{'tcl_cv_two_arg_readdir_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1637 "configure" +#line 1639 "configure" #include "confdefs.h" #include <stdlib.h> #include <sys/types.h> @@ -1648,7 +1650,7 @@ int main() { readdir_r(NULL, NULL); ; return 0; } EOF -if { (eval echo configure:1652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_two_arg_readdir_r=yes else @@ -1664,7 +1666,7 @@ fi echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1668 "configure" +#line 1670 "configure" #include "confdefs.h" #include <stdlib.h> #include <sys/types.h> @@ -1679,7 +1681,7 @@ int main() { readdir_r(NULL, NULL, NULL); ; return 0; } EOF -if { (eval echo configure:1683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_three_arg_readdir_r=yes else @@ -1717,13 +1719,9 @@ EOF # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" -#-------------------------------------------------------------------- -# Recompute the necessary flags to run the compiler -#-------------------------------------------------------------------- - echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1727: checking how to build libraries" >&5 +echo "configure:1725: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1753,10 +1751,16 @@ EOF fi +#-------------------------------------------------------------------- +# The statements below define a collection of compile flags. This +# macro depends on the value of SHARED_BUILD, and should be called +# after SC_ENABLE_SHARED checks the configure switches. +#-------------------------------------------------------------------- + # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1760: checking for $ac_word" >&5 +echo "configure:1764: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1788,7 +1792,7 @@ fi # Step 0.a: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1792: checking if 64bit support is requested" >&5 +echo "configure:1796: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1808,7 +1812,7 @@ fi # Step 0.b: Enable Solaris 64 bit VIS support? echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 -echo "configure:1812: checking if 64bit Sparc VIS support is requested" >&5 +echo "configure:1816: checking if 64bit Sparc VIS support is requested" >&5 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" @@ -1832,7 +1836,7 @@ fi # there are a few systems, like Next, where this doesn't work. echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 -echo "configure:1836: checking system version (for dynamic loading)" >&5 +echo "configure:1840: checking system version (for dynamic loading)" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -1858,7 +1862,7 @@ echo "configure:1836: checking system version (for dynamic loading)" >&5 # Linux can use either -ldl or -ldld for dynamic loading. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:1862: checking for dlopen in -ldl" >&5 +echo "configure:1866: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1866,7 +1870,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 1870 "configure" +#line 1874 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1877,7 +1881,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1925,7 +1929,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1929: checking for $ac_word" >&5 +echo "configure:1933: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2035,7 +2039,7 @@ fi # known GMT value. echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:2039: checking for gettimeofday in -lbsd" >&5 +echo "configure:2043: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2043,7 +2047,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 2047 "configure" +#line 2051 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2054,7 +2058,7 @@ int main() { gettimeofday() ; return 0; } EOF -if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2097,7 +2101,7 @@ EOF # is always linked to, for compatibility. #----------------------------------------------------------- echo $ac_n "checking for inet_ntoa in -lbind""... $ac_c" 1>&6 -echo "configure:2101: checking for inet_ntoa in -lbind" >&5 +echo "configure:2105: checking for inet_ntoa in -lbind" >&5 ac_lib_var=`echo bind'_'inet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2105,7 +2109,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <<EOF -#line 2109 "configure" +#line 2113 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2116,7 +2120,7 @@ int main() { inet_ntoa() ; return 0; } EOF -if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2182,7 +2186,7 @@ EOF SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2186: checking for shl_load in -ldld" >&5 +echo "configure:2190: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2190,7 +2194,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <<EOF -#line 2194 "configure" +#line 2198 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2201,7 +2205,7 @@ int main() { shl_load() ; return 0; } EOF -if { (eval echo configure:2205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2269,7 +2273,7 @@ fi HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2273: checking for shl_load in -ldld" >&5 +echo "configure:2277: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2277,7 +2281,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <<EOF -#line 2281 "configure" +#line 2285 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2288,7 +2292,7 @@ int main() { shl_load() ; return 0; } EOF -if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2412,17 +2416,17 @@ fi else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2416: checking for dld.h" >&5 +echo "configure:2420: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2421 "configure" +#line 2425 "configure" #include "confdefs.h" #include <dld.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2486,17 +2490,17 @@ EOF else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2490: checking for dld.h" >&5 +echo "configure:2494: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2495 "configure" +#line 2499 "configure" #include "confdefs.h" #include <dld.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2552,17 +2556,17 @@ fi # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:2556: checking for dlfcn.h" >&5 +echo "configure:2560: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2561 "configure" +#line 2565 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2589,9 +2593,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2593: checking for ELF" >&5 +echo "configure:2597: checking for ELF" >&5 cat > conftest.$ac_ext <<EOF -#line 2595 "configure" +#line 2599 "configure" #include "confdefs.h" #ifdef __ELF__ @@ -2665,9 +2669,9 @@ fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2669: checking for ELF" >&5 +echo "configure:2673: checking for ELF" >&5 cat > conftest.$ac_ext <<EOF -#line 2671 "configure" +#line 2675 "configure" #include "confdefs.h" #ifdef __ELF__ @@ -2726,7 +2730,7 @@ rm -f conftest* SHLIB_CFLAGS="-fno-common" SHLIB_LD="cc -dynamiclib \${LDFLAGS}" echo $ac_n "checking if ld accepts -single_module flag""... $ac_c" 1>&6 -echo "configure:2730: checking if ld accepts -single_module flag" >&5 +echo "configure:2734: checking if ld accepts -single_module flag" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_single_module'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2734,14 +2738,14 @@ else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat > conftest.$ac_ext <<EOF -#line 2738 "configure" +#line 2742 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_ld_single_module=yes else @@ -2764,7 +2768,7 @@ echo "$ac_t""$tcl_cv_ld_single_module" 1>&6 DL_LIBS="" LDFLAGS="$LDFLAGS -prebind" echo $ac_n "checking if ld accepts -search_paths_first flag""... $ac_c" 1>&6 -echo "configure:2768: checking if ld accepts -search_paths_first flag" >&5 +echo "configure:2772: checking if ld accepts -search_paths_first flag" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_search_paths_first'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2772,14 +2776,14 @@ else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat > conftest.$ac_ext <<EOF -#line 2776 "configure" +#line 2780 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_ld_search_paths_first=yes else @@ -2801,10 +2805,8 @@ echo "$ac_t""$tcl_cv_ld_search_paths_first" 1>&6 LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" PLAT_OBJS=\$\(MAC\_OSX_OBJS\) PLAT_SRCS=\$\(MAC\_OSX_SRCS\) - TCL_SHLIB_LD_EXTRAS='-compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000' - TK_SHLIB_LD_EXTRAS=' -compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' echo $ac_n "checking whether to use CoreFoundation""... $ac_c" 1>&6 -echo "configure:2808: checking whether to use CoreFoundation" >&5 +echo "configure:2810: checking whether to use CoreFoundation" >&5 # Check whether --enable-corefoundation or --disable-corefoundation was given. if test "${enable_corefoundation+set}" = set; then enableval="$enable_corefoundation" @@ -2816,7 +2818,7 @@ fi echo "$ac_t""$tcl_corefoundation" 1>&6 if test $tcl_corefoundation = yes; then echo $ac_n "checking for CoreFoundation.framework""... $ac_c" 1>&6 -echo "configure:2820: checking for CoreFoundation.framework" >&5 +echo "configure:2822: checking for CoreFoundation.framework" >&5 if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2824,14 +2826,14 @@ else hold_libs=$LIBS LIBS="$LIBS -framework CoreFoundation" cat > conftest.$ac_ext <<EOF -#line 2828 "configure" +#line 2830 "configure" #include "confdefs.h" #include <CoreFoundation/CoreFoundation.h> int main() { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } EOF -if { (eval echo configure:2835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_lib_corefoundation=yes else @@ -2857,17 +2859,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2861: checking for $ac_hdr" >&5 +echo "configure:2863: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2866 "configure" +#line 2868 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2896,12 +2898,12 @@ done for ac_func in OSSpinLockLock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2900: checking for $ac_func" >&5 +echo "configure:2902: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2905 "configure" +#line 2907 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2924,7 +2926,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2960,15 +2962,19 @@ EOF #define TCL_DEFAULT_ENCODING "utf-8" EOF + cat >> confdefs.h <<\EOF +#define TCL_LOAD_FROM_MEMORY 1 +EOF + # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232: echo $ac_n "checking for realpath""... $ac_c" 1>&6 -echo "configure:2967: checking for realpath" >&5 +echo "configure:2973: checking for realpath" >&5 if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2972 "configure" +#line 2978 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char realpath(); below. */ @@ -2991,7 +2997,7 @@ realpath(); ; return 0; } EOF -if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_realpath=yes" else @@ -3302,17 +3308,17 @@ EOF # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 -echo "configure:3306: checking for ld accepts -Bexport flag" >&5 +echo "configure:3312: checking for ld accepts -Bexport flag" >&5 LDFLAGS="$LDFLAGS -Wl,-Bexport" cat > conftest.$ac_ext <<EOF -#line 3309 "configure" +#line 3315 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -3353,9 +3359,9 @@ rm -f conftest* if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 -echo "configure:3357: checking sys/exec.h" >&5 +echo "configure:3363: checking sys/exec.h" >&5 cat > conftest.$ac_ext <<EOF -#line 3359 "configure" +#line 3365 "configure" #include "confdefs.h" #include <sys/exec.h> int main() { @@ -3373,7 +3379,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3391,9 +3397,9 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:3395: checking a.out.h" >&5 +echo "configure:3401: checking a.out.h" >&5 cat > conftest.$ac_ext <<EOF -#line 3397 "configure" +#line 3403 "configure" #include "confdefs.h" #include <a.out.h> int main() { @@ -3411,7 +3417,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3429,9 +3435,9 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:3433: checking sys/exec_aout.h" >&5 +echo "configure:3439: checking sys/exec_aout.h" >&5 cat > conftest.$ac_ext <<EOF -#line 3435 "configure" +#line 3441 "configure" #include "confdefs.h" #include <sys/exec_aout.h> int main() { @@ -3449,7 +3455,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3600,7 +3606,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:3604: checking for build with symbols" >&5 +echo "configure:3610: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -3661,21 +3667,21 @@ TK_DBGX=${DBGX} echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 -echo "configure:3665: checking for required early compiler flags" >&5 +echo "configure:3671: checking for required early compiler flags" >&5 tcl_flags="" if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3672 "configure" +#line 3678 "configure" #include "confdefs.h" #include <stdlib.h> int main() { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:3679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=no else @@ -3683,7 +3689,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 3687 "configure" +#line 3693 "configure" #include "confdefs.h" #define _ISOC99_SOURCE 1 #include <stdlib.h> @@ -3691,7 +3697,7 @@ int main() { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:3695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=yes else @@ -3717,14 +3723,14 @@ EOF echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3721 "configure" +#line 3727 "configure" #include "confdefs.h" #include <sys/stat.h> int main() { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:3728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=no else @@ -3732,7 +3738,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 3736 "configure" +#line 3742 "configure" #include "confdefs.h" #define _LARGEFILE64_SOURCE 1 #include <sys/stat.h> @@ -3740,7 +3746,7 @@ int main() { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:3744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=yes else @@ -3769,7 +3775,7 @@ EOF echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 -echo "configure:3773: checking for 64-bit integer type" >&5 +echo "configure:3779: checking for 64-bit integer type" >&5 if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3777,14 +3783,14 @@ else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat > conftest.$ac_ext <<EOF -#line 3781 "configure" +#line 3787 "configure" #include "confdefs.h" int main() { __int64 value = (__int64) 0; ; return 0; } EOF -if { (eval echo configure:3788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_type_64bit=__int64 else @@ -3798,7 +3804,7 @@ rm -f conftest* # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat > conftest.$ac_ext <<EOF -#line 3802 "configure" +#line 3808 "configure" #include "confdefs.h" int main() { @@ -3807,7 +3813,7 @@ switch (0) { } ; return 0; } EOF -if { (eval echo configure:3811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_64bit=${tcl_type_64bit} else @@ -3832,13 +3838,13 @@ EOF # Now check for auxiliary declarations echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 -echo "configure:3836: checking for struct dirent64" >&5 +echo "configure:3842: checking for struct dirent64" >&5 if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3842 "configure" +#line 3848 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/dirent.h> @@ -3846,7 +3852,7 @@ int main() { struct dirent64 p; ; return 0; } EOF -if { (eval echo configure:3850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_dirent64=yes else @@ -3867,13 +3873,13 @@ EOF echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6 echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:3871: checking for struct stat64" >&5 +echo "configure:3877: checking for struct stat64" >&5 if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3877 "configure" +#line 3883 "configure" #include "confdefs.h" #include <sys/stat.h> int main() { @@ -3881,7 +3887,7 @@ struct stat64 p; ; return 0; } EOF -if { (eval echo configure:3885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3891: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_stat64=yes else @@ -3904,12 +3910,12 @@ EOF for ac_func in open64 lseek64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3908: checking for $ac_func" >&5 +echo "configure:3914: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3913 "configure" +#line 3919 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3932,7 +3938,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3957,13 +3963,13 @@ fi done echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:3961: checking for off64_t" >&5 +echo "configure:3967: checking for off64_t" >&5 if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3967 "configure" +#line 3973 "configure" #include "confdefs.h" #include <sys/types.h> int main() { @@ -3971,7 +3977,7 @@ off64_t offset; ; return 0; } EOF -if { (eval echo configure:3975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_off64_t=yes else @@ -4001,14 +4007,14 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4005: checking whether byte ordering is bigendian" >&5 +echo "configure:4011: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 4012 "configure" +#line 4018 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -4019,11 +4025,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 4027 "configure" +#line 4033 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -4034,7 +4040,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4054,7 +4060,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4058 "configure" +#line 4064 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -4067,7 +4073,7 @@ main () { exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -4117,12 +4123,12 @@ fi MATH_LIBS="" echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4121: checking for sin" >&5 +echo "configure:4127: checking for sin" >&5 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4126 "configure" +#line 4132 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin(); below. */ @@ -4145,7 +4151,7 @@ sin(); ; return 0; } EOF -if { (eval echo configure:4149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -4166,7 +4172,7 @@ MATH_LIBS="-lm" fi echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6 -echo "configure:4170: checking for main in -lieee" >&5 +echo "configure:4176: checking for main in -lieee" >&5 ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4174,14 +4180,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lieee $LIBS" cat > conftest.$ac_ext <<EOF -#line 4178 "configure" +#line 4184 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4212,7 +4218,7 @@ fi libbsd=no if test "`uname -s`" = "AIX" ; then echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:4216: checking for gettimeofday in -lbsd" >&5 +echo "configure:4222: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4220,7 +4226,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 4224 "configure" +#line 4230 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4231,7 +4237,7 @@ int main() { gettimeofday() ; return 0; } EOF -if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4262,9 +4268,9 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking stdlib.h""... $ac_c" 1>&6 -echo "configure:4266: checking stdlib.h" >&5 +echo "configure:4272: checking stdlib.h" >&5 cat > conftest.$ac_ext <<EOF -#line 4268 "configure" +#line 4274 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4279,7 +4285,7 @@ fi rm -f conftest* cat > conftest.$ac_ext <<EOF -#line 4283 "configure" +#line 4289 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4293,7 +4299,7 @@ fi rm -f conftest* cat > conftest.$ac_ext <<EOF -#line 4297 "configure" +#line 4303 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4325,16 +4331,16 @@ echo "$ac_t""$tk_ok" 1>&6 #-------------------------------------------------------------------- echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6 -echo "configure:4329: checking fd_set and sys/select" >&5 +echo "configure:4335: checking fd_set and sys/select" >&5 cat > conftest.$ac_ext <<EOF -#line 4331 "configure" +#line 4337 "configure" #include "confdefs.h" #include <sys/types.h> int main() { fd_set readMask, writeMask; ; return 0; } EOF -if { (eval echo configure:4338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tk_ok=yes else @@ -4346,7 +4352,7 @@ fi rm -f conftest* if test $tk_ok = no; then cat > conftest.$ac_ext <<EOF -#line 4350 "configure" +#line 4356 "configure" #include "confdefs.h" #include <sys/select.h> EOF @@ -4378,12 +4384,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4382: checking for ANSI C header files" >&5 +echo "configure:4388: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4387 "configure" +#line 4393 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -4391,7 +4397,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4408,7 +4414,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4412 "configure" +#line 4418 "configure" #include "confdefs.h" #include <string.h> EOF @@ -4426,7 +4432,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4430 "configure" +#line 4436 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4447,7 +4453,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 4451 "configure" +#line 4457 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4458,7 +4464,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4482,12 +4488,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:4486: checking for mode_t" >&5 +echo "configure:4492: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4491 "configure" +#line 4497 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -4515,12 +4521,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:4519: checking for pid_t" >&5 +echo "configure:4525: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4524 "configure" +#line 4530 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -4548,12 +4554,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:4552: checking for size_t" >&5 +echo "configure:4558: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4557 "configure" +#line 4563 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -4581,12 +4587,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4585: checking for uid_t in sys/types.h" >&5 +echo "configure:4591: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4590 "configure" +#line 4596 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -4623,17 +4629,17 @@ for ac_hdr in sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4627: checking for $ac_hdr" >&5 +echo "configure:4633: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4632 "configure" +#line 4638 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4660,12 +4666,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4664: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4670: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4669 "configure" +#line 4675 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -4674,7 +4680,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4700,16 +4706,16 @@ fi #------------------------------------------- echo $ac_n "checking pw_gecos in struct pwd""... $ac_c" 1>&6 -echo "configure:4704: checking pw_gecos in struct pwd" >&5 +echo "configure:4710: checking pw_gecos in struct pwd" >&5 cat > conftest.$ac_ext <<EOF -#line 4706 "configure" +#line 4712 "configure" #include "confdefs.h" #include <pwd.h> int main() { struct passwd pwd; pwd.pw_gecos; ; return 0; } EOF -if { (eval echo configure:4713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tk_ok=yes else @@ -4728,21 +4734,111 @@ EOF fi #-------------------------------------------------------------------- -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. +# On Mac OS X, we can build either with X11 or with Aqua #-------------------------------------------------------------------- +if test "`uname -s`" = "Darwin" ; then + # Check whether --enable-aqua or --disable-aqua was given. +if test "${enable_aqua+set}" = set; then + enableval="$enable_aqua" + tk_aqua=$enableval +else + tk_aqua=no +fi + + if test $tk_aqua = yes; then + if test $tcl_corefoundation = no; then + echo "configure: warning: "Aqua can only be used when CoreFoundation is available"" 1>&2 + tk_aqua=no + elif test ! -d /System/Library/Frameworks/Carbon.framework; then + echo "configure: warning: "Aqua can only be used when Carbon is available"" 1>&2 + tk_aqua=no + fi + fi +else + tk_aqua=no +fi + +if test $tk_aqua = yes; then + cat >> confdefs.h <<\EOF +#define MAC_OSX_TK 1 +EOF + + LIBS="$LIBS -framework Carbon" + CFLAGS="$CFLAGS -fpascal-strings" + for ac_func in _dyld_get_image_header_containing_address +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4773: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4778 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + TK_WINDOWINGSYSTEM=AQUA +else + #-------------------------------------------------------------------- + # Locate the X11 header files and the X11 library archive. Try + # the ac_path_x macro first, but if it doesn't find the X stuff + # (e.g. because there's no xmkmf program) then check through + # a list of possible directories. Under some conditions the + # autoconf macro will return an include directory that contains + # no include files, so double-check its result just to be safe. + #-------------------------------------------------------------------- + + # If we find X, set shell vars x_includes and x_libraries to the # paths, otherwise set no_x=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:4746: checking for X" >&5 +echo "configure:4842: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4804,12 +4900,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 4808 "configure" +#line 4904 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4878,14 +4974,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 4882 "configure" +#line 4978 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:4889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -4975,12 +5071,12 @@ fi if test "$no_x" = ""; then if test "$x_includes" = ""; then cat > conftest.$ac_ext <<EOF -#line 4979 "configure" +#line 5075 "configure" #include "confdefs.h" #include <X11/XIntrinsic.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -5000,15 +5096,15 @@ rm -f conftest* fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo $ac_n "checking for X11 header files""... $ac_c" 1>&6 -echo "configure:5004: checking for X11 header files" >&5 +echo "configure:5100: checking for X11 header files" >&5 found_xincludes="no" cat > conftest.$ac_ext <<EOF -#line 5007 "configure" +#line 5103 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5044,7 +5140,7 @@ rm -f conftest* if test "$no_x" = yes; then echo $ac_n "checking for X11 libraries""... $ac_c" 1>&6 -echo "configure:5048: checking for X11 libraries" >&5 +echo "configure:5144: checking for X11 libraries" >&5 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do @@ -5064,7 +5160,7 @@ echo "configure:5048: checking for X11 libraries" >&5 fi if test "$XLIBSW" = nope ; then echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6 -echo "configure:5068: checking for XCreateWindow in -lXwindow" >&5 +echo "configure:5164: checking for XCreateWindow in -lXwindow" >&5 ac_lib_var=`echo Xwindow'_'XCreateWindow | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5072,7 +5168,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXwindow $LIBS" cat > conftest.$ac_ext <<EOF -#line 5076 "configure" +#line 5172 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5083,7 +5179,7 @@ int main() { XCreateWindow() ; return 0; } EOF -if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5109,6 +5205,8 @@ fi XLIBSW=-lX11 fi + TK_WINDOWINGSYSTEM=X11 +fi #-------------------------------------------------------------------- # Various manipulations on the search path used at runtime to @@ -5157,7 +5255,7 @@ eval "LD_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\"" #-------------------------------------------------------------------- echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:5161: checking for main in -lXbsd" >&5 +echo "configure:5259: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5165,14 +5263,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lXbsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 5169 "configure" +#line 5267 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5195,12 +5293,12 @@ fi tk_checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:5199: checking for connect" >&5 +echo "configure:5297: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5204 "configure" +#line 5302 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -5223,7 +5321,7 @@ connect(); ; return 0; } EOF -if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -5245,7 +5343,7 @@ fi if test "$tk_checkSocket" = 1; then echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:5249: checking for main in -lsocket" >&5 +echo "configure:5347: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5253,14 +5351,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 5257 "configure" +#line 5355 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5286,12 +5384,12 @@ if test "$tk_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:5290: checking for accept" >&5 +echo "configure:5388: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5295 "configure" +#line 5393 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept(); below. */ @@ -5314,7 +5412,7 @@ accept(); ; return 0; } EOF -if { (eval echo configure:5318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -5336,12 +5434,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:5340: checking for gethostbyname" >&5 +echo "configure:5438: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5345 "configure" +#line 5443 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -5364,7 +5462,7 @@ gethostbyname(); ; return 0; } EOF -if { (eval echo configure:5368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -5382,7 +5480,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:5386: checking for main in -lnsl" >&5 +echo "configure:5484: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5390,14 +5488,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 5394 "configure" +#line 5492 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5433,13 +5531,13 @@ fi if test -d /usr/include/mit ; then echo $ac_n "checking MIT X libraries""... $ac_c" 1>&6 -echo "configure:5437: checking MIT X libraries" >&5 +echo "configure:5535: checking MIT X libraries" >&5 tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -I/usr/include/mit" tk_oldLibs=$LIBS LIBS="$LIBS -lX11-mit" cat > conftest.$ac_ext <<EOF -#line 5443 "configure" +#line 5541 "configure" #include "confdefs.h" #include <X11/Xlib.h> @@ -5450,7 +5548,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -5474,14 +5572,14 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:5478: checking whether char is unsigned" >&5 +echo "configure:5576: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <<EOF -#line 5485 "configure" +#line 5583 "configure" #include "confdefs.h" #ifdef __CHAR_UNSIGNED__ yes @@ -5503,7 +5601,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 5507 "configure" +#line 5605 "configure" #include "confdefs.h" /* volatile prevents gcc2 from optimizing the test away on sparcs. */ #if !defined(__STDC__) || __STDC__ != 1 @@ -5513,7 +5611,7 @@ main() { volatile char c = 255; exit(c < 0); } EOF -if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -5546,12 +5644,12 @@ fi echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:5550: checking for strtod" >&5 +echo "configure:5648: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5555 "configure" +#line 5653 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strtod(); below. */ @@ -5574,7 +5672,7 @@ strtod(); ; return 0; } EOF -if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -5596,7 +5694,7 @@ fi if test "$tcl_strtod" = 1; then echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6 -echo "configure:5600: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo "configure:5698: checking for Solaris2.4/Tru64 strtod bugs" >&5 if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5605,7 +5703,7 @@ else tcl_cv_strtod_buggy=0 else cat > conftest.$ac_ext <<EOF -#line 5609 "configure" +#line 5707 "configure" #include "confdefs.h" extern double strtod(); @@ -5628,7 +5726,7 @@ else exit(0); } EOF -if { (eval echo configure:5632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_strtod_buggy=1 else @@ -5660,58 +5758,168 @@ EOF # building libtk as a shared library instead of a static library. #-------------------------------------------------------------------- -eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" +eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +eval "TK_LIB_FILE=libtk${LIB_SUFFIX}" + +# tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed +# so that the backslashes quoting the DBX braces are dropped. + +# Trick to replace DBGX with TK_DBGX +DBGX='${TK_DBGX}' +eval "TK_LIB_FILE=${TK_LIB_FILE}" if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}" TCL_STUB_FLAGS="-DUSE_TCL_STUBS" -else - TCL_STUB_FLAGS="" fi -TK_LIB_FILE=libtk${LIB_SUFFIX} -eval "TK_LIB_FILE=${TK_LIB_FILE}" + +TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +PRIVATE_INCLUDE_DIR='$(includedir)' +HTML_DIR='$(DISTDIR)/html' +TK_PKG_DIR='tk$(VERSION)$(TK_DBGX)' +TK_RSRC_FILE='tk$(VERSION).rsrc' +WISH_RSRC_FILE='wish$(VERSION).rsrc' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. -if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then - if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}" +if test "`uname -s`" = "Darwin" ; then + + echo $ac_n "checking how to package libraries""... $ac_c" 1>&6 +echo "configure:5793: checking how to package libraries" >&5 + # Check whether --enable-framework or --disable-framework was given. +if test "${enable_framework+set}" = set; then + enableval="$enable_framework" + tcl_ok=$enableval +else + tcl_ok=no +fi + + + if test "${enable_framework+set}" = set; then + enableval="$enable_framework" + tcl_ok=$enableval else - eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}" + tcl_ok=no fi - TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" - TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" - TK_BUILD_EXP_FILE="" - TK_EXP_FILE="" -else - TK_BUILD_EXP_FILE="lib.exp" - eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" - if test "$GCC" = "yes" ; then - TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" - TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + if test "$tcl_ok" = "yes" ; then + echo "$ac_t""framework" 1>&6 + FRAMEWORK_BUILD=1 + if test "${SHARED_BUILD}" = "0" ; then + echo "configure: warning: "Frameworks can only be built if --enable-shared is yes"" 1>&2 + FRAMEWORK_BUILD=0 + fi + if test $tcl_corefoundation = no; then + echo "configure: warning: "Frameworks can only be used when CoreFoundation is available"" 1>&2 + FRAMEWORK_BUILD=0 + fi else - TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" - TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + echo "$ac_t""standard shared library" 1>&6 + FRAMEWORK_BUILD=0 + fi + + TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' +fi + +if test "$FRAMEWORK_BUILD" = "1" ; then + cat >> confdefs.h <<\EOF +#define TK_FRAMEWORK 1 +EOF + + tk_config_files="${tk_config_files} Tk-Info.plist:../macosx/Tk-Info.plist.in" + # Construct a fake local framework structure to make linking with + # '-framework Tk' and running of tktest work + + LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" + if test "${libdir}" = '${exec_prefix}/lib'; then + # override libdir default + libdir="/Library/Frameworks" + fi + TK_LIB_FILE="Tk" + TK_LIB_FLAG="-framework Tk" + TK_BUILD_LIB_SPEC="-F`pwd` -framework Tk" + TK_LIB_SPEC="-F${libdir} -framework Tk" + libdir="${libdir}/Tk.framework/Versions/\${VERSION}" + TK_LIBRARY="${libdir}/Resources/Scripts" + TK_PKG_DIR="Resources/Scripts" + TK_RSRC_FILE="Tk.rsrc" + WISH_RSRC_FILE="Wish.rsrc" + includedir="${libdir}/Headers" + PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" + HTML_DIR="${libdir}/Resources/Documentation/Reference/Tk" + EXTRA_INSTALL="install-private-headers html-tk" + EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TkTOC.html' + EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + if test $tk_aqua = yes; then + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' + bindir="${libdir}/Resources/Wish.app/Contents/MacOS" + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "'\$\(MAC\_OSX_DIR\)'/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' + fi + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" "$(STUB_LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done' + TK_YEAR="`date +%Y`" + # Don't use AC_DEFINE for the following as the framework version define + # needs to go into the Makefile even when using autoheader, so that we + # can pick up a potential make override of VERSION. Also, don't put this + # into CFLAGS as it should not go into tkConfig.sh + EXTRA_CC_SWITCHES='-DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' +else + # libdir must be a fully qualified path and not ${exec_prefix}/lib + eval libdir="$libdir" + if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then + if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}" + else + eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}" + fi + TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" + else + TK_BUILD_EXP_FILE="lib.exp" + eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" + + if test "$GCC" = "yes" ; then + TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" + TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + else + TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" + TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + fi + fi +fi + +# Support for building the Aqua resource files +if test $tk_aqua = yes; then + tk_config_files="${tk_config_files} Wish-Info.plist:../macosx/Wish-Info.plist.in" + EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' + LIB_RSRC_FILE='${TK_RSRC_FILE}' + APP_RSRC_FILE='${WISH_RSRC_FILE}' + REZ=/Developer/Tools/Rez + REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF' + if test "$SHARED_BUILD" = 0; then + EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) $(LIB_INSTALL_DIR)' + TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd`/\${TK_RSRC_FILE}" + TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}" + elif test "$FRAMEWORK_BUILD" = "0"; then + TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}" fi fi -TK_SHARED_BUILD=${SHARED_BUILD} #-------------------------------------------------------------------- -# The statements below define various symbols relating to creating -# the stub'd version of the Tk library -# -# For now, linking to Tcl stubs is not supported with Tk. It causes -# too many problems with linking. When Tk is a fully loadable -# extension, linking the the Tcl stubs will be supported. +# The statements below define various symbols relating to Tk +# stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" +eval "TK_STUB_LIB_DIR=${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}\${TK_DBGX}" @@ -5720,11 +5928,33 @@ else fi TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" -TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" -TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" + +#------------------------------------------------------------------------ +# tkConfig.sh refers to this by a different name +#------------------------------------------------------------------------ + +TK_SHARED_BUILD=${SHARED_BUILD} + + + + + + + + + + + + + + + + + -eval "TK_LIB_FILE=${TK_LIB_FILE}" @@ -5759,6 +5989,7 @@ eval "TK_LIB_FILE=${TK_LIB_FILE}" +tk_config_files="${tk_config_files} Makefile tkConfig.sh" trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -5871,7 +6102,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "Makefile tkConfig.sh" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "${tk_config_files}" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -5946,28 +6177,44 @@ s%@TK_VERSION@%$TK_VERSION%g s%@TK_MAJOR_VERSION@%$TK_MAJOR_VERSION%g s%@TK_MINOR_VERSION@%$TK_MINOR_VERSION%g s%@TK_PATCH_LEVEL@%$TK_PATCH_LEVEL%g -s%@TK_DBGX@%$TK_DBGX%g +s%@TK_YEAR@%$TK_YEAR%g +s%@TK_LIB_FILE@%$TK_LIB_FILE%g +s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g +s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g s%@TK_STUB_LIB_FILE@%$TK_STUB_LIB_FILE%g s%@TK_STUB_LIB_FLAG@%$TK_STUB_LIB_FLAG%g -s%@TK_BUILD_STUB_LIB_SPEC@%$TK_BUILD_STUB_LIB_SPEC%g s%@TK_STUB_LIB_SPEC@%$TK_STUB_LIB_SPEC%g -s%@TK_BUILD_STUB_LIB_PATH@%$TK_BUILD_STUB_LIB_PATH%g s%@TK_STUB_LIB_PATH@%$TK_STUB_LIB_PATH%g -s%@TK_STUB_FLAGS@%$TK_STUB_FLAGS%g +s%@TK_BUILD_STUB_LIB_SPEC@%$TK_BUILD_STUB_LIB_SPEC%g +s%@TK_BUILD_STUB_LIB_PATH@%$TK_BUILD_STUB_LIB_PATH%g +s%@TK_SRC_DIR@%$TK_SRC_DIR%g +s%@TK_DBGX@%$TK_DBGX%g +s%@TK_SHARED_BUILD@%$TK_SHARED_BUILD%g +s%@LD_LIBRARY_PATH_VAR@%$LD_LIBRARY_PATH_VAR%g +s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g s%@TK_BUILD_EXP_FILE@%$TK_BUILD_EXP_FILE%g s%@TK_EXP_FILE@%$TK_EXP_FILE%g s%@TCL_STUB_FLAGS@%$TCL_STUB_FLAGS%g -s%@LD_LIBRARY_PATH_VAR@%$LD_LIBRARY_PATH_VAR%g s%@MATH_LIBS@%$MATH_LIBS%g -s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g -s%@TK_LIB_FILE@%$TK_LIB_FILE%g -s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g -s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g -s%@TK_SRC_DIR@%$TK_SRC_DIR%g s%@XINCLUDES@%$XINCLUDES%g s%@XLIBSW@%$XLIBSW%g -s%@TK_SHARED_BUILD@%$TK_SHARED_BUILD%g s%@LOCALES@%$LOCALES%g +s%@TK_WINDOWINGSYSTEM@%$TK_WINDOWINGSYSTEM%g +s%@TK_PKG_DIR@%$TK_PKG_DIR%g +s%@TK_LIBRARY@%$TK_LIBRARY%g +s%@PRIVATE_INCLUDE_DIR@%$PRIVATE_INCLUDE_DIR%g +s%@HTML_DIR@%$HTML_DIR%g +s%@EXTRA_CC_SWITCHES@%$EXTRA_CC_SWITCHES%g +s%@EXTRA_INSTALL@%$EXTRA_INSTALL%g +s%@EXTRA_INSTALL_BINARIES@%$EXTRA_INSTALL_BINARIES%g +s%@EXTRA_BUILD_HTML@%$EXTRA_BUILD_HTML%g +s%@EXTRA_WISH_LIBS@%$EXTRA_WISH_LIBS%g +s%@TK_RSRC_FILE@%$TK_RSRC_FILE%g +s%@WISH_RSRC_FILE@%$WISH_RSRC_FILE%g +s%@LIB_RSRC_FILE@%$LIB_RSRC_FILE%g +s%@APP_RSRC_FILE@%$APP_RSRC_FILE%g +s%@REZ@%$REZ%g +s%@REZ_FLAGS@%$REZ_FLAGS%g CEOF EOF @@ -6009,7 +6256,7 @@ EOF cat >> $CONFIG_STATUS <<EOF -CONFIG_FILES=\${CONFIG_FILES-"Makefile tkConfig.sh"} +CONFIG_FILES=\${CONFIG_FILES-"${tk_config_files}"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -6065,9 +6312,18 @@ rm -f conftest.s* EOF cat >> $CONFIG_STATUS <<EOF +VERSION=${TK_VERSION} && tk_aqua=${tk_aqua} EOF cat >> $CONFIG_STATUS <<\EOF +n=Tk && echo "creating $n.framework" && + f=$n.framework && v=Versions/$VERSION && + rm -rf $f && mkdir -p $f/$v/Resources && + ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && + ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && + if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && + unset n f v + exit 0 EOF diff --git a/unix/configure.in b/unix/configure.in index 841f948..94a4ee1 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.83.2.14 2005/05/07 00:03:05 hobbs Exp $ +# RCS: @(#) $Id: configure.in,v 1.83.2.15 2005/05/24 04:21:34 das Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.13) @@ -38,8 +38,6 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi -# libdir must be a fully qualified path and (not ${exec_prefix}/lib) -eval libdir="$libdir" # Make sure srcdir is fully qualified! srcdir=`cd $srcdir ; pwd` TK_SRC_DIR=`cd $srcdir/..; pwd` @@ -63,10 +61,10 @@ AC_PROG_CC AC_HAVE_HEADERS([unistd.h limits.h]) -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ if test -z "$no_pipe"; then if test -n "$GCC"; then @@ -89,12 +87,14 @@ SC_ENABLE_THREADS # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" +SC_ENABLE_SHARED + #-------------------------------------------------------------------- -# Recompute the necessary flags to run the compiler +# The statements below define a collection of compile flags. This +# macro depends on the value of SHARED_BUILD, and should be called +# after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- -SC_ENABLE_SHARED - SC_CONFIG_CFLAGS SC_ENABLE_SYMBOLS @@ -226,15 +226,44 @@ if test $tk_ok = yes; then fi #-------------------------------------------------------------------- -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. +# On Mac OS X, we can build either with X11 or with Aqua #-------------------------------------------------------------------- -SC_PATH_X +if test "`uname -s`" = "Darwin" ; then + AC_ARG_ENABLE(aqua, [ --enable-aqua enable Aqua windowingsystem on Mac OS X [--disable-aqua]], + [tk_aqua=$enableval], [tk_aqua=no]) + if test $tk_aqua = yes; then + if test $tcl_corefoundation = no; then + AC_MSG_WARN("Aqua can only be used when CoreFoundation is available") + tk_aqua=no + elif test ! -d /System/Library/Frameworks/Carbon.framework; then + AC_MSG_WARN("Aqua can only be used when Carbon is available") + tk_aqua=no + fi + fi +else + tk_aqua=no +fi + +if test $tk_aqua = yes; then + AC_DEFINE(MAC_OSX_TK) + LIBS="$LIBS -framework Carbon" + CFLAGS="$CFLAGS -fpascal-strings" + AC_CHECK_FUNCS(_dyld_get_image_header_containing_address) + TK_WINDOWINGSYSTEM=AQUA +else + #-------------------------------------------------------------------- + # Locate the X11 header files and the X11 library archive. Try + # the ac_path_x macro first, but if it doesn't find the X stuff + # (e.g. because there's no xmkmf program) then check through + # a list of possible directories. Under some conditions the + # autoconf macro will return an include directory that contains + # no include files, so double-check its result just to be safe. + #-------------------------------------------------------------------- + + SC_PATH_X + TK_WINDOWINGSYSTEM=X11 +fi #-------------------------------------------------------------------- # Various manipulations on the search path used at runtime to @@ -347,58 +376,138 @@ SC_BUGGY_STRTOD # building libtk as a shared library instead of a static library. #-------------------------------------------------------------------- -eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" +eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +eval "TK_LIB_FILE=libtk${LIB_SUFFIX}" + +# tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed +# so that the backslashes quoting the DBX braces are dropped. + +# Trick to replace DBGX with TK_DBGX +DBGX='${TK_DBGX}' +eval "TK_LIB_FILE=${TK_LIB_FILE}" if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}" TCL_STUB_FLAGS="-DUSE_TCL_STUBS" -else - TCL_STUB_FLAGS="" fi -TK_LIB_FILE=libtk${LIB_SUFFIX} -eval "TK_LIB_FILE=${TK_LIB_FILE}" + +TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +PRIVATE_INCLUDE_DIR='$(includedir)' +HTML_DIR='$(DISTDIR)/html' +TK_PKG_DIR='tk$(VERSION)$(TK_DBGX)' +TK_RSRC_FILE='tk$(VERSION).rsrc' +WISH_RSRC_FILE='wish$(VERSION).rsrc' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. -if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then - if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}" - else - eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}" +if test "`uname -s`" = "Darwin" ; then + SC_ENABLE_FRAMEWORK + TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' +fi + +if test "$FRAMEWORK_BUILD" = "1" ; then + AC_DEFINE(TK_FRAMEWORK) + tk_config_files="${tk_config_files} [Tk-Info.plist:../macosx/Tk-Info.plist.in]" + # Construct a fake local framework structure to make linking with + # '-framework Tk' and running of tktest work + AC_OUTPUT_COMMANDS([n=Tk && echo "creating $n.framework" && + f=$n.framework && v=Versions/$VERSION && + rm -rf $f && mkdir -p $f/$v/Resources && + ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && + ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && + if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && + unset n f v + ], VERSION=${TK_VERSION} && tk_aqua=${tk_aqua}) + LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" + if test "${libdir}" = '${exec_prefix}/lib'; then + # override libdir default + libdir="/Library/Frameworks" + fi + TK_LIB_FILE="Tk" + TK_LIB_FLAG="-framework Tk" + TK_BUILD_LIB_SPEC="-F`pwd` -framework Tk" + TK_LIB_SPEC="-F${libdir} -framework Tk" + libdir="${libdir}/Tk.framework/Versions/\${VERSION}" + TK_LIBRARY="${libdir}/Resources/Scripts" + TK_PKG_DIR="Resources/Scripts" + TK_RSRC_FILE="Tk.rsrc" + WISH_RSRC_FILE="Wish.rsrc" + includedir="${libdir}/Headers" + PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" + HTML_DIR="${libdir}/Resources/Documentation/Reference/Tk" + EXTRA_INSTALL="install-private-headers html-tk" + EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TkTOC.html' + EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + if test $tk_aqua = yes; then + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' + bindir="${libdir}/Resources/Wish.app/Contents/MacOS" + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "'\$\(MAC\_OSX_DIR\)'/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' fi - TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" - TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" - TK_BUILD_EXP_FILE="" - TK_EXP_FILE="" + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" "$(STUB_LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done' + TK_YEAR="`date +%Y`" + # Don't use AC_DEFINE for the following as the framework version define + # needs to go into the Makefile even when using autoheader, so that we + # can pick up a potential make override of VERSION. Also, don't put this + # into CFLAGS as it should not go into tkConfig.sh + EXTRA_CC_SWITCHES='-DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' else - TK_BUILD_EXP_FILE="lib.exp" - eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" - - if test "$GCC" = "yes" ; then - TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" - TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + # libdir must be a fully qualified path and not ${exec_prefix}/lib + eval libdir="$libdir" + if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then + if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}" + else + eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}" + fi + TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" else - TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" - TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + TK_BUILD_EXP_FILE="lib.exp" + eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" + + if test "$GCC" = "yes" ; then + TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" + TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + else + TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" + TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + fi + fi +fi + +# Support for building the Aqua resource files +if test $tk_aqua = yes; then + tk_config_files="${tk_config_files} [Wish-Info.plist:../macosx/Wish-Info.plist.in]" + EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' + LIB_RSRC_FILE='${TK_RSRC_FILE}' + APP_RSRC_FILE='${WISH_RSRC_FILE}' + REZ=/Developer/Tools/Rez + REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF' + if test "$SHARED_BUILD" = 0; then + EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) $(LIB_INSTALL_DIR)' + TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd`/\${TK_RSRC_FILE}" + TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}" + elif test "$FRAMEWORK_BUILD" = "0"; then + TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}" fi fi -TK_SHARED_BUILD=${SHARED_BUILD} #-------------------------------------------------------------------- -# The statements below define various symbols relating to creating -# the stub'd version of the Tk library -# -# For now, linking to Tcl stubs is not supported with Tk. It causes -# too many problems with linking. When Tk is a fully loadable -# extension, linking the the Tcl stubs will be supported. +# The statements below define various symbols relating to Tk +# stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" +eval "TK_STUB_LIB_DIR=${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}\${TK_DBGX}" @@ -407,43 +516,66 @@ else fi TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" -TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" -TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" -eval "TK_LIB_FILE=${TK_LIB_FILE}" +#------------------------------------------------------------------------ +# tkConfig.sh refers to this by a different name +#------------------------------------------------------------------------ + +TK_SHARED_BUILD=${SHARED_BUILD} AC_SUBST(TK_VERSION) AC_SUBST(TK_MAJOR_VERSION) AC_SUBST(TK_MINOR_VERSION) AC_SUBST(TK_PATCH_LEVEL) -AC_SUBST(TK_DBGX) +AC_SUBST(TK_YEAR) +AC_SUBST(TK_LIB_FILE) +AC_SUBST(TK_LIB_FLAG) +AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) -AC_SUBST(TK_BUILD_STUB_LIB_SPEC) AC_SUBST(TK_STUB_LIB_SPEC) -AC_SUBST(TK_BUILD_STUB_LIB_PATH) AC_SUBST(TK_STUB_LIB_PATH) -AC_SUBST(TK_STUB_FLAGS) -AC_SUBST(TK_BUILD_EXP_FILE) -AC_SUBST(TK_EXP_FILE) +AC_SUBST(TK_BUILD_STUB_LIB_SPEC) +AC_SUBST(TK_BUILD_STUB_LIB_PATH) -AC_SUBST(TCL_STUB_FLAGS) -AC_SUBST(TK_BUILD_EXP_FILE) -AC_SUBST(TK_EXP_FILE) +AC_SUBST(TK_SRC_DIR) +AC_SUBST(TK_DBGX) +AC_SUBST(TK_SHARED_BUILD) AC_SUBST(LD_LIBRARY_PATH_VAR) -AC_SUBST(MATH_LIBS) AC_SUBST(TK_BUILD_LIB_SPEC) -AC_SUBST(TK_LIB_FILE) -AC_SUBST(TK_LIB_FLAG) -AC_SUBST(TK_LIB_SPEC) -AC_SUBST(TK_SRC_DIR) +AC_SUBST(TK_BUILD_EXP_FILE) +AC_SUBST(TK_EXP_FILE) + +AC_SUBST(TCL_STUB_FLAGS) +AC_SUBST(MATH_LIBS) AC_SUBST(XINCLUDES) AC_SUBST(XLIBSW) -AC_SUBST(TK_SHARED_BUILD) AC_SUBST(LOCALES) -AC_OUTPUT(Makefile tkConfig.sh) +AC_SUBST(TK_WINDOWINGSYSTEM) +AC_SUBST(TK_PKG_DIR) +AC_SUBST(TK_LIBRARY) +AC_SUBST(PRIVATE_INCLUDE_DIR) +AC_SUBST(HTML_DIR) + +AC_SUBST(EXTRA_CC_SWITCHES) +AC_SUBST(EXTRA_INSTALL) +AC_SUBST(EXTRA_INSTALL_BINARIES) +AC_SUBST(EXTRA_BUILD_HTML) +AC_SUBST(EXTRA_WISH_LIBS) + +AC_SUBST(TK_RSRC_FILE) +AC_SUBST(WISH_RSRC_FILE) +AC_SUBST(LIB_RSRC_FILE) +AC_SUBST(APP_RSRC_FILE) +AC_SUBST(REZ) +AC_SUBST(REZ_FLAGS) + +tk_config_files="${tk_config_files} [Makefile tkConfig.sh]" +AC_OUTPUT([${tk_config_files}]) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 73fb065..fc91c3d 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1391,8 +1391,6 @@ dnl AC_CHECK_TOOL(AR, ar) LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" PLAT_OBJS=\$\(MAC\_OSX_OBJS\) PLAT_SRCS=\$\(MAC\_OSX_SRCS\) - TCL_SHLIB_LD_EXTRAS='-compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000' - TK_SHLIB_LD_EXTRAS=' -compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' AC_MSG_CHECKING([whether to use CoreFoundation]) AC_ARG_ENABLE(corefoundation, [ --enable-corefoundation use CoreFoundation API [--enable-corefoundation]], [tcl_corefoundation=$enableval], [tcl_corefoundation=yes]) @@ -1415,6 +1413,7 @@ dnl AC_CHECK_TOOL(AR, ar) AC_DEFINE(MAC_OSX_TCL) AC_DEFINE(USE_VFORK) AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8") + AC_DEFINE(TCL_LOAD_FROM_MEMORY) # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232: AC_CHECK_FUNC(realpath) diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index 825b0c1..2fae9cf 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixInit.c,v 1.5 2002/01/25 21:09:37 dgp Exp $ + * RCS: @(#) $Id: tkUnixInit.c,v 1.5.2.1 2005/05/24 04:21:34 das Exp $ */ #include "tkInt.h" @@ -21,6 +21,11 @@ */ #include "tkInitScript.h" +#ifdef HAVE_COREFOUNDATION +static int MacOSXGetLibraryPath _ANSI_ARGS_(( + Tcl_Interp *interp)); +#endif /* HAVE_COREFOUNDATION */ + /* *---------------------------------------------------------------------- @@ -45,6 +50,9 @@ TkpInit(interp) Tcl_Interp *interp; { TkCreateXEventSource(); +#ifdef HAVE_COREFOUNDATION + MacOSXGetLibraryPath(interp); +#endif /* HAVE_COREFOUNDATION */ return Tcl_Eval(interp, initScript); } @@ -115,3 +123,38 @@ TkpDisplayWarning(msg, title) Tcl_WriteChars(errChannel, "\n", 1); } } + +/* + *---------------------------------------------------------------------- + * + * MacOSXGetLibraryPath -- + * + * If we have a bundle structure for the Tk installation, + * then check there first to see if we can find the libraries + * there. + * + * Results: + * TCL_OK if we have found the tk library; TCL_ERROR otherwise. + * + * Side effects: + * Same as for Tcl_MacOSXOpenVersionedBundleResources. + * + *---------------------------------------------------------------------- + */ + +#ifdef HAVE_COREFOUNDATION +static int +MacOSXGetLibraryPath(Tcl_Interp *interp) +{ + int foundInFramework = TCL_ERROR; +#ifdef TK_FRAMEWORK + char tkLibPath[PATH_MAX + 1]; + foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp, + "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX, tkLibPath); + if (tkLibPath[0] != '\0') { + Tcl_SetVar(interp, "tk_library", tkLibPath, TCL_GLOBAL_ONLY); + } +#endif + return foundInFramework; +} +#endif /* HAVE_COREFOUNDATION */ |