Browse Source

Changed copyright notice, made installation less dependent on ACK

ceriel 33 years ago
parent
commit
6fa0e5bfb0

+ 1 - 0
util/LLgen/.distr

@@ -1,4 +1,5 @@
 READ_ME
+COPYING
 lib
 src
 Makefile

+ 18 - 0
util/LLgen/COPYING

@@ -0,0 +1,18 @@
+Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+All rights reserved.
+
+Permission to use and copy this software and its documentation for research
+and educational use only is hereby granted, provided that the above copyright
+notice and this permission notice appear in all copies.  No commercial use of
+any kind is permitted without permission in writing from the copyright owner.
+
+One way of obtaining such a permission is to obtain the Amsterdam Compiler
+Kit.  LLgen is part of it.  The Amsterdam Compiler Kit is available from
+two companies:
+
+Transmediair Products & Support B.V.            Unipress Software
+Melkweg 3                                       2025 Lincoln Highway
+3721 RG  Bilthoven                              Edison, NJ 08817
+The Netherlands                                 U.S.A.
+tel: +31 30 281820                              tel: +1 908 287 2100
+fax: +31 30 292294                              fax: +1 908 287 4929

+ 3 - 3
util/LLgen/LLgen.1

@@ -82,9 +82,9 @@ so that the compiler can generate a jump table for it. This will only be
 done for switches that have density between
 \fIlow_percentage\fP and \fIhigh_percentage\fP, as explained below.
 Usually, compilers generate a jumptable when the density of the switch
