From fb10e693b2a8b1d3c30b2de7c9899f0d7a7081a9 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 21 Oct 2020 18:02:31 +0000 Subject: When building a subframework for macOS use a build directory in the staging directory. --- macosx/GNUmakefile | 15 ++++++++++++--- macosx/README | 7 +++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index e55b661..cdeb099 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -32,6 +32,18 @@ MANDIR ?= ${PREFIX}/man # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= +# Checks and overrides for subframework builds +ifeq (${SUBFRAMEWORK},1) +ifeq (${DYLIB_INSTALL_DIR},) + @echo "Cannot install subframework with empty DYLIB_INSTALL_DIR !" && false +endif +ifeq (${DESTDIR},) + @echo "Cannot install subframework with empty DESTDIR !" && false +endif +override BUILD_DIR = ${DESTDIR}/build +override INSTALL_PATH = /Frameworks +endif + #------------------------------------------------------------------------------------------------------- # meta targets @@ -150,9 +162,6 @@ install-${PROJECT}: build-${PROJECT} ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_) @echo "Cannot install-embedded with empty INSTALL_ROOT !" && false endif -ifeq (${SUBFRAMEWORK}_${DYLIB_INSTALL_DIR},1_) - @echo "Cannot install-subframework with empty DYLIB_INSTALL_DIR !" && false -endif ifeq (${EMBEDDED_BUILD},1) @rm -rf "${INSTALL_ROOT}${LIBDIR}/Tcl.framework" endif diff --git a/macosx/README b/macosx/README index cb36811..c2bcc42 100644 --- a/macosx/README +++ b/macosx/README @@ -172,7 +172,6 @@ variable to the path which should be the install_name path of the Tcl library, s the DESTDIR variable to the pathname of a staging directory where the framework will be written . For example, running this command in the Tcl source directory: make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcl \ - DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/3.9/Frameworks/Tcl -will produce a Tcl.framework intended for installing as a subframework of the -Python.framework. The framework will be found in /tmp/tcl/Library/Frameworks/ - + DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tcl.framework +will produce a Tcl.framework intended for installing as a subframework of +Some.framework. The framework will be found in /tmp/tcl/Frameworks/ -- cgit v0.12 From c41f6053680bfa7bf4537af890349ddf5b543d33 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 22 Oct 2020 09:23:49 +0000 Subject: (cherry-pick): Fix [c975939973]: Usage of gnu_printf in latest mingw-w64. Change (internal, windows-only) TCL_I_MODIFIER to TCL_Z_MODIFIER, since that's how it's called in Tcl 8.7 and up --- generic/tcl.h | 2 +- win/tclWin32Dll.c | 2 +- win/tclWinChan.c | 16 ++++++++-------- win/tclWinConsole.c | 2 +- win/tclWinInt.h | 15 +++++++++++---- win/tclWinPipe.c | 10 +++++----- win/tclWinPort.h | 4 ++++ win/tclWinSerial.c | 4 ++-- win/tclWinSock.c | 20 ++++++++++---------- 9 files changed, 43 insertions(+), 32 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index d7d064c..3232734 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -354,7 +354,7 @@ typedef long LONG; */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__WIN32__) +# if defined(__WIN32__) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ # define TCL_LL_MODIFIER "L" diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 560b448..33c29f7 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -543,7 +543,7 @@ TclpGetCStackParams( if (!tsdPtr->stackBound || ((UINT_PTR)&tsdPtr < (UINT_PTR)tsdPtr->stackBound)) { - /* + /* * Either we haven't determined the stack bound in this thread, * or else we've overflowed the bound that we previously * determined. We need to find a new stack bound from diff --git a/win/tclWinChan.c b/win/tclWinChan.c index a271919..6073e2f 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -967,7 +967,7 @@ TclpOpenFileChannel( switch (FileGetType(handle)) { case FILE_TYPE_SERIAL: /* - * Natively named serial ports "com1-9", "\\\\.\\comXX" are + * Natively named serial ports "com1-9", "\\\\.\\comXX" are * already done with the code above. * Here we handle all other serial port names. * @@ -1356,7 +1356,7 @@ TclWinOpenFileChannel( infoPtr->flags = appendMode; infoPtr->handle = handle; infoPtr->dirty = 0; - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName, (ClientData) infoPtr, permissions); @@ -1518,8 +1518,8 @@ FileGetType( * NativeIsComPort -- * * Determines if a path refers to a Windows serial port. - * A simple and efficient solution is to use a "name hint" to detect - * COM ports by their filename instead of resorting to a syscall + * A simple and efficient solution is to use a "name hint" to detect + * COM ports by their filename instead of resorting to a syscall * to detect serialness after the fact. * The following patterns cover common serial port names: * COM[1-9]:? @@ -1547,7 +1547,7 @@ NativeIsComPort( * 1. Look for com[1-9]:? */ - if ( (len >= 4) && (len <= 5) + if ( (len >= 4) && (len <= 5) && (_wcsnicmp(p, L"com", 3) == 0) ) { /* * The 4th character must be a digit 1..9 optionally followed by a ":" @@ -1566,7 +1566,7 @@ NativeIsComPort( * 2. Look for //./com[0-9]+ or \\.\com[0-9]+ */ - if ( (len >= 8) && ( + if ( (len >= 8) && ( (_wcsnicmp(p, L"//./com", 7) == 0) || (_wcsnicmp(p, L"\\\\.\\com", 7) == 0) ) ) { @@ -1590,7 +1590,7 @@ NativeIsComPort( * 1. Look for com[1-9]:? */ - if ( (len >= 4) && (len <= 5) + if ( (len >= 4) && (len <= 5) && (strnicmp(p, "com", 3) == 0) ) { /* * The 4th character must be a digit 1..9 optionally followed by a ":" @@ -1609,7 +1609,7 @@ NativeIsComPort( * 2. Look for //./com[0-9]+ or \\.\com[0-9]+ */ - if ( (len >= 8) && ( + if ( (len >= 8) && ( (strnicmp(p, "//./com", 7) == 0) || (strnicmp(p, "\\\\.\\com", 7) == 0) ) ) { diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 361fb3d..a563748 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -1361,7 +1361,7 @@ TclWinOpenConsoleChannel( * for instance). */ - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 39790a0..a84d218 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -52,11 +52,18 @@ typedef struct TCLEXCEPTION_REGISTRATION { #define VER_PLATFORM_WIN32_CE 3 #endif -#ifdef _WIN64 -# define TCL_I_MODIFIER "I" -#else -# define TCL_I_MODIFIER "" +#ifndef TCL_Z_MODIFIER +# ifdef _WIN64 +# if defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO +# define TCL_Z_MODIFIER "ll" +# else +# define TCL_Z_MODIFIER "I" +# endif +# else +# define TCL_Z_MODIFIER "" +# endif #endif +#define TCL_I_MODIFIER TCL_Z_MODIFIER /* * The following structure keeps track of whether we are using the diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index cdb955f..fd941d7 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1580,10 +1580,10 @@ QuoteCmdLinePart( QuoteCmdLineBackslash(dsPtr, start, *bspos, NULL); start = *bspos; } - /* - * escape all special chars enclosed in quotes like `"..."`, note that here we + /* + * escape all special chars enclosed in quotes like `"..."`, note that here we * don't must escape `\` (with `\`), because it's outside of the main quotes, - * so `\` remains `\`, but important - not at end of part, because results as + * so `\` remains `\`, but important - not at end of part, because results as * before the quote, so `%\%\` should be escaped as `"%\%"\\`). */ Tcl_DStringAppend(dsPtr, "\"", 1); /* opening escape quote-char */ @@ -1738,7 +1738,7 @@ BuildCommandLine( special++; } /* rest of argument (and escape backslashes before closing main quote) */ - QuoteCmdLineBackslash(&ds, start, special, + QuoteCmdLineBackslash(&ds, start, special, (quote & CL_QUOTE) ? bspos : NULL); } if (quote & CL_QUOTE) { @@ -1836,7 +1836,7 @@ TclpCreateCommandChannel( * unique, in case channels share handles (stdin/stdout). */ - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName, (ClientData) infoPtr, infoPtr->validMask); diff --git a/win/tclWinPort.h b/win/tclWinPort.h index d3dbb1b..358398d 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -19,6 +19,10 @@ /* See [Bug 3354324]: file mtime sets wrong time */ # define __MINGW_USE_VC2005_COMPAT #endif +#if !defined(__USE_MINGW_ANSI_STDIO) +/* See [Bug c975939973]: Usage of gnu_printf in latest mingw-w64 */ +# define __USE_MINGW_ANSI_STDIO 0 +#endif #define WIN32_LEAN_AND_MEAN #include diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 83f1866..7bfada7 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1415,7 +1415,7 @@ SerialWriterThread( * Opens or Reopens the serial port with the OVERLAPPED FLAG set * * Results: - * Returns the new handle, or INVALID_HANDLE_VALUE. + * Returns the new handle, or INVALID_HANDLE_VALUE. * If an existing channel is specified it is closed and reopened. * * Side effects: @@ -1502,7 +1502,7 @@ TclWinOpenSerialChannel( * are shared between multiple channels (stdin/stdout). */ - sprintf(channelName, "file%" TCL_I_MODIFIER "x", (size_t)infoPtr); + sprintf(channelName, "file%" TCL_Z_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 11632c4..8a1832a 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -691,7 +691,7 @@ SocketEventProc( if (infoPtr->lastError) { mask |= TCL_READABLE; - + } else { fd_set readFds; struct timeval timeout; @@ -1005,7 +1005,7 @@ CreateSocket( * Register for interest in events in the select mask. Note that this * automatically places the socket into non-blocking mode. */ - + ioctlsocket(sock, (long) FIONBIO, &flag); SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); @@ -1056,7 +1056,7 @@ CreateSocket( infoPtr->selectEvents |= FD_CONNECT | FD_READ | FD_WRITE | FD_CLOSE; infoPtr->flags |= SOCKET_ASYNC_CONNECT; - + /* * Free list lock */ @@ -1257,7 +1257,7 @@ WaitForSocketEvent( if ( 0 == (events & FD_CONNECT) ) { SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) UNSELECT, (LPARAM) infoPtr); - + SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); } @@ -1329,7 +1329,7 @@ Tcl_OpenTcpClient( return NULL; } - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE)); @@ -1394,7 +1394,7 @@ Tcl_MakeTcpClientChannel( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE)); Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto crlf"); @@ -1447,7 +1447,7 @@ Tcl_OpenTcpServer( infoPtr->acceptProc = acceptProc; infoPtr->acceptProcData = acceptProcData; - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, 0); @@ -1553,7 +1553,7 @@ TcpAccept( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) newInfoPtr); - sprintf(channelName, "sock%" TCL_I_MODIFIER "u", (size_t)newInfoPtr->socket); + sprintf(channelName, "sock%" TCL_Z_MODIFIER "u", (size_t)newInfoPtr->socket); newInfoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) newInfoPtr, (TCL_READABLE | TCL_WRITABLE)); if (Tcl_SetChannelOption(NULL, newInfoPtr->channel, "-translation", @@ -2619,11 +2619,11 @@ TcpThreadActionProc( WaitForSingleObject(tsdPtr->socketListLock, INFINITE); infoPtr->nextPtr = tsdPtr->socketList; tsdPtr->socketList = infoPtr; - + if (infoPtr == tsdPtr->pendingSocketInfo) { tsdPtr->pendingSocketInfo = NULL; } - + SetEvent(tsdPtr->socketListLock); notifyCmd = SELECT; -- cgit v0.12