From 1602f4eea94987af0c6a3bb0c68f62b9967acf1b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Mar 2016 21:55:59 +0000 Subject: Fixed bug [487861ffff] - cascade with -accelerator looks wrong --- win/tkWinMenu.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 4593928..8eede75 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -155,7 +155,7 @@ static void DrawWindowsSystemBitmap(Display *display, Drawable drawable, GC gc, const RECT *rectPtr, int bitmapID, int alignFlags); static void FreeID(WORD commandID); -static char * GetEntryText(TkMenuEntry *mePtr); +static char * GetEntryText(TkMenu *menuPtr, TkMenuEntry *mePtr); static void GetMenuAccelGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *widthPtr, @@ -486,6 +486,7 @@ TkpDestroyMenuEntry( static char * GetEntryText( + TkMenu *menuPtr, /* The menu considered. */ TkMenuEntry *mePtr) /* A pointer to the menu entry. */ { char *itemText; @@ -506,7 +507,7 @@ GetEntryText( int i; const char *label = (mePtr->labelPtr == NULL) ? "" : Tcl_GetString(mePtr->labelPtr); - const char *accel = (mePtr->accelPtr == NULL) ? "" + const char *accel = ((menuPtr->menuType == MENUBAR) || (mePtr->accelPtr == NULL)) ? "" : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; @@ -605,7 +606,7 @@ ReconfigureWindowsMenu( continue; } - itemText = GetEntryText(mePtr); + itemText = GetEntryText(menuPtr, mePtr); if ((menuPtr->menuType == MENUBAR) || (menuPtr->menuFlags & MENU_SYSTEM_MENU)) { Tcl_WinUtfToTChar(itemText, -1, &translatedText); @@ -1502,12 +1503,12 @@ GetMenuAccelGeometry( *heightPtr = fmPtr->linespace; if (mePtr->type == CASCADE_ENTRY) { *widthPtr = 0; - } else if (mePtr->accelPtr == NULL) { - *widthPtr = 0; - } else { + } else if ((menuPtr->menuType != MENUBAR) && (mePtr->accelPtr != NULL)) { const char *accel = Tcl_GetString(mePtr->accelPtr); *widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength); + } else { + *widthPtr = 0; } } @@ -1763,6 +1764,10 @@ DrawMenuEntryAccelerator( int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth; const char *accel; + if (menuPtr->menuType == MENUBAR) { + return; + } + if (mePtr->accelPtr != NULL) { accel = Tcl_GetString(mePtr->accelPtr); } else { -- cgit v0.12 From 6c534182fd22240a95933a12751a111f41f4a87c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Mar 2016 08:30:39 +0000 Subject: configure.in -> configure.ac --- generic/tk.h | 4 +- macosx/GNUmakefile | 2 +- macosx/Tk.xcode/project.pbxproj | 36 +- macosx/Tk.xcodeproj/project.pbxproj | 36 +- macosx/configure.ac | 2 +- unix/Makefile.in | 12 +- unix/configure.ac | 857 ++++++++++++++++++++++++++++++++++++ unix/configure.in | 857 ------------------------------------ win/configure.ac | 314 +++++++++++++ win/configure.in | 314 ------------- 10 files changed, 1217 insertions(+), 1217 deletions(-) create mode 100644 unix/configure.ac delete mode 100644 unix/configure.in create mode 100644 win/configure.ac delete mode 100644 win/configure.in diff --git a/generic/tk.h b/generic/tk.h index 6abb05e..f51d793 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -59,8 +59,8 @@ extern "C" { * and update the version numbers: * * library/tk.tcl (1 LOC patch) - * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch) - * win/configure.in (as above) + * unix/configure.ac (2 LOC Major, 2 LOC minor, 1 LOC patch) + * win/configure.ac (as above) * README (sections 0 and 1) * macosx/Tk-Common.xcconfig (not patchlevel) 1 LOC * win/README (not patchlevel) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index d0bab1a..57d0206 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -102,7 +102,7 @@ PROJECT := tk PRODUCT_NAME := Tk UNIX_DIR := ${CURDIR}/../unix -VERSION := $(shell awk -F= '/^TK_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.in) +VERSION := $(shell awk -F= '/^TK_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.ac) TCL_VERSION := ${VERSION} wish := wish WISH = wish${VERSION} diff --git a/macosx/Tk.xcode/project.pbxproj b/macosx/Tk.xcode/project.pbxproj index 70c2472..eee37a2 100644 --- a/macosx/Tk.xcode/project.pbxproj +++ b/macosx/Tk.xcode/project.pbxproj @@ -1172,7 +1172,7 @@ F966BC6A08F27A3D005CB29B /* xmfbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.test; sourceTree = ""; }; F966BC6C08F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = ""; }; F966BC6D08F27A3D005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F966BC6E08F27A3D005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F966BC6E08F27A3D005CB29B /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F966BC6F08F27A3D005CB29B /* install-sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-sh"; sourceTree = ""; }; F966BC7008F27A3D005CB29B /* installManPage */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = installManPage; sourceTree = ""; }; F966BC7108F27A3D005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; @@ -1211,7 +1211,7 @@ F966BC9408F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = ""; }; F966BC9508F27A3D005CB29B /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = ""; }; F966BC9608F27A3E005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F966BC9708F27A3E005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F966BC9708F27A3E005CB29B /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; @@ -1916,7 +1916,7 @@ F96D43CF08F272B7004A47F5 /* winTime.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winTime.test; sourceTree = ""; }; F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = ""; }; F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F96D43D308F272B8004A47F5 /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = ""; }; F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = ""; }; F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = ""; }; @@ -1941,7 +1941,7 @@ F96D443C08F272B9004A47F5 /* uniParse.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniParse.tcl; sourceTree = ""; }; F96D444008F272B9004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = ""; }; F96D444108F272B9004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F96D444208F272B9004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F96D444208F272B9004A47F5 /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F96D444408F272B9004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F96D444508F272B9004A47F5 /* pkga.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkga.c; sourceTree = ""; }; F96D444608F272B9004A47F5 /* pkgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgb.c; sourceTree = ""; }; @@ -1986,7 +1986,7 @@ F96D447208F272BA004A47F5 /* cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cat.c; sourceTree = ""; }; F96D447308F272BA004A47F5 /* coffbase.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coffbase.txt; sourceTree = ""; }; F96D447408F272BA004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F96D447508F272BA004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F96D447508F272BA004A47F5 /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F96D447608F272BA004A47F5 /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F96D447708F272BA004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F96D447808F272BA004A47F5 /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; @@ -2743,7 +2743,7 @@ children = ( F966BC6C08F27A3D005CB29B /* aclocal.m4 */, F966BC6D08F27A3D005CB29B /* configure */, - F966BC6E08F27A3D005CB29B /* configure.in */, + F966BC6E08F27A3D005CB29B /* configure.ac */, F966BC6F08F27A3D005CB29B /* install-sh */, F966BC7008F27A3D005CB29B /* installManPage */, F966BC7108F27A3D005CB29B /* Makefile.in */, @@ -2790,7 +2790,7 @@ F966BC9408F27A3D005CB29B /* aclocal.m4 */, F966BC9508F27A3D005CB29B /* buildall.vc.bat */, F966BC9608F27A3E005CB29B /* configure */, - F966BC9708F27A3E005CB29B /* configure.in */, + F966BC9708F27A3E005CB29B /* configure.ac */, F966BC9808F27A3E005CB29B /* makefile.bc */, F966BC9908F27A3E005CB29B /* Makefile.in */, F966BC9A08F27A3E005CB29B /* makefile.vc */, @@ -3726,7 +3726,7 @@ children = ( F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */, F96D43D208F272B8004A47F5 /* configure */, - F96D43D308F272B8004A47F5 /* configure.in */, + F96D43D308F272B8004A47F5 /* configure.ac */, F96D442208F272B8004A47F5 /* eolFix.tcl */, F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */, F96D442508F272B8004A47F5 /* genStubs.tcl */, @@ -3759,7 +3759,7 @@ children = ( F96D444008F272B9004A47F5 /* aclocal.m4 */, F96D444108F272B9004A47F5 /* configure */, - F96D444208F272B9004A47F5 /* configure.in */, + F96D444208F272B9004A47F5 /* configure.ac */, F96D444308F272B9004A47F5 /* dltest */, F96D444D08F272B9004A47F5 /* install-sh */, F96D444E08F272B9004A47F5 /* installManPage */, @@ -3821,7 +3821,7 @@ F96D447208F272BA004A47F5 /* cat.c */, F96D447308F272BA004A47F5 /* coffbase.txt */, F96D447408F272BA004A47F5 /* configure */, - F96D447508F272BA004A47F5 /* configure.in */, + F96D447508F272BA004A47F5 /* configure.ac */, F96D447608F272BA004A47F5 /* makefile.bc */, F96D447708F272BA004A47F5 /* Makefile.in */, F96D447808F272BA004A47F5 /* makefile.vc */, @@ -3974,7 +3974,7 @@ ); inputPaths = ( "$(TCL_SRCROOT)/macosx/configure.ac", - "$(TCL_SRCROOT)/unix/configure.in", + "$(TCL_SRCROOT)/unix/configure.ac", "$(TCL_SRCROOT)/unix/tcl.m4", "$(TCL_SRCROOT)/unix/aclocal.m4", "$(TCL_SRCROOT)/unix/tclConfig.sh.in", @@ -3987,7 +3987,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${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.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9A5C5F608F651AB008AE941 /* Configure Tk */ = { @@ -3997,7 +3997,7 @@ ); inputPaths = ( "$(TK_SRCROOT)/macosx/configure.ac", - "$(TK_SRCROOT)/unix/configure.in", + "$(TK_SRCROOT)/unix/configure.ac", "$(TK_SRCROOT)/unix/tcl.m4", "$(TK_SRCROOT)/unix/aclocal.m4", "$(TK_SRCROOT)/unix/tkConfig.sh.in", @@ -4008,7 +4008,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\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 CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; + shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\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 CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9FD30B40CC1AD070073837D /* Configure Tcl */ = { @@ -4018,7 +4018,7 @@ ); inputPaths = ( "$(TCL_SRCROOT)/macosx/configure.ac", - "$(TCL_SRCROOT)/unix/configure.in", + "$(TCL_SRCROOT)/unix/configure.ac", "$(TCL_SRCROOT)/unix/tcl.m4", "$(TCL_SRCROOT)/unix/aclocal.m4", "$(TCL_SRCROOT)/unix/tclConfig.sh.in", @@ -4031,7 +4031,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${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.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9FD30B50CC1AD070073837D /* Configure Tk */ = { @@ -4041,7 +4041,7 @@ ); inputPaths = ( "$(TK_SRCROOT)/macosx/configure.ac", - "$(TK_SRCROOT)/unix/configure.in", + "$(TK_SRCROOT)/unix/configure.ac", "$(TK_SRCROOT)/unix/tcl.m4", "$(TK_SRCROOT)/unix/aclocal.m4", "$(TK_SRCROOT)/unix/tkConfig.sh.in", @@ -4052,7 +4052,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl CC=${CC} LD=${CC} ${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.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index dcfe9fb..2f7edba 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -1172,7 +1172,7 @@ F966BC6A08F27A3D005CB29B /* xmfbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.test; sourceTree = ""; }; F966BC6C08F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = ""; }; F966BC6D08F27A3D005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F966BC6E08F27A3D005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F966BC6E08F27A3D005CB29B /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F966BC6F08F27A3D005CB29B /* install-sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-sh"; sourceTree = ""; }; F966BC7008F27A3D005CB29B /* installManPage */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = installManPage; sourceTree = ""; }; F966BC7108F27A3D005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; @@ -1211,7 +1211,7 @@ F966BC9408F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = ""; }; F966BC9508F27A3D005CB29B /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = ""; }; F966BC9608F27A3E005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F966BC9708F27A3E005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F966BC9708F27A3E005CB29B /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; @@ -1916,7 +1916,7 @@ F96D43CF08F272B7004A47F5 /* winTime.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winTime.test; sourceTree = ""; }; F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = ""; }; F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F96D43D308F272B8004A47F5 /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = ""; }; F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = ""; }; F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = ""; }; @@ -1941,7 +1941,7 @@ F96D443C08F272B9004A47F5 /* uniParse.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniParse.tcl; sourceTree = ""; }; F96D444008F272B9004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = ""; }; F96D444108F272B9004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F96D444208F272B9004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F96D444208F272B9004A47F5 /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F96D444408F272B9004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F96D444508F272B9004A47F5 /* pkga.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkga.c; sourceTree = ""; }; F96D444608F272B9004A47F5 /* pkgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgb.c; sourceTree = ""; }; @@ -1986,7 +1986,7 @@ F96D447208F272BA004A47F5 /* cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cat.c; sourceTree = ""; }; F96D447308F272BA004A47F5 /* coffbase.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coffbase.txt; sourceTree = ""; }; F96D447408F272BA004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; - F96D447508F272BA004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; + F96D447508F272BA004A47F5 /* configure.ac */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.ac; sourceTree = ""; }; F96D447608F272BA004A47F5 /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = ""; }; F96D447708F272BA004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = ""; }; F96D447808F272BA004A47F5 /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = ""; }; @@ -2743,7 +2743,7 @@ children = ( F966BC6C08F27A3D005CB29B /* aclocal.m4 */, F966BC6D08F27A3D005CB29B /* configure */, - F966BC6E08F27A3D005CB29B /* configure.in */, + F966BC6E08F27A3D005CB29B /* configure.ac */, F966BC6F08F27A3D005CB29B /* install-sh */, F966BC7008F27A3D005CB29B /* installManPage */, F966BC7108F27A3D005CB29B /* Makefile.in */, @@ -2790,7 +2790,7 @@ F966BC9408F27A3D005CB29B /* aclocal.m4 */, F966BC9508F27A3D005CB29B /* buildall.vc.bat */, F966BC9608F27A3E005CB29B /* configure */, - F966BC9708F27A3E005CB29B /* configure.in */, + F966BC9708F27A3E005CB29B /* configure.ac */, F966BC9808F27A3E005CB29B /* makefile.bc */, F966BC9908F27A3E005CB29B /* Makefile.in */, F966BC9A08F27A3E005CB29B /* makefile.vc */, @@ -3726,7 +3726,7 @@ children = ( F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */, F96D43D208F272B8004A47F5 /* configure */, - F96D43D308F272B8004A47F5 /* configure.in */, + F96D43D308F272B8004A47F5 /* configure.ac */, F96D442208F272B8004A47F5 /* eolFix.tcl */, F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */, F96D442508F272B8004A47F5 /* genStubs.tcl */, @@ -3759,7 +3759,7 @@ children = ( F96D444008F272B9004A47F5 /* aclocal.m4 */, F96D444108F272B9004A47F5 /* configure */, - F96D444208F272B9004A47F5 /* configure.in */, + F96D444208F272B9004A47F5 /* configure.ac */, F96D444308F272B9004A47F5 /* dltest */, F96D444D08F272B9004A47F5 /* install-sh */, F96D444E08F272B9004A47F5 /* installManPage */, @@ -3821,7 +3821,7 @@ F96D447208F272BA004A47F5 /* cat.c */, F96D447308F272BA004A47F5 /* coffbase.txt */, F96D447408F272BA004A47F5 /* configure */, - F96D447508F272BA004A47F5 /* configure.in */, + F96D447508F272BA004A47F5 /* configure.ac */, F96D447608F272BA004A47F5 /* makefile.bc */, F96D447708F272BA004A47F5 /* Makefile.in */, F96D447808F272BA004A47F5 /* makefile.vc */, @@ -3977,7 +3977,7 @@ ); inputPaths = ( "$(TCL_SRCROOT)/macosx/configure.ac", - "$(TCL_SRCROOT)/unix/configure.in", + "$(TCL_SRCROOT)/unix/configure.ac", "$(TCL_SRCROOT)/unix/tcl.m4", "$(TCL_SRCROOT)/unix/aclocal.m4", "$(TCL_SRCROOT)/unix/tclConfig.sh.in", @@ -3990,7 +3990,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${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.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9A5C5F608F651AB008AE941 /* Configure Tk */ = { @@ -4000,7 +4000,7 @@ ); inputPaths = ( "$(TK_SRCROOT)/macosx/configure.ac", - "$(TK_SRCROOT)/unix/configure.in", + "$(TK_SRCROOT)/unix/configure.ac", "$(TK_SRCROOT)/unix/tcl.m4", "$(TK_SRCROOT)/unix/aclocal.m4", "$(TK_SRCROOT)/unix/tkConfig.sh.in", @@ -4011,7 +4011,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\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 CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; + shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\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 CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9FD30B40CC1AD070073837D /* Configure Tcl */ = { @@ -4021,7 +4021,7 @@ ); inputPaths = ( "$(TCL_SRCROOT)/macosx/configure.ac", - "$(TCL_SRCROOT)/unix/configure.in", + "$(TCL_SRCROOT)/unix/configure.ac", "$(TCL_SRCROOT)/unix/tcl.m4", "$(TCL_SRCROOT)/unix/aclocal.m4", "$(TCL_SRCROOT)/unix/tclConfig.sh.in", @@ -4034,7 +4034,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${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.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9FD30B50CC1AD070073837D /* Configure Tk */ = { @@ -4044,7 +4044,7 @@ ); inputPaths = ( "$(TK_SRCROOT)/macosx/configure.ac", - "$(TK_SRCROOT)/unix/configure.in", + "$(TK_SRCROOT)/unix/configure.ac", "$(TK_SRCROOT)/unix/tcl.m4", "$(TK_SRCROOT)/unix/aclocal.m4", "$(TK_SRCROOT)/unix/tkConfig.sh.in", @@ -4055,7 +4055,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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl CC=${CC} LD=${CC} ${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.ac -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:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\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 CC=$(xcrun -find ${GCC} || echo ${GCC})\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/macosx/configure.ac b/macosx/configure.ac index 69573c5..41f39d6 100644 --- a/macosx/configure.ac +++ b/macosx/configure.ac @@ -8,4 +8,4 @@ dnl include the configure sources from ../unix: m4_include(../unix/aclocal.m4) m4_define(SC_USE_CONFIG_HEADERS) -m4_include(../unix/configure.in) +m4_include(../unix/configure.ac) diff --git a/unix/Makefile.in b/unix/Makefile.in index 96f1408..a4bc2d4 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -227,7 +227,7 @@ INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA_DIR = ${INSTALL} -d -m 755 # The symbol below provides support for dynamic loading and shared -# libraries. See configure.in for a description of what it means. +# libraries. See configure.ac for a description of what it means. # The value of the symbol is normally set by the configure script. SHLIB_CFLAGS = @SHLIB_CFLAGS@ -DBUILD_tk @@ -266,7 +266,7 @@ LIBS = @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ @EXTRA_WISH_LIBS@ # The symbols below provide support for dynamic loading and shared -# libraries. See configure.in for a description of what the +# libraries. See configure.ac 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. @@ -1528,7 +1528,7 @@ DISTNAME = tk${VERSION}${PATCH_LEVEL} ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip DISTDIR = $(DISTROOT)/$(DISTNAME) TCLDIR = @TCL_SRC_DIR@ -$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in $(UNIX_DIR)/tcl.m4 \ +$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tcl.m4 \ $(UNIX_DIR)/aclocal.m4 cd $(UNIX_DIR); autoconf $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure @@ -1542,12 +1542,12 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M 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 - cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in $(UNIX_DIR)/tk.spec \ + cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tk.spec \ $(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \ $(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \ $(UNIX_DIR)/README $(UNIX_DIR)/installManPage \ $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(DISTDIR)/unix - chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in + chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.ac mkdir $(DISTDIR)/bitmaps @(cd $(TOP_DIR); for i in bitmaps/* ; do \ if [ -f $$i ] ; then \ @@ -1568,7 +1568,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M $(TTK_DIR)/ttkGenStubs.tcl $(DISTDIR)/generic/ttk mkdir $(DISTDIR)/win cp $(TOP_DIR)/win/Makefile.in $(DISTDIR)/win - cp $(TOP_DIR)/win/configure.in \ + cp $(TOP_DIR)/win/configure.ac \ $(TOP_DIR)/win/configure \ $(TOP_DIR)/win/tkConfig.sh.in \ $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \ diff --git a/unix/configure.ac b/unix/configure.ac new file mode 100644 index 0000000..a748246 --- /dev/null +++ b/unix/configure.ac @@ -0,0 +1,857 @@ +#! /bin/bash -norc +dnl This file is an input file used by the GNU "autoconf" program to +dnl generate the file "configure", which is run during Tk installation +dnl to configure the system for the local environment. + +AC_INIT([tk],[8.7]) +AC_PREREQ(2.69) + +dnl This is only used when included from macosx/configure.ac +m4_ifdef([SC_USE_CONFIG_HEADERS], [ + AC_CONFIG_HEADERS([tkConfig.h:../unix/tkConfig.h.in]) + AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TK_CONFIG_H -imacros tkConfig.h"]) + AH_TOP([ + #ifndef _TKCONFIG + #define _TKCONFIG]) + AH_BOTTOM([ + /* Undef unused package specific autoheader defines so that we can + * include both tclConfig.h and tkConfig.h at the same time: */ + /* override */ #undef PACKAGE_NAME + /* override */ #undef PACKAGE_STRING + /* override */ #undef PACKAGE_TARNAME + #endif /* _TKCONFIG */]) +]) + +TK_VERSION=8.7 +TK_MAJOR_VERSION=8 +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="a0" +VERSION=${TK_VERSION} +LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" + +#-------------------------------------------------------------------- +# Find and load the tclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG +SC_LOAD_TCLCONFIG + +if test "${TCL_MAJOR_VERSION}" -ne 8 ; then + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}]) +fi +if test "${TCL_MINOR_VERSION}" -lt 6 ; then + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}]) +fi + +SC_PROG_TCLSH +SC_BUILD_TCLSH + +#------------------------------------------------------------------------ +# Handle the --prefix=... option +#------------------------------------------------------------------------ + +if test "${prefix}" = "NONE"; then + prefix="$TCL_PREFIX" +fi +if test "${exec_prefix}" = "NONE"; then + exec_prefix=$prefix +fi +# Make sure srcdir is fully qualified! +srcdir="`cd "$srcdir" ; pwd`" +TK_SRC_DIR="`cd "$srcdir"/..; pwd`" + +#------------------------------------------------------------------------ +# Compress and/or soft link the manpages? +#------------------------------------------------------------------------ + +SC_CONFIG_MANPAGES + +#------------------------------------------------------------------------ +# Standard compiler checks +#------------------------------------------------------------------------ + +# If the user did not set CFLAGS, set it now to keep +# the AC_PROG_CC macro from adding "-g -O2". +if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" +fi + +AC_PROG_CC +AC_C_INLINE + +#-------------------------------------------------------------------- +# Supply a substitute for stdlib.h if it doesn't define strtol, +# strtoul, or strtod (which it doesn't in some versions of SunOS). +#-------------------------------------------------------------------- + +AC_CHECK_HEADER(stdlib.h, tk_ok=1, tk_ok=0) +AC_EGREP_HEADER(strtol, stdlib.h, , tk_ok=0) +AC_EGREP_HEADER(strtoul, stdlib.h, , tk_ok=0) +AC_EGREP_HEADER(strtod, stdlib.h, , tk_ok=0) +if test $tk_ok = 0; then + AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) +fi + +#------------------------------------------------------------------------ +# If we're using GCC, see if the compiler understands -pipe. If so, use it. +# It makes compiling go faster. (This is only a performance feature.) +#------------------------------------------------------------------------ + +if test -z "$no_pipe" && test -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -pipe], + tcl_cv_cc_pipe, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi +fi + +#------------------------------------------------------------------------ +# Threads support - this auto-enables if Tcl was compiled threaded +#------------------------------------------------------------------------ + +SC_ENABLE_THREADS + +# Add the threads support libraries +LIBS="$LIBS$THREADS_LIBS" + +SC_ENABLE_SHARED + +#-------------------------------------------------------------------- +# 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_CONFIG_CFLAGS + +SC_ENABLE_SYMBOLS + +#-------------------------------------------------------------------- +# Detect what compiler flags to set for 64-bit support. +#-------------------------------------------------------------------- + +SC_TCL_EARLY_FLAGS + +SC_TCL_64BIT_FLAGS + +#-------------------------------------------------------------------- +# Check endianness because we can optimize some operations +#-------------------------------------------------------------------- + +AC_C_BIGENDIAN + +#------------------------------------------------------------------------ +# If Tcl and Tk are installed in different places, adjust the library +# search path to reflect this. +#------------------------------------------------------------------------ + +LIB_RUNTIME_DIR='$(libdir)' + +if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then + LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib" +fi + +if test "$TCL_PREFIX" != "$prefix"; then + AC_MSG_WARN([ + Different --prefix selected for Tk and Tcl! + [[package require Tk]] may not work correctly in tclsh.]) +fi + +#-------------------------------------------------------------------- +# Include sys/select.h if it exists and if it supplies things +# that appear to be useful and aren't already in sys/types.h. +# This appears to be true only on the RS/6000 under AIX. Some +# systems like OSF/1 have a sys/select.h that's of no use, and +# other systems like SCO UNIX have a sys/select.h that's +# pernicious. If "fd_set" isn't defined anywhere then set a +# special flag. +#-------------------------------------------------------------------- + +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)]) +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_EGREP_HEADER(fd_mask, sys/select.h, + 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 + fi +fi +if test $tk_ok = no; then + AC_DEFINE(NO_FD_SET, 1, [Do we have fd_set?]) +fi + +#------------------------------------------------------------------------------ +# Find out all about time handling differences. +#------------------------------------------------------------------------------ + +AC_CHECK_HEADERS(sys/time.h) +AC_HEADER_TIME + +#-------------------------------------------------------------------- +# Under Solaris 2.4, strtod returns the wrong value for the +# terminating character under some conditions. Check for this +# and if the problem exists use a substitute procedure +# "fixstrtod" (provided by Tcl) that corrects the error. +#-------------------------------------------------------------------- + +SC_BUGGY_STRTOD + +#-------------------------------------------------------------------- +# Check for various typedefs and provide substitutes if +# they don't exist. +#-------------------------------------------------------------------- + +AC_TYPE_MODE_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_UID_T + +AC_CHECK_TYPE([intptr_t], [ + AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [ + AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [ + for tcl_cv_intptr_t in "int" "long" "long long" none; do + if test "$tcl_cv_intptr_t" != none; then + AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], + [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], + [tcl_ok=yes], [tcl_ok=no]) + test "$tcl_ok" = yes && break; fi + done]) + if test "$tcl_cv_intptr_t" != none; then + AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer + type wide enough to hold a pointer.]) + fi +]) +AC_CHECK_TYPE([uintptr_t], [ + AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [ + AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [ + for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \ + none; do + if test "$tcl_cv_uintptr_t" != none; then + AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], + [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], + [tcl_ok=yes], [tcl_ok=no]) + test "$tcl_ok" = yes && break; fi + done]) + if test "$tcl_cv_uintptr_t" != none; then + AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer + type wide enough to hold a pointer.]) + fi +]) + +#------------------------------------------- +# In OS/390 struct pwd has no pw_gecos field +#------------------------------------------- + +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)]) +if test $tcl_cv_pwd_pw_gecos = yes; then + AC_DEFINE(HAVE_PW_GECOS, 1, [Does struct password have a pw_gecos field?]) +fi + +#-------------------------------------------------------------------- +# On Mac OS X, we can build either with X11 or with Aqua +#-------------------------------------------------------------------- + +if test "`uname -s`" = "Darwin" ; then + AC_MSG_CHECKING([whether to use Aqua]) + AC_ARG_ENABLE(aqua, + AC_HELP_STRING([--enable-aqua=yes|no], + [use Aqua windowingsystem on Mac OS X (default: no)]), + [tk_aqua=$enableval], [tk_aqua=no]) + if test $tk_aqua = yes -o $tk_aqua = cocoa; then + tk_aqua=yes + 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/Cocoa.framework; then + AC_MSG_WARN([Aqua can only be used when Cocoa is available]) + tk_aqua=no + fi + if test "`uname -r | awk -F. '{print [$]1}'`" -lt 9; then + AC_MSG_WARN([Aqua requires Mac OS X 10.5 or later]) + tk_aqua=no + fi + fi + AC_MSG_RESULT([$tk_aqua]) + if test "$fat_32_64" = yes; then + if test $tk_aqua = no; then + AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [ + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' + done + CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" + LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" + AC_TRY_LINK([#include ], [XrmInitialize();], + tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no) + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="$hold_'$v'"' + done]) + fi + # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit + # fat builds if configuration does not support 64-bit. + if test "$tcl_cv_lib_x11_64" = no; then + AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags]) + for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' + done + fi + 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 + AC_CHECK_HEADERS(AvailabilityMacros.h) + if test "$ac_cv_header_AvailabilityMacros_h" = yes; then + AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + AC_TRY_LINK([ + #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020 + #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020 + #endif + #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1020 + #error MAC_OS_X_VERSION_MIN_REQUIRED < 1020 + #endif + int rand(void) __attribute__((weak_import)); + ], [rand();], + tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_weak_import = yes; then + AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?]) + fi + AC_CACHE_CHECK([if Darwin SUSv3 extensions are available], + tcl_cv_cc_darwin_c_source, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + AC_TRY_COMPILE([ + #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 + #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 + #endif + #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1050 + #error MAC_OS_X_VERSION_MIN_REQUIRED < 1050 + #endif + #define _DARWIN_C_SOURCE 1 + #include + ],,tcl_cv_cc_darwin_c_source=yes, tcl_cv_cc_darwin_c_source=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_darwin_c_source = yes; then + AC_DEFINE(_DARWIN_C_SOURCE, 1, + [Are Darwin SUSv3 extensions available?]) + fi + fi +else + tk_aqua=no +fi + +if test $tk_aqua = yes; then + AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?]) + LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit" + EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' + TK_WINDOWINGSYSTEM=AQUA + if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then + AC_DEFINE(TK_MAC_DEBUG, 1, [Are TkAqua debug messages enabled?]) + fi +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 +# find shared libraries: +# 1. If the X library binaries are in a non-standard directory, +# add the X library location into that search path. +# 2. On systems such as AIX and Ultrix that use "-L" as the +# search path option, colons cannot be used to separate +# directories from each other. Change colons to " -L". +# 3. Create two sets of search flags, one for use in cc lines +# and the other for when the linker is invoked directly. In +# the second case, '-Wl,' must be stripped off and commas must +# be replaced by spaces. +#-------------------------------------------------------------------- + +if test "x${x_libraries}" != "x"; then + if test "x${x_libraries}" != "xNONE"; then + LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}" + fi +fi +if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then + LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'` +fi + +#-------------------------------------------------------------------- +# Check for the existence of various libraries. The order here +# is important, so that then end up in the right order in the +# command line generated by make. The -lsocket and -lnsl libraries +# require a couple of special tricks: +# 1. Use "connect" and "accept" to check for -lsocket, and +# "gethostbyname" to check for -lnsl. +# 2. Use each function name only once: can't redo a check because +# autoconf caches the results of the last check and won't redo it. +# 3. Use -lnsl and -lsocket only if they supply procedures that +# aren't already present in the normal libraries. This is because +# IRIX 5.2 has libraries, but they aren't needed and they're +# bogus: they goof up name resolution if used. +# 4. On some SVR4 systems, can't use -lsocket without -lnsl too. +# To get around this problem, check for both libraries together +# if -lsocket doesn't work by itself. +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"]) +fi + +#-------------------------------------------------------------------- +# One more check related to the X libraries. The standard releases +# of Ultrix don't support the "xauth" mechanism, so send won't work +# unless TK_NO_SECURITY is defined. However, there are usually copies +# of the MIT X server available as well, which do support xauth. +# Check for the MIT stuff and use it if it exists. +# +# Note: can't use ac_check_lib macro (at least, not in Autoconf 2.1) +# because it can't deal with the "-" in the library name. +#-------------------------------------------------------------------- + +if test -d /usr/include/mit -a $tk_aqua = no; then + AC_MSG_CHECKING([MIT X libraries]) + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS -I/usr/include/mit" + tk_oldLibs=$LIBS + LIBS="$LIBS -lX11-mit" + AC_TRY_LINK([ + #include + ], [ + XOpenDisplay(0); + ], [ + AC_MSG_RESULT([yes]) + XLIBSW="-lX11-mit" + XINCLUDES="-I/usr/include/mit" + ], AC_MSG_RESULT([no])) + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs +fi + +#-------------------------------------------------------------------- +# Check for freetype / fontconfig / Xft support. +#-------------------------------------------------------------------- + +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: on)]), + [enable_xft=$enableval], [enable_xft="default"]) + XFT_CFLAGS="" + XFT_LIBS="" + if test "$enable_xft" = "no" ; then + AC_MSG_RESULT([$enable_xft]) + else + found_xft="yes" + dnl make sure package configurator (xft-config or pkg-config + dnl says that xft is present. + XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" + XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" + if test "$found_xft" = "no" ; then + found_xft=yes + XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" + XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" + fi + AC_MSG_RESULT([$found_xft]) + dnl make sure that compiling against Xft header file doesn't bomb + if test "$found_xft" = "yes" ; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" + tk_oldLibs=$LIBS + LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" + AC_CHECK_HEADER(X11/Xft/Xft.h, [], [ + found_xft=no + ],[#include ]) + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + dnl make sure that linking against Xft libraries finds freetype + if test "$found_xft" = "yes" ; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" + tk_oldLibs=$LIBS + LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" + AC_CHECK_LIB(Xft, XftFontOpen, [], [ + found_xft=no + ]) + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + dnl make sure that linking against fontconfig libraries finds Fc* symbols + if test "$found_xft" = "yes" ; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" + tk_oldLibs=$LIBS + LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW -lfontconfig" + AC_CHECK_LIB(fontconfig, FcFontSort, [ + XFT_LIBS="$XFT_LIBS -lfontconfig" + ], []) + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + dnl print a warning if xft is unusable and was specifically requested + if test "$found_xft" = "no" ; then + if test "$enable_xft" = "yes" ; then + AC_MSG_WARN([Can't find xft configuration, or xft is unusable]) + fi + enable_xft=no + XFT_CFLAGS="" + XFT_LIBS="" + else + enable_xft=yes + fi + fi + 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) +fi + +#-------------------------------------------------------------------- +# Check for XkbKeycodeToKeysym. +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + tk_oldCFlags=$CFLAGS + tk_oldLibs=$LIBS + CFLAGS="$CFLAGS $XINCLUDES" + LIBS="$LIBS $XLIBSW" + AC_CHECK_HEADER(X11/XKBlib.h, [ + xkblib_header_found=yes + ], [ + xkblib_header_found=no + ], [#include ]) + if test $xkblib_header_found = "yes" ; then + AC_CHECK_LIB(X11, XkbKeycodeToKeysym, [ + xkbkeycodetokeysym_found=yes + ], [ + xkbkeycodetokeysym_found=no + ]) + else + xkbkeycodetokeysym_found=no + fi + if test $xkbkeycodetokeysym_found = "yes" ; then + AC_DEFINE(HAVE_XKBKEYCODETOKEYSYM, 1, [Do we have XkbKeycodeToKeysym?]) + fi + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs +fi + +#-------------------------------------------------------------------- +# Check whether XKeycodeToKeysym is deprecated in X11 headers. +#-------------------------------------------------------------------- + +if test $tk_aqua = no && test "$GCC" = yes; then + AC_MSG_CHECKING([whether XKeycodeToKeysym is deprecated]) + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS -Werror" + AC_TRY_LINK([ + #include + ], [ + XKeycodeToKeysym(0,0,0); + ], [ + AC_MSG_RESULT([no]) + ], [ + AC_MSG_RESULT([yes]) + AC_DEFINE(XKEYCODETOKEYSYM_IS_DEPRECATED, 1, [Is XKeycodeToKeysym deprecated?]) + ]) + CFLAGS=$tk_oldCFlags +fi + +#-------------------------------------------------------------------- +# XXX Do this last. +# It might modify XLIBSW which could affect other tests. +# +# Check whether the header and library for the XScreenSaver +# extension are available, and set HAVE_XSS if so. +# XScreenSaver is needed for Tk_GetUserInactiveTime(). +#-------------------------------------------------------------------- + +if test $tk_aqua = no; then + tk_oldCFlags=$CFLAGS + CFLAGS="$CFLAGS $XINCLUDES" + tk_oldLibs=$LIBS + LIBS="$tk_oldLibs $XLIBSW" + xss_header_found=no + xss_lib_found=no + AC_MSG_CHECKING([whether to try to use XScreenSaver]) + AC_ARG_ENABLE(xss, + AC_HELP_STRING([--enable-xss], + [use XScreenSaver for activity timer (default: on)]), + [enable_xss=$enableval], [enable_xss=yes]) + if test "$enable_xss" = "no" ; then + AC_MSG_RESULT([$enable_xss]) + else + AC_MSG_RESULT([$enable_xss]) + AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [ + xss_header_found=yes + ],,[#include ]) + AC_CHECK_FUNC(XScreenSaverQueryInfo,,[ + AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [ + XLIBSW="$XLIBSW -lXext" + xss_lib_found=yes + ], [ + AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [ + 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 -Wl,-weak-lXss -lXext" + else + XLIBSW="$XLIBSW -lXss -lXext" + fi + xss_lib_found=yes + ],, -lXext) + ]) + ]) + fi + if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then + AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?]) + fi + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs +fi + +#-------------------------------------------------------------------- +# Figure out whether "char" is unsigned. If so, set a +# #define for __CHAR_UNSIGNED__. +#-------------------------------------------------------------------- + +AC_C_CHAR_UNSIGNED + +#-------------------------------------------------------------------- +# The statements below define a collection of symbols related to +# building libtk as a shared library instead of a static library. +#-------------------------------------------------------------------- + +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 +# since on some platforms TK_LIB_FILE contains shell escapes. + +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" +fi + +TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +PRIVATE_INCLUDE_DIR='$(includedir)' +HTML_DIR='$(DISTDIR)/html' +TK_PKG_DIR='tk$(VERSION)' +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 "`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}" -unexported_symbols_list $$(f=$(TK_LIB_FILE).E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[[0-9a-f]]+ . \.objc/ {print \$$3}" > $$f && nm -gjp "$(TCL_BIN_DIR)"/$(TCL_STUB_LIB_FILE) | grep ^_[[^_]] >> $$f && echo $$f)' + echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000' + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist' + EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' + EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic' + AC_CONFIG_FILES([Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in]) + for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}$l"; done + TK_YEAR="`date +%Y`" +fi + +if test "$FRAMEWORK_BUILD" = "1" ; then + AC_DEFINE(TK_FRAMEWORK, 1, [Is Tk built as a framework?]) + # Construct a fake local framework structure to make linking with + # '-framework Tk' and running of tktest work + AC_CONFIG_COMMANDS([Tk.framework], [n=Tk && + 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 | sed -e 's/ /\\\\ /g'` -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/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' + if test $tk_aqua = yes; then + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'/" && $(INSTALL_DATA_DIR) "$(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" && $(INSTALL_DATA_DIR) "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(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)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' + # 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="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' +else + if test $tk_aqua = yes; then + EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' + fi + # libdir must be a fully qualified path and not ${exec_prefix}/lib + eval libdir="$libdir" + if test "${ac_cv_cygwin}" = "yes" -a "$SHARED_BUILD" = "1"; then + TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" + TK_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win ${TK_LIB_FLAG}" + else + if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TK_LIB_FLAG="-ltk${TK_VERSION}" + else + TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" + fi + TK_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG}" + fi + TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" +fi + +#-------------------------------------------------------------------- +# 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 + TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" +else + TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" +fi + +TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${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="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" + +# Install time header dir can be set via --includedir +eval "TK_INCLUDE_SPEC=\"-I${includedir}\"" + +#------------------------------------------------------------------------ +# 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_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_STUB_LIB_SPEC) +AC_SUBST(TK_STUB_LIB_PATH) +AC_SUBST(TK_INCLUDE_SPEC) +AC_SUBST(TK_BUILD_STUB_LIB_SPEC) +AC_SUBST(TK_BUILD_STUB_LIB_PATH) + +AC_SUBST(TK_SRC_DIR) + +AC_SUBST(TK_SHARED_BUILD) +AC_SUBST(LD_LIBRARY_PATH_VAR) + +AC_SUBST(TK_BUILD_LIB_SPEC) + +AC_SUBST(TCL_STUB_FLAGS) +AC_SUBST(XINCLUDES) +AC_SUBST(XLIBSW) +AC_SUBST(LOCALES) + +AC_SUBST(TK_WINDOWINGSYSTEM) +AC_SUBST(TK_PKG_DIR) +AC_SUBST(TK_LIBRARY) +AC_SUBST(LIB_RUNTIME_DIR) +AC_SUBST(PRIVATE_INCLUDE_DIR) +AC_SUBST(HTML_DIR) + +AC_SUBST(EXTRA_CC_SWITCHES) +AC_SUBST(EXTRA_APP_CC_SWITCHES) +AC_SUBST(EXTRA_INSTALL) +AC_SUBST(EXTRA_INSTALL_BINARIES) +AC_SUBST(EXTRA_BUILD_HTML) +AC_SUBST(EXTRA_WISH_LIBS) +AC_SUBST(CFBUNDLELOCALIZATIONS) + +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) + +AC_CONFIG_FILES([ + Makefile:../unix/Makefile.in + tkConfig.sh:../unix/tkConfig.sh.in + tk.pc:../unix/tk.pc.in +]) +AC_OUTPUT + +dnl Local Variables: +dnl mode: autoconf +dnl End: diff --git a/unix/configure.in b/unix/configure.in deleted file mode 100644 index a748246..0000000 --- a/unix/configure.in +++ /dev/null @@ -1,857 +0,0 @@ -#! /bin/bash -norc -dnl This file is an input file used by the GNU "autoconf" program to -dnl generate the file "configure", which is run during Tk installation -dnl to configure the system for the local environment. - -AC_INIT([tk],[8.7]) -AC_PREREQ(2.69) - -dnl This is only used when included from macosx/configure.ac -m4_ifdef([SC_USE_CONFIG_HEADERS], [ - AC_CONFIG_HEADERS([tkConfig.h:../unix/tkConfig.h.in]) - AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TK_CONFIG_H -imacros tkConfig.h"]) - AH_TOP([ - #ifndef _TKCONFIG - #define _TKCONFIG]) - AH_BOTTOM([ - /* Undef unused package specific autoheader defines so that we can - * include both tclConfig.h and tkConfig.h at the same time: */ - /* override */ #undef PACKAGE_NAME - /* override */ #undef PACKAGE_STRING - /* override */ #undef PACKAGE_TARNAME - #endif /* _TKCONFIG */]) -]) - -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a0" -VERSION=${TK_VERSION} -LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" - -#-------------------------------------------------------------------- -# Find and load the tclConfig.sh file -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG -SC_LOAD_TCLCONFIG - -if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}]) -fi -if test "${TCL_MINOR_VERSION}" -lt 6 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}]) -fi - -SC_PROG_TCLSH -SC_BUILD_TCLSH - -#------------------------------------------------------------------------ -# Handle the --prefix=... option -#------------------------------------------------------------------------ - -if test "${prefix}" = "NONE"; then - prefix="$TCL_PREFIX" -fi -if test "${exec_prefix}" = "NONE"; then - exec_prefix=$prefix -fi -# Make sure srcdir is fully qualified! -srcdir="`cd "$srcdir" ; pwd`" -TK_SRC_DIR="`cd "$srcdir"/..; pwd`" - -#------------------------------------------------------------------------ -# Compress and/or soft link the manpages? -#------------------------------------------------------------------------ - -SC_CONFIG_MANPAGES - -#------------------------------------------------------------------------ -# Standard compiler checks -#------------------------------------------------------------------------ - -# If the user did not set CFLAGS, set it now to keep -# the AC_PROG_CC macro from adding "-g -O2". -if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" -fi - -AC_PROG_CC -AC_C_INLINE - -#-------------------------------------------------------------------- -# Supply a substitute for stdlib.h if it doesn't define strtol, -# strtoul, or strtod (which it doesn't in some versions of SunOS). -#-------------------------------------------------------------------- - -AC_CHECK_HEADER(stdlib.h, tk_ok=1, tk_ok=0) -AC_EGREP_HEADER(strtol, stdlib.h, , tk_ok=0) -AC_EGREP_HEADER(strtoul, stdlib.h, , tk_ok=0) -AC_EGREP_HEADER(strtod, stdlib.h, , tk_ok=0) -if test $tk_ok = 0; then - AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) -fi - -#------------------------------------------------------------------------ -# If we're using GCC, see if the compiler understands -pipe. If so, use it. -# It makes compiling go faster. (This is only a performance feature.) -#------------------------------------------------------------------------ - -if test -z "$no_pipe" && test -n "$GCC"; then - AC_CACHE_CHECK([if the compiler understands -pipe], - tcl_cv_cc_pipe, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi -fi - -#------------------------------------------------------------------------ -# Threads support - this auto-enables if Tcl was compiled threaded -#------------------------------------------------------------------------ - -SC_ENABLE_THREADS - -# Add the threads support libraries -LIBS="$LIBS$THREADS_LIBS" - -SC_ENABLE_SHARED - -#-------------------------------------------------------------------- -# 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_CONFIG_CFLAGS - -SC_ENABLE_SYMBOLS - -#-------------------------------------------------------------------- -# Detect what compiler flags to set for 64-bit support. -#-------------------------------------------------------------------- - -SC_TCL_EARLY_FLAGS - -SC_TCL_64BIT_FLAGS - -#-------------------------------------------------------------------- -# Check endianness because we can optimize some operations -#-------------------------------------------------------------------- - -AC_C_BIGENDIAN - -#------------------------------------------------------------------------ -# If Tcl and Tk are installed in different places, adjust the library -# search path to reflect this. -#------------------------------------------------------------------------ - -LIB_RUNTIME_DIR='$(libdir)' - -if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then - LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib" -fi - -if test "$TCL_PREFIX" != "$prefix"; then - AC_MSG_WARN([ - Different --prefix selected for Tk and Tcl! - [[package require Tk]] may not work correctly in tclsh.]) -fi - -#-------------------------------------------------------------------- -# Include sys/select.h if it exists and if it supplies things -# that appear to be useful and aren't already in sys/types.h. -# This appears to be true only on the RS/6000 under AIX. Some -# systems like OSF/1 have a sys/select.h that's of no use, and -# other systems like SCO UNIX have a sys/select.h that's -# pernicious. If "fd_set" isn't defined anywhere then set a -# special flag. -#-------------------------------------------------------------------- - -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)]) -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_EGREP_HEADER(fd_mask, sys/select.h, - 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 - fi -fi -if test $tk_ok = no; then - AC_DEFINE(NO_FD_SET, 1, [Do we have fd_set?]) -fi - -#------------------------------------------------------------------------------ -# Find out all about time handling differences. -#------------------------------------------------------------------------------ - -AC_CHECK_HEADERS(sys/time.h) -AC_HEADER_TIME - -#-------------------------------------------------------------------- -# Under Solaris 2.4, strtod returns the wrong value for the -# terminating character under some conditions. Check for this -# and if the problem exists use a substitute procedure -# "fixstrtod" (provided by Tcl) that corrects the error. -#-------------------------------------------------------------------- - -SC_BUGGY_STRTOD - -#-------------------------------------------------------------------- -# Check for various typedefs and provide substitutes if -# they don't exist. -#-------------------------------------------------------------------- - -AC_TYPE_MODE_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_TYPE_UID_T - -AC_CHECK_TYPE([intptr_t], [ - AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [ - AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [ - for tcl_cv_intptr_t in "int" "long" "long long" none; do - if test "$tcl_cv_intptr_t" != none; then - AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], - [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], - [tcl_ok=yes], [tcl_ok=no]) - test "$tcl_ok" = yes && break; fi - done]) - if test "$tcl_cv_intptr_t" != none; then - AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer - type wide enough to hold a pointer.]) - fi -]) -AC_CHECK_TYPE([uintptr_t], [ - AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [ - AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [ - for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \ - none; do - if test "$tcl_cv_uintptr_t" != none; then - AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], - [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], - [tcl_ok=yes], [tcl_ok=no]) - test "$tcl_ok" = yes && break; fi - done]) - if test "$tcl_cv_uintptr_t" != none; then - AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer - type wide enough to hold a pointer.]) - fi -]) - -#------------------------------------------- -# In OS/390 struct pwd has no pw_gecos field -#------------------------------------------- - -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)]) -if test $tcl_cv_pwd_pw_gecos = yes; then - AC_DEFINE(HAVE_PW_GECOS, 1, [Does struct password have a pw_gecos field?]) -fi - -#-------------------------------------------------------------------- -# On Mac OS X, we can build either with X11 or with Aqua -#-------------------------------------------------------------------- - -if test "`uname -s`" = "Darwin" ; then - AC_MSG_CHECKING([whether to use Aqua]) - AC_ARG_ENABLE(aqua, - AC_HELP_STRING([--enable-aqua=yes|no], - [use Aqua windowingsystem on Mac OS X (default: no)]), - [tk_aqua=$enableval], [tk_aqua=no]) - if test $tk_aqua = yes -o $tk_aqua = cocoa; then - tk_aqua=yes - 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/Cocoa.framework; then - AC_MSG_WARN([Aqua can only be used when Cocoa is available]) - tk_aqua=no - fi - if test "`uname -r | awk -F. '{print [$]1}'`" -lt 9; then - AC_MSG_WARN([Aqua requires Mac OS X 10.5 or later]) - tk_aqua=no - fi - fi - AC_MSG_RESULT([$tk_aqua]) - if test "$fat_32_64" = yes; then - if test $tk_aqua = no; then - AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [ - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' - done - CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" - LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - AC_TRY_LINK([#include ], [XrmInitialize();], - tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no) - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="$hold_'$v'"' - done]) - fi - # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit - # fat builds if configuration does not support 64-bit. - if test "$tcl_cv_lib_x11_64" = no; then - AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags]) - for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' - done - fi - 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 - AC_CHECK_HEADERS(AvailabilityMacros.h) - if test "$ac_cv_header_AvailabilityMacros_h" = yes; then - AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - AC_TRY_LINK([ - #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020 - #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020 - #endif - #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1020 - #error MAC_OS_X_VERSION_MIN_REQUIRED < 1020 - #endif - int rand(void) __attribute__((weak_import)); - ], [rand();], - tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_weak_import = yes; then - AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?]) - fi - AC_CACHE_CHECK([if Darwin SUSv3 extensions are available], - tcl_cv_cc_darwin_c_source, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - AC_TRY_COMPILE([ - #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 - #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 - #endif - #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1050 - #error MAC_OS_X_VERSION_MIN_REQUIRED < 1050 - #endif - #define _DARWIN_C_SOURCE 1 - #include - ],,tcl_cv_cc_darwin_c_source=yes, tcl_cv_cc_darwin_c_source=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_darwin_c_source = yes; then - AC_DEFINE(_DARWIN_C_SOURCE, 1, - [Are Darwin SUSv3 extensions available?]) - fi - fi -else - tk_aqua=no -fi - -if test $tk_aqua = yes; then - AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?]) - LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit" - EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' - TK_WINDOWINGSYSTEM=AQUA - if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then - AC_DEFINE(TK_MAC_DEBUG, 1, [Are TkAqua debug messages enabled?]) - fi -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 -# find shared libraries: -# 1. If the X library binaries are in a non-standard directory, -# add the X library location into that search path. -# 2. On systems such as AIX and Ultrix that use "-L" as the -# search path option, colons cannot be used to separate -# directories from each other. Change colons to " -L". -# 3. Create two sets of search flags, one for use in cc lines -# and the other for when the linker is invoked directly. In -# the second case, '-Wl,' must be stripped off and commas must -# be replaced by spaces. -#-------------------------------------------------------------------- - -if test "x${x_libraries}" != "x"; then - if test "x${x_libraries}" != "xNONE"; then - LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}" - fi -fi -if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then - LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'` -fi - -#-------------------------------------------------------------------- -# Check for the existence of various libraries. The order here -# is important, so that then end up in the right order in the -# command line generated by make. The -lsocket and -lnsl libraries -# require a couple of special tricks: -# 1. Use "connect" and "accept" to check for -lsocket, and -# "gethostbyname" to check for -lnsl. -# 2. Use each function name only once: can't redo a check because -# autoconf caches the results of the last check and won't redo it. -# 3. Use -lnsl and -lsocket only if they supply procedures that -# aren't already present in the normal libraries. This is because -# IRIX 5.2 has libraries, but they aren't needed and they're -# bogus: they goof up name resolution if used. -# 4. On some SVR4 systems, can't use -lsocket without -lnsl too. -# To get around this problem, check for both libraries together -# if -lsocket doesn't work by itself. -#-------------------------------------------------------------------- - -if test $tk_aqua = no; then - AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"]) -fi - -#-------------------------------------------------------------------- -# One more check related to the X libraries. The standard releases -# of Ultrix don't support the "xauth" mechanism, so send won't work -# unless TK_NO_SECURITY is defined. However, there are usually copies -# of the MIT X server available as well, which do support xauth. -# Check for the MIT stuff and use it if it exists. -# -# Note: can't use ac_check_lib macro (at least, not in Autoconf 2.1) -# because it can't deal with the "-" in the library name. -#-------------------------------------------------------------------- - -if test -d /usr/include/mit -a $tk_aqua = no; then - AC_MSG_CHECKING([MIT X libraries]) - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS -I/usr/include/mit" - tk_oldLibs=$LIBS - LIBS="$LIBS -lX11-mit" - AC_TRY_LINK([ - #include - ], [ - XOpenDisplay(0); - ], [ - AC_MSG_RESULT([yes]) - XLIBSW="-lX11-mit" - XINCLUDES="-I/usr/include/mit" - ], AC_MSG_RESULT([no])) - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs -fi - -#-------------------------------------------------------------------- -# Check for freetype / fontconfig / Xft support. -#-------------------------------------------------------------------- - -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: on)]), - [enable_xft=$enableval], [enable_xft="default"]) - XFT_CFLAGS="" - XFT_LIBS="" - if test "$enable_xft" = "no" ; then - AC_MSG_RESULT([$enable_xft]) - else - found_xft="yes" - dnl make sure package configurator (xft-config or pkg-config - dnl says that xft is present. - XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" - XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" - if test "$found_xft" = "no" ; then - found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" - fi - AC_MSG_RESULT([$found_xft]) - dnl make sure that compiling against Xft header file doesn't bomb - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - AC_CHECK_HEADER(X11/Xft/Xft.h, [], [ - found_xft=no - ],[#include ]) - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - dnl make sure that linking against Xft libraries finds freetype - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - AC_CHECK_LIB(Xft, XftFontOpen, [], [ - found_xft=no - ]) - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - dnl make sure that linking against fontconfig libraries finds Fc* symbols - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW -lfontconfig" - AC_CHECK_LIB(fontconfig, FcFontSort, [ - XFT_LIBS="$XFT_LIBS -lfontconfig" - ], []) - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - dnl print a warning if xft is unusable and was specifically requested - if test "$found_xft" = "no" ; then - if test "$enable_xft" = "yes" ; then - AC_MSG_WARN([Can't find xft configuration, or xft is unusable]) - fi - enable_xft=no - XFT_CFLAGS="" - XFT_LIBS="" - else - enable_xft=yes - fi - fi - 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) -fi - -#-------------------------------------------------------------------- -# Check for XkbKeycodeToKeysym. -#-------------------------------------------------------------------- - -if test $tk_aqua = no; then - tk_oldCFlags=$CFLAGS - tk_oldLibs=$LIBS - CFLAGS="$CFLAGS $XINCLUDES" - LIBS="$LIBS $XLIBSW" - AC_CHECK_HEADER(X11/XKBlib.h, [ - xkblib_header_found=yes - ], [ - xkblib_header_found=no - ], [#include ]) - if test $xkblib_header_found = "yes" ; then - AC_CHECK_LIB(X11, XkbKeycodeToKeysym, [ - xkbkeycodetokeysym_found=yes - ], [ - xkbkeycodetokeysym_found=no - ]) - else - xkbkeycodetokeysym_found=no - fi - if test $xkbkeycodetokeysym_found = "yes" ; then - AC_DEFINE(HAVE_XKBKEYCODETOKEYSYM, 1, [Do we have XkbKeycodeToKeysym?]) - fi - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs -fi - -#-------------------------------------------------------------------- -# Check whether XKeycodeToKeysym is deprecated in X11 headers. -#-------------------------------------------------------------------- - -if test $tk_aqua = no && test "$GCC" = yes; then - AC_MSG_CHECKING([whether XKeycodeToKeysym is deprecated]) - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS -Werror" - AC_TRY_LINK([ - #include - ], [ - XKeycodeToKeysym(0,0,0); - ], [ - AC_MSG_RESULT([no]) - ], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(XKEYCODETOKEYSYM_IS_DEPRECATED, 1, [Is XKeycodeToKeysym deprecated?]) - ]) - CFLAGS=$tk_oldCFlags -fi - -#-------------------------------------------------------------------- -# XXX Do this last. -# It might modify XLIBSW which could affect other tests. -# -# Check whether the header and library for the XScreenSaver -# extension are available, and set HAVE_XSS if so. -# XScreenSaver is needed for Tk_GetUserInactiveTime(). -#-------------------------------------------------------------------- - -if test $tk_aqua = no; then - tk_oldCFlags=$CFLAGS - CFLAGS="$CFLAGS $XINCLUDES" - tk_oldLibs=$LIBS - LIBS="$tk_oldLibs $XLIBSW" - xss_header_found=no - xss_lib_found=no - AC_MSG_CHECKING([whether to try to use XScreenSaver]) - AC_ARG_ENABLE(xss, - AC_HELP_STRING([--enable-xss], - [use XScreenSaver for activity timer (default: on)]), - [enable_xss=$enableval], [enable_xss=yes]) - if test "$enable_xss" = "no" ; then - AC_MSG_RESULT([$enable_xss]) - else - AC_MSG_RESULT([$enable_xss]) - AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [ - xss_header_found=yes - ],,[#include ]) - AC_CHECK_FUNC(XScreenSaverQueryInfo,,[ - AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [ - XLIBSW="$XLIBSW -lXext" - xss_lib_found=yes - ], [ - AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [ - 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 -Wl,-weak-lXss -lXext" - else - XLIBSW="$XLIBSW -lXss -lXext" - fi - xss_lib_found=yes - ],, -lXext) - ]) - ]) - fi - if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then - AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?]) - fi - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs -fi - -#-------------------------------------------------------------------- -# Figure out whether "char" is unsigned. If so, set a -# #define for __CHAR_UNSIGNED__. -#-------------------------------------------------------------------- - -AC_C_CHAR_UNSIGNED - -#-------------------------------------------------------------------- -# The statements below define a collection of symbols related to -# building libtk as a shared library instead of a static library. -#-------------------------------------------------------------------- - -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 -# since on some platforms TK_LIB_FILE contains shell escapes. - -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" -fi - -TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' -PRIVATE_INCLUDE_DIR='$(includedir)' -HTML_DIR='$(DISTDIR)/html' -TK_PKG_DIR='tk$(VERSION)' -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 "`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}" -unexported_symbols_list $$(f=$(TK_LIB_FILE).E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[[0-9a-f]]+ . \.objc/ {print \$$3}" > $$f && nm -gjp "$(TCL_BIN_DIR)"/$(TCL_STUB_LIB_FILE) | grep ^_[[^_]] >> $$f && echo $$f)' - echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000' - TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist' - EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' - EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic' - AC_CONFIG_FILES([Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in]) - for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}$l"; done - TK_YEAR="`date +%Y`" -fi - -if test "$FRAMEWORK_BUILD" = "1" ; then - AC_DEFINE(TK_FRAMEWORK, 1, [Is Tk built as a framework?]) - # Construct a fake local framework structure to make linking with - # '-framework Tk' and running of tktest work - AC_CONFIG_COMMANDS([Tk.framework], [n=Tk && - 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 | sed -e 's/ /\\\\ /g'` -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/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' - if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'/" && $(INSTALL_DATA_DIR) "$(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" && $(INSTALL_DATA_DIR) "$(BIN_INSTALL_DIR)/../Resources"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(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)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' - # 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="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' -else - if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' - fi - # libdir must be a fully qualified path and not ${exec_prefix}/lib - eval libdir="$libdir" - if test "${ac_cv_cygwin}" = "yes" -a "$SHARED_BUILD" = "1"; then - TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" - TK_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win ${TK_LIB_FLAG}" - else - if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - TK_LIB_FLAG="-ltk${TK_VERSION}" - else - TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" - fi - TK_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG}" - fi - TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" -fi - -#-------------------------------------------------------------------- -# 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 - TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" -else - TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" -fi - -TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${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="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" - -# Install time header dir can be set via --includedir -eval "TK_INCLUDE_SPEC=\"-I${includedir}\"" - -#------------------------------------------------------------------------ -# 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_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_STUB_LIB_SPEC) -AC_SUBST(TK_STUB_LIB_PATH) -AC_SUBST(TK_INCLUDE_SPEC) -AC_SUBST(TK_BUILD_STUB_LIB_SPEC) -AC_SUBST(TK_BUILD_STUB_LIB_PATH) - -AC_SUBST(TK_SRC_DIR) - -AC_SUBST(TK_SHARED_BUILD) -AC_SUBST(LD_LIBRARY_PATH_VAR) - -AC_SUBST(TK_BUILD_LIB_SPEC) - -AC_SUBST(TCL_STUB_FLAGS) -AC_SUBST(XINCLUDES) -AC_SUBST(XLIBSW) -AC_SUBST(LOCALES) - -AC_SUBST(TK_WINDOWINGSYSTEM) -AC_SUBST(TK_PKG_DIR) -AC_SUBST(TK_LIBRARY) -AC_SUBST(LIB_RUNTIME_DIR) -AC_SUBST(PRIVATE_INCLUDE_DIR) -AC_SUBST(HTML_DIR) - -AC_SUBST(EXTRA_CC_SWITCHES) -AC_SUBST(EXTRA_APP_CC_SWITCHES) -AC_SUBST(EXTRA_INSTALL) -AC_SUBST(EXTRA_INSTALL_BINARIES) -AC_SUBST(EXTRA_BUILD_HTML) -AC_SUBST(EXTRA_WISH_LIBS) -AC_SUBST(CFBUNDLELOCALIZATIONS) - -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) - -AC_CONFIG_FILES([ - Makefile:../unix/Makefile.in - tkConfig.sh:../unix/tkConfig.sh.in - tk.pc:../unix/tk.pc.in -]) -AC_OUTPUT - -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/win/configure.ac b/win/configure.ac new file mode 100644 index 0000000..cdef517 --- /dev/null +++ b/win/configure.ac @@ -0,0 +1,314 @@ +#! /bin/bash -norc +# This file is an input file used by the GNU "autoconf" program to +# generate the file "configure", which is run during Tk installation +# to configure the system for the local environment. + +AC_INIT(../generic/tk.h) +AC_PREREQ(2.69) + +# The following define is needed when building with Cygwin since newer +# versions of autoconf incorrectly set SHELL to /bin/bash instead of +# /bin/sh. The bash shell seems to suffer from some strange failures. +SHELL=/bin/sh + +TK_VERSION=8.7 +TK_MAJOR_VERSION=8 +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="a0" +VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION + +#------------------------------------------------------------------------ +# Handle the --prefix=... option +#------------------------------------------------------------------------ + +if test "${prefix}" = "NONE"; then + prefix=/usr/local +fi +if test "${exec_prefix}" = "NONE"; then + exec_prefix=$prefix +fi +# libdir must be a fully qualified path (not ${exec_prefix}/lib) +eval libdir="$libdir" + +#------------------------------------------------------------------------ +# Standard compiler checks +#------------------------------------------------------------------------ + +# If the user did not set CFLAGS, set it now to keep +# the AC_PROG_CC macro from adding "-g -O2". +if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" +fi + +AC_PROG_CC +AC_C_INLINE +AC_HEADER_STDC + +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib) +AC_CHECK_TOOL(RC, windres) + +#-------------------------------------------------------------------- +# Checks to see if the make program sets the $MAKE variable. +#-------------------------------------------------------------------- + +AC_PROG_MAKE_SET + +#-------------------------------------------------------------------- +# Determines the correct binary file extension (.o, .obj, .exe etc.) +#-------------------------------------------------------------------- + +AC_OBJEXT +AC_EXEEXT + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + +SC_ENABLE_THREADS + +#-------------------------------------------------------------------- +# The statements below define a collection of symbols related to +# building libtk as a shared library instead of a static library. +#-------------------------------------------------------------------- + +SC_ENABLE_SHARED + +#-------------------------------------------------------------------- +# Locate and source the tclConfig.sh file. +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) +SC_LOAD_TCLCONFIG + +if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then + AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) +fi +if test "${TCL_MINOR_VERSION}" -lt 6; then + AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) +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. +#-------------------------------------------------------------------- + +SC_CONFIG_CFLAGS + +#-------------------------------------------------------------------- +# man2tcl needs this so that it can use errno.h +#-------------------------------------------------------------------- + +AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H") +AC_SUBST(MAN2TCLFLAGS) + +#------------------------------------------- +# Check for _strtoi64 +#------------------------------------------- + +AC_CACHE_CHECK([availability of _strtoi64], tcl_cv_strtoi64, [ + AC_TRY_LINK([#include ], + [_strtoi64(0,0,0)], + tcl_cv_strtoi64=yes, tcl_cv_strtoi64=no)]) +if test $tcl_cv_strtoi64 = no; then + AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?]) +fi + +#-------------------------------------------------------------------- +# Windows XP theme engine header for Ttk +#-------------------------------------------------------------------- + +AC_CHECK_HEADER([uxtheme.h], [AC_DEFINE(HAVE_UXTHEME_H)], + [AC_MSG_NOTICE([xpnative theme will be unavailable])], + [#include ]) +AC_CHECK_HEADER([vssym32.h], [AC_DEFINE(HAVE_VSSYM32_H)], [], + [#include +#include ]) + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. This macro depends on C flags, and should be called +# after SC_CONFIG_CFLAGS macro is called. +#-------------------------------------------------------------------- + +SC_ENABLE_SYMBOLS + +TK_DBGX=${DBGX} + +#-------------------------------------------------------------------- +# Embed the manifest if we can determine how +#-------------------------------------------------------------------- + +SC_EMBED_MANIFEST(wish.exe.manifest) + +SC_BUILD_TCLSH +SC_PROG_TCLSH + +#------------------------------------------------------------------------ +# tkConfig.sh refers to this by a different name +#------------------------------------------------------------------------ + +TK_SHARED_BUILD=${SHARED_BUILD} + +#-------------------------------------------------------------------- +# Perform final evaluations of variables with possible substitutions. +#-------------------------------------------------------------------- + +TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" +TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" +TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" + +eval "TK_SRC_DIR=\"`cd $srcdir/..; pwd`\"" + +eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}" +eval "TK_LIB_FILE=${LIBPREFIX}tk$VER${LIBSUFFIX}" + +eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" +# FIXME: All of this var junk needs to be done in tcl.m4 !!!! +# I left out the other vars that also need to get defined here. +# we also need to double check about spaces in path names +eval "TK_LIB_FLAG=\"-ltk${VER}${LIBFLAGSUFFIX}\"" +TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" +TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + +eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" +TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" + +TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" + +eval "DLLSUFFIX=${DLLSUFFIX}" +eval "LIBPREFIX=${LIBPREFIX}" +eval "LIBSUFFIX=${LIBSUFFIX}" +eval "EXESUFFIX=${EXESUFFIX}" + +CFG_TK_SHARED_LIB_SUFFIX=${TK_SHARED_LIB_SUFFIX} +CFG_TK_UNSHARED_LIB_SUFFIX=${TK_UNSHARED_LIB_SUFFIX} +CFG_TK_EXPORT_FILE_SUFFIX=${TK_EXPORT_FILE_SUFFIX} + +#-------------------------------------------------------------------- +# Adjust the defines for how the resources are built depending +# on symbols and static vs. shared. +#-------------------------------------------------------------------- + +if test ${SHARED_BUILD} = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then + if test "${DBGX}" = "d"; then + RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG" + else + RC_DEFINES="${RC_DEFINE} STATIC_BUILD" + fi + TK_RES="" +else + if test "${DBGX}" = "d"; then + RC_DEFINES="${RC_DEFINE} DEBUG" + else + RC_DEFINES="" + fi + TK_RES='tk.$(RES)' +fi + +# The wish.exe.manifest requires these +# TK_WIN_VERSION is the 4 dotted pair Windows version format which needs +# the release level, and must account for interim release versioning +case "$TK_PATCH_LEVEL" in + *a*) TK_RELEASE_LEVEL=0 ;; + *b*) TK_RELEASE_LEVEL=1 ;; + *) TK_RELEASE_LEVEL=2 ;; +esac +TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`" +AC_SUBST(TK_WIN_VERSION) +# X86|AMD64|IA64 for manifest +AC_SUBST(MACHINE) + +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_LIB_FILE) +AC_SUBST(TK_DLL_FILE) +AC_SUBST(TK_STUB_LIB_FILE) +AC_SUBST(TK_STUB_LIB_FLAG) +AC_SUBST(TK_BUILD_STUB_LIB_SPEC) +AC_SUBST(TK_SRC_DIR) +AC_SUBST(TK_BIN_DIR) + +AC_SUBST(TCL_VERSION) +AC_SUBST(TCL_MAJOR_VERSION) +AC_SUBST(TCL_MINOR_VERSION) +AC_SUBST(TCL_PATCH_LEVEL) + +AC_SUBST(TCL_SRC_DIR) +AC_SUBST(TCL_BIN_DIR) +AC_SUBST(TCL_DBGX) +AC_SUBST(CFG_TK_SHARED_LIB_SUFFIX) +AC_SUBST(CFG_TK_UNSHARED_LIB_SUFFIX) +AC_SUBST(CFG_TK_EXPORT_FILE_SUFFIX) + +AC_SUBST(CFLAGS_DEFAULT) +AC_SUBST(EXTRA_CFLAGS) +AC_SUBST(CYGPATH) +AC_SUBST(DEPARG) +AC_SUBST(CC_OBJNAME) +AC_SUBST(CC_EXENAME) + +# win/tcl.m4 doesn't set (LDFLAGS) +AC_SUBST(LDFLAGS_DEFAULT) +AC_SUBST(LDFLAGS_DEBUG) +AC_SUBST(LDFLAGS_OPTIMIZE) +AC_SUBST(LDFLAGS_CONSOLE) +AC_SUBST(LDFLAGS_WINDOW) +AC_SUBST(AR) +AC_SUBST(RANLIB) +AC_SUBST(TK_RES) + +AC_SUBST(STLIB_LD) +AC_SUBST(SHLIB_LD) +AC_SUBST(SHLIB_LD_LIBS) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_SUFFIX) +AC_SUBST(TK_SHARED_BUILD) + +AC_SUBST(LIBS) +AC_SUBST(LIBS_GUI) +AC_SUBST(DLLSUFFIX) +AC_SUBST(LIBPREFIX) +AC_SUBST(LIBSUFFIX) +AC_SUBST(EXESUFFIX) +AC_SUBST(LIBRARIES) +AC_SUBST(MAKE_LIB) +AC_SUBST(MAKE_STUB_LIB) +AC_SUBST(POST_MAKE_LIB) +AC_SUBST(MAKE_DLL) +AC_SUBST(MAKE_EXE) + +AC_SUBST(TK_LIB_FLAG) +AC_SUBST(TK_LIB_SPEC) +AC_SUBST(TK_BUILD_LIB_SPEC) +AC_SUBST(TK_STUB_LIB_SPEC) +AC_SUBST(TK_STUB_LIB_PATH) +AC_SUBST(TK_BUILD_STUB_LIB_PATH) + +# undefined at this point for win +AC_SUBST(TK_CC_SEARCH_FLAGS) +AC_SUBST(TK_LD_SEARCH_FLAGS) + +AC_SUBST(RC) +AC_SUBST(RC_OUT) +AC_SUBST(RC_TYPE) +AC_SUBST(RC_INCLUDE) +AC_SUBST(RC_DEFINE) +AC_SUBST(RC_DEFINES) +AC_SUBST(RES) + +AC_OUTPUT(Makefile tkConfig.sh wish.exe.manifest) + +dnl Local Variables: +dnl mode: autoconf; +dnl End: diff --git a/win/configure.in b/win/configure.in deleted file mode 100644 index cdef517..0000000 --- a/win/configure.in +++ /dev/null @@ -1,314 +0,0 @@ -#! /bin/bash -norc -# This file is an input file used by the GNU "autoconf" program to -# generate the file "configure", which is run during Tk installation -# to configure the system for the local environment. - -AC_INIT(../generic/tk.h) -AC_PREREQ(2.69) - -# The following define is needed when building with Cygwin since newer -# versions of autoconf incorrectly set SHELL to /bin/bash instead of -# /bin/sh. The bash shell seems to suffer from some strange failures. -SHELL=/bin/sh - -TK_VERSION=8.7 -TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=7 -TK_PATCH_LEVEL="a0" -VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION - -#------------------------------------------------------------------------ -# Handle the --prefix=... option -#------------------------------------------------------------------------ - -if test "${prefix}" = "NONE"; then - prefix=/usr/local -fi -if test "${exec_prefix}" = "NONE"; then - exec_prefix=$prefix -fi -# libdir must be a fully qualified path (not ${exec_prefix}/lib) -eval libdir="$libdir" - -#------------------------------------------------------------------------ -# Standard compiler checks -#------------------------------------------------------------------------ - -# If the user did not set CFLAGS, set it now to keep -# the AC_PROG_CC macro from adding "-g -O2". -if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" -fi - -AC_PROG_CC -AC_C_INLINE -AC_HEADER_STDC - -AC_CHECK_TOOL(AR, ar) -AC_CHECK_TOOL(RANLIB, ranlib) -AC_CHECK_TOOL(RC, windres) - -#-------------------------------------------------------------------- -# Checks to see if the make program sets the $MAKE variable. -#-------------------------------------------------------------------- - -AC_PROG_MAKE_SET - -#-------------------------------------------------------------------- -# Determines the correct binary file extension (.o, .obj, .exe etc.) -#-------------------------------------------------------------------- - -AC_OBJEXT -AC_EXEEXT - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - -SC_ENABLE_THREADS - -#-------------------------------------------------------------------- -# The statements below define a collection of symbols related to -# building libtk as a shared library instead of a static library. -#-------------------------------------------------------------------- - -SC_ENABLE_SHARED - -#-------------------------------------------------------------------- -# Locate and source the tclConfig.sh file. -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) -SC_LOAD_TCLCONFIG - -if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then - AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) -fi -if test "${TCL_MINOR_VERSION}" -lt 6; then - AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) -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. -#-------------------------------------------------------------------- - -SC_CONFIG_CFLAGS - -#-------------------------------------------------------------------- -# man2tcl needs this so that it can use errno.h -#-------------------------------------------------------------------- - -AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H") -AC_SUBST(MAN2TCLFLAGS) - -#------------------------------------------- -# Check for _strtoi64 -#------------------------------------------- - -AC_CACHE_CHECK([availability of _strtoi64], tcl_cv_strtoi64, [ - AC_TRY_LINK([#include ], - [_strtoi64(0,0,0)], - tcl_cv_strtoi64=yes, tcl_cv_strtoi64=no)]) -if test $tcl_cv_strtoi64 = no; then - AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?]) -fi - -#-------------------------------------------------------------------- -# Windows XP theme engine header for Ttk -#-------------------------------------------------------------------- - -AC_CHECK_HEADER([uxtheme.h], [AC_DEFINE(HAVE_UXTHEME_H)], - [AC_MSG_NOTICE([xpnative theme will be unavailable])], - [#include ]) -AC_CHECK_HEADER([vssym32.h], [AC_DEFINE(HAVE_VSSYM32_H)], [], - [#include -#include ]) - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols -# option. This macro depends on C flags, and should be called -# after SC_CONFIG_CFLAGS macro is called. -#-------------------------------------------------------------------- - -SC_ENABLE_SYMBOLS - -TK_DBGX=${DBGX} - -#-------------------------------------------------------------------- -# Embed the manifest if we can determine how -#-------------------------------------------------------------------- - -SC_EMBED_MANIFEST(wish.exe.manifest) - -SC_BUILD_TCLSH -SC_PROG_TCLSH - -#------------------------------------------------------------------------ -# tkConfig.sh refers to this by a different name -#------------------------------------------------------------------------ - -TK_SHARED_BUILD=${SHARED_BUILD} - -#-------------------------------------------------------------------- -# Perform final evaluations of variables with possible substitutions. -#-------------------------------------------------------------------- - -TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" -TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" -TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" - -eval "TK_SRC_DIR=\"`cd $srcdir/..; pwd`\"" - -eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}" -eval "TK_LIB_FILE=${LIBPREFIX}tk$VER${LIBSUFFIX}" - -eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" -# FIXME: All of this var junk needs to be done in tcl.m4 !!!! -# I left out the other vars that also need to get defined here. -# we also need to double check about spaces in path names -eval "TK_LIB_FLAG=\"-ltk${VER}${LIBFLAGSUFFIX}\"" -TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" -TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" - -eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" -TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" - -TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" -TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" -TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" - -eval "DLLSUFFIX=${DLLSUFFIX}" -eval "LIBPREFIX=${LIBPREFIX}" -eval "LIBSUFFIX=${LIBSUFFIX}" -eval "EXESUFFIX=${EXESUFFIX}" - -CFG_TK_SHARED_LIB_SUFFIX=${TK_SHARED_LIB_SUFFIX} -CFG_TK_UNSHARED_LIB_SUFFIX=${TK_UNSHARED_LIB_SUFFIX} -CFG_TK_EXPORT_FILE_SUFFIX=${TK_EXPORT_FILE_SUFFIX} - -#-------------------------------------------------------------------- -# Adjust the defines for how the resources are built depending -# on symbols and static vs. shared. -#-------------------------------------------------------------------- - -if test ${SHARED_BUILD} = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then - if test "${DBGX}" = "d"; then - RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG" - else - RC_DEFINES="${RC_DEFINE} STATIC_BUILD" - fi - TK_RES="" -else - if test "${DBGX}" = "d"; then - RC_DEFINES="${RC_DEFINE} DEBUG" - else - RC_DEFINES="" - fi - TK_RES='tk.$(RES)' -fi - -# The wish.exe.manifest requires these -# TK_WIN_VERSION is the 4 dotted pair Windows version format which needs -# the release level, and must account for interim release versioning -case "$TK_PATCH_LEVEL" in - *a*) TK_RELEASE_LEVEL=0 ;; - *b*) TK_RELEASE_LEVEL=1 ;; - *) TK_RELEASE_LEVEL=2 ;; -esac -TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`" -AC_SUBST(TK_WIN_VERSION) -# X86|AMD64|IA64 for manifest -AC_SUBST(MACHINE) - -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_LIB_FILE) -AC_SUBST(TK_DLL_FILE) -AC_SUBST(TK_STUB_LIB_FILE) -AC_SUBST(TK_STUB_LIB_FLAG) -AC_SUBST(TK_BUILD_STUB_LIB_SPEC) -AC_SUBST(TK_SRC_DIR) -AC_SUBST(TK_BIN_DIR) - -AC_SUBST(TCL_VERSION) -AC_SUBST(TCL_MAJOR_VERSION) -AC_SUBST(TCL_MINOR_VERSION) -AC_SUBST(TCL_PATCH_LEVEL) - -AC_SUBST(TCL_SRC_DIR) -AC_SUBST(TCL_BIN_DIR) -AC_SUBST(TCL_DBGX) -AC_SUBST(CFG_TK_SHARED_LIB_SUFFIX) -AC_SUBST(CFG_TK_UNSHARED_LIB_SUFFIX) -AC_SUBST(CFG_TK_EXPORT_FILE_SUFFIX) - -AC_SUBST(CFLAGS_DEFAULT) -AC_SUBST(EXTRA_CFLAGS) -AC_SUBST(CYGPATH) -AC_SUBST(DEPARG) -AC_SUBST(CC_OBJNAME) -AC_SUBST(CC_EXENAME) - -# win/tcl.m4 doesn't set (LDFLAGS) -AC_SUBST(LDFLAGS_DEFAULT) -AC_SUBST(LDFLAGS_DEBUG) -AC_SUBST(LDFLAGS_OPTIMIZE) -AC_SUBST(LDFLAGS_CONSOLE) -AC_SUBST(LDFLAGS_WINDOW) -AC_SUBST(AR) -AC_SUBST(RANLIB) -AC_SUBST(TK_RES) - -AC_SUBST(STLIB_LD) -AC_SUBST(SHLIB_LD) -AC_SUBST(SHLIB_LD_LIBS) -AC_SUBST(SHLIB_CFLAGS) -AC_SUBST(SHLIB_SUFFIX) -AC_SUBST(TK_SHARED_BUILD) - -AC_SUBST(LIBS) -AC_SUBST(LIBS_GUI) -AC_SUBST(DLLSUFFIX) -AC_SUBST(LIBPREFIX) -AC_SUBST(LIBSUFFIX) -AC_SUBST(EXESUFFIX) -AC_SUBST(LIBRARIES) -AC_SUBST(MAKE_LIB) -AC_SUBST(MAKE_STUB_LIB) -AC_SUBST(POST_MAKE_LIB) -AC_SUBST(MAKE_DLL) -AC_SUBST(MAKE_EXE) - -AC_SUBST(TK_LIB_FLAG) -AC_SUBST(TK_LIB_SPEC) -AC_SUBST(TK_BUILD_LIB_SPEC) -AC_SUBST(TK_STUB_LIB_SPEC) -AC_SUBST(TK_STUB_LIB_PATH) -AC_SUBST(TK_BUILD_STUB_LIB_PATH) - -# undefined at this point for win -AC_SUBST(TK_CC_SEARCH_FLAGS) -AC_SUBST(TK_LD_SEARCH_FLAGS) - -AC_SUBST(RC) -AC_SUBST(RC_OUT) -AC_SUBST(RC_TYPE) -AC_SUBST(RC_INCLUDE) -AC_SUBST(RC_DEFINE) -AC_SUBST(RC_DEFINES) -AC_SUBST(RES) - -AC_OUTPUT(Makefile tkConfig.sh wish.exe.manifest) - -dnl Local Variables: -dnl mode: autoconf; -dnl End: -- cgit v0.12 From 959d3f8c10cb4427661409386cb2ff80fc168f4b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Mar 2016 09:04:57 +0000 Subject: Eliminate configure warning: Makefile.in seems to ignore the --datarootdir setting. For details, see: [https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Changed-Directory-Variables.html] --- win/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/win/Makefile.in b/win/Makefile.in index 7b1766d..f1018eb 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -27,6 +27,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ +datarootdir = @datarootdir@ mandir = @mandir@ # The following definition can be set to non-null for special systems -- cgit v0.12 From bfe8b898cef5dee7be36a12e1125f870a70805fb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Mar 2016 10:20:06 +0000 Subject: Eliminate use of Tcl_SetResult(), and CONST -> const --- generic/tkTextDisp.c | 4 ++-- generic/tkTextIndex.c | 18 +++++++++--------- win/tkWinDialog.c | 7 +++---- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 1eea37d..d2499b3 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -594,7 +594,7 @@ static void AsyncUpdateLineMetrics(ClientData clientData); static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync); static void AsyncUpdateYScrollbar(ClientData clientData); static int IsStartOfNotMergedLine(TkText *textPtr, - CONST TkTextIndex *indexPtr); + const TkTextIndex *indexPtr); /* * Result values returned by TextGetScrollInfoObj: @@ -6805,7 +6805,7 @@ FindDLine( static int IsStartOfNotMergedLine( TkText *textPtr, /* Widget record for text widget. */ - CONST TkTextIndex *indexPtr) /* Index to check. */ + const TkTextIndex *indexPtr) /* Index to check. */ { TkTextIndex indexPtr2; diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 8820191..92ca03b 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -40,9 +40,9 @@ static const char * StartEnd(TkText *textPtr, const char *string, static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr, TkText *textPtr, const char *string, TkTextIndex *indexPtr, int *canCachePtr); -static int IndexCountBytesOrdered(CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, - CONST TkTextIndex *indexPtr2); +static int IndexCountBytesOrdered(const TkText *textPtr, + const TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr2); /* * The "textindex" Tcl_Obj definition: @@ -1636,9 +1636,9 @@ TkTextIndexForwChars( int TkTextIndexCountBytes( - CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, /* Index describing one location. */ - CONST TkTextIndex *indexPtr2) /* Index describing second location. */ + const TkText *textPtr, + const TkTextIndex *indexPtr1, /* Index describing one location. */ + const TkTextIndex *indexPtr2) /* Index describing second location. */ { int compare = TkTextIndexCmp(indexPtr1, indexPtr2); @@ -1653,11 +1653,11 @@ TkTextIndexCountBytes( static int IndexCountBytesOrdered( - CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, + const TkTextIndex *indexPtr1, /* Index describing location of character from * which to count. */ - CONST TkTextIndex *indexPtr2) + const TkTextIndex *indexPtr2) /* Index describing location of last character * at which to stop the count. */ { diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index d7f63fb..f763a7b 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -1113,7 +1113,7 @@ ParseOFNOptions( if (strcmp(Tcl_GetString(objv[i]), "-xpstyle")) goto error_return; if (i + 1 == objc) { - Tcl_SetResult(interp, "value for \"-xpstyle\" missing", TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("value for \"-xpstyle\" missing", -1)); Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); goto error_return; } @@ -1281,9 +1281,8 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, int oldMode; if (tsdPtr->newFileDialogsState != FDLG_STATE_USE_NEW) { - /* XXX - should be an assert but Tcl does not seem to have one? */ - Tcl_SetResult(interp, "Internal error: GetFileNameVista: IFileDialog API not available", TCL_STATIC); - return TCL_ERROR; + Tcl_Panic("Internal error: GetFileNameVista: IFileDialog API not available"); + return TCL_ERROR; } /* -- cgit v0.12 From d59be377f95879a31e6eb5e91e0cfd358b0a1a42 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 15 Mar 2016 11:34:29 +0000 Subject: Make tk.h usable for compilation with Tcl 9.0 (novem) as well. --- generic/tk.h | 2 +- generic/tkTest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index f51d793..9403f31 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -17,7 +17,7 @@ #define _TK #include -#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6) +#if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) # error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better #endif diff --git a/generic/tkTest.c b/generic/tkTest.c index fa9e073..42fc437 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -227,7 +227,7 @@ Tktest_Init( { static int initialized = 0; - if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6", 0) == NULL) { return TCL_ERROR; } if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) { -- cgit v0.12 From d7f29e1ccf269fa5f4cb2cd8d02f35193ebc67be Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 15 Mar 2016 14:01:56 +0000 Subject: Revert whitespace changes that made tests send-10.[89] fail. --- tests/send.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/send.test b/tests/send.test index f124861..945d4d0 100644 --- a/tests/send.test +++ b/tests/send.test @@ -441,7 +441,7 @@ test send-10.8 {SendEventProc procedure, exceptional return} {secureserver tests } { r -s 62 --r +-r -c 3 } test send-10.9 {SendEventProc procedure, empty return} {secureserver testsend} { @@ -453,7 +453,7 @@ test send-10.9 {SendEventProc procedure, empty return} {secureserver testsend} { } { r -s 62 --r +-r } test send-10.10 {SendEventProc procedure, asynchronous calls} {secureserver testsend} { testsend prop [winfo id .f] Comm {} -- cgit v0.12 From 2b27bfdd758f6c35adfaf96148424d06f51c9292 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 16 Mar 2016 09:37:12 +0000 Subject: Make Tk compile warning-free against TIP-389-enabled Tcl 8.7. No change of functionality, since font-names generally don't contain out-of-BMP Unicode characters (if they do in the future, that still can be fixed then). --- generic/tkFont.c | 6 +++--- generic/tkInt.h | 2 +- macosx/tkMacOSXFont.c | 4 ++-- unix/tkUnixFont.c | 2 +- unix/tkUnixRFont.c | 2 +- win/tkWinFont.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 102fc6e..1ffac16 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -497,7 +497,7 @@ Tk_FontObjCmd( const char *s; Tk_Font tkfont; Tcl_Obj *optPtr, *charPtr, *resultPtr; - Tcl_UniChar uniChar = 0; + int uniChar = 0; const TkFontAttributes *faPtr; TkFontAttributes fa; @@ -1714,10 +1714,10 @@ Tk_PostscriptFontName( } src += Tcl_UtfToUniChar(src, &ch); if (upper) { - ch = Tcl_UniCharToUpper(ch); + ch = (Tcl_UniChar) Tcl_UniCharToUpper(ch); upper = 0; } else { - ch = Tcl_UniCharToLower(ch); + ch = (Tcl_UniChar) Tcl_UniCharToLower(ch); } dest += Tcl_UniCharToUtf(ch, dest); } diff --git a/generic/tkInt.h b/generic/tkInt.h index b644c5b..600a2a3 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1196,7 +1196,7 @@ MODULE_SCOPE void TkUnderlineCharsInContext(Display *display, const char *string, int numBytes, int x, int y, int firstByte, int lastByte); MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, - Tcl_UniChar c, struct TkFontAttributes *faPtr); + int c, struct TkFontAttributes *faPtr); MODULE_SCOPE Tcl_Obj * TkNewWindowObj(Tk_Window tkwin); MODULE_SCOPE void TkpShowBusyWindow(TkBusy busy); MODULE_SCOPE void TkpHideBusyWindow(TkBusy busy); diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index c48e56e..d3e0e41 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -672,14 +672,14 @@ void TkpGetFontAttrsForChar( Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ - Tcl_UniChar c, /* Character of interest */ + int c, /* Character of interest */ TkFontAttributes* faPtr) /* Output: Font attributes */ { MacFont *fontPtr = (MacFont *) tkfont; NSFont *nsFont = fontPtr->nsFont; *faPtr = fontPtr->font.fa; if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) { - UTF16Char ch = c; + UTF16Char ch = (UTF16Char) c; nsFont = [nsFont bestMatchingFontForCharacters:&ch length:1 attributes:nil actualCoveredLength:NULL]; diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index a4998aa..1f4a1d4 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -946,7 +946,7 @@ void TkpGetFontAttrsForChar( Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ - Tcl_UniChar c, /* Character of interest */ + int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ { FontAttributes atts; diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index ab2ed4a..cc743a6 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -609,7 +609,7 @@ void TkpGetFontAttrsForChar( Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ - Tcl_UniChar c, /* Character of interest */ + int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ { UnixFtFont *fontPtr = (UnixFtFont *) tkfont; diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 9172b00..7b5e4c9 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -743,7 +743,7 @@ void TkpGetFontAttrsForChar( Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ - Tcl_UniChar c, /* Character of interest */ + int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ { WinFont *fontPtr = (WinFont *) tkfont; -- cgit v0.12 From e3c55a1c63f3103c8febf4251dff59ecb740cdf3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 16 Mar 2016 13:16:22 +0000 Subject: Fixed typo in comment --- generic/tkMenu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkMenu.c b/generic/tkMenu.c index d24516f..7f5389c 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -38,7 +38,7 @@ * implemented using menu clones. Menu clones are full menus in their own * right; they have a Tk window and pathname associated with them; they have a * TkMenu structure and array of entries. However, they are linked with the - * original menu that they were cloned from. The reflect the attributes of the + * original menu that they were cloned from. They reflect the attributes of the * original, or "master", menu. So if an item is added to a menu, and that * menu has clones, then the item must be added to all of its clones also. * Menus are cloned when a menu is torn-off or when a menu is assigned as a -- cgit v0.12 From f7a453a1ae131c17d52732ae042f69a7ce87f214 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 18 Mar 2016 19:46:25 +0000 Subject: Fixed error in comment --- generic/tkText.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkText.c b/generic/tkText.c index 3079417..5f87606 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -3016,7 +3016,7 @@ CountIndices( * If 'viewUpdate' is true, we may adjust the window contents' * y-position, and scrollbar setting. * - * If 'viewUpdate' is false, true we can guarantee that textPtr->topIndex + * If 'viewUpdate' is true we can guarantee that textPtr->topIndex * points to a valid TkTextLine after this function returns. However, if * 'viewUpdate' is false, then there is no such guarantee (since * topIndex.linePtr can be garbage). The caller is expected to take -- cgit v0.12 From a6147a73cc09ce18e35f8dce240c9bbdb8462512 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 20 Mar 2016 08:28:05 +0000 Subject: Merged tip-443 following acceptation of the TIP by TCT vote (cherrypicked [cb3354b298]) --- doc/text.n | 45 +++++++++++++++ generic/tkText.c | 20 ++++++- generic/tkText.h | 13 +++++ generic/tkTextDisp.c | 106 +++++++++++++++++++++++++++++++++-- generic/tkTextTag.c | 40 ++++++++++++- tests/textTag.test | 154 ++++++++++++++++++++++++++++++++++++++++++++++++--- 6 files changed, 359 insertions(+), 19 deletions(-) diff --git a/doc/text.n b/doc/text.n index 6266a04..e20b68c 100644 --- a/doc/text.n +++ b/doc/text.n @@ -486,6 +486,15 @@ much the line should be indented from the left edge of the window. option is only used when wrapping is enabled, and it only applies to the second and later display lines for a text line. .TP +\fB\-lmargincolor \fIcolor\fR +. +\fIColor\fR specifies the background color to use in regions that do not +contain characters because they are indented by \fB\-lmargin1\fR or +\fB\-lmargin2\fR. It may have any of the forms accepted by +\fBTk_GetColor\fR.If \fIcolor\fR has not been specified, or if it is +specified as an empty string, then the color specified by the +\fB-background\fR widget option is used. +.TP \fB\-offset \fIpixels\fR . \fIPixels\fR specifies an amount by which the text's baseline should be offset @@ -500,6 +509,13 @@ Specifies whether or not to draw a horizontal rule through the middle of characters. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP +\fB\-overstrikefg \fIcolor\fR +. +\fIColor\fR specifies the color to use when displaying the overstrike. It may +have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not +been specified, or if it is specified as an empty string, then the color +specified by the \fB\-foreground\fR tag option is used. +.TP \fB\-relief \fIrelief\fR . \fIRelief\fR specifies the relief style to use for drawing the border, in any @@ -517,6 +533,28 @@ option is only used when wrapping is enabled. If a text line wraps, the right margin for each line on the display is determined by the first non-elided character of that display line. .TP +\fB\-rmargincolor \fIcolor\fR +. +\fIColor\fR specifies the background color to use in regions that do not +contain characters because they are indented by \fB\-rmargin1\fR. It may +have any of the forms accepted by \fBTk_GetColor\fR.If \fIcolor\fR has not +been specified, or if it is specified as an empty string, then the color +specified by the \fB-background\fR widget option is used. +.TP +\fB\-selectbackground \fIcolor\fR +\fIColor\fR specifies the background color to use when displaying selected +items. It may have any of the forms accepted by \fBTk_GetColor\fR. If +\fIcolor\fR has not been specified, or if it is specified as an empty +string, then the color specified by the \fB\-background\fR tag option is +used. +.TP +\fB\-selectforeground \fIcolor\fR +\fIColor\fR specifies the foreground color to use when displaying selected +items. It may have any of the forms accepted by \fBTk_GetColor\fR. If +\fIcolor\fR has not been specified, or if it is specified as an empty +string, then the color specified by the \fB\-foreground\fR tag option is +used. +.TP \fB\-spacing1 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left above each @@ -559,6 +597,13 @@ unspecified for the tag (the default). \fIBoolean\fR specifies whether or not to draw an underline underneath characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP +\fB\-underlinefg \fIcolor\fR +. +\fIColor\fR specifies the color to use when displaying the underline. It may +have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not +been specified, or if it is specified as an empty string, then the color +specified by the \fB\-foreground\fR tag option is used. +.TP \fB\-wrap \fImode\fR . \fIMode\fR specifies how to handle lines that are wider than the text's diff --git a/generic/tkText.c b/generic/tkText.c index 5f87606..76251c0 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2253,12 +2253,20 @@ ConfigureText( * replaced in the widget record. */ - textPtr->selTagPtr->border = textPtr->selBorder; + if (textPtr->selTagPtr->selBorder == NULL) { + textPtr->selTagPtr->border = textPtr->selBorder; + } else { + textPtr->selTagPtr->selBorder = textPtr->selBorder; + } if (textPtr->selTagPtr->borderWidthPtr != textPtr->selBorderWidthPtr) { textPtr->selTagPtr->borderWidthPtr = textPtr->selBorderWidthPtr; textPtr->selTagPtr->borderWidth = textPtr->selBorderWidth; } - textPtr->selTagPtr->fgColor = textPtr->selFgColorPtr; + if (textPtr->selTagPtr->selFgColor == NULL) { + textPtr->selTagPtr->fgColor = textPtr->selFgColorPtr; + } else { + textPtr->selTagPtr->selFgColor = textPtr->selFgColorPtr; + } textPtr->selTagPtr->affectsDisplay = 0; textPtr->selTagPtr->affectsDisplayGeometry = 0; if ((textPtr->selTagPtr->elideString != NULL) @@ -2277,12 +2285,18 @@ ConfigureText( textPtr->selTagPtr->affectsDisplayGeometry = 1; } if ((textPtr->selTagPtr->border != NULL) + || (textPtr->selTagPtr->selBorder != NULL) || (textPtr->selTagPtr->reliefString != NULL) || (textPtr->selTagPtr->bgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) + || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) - || (textPtr->selTagPtr->underlineString != NULL)) { + || (textPtr->selTagPtr->overstrikeColor != NULL) + || (textPtr->selTagPtr->underlineString != NULL) + || (textPtr->selTagPtr->underlineColor != NULL) + || (textPtr->selTagPtr->lMarginColor != NULL) + || (textPtr->selTagPtr->rMarginColor != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; } TkTextRedrawTag(NULL, textPtr, NULL, NULL, textPtr->selTagPtr, 1); diff --git a/generic/tkText.h b/generic/tkText.h index fc92644..5d88784 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -347,6 +347,9 @@ typedef struct TkTextTag { int lMargin2; /* Left margin for second and later display * lines of each text line, in pixels. Only * valid if lMargin2String is non-NULL. */ + Tk_3DBorder lMarginColor; /* Used for drawing background in left margins. + * This is used for both lmargin1 and lmargin2. + * NULL means no value specified here. */ char *offsetString; /* -offset option string (malloc-ed). NULL * means option not specified. */ int offset; /* Vertical offset of text's baseline from @@ -358,10 +361,18 @@ typedef struct TkTextTag { int overstrike; /* Non-zero means draw horizontal line through * middle of text. Only valid if * overstrikeString is non-NULL. */ + XColor *overstrikeColor; /* Color for the overstrike. NULL means same + * color as foreground. */ char *rMarginString; /* -rmargin option string (malloc-ed). NULL * means option not specified. */ int rMargin; /* Right margin for text, in pixels. Only * valid if rMarginString is non-NULL. */ + Tk_3DBorder rMarginColor; /* Used for drawing background in right margin. + * NULL means no value specified here. */ + Tk_3DBorder selBorder; /* Used for drawing background for selected text. + * NULL means no value specified here. */ + XColor *selFgColor; /* Foreground color for selected text. NULL means + * no value specified here. */ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for @@ -389,6 +400,8 @@ typedef struct TkTextTag { int underline; /* Non-zero means draw underline underneath * text. Only valid if underlineString is * non-NULL. */ + XColor *underlineColor; /* Color for the underline. NULL means same + * color as foreground. */ TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * Must be TEXT_WRAPMODE_CHAR, * TEXT_WRAPMODE_NONE, TEXT_WRAPMODE_WORD, or diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d2499b3..72fc50c 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -136,11 +136,15 @@ typedef struct StyleValues { * line of each text line. */ int lMargin2; /* Left margin, in pixels, for second and * later display lines of each text line. */ + Tk_3DBorder lMarginColor; /* Color of left margins (1 and 2). */ int offset; /* Offset in pixels of baseline, relative to * baseline of line. */ int overstrike; /* Non-zero means draw overstrike through * text. */ + XColor *overstrikeColor; /* Foreground color for overstrike through + * text. */ int rMargin; /* Right margin, in pixels. */ + Tk_3DBorder rMarginColor; /* Color of right margin. */ int spacing1; /* Spacing above first dline in text line. */ int spacing2; /* Spacing between lines of dline. */ int spacing3; /* Spacing below last dline in text line. */ @@ -149,6 +153,8 @@ typedef struct StyleValues { int tabStyle; /* One of TABULAR or WORDPROCESSOR. */ int underline; /* Non-zero means draw underline underneath * text. */ + XColor *underlineColor; /* Foreground color for underline underneath + * text. */ int elide; /* Zero means draw text, otherwise not. */ TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * One of TEXT_WRAPMODE_CHAR, @@ -167,6 +173,8 @@ typedef struct TextStyle { GC bgGC; /* Graphics context for background. None means * use widget background. */ GC fgGC; /* Graphics context for foreground. */ + GC ulGC; /* Graphics context for underline. */ + GC ovGC; /* Graphics context for overstrike. */ StyleValues *sValuePtr; /* Raw information from which GCs were * derived. */ Tcl_HashEntry *hPtr; /* Pointer to entry in styleTable. Used to @@ -234,6 +242,14 @@ typedef struct DLine { int spaceBelow; /* How much extra space was added to the * bottom of the line because of spacing * options. This is included in height. */ + Tk_3DBorder lMarginColor; /* Background color of the area corresponding + * to the left margin of the display line. */ + int lMarginWidth; /* Pixel width of the area corresponding to + * the left margin. */ + Tk_3DBorder rMarginColor; /* Background color of the area corresponding + * to the right margin of the display line. */ + int rMarginWidth; /* Pixel width of the area corresponding to + * the right margin. */ int length; /* Total length of line, in pixels. */ TkTextDispChunk *chunkPtr; /* Pointer to first chunk in list of all of * those that are displayed on this line of @@ -748,6 +764,7 @@ GetStyle( TextStyle *stylePtr; Tcl_HashEntry *hPtr; int numTags, isNew, i; + int isSelected; XGCValues gcValues; unsigned long mask; /* @@ -758,6 +775,7 @@ GetStyle( int fgPrio, fontPrio, fgStipplePrio; int underlinePrio, elidePrio, justifyPrio, offsetPrio; int lMargin1Prio, lMargin2Prio, rMarginPrio; + int lMarginColorPrio, rMarginColorPrio; int spacing1Prio, spacing2Prio, spacing3Prio; int overstrikePrio, tabPrio, tabStylePrio, wrapPrio; @@ -772,11 +790,14 @@ GetStyle( fgPrio = fontPrio = fgStipplePrio = -1; underlinePrio = elidePrio = justifyPrio = offsetPrio = -1; lMargin1Prio = lMargin2Prio = rMarginPrio = -1; + lMarginColorPrio = rMarginColorPrio = -1; spacing1Prio = spacing2Prio = spacing3Prio = -1; overstrikePrio = tabPrio = tabStylePrio = wrapPrio = -1; memset(&styleValues, 0, sizeof(StyleValues)); styleValues.relief = TK_RELIEF_FLAT; styleValues.fgColor = textPtr->fgColor; + styleValues.underlineColor = textPtr->fgColor; + styleValues.overstrikeColor = textPtr->fgColor; styleValues.tkfont = textPtr->tkfont; styleValues.justify = TK_JUSTIFY_LEFT; styleValues.spacing1 = textPtr->spacing1; @@ -786,12 +807,22 @@ GetStyle( styleValues.tabStyle = textPtr->tabStyle; styleValues.wrapMode = textPtr->wrapMode; styleValues.elide = 0; + isSelected = 0; + + for (i = 0 ; i < numTags; i++) { + if (textPtr->selTagPtr == tagPtrs[i]) { + isSelected = 1; + break; + } + } for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; + XColor *fgColor; tagPtr = tagPtrs[i]; border = tagPtr->border; + fgColor = tagPtr->fgColor; /* * If this is the selection tag, and inactiveSelBorder is NULL (the @@ -811,6 +842,14 @@ GetStyle( border = textPtr->inactiveSelBorder; } + if ((tagPtr->selBorder != NULL) && (isSelected)) { + border = tagPtr->selBorder; + } + + if ((tagPtr->selFgColor != None) && (isSelected)) { + fgColor = tagPtr->selFgColor; + } + if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; @@ -834,8 +873,8 @@ GetStyle( styleValues.bgStipple = tagPtr->bgStipple; bgStipplePrio = tagPtr->priority; } - if ((tagPtr->fgColor != None) && (tagPtr->priority > fgPrio)) { - styleValues.fgColor = tagPtr->fgColor; + if ((fgColor != None) && (tagPtr->priority > fgPrio)) { + styleValues.fgColor = fgColor; fgPrio = tagPtr->priority; } if ((tagPtr->tkfont != None) && (tagPtr->priority > fontPrio)) { @@ -862,6 +901,11 @@ GetStyle( styleValues.lMargin2 = tagPtr->lMargin2; lMargin2Prio = tagPtr->priority; } + if ((tagPtr->lMarginColor != NULL) + && (tagPtr->priority > lMarginColorPrio)) { + styleValues.lMarginColor = tagPtr->lMarginColor; + lMarginColorPrio = tagPtr->priority; + } if ((tagPtr->offsetString != NULL) && (tagPtr->priority > offsetPrio)) { styleValues.offset = tagPtr->offset; @@ -871,12 +915,22 @@ GetStyle( && (tagPtr->priority > overstrikePrio)) { styleValues.overstrike = tagPtr->overstrike; overstrikePrio = tagPtr->priority; + if (tagPtr->overstrikeColor != None) { + styleValues.overstrikeColor = tagPtr->overstrikeColor; + } else if (fgColor != None) { + styleValues.overstrikeColor = fgColor; + } } if ((tagPtr->rMarginString != NULL) && (tagPtr->priority > rMarginPrio)) { styleValues.rMargin = tagPtr->rMargin; rMarginPrio = tagPtr->priority; } + if ((tagPtr->rMarginColor != NULL) + && (tagPtr->priority > rMarginColorPrio)) { + styleValues.rMarginColor = tagPtr->rMarginColor; + rMarginColorPrio = tagPtr->priority; + } if ((tagPtr->spacing1String != NULL) && (tagPtr->priority > spacing1Prio)) { styleValues.spacing1 = tagPtr->spacing1; @@ -906,6 +960,11 @@ GetStyle( && (tagPtr->priority > underlinePrio)) { styleValues.underline = tagPtr->underline; underlinePrio = tagPtr->priority; + if (tagPtr->underlineColor != None) { + styleValues.underlineColor = tagPtr->underlineColor; + } else if (fgColor != None) { + styleValues.underlineColor = fgColor; + } } if ((tagPtr->elideString != NULL) && (tagPtr->priority > elidePrio)) { @@ -962,6 +1021,11 @@ GetStyle( mask |= GCStipple|GCFillStyle; } stylePtr->fgGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); + mask = GCForeground; + gcValues.foreground = styleValues.underlineColor->pixel; + stylePtr->ulGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); + gcValues.foreground = styleValues.overstrikeColor->pixel; + stylePtr->ovGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); stylePtr->sValuePtr = (StyleValues *) Tcl_GetHashKey(&textPtr->dInfoPtr->styleTable, hPtr); stylePtr->hPtr = hPtr; @@ -1002,6 +1066,12 @@ FreeStyle( if (stylePtr->fgGC != None) { Tk_FreeGC(textPtr->display, stylePtr->fgGC); } + if (stylePtr->ulGC != None) { + Tk_FreeGC(textPtr->display, stylePtr->ulGC); + } + if (stylePtr->ovGC != None) { + Tk_FreeGC(textPtr->display, stylePtr->ovGC); + } Tcl_DeleteHashEntry(stylePtr->hPtr); ckfree(stylePtr); } @@ -1113,6 +1183,10 @@ LayoutDLine( dlPtr->nextPtr = NULL; dlPtr->flags = NEW_LAYOUT | OLD_Y_INVALID; dlPtr->logicalLinesMerged = 0; + dlPtr->lMarginColor = NULL; + dlPtr->lMarginWidth = 0; + dlPtr->rMarginColor = NULL; + dlPtr->rMarginWidth = 0; /* * This is not necessarily totally correct, where we have merged logical @@ -1387,6 +1461,7 @@ LayoutDLine( x = chunkPtr->stylePtr->sValuePtr->lMargin2; } + dlPtr->lMarginWidth = x; if (wrapMode == TEXT_WRAPMODE_NONE) { maxX = -1; } else { @@ -1698,6 +1773,11 @@ LayoutDLine( } dlPtr->height += dlPtr->spaceAbove + dlPtr->spaceBelow; dlPtr->baseline += dlPtr->spaceAbove; + dlPtr->lMarginColor = sValuePtr->lMarginColor; + dlPtr->rMarginColor = sValuePtr->rMarginColor; + if (wrapMode != TEXT_WRAPMODE_NONE) { + dlPtr->rMarginWidth = rMargin; + } /* * Recompute line length: may have changed because of justification. @@ -2384,6 +2464,20 @@ DisplayDLine( Tk_Width(textPtr->tkwin), dlPtr->height, 0, TK_RELIEF_FLAT); /* + * Second, draw the background color of the left and right margins. + */ + if (dlPtr->lMarginColor != NULL) { + Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y, + dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset, + dlPtr->height, 0, TK_RELIEF_FLAT); + } + if (dlPtr->rMarginColor != NULL) { + Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->rMarginColor, + dInfoPtr->maxX - dlPtr->rMarginWidth + dInfoPtr->curXPixelOffset, + y, dlPtr->rMarginWidth, dlPtr->height, 0, TK_RELIEF_FLAT); + } + + /* * Next, draw background information for the whole line. */ @@ -7845,7 +7939,7 @@ CharDisplayProc( y + baseline - sValuePtr->offset); if (sValuePtr->underline) { - TkUnderlineCharsInContext(display, dst, stylePtr->fgGC, + TkUnderlineCharsInContext(display, dst, stylePtr->ulGC, sValuePtr->tkfont, string, numBytes, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset, @@ -7855,7 +7949,7 @@ CharDisplayProc( Tk_FontMetrics fm; Tk_GetFontMetrics(sValuePtr->tkfont, &fm); - TkUnderlineCharsInContext(display, dst, stylePtr->fgGC, + TkUnderlineCharsInContext(display, dst, stylePtr->ovGC, sValuePtr->tkfont, string, numBytes, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset @@ -7872,7 +7966,7 @@ CharDisplayProc( Tk_DrawChars(display, dst, stylePtr->fgGC, sValuePtr->tkfont, string, numBytes, offsetX, y + baseline - sValuePtr->offset); if (sValuePtr->underline) { - Tk_UnderlineChars(display, dst, stylePtr->fgGC, sValuePtr->tkfont, + Tk_UnderlineChars(display, dst, stylePtr->ulGC, sValuePtr->tkfont, string, offsetX, y + baseline - sValuePtr->offset, 0, numBytes); @@ -7882,7 +7976,7 @@ CharDisplayProc( Tk_FontMetrics fm; Tk_GetFontMetrics(sValuePtr->tkfont, &fm); - Tk_UnderlineChars(display, dst, stylePtr->fgGC, sValuePtr->tkfont, + Tk_UnderlineChars(display, dst, stylePtr->ovGC, sValuePtr->tkfont, string, offsetX, y + baseline - sValuePtr->offset - fm.descent - (fm.ascent * 3) / 10, diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 3363d25..a212615 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -61,15 +61,26 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-lmargin2", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, + {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-offset", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-overstrike", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, overstrikeString), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, overstrikeColor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-relief", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-rmargin", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, + {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing2", NULL, NULL, @@ -84,6 +95,9 @@ static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_STRING, "-underline", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, underlineString), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, underlineColor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, wrapMode), TK_OPTION_NULL_OK, wrapStrings, 0}, @@ -484,10 +498,18 @@ TkTextTagCmd( */ if (tagPtr == textPtr->selTagPtr) { - textPtr->selBorder = tagPtr->border; + if (tagPtr->selBorder == NULL) { + textPtr->selBorder = tagPtr->border; + } else { + textPtr->selBorder = tagPtr->selBorder; + } textPtr->selBorderWidth = tagPtr->borderWidth; textPtr->selBorderWidthPtr = tagPtr->borderWidthPtr; - textPtr->selFgColorPtr = tagPtr->fgColor; + if (tagPtr->selFgColor == NULL) { + textPtr->selFgColorPtr = tagPtr->fgColor; + } else { + textPtr->selFgColorPtr = tagPtr->selFgColor; + } } tagPtr->affectsDisplay = 0; @@ -509,12 +531,18 @@ TkTextTagCmd( tagPtr->affectsDisplayGeometry = 1; } if ((tagPtr->border != NULL) + || (tagPtr->selBorder != NULL) || (tagPtr->reliefString != NULL) || (tagPtr->bgStipple != None) || (tagPtr->fgColor != NULL) + || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) || (tagPtr->overstrikeString != NULL) - || (tagPtr->underlineString != NULL)) { + || (tagPtr->overstrikeColor != NULL) + || (tagPtr->underlineString != NULL) + || (tagPtr->underlineColor != NULL) + || (tagPtr->lMarginColor != NULL) + || (tagPtr->rMarginColor != NULL)) { tagPtr->affectsDisplay = 1; } if (!newTag) { @@ -1011,12 +1039,17 @@ TkTextCreateTag( tagPtr->lMargin1 = 0; tagPtr->lMargin2String = NULL; tagPtr->lMargin2 = 0; + tagPtr->lMarginColor = NULL; tagPtr->offsetString = NULL; tagPtr->offset = 0; tagPtr->overstrikeString = NULL; tagPtr->overstrike = 0; + tagPtr->overstrikeColor = NULL; tagPtr->rMarginString = NULL; tagPtr->rMargin = 0; + tagPtr->rMarginColor = NULL; + tagPtr->selBorder = NULL; + tagPtr->selFgColor = NULL; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; tagPtr->spacing2String = NULL; @@ -1028,6 +1061,7 @@ TkTextCreateTag( tagPtr->tabStyle = TK_TEXT_TABSTYLE_NONE; tagPtr->underlineString = NULL; tagPtr->underline = 0; + tagPtr->underlineColor = NULL; tagPtr->elideString = NULL; tagPtr->elide = 0; tagPtr->wrapMode = TEXT_WRAPMODE_NULL; diff --git a/tests/textTag.test b/tests/textTag.test index 08a9455..f10a2ad 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -168,6 +168,17 @@ test textTag-1.17 {configuration options} -constraints { } -cleanup { .t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3] } -returnCodes error -result {bad screen distance "bad"} +test textTag-1.17a {tag configuration options} -body { + .t tag configure x -lmargincolor lightgreen + .t tag cget x -lmargincolor +} -cleanup { + .t tag configure x -lmargincolor [lindex [.t tag configure x -lmargincolor] 3] +} -result {lightgreen} +test textTag-1.17b {configuration options} -body { + .t tag configure x -lmargincolor non-existent +} -cleanup { + .t tag configure x -lmargincolor [lindex [.t tag configure x -lmargincolor] 3] +} -returnCodes error -result {unknown color name "non-existent"} test textTag-1.18 {tag configuration options} -constraints { haveCourier12 } -body { @@ -198,6 +209,17 @@ test textTag-1.21 {configuration options} -constraints { } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] } -returnCodes error -result {expected boolean value but got "stupid"} +test textTag-1.21a {tag configuration options} -body { + .t tag configure x -overstrikefg red + .t tag cget x -overstrikefg +} -cleanup { + .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3] +} -result {red} +test textTag-1.21b {configuration options} -body { + .t tag configure x -overstrikefg stupid +} -cleanup { + .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3] +} -returnCodes error -result {unknown color name "stupid"} test textTag-1.22 {tag configuration options} -constraints { haveCourier12 } -body { @@ -228,6 +250,39 @@ test textTag-1.25 {configuration options} -constraints { } -cleanup { .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3] } -returnCodes error -result {bad screen distance "bad"} +test textTag-1.25a {tag configuration options} -body { + .t tag configure x -rmargincolor darkblue + .t tag cget x -rmargincolor +} -cleanup { + .t tag configure x -rmargincolor [lindex [.t tag configure x -rmargincolor] 3] +} -result {darkblue} +test textTag-1.25b {configuration options} -body { + .t tag configure x -rmargincolor non-existent +} -cleanup { + .t tag configure x -rmargincolor [lindex [.t tag configure x -rmargincolor] 3] +} -returnCodes error -result {unknown color name "non-existent"} +test textTag-1.25c {tag configuration options} -body { + .t tag configure x -selectbackground #012345 + .t tag cget x -selectbackground +} -cleanup { + .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] +} -result {#012345} +test textTag-1.25d {configuration options} -body { + .t tag configure x -selectbackground non-existent +} -cleanup { + .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] +} -returnCodes error -result {unknown color name "non-existent"} +test textTag-1.25e {tag configuration options} -body { + .t tag configure x -selectforeground #012345 + .t tag cget x -selectforeground +} -cleanup { + .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] +} -result {#012345} +test textTag-1.25f {configuration options} -body { + .t tag configure x -selectforeground non-existent +} -cleanup { + .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] +} -returnCodes error -result {unknown color name "non-existent"} test textTag-1.26 {tag configuration options} -constraints { haveCourier12 } -body { @@ -303,6 +358,17 @@ test textTag-1.35 {configuration options} -constraints { } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -returnCodes error -result {expected boolean value but got "stupid"} +test textTag-1.36 {tag configuration options} -body { + .t tag configure x -underlinefg red + .t tag cget x -underlinefg +} -cleanup { + .t tag configure x -underlinefg [lindex [.t tag configure x -underlinefg] 3] +} -result {red} +test textTag-1.37 {configuration options} -body { + .t tag configure x -underlinefg stupid +} -cleanup { + .t tag configure x -underlinefg [lindex [.t tag configure x -underlinefg] 3] +} -returnCodes error -result {unknown color name "stupid"} test textTag-2.1 {TkTextTagCmd - "add" option} -constraints { @@ -559,6 +625,13 @@ test textTag-5.4 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -result {-underline {} {} {} yes} +test textTag-5.4a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -underlinefg lightgreen + .t tag configure x -underlinefg +} -cleanup { + .t tag delete x +} -result {-underlinefg {} {} {} lightgreen} test textTag-5.5 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { @@ -568,6 +641,13 @@ test textTag-5.5 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -result {on} +test textTag-5.5a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -overstrikefg lightgreen + .t tag configure x -overstrikefg +} -cleanup { + .t tag delete x +} -result {-overstrikefg {} {} {} lightgreen} test textTag-5.6 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { @@ -625,16 +705,19 @@ test textTag-5.12 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "1.0q"} -test textTag-5.13 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.13 {TkTextTagCmd - "configure" option} -body { .t tag delete x - .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 + .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 \ + -lmargincolor darkblue -rmargincolor lightgreen list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \ - [.t tag configure x -rmargin] + [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] \ + [.t tag configure x -rmargincolor] } -cleanup { .t tag delete x -} -result {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5}} +} -result [list {-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} \ + {-rmargin {} {} {} 5} \ + {-lmargincolor {} {} {} darkblue} {-rmargincolor {} {} {} lightgreen} \ + ] test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { @@ -651,6 +734,12 @@ test textTag-5.15 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "gorp"} +test textTag-5.15a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -lmargincolor rainbow +} -cleanup { + .t tag delete x +} -returnCodes error -result {unknown color name "rainbow"} test textTag-5.16 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { @@ -659,6 +748,12 @@ test textTag-5.16 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "140.1.1"} +test textTag-5.16a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -rmargincolor rainbow +} -cleanup { + .t tag delete x +} -returnCodes error -result {unknown color name "rainbow"} .t tag delete x test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 @@ -713,7 +808,52 @@ test textTag-5.22 {TkTextTagCmd - "configure" option} -constraints { .t tag configure sel -borderwidth {} .t cget -selectborderwidth } -result {} - +test textTag-5.23 {TkTextTagCmd - "configure" option} -body { + set x {} + # when [.t tag cget sel -selectbackground] == "", mirroring happens between + # the text widget option -selectbackground + # and the tag option -background + .t tag configure sel -selectbackground {} + .t configure -selectbackground black + .t tag configure sel -background yellow + lappend x [.t cget -selectbackground] + .t tag configure sel -background orange + .t configure -selectbackground blue + lappend x [.t tag cget sel -background] + # when [.t tag cget sel -selectbackground] != "", mirroring happens between + # the text widget option -selectbackground + # and the tag option -selectbackground + .t tag configure sel -selectbackground green + .t configure -selectbackground red + lappend x [.t tag cget sel -selectbackground] + .t configure -selectbackground black + .t tag configure sel -selectbackground white + lappend x [.t cget -selectbackground] + return $x +} -result {yellow blue red white} +test textTag-5.24 {TkTextTagCmd - "configure" option} -body { + set x {} + # when [.t tag cget sel -selectforeground] == "", mirroring happens between + # the text widget option -selectforeground + # and the tag option -foreground + .t tag configure sel -selectforeground {} + .t configure -selectforeground black + .t tag configure sel -foreground yellow + lappend x [.t cget -selectforeground] + .t tag configure sel -foreground orange + .t configure -selectforeground blue + lappend x [.t tag cget sel -foreground] + # when [.t tag cget sel -selectforeground] != "", mirroring happens between + # the text widget option -selectforeground + # and the tag option -selectforeground + .t tag configure sel -selectforeground green + .t configure -selectforeground red + lappend x [.t tag cget sel -selectforeground] + .t configure -selectforeground black + .t tag configure sel -selectforeground white + lappend x [.t cget -selectforeground] + return $x +} -result {yellow blue red white} test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints { haveCourier12 -- cgit v0.12 From 12425df1534b3eba6664117959c1c5c56f767986 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 20 Mar 2016 11:49:28 +0000 Subject: Fixed bug [438cf10142] - Tests textTag-* require haveCourier12 constraint --- tests/textTag.test | 601 ++++++++++++++--------------------------------------- 1 file changed, 154 insertions(+), 447 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index f10a2ad..2df8c5a 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -13,9 +13,6 @@ tcltest::loadTestedCommands destroy .t text .t -width 20 -height 10 -testConstraint haveCourier12 [expr {[catch { - .t configure -font {Courier 12} -}] == 0}] pack append . .t {top expand fill} update @@ -40,130 +37,96 @@ bOy GIrl .#@? x_yz !@#$% Line 7" -test textTag-1.1 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.1 {tag configuration options} -body { .t tag configure x -background #012345 .t tag cget x -background } -cleanup { .t tag configure x -background [lindex [.t tag configure x -background] 3] } -result {#012345} -test textTag-1.2 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.2 {configuration options} -body { .t tag configure x -background non-existent } -cleanup { .t tag configure x -background [lindex [.t tag configure x -background] 3] } -returnCodes error -result {unknown color name "non-existent"} -test textTag-1.3 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.3 {tag configuration options} -body { .t tag configure x -bgstipple gray50 .t tag cget x -bgstipple } -cleanup { .t tag configure x -bgstipple [lindex [.t tag configure x -bgstipple] 3] } -result {gray50} -test textTag-1.4 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.4 {configuration options} -body { .t tag configure x -bgstipple badStipple } -cleanup { .t tag configure x -bgstipple [lindex [.t tag configure x -bgstipple] 3] } -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.5 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.5 {tag configuration options} -body { .t tag configure x -borderwidth 2 .t tag cget x -borderwidth } -cleanup { .t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3] } -result {2} -test textTag-1.6 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.6 {configuration options} -body { .t tag configure x -borderwidth 46q } -cleanup { .t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3] } -returnCodes error -result {bad screen distance "46q"} -test textTag-1.7 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.7 {tag configuration options} -body { .t tag configure x -fgstipple gray25 .t tag cget x -fgstipple } -cleanup { .t tag configure x -fgstipple [lindex [.t tag configure x -fgstipple] 3] } -result {gray25} -test textTag-1.8 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.8 {configuration options} -body { .t tag configure x -fgstipple bogus } -cleanup { .t tag configure x -fgstipple [lindex [.t tag configure x -fgstipple] 3] } -returnCodes error -result {bitmap "bogus" not defined} -test textTag-1.9 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.9 {tag configuration options} -body { .t tag configure x -font fixed .t tag cget x -font } -cleanup { .t tag configure x -font [lindex [.t tag configure x -font] 3] } -result {fixed} -test textTag-1.10 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.10 {tag configuration options} -body { .t tag configure x -foreground #001122 .t tag cget x -foreground } -cleanup { .t tag configure x -foreground [lindex [.t tag configure x -foreground] 3] } -result {#001122} -test textTag-1.11 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.11 {configuration options} -body { .t tag configure x -foreground {silly color} } -cleanup { .t tag configure x -foreground [lindex [.t tag configure x -foreground] 3] } -returnCodes error -result {unknown color name "silly color"} -test textTag-1.12 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.12 {tag configuration options} -body { .t tag configure x -justify left .t tag cget x -justify } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] } -result {left} -test textTag-1.13 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.13 {configuration options} -body { .t tag configure x -justify middle } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] } -returnCodes error -result {bad justification "middle": must be left, right, or center} -test textTag-1.14 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.14 {tag configuration options} -body { .t tag configure x -lmargin1 10 .t tag cget x -lmargin1 } -cleanup { .t tag configure x -lmargin1 [lindex [.t tag configure x -lmargin1] 3] } -result {10} -test textTag-1.15 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.15 {configuration options} -body { .t tag configure x -lmargin1 bad } -cleanup { .t tag configure x -lmargin1 [lindex [.t tag configure x -lmargin1] 3] } -returnCodes error -result {bad screen distance "bad"} -test textTag-1.16 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.16 {tag configuration options} -body { .t tag configure x -lmargin2 10 .t tag cget x -lmargin2 } -cleanup { .t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3] } -result {10} -test textTag-1.17 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.17 {configuration options} -body { .t tag configure x -lmargin2 bad } -cleanup { .t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3] @@ -179,32 +142,24 @@ test textTag-1.17b {configuration options} -body { } -cleanup { .t tag configure x -lmargincolor [lindex [.t tag configure x -lmargincolor] 3] } -returnCodes error -result {unknown color name "non-existent"} -test textTag-1.18 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.18 {tag configuration options} -body { .t tag configure x -offset 2 .t tag cget x -offset } -cleanup { .t tag configure x -offset [lindex [.t tag configure x -offset] 3] } -result {2} -test textTag-1.19 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.19 {configuration options} -body { .t tag configure x -offset 100xyz } -cleanup { .t tag configure x -offset [lindex [.t tag configure x -offset] 3] } -returnCodes error -result {bad screen distance "100xyz"} -test textTag-1.20 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.20 {tag configuration options} -body { .t tag configure x -overstrike on .t tag cget x -overstrike } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] } -result {on} -test textTag-1.21 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.21 {configuration options} -body { .t tag configure x -overstrike stupid } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] @@ -220,32 +175,24 @@ test textTag-1.21b {configuration options} -body { } -cleanup { .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3] } -returnCodes error -result {unknown color name "stupid"} -test textTag-1.22 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.22 {tag configuration options} -body { .t tag configure x -relief raised .t tag cget x -relief } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -result {raised} -test textTag-1.23 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.23 {configuration options} -body { .t tag configure x -relief stupid } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -returnCodes error -result {bad relief "stupid": must be flat, groove, raised, ridge, solid, or sunken} -test textTag-1.24 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.24 {tag configuration options} -body { .t tag configure x -rmargin 10 .t tag cget x -rmargin } -cleanup { .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3] } -result {10} -test textTag-1.25 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.25 {configuration options} -body { .t tag configure x -rmargin bad } -cleanup { .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3] @@ -283,77 +230,57 @@ test textTag-1.25f {configuration options} -body { } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] } -returnCodes error -result {unknown color name "non-existent"} -test textTag-1.26 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.26 {tag configuration options} -body { .t tag configure x -spacing1 10 .t tag cget x -spacing1 } -cleanup { .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3] } -result {10} -test textTag-1.27 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.27 {configuration options} -body { .t tag configure x -spacing1 bad } -cleanup { .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3] } -returnCodes error -result {bad screen distance "bad"} -test textTag-1.28 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.28 {tag configuration options} -body { .t tag configure x -spacing2 10 .t tag cget x -spacing2 } -cleanup { .t tag configure x -spacing2 [lindex [.t tag configure x -spacing2] 3] } -result {10} -test textTag-1.29 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.29 {configuration options} -body { .t tag configure x -spacing2 bad } -cleanup { .t tag configure x -spacing2 [lindex [.t tag configure x -spacing2] 3] } -returnCodes error -result {bad screen distance "bad"} -test textTag-1.30 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.30 {tag configuration options} -body { .t tag configure x -spacing3 10 .t tag cget x -spacing3 } -cleanup { .t tag configure x -spacing3 [lindex [.t tag configure x -spacing3] 3] } -result {10} -test textTag-1.31 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.31 {configuration options} -body { .t tag configure x -spacing3 bad } -cleanup { .t tag configure x -spacing3 [lindex [.t tag configure x -spacing3] 3] } -returnCodes error -result {bad screen distance "bad"} -test textTag-1.32 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.32 {tag configuration options} -body { .t tag configure x -tabs {10 20 30} .t tag cget x -tabs } -cleanup { .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3] } -result {10 20 30} -test textTag-1.33 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.33 {configuration options} -body { .t tag configure x -tabs {10 fork} } -cleanup { .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3] } -returnCodes error -result {bad tab alignment "fork": must be left, right, center, or numeric} -test textTag-1.34 {tag configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.34 {tag configuration options} -body { .t tag configure x -underline no .t tag cget x -underline } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -result {no} -test textTag-1.35 {configuration options} -constraints { - haveCourier12 -} -body { +test textTag-1.35 {configuration options} -body { .t tag configure x -underline stupid } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] @@ -371,43 +298,29 @@ test textTag-1.37 {configuration options} -body { } -returnCodes error -result {unknown color name "stupid"} -test textTag-2.1 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.1 {TkTextTagCmd - "add" option} -body { .t tag } -returnCodes error -result {wrong # args: should be ".t tag option ?arg ...?"} -test textTag-2.2 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.2 {TkTextTagCmd - "add" option} -body { .t tag gorp } -returnCodes error -result {bad tag option "gorp": must be add, bind, cget, configure, delete, lower, names, nextrange, prevrange, raise, ranges, or remove} -test textTag-2.3 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.3 {TkTextTagCmd - "add" option} -body { .t tag add foo } -returnCodes error -result {wrong # args: should be ".t tag add tagName index1 ?index2 index1 index2 ...?"} -test textTag-2.4 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.4 {TkTextTagCmd - "add" option} -body { .t tag add x gorp } -returnCodes error -result {bad text index "gorp"} -test textTag-2.5 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.5 {TkTextTagCmd - "add" option} -body { .t tag add x 1.2 gorp } -returnCodes error -result {bad text index "gorp"} -test textTag-2.6 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -setup { +test textTag-2.6 {TkTextTagCmd - "add" option} -setup { .t tag delete sel } -body { .t tag add sel 3.2 3.4 .t tag add sel 3.2 3.0 .t tag ranges sel } -result {3.2 3.4} -test textTag-2.7 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -setup { +test textTag-2.7 {TkTextTagCmd - "add" option} -setup { .t tag delete x } -body { .t tag add x 1.0 1.end @@ -415,9 +328,7 @@ test textTag-2.7 {TkTextTagCmd - "add" option} -constraints { } -cleanup { .t tag delete x } -result {1.0 1.6} -test textTag-2.8 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -setup { +test textTag-2.8 {TkTextTagCmd - "add" option} -setup { .t tag remove x 1.0 end } -body { .t tag add x 1.2 @@ -425,9 +336,7 @@ test textTag-2.8 {TkTextTagCmd - "add" option} -constraints { } -cleanup { .t tag delete x } -result {1.2 1.3} -test textTag-2.9 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -setup { +test textTag-2.9 {TkTextTagCmd - "add" option} -setup { destroy .t.e } -body { entry .t.e @@ -439,9 +348,7 @@ test textTag-2.9 {TkTextTagCmd - "add" option} -constraints { } -cleanup { destroy .t.e } -result 34 -test textTag-2.10 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -setup { +test textTag-2.10 {TkTextTagCmd - "add" option} -setup { destroy .t.e } -body { entry .t.e @@ -454,23 +361,19 @@ test textTag-2.10 {TkTextTagCmd - "add" option} -constraints { } -cleanup { destroy .t.e } -result {Text} -test textTag-2.11 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.11 {TkTextTagCmd - "add" option} -body { .t tag remove sel 1.0 end .t tag add sel 1.1 1.5 2.4 3.1 4.2 4.4 .t tag ranges sel } -result {1.1 1.5 2.4 3.1 4.2 4.4} -test textTag-2.12 {TkTextTagCmd - "add" option} -constraints { - haveCourier12 -} -body { +test textTag-2.12 {TkTextTagCmd - "add" option} -body { .t tag remove sel 1.0 end .t tag add sel 1.1 1.5 2.4 .t tag ranges sel } -cleanup { .t tag remove sel 1.0 end } -result {1.1 1.5 2.4 2.5} -test textTag-2.14 {tag add before -startline - Bug 1615425} haveCourier12 { +test textTag-2.14 {tag add before -startline - Bug 1615425} -body { text .tt for {set i 1} {$i <10} {incr i} { .tt insert end "Line $i\n" @@ -482,44 +385,32 @@ test textTag-2.14 {tag add before -startline - Bug 1615425} haveCourier12 { .tt tag add mytag 1.0 1.end destroy .ptt .tt set res 1 -} {1} +} -result {1} -test textTag-3.1 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.1 {TkTextTagCmd - "bind" option} -body { .t tag bind } -returnCodes error -result {wrong # args: should be ".t tag bind tagName ?sequence? ?command?"} -test textTag-3.2 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.2 {TkTextTagCmd - "bind" option} -body { .t tag bind 1 2 3 4 } -returnCodes error -result {wrong # args: should be ".t tag bind tagName ?sequence? ?command?"} -test textTag-3.3 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.3 {TkTextTagCmd - "bind" option} -body { .t tag bind x script1 .t tag bind x } -cleanup { .t tag delete x } -result {script1} -test textTag-3.4 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.4 {TkTextTagCmd - "bind" option} -body { .t tag bind x script2 } -returnCodes error -result {bad event type or keysym "Gorp"} -test textTag-3.5 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.5 {TkTextTagCmd - "bind" option} -body { .t tag delete x .t tag bind x script1 .t tag bind x script2 } -cleanup { .t tag delete x } -returnCodes error -result {requested illegal events; only key, button, motion, enter, leave, and virtual events may be used} -test textTag-3.6 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.6 {TkTextTagCmd - "bind" option} -body { .t tag delete x .t tag bind x script1 catch {.t tag bind x script2} @@ -527,9 +418,7 @@ test textTag-3.6 {TkTextTagCmd - "bind" option} -constraints { } -cleanup { .t tag delete x } -result {} -test textTag-3.7 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.7 {TkTextTagCmd - "bind" option} -body { .t tag delete x .t tag bind x script1 .t tag bind x script2 @@ -538,9 +427,7 @@ test textTag-3.7 {TkTextTagCmd - "bind" option} -constraints { } -cleanup { .t tag delete x } -result {{ a} script1 xyzzy} -test textTag-3.8 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.8 {TkTextTagCmd - "bind" option} -body { .t tag delete x .t tag bind x script1 .t tag bind x +script2 @@ -549,17 +436,13 @@ test textTag-3.8 {TkTextTagCmd - "bind" option} -constraints { .t tag delete x } -result {script1 script2} -test textTag-3.9 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.9 {TkTextTagCmd - "bind" option} -body { .t tag delete x .t tag bind x } -cleanup { .t tag delete x } -returnCodes ok -result {} -test textTag-3.10 {TkTextTagCmd - "bind" option} -constraints { - haveCourier12 -} -body { +test textTag-3.10 {TkTextTagCmd - "bind" option} -body { .t tag delete x .t tag bind x < } -cleanup { @@ -567,30 +450,20 @@ test textTag-3.10 {TkTextTagCmd - "bind" option} -constraints { } -returnCodes error -result {no event type or button # or keysym} -test textTag-4.1 {TkTextTagCmd - "cget" option} -constraints { - haveCourier12 -} -body { +test textTag-4.1 {TkTextTagCmd - "cget" option} -body { .t tag cget a } -returnCodes error -result {wrong # args: should be ".t tag cget tagName option"} -test textTag-4.2 {TkTextTagCmd - "cget" option} -constraints { - haveCourier12 -} -body { +test textTag-4.2 {TkTextTagCmd - "cget" option} -body { .t tag cget a b c } -returnCodes error -result {wrong # args: should be ".t tag cget tagName option"} -test textTag-4.3 {TkTextTagCmd - "cget" option} -constraints { - haveCourier12 -} -body { +test textTag-4.3 {TkTextTagCmd - "cget" option} -body { .t tag delete foo .t tag cget foo bar } -returnCodes error -result {tag "foo" isn't defined in text widget} -test textTag-4.4 {TkTextTagCmd - "cget" option} -constraints { - haveCourier12 -} -body { +test textTag-4.4 {TkTextTagCmd - "cget" option} -body { .t tag cget sel bogus } -returnCodes error -result {unknown option "bogus"} -test textTag-4.5 {TkTextTagCmd - "cget" option} -constraints { - haveCourier12 -} -body { +test textTag-4.5 {TkTextTagCmd - "cget" option} -body { .t tag delete x .t tag configure x -background red .t tag cget x -background @@ -599,26 +472,18 @@ test textTag-4.5 {TkTextTagCmd - "cget" option} -constraints { } -result {red} -test textTag-5.1 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.1 {TkTextTagCmd - "configure" option} -body { .t tag configure } -returnCodes error -result {wrong # args: should be ".t tag configure tagName ?-option? ?value? ?-option value ...?"} -test textTag-5.2 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.2 {TkTextTagCmd - "configure" option} -body { .t tag configure x -foo } -returnCodes error -result {unknown option "-foo"} -test textTag-5.3 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.3 {TkTextTagCmd - "configure" option} -body { .t tag configure x -background red -underline } -cleanup { .t tag delete x } -returnCodes error -result {value for "-underline" missing} -test textTag-5.4 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.4 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underline yes .t tag configure x -underline @@ -632,9 +497,7 @@ test textTag-5.4a {TkTextTagCmd - "configure" option} -body { } -cleanup { .t tag delete x } -result {-underlinefg {} {} {} lightgreen} -test textTag-5.5 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.5 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -overstrike on .t tag cget x -overstrike @@ -648,58 +511,44 @@ test textTag-5.5a {TkTextTagCmd - "configure" option} -body { } -cleanup { .t tag delete x } -result {-overstrikefg {} {} {} lightgreen} -test textTag-5.6 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.6 {TkTextTagCmd - "configure" option} -body { .t tag configure x -overstrike foo } -cleanup { .t tag delete x } -returnCodes error -result {expected boolean value but got "foo"} -test textTag-5.7 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.7 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underline stupid } -cleanup { .t tag delete x } -returnCodes error -result {expected boolean value but got "stupid"} -test textTag-5.8 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.8 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -justify left .t tag configure x -justify } -cleanup { .t tag delete x } -result {-justify {} {} {} left} -test textTag-5.9 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.9 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -justify bogus } -cleanup { .t tag delete x } -returnCodes error -result {bad justification "bogus": must be left, right, or center} -test textTag-5.10 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.10 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -justify fill } -cleanup { .t tag delete x } -returnCodes error -result {bad justification "fill": must be left, right, or center} -test textTag-5.11 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.11 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -offset 2 .t tag configure x -offset } -cleanup { .t tag delete x } -result {-offset {} {} {} 2} -test textTag-5.12 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.12 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -offset 1.0q } -cleanup { @@ -718,17 +567,13 @@ test textTag-5.13 {TkTextTagCmd - "configure" option} -body { {-rmargin {} {} {} 5} \ {-lmargincolor {} {} {} darkblue} {-rmargincolor {} {} {} lightgreen} \ ] -test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.14 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -lmargin1 2.0x } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "2.0x"} -test textTag-5.15 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.15 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -lmargin2 gorp } -cleanup { @@ -740,9 +585,7 @@ test textTag-5.15a {TkTextTagCmd - "configure" option} -body { } -cleanup { .t tag delete x } -returnCodes error -result {unknown color name "rainbow"} -test textTag-5.16 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.16 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -rmargin 140.1.1 } -cleanup { @@ -755,9 +598,7 @@ test textTag-5.16a {TkTextTagCmd - "configure" option} -body { .t tag delete x } -returnCodes error -result {unknown color name "rainbow"} .t tag delete x -test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.17 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -spacing1 2 -spacing2 4 -spacing3 6 list [.t tag configure x -spacing1] [.t tag configure x -spacing2] \ @@ -765,33 +606,25 @@ test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -result {{-spacing1 {} {} {} 2} {-spacing2 {} {} {} 4} {-spacing3 {} {} {} 6}} -test textTag-5.18 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.18 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -spacing1 2.0x } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "2.0x"} -test textTag-5.19 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.19 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -spacing1 lousy } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "lousy"} -test textTag-5.20 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.20 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -spacing1 4.2.3 } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "4.2.3"} -test textTag-5.21 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.21 {TkTextTagCmd - "configure" option} -body { .t configure -selectborderwidth 2 -selectforeground blue \ -selectbackground black .t tag configure sel -borderwidth 4 -foreground green -background yellow @@ -801,9 +634,7 @@ test textTag-5.21 {TkTextTagCmd - "configure" option} -constraints { } return $x } -result {4 green yellow} -test textTag-5.22 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.22 {TkTextTagCmd - "configure" option} -body { .t configure -selectborderwidth 20 .t tag configure sel -borderwidth {} .t cget -selectborderwidth @@ -855,19 +686,13 @@ test textTag-5.24 {TkTextTagCmd - "configure" option} -body { return $x } -result {yellow blue red white} -test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints { - haveCourier12 -} -body { +test textTag-6.1 {TkTextTagCmd - "delete" option} -body { .t tag delete } -returnCodes error -result {wrong # args: should be ".t tag delete tagName ?tagName ...?"} -test textTag-6.2 {TkTextTagCmd - "delete" option} -constraints { - haveCourier12 -} -body { +test textTag-6.2 {TkTextTagCmd - "delete" option} -body { .t tag delete zork } -returnCodes ok -result {} -test textTag-6.3 {TkTextTagCmd - "delete" option} -constraints { - haveCourier12 -} -setup { +test textTag-6.3 {TkTextTagCmd - "delete" option} -setup { .t tag delete {*}[.t tag names] } -body { .t tag config x -background black @@ -878,9 +703,7 @@ test textTag-6.3 {TkTextTagCmd - "delete" option} -constraints { } -cleanup { .t tag delete x } -result {sel x} -test textTag-6.4 {TkTextTagCmd - "delete" option} -constraints { - haveCourier12 -} -setup { +test textTag-6.4 {TkTextTagCmd - "delete" option} -setup { .t tag delete {*}[.t tag names] } -body { .t tag config x -background black @@ -889,9 +712,7 @@ test textTag-6.4 {TkTextTagCmd - "delete" option} -constraints { eval .t tag delete [.t tag names] .t tag names } -result {sel} -test textTag-6.5 {TkTextTagCmd - "delete" option} -constraints { - haveCourier12 -} -body { +test textTag-6.5 {TkTextTagCmd - "delete" option} -body { .t tag bind x foo .t tag delete x .t tag configure x -background black @@ -901,24 +722,16 @@ test textTag-6.5 {TkTextTagCmd - "delete" option} -constraints { } -result {} -test textTag-7.1 {TkTextTagCmd - "lower" option} -constraints { - haveCourier12 -} -body { +test textTag-7.1 {TkTextTagCmd - "lower" option} -body { .t tag lower } -returnCodes error -result {wrong # args: should be ".t tag lower tagName ?belowThis?"} -test textTag-7.2 {TkTextTagCmd - "lower" option} -constraints { - haveCourier12 -} -body { +test textTag-7.2 {TkTextTagCmd - "lower" option} -body { .t tag lower foo } -returnCodes error -result {tag "foo" isn't defined in text widget} -test textTag-7.3 {TkTextTagCmd - "lower" option} -constraints { - haveCourier12 -} -body { +test textTag-7.3 {TkTextTagCmd - "lower" option} -body { .t tag lower sel bar } -returnCodes error -result {tag "bar" isn't defined in text widget} -test textTag-7.4 {TkTextTagCmd - "lower" option} -constraints { - haveCourier12 -} -setup { +test textTag-7.4 {TkTextTagCmd - "lower" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -930,9 +743,7 @@ test textTag-7.4 {TkTextTagCmd - "lower" option} -constraints { } -cleanup { .t tag delete {*}[.t tag names] } -result {c sel a b d} -test textTag-7.5 {TkTextTagCmd - "lower" option} -constraints { - haveCourier12 -} -setup { +test textTag-7.5 {TkTextTagCmd - "lower" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -944,9 +755,7 @@ test textTag-7.5 {TkTextTagCmd - "lower" option} -constraints { } -cleanup { .t tag delete {*}[.t tag names] } -result {sel a d b c} -test textTag-7.6 {TkTextTagCmd - "lower" option} -constraints { - haveCourier12 -} -setup { +test textTag-7.6 {TkTextTagCmd - "lower" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -960,16 +769,12 @@ test textTag-7.6 {TkTextTagCmd - "lower" option} -constraints { } -result {sel b a c d} -test textTag-8.1 {TkTextTagCmd - "names" option} -constraints { - haveCourier12 -} -body { +test textTag-8.1 {TkTextTagCmd - "names" option} -body { .t tag names a b } -cleanup { .t tag delete {*}[.t tag names] } -returnCodes error -result {wrong # args: should be ".t tag names ?index?"} -test textTag-8.2 {TkTextTagCmd - "names" option} -constraints { - haveCourier12 -} -setup { +test textTag-8.2 {TkTextTagCmd - "names" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -980,9 +785,7 @@ test textTag-8.2 {TkTextTagCmd - "names" option} -constraints { } -cleanup { .t tag delete {*}[.t tag names] } -result {sel a b c d} -test textTag-8.3 {TkTextTagCmd - "names" option} -constraints { - haveCourier12 -} -setup { +test textTag-8.3 {TkTextTagCmd - "names" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -997,24 +800,16 @@ test textTag-8.3 {TkTextTagCmd - "names" option} -constraints { } -result {c {a b}} -test textTag-9.1 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -body { +test textTag-9.1 {TkTextTagCmd - "nextrange" option} -body { .t tag nextrange x } -returnCodes error -result {wrong # args: should be ".t tag nextrange tagName index1 ?index2?"} -test textTag-9.2 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -body { +test textTag-9.2 {TkTextTagCmd - "nextrange" option} -body { .t tag nextrange x 1 2 3 } -returnCodes error -result {wrong # args: should be ".t tag nextrange tagName index1 ?index2?"} -test textTag-9.3 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -body { +test textTag-9.3 {TkTextTagCmd - "nextrange" option} -body { .t tag nextrange foo 1.0 } -returnCodes ok -result {} -test textTag-9.4 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.4 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1022,9 +817,7 @@ test textTag-9.4 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad text index "foo"} -test textTag-9.5 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.5 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1034,9 +827,7 @@ test textTag-9.5 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad text index "bar"} -test textTag-9.6 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.6 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1046,9 +837,7 @@ test textTag-9.6 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-9.7 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.7 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1058,9 +847,7 @@ test textTag-9.7 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-9.8 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.8 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1070,9 +857,7 @@ test textTag-9.8 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-9.9 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.9 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1082,9 +867,7 @@ test textTag-9.9 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.9 3.1} -test textTag-9.10 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.10 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1094,9 +877,7 @@ test textTag-9.10 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {} -test textTag-9.11 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.11 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1106,9 +887,7 @@ test textTag-9.11 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.9 3.1} -test textTag-9.12 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.12 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1118,9 +897,7 @@ test textTag-9.12 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.9 3.1} -test textTag-9.13 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.13 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1130,9 +907,7 @@ test textTag-9.13 {TkTextTagCmd - "nextrange" option} -constraints { } -cleanup { .t tag delete x } -result {7.2 7.3} -test textTag-9.14 {TkTextTagCmd - "nextrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-9.14 {TkTextTagCmd - "nextrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1144,28 +919,20 @@ test textTag-9.14 {TkTextTagCmd - "nextrange" option} -constraints { } -result {} -test textTag-10.1 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -body { +test textTag-10.1 {TkTextTagCmd - "prevrange" option} -body { .t tag prevrange x } -returnCodes error -result {wrong # args: should be ".t tag prevrange tagName index1 ?index2?"} -test textTag-10.2 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -body { +test textTag-10.2 {TkTextTagCmd - "prevrange" option} -body { .t tag prevrange x 1 2 3 } -returnCodes error -result {wrong # args: should be ".t tag prevrange tagName index1 ?index2?"} -test textTag-10.3 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.3 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag prevrange foo end } -cleanup { .t tag delete x } -returnCodes ok -result {} -test textTag-10.4 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.4 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1175,9 +942,7 @@ test textTag-10.4 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad text index "foo"} -test textTag-10.5 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.5 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1187,9 +952,7 @@ test textTag-10.5 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad text index "bar"} -test textTag-10.6 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.6 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1199,9 +962,7 @@ test textTag-10.6 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {7.2 7.3} -test textTag-10.7 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.7 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1211,9 +972,7 @@ test textTag-10.7 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-10.8 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.8 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1223,9 +982,7 @@ test textTag-10.8 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-10.9 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.9 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1235,9 +992,7 @@ test textTag-10.9 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-10.10 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.10 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1247,9 +1002,7 @@ test textTag-10.10 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {} -test textTag-10.11 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.11 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1259,9 +1012,7 @@ test textTag-10.11 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {} -test textTag-10.12 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.12 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1271,9 +1022,7 @@ test textTag-10.12 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.3 2.5} -test textTag-10.13 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.13 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1283,9 +1032,7 @@ test textTag-10.13 {TkTextTagCmd - "prevrange" option} -constraints { } -cleanup { .t tag delete x } -result {2.9 3.1} -test textTag-10.14 {TkTextTagCmd - "prevrange" option} -constraints { - haveCourier12 -} -setup { +test textTag-10.14 {TkTextTagCmd - "prevrange" option} -setup { .t tag delete x } -body { .t tag add x 2.3 2.5 @@ -1297,24 +1044,16 @@ test textTag-10.14 {TkTextTagCmd - "prevrange" option} -constraints { } -result {} -test textTag-11.1 {TkTextTagCmd - "raise" option} -constraints { - haveCourier12 -} -body { +test textTag-11.1 {TkTextTagCmd - "raise" option} -body { .t tag raise } -returnCodes error -result {wrong # args: should be ".t tag raise tagName ?aboveThis?"} -test textTag-11.2 {TkTextTagCmd - "raise" option} -constraints { - haveCourier12 -} -body { +test textTag-11.2 {TkTextTagCmd - "raise" option} -body { .t tag raise foo } -returnCodes error -result {tag "foo" isn't defined in text widget} -test textTag-11.3 {TkTextTagCmd - "raise" option} -constraints { - haveCourier12 -} -body { +test textTag-11.3 {TkTextTagCmd - "raise" option} -body { .t tag raise sel bar } -returnCodes error -result {tag "bar" isn't defined in text widget} -test textTag-11.4 {TkTextTagCmd - "raise" option} -constraints { - haveCourier12 -} -setup { +test textTag-11.4 {TkTextTagCmd - "raise" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -1326,9 +1065,7 @@ test textTag-11.4 {TkTextTagCmd - "raise" option} -constraints { } -cleanup { .t tag delete {*}[.t tag names] } -result {sel a b d c} -test textTag-11.5 {TkTextTagCmd - "raise" option} -constraints { - haveCourier12 -} -setup { +test textTag-11.5 {TkTextTagCmd - "raise" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -1340,9 +1077,7 @@ test textTag-11.5 {TkTextTagCmd - "raise" option} -constraints { } -cleanup { .t tag delete {*}[.t tag names] } -result {sel a b d c} -test textTag-11.6 {TkTextTagCmd - "raise" option} -constraints { - haveCourier12 -} -setup { +test textTag-11.6 {TkTextTagCmd - "raise" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { @@ -1356,20 +1091,14 @@ test textTag-11.6 {TkTextTagCmd - "raise" option} -constraints { } -result {sel b c a d} -test textTag-12.1 {TkTextTagCmd - "ranges" option} -constraints { - haveCourier12 -} -body { +test textTag-12.1 {TkTextTagCmd - "ranges" option} -body { .t tag ranges } -returnCodes error -result {wrong # args: should be ".t tag ranges tagName"} -test textTag-12.2 {TkTextTagCmd - "ranges" option} -constraints { - haveCourier12 -} -body { +test textTag-12.2 {TkTextTagCmd - "ranges" option} -body { .t tag delete x .t tag ranges x } -result {} -test textTag-12.3 {TkTextTagCmd - "ranges" option} -constraints { - haveCourier12 -} -setup { +test textTag-12.3 {TkTextTagCmd - "ranges" option} -setup { .t tag delete x } -body { .t tag add x 2.2 @@ -1379,9 +1108,7 @@ test textTag-12.3 {TkTextTagCmd - "ranges" option} -constraints { } -cleanup { .t tag delete x } -result {2.2 2.3 2.7 4.6 5.2 5.5} -test textTag-12.4 {TkTextTagCmd - "ranges" option} -constraints { - haveCourier12 -} -setup { +test textTag-12.4 {TkTextTagCmd - "ranges" option} -setup { .t tag delete x } -body { .t tag add x 1.0 3.0 @@ -1392,14 +1119,10 @@ test textTag-12.4 {TkTextTagCmd - "ranges" option} -constraints { } -result {1.0 3.0 4.0 8.0} -test textTag-13.1 {TkTextTagCmd - "remove" option} -constraints { - haveCourier12 -} -body { +test textTag-13.1 {TkTextTagCmd - "remove" option} -body { .t tag remove } -returnCodes error -result {wrong # args: should be ".t tag remove tagName index1 ?index2 index1 index2 ...?"} -test textTag-13.2 {TkTextTagCmd - "remove" option} -constraints { - haveCourier12 -} -setup { +test textTag-13.2 {TkTextTagCmd - "remove" option} -setup { .t tag delete x } -body { .t tag add x 2.2 2.11 @@ -1408,9 +1131,7 @@ test textTag-13.2 {TkTextTagCmd - "remove" option} -constraints { } -cleanup { .t tag delete x } -result {2.2 2.3 2.7 2.11} -test textTag-13.3 {TkTextTagCmd - "remove" option} -constraints { - haveCourier12 -} -setup { +test textTag-13.3 {TkTextTagCmd - "remove" option} -setup { destroy .t.e } -body { entry .t.e @@ -1426,7 +1147,7 @@ test textTag-13.3 {TkTextTagCmd - "remove" option} -constraints { } -result {Text} -test textTag-14.1 {SortTags} -constraints haveCourier12 -setup { +test textTag-14.1 {SortTags} -setup { .t tag delete a b c d } -body { foreach i {a b c d} { @@ -1437,7 +1158,7 @@ test textTag-14.1 {SortTags} -constraints haveCourier12 -setup { .t tag delete a b c d } -result {a b c d} .t tag delete a b c d -test textTag-14.2 {SortTags} -constraints haveCourier12 -setup { +test textTag-14.2 {SortTags} -setup { .t tag delete a b c d } -body { foreach i {a b c d} { @@ -1450,7 +1171,7 @@ test textTag-14.2 {SortTags} -constraints haveCourier12 -setup { } -cleanup { .t tag delete a b c d } -result {a b c d} -test textTag-14.3 {SortTags} -constraints haveCourier12 -setup { +test textTag-14.3 {SortTags} -setup { .t tag delete {*}[.t tag names] } -body { for {set i 0} {$i < 30} {incr i} { @@ -1460,7 +1181,7 @@ test textTag-14.3 {SortTags} -constraints haveCourier12 -setup { } -cleanup { .t tag delete {*}[.t tag names] } -result {x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29} -test textTag-14.4 {SortTags} -constraints haveCourier12 -setup { +test textTag-14.4 {SortTags} -setup { .t tag delete {*}[.t tag names] } -body { for {set i 0} {$i < 30} {incr i} { @@ -1486,7 +1207,7 @@ set c [.t bbox 4.3] set x3 [expr [lindex $c 0] + [lindex $c 2]/2] set y3 [expr [lindex $c 1] + [lindex $c 3]/2] -test textTag-15.1 {TkTextBindProc} -constraints haveCourier12 -setup { +test textTag-15.1 {TkTextBindProc} -setup { .t tag delete x y event generate {} -warp 1 -x -1 -y -1; update } -body { @@ -1511,7 +1232,7 @@ test textTag-15.1 {TkTextBindProc} -constraints haveCourier12 -setup { bind .t {} } -result {x-up up up y-up up} -test textTag-15.2 {TkTextBindProc} -constraints haveCourier12 -setup { +test textTag-15.2 {TkTextBindProc} -setup { .t tag delete x y event generate {} -warp 1 -x -1 -y -1; update } -body { @@ -1539,7 +1260,7 @@ test textTag-15.2 {TkTextBindProc} -constraints haveCourier12 -setup { .t tag delete x y } -result {x-enter | x-down | | x-up x-leave y-enter} -test textTag-15.3 {TkTextBindProc} -constraints haveCourier12 -setup { +test textTag-15.3 {TkTextBindProc} -setup { .t tag delete x y event generate {} -warp 1 -x -1 -y -1; update } -body { @@ -1572,9 +1293,7 @@ test textTag-15.3 {TkTextBindProc} -constraints haveCourier12 -setup { } -result {x-enter | x-down | | | x-up | x-leave y-enter} -test textTag-16.1 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.1 {TkTextPickCurrent procedure} -setup { .t tag delete {*}[.t tag names] event generate {} -warp 1 -x -1 -y -1; update } -body { @@ -1594,9 +1313,7 @@ test textTag-16.1 {TkTextPickCurrent procedure} -constraints { lappend x [.t index current] } -result {2.1 3.2 3.2 3.2 3.2 3.2 4.3} -test textTag-16.2 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.2 {TkTextPickCurrent procedure} -setup { .t tag delete {*}[.t tag names] event generate {} -warp 1 -x -1 -y -1; update } -body { @@ -1611,9 +1328,7 @@ test textTag-16.2 {TkTextPickCurrent procedure} -constraints { .t tag delete big } -result {3.2 3.1} -test textTag-16.3 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.3 {TkTextPickCurrent procedure} -setup { foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -1640,9 +1355,7 @@ test textTag-16.3 {TkTextPickCurrent procedure} -constraints { .t tag delete {*}[.t tag names] } -result {enter-a enter-b | leave-b enter-c | leave-a leave-c} -test textTag-16.4 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.4 {TkTextPickCurrent procedure} -setup { foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -1668,9 +1381,7 @@ test textTag-16.4 {TkTextPickCurrent procedure} -constraints { .t tag delete {*}[.t tag names] } -result {enter-a enter-b enter-c | leave-c leave-b} -test textTag-16.5 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.5 {TkTextPickCurrent procedure} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } @@ -1686,9 +1397,7 @@ test textTag-16.5 {TkTextPickCurrent procedure} -constraints { .t tag delete a big } -result {3.2} -test textTag-16.6 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.6 {TkTextPickCurrent procedure} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } @@ -1705,9 +1414,7 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints { .t tag delete a big } -result {3.1} -test textTag-16.7 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.7 {TkTextPickCurrent procedure} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } -- cgit v0.12 From de3f6dd4ea12576354f6128c2c982bb648c53f64 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Mar 2016 10:01:29 +0000 Subject: sync tcl.m4 (both win and unix) with Tcl's version. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- win/configure | 2 +- win/tcl.m4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/configure b/unix/configure index 040f4a1..1ed0275 100755 --- a/unix/configure +++ b/unix/configure @@ -4595,7 +4595,7 @@ fi if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 41b94ef..a1d4021 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1096,7 +1096,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g AS_IF([test "$GCC" = yes], [ CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" ], [ CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" diff --git a/win/configure b/win/configure index 494e71a..0b80f22 100755 --- a/win/configure +++ b/win/configure @@ -4335,7 +4335,7 @@ $as_echo "using shared flags" >&6; } CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wdeclaration-after-statement" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= diff --git a/win/tcl.m4 b/win/tcl.m4 index c95d61f..d1fb11c 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -727,7 +727,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wdeclaration-after-statement" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= -- cgit v0.12