-is above a certain threshold. If you want jump tables in more cases,
-set \fIhigh_percentage\fP to this threshold, and \fIlow_percentage\fP to
-a minimum threshold. There is a time-space trade-off here.
+is above a certain threshold. When jump tables are to be used more often,
+\fIhigh_percentage\fP must be set to this threshold, and \fIlow_percentage\fP
+must be set to a minimum threshold. There is a time-space trade-off here.
 .I num
 is the minimum number of cases in a switch for the \fB\-j\fP option to be
 effective. The default value (if

+ 7 - 8
util/LLgen/Makefile

@@ -1,17 +1,16 @@
 # $Header$
-EMHOME=../..
-INSTALLDIR=$(EMHOME)/bin
-LIBDIR=$(EMHOME)/lib/LLgen
-MANDIR=$(EMHOME)/man
+INSTALLDIR=/usr/local/bin
+LIBDIR=/usr/local/lib/LLgen
+MANDIR=/usr/local/man/man1
 
 all:
-	cd src; make
+	cd src; make LIBDIR=$(LIBDIR)
 
 clean:
 	-cd src; make clean
 
 install:
-	cd src; make
+	cd src; make LIBDIR=$(LIBDIR)
 	rm -f $(INSTALLDIR)/LLgen $(LIBDIR)/rec $(LIBDIR)/incl $(MANDIR)/LLgen.1
 	cp src/LLgen $(INSTALLDIR)/LLgen
 	cp lib/rec $(LIBDIR)/rec
@@ -19,7 +18,7 @@ install:
 	cp LLgen.1 $(MANDIR)/LLgen.1
 
 firstinstall:
-	cd src; make first
+	cd src; make LIBDIR=$(LIBDIR) first
 	rm -f $(INSTALLDIR)/LLgen $(LIBDIR)/rec $(LIBDIR)/incl $(MANDIR)/LLgen.1
 	cp src/LLgen $(INSTALLDIR)/LLgen
 	-mkdir $(LIBDIR)
@@ -28,7 +27,7 @@ firstinstall:
 	cp LLgen.1 $(MANDIR)/LLgen.1
 
 cmp:
-	cd src; make
+	cd src; make LIBDIR=$(LIBDIR)
 	-cmp src/LLgen $(INSTALLDIR)/LLgen
 	-cmp lib/rec $(LIBDIR)/rec
 	-cmp lib/incl $(LIBDIR)/incl

+ 4 - 4
util/LLgen/proto.make

@@ -6,13 +6,13 @@ INSTALLDIR=$(TARGET_HOME)/bin
 LIBDIR=$(TARGET_HOME)/lib/LLgen
 
 all:
-	cd src; make
+	cd src; make LIBDIR=$(LIBDIR)
 
 clean:
 	-cd src; make clean
 
 install:
-	cd src; make
+	cd src; make LIBDIR=$(LIBDIR)
 	cp src/LLgen $(INSTALLDIR)/LLgen
 	if [ $(DO_MACHINE_INDEP) = y ] ; \
 	then	cp $(SRC_HOME)/util/LLgen/lib/rec $(LIBDIR)/rec ; \
@@ -21,7 +21,7 @@ install:
 	fi
 
 firstinstall:
-	cd src; make first
+	cd src; make LIBDIR=$(LIBDIR) first
 	cp src/LLgen $(INSTALLDIR)/LLgen
 	if [ $(DO_MACHINE_INDEP) = y ] ; \
 	then	if [ -d $(LIBDIR) ] ; then : ; else mkdir $(LIBDIR) ; fi ; \
@@ -31,7 +31,7 @@ firstinstall:
 	fi
 
 cmp:
-	cd src; make
+	cd src; make LIBDIR=$(LIBDIR)
 	-cmp src/LLgen $(INSTALLDIR)/LLgen
 	-cmp $(SRC_HOME)/util/LLgen/lib/rec $(LIBDIR)/rec
 	-cmp $(SRC_HOME)/util/LLgen/lib/incl $(LIBDIR)/incl

+ 2 - 4
util/LLgen/src/LLgen.g

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 13 - 9
util/LLgen/src/Makefile

@@ -1,25 +1,27 @@
 # $Header$
-EMHOME=../../..
 PROF=
 LLOPT= # -vvv -x
-INCLUDES = -I$(EMHOME)/h
-CFLAGS=-O -DNDEBUG $(INCLUDES) $(PROF)
+INCLUDES =
+DEFINES = -DNDEBUG
+CFLAGS=-O $(DEFINES) $(INCLUDES) $(PROF)
 LDFLAGS=
 OBJECTS = main.o gencode.o compute.o LLgen.o tokens.o check.o reach.o global.o name.o sets.o Lpars.o alloc.o machdep.o cclass.o
 CFILES = main.c gencode.c compute.c LLgen.c tokens.c check.c reach.c global.c name.c sets.c Lpars.c alloc.c machdep.c cclass.c
-FILES =types.h tunable.h extern.h io.h sets.h tokens.g LLgen.g main.c name.c compute.c sets.c gencode.c global.c check.c reach.c alloc.c machdep.c Makefile cclass.c
+FILES =types.h extern.h io.h sets.h tokens.g LLgen.g main.c name.c compute.c sets.c gencode.c global.c check.c reach.c alloc.c machdep.c Makefile cclass.c
 GFILES = tokens.g LLgen.g
-LINT = lint -b -DNDEBUG -DNORCSID
+LINT = lint -b $(DEFINES) -DNORCSID
+
+LIBDIRSTR = \"$(LIBDIR)\"
 
 all:		parser
-		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)"
+		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)" "LIBDIR=$(LIBDIR)"
 
 parser:		$(GFILES)
 		LLgen $(LLOPT) $(GFILES)
 		@touch parser
 
 first:		firstparser
-		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)"
+		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "PROF=$(PROF)" "LIBDIR=$(LIBDIR)"
 
 firstparser:
 		cp LLgen.c.dist LLgen.c
@@ -29,7 +31,7 @@ firstparser:
 		@touch parser
 
 LLgen:		$(OBJECTS)
-		$(CC) $(PROF) $(LDFLAGS) $(OBJECTS) $(EMHOME)/modules/lib/libsystem.a -o LLgen
+		$(CC) $(PROF) $(LDFLAGS) $(OBJECTS) -o LLgen
 		@size LLgen
 
 pr : 
@@ -49,6 +51,9 @@ distr:
 		cp LLgen.c LLgen.c.dist
 		cp tokens.c tokens.c.dist
 
+machdep.o:	machdep.c
+		$(CC) -c $(CFLAGS) -DLIBDIR=$(LIBDIRSTR) machdep.c
+
 # The next lines are generated automatically
 # AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
 LLgen.o:	Lpars.h
