]> git.zerfleddert.de Git - micropolis/commitdiff
XINCLUDE: use /usr/X11R6/include everywhere master
authorMichael Gernoth <michael@gernoth.net>
Sat, 4 Jun 2022 12:13:05 +0000 (14:13 +0200)
committerMichael Gernoth <michael@gernoth.net>
Sat, 4 Jun 2022 12:13:05 +0000 (14:13 +0200)
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).

19 files changed:
Makefile
src/makefile
src/sim/makefile
src/tclx/config.mk
src/tclx/config/linux
src/tclx/src/tclxgdat.y
src/tclx/src/tclxmerr.c
src/tclx/tkucbsrc/main.dif [deleted file]
src/tclx/tkucbsrc/makefile
src/tclx/tkucbsrc/tkevent.dif [deleted file]
src/tclx/ucbsrc/makefile
src/tclx/ucbsrc/tclbasic.dif [deleted file]
src/tclx/ucbsrc/tclbasic.sed
src/tclx/ucbsrc/tclexpr.dif [deleted file]
src/tclx/ucbsrc/tclexpr.sed
src/tk/makefile
src/tk/tkconfig.h
src/tk/tkevent.c
src/tk/tkrawtcp.c

index 3f55dcc1da21ed0eb9ab6c9555c1a0db1b91e5b9..dc804a4c9923af3533ba3bbcb8610dbccddfd535 100644 (file)
--- 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
index 57217b1de27b011c1829e8667892314b03ce4a9b..bed6c5a2eb9804f7be19cea3119824b61264e48e 100644 (file)
@@ -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)
index bdf58472a6e1aa166281b2d9a0602b46ddf1d9f2..afc440ab8c143b3727c26fe7a97f61cb26ffbb67 100644 (file)
@@ -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 \
index 69ca791309411682d321ee3625dd7d4dc330d4c0..6108fbe8f1d21a9a63dfb1b423acc6c648087d13 100644 (file)
@@ -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
index 12a800d2d7185fc4519e8db53a8473d914c877b9..7188333d9306074a98b6c941dd35013c9a5d7b32 100644 (file)
@@ -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=
index 93b1610b8755b707bf354983fa52d87b65c97f64..aea9f3d49ced8818421c6aca538df0f1a08b17b3 100644 (file)
@@ -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;
 {
index dc3596b238e6a249673113c5543d4e0d584d90e4..06aad3a044f1ecd12b9fb01c5f9905072962b151 100644 (file)
  *
  *-----------------------------------------------------------------------------
  */
-int
-matherr (except)
-    struct exception *except;
-{
-    if (Tcl_MathError (except->name, except->type))
-        return 1;
-    else
-        return 0;
-}
 
 #else
 \f
diff --git a/src/tclx/tkucbsrc/main.dif b/src/tclx/tkucbsrc/main.dif
deleted file mode 100644 (file)
index 180a61f..0000000
+++ /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;
index 47f45f9329eae08ea1fca959e8dd7d3e04b80d1e..757ba45e01af54a5851d310105bc3306a1180216 100644 (file)
@@ -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 (file)
index f2efa9d..0000000
+++ /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 <errno.h>
-  #include <signal.h>
-  
-  /*
-   * For each timer callback that's pending, there is one record
-
---- 23,29 -----
-  #include "tkInt.h"
-  #include <errno.h>
-  #include <signal.h>
-+ 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);
index 5e796210d145b35e16b4f079c489be58b9bc741b..c03c768885c9acab32040768ab58b6aa5d72882d 100644 (file)
@@ -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 (file)
index 480ba28..0000000
+++ /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;
-       }
index c22bb1cda7abf5f322935fcaa7f56e16d91483b4..95976199bd4580d91b8c9866a5cf4a0ca52fe26f 100644 (file)
@@ -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 (file)
index fa8f070..0000000
+++ /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;
index ce0fd865102945a5289234d4eb827c98ad55616e..f3c1dab41e292d0ab4a7fc4b56cfd5c78a63ccac 100644 (file)
@@ -1,2 +1,5 @@
+/#include "tclint.h"/a\
+\#include "tclxint.h"
+
 /          sprintf(interp->result, "%g", value.doubleValue);/c\
            Tcl_ReturnDouble (interp, value.doubleValue);
index 344c37c2f2436200b52e865333784e472f165174..424f95b5b13deed5b783f055e9bcbfd42f1aa737 100644 (file)
 
 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~
index d8e27a20269f5d2912917bb212f9f5661b95d7c7..ca64595f679dcb7990399eb98b9438e224d86bbe 100644 (file)
@@ -45,6 +45,7 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <unistd.h>
 #ifndef _TCL
 #   include <tcl.h>
 #endif
index 5e2c654fe853682143dd154b8ef0fb2befa647cd..0e9deb0e6ff1fefc4a4f8029eb3e6d6cd6131e59 100644 (file)
@@ -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 <errno.h>
 #include <signal.h>
 #include <sys/time.h>
index f556e5f7df81b82fff62c573c8bd2e409ec75350..6caea9935b52f105f17fedfb70aca930a5893e8f 100644 (file)
@@ -43,6 +43,7 @@ static char rcsid[] = "...";
 #include <sys/un.h>
 
 #include <tk.h>
+#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));
Impressum, Datenschutz