From 472701c8e65c0becd4620bce71070564d0569287 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 20 Jul 2006 06:25:18 +0000 Subject: * macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support * unix/tkUnixSend.c (Tk_GetUserInactiveTime): for weakly importing symbols not available on OSX 10.2 or 10.3, enables binaires built on later OSX versions to run on earlier ones. * macosx/Wish.xcodeproj/project.pbxproj: enable weak-linking; turn on extra warnings. * macosx/README: document how to enable weak-linking; cleanup. * unix/configure.in: add check on Darwin-X11 for ld support of -weak-l * unix/tcl.m4: flag and weak-link libXss if possible as it is not available before OSX 10.4; enforce requirement of OSX 10.2 for TkAqua; move Darwin specific checks & defines that are only relevant to the tcl build out of tcl.m4; restrict framework option to Darwin; cleanup quoting and help messages. * unix/configure: autoconf-2.59 * unix/tkConfig.h.in: autoheader-2.59 * macosx/GNUmakefile: enable xft for TkX11 build. * macosx/tkMacOSXFont.c (TkMacOSXQuarzStartDraw, TkMacOSXQuarzEndDraw): verify validity of context returned from QDBeginCGContext() before use. * macosx/tkMacOSXKeyEvent.c: ifdef out diagnostic messages to stderr. * macosx/tkMacOSXEvent.h: standardize MAC_OS_X_VERSION_MAX_ALLOWED * macosx/tkMacOSXMenu.c: checks per QA1316, ensure define can be * macosx/tkMacOSXMenubutton.c: overriden on command line (from default * macosx/tkMacOSXMenus.c: of current OS version). * macosx/tkMacOSXMouseEvent.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): fix signed-with-unsigned comparison and other warnings from gcc4 -Wextra. --- ChangeLog | 38 ++ macosx/GNUmakefile | 3 +- macosx/README | 37 +- macosx/Wish.xcodeproj/project.pbxproj | 31 +- macosx/tkMacOSXEvent.h | 7 +- macosx/tkMacOSXFont.c | 110 ++-- macosx/tkMacOSXKeyEvent.c | 19 +- macosx/tkMacOSXMenu.c | 5 +- macosx/tkMacOSXMenubutton.c | 5 +- macosx/tkMacOSXMenus.c | 5 +- macosx/tkMacOSXMouseEvent.c | 5 +- macosx/tkMacOSXWm.c | 52 +- unix/configure | 1038 +++++++-------------------------- unix/configure.in | 74 ++- unix/tcl.m4 | 103 ++-- unix/tkConfig.h.in | 26 +- unix/tkUnix.c | 8 +- unix/tkUnixSend.c | 4 +- 18 files changed, 496 insertions(+), 1074 deletions(-) diff --git a/ChangeLog b/ChangeLog index 415a0f6..a9f4d3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +2006-07-20 Daniel Steffen + + * macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support + * unix/tkUnixSend.c (Tk_GetUserInactiveTime): for weakly + importing symbols not available on OSX 10.2 or 10.3, enables binaires + built on later OSX versions to run on earlier ones. + * macosx/Wish.xcodeproj/project.pbxproj: enable weak-linking; turn on + extra warnings. + * macosx/README: document how to enable weak-linking; cleanup. + * unix/configure.in: add check on Darwin-X11 for ld support of -weak-l + * unix/tcl.m4: flag and weak-link libXss if possible as it is not + available before OSX 10.4; enforce requirement of OSX 10.2 for TkAqua; + move Darwin specific checks & defines that are only relevant to the tcl + build out of tcl.m4; restrict framework option to Darwin; cleanup + quoting and help messages. + * unix/configure: autoconf-2.59 + * unix/tkConfig.h.in: autoheader-2.59 + + * macosx/GNUmakefile: enable xft for TkX11 build. + * macosx/tkMacOSXFont.c (TkMacOSXQuarzStartDraw, TkMacOSXQuarzEndDraw): + verify validity of context returned from QDBeginCGContext() before use. + * macosx/tkMacOSXKeyEvent.c: ifdef out diagnostic messages to stderr. + + * macosx/tkMacOSXEvent.h: standardize MAC_OS_X_VERSION_MAX_ALLOWED + * macosx/tkMacOSXMenu.c: checks per QA1316, ensure define can be + * macosx/tkMacOSXMenubutton.c: overriden on command line (from default + * macosx/tkMacOSXMenus.c: of current OS version). + * macosx/tkMacOSXMouseEvent.c: + * macosx/tkMacOSXWm.c: + + * generic/tkImgGIF.c (ReadImage): + * macosx/tkMacOSXCursor.c (TkMacOSXCursor): + * macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol): + * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): + * macosx/tkMacOSXInit.c (Map): + * xlib/xgc.c (XCreateGC): fix signed-with-unsigned comparison and other + warnings from gcc4 -Wextra. + 2006-07-14 Andreas Kupries * generic/tkWindow.c (Initialize): Modify change of 2006-05-25 diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 123efd4..ce9d159 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -4,7 +4,7 @@ # 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: GNUmakefile,v 1.4 2006/04/12 00:58:41 das Exp $ +# RCS: @(#) $Id: GNUmakefile,v 1.5 2006/07/20 06:25:18 das Exp $ # ######################################################################################################## @@ -117,6 +117,7 @@ export CPPROG := cp -p ifeq (${TK_X11},) override CONFIGURE_ARGS := ${CONFIGURE_ARGS} --enable-aqua else +override CONFIGURE_ARGS := ${CONFIGURE_ARGS} --enable-xft VERSION := ${VERSION}-X11 wish := ${wish}-X11 endif diff --git a/macosx/README b/macosx/README index 15b9a12..511ece3 100644 --- a/macosx/README +++ b/macosx/README @@ -1,7 +1,7 @@ Tcl/Tk Mac OS X README ---------------------- -RCS: @(#) $Id: README,v 1.17 2006/04/11 10:19:51 das Exp $ +RCS: @(#) $Id: README,v 1.18 2006/07/20 06:25:19 das Exp $ This is the README file for the Mac OS X/Darwin version of Tcl/Tk. @@ -43,9 +43,12 @@ TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem]. required to run TkAqua. However OS X 10.3 or higher is recommended (certain [file] operations behave incorrectly on earlier releases). -- Tcl/Tk built on Mac OS X 10.x will not run on 10.y for y < x, on the other -hand Tcl/Tk built on 10.y will run on 10.x for y < x (but without any of the -fixes and optimizations that would be available in a binary built on 10.x). +- Unless weak-linking is used, Tcl/Tk built on Mac OS X 10.x will not run on +10.y with y < x; on the other hand Tcl/Tk built on 10.y will always run on 10.x +with y <= x (but without any of the fixes and optimizations that would be +available in a binary built on 10.x). +Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl/Tk +built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2). - Wish checks the Resources/Scripts directory in its application bundle for a file called AppMain.tcl, if found it is used as the startup script and the @@ -158,11 +161,10 @@ tcl/macosx and tk/macosx (see below for details), but can also be built with the standard unix configure and make buildsystem in tcl/unix resp. tk/unix as on any other unix platform (indeed, the Makefiles are just wrappers around the unix buildsystem). -The Mac OS X specifc configure flags are --enable-aqua, --enable-framework and +The Mac OS X specific configure flags are --enable-aqua, --enable-framework and --disable-corefoundation (which disables CF and notably reverts to the standard -select based notifier, you will only need this if your require use of naked fork -(i.e. not followed by execve) in an unthreaded core). Note that --enable-aqua is -incompatible with --disable-corefoundation (for both Tcl and Tk configure). +select based notifier). Note that --enable-aqua is incompatible with +--disable-corefoundation (for both Tcl and Tk configure). - It is also possible to build with Apple's IDE via the projects in tk/macosx, take care to only use the project matching your DevTools and OS version: @@ -199,7 +201,7 @@ Notes about the native targets of the Xcode projects: export CFLAGS="-arch ppc -arch i386 \ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on -any of the architectures (on i386 DTKs, the -isysroot is not required). +any of the architectures (on intel Macs, the -isysroot is not required). Note that it is not possible to configure correctly if the current architecture is not present in CFLAGS (i.e. -arch `arch` must always be there). Universal builds of Tk TEA extensions are also possible with CFLAGS set as @@ -209,7 +211,18 @@ TkX11 can be built with -arch ppc64 as the corresponding GUI libraries are not available for 64bit at present. However, linking a universal 'ppc i386' Tk binary against a universal 'ppc ppc64 i386' Tcl binary works just fine. The Tk configure script automatically removes '-arch ppc64' from CFLAGS to -facilitate universal building of both Tcl and Tk with the same CFLAGS setting. +facilitate universal building of both Tcl and Tk with the same CFLAGS setting; +the same happens with configure in Tk extensions based on TEA 3.5 or later. + +- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable +to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g: + export MACOSX_DEPLOYMENT_TARGET=10.2 +This requires Mac OS X 10.2 and gcc 3.1; if you have gcc 4 or later you can set +CFLAGS instead: + export CFLAGS="-mmacosx-version-min=10.2" +The Wish.xcodeproj is setup to produce binaires that can run on 10.2 or later, +except for the 'ReleaseUniversal'configuration, where they require 10.4. +Support for weak-linking was added to the code for 8.4.14/8.5a5. Detailed Instructions for building with macosx/Makefile ------------------------------------------------------- @@ -250,8 +263,8 @@ instead by passing an INSTALL_ROOT argument to make: - The default Makefile targets will build _both_ debug and optimized versions of the Tcl and Tk frameworks with the standard convention of naming the debug library Tcl.framework/Tcl_debug resp. Tk.framework/Tk_debug. -This allows you to dynamically link to the debug libraries at runtime by setting - setenv DYLD_IMAGE_SUFFIX _debug +This allows switching to the debug libraries at runtime by setting + export DYLD_IMAGE_SUFFIX=_debug (c.f. man dyld for more details) If you only want to build and install the debug or optimized build, use the diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 1cf376e..1e0e2bd 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -3354,7 +3354,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-/usr/bin/autoconf} && ${AUTOHEADER:-/usr/bin/autoheader}\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; + shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-/usr/bin/autoconf} && ${AUTOHEADER:-/usr/bin/autoheader}\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; }; F9A5C5F608F651AB008AE941 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -3373,7 +3373,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-/usr/bin/autoconf} && ${AUTOHEADER:-/usr/bin/autoheader}\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; + shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-/usr/bin/autoconf} && ${AUTOHEADER:-/usr/bin/autoheader}\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring tk\"\n \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; }; /* End PBXShellScriptBuildPhase section */ @@ -3708,7 +3708,6 @@ INCLUDEDIR = "${PREFIX}/include"; INSTALL_PATH = "${BINDIR}"; LIBDIR = "${PREFIX}/lib"; - MACOSX_DEPLOYMENT_TARGET = 10.4; MANDIR = "${PREFIX}/man"; OTHER_CFLAGS = ( "-imacros", @@ -3740,6 +3739,9 @@ WARNING_CFLAGS = ( "-Wall", "-Wno-implicit-int", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", ); ZERO_LINK = NO; }; @@ -3751,6 +3753,7 @@ CFLAGS = "-arch ppc -arch i386 -isysroot ${SDKROOT} -mmacosx-version-min=10.4"; CONFIGURE_ARGS = "--disable-symbols"; GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; + MACOSX_DEPLOYMENT_TARGET = 10.4; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = ReleaseUniversal; @@ -3842,7 +3845,6 @@ INCLUDEDIR = "${PREFIX}/include"; INSTALL_PATH = "${BINDIR}"; LIBDIR = "${PREFIX}/lib"; - MACOSX_DEPLOYMENT_TARGET = 10.4; MANDIR = "${PREFIX}/man"; OTHER_CFLAGS = ( "-imacros", @@ -3874,6 +3876,9 @@ WARNING_CFLAGS = ( "-Wall", "-Wno-implicit-int", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", ); ZERO_LINK = YES; }; @@ -3911,7 +3916,6 @@ INCLUDEDIR = "${PREFIX}/include"; INSTALL_PATH = "${BINDIR}"; LIBDIR = "${PREFIX}/lib"; - MACOSX_DEPLOYMENT_TARGET = 10.4; MANDIR = "${PREFIX}/man"; OTHER_CFLAGS = ( "-imacros", @@ -3943,6 +3947,9 @@ WARNING_CFLAGS = ( "-Wall", "-Wno-implicit-int", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", ); ZERO_LINK = NO; }; @@ -3981,7 +3988,6 @@ INCLUDEDIR = "${PREFIX}/include"; INSTALL_PATH = "${BINDIR}"; LIBDIR = "${PREFIX}/lib"; - MACOSX_DEPLOYMENT_TARGET = 10.4; MANDIR = "${PREFIX}/man"; OTHER_CFLAGS = ( "-imacros", @@ -4013,6 +4019,9 @@ WARNING_CFLAGS = ( "-Wall", "-Wno-implicit-int", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", ); ZERO_LINK = NO; }; @@ -4022,7 +4031,11 @@ isa = XCBuildConfiguration; buildSettings = { CONFIGURE_ARGS = "--enable-symbols"; - GCC_PREPROCESSOR_DEFINITIONS = "__private_extern__=extern"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__private_extern__=extern", + "DEBUG_ASSERT_PRODUCTION_CODE=0", + ); + MACOSX_DEPLOYMENT_TARGET = 10.2; }; name = Debug; }; @@ -4031,6 +4044,7 @@ buildSettings = { CONFIGURE_ARGS = "--disable-symbols"; GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; + MACOSX_DEPLOYMENT_TARGET = 10.2; }; name = Release; }; @@ -4038,7 +4052,8 @@ isa = XCBuildConfiguration; buildSettings = { CONFIGURE_ARGS = "--enable-symbols"; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "DEBUG_ASSERT_PRODUCTION_CODE=0"; + MACOSX_DEPLOYMENT_TARGET = 10.2; }; name = DebugNoFixZL; }; diff --git a/macosx/tkMacOSXEvent.h b/macosx/tkMacOSXEvent.h index 00f1963..9c5f583 100644 --- a/macosx/tkMacOSXEvent.h +++ b/macosx/tkMacOSXEvent.h @@ -50,7 +50,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.10 2006/04/28 06:02:48 das Exp $ + * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.11 2006/07/20 06:25:19 das Exp $ */ #ifndef _TKMACEVENT @@ -100,10 +100,9 @@ MODULE_SCOPE int TkMacOSXKeycodeToUnicode( MODULE_SCOPE OSStatus TkMacOSXStartTclEventLoopCarbonTimer(); MODULE_SCOPE OSStatus TkMacOSXStopTclEventLoopCarbonTimer(); -#if !defined(MAC_OS_X_VERSION_10_3) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 /* Define constants only available on Mac OS X 10.3 or later */ -enum { kEventAppAvailableWindowBoundsChanged = 110 }; +#define kEventAppAvailableWindowBoundsChanged 110 #endif #endif diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 403a903..280e649 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -35,7 +35,7 @@ * that such fonts can not be used for controls, because controls * definitely require a family id (this assertion needs testing). * - * RCS: @(#) $Id: tkMacOSXFont.c,v 1.18 2006/05/16 07:58:09 das Exp $ + * RCS: @(#) $Id: tkMacOSXFont.c,v 1.19 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" @@ -690,7 +690,7 @@ TkpMeasureCharsInContext( * also something we like to decide for ourself. */ - while ((offset > urstart) && (uchars[offset-1] == ' ')) { + while ((offset > (UniCharArrayOffset)urstart) && (uchars[offset-1] == ' ')) { offset--; } @@ -708,8 +708,8 @@ TkpMeasureCharsInContext( * forward. */ - if ((offset == urstart) || (uchars[offset] != ' ')) { - while ((offset < urend) + if ((offset == (UniCharArrayOffset)urstart) || (uchars[offset] != ' ')) { + while ((offset < (UniCharArrayOffset)urend) && (uchars[offset] != ' ')) { offset++; } @@ -721,12 +721,12 @@ TkpMeasureCharsInContext( * backward. */ - if ((offset != urend) && (uchars[offset] != ' ')) { - while ((offset > urstart) + if ((offset != (UniCharArrayOffset)urend) && (uchars[offset] != ' ')) { + while ((offset > (UniCharArrayOffset)urstart) && (uchars[offset-1] != ' ')) { offset--; } - while ((offset > urstart) + while ((offset > (UniCharArrayOffset)urstart) && (uchars[offset-1] == ' ')) { offset--; } @@ -735,7 +735,7 @@ TkpMeasureCharsInContext( } } - if (offset > urend) { + if (offset > (UniCharArrayOffset)urend) { offset = urend; } @@ -747,14 +747,14 @@ TkpMeasureCharsInContext( if ((err != kATSULineBreakInWord) && !(flags & TK_WHOLE_WORDS) - && (offset <= urend)) { + && (offset <= (UniCharArrayOffset)urend)) { UniCharArrayOffset lastOffset = offset; UniCharArrayOffset nextoffset; int lastX = -1; int wantonemorechar = -1; /* undecided */ - while (offset <= urend) { + while (offset <= (UniCharArrayOffset)urend) { if (flags & TK_ISOLATE_END) { TkMacOSXLayoutSetString(fontPtr, &drawingContext, @@ -778,7 +778,7 @@ TkpMeasureCharsInContext( if (wantonemorechar == -1) { wantonemorechar = ((flags & TK_AT_LEAST_ONE) - && (lastOffset == urstart)) + && (lastOffset == (UniCharArrayOffset)urstart)) || ((flags & TK_PARTIAL_OK) && (lastX != maxLength)) @@ -811,7 +811,7 @@ TkpMeasureCharsInContext( * into account. */ - if (offset >= urend) { + if (offset >= (UniCharArrayOffset)urend) { break; } nextoffset = 0; @@ -1103,44 +1103,50 @@ TkMacOSXQuarzStartDraw( err = QDBeginCGContext(destPort, &outContext); - /* - * Now clip the CG Context to the port. We also have to intersect our clip - * region with the port visible region so we don't overwrite the window - * decoration. - */ - - if (!clipRgn) { - clipRgn = NewRgn(); + if (err == noErr && outContext) { + /* + * Now clip the CG Context to the port. We also have to intersect our clip + * region with the port visible region so we don't overwrite the window + * decoration. + */ + + if (!clipRgn) { + clipRgn = NewRgn(); + } + + GetPortBounds(destPort, &boundsRect); + + RectRgn(clipRgn, &boundsRect); + SectRegionWithPortClipRegion(destPort, clipRgn); + SectRegionWithPortVisibleRegion(destPort, clipRgn); + ClipCGContextToRegion(outContext, &boundsRect, clipRgn); + SetEmptyRgn(clipRgn); + + /* + * Note: You have to call SyncCGContextOriginWithPort + * AFTER all the clip region manipulations. + */ + + SyncCGContextOriginWithPort(outContext, destPort); + + /* + * Scale the color values, as QD uses UInt16 with the range [0..2^16-1] + * while Quarz uses float with [0..1]. NB: Only + * CGContextSetRGBFillColor() seems to be actually used by ATSU. + */ + + GetForeColor(&macColor); + CGContextSetRGBFillColor(outContext, + RGBFLOATRED(macColor), + RGBFLOATGREEN(macColor), + RGBFLOATBLUE(macColor), + 1.0f); + #ifdef TK_MAC_DEBUG_FONTS + } else { + fprintf(stderr, "QDBeginCGContext(): Error %d\n", (int) err); + #endif } - GetPortBounds(destPort, &boundsRect); - - RectRgn(clipRgn, &boundsRect); - SectRegionWithPortClipRegion(destPort, clipRgn); - SectRegionWithPortVisibleRegion(destPort, clipRgn); - ClipCGContextToRegion(outContext, &boundsRect, clipRgn); - SetEmptyRgn(clipRgn); - - /* - * Note: You have to call SyncCGContextOriginWithPort - * AFTER all the clip region manipulations. - */ - - SyncCGContextOriginWithPort(outContext, destPort); - - /* - * Scale the color values, as QD uses UInt16 with the range [0..2^16-1] - * while Quarz uses float with [0..1]. NB: Only - * CGContextSetRGBFillColor() seems to be actually used by ATSU. - */ - - GetForeColor(&macColor); - CGContextSetRGBFillColor(outContext, - RGBFLOATRED(macColor), - RGBFLOATGREEN(macColor), - RGBFLOATBLUE(macColor), - 1.0f); - drawingContextPtr->graphPort = destPort; drawingContextPtr->cgContext = outContext; drawingContextPtr->portRect = boundsRect; @@ -1170,9 +1176,11 @@ void TkMacOSXQuarzEndDraw( DrawingContext * drawingContextPtr) { - QDEndCGContext( - drawingContextPtr->graphPort, - &drawingContextPtr->cgContext); + if (drawingContextPtr->cgContext) { + QDEndCGContext( + drawingContextPtr->graphPort, + &drawingContextPtr->cgContext); + } } #endif /* TK_MAC_USE_QUARZ */ diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 0201054..070c3d4 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -54,12 +54,18 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.15 2006/05/12 18:17:48 das Exp $ + * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.16 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" #include "tkMacOSXEvent.h" +/* +#ifdef TK_MAC_DEBUG +#define TK_MAC_DEBUG_KEYBOARD +#endif +*/ + typedef struct { WindowRef whichWindow; int global_x, global_y; @@ -563,8 +569,7 @@ InitKeyEvent( * duplicate enums and typedefs would give errrors. */ -#if !defined(MAC_OS_X_VERSION_10_2) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1020 #define KeyboardLayoutRef Ptr #define KeyboardLayoutPropertyTag UInt32 #define kKLKCHRData 0 @@ -643,7 +648,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr) if ((lastLayout != currentLayout) || (lastLayoutId != currentLayoutId)) { -#ifdef TK_MAC_DEBUG +#ifdef TK_MAC_DEBUG_KEYBOARD fprintf (stderr, "GetKeyboardLayout(): Use KLS\n"); #endif @@ -684,7 +689,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr) if ((lastLayout == NULL) || (lastLayoutId != currentLayoutId)) { -#ifdef TK_MAC_DEBUG +#ifdef TK_MAC_DEBUG_KEYBOARD fprintf (stderr, "GetKeyboardLayout(): Use GetResource()\n"); #endif @@ -719,7 +724,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr) if (hasLayoutChanged) { -#ifdef TK_MAC_DEBUG +#ifdef TK_MAC_DEBUG_KEYBOARD if (KCHR != NULL) { fprintf (stderr, "GetKeyboardLayout(): New 'KCHR' layout %d\n", (int) (short) currentLayoutId); @@ -747,7 +752,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr) if (KCHR != NULL) { lastEncoding = GetKCHREncoding(currentKeyScript, currentLayoutId); -#ifdef TK_MAC_DEBUG +#ifdef TK_MAC_DEBUG_KEYBOARD fprintf (stderr, "GetKeyboardLayout(): New 'KCHR' encoding %lu " "(%lu + 0x%lX)\n", lastEncoding, lastEncoding & 0xFFFFL, diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index b3c0f20..758d107 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.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: tkMacOSXMenu.c,v 1.29 2006/05/12 18:18:36 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.30 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" @@ -28,8 +28,7 @@ #endif */ -#if !defined(MAC_OS_X_VERSION_10_3) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 /* Define constants only available on Mac OS X 10.3 or later */ #define kMenuAttrDoNotUseUserCommandKeys (1 << 7) #endif diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c index 106df35..50f2ed5 100644 --- a/macosx/tkMacOSXMenubutton.c +++ b/macosx/tkMacOSXMenubutton.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: tkMacOSXMenubutton.c,v 1.10 2006/03/24 14:58:01 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenubutton.c,v 1.11 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" @@ -19,8 +19,7 @@ #include "tkMacOSXFont.h" #include "tkMacOSXDebug.h" -#if !defined(MAC_OS_X_VERSION_10_3) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 /* Define constants only available on Mac OS X 10.3 or later */ #define kMenuAttrDoNotUseUserCommandKeys (1 << 7) #endif diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index 7d5471f..1810f97 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -11,13 +11,12 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.13 2006/05/16 06:53:58 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.14 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" -#if !defined(MAC_OS_X_VERSION_10_3) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 /* Define constants only available on Mac OS X 10.3 or later */ #define kMenuAttrDoNotUseUserCommandKeys (1 << 7) #endif diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 6326ec5..59a03a8 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -54,15 +54,14 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.22 2006/04/28 06:02:49 das Exp $ + * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.23 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" #include "tkMacOSXEvent.h" #include "tkMacOSXDebug.h" -#if !defined(MAC_OS_X_VERSION_10_3) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 /* Define constants only available on Mac OS X 10.3 or later */ #define kEventParamWindowPartCode 'wpar' #define typeWindowPartCode 'wpar' diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index b8fcd3f..628fbfb 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.35 2006/05/16 07:37:17 das Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.36 2006/07/20 06:25:19 das Exp $ */ #include "tkMacOSXInt.h" @@ -22,14 +22,12 @@ #include "tkMacOSXEvent.h" /* Define constants only available on Mac OS X 10.3 or later */ -#if !defined(MAC_OS_X_VERSION_10_3) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 #define kSimpleWindowClass 18 #define kWindowDoesNotCycleAttribute (1L << 15) #endif /* Define constants only available on Mac OS X 10.4 or later */ -#if !defined(MAC_OS_X_VERSION_10_4) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040 #define kWindowNoTitleBarAttribute (1L << 9) #define kWindowMetalNoContentSeparatorAttribute (1L << 11) #endif @@ -880,17 +878,19 @@ Tcl_Obj *CONST objv[]; /* Argument objects. */ Boolean d; err = FSPathMakeRef((unsigned char*) path, &ref, &d); if (err == noErr) { -#if defined(MAC_OS_X_VERSION_10_4) && \ - (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) - err = HIWindowSetProxyFSRef(macWindow, &ref); -#else - AliasHandle alias; - err = FSNewAlias(NULL, &ref, &alias); - if (err == noErr) { - err = SetWindowProxyAlias(macWindow, alias); - DisposeHandle((Handle) alias); - } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 + if (HIWindowSetProxyFSRef != NULL) { + err = HIWindowSetProxyFSRef(macWindow, &ref); + } else #endif + { + AliasHandle alias; + err = FSNewAlias(NULL, &ref, &alias); + if (err == noErr) { + err = SetWindowProxyAlias(macWindow, alias); + DisposeHandle((Handle) alias); + } + } } } else { int len; @@ -1714,17 +1714,19 @@ Tcl_Obj *CONST objv[]; /* Argument objects. */ } macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window)); if (len) { -#if defined(MAC_OS_X_VERSION_10_4) && \ - (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) - err = HIWindowSetProxyFSRef(macWindow, &ref); -#else - AliasHandle alias; - err = FSNewAlias(NULL, &ref, &alias); - if (err == noErr) { - err = SetWindowProxyAlias(macWindow, alias); - DisposeHandle((Handle) alias); - } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 + if (HIWindowSetProxyFSRef != NULL) { + err = HIWindowSetProxyFSRef(macWindow, &ref); + } else #endif + { + AliasHandle alias; + err = FSNewAlias(NULL, &ref, &alias); + if (err == noErr) { + err = SetWindowProxyAlias(macWindow, alias); + DisposeHandle((Handle) alias); + } + } } else { err = RemoveWindowProxy(macWindow); if (wmPtr->hints.icon_pixmap != None) { diff --git a/unix/configure b/unix/configure index b1afd00..a24ea16 100755 --- a/unix/configure +++ b/unix/configure @@ -856,13 +856,12 @@ Optional Features: --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) - --enable-corefoundation use CoreFoundation API on MacOSX (default: yes) - --disable-load disallow dynamic loading and "load" command - (default: enabled) + --enable-corefoundation use CoreFoundation API on MacOSX (default: on) + --enable-load allow dynamic loading and "load" command (default: + on) --enable-symbols build with debugging symbols (default: off) - --enable-aqua enable Aqua windowingsystem on Mac OS X (default: - off) - --enable-xft Use freetype/fontconfig/xft (default: off) + --enable-aqua use Aqua windowingsystem on Mac OS X (default: off) + --enable-xft use freetype/fontconfig/xft (default: off) --enable-framework package shared libraries in MacOSX frameworks (default: off) @@ -4162,7 +4161,8 @@ echo $ECHO_N "checking for pthread_attr_get_np declaration... $ECHO_C" >&6 if test "${tcl_cv_grep_pthread_attr_get_np+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4297,7 +4297,8 @@ echo $ECHO_N "checking for pthread_getattr_np declaration... $ECHO_C" >&6 if test "${tcl_cv_grep_pthread_getattr_np+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5552,711 +5553,19 @@ if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_search_paths_first=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_search_paths_first=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 -echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - PLAT_OBJS='${MAC_OSX_OBJS}' - PLAT_SRCS='${MAC_OSX_SRCS}' - echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5 -echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6 - # Check whether --enable-corefoundation or --disable-corefoundation was given. -if test "${enable_corefoundation+set}" = set; then - enableval="$enable_corefoundation" - tcl_corefoundation=$enableval -else - tcl_corefoundation=yes -fi; - echo "$as_me:$LINENO: result: $tcl_corefoundation" >&5 -echo "${ECHO_T}$tcl_corefoundation" >&6 - if test $tcl_corefoundation = yes; then - echo "$as_me:$LINENO: checking for CoreFoundation.framework" >&5 -echo $ECHO_N "checking for CoreFoundation.framework... $ECHO_C" >&6 -if test "${tcl_cv_lib_corefoundation+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_libs=$LIBS; hold_cflags=$CFLAGS - if test $do64bit_ok = no ; then - # remove -arch ppc64 from CFLAGS while testing presence - # of CF, otherwise all archs will have CF disabled. - # CF for ppc64 is disabled in tclUnixPort.h instead. - CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/'`" - fi - LIBS="$LIBS -framework CoreFoundation" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -CFBundleRef b = CFBundleGetMainBundle(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_lib_corefoundation=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_lib_corefoundation=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$hold_libs; CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5 -echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6 - if test $tcl_cv_lib_corefoundation = yes; then - LIBS="$LIBS -framework CoreFoundation" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_COREFOUNDATION 1 -_ACEOF - - -for ac_header in libkern/OSAtomic.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in OSSpinLockLock -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -for ac_func in pthread_atfork -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - fi - fi - -for ac_header in copyfile.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in copyfile -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +int i; ; return 0; } @@ -6283,105 +5592,64 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -cat >>confdefs.h <<\_ACEOF -#define MAC_OSX_TCL 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define USE_VFORK 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define TCL_DEFAULT_ENCODING "utf-8" -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE __private_extern__ -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define TCL_LOAD_FROM_MEMORY 1 -_ACEOF - - # prior to Darwin 7, realpath is not threadsafe, so don't - # use it when threads are enabled, c.f. bug # 711232: - echo "$as_me:$LINENO: checking for realpath" >&5 -echo $ECHO_N "checking for realpath... $ECHO_C" >&6 -if test "${ac_cv_func_realpath+set}" = set; then +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + PLAT_OBJS='${MAC_OSX_OBJS}' + PLAT_SRCS='${MAC_OSX_SRCS}' + echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5 +echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6 + # Check whether --enable-corefoundation or --disable-corefoundation was given. +if test "${enable_corefoundation+set}" = set; then + enableval="$enable_corefoundation" + tcl_corefoundation=$enableval +else + tcl_corefoundation=yes +fi; + echo "$as_me:$LINENO: result: $tcl_corefoundation" >&5 +echo "${ECHO_T}$tcl_corefoundation" >&6 + if test $tcl_corefoundation = yes; then + echo "$as_me:$LINENO: checking for CoreFoundation.framework" >&5 +echo $ECHO_N "checking for CoreFoundation.framework... $ECHO_C" >&6 +if test "${tcl_cv_lib_corefoundation+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + hold_libs=$LIBS; hold_cflags=$CFLAGS + if test $do64bit_ok = no ; then + # remove -arch ppc64 from CFLAGS while testing presence + # of CF, otherwise all archs will have CF disabled. + # CF for ppc64 is disabled in tclUnixPort.h instead. + CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/'`" + fi + LIBS="$LIBS -framework CoreFoundation" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define realpath to an innocuous variant, in case declares realpath. - For example, HP-UX 11i declares gettimeofday. */ -#define realpath innocuous_realpath - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char realpath (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef realpath - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char realpath (); -/* 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_realpath) || defined (__stub___realpath) -choke me -#else -char (*f) () = realpath; -#endif -#ifdef __cplusplus -} -#endif - +#include int main () { -return f != realpath; +CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } @@ -6408,23 +5676,40 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_realpath=yes + tcl_cv_lib_corefoundation=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_realpath=no +tcl_cv_lib_corefoundation=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS=$hold_libs; CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $ac_cv_func_realpath" >&5 -echo "${ECHO_T}$ac_cv_func_realpath" >&6 +echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5 +echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6 + if test $tcl_cv_lib_corefoundation = yes; then + LIBS="$LIBS -framework CoreFoundation" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_COREFOUNDATION 1 +_ACEOF - if test $ac_cv_func_realpath = yes -a "${TCL_THREADS}" = 1 \ - -a `uname -r | awk -F. '{print $1}'` -lt 7 ; then - ac_cv_func_realpath=no + else + tcl_corefoundation=no + fi fi + +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TCL 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE __private_extern__ +_ACEOF + ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -7996,7 +7281,8 @@ echo $ECHO_N "checking for fd_set in sys/types... $ECHO_C" >&6 if test "${tcl_cv_type_fd_set+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8051,7 +7337,8 @@ echo $ECHO_N "checking for fd_mask in sys/select... $ECHO_C" >&6 if test "${tcl_cv_grep_fd_mask+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8744,7 +8031,8 @@ echo $ECHO_N "checking pw_gecos in struct pwd... $ECHO_C" >&6 if test "${tcl_cv_pwd_pw_gecos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8805,6 +8093,8 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then + echo "$as_me:$LINENO: checking whether to use Aqua" >&5 +echo $ECHO_N "checking whether to use Aqua... $ECHO_C" >&6 # Check whether --enable-aqua or --disable-aqua was given. if test "${enable_aqua+set}" = set; then enableval="$enable_aqua" @@ -8813,21 +8103,90 @@ else tk_aqua=no fi; if test $tk_aqua = yes; then - if test $tcl_corefoundation = no; then - { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5 + if test $tcl_corefoundation = no; then + { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5 echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} - tk_aqua=no - elif test ! -d /System/Library/Frameworks/Carbon.framework; then - { echo "$as_me:$LINENO: WARNING: Aqua can only be used when Carbon is available" >&5 + tk_aqua=no + fi + if test ! -d /System/Library/Frameworks/Carbon.framework; then + { echo "$as_me:$LINENO: WARNING: Aqua can only be used when Carbon is available" >&5 echo "$as_me: WARNING: Aqua can only be used when Carbon is available" >&2;} - tk_aqua=no - fi + tk_aqua=no + fi + if test "`uname -r | awk -F. '{print $1}'`" -lt 6; then + { echo "$as_me:$LINENO: WARNING: Aqua requires Mac OS X 10.2 or later" >&5 +echo "$as_me: WARNING: Aqua requires Mac OS X 10.2 or later" >&2;} + tk_aqua=no + fi fi + echo "$as_me:$LINENO: result: $tk_aqua" >&5 +echo "${ECHO_T}$tk_aqua" >&6 if test $do64bit_ok = no ; then # remove -arch ppc64 from CFLAGS for fat builds as neither Aqua nor X11 # can be built for 64bit at present (no 64bit GUI libraries). CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`" fi + if test $tk_aqua = no; then + # check if weak linking whole libraries is possible. + echo "$as_me:$LINENO: checking if ld accepts -weak-l flag" >&5 +echo $ECHO_N "checking if ld accepts -weak-l flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_weak_l+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-weak-lm" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +double f = sin(1.0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_weak_l=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_weak_l=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_weak_l" >&5 +echo "${ECHO_T}$tcl_cv_ld_weak_l" >&6 + fi else tk_aqua=no fi @@ -9493,7 +8852,6 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES" tk_oldLibs=$LIBS @@ -9786,7 +9144,13 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6 if test $ac_cv_lib_Xss_XScreenSaverQueryInfo = yes; then - XLIBSW="$XLIBSW -lXss -lXext" + if test "$tcl_cv_ld_weak_l" = yes; then + # On Darwin, weak link libXss if possible, + # as it is only available on Tiger or later. + XLIBSW="$XLIBSW -weak-lXss -lXext" + else + XLIBSW="$XLIBSW -lXss -lXext" + fi xss_lib_found=yes fi @@ -9813,6 +9177,8 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then + echo "$as_me:$LINENO: checking whether to use xft" >&5 +echo $ECHO_N "checking whether to use xft... $ECHO_C" >&6 # Check whether --enable-xft or --disable-xft was given. if test "${enable_xft+set}" = set; then enableval="$enable_xft" @@ -9820,12 +9186,9 @@ if test "${enable_xft+set}" = set; then else enable_xft="no" fi; - XFT_CFLAGS="" XFT_LIBS="" if test "$enable_xft" = "yes" ; then - echo "$as_me:$LINENO: checking for xft configuration" >&5 -echo $ECHO_N "checking for xft configuration... $ECHO_C" >&6 XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || enable_xft="no" XFT_LIBS=`xft-config --libs 2>/dev/null` || enable_xft="no" if test "$enable_xft" = "no" ; then @@ -9833,14 +9196,13 @@ echo $ECHO_N "checking for xft configuration... $ECHO_C" >&6 XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || enable_xft="no" XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || enable_xft="no" fi - if test "$enable_xft" = "yes" ; then - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 - else + if test "$enable_xft" == "no" ; then { echo "$as_me:$LINENO: WARNING: Can't find xft configuration" >&5 echo "$as_me: WARNING: Can't find xft configuration" >&2;} fi fi + echo "$as_me:$LINENO: result: $enable_xft" >&5 +echo "${ECHO_T}$enable_xft" >&6 if test $enable_xft = "yes" ; then UNIX_FONT_OBJS=tkUnixRFont.o @@ -9854,7 +9216,6 @@ _ACEOF - fi #-------------------------------------------------------------------- @@ -9959,41 +9320,42 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc' if test "`uname -s`" = "Darwin" ; then - echo "$as_me:$LINENO: checking how to package libraries" >&5 + if test "`uname -s`" = "Darwin" ; then + echo "$as_me:$LINENO: checking how to package libraries" >&5 echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6 - # Check whether --enable-framework or --disable-framework was given. + # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then enableval="$enable_framework" - tcl_ok=$enableval + enable_framework=$enableval else - tcl_ok=no + enable_framework=no fi; - - if test "${enable_framework+set}" = set; then - enableval="$enable_framework" - tcl_ok=$enableval - else - tcl_ok=no - fi - - if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: framework" >&5 -echo "${ECHO_T}framework" >&6 - FRAMEWORK_BUILD=1 - if test "${SHARED_BUILD}" = "0" ; then - { echo "$as_me:$LINENO: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 + if test $enable_framework = yes; then + if test $SHARED_BUILD = 0; then + { echo "$as_me:$LINENO: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} - FRAMEWORK_BUILD=0 - fi - if test $tcl_corefoundation = no; then - { echo "$as_me:$LINENO: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 + enable_framework=no + fi + if test $tcl_corefoundation = no; then + { echo "$as_me:$LINENO: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} + enable_framework=no + fi + fi + if test $enable_framework = yes; then + echo "$as_me:$LINENO: result: framework" >&5 +echo "${ECHO_T}framework" >&6 + FRAMEWORK_BUILD=1 + else + if test $SHARED_BUILD = 1; then + echo "$as_me:$LINENO: result: shared library" >&5 +echo "${ECHO_T}shared library" >&6 + else + echo "$as_me:$LINENO: result: static library" >&5 +echo "${ECHO_T}static library" >&6 + fi FRAMEWORK_BUILD=0 fi - else - echo "$as_me:$LINENO: result: standard shared library" >&5 -echo "${ECHO_T}standard shared library" >&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)}'`" diff --git a/unix/configure.in b/unix/configure.in index a9a804c..8182d93 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.119 2006/05/04 14:11:50 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.120 2006/07/20 06:25:20 das Exp $ AC_INIT([tk],[8.5]) AC_PREREQ(2.59) @@ -177,14 +177,14 @@ fi # special flag. #-------------------------------------------------------------------- -AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, +AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [ AC_TRY_COMPILE([#include ],[fd_set readMask, writeMask;], - tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)) + tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)]) tk_ok=$tcl_cv_type_fd_set if test $tk_ok = no; then - AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, + AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [ AC_EGREP_HEADER(fd_mask, sys/select.h, - tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)) + tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)]) if test $tcl_cv_grep_fd_mask = present; then AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Should we include ?]) tk_ok=yes @@ -224,10 +224,10 @@ AC_TYPE_UID_T # In OS/390 struct pwd has no pw_gecos field #------------------------------------------- -AC_CACHE_CHECK([pw_gecos in struct pwd], tcl_cv_pwd_pw_gecos, +AC_CACHE_CHECK([pw_gecos in struct pwd], tcl_cv_pwd_pw_gecos, [ AC_TRY_COMPILE([#include ], [struct passwd pwd; pwd.pw_gecos;], - tcl_cv_pwd_pw_gecos=yes, tcl_cv_pwd_pw_gecos=no)) + tcl_cv_pwd_pw_gecos=yes, tcl_cv_pwd_pw_gecos=no)]) if test $tcl_cv_pwd_pw_gecos = yes; then AC_DEFINE(HAVE_PW_GECOS, 1, [Does struct password have a pw_gecos field?]) fi @@ -237,24 +237,40 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then + AC_MSG_CHECKING([whether to use Aqua]) AC_ARG_ENABLE(aqua, - AC_HELP_STRING([--enable-aqua], - [enable Aqua windowingsystem on Mac OS X (default: off)]), - [tk_aqua=$enableval], [tk_aqua=no]) + AC_HELP_STRING([--enable-aqua], + [use Aqua windowingsystem on Mac OS X (default: off)]), + [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 + if test $tcl_corefoundation = no; then + AC_MSG_WARN([Aqua can only be used when CoreFoundation is available]) + tk_aqua=no + fi + if test ! -d /System/Library/Frameworks/Carbon.framework; then + AC_MSG_WARN([Aqua can only be used when Carbon is available]) + tk_aqua=no + fi + if test "`uname -r | awk -F. '{print [$]1}'`" -lt 6; then + AC_MSG_WARN([Aqua requires Mac OS X 10.2 or later]) + tk_aqua=no + fi fi + AC_MSG_RESULT([$tk_aqua]) if test $do64bit_ok = no ; then # remove -arch ppc64 from CFLAGS for fat builds as neither Aqua nor X11 # can be built for 64bit at present (no 64bit GUI libraries). CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`" fi + if test $tk_aqua = no; then + # check if weak linking whole libraries is possible. + AC_CACHE_CHECK([if ld accepts -weak-l flag], tcl_cv_ld_weak_l, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-weak-lm" + AC_TRY_LINK([#include ], [double f = sin(1.0);], + tcl_cv_ld_weak_l=yes, tcl_cv_ld_weak_l=no) + LDFLAGS=$hold_ldflags]) + fi else tk_aqua=no fi @@ -368,7 +384,6 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES" tk_oldLibs=$LIBS @@ -384,7 +399,13 @@ if test $tk_aqua = no; then xss_lib_found=yes ], [ AC_CHECK_LIB(Xss,XScreenSaverQueryInfo, [ - XLIBSW="$XLIBSW -lXss -lXext" + if test "$tcl_cv_ld_weak_l" = yes; then + # On Darwin, weak link libXss if possible, + # as it is only available on Tiger or later. + XLIBSW="$XLIBSW -weak-lXss -lXext" + else + XLIBSW="$XLIBSW -lXss -lXext" + fi xss_lib_found=yes ],, -lXext) ]) @@ -401,15 +422,14 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then + AC_MSG_CHECKING([whether to use xft]) AC_ARG_ENABLE(xft, - AC_HELP_STRING([--enable-xft],[Use freetype/fontconfig/xft (default: off)]), - [enable_xft=$enableval], - [enable_xft="no"]) - + AC_HELP_STRING([--enable-xft], + [use freetype/fontconfig/xft (default: off)]), + [enable_xft=$enableval], [enable_xft="no"]) XFT_CFLAGS="" XFT_LIBS="" if test "$enable_xft" = "yes" ; then - AC_MSG_CHECKING([for xft configuration]) XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || enable_xft="no" XFT_LIBS=`xft-config --libs 2>/dev/null` || enable_xft="no" if test "$enable_xft" = "no" ; then @@ -417,19 +437,17 @@ if test $tk_aqua = no; then XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || enable_xft="no" XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || enable_xft="no" fi - if test "$enable_xft" = "yes" ; then - AC_MSG_RESULT([ok]) - else + if test "$enable_xft" == "no" ; then AC_MSG_WARN([Can't find xft configuration]) fi fi + AC_MSG_RESULT([$enable_xft]) if test $enable_xft = "yes" ; then UNIX_FONT_OBJS=tkUnixRFont.o AC_DEFINE(HAVE_XFT, 1, [Have we turned on XFT (antialiased fonts)?]) else UNIX_FONT_OBJS=tkUnixFont.o fi - AC_SUBST(XFT_CFLAGS) AC_SUBST(XFT_LIBS) AC_SUBST(UNIX_FONT_OBJS) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3b2e228..e009b9b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -560,33 +560,33 @@ AC_DEFUN([SC_ENABLE_SHARED], [ #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_FRAMEWORK], [ - AC_MSG_CHECKING([how to package libraries]) - AC_ARG_ENABLE(framework, - AC_HELP_STRING([--enable-framework], - [package shared libraries in MacOSX frameworks (default: off)]), - [tcl_ok=$enableval], [tcl_ok=no]) - - if test "${enable_framework+set}" = set; then - enableval="$enable_framework" - tcl_ok=$enableval - else - tcl_ok=no - fi - - if test "$tcl_ok" = "yes" ; then - AC_MSG_RESULT([framework]) - FRAMEWORK_BUILD=1 - if test "${SHARED_BUILD}" = "0" ; then - AC_MSG_WARN([Frameworks can only be built if --enable-shared is yes]) - FRAMEWORK_BUILD=0 + if test "`uname -s`" = "Darwin" ; then + AC_MSG_CHECKING([how to package libraries]) + AC_ARG_ENABLE(framework, + AC_HELP_STRING([--enable-framework], + [package shared libraries in MacOSX frameworks (default: off)]), + [enable_framework=$enableval], [enable_framework=no]) + if test $enable_framework = yes; then + if test $SHARED_BUILD = 0; then + AC_MSG_WARN([Frameworks can only be built if --enable-shared is yes]) + enable_framework=no + fi + if test $tcl_corefoundation = no; then + AC_MSG_WARN([Frameworks can only be used when CoreFoundation is available]) + enable_framework=no + fi fi - if test $tcl_corefoundation = no; then - AC_MSG_WARN([Frameworks can only be used when CoreFoundation is available]) + if test $enable_framework = yes; then + AC_MSG_RESULT([framework]) + FRAMEWORK_BUILD=1 + else + if test $SHARED_BUILD = 1; then + AC_MSG_RESULT([shared library]) + else + AC_MSG_RESULT([static library]) + fi FRAMEWORK_BUILD=0 fi - else - AC_MSG_RESULT([standard shared library]) - FRAMEWORK_BUILD=0 fi ]) @@ -683,10 +683,10 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1, [Do we want a BSD-like thread-attribute interface?]) AC_CACHE_CHECK([for pthread_attr_get_np declaration], - tcl_cv_grep_pthread_attr_get_np, + tcl_cv_grep_pthread_attr_get_np, [ AC_EGREP_HEADER(pthread_attr_get_np, pthread.h, tcl_cv_grep_pthread_attr_get_np=present, - tcl_cv_grep_pthread_attr_get_np=missing)) + tcl_cv_grep_pthread_attr_get_np=missing)]) if test $tcl_cv_grep_pthread_attr_get_np = missing ; then AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1, [Is pthread_attr_get_np() declared in ?]) @@ -697,10 +697,10 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1, [Do we want a Linux-like thread-attribute interface?]) AC_CACHE_CHECK([for pthread_getattr_np declaration], - tcl_cv_grep_pthread_getattr_np, + tcl_cv_grep_pthread_getattr_np, [ AC_EGREP_HEADER(pthread_getattr_np, pthread.h, tcl_cv_grep_pthread_getattr_np=present, - tcl_cv_grep_pthread_getattr_np=missing)) + tcl_cv_grep_pthread_getattr_np=missing)]) if test $tcl_cv_grep_pthread_getattr_np = missing ; then AC_DEFINE(GETATTRNP_NOT_DECLARED, 1, [Is pthread_getattr_np declared in ?]) @@ -1596,7 +1596,7 @@ dnl AC_CHECK_TOOL(AR, ar) AC_MSG_CHECKING([whether to use CoreFoundation]) AC_ARG_ENABLE(corefoundation, AC_HELP_STRING([--enable-corefoundation], - [use CoreFoundation API on MacOSX (default: yes)]), + [use CoreFoundation API on MacOSX (default: on)]), [tcl_corefoundation=$enableval], [tcl_corefoundation=yes]) AC_MSG_RESULT([$tcl_corefoundation]) if test $tcl_corefoundation = yes; then @@ -1616,29 +1616,14 @@ dnl AC_CHECK_TOOL(AR, ar) if test $tcl_cv_lib_corefoundation = yes; then LIBS="$LIBS -framework CoreFoundation" AC_DEFINE(HAVE_COREFOUNDATION, 1, - [Do we have access to Darwin CoreFoundation.framework ?]) - AC_CHECK_HEADERS(libkern/OSAtomic.h) - AC_CHECK_FUNCS(OSSpinLockLock) - AC_CHECK_FUNCS(pthread_atfork) + [Do we have access to Darwin CoreFoundation.framework?]) + else + tcl_corefoundation=no fi fi - AC_CHECK_HEADERS(copyfile.h) - AC_CHECK_FUNCS(copyfile) AC_DEFINE(MAC_OSX_TCL, 1, [Is this a Mac I see before me?]) - AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?]) - AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8", - [Are we to override what our default encoding is?]) AC_DEFINE(MODULE_SCOPE, __private_extern__, [Linker support for module scope symbols]) - AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1, - [Can this platform load code from memory?]) - # prior to Darwin 7, realpath is not threadsafe, so don't - # use it when threads are enabled, c.f. bug # 711232: - AC_CHECK_FUNC(realpath) - if test $ac_cv_func_realpath = yes -a "${TCL_THREADS}" = 1 \ - -a `uname -r | awk -F. '{print [$]1}'` -lt 7 ; then - ac_cv_func_realpath=no - fi ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -1912,8 +1897,8 @@ dnl AC_CHECK_TOOL(AR, ar) # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, - AC_HELP_STRING([--disable-load], - [disallow dynamic loading and "load" command (default: enabled)]), + AC_HELP_STRING([--enable-load], + [allow dynamic loading and "load" command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" @@ -2202,7 +2187,7 @@ int main() { #-------------------------------------------------------------------- AC_DEFUN([SC_MISSING_POSIX_HEADERS], [ - AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE @@ -2222,7 +2207,7 @@ d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); -], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)) +], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) if test $tcl_cv_dirent_h = no; then AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) @@ -2416,16 +2401,16 @@ AC_DEFUN([SC_TIME_HANDLER], [ AC_CHECK_FUNCS(gmtime_r localtime_r mktime) - AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], - tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)) + tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi - AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], - tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)) + tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi @@ -2434,24 +2419,24 @@ AC_DEFUN([SC_TIME_HANDLER], [ # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # - AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], - tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)) + tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # - AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], - tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)) + tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in index 8d09814..7c36c14 100644 --- a/unix/tkConfig.h.in +++ b/unix/tkConfig.h.in @@ -10,21 +10,12 @@ /* Is pthread_getattr_np declared in ? */ #undef GETATTRNP_NOT_DECLARED -/* Define to 1 if you have the `copyfile' function. */ -#undef HAVE_COPYFILE - -/* Define to 1 if you have the header file. */ -#undef HAVE_COPYFILE_H - -/* Do we have access to Darwin CoreFoundation.framework ? */ +/* Do we have access to Darwin CoreFoundation.framework? */ #undef HAVE_COREFOUNDATION /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBKERN_OSATOMIC_H - /* Do we have ? */ #undef HAVE_LIMITS_H @@ -37,12 +28,6 @@ /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 -/* Define to 1 if you have the `OSSpinLockLock' function. */ -#undef HAVE_OSSPINLOCKLOCK - -/* Define to 1 if you have the `pthread_atfork' function. */ -#undef HAVE_PTHREAD_ATFORK - /* Do we want a BSD-like thread-attribute interface? */ #undef HAVE_PTHREAD_ATTR_GET_NP @@ -154,12 +139,6 @@ /* Are bytecode statistics enabled? */ #undef TCL_COMPILE_STATS -/* Are we to override what our default encoding is? */ -#undef TCL_DEFAULT_ENCODING - -/* Can this platform load code from memory? */ -#undef TCL_LOAD_FROM_MEMORY - /* Is memory debugging enabled? */ #undef TCL_MEM_DEBUG @@ -190,9 +169,6 @@ /* Do we want to use the threaded memory allocator? */ #undef USE_THREAD_ALLOC -/* Should we use vfork() instead of fork()? */ -#undef USE_VFORK - /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN diff --git a/unix/tkUnix.c b/unix/tkUnix.c index 2e174b7..993bc9d 100644 --- a/unix/tkUnix.c +++ b/unix/tkUnix.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: tkUnix.c,v 1.12 2005/11/14 11:54:21 dkf Exp $ + * RCS: @(#) $Id: tkUnix.c,v 1.13 2006/07/20 06:25:20 das Exp $ */ #include @@ -209,7 +209,11 @@ Tk_GetUserInactiveTime( * on some buggy versions of XFree86. */ - if (XScreenSaverQueryExtension(dpy, &eventBase, &errorBase) && + if ( +#ifdef __APPLE__ + XScreenSaverQueryInfo != NULL && /* Support for weak-linked libXss. */ +#endif + XScreenSaverQueryExtension(dpy, &eventBase, &errorBase) && XScreenSaverQueryVersion(dpy, &major, &minor)) { XScreenSaverInfo *info = XScreenSaverAllocInfo(); diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index d91e2b3..29deb7e 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSend.c,v 1.14 2005/11/27 02:36:16 das Exp $ + * RCS: @(#) $Id: tkUnixSend.c,v 1.15 2006/07/20 06:25:20 das Exp $ */ #include "tkPort.h" @@ -1926,7 +1926,7 @@ TkpTestsendCmd( &bytesAfter, (unsigned char **) &property); if ((result == Success) && (actualType != None) && (actualFormat == 8) && (actualType == XA_STRING)) { - for (p = property; (p-property) < length; p++) { + for (p = property; (unsigned long)(p-property) < length; p++) { if (*p == 0) { *p = '\n'; } -- cgit v0.12