From d10a594c04990d6853986f2b4e532ab5077e85bc Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 9 Jun 2018 14:10:45 +0900 Subject: [PATCH] Get ass running --- it's very K&R and almost certainly won't build on clang, but it works on gcc. --- build.lua | 2 ++ util/ass/ass00.h | 5 +++++ util/ass/assci.c | 4 ++-- util/ass/asscm.c | 1 - util/ass/assex.h | 13 ------------ util/ass/build.lua | 51 ++++++++++++++++++++++++++++++++++++++++++++++ util/ass/em_ass.6 | 2 +- 7 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 util/ass/build.lua diff --git a/build.lua b/build.lua index c95e3acf3..1ecf0eb12 100644 --- a/build.lua +++ b/build.lua @@ -45,7 +45,9 @@ installable { "util/ack+pkg", "util/amisc+pkg", "util/arch+pkg", + "util/ass+pkg", "util/ego+pkg", + "util/ass+pkg", "util/led+pkg", "util/misc+pkg", "util/opt+pkg", diff --git a/util/ass/ass00.h b/util/ass/ass00.h index 6da8fb173..7b31d89ff 100644 --- a/util/ass/ass00.h +++ b/util/ass/ass00.h @@ -2,7 +2,12 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ +#include #include +#include +#include +#include +#include #include #include #include diff --git a/util/ass/assci.c b/util/ass/assci.c index d3d0b9692..3b9761eac 100644 --- a/util/ass/assci.c +++ b/util/ass/assci.c @@ -850,7 +850,7 @@ extxcon(header) { } /* Added atol() that ignores overflow. --Ceriel */ -long atol(s) +long myatol(s) register char *s; { register long total = 0; @@ -879,6 +879,6 @@ extvcon(header) { if ( consiz>4 ) { error("Size of initializer exceeds loader capability") ; } - extarb((int)consiz,atol(string)) ; + extarb((int)consiz,myatol(string)) ; return ; } diff --git a/util/ass/asscm.c b/util/ass/asscm.c index eb9f853bf..e2b72e953 100644 --- a/util/ass/asscm.c +++ b/util/ass/asscm.c @@ -47,7 +47,6 @@ area_t getarea(size) unsigned size ; { register struct freeblock *c_ptr,*l_ptr ; register char *ptr ; unsigned rqsize ; - char *malloc() ; size = ((size + (sizeof(int) - 1)) / sizeof(int)) * sizeof(int); #ifdef MEMUSE diff --git a/util/ass/assex.h b/util/ass/assex.h index f28c6f582..86359ba11 100644 --- a/util/ass/assex.h +++ b/util/ass/assex.h @@ -150,16 +150,3 @@ extern relc_t *text_reloc(); extern relc_t *data_reloc(); extern area_t getarea(); -/* - * all used library routines - */ -extern char *malloc(); -extern int open(); -extern int creat(); -extern int getpid(); -extern int unlink(); -extern int close(); -extern int strcmp(); -extern char *strcpy(); - -#define void int diff --git a/util/ass/build.lua b/util/ass/build.lua new file mode 100644 index 000000000..77e12141c --- /dev/null +++ b/util/ass/build.lua @@ -0,0 +1,51 @@ +cprogram { + name = "maktab", + srcs = { + "./maktab.c" + }, + deps = { + "h+emheaders", + "modules/src/em_data+lib", + } +} + +normalrule { + name = "asstb", + ins = { + "+maktab", + "etc/ip_spec.t" + }, + outleaves = { + "asstb.c" + }, + commands = { + "%{ins} %{outs}" + } +} + +cprogram { + name = "em_ass", + srcs = { + "./ass*.c", + "+asstb", + }, + deps = { + "h+emheaders", + "h+local", + --"modules/src/alloc+lib", + "modules/src/em_data+lib", + --"modules/src/data+lib", + --"modules/src/object+lib", + --"modules/src/system+lib", + "./ass*.h", + } +} + +installable { + name = "pkg", + map = { + ["$(PLATDEP)/em_ass"] = "+em_ass", + ["$(INSDIR)/share/man/man6/em_ass.6"] = "./em_ass.6", + } +} + diff --git a/util/ass/em_ass.6 b/util/ass/em_ass.6 index cb2eb21c3..3f8cdb279 100644 --- a/util/ass/em_ass.6 +++ b/util/ass/em_ass.6 @@ -4,7 +4,7 @@ .SH NAME em_ass \- EM assembler/loader .SH SYNOPSIS -.B ~em/lib.bin/em_ass +.B ~em/lib/ack/em_ass [options] argument ... .SH DESCRIPTION Em_ass assembles and links EM modules.