From cc31822e4ebe54c0109623ac0c5cdf0e3acad755 Mon Sep 17 00:00:00 2001 From: Markus Koschany Date: Tue, 13 Mar 2018 21:42:31 +0100 Subject: [PATCH 01/15] remove matherr Work around "tclxmerr.c:40:30: error: dereferencing pointer to incomplete type 'struct exception'" --- src/tclx/src/tclxmerr.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/tclx/src/tclxmerr.c b/src/tclx/src/tclxmerr.c index dc3596b..06aad3a 100644 --- a/src/tclx/src/tclxmerr.c +++ b/src/tclx/src/tclxmerr.c @@ -33,15 +33,6 @@ * *----------------------------------------------------------------------------- */ -int -matherr (except) - struct exception *except; -{ - if (Tcl_MathError (except->name, except->type)) - return 1; - else - return 0; -} #else -- 2.39.2 From e049e4ba47308629d2233fdd3f85d49352463d9c Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 02/15] Makefile: Micropolis build fixes for recent macOS Hide the sim executable in an appropriately-named subdirectory of libexec rather than directly in libexec. In the micropolis wrapper script, use a shebang line, use exec so that the shell doesn't stay around, and quote user-supplied arguments properly. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3f55dcc..dc804a4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PREFIX=/usr/local DATADIR=$(PREFIX)/share/micropolis -LIBEXECDIR=$(PREFIX)/libexec +LIBEXECDIR=$(PREFIX)/libexec/micropolis BINDIR=$(PREFIX)/bin DOCDIR=$(PREFIX)/share/doc/micropolis PIXMAPDIR=$(PREFIX)/share/pixmaps @@ -64,9 +64,10 @@ install-dirs: install-bin: $(INSTALL) -m 0755 res/sim $(DESTDIR)/$(LIBEXECDIR)/sim $(INSTALL) -m 0755 res/sounds/player $(DESTDIR)/$(DATADIR)/res/sounds/player - echo "SIMHOME=$(DATADIR); export SIMHOME" >$(DESTDIR)/$(BINDIR)/micropolis + echo "#!/bin/sh" >$(DESTDIR)/$(BINDIR)/micropolis + echo "SIMHOME=$(DATADIR); export SIMHOME" >>$(DESTDIR)/$(BINDIR)/micropolis echo "echo \"Starting Micropolis in \$${SIMHOME} ... \"" >>$(DESTDIR)/$(BINDIR)/micropolis - echo "cd $(DATADIR) && $(LIBEXECDIR)/sim \$$*" >>$(DESTDIR)/$(BINDIR)/micropolis + echo "cd $(DATADIR) && exec $(LIBEXECDIR)/sim \"\$$@\"" >>$(DESTDIR)/$(BINDIR)/micropolis chmod 755 $(DESTDIR)/$(BINDIR)/micropolis install-res: install-res-sounds install-res-dejavu-lgc -- 2.39.2 From 81583a602d526bf267d2426f84615e512567b29a Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 03/15] src/sim/makefile: Micropolis build fixes for recent macOS Evaluate SDLINCLUDE and SDLLIB just once, not for every compile. Remove use of undefined XPMHOME variable. --- src/sim/makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sim/makefile b/src/sim/makefile index bdf5847..3f29de7 100644 --- a/src/sim/makefile +++ b/src/sim/makefile @@ -5,8 +5,8 @@ TCLXHOME = ../tclx TCLLIBRARY = /usr/local/lib/tcl TKLIBRARY = /usr/local/lib/tk -SDLINCLUDE = $$(/bin/sh ./sdl_helper cflags) -SDLLIBS = $$(/bin/sh ./sdl_helper libs) +SDLINCLUDE := $(shell /bin/sh sdl_helper cflags) +SDLLIBS := $(shell /bin/sh sdl_helper libs) CC = gcc @@ -31,7 +31,6 @@ INSTALL = install -s INCLUDES = \ -Iheaders \ - -I$(XPMHOME) \ -I$(XINCLUDE) \ -I$(TCLHOME) \ -I$(TCLXHOME)/src \ -- 2.39.2 From 64026b2057cc20136ebfb3d3aaf3fccd81e8b640 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 04/15] src/tclx/src/tclxgdat.y: Micropolis build fixes for recent macOS Fix: y.tab.c:1310:16: error: implicit declaration of function 'yylex' is invalid in C99 [-Werror,-Wimplicit-function-declaration] yychar = YYLEX; ^ y.tab.c:1586:7: error: implicit declaration of function 'yyerror' is invalid in C99 [-Werror,-Wimplicit-function-declaration] yyerror (YY_("syntax error")); ^ y.tab.c:1732:3: error: implicit declaration of function 'yyerror' is invalid in C99 [-Werror,-Wimplicit-function-declaration] yyerror (YY_("memory exhausted")); ^ --- src/tclx/src/tclxgdat.y | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tclx/src/tclxgdat.y b/src/tclx/src/tclxgdat.y index 93b1610..aea9f3d 100644 --- a/src/tclx/src/tclxgdat.y +++ b/src/tclx/src/tclxgdat.y @@ -58,6 +58,9 @@ #define DAYLIGHT 1 #define STANDARD 2 #define MAYBE 3 + +int yylex(void); +void yyerror(const char *); %} %% @@ -229,6 +232,7 @@ time_t daylcorr(future, now) time_t future, now; static char *lptr; //static +int yylex() { #ifndef YYSTYPE @@ -580,7 +584,7 @@ Tcl_GetDate (p, now, zone) * Error message are not used, so discard with dummy function. */ -int +void yyerror(msg) const char *msg; { -- 2.39.2 From 939cf6655a6c04ceaf2902c863de9242ac9aece8 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 05/15] src/tclx/tkucbsrc/makefile: Micropolis build fixes for recent macOS Fix: ../../tk/tkconfig.h:55:10: fatal error: 'X11/Xlib.h' file not found ^~~~~~~~~~~~ --- src/tclx/config.mk | 1 + src/tclx/config/linux | 1 + src/tclx/tkucbsrc/makefile | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tclx/config.mk b/src/tclx/config.mk index 69ca791..6108fbe 100644 --- a/src/tclx/config.mk +++ b/src/tclx/config.mk @@ -54,6 +54,7 @@ TCL_TK_SHELL=wish TCL_TK_DIR=../tk TK_LIBRARY=/usr/local/lib/tk XPM_LIBS=-L/usr/X11R6/lib -lXpm +XINCLUDE=/usr/X11R6/include #------------------------------------------------------------------------------ # Compiler debug/optimization/profiling flag to use. Not that if debugging or diff --git a/src/tclx/config/linux b/src/tclx/config/linux index 12a800d..e83296f 100644 --- a/src/tclx/config/linux +++ b/src/tclx/config/linux @@ -9,5 +9,6 @@ LIBS=-lm RANLIB_CMD=ranlib MCS_CMD=true TCL_TK_LIBS= -L/usr/X11/lib -lX11 -lm -lXpm +XINCLUDE=/usr/include/X11 TCL_MAN_SEPARATOR= diff --git a/src/tclx/tkucbsrc/makefile b/src/tclx/tkucbsrc/makefile index 47f45f9..757ba45 100644 --- a/src/tclx/tkucbsrc/makefile +++ b/src/tclx/tkucbsrc/makefile @@ -24,7 +24,7 @@ SHELL=/bin/sh #------------------------------------------------------------------------------ CFLAGS= $(OPTIMIZE_FLAG) $(XCFLAGS) -I../src -I../$(TCL_TK_DIR) \ - -I../$(TCL_UCB_DIR) -I$(XHOME)/include \ + -I../$(TCL_UCB_DIR) -I$(XINCLUDE) \ $(MEM_DEBUG_FLAGS) $(SYS_DEP_FLAGS) \ -DTK_VERSION=\"2.2/\" -- 2.39.2 From 3b72e7f203bdcef9c36b9fdabb5d237e3ba98ad5 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 06/15] src/tclx/ucbsrc/makefile: Micropolis build fixes for recent macOS Fix: tclbasic.c:23:10: fatal error: 'tclxtend.h' file not found ^~~~~~~~~~~~ --- src/tclx/ucbsrc/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tclx/ucbsrc/makefile b/src/tclx/ucbsrc/makefile index 5e79621..c03c768 100644 --- a/src/tclx/ucbsrc/makefile +++ b/src/tclx/ucbsrc/makefile @@ -24,7 +24,7 @@ SHELL=/bin/sh #------------------------------------------------------------------------------ -CFLAGS=$(OPTIMIZE_FLAG) $(XCFLAGS) -I../$(TCL_UCB_DIR) $(MEM_DEBUG_FLAGS) \ +CFLAGS=$(OPTIMIZE_FLAG) $(XCFLAGS) -I../src -I../$(TCL_UCB_DIR) $(MEM_DEBUG_FLAGS) \ $(SYS_DEP_FLAGS) #------------------------------------------------------------------------------ -- 2.39.2 From d0e1ede27a0c7ce4f381c108068887fe7c93d37f Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 07/15] src/tclx/ucbsrc/tclbasic.sed: Micropolis build fixes for recent macOS Fix: tclbasic.c:711:18: error: implicit declaration of function 'Tcl_CheckForSignal' is invalid in C99 [-Werror,-Wimplicit-function-declaration] result = Tcl_CheckForSignal (interp, result); ^ --- src/tclx/ucbsrc/tclbasic.sed | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tclx/ucbsrc/tclbasic.sed b/src/tclx/ucbsrc/tclbasic.sed index c22bb1c..9597619 100644 --- a/src/tclx/ucbsrc/tclbasic.sed +++ b/src/tclx/ucbsrc/tclbasic.sed @@ -1,3 +1,6 @@ +/#include "tclint.h"/a\ +\#include "tclxtend.h" + /(\*cmdPtr->proc)/a\ \ /*\ \ * Signal handling added for Extended Tcl.\ -- 2.39.2 From 1f4aeab6ff1a6d74140387d699f9839360c95156 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 08/15] src/tclx/ucbsrc/tclexpr.sed: Micropolis build fixes for recent macOS Fix: tclexpr.c:1321:1: error: implicit declaration of function 'Tcl_ReturnDouble' is invalid in C99 [-Werror,-Wimplicit-function-declaration] Tcl_ReturnDouble (interp, value.doubleValue); ^ --- src/tclx/ucbsrc/tclexpr.sed | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tclx/ucbsrc/tclexpr.sed b/src/tclx/ucbsrc/tclexpr.sed index ce0fd86..f3c1dab 100644 --- a/src/tclx/ucbsrc/tclexpr.sed +++ b/src/tclx/ucbsrc/tclexpr.sed @@ -1,2 +1,5 @@ +/#include "tclint.h"/a\ +\#include "tclxint.h" + / sprintf(interp->result, "%g", value.doubleValue);/c\ Tcl_ReturnDouble (interp, value.doubleValue); -- 2.39.2 From 5ec4544b058d7399f30b1736ff7079de9c173b93 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 09/15] src/tk/makefile: Micropolis build fixes for recent macOS Fix: tkevent.c:24:10: fatal error: 'tclxtend.h' file not found ^~~~~~~~~~~~ --- src/tk/makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tk/makefile b/src/tk/makefile index 344c37c..219063a 100644 --- a/src/tk/makefile +++ b/src/tk/makefile @@ -29,10 +29,11 @@ CC = gcc -CFLAGS = -I. -I$(XINCLUDE) -I$(TCL_DIR) -O3 -DTK_VERSION=\"2.3\" -DUSE_XPM3 -DIS_LINUX -#CFLAGS = -I. -I$(XINCLUDE) -I$(TCL_DIR) -g -DTK_VERSION=\"2.3\" -DUSE_XPM3 -DIS_LINUX +CFLAGS = -I. -I$(XINCLUDE) -I$(TCL_DIR) -I$(TCLX_DIR) -O3 -DTK_VERSION=\"2.3\" -DUSE_XPM3 -DIS_LINUX +#CFLAGS = -I. -I$(XINCLUDE) -I$(TCL_DIR) -I$(TCLX_DIR) -g -DTK_VERSION=\"2.3\" -DUSE_XPM3 -DIS_LINUX TCL_DIR = ../tcl +TCLX_DIR = ../tclx/src XINCLUDE = /usr/include/X11 XLIB = -L/usr/X11R6/lib -lX11 -lXpm -- 2.39.2 From 056053a6a9c5d780be96ae4865d01fed5700f90c Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 10/15] src/tk/tkconfig.h: Micropolis build fixes for recent macOS Fix: tkoption.c:875:9: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (read(fileId, buffer, (int) statBuf.st_size) != statBuf.st_size) { ^ --- src/tk/tkconfig.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tk/tkconfig.h b/src/tk/tkconfig.h index d8e27a2..ca64595 100644 --- a/src/tk/tkconfig.h +++ b/src/tk/tkconfig.h @@ -45,6 +45,7 @@ #include #include #include +#include #ifndef _TCL # include #endif -- 2.39.2 From 753d72ecb98f0d5f0543851fda4d246b4cc97ce9 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 11/15] src/tk/tkevent.c: Micropolis build fixes for recent macOS Fix: tkevent.c:682:3: error: implicit declaration of function 'TkWmProtocolEventProc' is invalid in C99 [-Werror,-Wimplicit-function-declaration] TkWmProtocolEventProc(winPtr, eventPtr); ^ tkevent.c:1447:5: error: implicit declaration of function 'Tcl_CheckForSignal' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (Tcl_CheckForSignal (tk_mainInterp, TCL_OK) == TCL_ERROR) ^ tkevent.c:1512:5: error: implicit declaration of function 'Tcl_CheckForSignal' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (Tcl_CheckForSignal (tk_mainInterp, TCL_OK) == TCL_ERROR) ^ --- src/tk/tkevent.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tk/tkevent.c b/src/tk/tkevent.c index 5e2c654..0e9deb0 100644 --- a/src/tk/tkevent.c +++ b/src/tk/tkevent.c @@ -21,6 +21,8 @@ static char rcsid[] = "$Header: /user6/ouster/wish/RCS/tkEvent.c,v 1.60 92/08/21 #include "tkconfig.h" #include "tkint.h" +#include "tclxtend.h" +#include "tkwm.h" #include #include #include -- 2.39.2 From 2647c123bd2f34f4147f06bed6f936cc122636e3 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 18 May 2022 05:53:08 -0500 Subject: [PATCH 12/15] src/tk/tkrawtcp.c: Micropolis build fixes for recent macOS Fix: tkrawtcp.c:658:3: error: implicit declaration of function 'TkBindError' is invalid in C99 [-Werror,-Wimplicit-function-declaration] TkBindError(interp); ^ tkrawtcp.c:665:3: error: implicit declaration of function 'TkBindError' is invalid in C99 [-Werror,-Wimplicit-function-declaration] TkBindError(interp); ^ tkrawtcp.c:672:3: error: implicit declaration of function 'TkBindError' is invalid in C99 [-Werror,-Wimplicit-function-declaration] TkBindError(interp); ^ tkrawtcp.c:680:3: error: implicit declaration of function 'TkBindError' is invalid in C99 [-Werror,-Wimplicit-function-declaration] TkBindError(interp); ^ --- src/tk/tkrawtcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tk/tkrawtcp.c b/src/tk/tkrawtcp.c index f556e5f..6caea99 100644 --- a/src/tk/tkrawtcp.c +++ b/src/tk/tkrawtcp.c @@ -43,6 +43,7 @@ static char rcsid[] = "..."; #include #include +#include "tkint.h" static int inet_connect _ANSI_ARGS_((char *host, char *port,int server)); static int unix_connect _ANSI_ARGS_((char *path, int server)); -- 2.39.2 From 34e37af786a9743ebe7bd76a518911affb9db72b Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 4 Jun 2022 11:26:39 +0200 Subject: [PATCH 13/15] remove outdated and unused .dif-files --- src/tclx/tkucbsrc/main.dif | 121 ---------------------------------- src/tclx/tkucbsrc/tkevent.dif | 57 ---------------- src/tclx/ucbsrc/tclbasic.dif | 22 ------- src/tclx/ucbsrc/tclexpr.dif | 20 ------ 4 files changed, 220 deletions(-) delete mode 100644 src/tclx/tkucbsrc/main.dif delete mode 100644 src/tclx/tkucbsrc/tkevent.dif delete mode 100644 src/tclx/ucbsrc/tclbasic.dif delete mode 100644 src/tclx/ucbsrc/tclexpr.dif diff --git a/src/tclx/tkucbsrc/main.dif b/src/tclx/tkucbsrc/main.dif deleted file mode 100644 index 180a61f..0000000 --- a/src/tclx/tkucbsrc/main.dif +++ /dev/null @@ -1,121 +0,0 @@ -*** ../../tk2.3/main.c Wed Aug 19 08:10:32 1992 ---- main.c Tue Oct 6 17:27:56 1992 -*************** -*** 19,24 - - #include "tkConfig.h" - #include "tkInt.h" - - /* - * Declarations for library procedures: - ---- 19,29 ----- - - #include "tkConfig.h" - #include "tkInt.h" -+ #define TK_EXTENDED -+ #ifdef TK_EXTENDED -+ # include "tclExtend.h" -+ Tcl_Interp *tk_mainInterp; /* Need to process signals */ -+ #endif - - /* - * Declarations for library procedures: -*************** -*** 30,35 - * Command used to initialize wish: - */ - - char initCmd[] = "source $tk_library/wish.tcl"; - - Tk_Window w; /* NULL means window has been deleted. */ - ---- 35,43 ----- - * Command used to initialize wish: - */ - -+ #ifdef TK_EXTENDED -+ char initCmd[] = "load wishx.tcl"; -+ #else - char initCmd[] = "source $tk_library/wish.tcl"; - #endif - -*************** -*** 31,36 - */ - - char initCmd[] = "source $tk_library/wish.tcl"; - - Tk_Window w; /* NULL means window has been deleted. */ - Tk_TimerToken timeToken = 0; - ---- 39,45 ----- - char initCmd[] = "load wishx.tcl"; - #else - char initCmd[] = "source $tk_library/wish.tcl"; -+ #endif - - Tk_Window w; /* NULL means window has been deleted. */ - Tk_TimerToken timeToken = 0; -*************** -*** 219,224 - int result; - Tk_3DBorder border; - - interp = Tcl_CreateInterp(); - #ifdef TCL_MEM_DEBUG - Tcl_InitMemory(interp); - ---- 228,236 ----- - int result; - Tk_3DBorder border; - -+ #ifdef TK_EXTENDED -+ tk_mainInterp = interp = Tcl_CreateExtendedInterp(); -+ #else - interp = Tcl_CreateInterp(); - #endif - #ifdef TCL_MEM_DEBUG -*************** -*** 220,225 - Tk_3DBorder border; - - interp = Tcl_CreateInterp(); - #ifdef TCL_MEM_DEBUG - Tcl_InitMemory(interp); - #endif - ---- 232,238 ----- - tk_mainInterp = interp = Tcl_CreateExtendedInterp(); - #else - interp = Tcl_CreateInterp(); -+ #endif - #ifdef TCL_MEM_DEBUG - Tcl_InitMemory(interp); - #endif -*************** -*** 284,289 - if (geometry != NULL) { - Tcl_SetVar(interp, "geometry", geometry, TCL_GLOBAL_ONLY); - } - result = Tcl_Eval(interp, initCmd, 0, (char **) NULL); - if (result != TCL_OK) { - goto error; - ---- 297,312 ----- - if (geometry != NULL) { - Tcl_SetVar(interp, "geometry", geometry, TCL_GLOBAL_ONLY); - } -+ #ifdef TK_EXTENDED -+ tclAppName = "Wish"; -+ tclAppLongname = "Wish - Tk Shell"; -+ tclAppVersion = TK_VERSION; -+ Tcl_ShellEnvInit (interp, TCLSH_ABORT_STARTUP_ERR, -+ name, -+ 0, NULL, /* argv var already set */ -+ fileName == NULL, /* interactive? */ -+ NULL); /* Standard default file */ -+ #endif - result = Tcl_Eval(interp, initCmd, 0, (char **) NULL); - if (result != TCL_OK) { - goto error; diff --git a/src/tclx/tkucbsrc/tkevent.dif b/src/tclx/tkucbsrc/tkevent.dif deleted file mode 100644 index f2efa9d..0000000 --- a/src/tclx/tkucbsrc/tkevent.dif +++ /dev/null @@ -1,57 +0,0 @@ -*** ../../tk2.3/tkEvent.c Fri Aug 21 16:16:16 1992 ---- tkEvent.c Tue Oct 6 17:28:21 1992 -*************** -*** 23,28 - #include "tkInt.h" - #include - #include - - /* - * For each timer callback that's pending, there is one record - ---- 23,29 ----- - #include "tkInt.h" - #include - #include -+ extern Tcl_Interp *tk_mainInterp; - - /* - * For each timer callback that's pending, there is one record -*************** -*** 1321,1326 - memcpy((VOID *) ready, (VOID *) masks, 3*MASK_SIZE*sizeof(int)); - timeout.tv_sec = timeout.tv_usec = 0; - do { - numFound = select(numFds, (SELECT_MASK *) readPtr, - (SELECT_MASK *) writePtr, (SELECT_MASK *) exceptPtr, - &timeout); - ---- 1322,1330 ----- - memcpy((VOID *) ready, (VOID *) masks, 3*MASK_SIZE*sizeof(int)); - timeout.tv_sec = timeout.tv_usec = 0; - do { -+ if (Tcl_CheckForSignal (tk_mainInterp, TCL_OK) == TCL_ERROR) -+ TkBindError(tk_mainInterp); -+ - numFound = select(numFds, (SELECT_MASK *) readPtr, - (SELECT_MASK *) writePtr, (SELECT_MASK *) exceptPtr, - &timeout); -*************** -*** 1384,1389 - } - memcpy((VOID *) ready, (VOID *) masks, 3*MASK_SIZE*sizeof(int)); - do { - numFound = select(numFds, (SELECT_MASK *) readPtr, - (SELECT_MASK *) writePtr, (SELECT_MASK *) exceptPtr, - timeoutPtr); - ---- 1388,1396 ----- - } - memcpy((VOID *) ready, (VOID *) masks, 3*MASK_SIZE*sizeof(int)); - do { -+ if (Tcl_CheckForSignal (tk_mainInterp, TCL_OK) == TCL_ERROR) -+ TkBindError(tk_mainInterp); -+ - numFound = select(numFds, (SELECT_MASK *) readPtr, - (SELECT_MASK *) writePtr, (SELECT_MASK *) exceptPtr, - timeoutPtr); diff --git a/src/tclx/ucbsrc/tclbasic.dif b/src/tclx/ucbsrc/tclbasic.dif deleted file mode 100644 index 480ba28..0000000 --- a/src/tclx/ucbsrc/tclbasic.dif +++ /dev/null @@ -1,22 +0,0 @@ -*** ../../tcl6.4/tclBasic.c Sun Jun 21 14:09:46 1992 ---- tclBasic.c Tue Oct 6 17:19:52 1992 -*************** -*** 705,710 - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; - result = (*cmdPtr->proc)(cmdPtr->clientData, interp, argc, argv); - if (result != TCL_OK) { - break; - } - ---- 705,714 ----- - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; - result = (*cmdPtr->proc)(cmdPtr->clientData, interp, argc, argv); -+ /* -+ * Signal handling added for Extended Tcl. -+ */ -+ result = Tcl_CheckForSignal (interp, result); - if (result != TCL_OK) { - break; - } diff --git a/src/tclx/ucbsrc/tclexpr.dif b/src/tclx/ucbsrc/tclexpr.dif deleted file mode 100644 index fa8f070..0000000 --- a/src/tclx/ucbsrc/tclexpr.dif +++ /dev/null @@ -1,20 +0,0 @@ -*** ../../tcl6.4/tclExpr.c Mon Mar 23 09:54:06 1992 ---- tclExpr.c Tue Oct 6 17:20:10 1992 -*************** -*** 1318,1324 - if (value.type == TYPE_INT) { - sprintf(interp->result, "%ld", value.intValue); - } else if (value.type == TYPE_DOUBLE) { -! sprintf(interp->result, "%g", value.doubleValue); - } else { - if (value.pv.buffer != value.staticSpace) { - interp->result = value.pv.buffer; - ---- 1318,1324 ----- - if (value.type == TYPE_INT) { - sprintf(interp->result, "%ld", value.intValue); - } else if (value.type == TYPE_DOUBLE) { -! Tcl_ReturnDouble (interp, value.doubleValue); - } else { - if (value.pv.buffer != value.staticSpace) { - interp->result = value.pv.buffer; -- 2.39.2 From ffe26d810b46010daa067f1995da042f81207080 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 4 Jun 2022 11:34:28 +0200 Subject: [PATCH 14/15] use $(MAKE) in recursion to subdirectories As gnu make is needed to compile micropolis, don't just directly call make in subdirectories but use $(MAKE) instead. --- src/makefile | 16 ++++++++-------- src/tk/makefile | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/makefile b/src/makefile index 57217b1..bed6c5a 100644 --- a/src/makefile +++ b/src/makefile @@ -75,10 +75,10 @@ TARFILES = \ micropolis-activity/Micropolis.png all: - cd tcl ; make all - cd tk ; make all - cd tclx ; make all - cd sim ; make all + cd tcl ; $(MAKE) all + cd tk ; $(MAKE) all + cd tclx ; $(MAKE) all + cd sim ; $(MAKE) all clean: rm -f Micropolis.tgz @@ -86,10 +86,10 @@ clean: (cd .. ; touch junk~ ; rm -f *~) touch junk~ ; rm -f *~ rm -rf BUILDIT - cd tcl ; make clean - cd tk ; make clean - cd tclx ; make clean - cd sim ; make clean + cd tcl ; $(MAKE) clean + cd tk ; $(MAKE) clean + cd tclx ; $(MAKE) clean + cd sim ; $(MAKE) clean install: all (cd $(RES) ; rm -f sim) diff --git a/src/tk/makefile b/src/tk/makefile index 219063a..885b54a 100644 --- a/src/tk/makefile +++ b/src/tk/makefile @@ -176,7 +176,7 @@ libtk.a: $(OBJS) ranlib libtk.a $(TCL_DIR)/libtcl.a: - cd $(TCL_DIR); make libtcl.a + cd $(TCL_DIR); $(MAKE) libtcl.a clean: touch junk~ -- 2.39.2 From 6f873e16d6a1a8f6f59c1e5a75ec5f52ce5c89b6 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 4 Jun 2022 14:13:05 +0200 Subject: [PATCH 15/15] XINCLUDE: use /usr/X11R6/include everywhere As X11 includes live in /usr/include on linux the previous path was wrong anyway so switch to a path which should work on other systems (does not break linux). --- src/sim/makefile | 2 +- src/tclx/config/linux | 2 +- src/tk/makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sim/makefile b/src/sim/makefile index 3f29de7..afc440a 100644 --- a/src/sim/makefile +++ b/src/sim/makefile @@ -1,4 +1,4 @@ -XINCLUDE = /usr/include/X11 +XINCLUDE = /usr/X11R6/include TCLHOME = ../tcl TKHOME = ../tk TCLXHOME = ../tclx diff --git a/src/tclx/config/linux b/src/tclx/config/linux index e83296f..7188333 100644 --- a/src/tclx/config/linux +++ b/src/tclx/config/linux @@ -9,6 +9,6 @@ LIBS=-lm RANLIB_CMD=ranlib MCS_CMD=true TCL_TK_LIBS= -L/usr/X11/lib -lX11 -lm -lXpm -XINCLUDE=/usr/include/X11 +XINCLUDE=/usr/X11R6/include TCL_MAN_SEPARATOR= diff --git a/src/tk/makefile b/src/tk/makefile index 885b54a..424f95b 100644 --- a/src/tk/makefile +++ b/src/tk/makefile @@ -34,7 +34,7 @@ CFLAGS = -I. -I$(XINCLUDE) -I$(TCL_DIR) -I$(TCLX_DIR) -O3 -DTK_VERSION=\"2.3\" TCL_DIR = ../tcl TCLX_DIR = ../tclx/src -XINCLUDE = /usr/include/X11 +XINCLUDE = /usr/X11R6/include XLIB = -L/usr/X11R6/lib -lX11 -lXpm LIBS = libtk.a $(TCL_DIR)/libtcl.a -- 2.39.2