From df0bc82b2b44f2f88c6c4a485d41c2c9354500d9 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 10 Mar 2020 17:13:58 +0000 Subject: Fix the X11 build on OSX --- unix/tkUnixFont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index d15b1dd..897770b 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -839,7 +839,7 @@ TkpGetFontFamilies( Tk_Window tkwin) /* For display to query. */ { int i, new, numNames; - const char *family, **nameList; + char *family, **nameList; Tcl_HashTable familyTable; Tcl_HashEntry *hPtr; Tcl_HashSearch search; @@ -850,7 +850,7 @@ TkpGetFontFamilies( Tcl_InitHashTable(&familyTable, TCL_STRING_KEYS); nameList = ListFonts(Tk_Display(tkwin), "*", &numNames); for (i = 0; i < numNames; i++) { - const char *familyEnd; + char *familyEnd; family = strchr(nameList[i] + 1, '-'); if (family == NULL) { -- cgit v0.12 From 53f23d95d29c5d49a2deca5d751c921dc48ccda2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 11 Mar 2020 08:45:29 +0000 Subject: Add various build (e.g. MacOS with xquarz, --disable-xft) --- .travis.yml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f01fb0..5e7a8a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,10 @@ addons: packages: - tcl-dev - libx11-dev - + homebrew: + packages: + - tcl-tk + - xquartz matrix: include: # Testing on Linux with various compilers @@ -15,13 +18,28 @@ matrix: compiler: gcc env: - BUILD_DIR=unix + - name: "Linux/GCC/Shared/no-xft" + os: linux + dist: bionic + compiler: gcc + env: + - BUILD_DIR=unix + - CFGOPT="--disable-xft" - name: "Linux/GCC/Static" os: linux dist: bionic compiler: gcc env: + - BUILD_DIR=unix - CFGOPT="--disable-shared" + - name: "Linux/GCC/Debug" + os: linux + dist: bionic + compiler: gcc + env: - BUILD_DIR=unix + - CFGOPT="--enable-symbols" +# Older versions of GCC... - name: "Linux/GCC 7/Shared" os: linux dist: bionic @@ -58,7 +76,61 @@ matrix: - g++-5 env: - BUILD_DIR=unix +# Clang + - name: "Linux/Clang/Shared" + os: linux + dist: bionic + compiler: clang + env: + - BUILD_DIR=unix + - name: "Linux/Clang/Shared/no-xft" + os: linux + dist: bionic + compiler: clang + env: + - BUILD_DIR=unix + - CFGOPT="--disable-xft" + - name: "Linux/Clang/Static" + os: linux + dist: bionic + compiler: clang + env: + - CFGOPT="--disable-shared" + - BUILD_DIR=unix + - name: "Linux/Clang/Debug" + os: linux + dist: bionic + compiler: clang + env: + - BUILD_DIR=unix + - CFGOPT="--enable-symbols" +# Testing on Mac, various styles + - name: "macOS/Xcode 11.3/Shared/Unix-like" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=unix + - CFGOPT="--x-includes=/opt/X11/include --x-libraries=/opt/X11/lib" +# Test on Windows with MSVC native +# - name: "Windows/MSVC/Shared" +# os: windows +# compiler: cl +# env: &vcenv +# - BUILD_DIR=win +# - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" +# before_install: &vcpreinst +# - PATH="$PATH:$VCDIR" +# - cd ${BUILD_DIR} +# install: [] +# script: +# - cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tcltest before_install: + - |- + case $TRAVIS_OS_NAME in + windows) + choco install -y magicsplat-tcl-tk + ;; + esac - cd ${BUILD_DIR} install: - ./configure ${CFGOPT} --prefix=$HOME || (cat config.log && exit 1) @@ -66,3 +138,7 @@ before_script: - export ERROR_ON_FAILURES=1 script: - make binaries libraries tktest +cache: + directories: + - $HOME/AppData/Local/Temp/chocolatey + - $HOME/AppData/Local/Apps/Tcl86 -- cgit v0.12 From 1800da769a5065afec0c18f54f59f3c353ffc766 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 12 Mar 2020 12:13:03 +0000 Subject: Try to fix Travis OSX build --- .travis.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e7a8a6..e1c9f0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,11 @@ addons: packages: - tcl-dev - libx11-dev - homebrew: - packages: - - tcl-tk - - xquartz +# Doesn't work at the moment, see: +# homebrew: +# packages: +# - tcl-tk +# - xquartz matrix: include: # Testing on Linux with various compilers @@ -130,6 +131,10 @@ before_install: windows) choco install -y magicsplat-tcl-tk ;; + osx) + brew update + brew install tcl-tk xquartz + ;; esac - cd ${BUILD_DIR} install: -- cgit v0.12 From 891ce8654aa05e6e3068a65b568abd7018de6c92 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Mar 2020 11:07:41 +0000 Subject: Another attempt to fix OSX build --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e1c9f0b..56a49fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -133,7 +133,8 @@ before_install: ;; osx) brew update - brew install tcl-tk xquartz + brew install tcl-tk + brew cask install xquartz ;; esac - cd ${BUILD_DIR} -- cgit v0.12 From 1238e21206d840a343ed997530575d3dd601a771 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 15 Mar 2020 17:09:35 +0000 Subject: Should now (really!) work on OSX, X11 only. --- .travis.yml | 2 +- unix/Makefile.in | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56a49fa..5cd2dd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,7 +111,7 @@ matrix: osx_image: xcode11.3 env: - BUILD_DIR=unix - - CFGOPT="--x-includes=/opt/X11/include --x-libraries=/opt/X11/lib" + - CFGOPT="--with-tcl=/usr/local/Cellar/tcl-tk/8.6.9_1/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/Cellar/tcl-tk/8.6.9_1/include" # Test on Windows with MSVC native # - name: "Windows/MSVC/Shared" # os: windows diff --git a/unix/Makefile.in b/unix/Makefile.in index 1baa41b..c917516 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -322,9 +322,9 @@ MAN_FLAGS = @MAN_FLAGS@ CC = @CC@ -CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ --I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} -I${TCL_GENERIC_DIR} \ --I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${AC_FLAGS} \ +CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ +${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \ +${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \ ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \ ${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@ @@ -332,10 +332,10 @@ CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) ${TCL_STUB_FLAGS} APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@ -DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ --I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \ -${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \ -${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ +DEPEND_SWITCHES = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ +${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} -I${TCL_GENERIC_DIR} \ +-I${TCL_PLATFORM_DIR} ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} \ +${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ WISH_OBJS = tkAppInit.o -- cgit v0.12 From 1ae85e4478032e462e4e93246165f3cb57767cdc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 15 Mar 2020 17:32:56 +0000 Subject: Slightly better than previous commit: Don't depend on the exact version number of the availble Tcl 8.6.x brew formula. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5cd2dd9..cba7b2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,7 +111,7 @@ matrix: osx_image: xcode11.3 env: - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/Cellar/tcl-tk/8.6.9_1/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/Cellar/tcl-tk/8.6.9_1/include" + - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include" # Test on Windows with MSVC native # - name: "Windows/MSVC/Shared" # os: windows -- cgit v0.12 From a7054af8ad2d19f60b1c8c1863dc7cd8e82bf574 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 17 Mar 2020 10:10:03 +0000 Subject: Add various Xcode builds (8 up to 11.3) to Travis --- .travis.yml | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e192cb1..84c557c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,14 +112,42 @@ matrix: env: - BUILD_DIR=unix - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include" -# - name: "macOS/Xcode 11.3/Shared" -# os: osx -# osx_image: xcode11.3 -# env: -# - BUILD_DIR=macosx -# install: [] -# script: -# - make INSTALL_PATH=/usr/local/opt/tcl-tk/lib TCL_INSTALL_PATH=/usr/local/opt/tcl-tk/lib CFLAGS=-I/usr/local/opt/tcl-tk/include tk + - name: "macOS/Xcode 11.3/Shared" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=macosx + install: [] + script: &mactest + - make INSTALL_PATH=/usr/local/opt/tcl-tk/lib TCL_INSTALL_PATH=/usr/local/opt/tcl-tk/lib CFLAGS=-I/usr/local/opt/tcl-tk/include tk + - name: "macOS/Xcode 11/Shared" + os: osx + osx_image: xcode11 + env: + - BUILD_DIR=macosx + install: [] + script: *mactest + - name: "macOS/Xcode 10/Shared" + os: osx + osx_image: xcode10.3 + env: + - BUILD_DIR=macosx + install: [] + script: *mactest + - name: "macOS/Xcode 9/Shared" + os: osx + osx_image: xcode9 + env: + - BUILD_DIR=macosx + install: [] + script: *mactest + - name: "macOS/Xcode 8/Shared" + os: osx + osx_image: xcode8 + env: + - BUILD_DIR=macosx + install: [] + script: *mactest # Test on Windows with MSVC native # - name: "Windows/MSVC/Shared" # os: windows -- cgit v0.12 From 54591f0f146041539b5a5d39654e19e71d6a4b1c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 18 Mar 2020 17:45:24 +0000 Subject: Build Mac using unix/Makefile in stead of macosx/GNUmakefile, because that's easier to get working directly. --- .travis.yml | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84c557c..32cd25e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -106,48 +106,55 @@ matrix: - BUILD_DIR=unix - CFGOPT="--enable-symbols" # Testing on Mac, various styles - - name: "macOS/Xcode 11.3/Shared/Unix-like" + - name: "macOS/Xcode 11.3/Shared" os: osx osx_image: xcode11.3 env: - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include" - - name: "macOS/Xcode 11.3/Shared" + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 11.3/Static" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 11.3/Debug" os: osx osx_image: xcode11.3 env: - - BUILD_DIR=macosx - install: [] - script: &mactest - - make INSTALL_PATH=/usr/local/opt/tcl-tk/lib TCL_INSTALL_PATH=/usr/local/opt/tcl-tk/lib CFLAGS=-I/usr/local/opt/tcl-tk/include tk + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 11.3/Shared/XQuartz" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" +# Older MacOS versions - name: "macOS/Xcode 11/Shared" os: osx osx_image: xcode11 env: - - BUILD_DIR=macosx - install: [] - script: *mactest + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" - name: "macOS/Xcode 10/Shared" os: osx osx_image: xcode10.3 env: - - BUILD_DIR=macosx - install: [] - script: *mactest + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" - name: "macOS/Xcode 9/Shared" os: osx osx_image: xcode9 env: - - BUILD_DIR=macosx - install: [] - script: *mactest + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" - name: "macOS/Xcode 8/Shared" os: osx osx_image: xcode8 env: - - BUILD_DIR=macosx - install: [] - script: *mactest + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" # Test on Windows with MSVC native # - name: "Windows/MSVC/Shared" # os: windows -- cgit v0.12 From 2697ce46a4ddd06efb4c543aeeee43b6f3dcf94b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Mar 2020 09:37:41 +0000 Subject: Increase FONTMAP_PAGES from 192 to 256, making room for Unicode 13 plane 3. --- unix/tkUnixFont.c | 14 +++++++------- win/tkWinFont.c | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index d95527b..6e7b4c3 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -36,11 +36,12 @@ static const char *const encodingList[] = { #define FONTMAP_SHIFT 10 #define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT) -#define FONTMAP_PAGES (0x30000 / FONTMAP_BITSPERPAGE) +#define FONTMAP_NUMCHARS 0x40000 +#define FONTMAP_PAGES (FONTMAP_NUMCHARS / FONTMAP_BITSPERPAGE) typedef struct FontFamily { struct FontFamily *nextPtr; /* Next in list of all known font families. */ - int refCount; /* How many SubFonts are referring to this + size_t refCount; /* How many SubFonts are referring to this * FontFamily. When the refCount drops to * zero, this FontFamily may be freed. */ /* @@ -1910,8 +1911,7 @@ FreeFontFamily( if (familyPtr == NULL) { return; } - familyPtr->refCount--; - if (familyPtr->refCount > 0) { + if (familyPtr->refCount-- > 1) { return; } if (familyPtr->encoding) { @@ -1979,7 +1979,7 @@ FindSubFontForChar( SubFont *subFontPtr; Tcl_DString ds; - if (ch < 0 || ch > 0x30000) { + if (ch < 0 || ch >= FONTMAP_NUMCHARS) { ch = 0xFFFD; } @@ -2133,7 +2133,7 @@ FontMapLookup( { int row, bitOffset; - if (ch < 0 || ch >= 0x30000) { + if (ch < 0 || ch >= FONTMAP_NUMCHARS) { return 0; } row = ch >> FONTMAP_SHIFT; @@ -2176,7 +2176,7 @@ FontMapInsert( { int row, bitOffset; - if (ch >= 0 && ch < 0x30000) { + if (ch >= 0 && ch < FONTMAP_NUMCHARS) { row = ch >> FONTMAP_SHIFT; if (subFontPtr->fontMap[row] == NULL) { FontMapLoadPage(subFontPtr, row); diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 7b70a08..aae34a7 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -29,7 +29,8 @@ #define FONTMAP_SHIFT 10 #define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT) -#define FONTMAP_PAGES (0x30000 / FONTMAP_BITSPERPAGE) +#define FONTMAP_NUMCHARS 0x40000 +#define FONTMAP_PAGES (FONTMAP_NUMCHARS / FONTMAP_BITSPERPAGE) typedef struct FontFamily { struct FontFamily *nextPtr; /* Next in list of all known font families. */ @@ -1920,7 +1921,7 @@ FindSubFontForChar( SubFont *subFontPtr; Tcl_DString ds; - if ((ch < BASE_CHARS) || (ch >= 0x30000)) { + if ((ch < BASE_CHARS) || (ch >= FONTMAP_NUMCHARS)) { return &fontPtr->subFontArray[0]; } @@ -2090,7 +2091,7 @@ FontMapLookup( { int row, bitOffset; - if (ch < 0 || ch >= 0x30000) { + if (ch < 0 || ch >= FONTMAP_NUMCHARS) { return 0; } @@ -2134,7 +2135,7 @@ FontMapInsert( { int row, bitOffset; - if (ch >= 0 && ch < 0x30000) { + if (ch >= 0 && ch < FONTMAP_NUMCHARS) { row = ch >> FONTMAP_SHIFT; if (subFontPtr->fontMap[row] == NULL) { FontMapLoadPage(subFontPtr, row); -- cgit v0.12