From: Michael Gernoth Date: Sat, 4 Jun 2022 12:13:05 +0000 (+0200) Subject: XINCLUDE: use /usr/X11R6/include everywhere X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/commitdiff_plain/HEAD?hp=59dd70c3b1f545e2239a63474c595b5061c559e2 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). --- 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 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/sim/makefile b/src/sim/makefile index bdf5847..afc440a 100644 --- a/src/sim/makefile +++ b/src/sim/makefile @@ -1,12 +1,12 @@ -XINCLUDE = /usr/include/X11 +XINCLUDE = /usr/X11R6/include TCLHOME = ../tcl TKHOME = ../tk 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 \ 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..7188333 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/X11R6/include TCL_MAN_SEPARATOR= 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; { 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 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/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/\" 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/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) #------------------------------------------------------------------------------ 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/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.\ 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; 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); diff --git a/src/tk/makefile b/src/tk/makefile index 344c37c..424f95b 100644 --- a/src/tk/makefile +++ b/src/tk/makefile @@ -29,11 +29,12 @@ 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 -XINCLUDE = /usr/include/X11 +TCLX_DIR = ../tclx/src +XINCLUDE = /usr/X11R6/include XLIB = -L/usr/X11R6/lib -lX11 -lXpm LIBS = libtk.a $(TCL_DIR)/libtcl.a @@ -175,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~ 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 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 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));