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
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
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
(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)
-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
INCLUDES = \
-Iheaders \
- -I$(XPMHOME) \
-I$(XINCLUDE) \
-I$(TCLHOME) \
-I$(TCLXHOME)/src \
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
RANLIB_CMD=ranlib
MCS_CMD=true
TCL_TK_LIBS= -L/usr/X11/lib -lX11 -lm -lXpm
+XINCLUDE=/usr/X11R6/include
TCL_MAN_SEPARATOR=
#define DAYLIGHT 1
#define STANDARD 2
#define MAYBE 3
+
+int yylex(void);
+void yyerror(const char *);
%}
%%
static char *lptr;
//static
+int
yylex()
{
#ifndef YYSTYPE
* Error message are not used, so discard with dummy function.
*/
-int
+void
yyerror(msg)
const char *msg;
{
*
*-----------------------------------------------------------------------------
*/
-int
-matherr (except)
- struct exception *except;
-{
- if (Tcl_MathError (except->name, except->type))
- return 1;
- else
- return 0;
-}
#else
\f
+++ /dev/null
-*** ../../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;
#------------------------------------------------------------------------------
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/\"
+++ /dev/null
-*** ../../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);
#------------------------------------------------------------------------------
-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)
#------------------------------------------------------------------------------
+++ /dev/null
-*** ../../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;
- }
+/#include "tclint.h"/a\
+\#include "tclxtend.h"
+
/(\*cmdPtr->proc)/a\
\ /*\
\ * Signal handling added for Extended Tcl.\
+++ /dev/null
-*** ../../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;
+/#include "tclint.h"/a\
+\#include "tclxint.h"
+
/ sprintf(interp->result, "%g", value.doubleValue);/c\
Tcl_ReturnDouble (interp, value.doubleValue);
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
ranlib libtk.a
$(TCL_DIR)/libtcl.a:
- cd $(TCL_DIR); make libtcl.a
+ cd $(TCL_DIR); $(MAKE) libtcl.a
clean:
touch junk~
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <unistd.h>
#ifndef _TCL
# include <tcl.h>
#endif
#include "tkconfig.h"
#include "tkint.h"
+#include "tclxtend.h"
+#include "tkwm.h"
#include <errno.h>
#include <signal.h>
#include <sys/time.h>
#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));