@@ -76,7 +81,6 @@ gencode.o:	types.h
 global.o:	extern.h
 global.o:	io.h
 global.o:	types.h
-machdep.o:	$(EMHOME)/h/em_path.h
 machdep.o:	types.h
 main.o:	extern.h
 main.o:	io.h

+ 15 - 17
util/LLgen/src/alloc.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -19,7 +17,6 @@
 
 # include "types.h"
 # include "extern.h"
-# include <local.h>
 
 # ifndef NORCSID
 static string rcsid = "$Header$";
@@ -68,19 +65,20 @@ new_mem(p) register p_info p; {
 
 	if (p->i_max >= p->i_top) {	/* No more free elements */
 		sz = p->i_size;
-#if BIGMACHINE
-		/*
-		   Do not worry about size. Just double it.
-		 */
-		p->i_size += p->i_size;
-		if (! p->i_size)
+		if (sizeof(char *) > 2) {
+			/*
+			   Do not worry about size. Just double it.
+			 */
+			p->i_size += p->i_size;
+			if (! p->i_size)
+				p->i_size += p->i_incr * p->i_esize;
+			}
+		else {
+			/*
+			   Worry about size, so only increment in chunks of i_incr.
+			 */
 			p->i_size += p->i_incr * p->i_esize;
-#else
-		/*
-		   Worry about size, so only increment in chunks of i_incr.
-		 */
-		p->i_size += p->i_incr * p->i_esize;
-#endif
+		}
 		p->i_ptr = !p->i_ptr ? 
 			alloc(p->i_size) :
 			ralloc(p->i_ptr, p->i_size);

+ 5 - 4
util/LLgen/src/cclass.c

@@ -1,8 +1,9 @@
-/* $Header$ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
+
+/* $Header$ */
+
 #include "cclass.h"
 char c_class[] = {
 	0,	/* 00 */

+ 5 - 4
util/LLgen/src/cclass.h

@@ -1,8 +1,9 @@
-/* $Header$ */
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
+
+/* $Header$ */
+
 extern char c_class[];
 
 #define ISLET 1

+ 2 - 4
util/LLgen/src/check.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 2 - 4
util/LLgen/src/compute.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 4 - 6
util/LLgen/src/extern.h

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,12 +11,12 @@
  */
 
 /*
- * extern.h $Header$
+ * $Header$
  * Miscellanious constants and
  * some variables that are visible in more than one file
  */
 
-# define LTEXTSZ	51	/* Size of longest token */
+# define LTEXTSZ	256	/* Size of longest token */
 
 /*
  * options for the identifier search routine

+ 2 - 4
util/LLgen/src/gencode.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 2 - 4
util/LLgen/src/global.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 3 - 5
util/LLgen/src/io.h

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,7 +11,7 @@
  */
 
 /*
- * io.h $Header$
+ * $Header$
  * Some important file names and variables
  */
 

+ 16 - 11
util/LLgen/src/machdep.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -17,8 +15,6 @@
  * Machine dependant things
  */
 
-
-# include <em_path.h>
 # include "types.h"
 
 # ifndef NORCSID
@@ -33,17 +29,27 @@ extern string	libpath();
 UNLINK(x) string x; {
 	/* Must remove the file "x" */
 
+#ifdef USE_SYS
 	sys_remove(x);	/* systemcall to remove file */
+#else
+	unlink(x);
+#endif
 }
 
 RENAME(x,y) string x,y; {
 	/* Must move the file "x" to the file "y" */
 
+#ifdef USE_SYS
 	if(! sys_rename(x,y)) fatal(1,"Cannot rename to %s",y);
+#else
+	unlink(y);
+	if (link(x,y) != 0) fatal(1,"Cannot rename to %s",y);
+	unlink(x);
+#endif
 }
 
 /* to make it easier to patch ... */
-char emdir[64] = EM_DIR;
+char libdir[256] = LIBDIR;
 
 string
 libpath(s) string s; {
@@ -53,12 +59,11 @@ libpath(s) string s; {
 	register length;
 	p_mem alloc();
 	string strcpy(), strcat();
-	static string subdir = "/lib/LLgen/";
 
-	length = strlen(emdir) + strlen(subdir) + strlen(s) + 1;
+	length = strlen(libdir) + strlen(s) + 2;
 	p = (string) alloc((unsigned) length);
-	strcpy(p,emdir);
-	strcat(p,subdir);
+	strcpy(p,libdir);
+	strcat(p,"/");
 	strcat(p,s);
 	return p;
 }

+ 2 - 4
util/LLgen/src/main.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 2 - 4
util/LLgen/src/name.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 9 - 6
util/LLgen/src/proto.make

@@ -3,8 +3,11 @@
 #PARAMS		do not remove this line
 
 SRC_DIR = $(SRC_HOME)/util/LLgen/src
-INCLUDES = -I$(TARGET_HOME)/h -I$(TARGET_HOME)/config -I$(SRC_DIR) -I.
-CFLAGS = -DNDEBUG $(INCLUDES) $(COPTIONS)
+LIBDIR = $(TARGET_HOME)/lib/LLgen
+INCLUDES = -I$(SRC_DIR) -I.
+LIBDIRSTR = \"$(LIBDIR)\"
+DEFINES = -DNDEBUG
+CFLAGS = $(DEFINES) $(INCLUDES) $(COPTIONS)
 LDFLAGS=$(LDOPTIONS)
 
 LLOPT= # -vvv -x
@@ -18,19 +21,19 @@ CSRC = $(SRC_DIR)/main.c $(SRC_DIR)/gencode.c $(SRC_DIR)/compute.c \
 	$(SRC_DIR)/machdep.c $(SRC_DIR)/cclass.c
 CFILES = LLgen.c tokens.c Lpars.c $(CSRC)
 GFILES = $(SRC_DIR)/tokens.g $(SRC_DIR)/LLgen.g
-FILES = $(SRC_DIR)/types.h $(SRC_DIR)/tunable.h $(SRC_DIR)/extern.h \
+FILES = $(SRC_DIR)/types.h $(SRC_DIR)/extern.h \
 	$(SRC_DIR)/io.h $(SRC_DIR)/sets.h \
 	$(GFILES) $(CSRC) $(SRC_DIR)/proto.make
 
 all:		parser
-		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)"
+		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LIBDIR=$(LIBDIR)"
 
 parser:		$(GFILES)
 		LLgen $(LLOPT) $(GFILES)
 		@touch parser
 
 first:		firstparser
-		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)"
+		@make LLgen "LDFLAGS=$(LDFLAGS)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LIBDIR=$(LIBDIR)"
 
 firstparser:
 		cp $(SRC_DIR)/LLgen.c.dist LLgen.c
@@ -109,7 +112,7 @@ global.$(SUF):	$(SRC_DIR)/io.h
 global.$(SUF):	$(SRC_DIR)/types.h
 
 machdep.$(SUF):	$(SRC_DIR)/machdep.c
-		$(CC) -c $(CFLAGS) $(SRC_DIR)/machdep.c
+		$(CC) -c $(CFLAGS) -DUSE_SYS -DLIBDIR=$(LIBDIRSTR) $(SRC_DIR)/machdep.c
 machdep.$(SUF):	$(SRC_DIR)/types.h
 
 main.$(SUF):	$(SRC_DIR)/main.c

+ 2 - 4
util/LLgen/src/reach.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 2 - 4
util/LLgen/src/sets.c

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 3 - 5
util/LLgen/src/sets.h

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,7 +11,7 @@
  */
 
 /*
- * sets.h $Header$
+ * $Header$
  * Some macros that deal with bitsets and their size
  */
 

+ 2 - 4
util/LLgen/src/tokens.g

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*

+ 3 - 5
util/LLgen/src/types.h

@@ -1,7 +1,5 @@
-/*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
+/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
+ * All rights reserved.
  */
 
 /*
@@ -13,7 +11,7 @@
  */
 
 /*
- * types.h $Header$
+ * $Header$
  * Type and structure definitions
  */