From d8223ed619188731aeeda7ae48f0eae24c4fafeb Mon Sep 17 00:00:00 2001 From: Nick Downing Date: Tue, 16 Apr 2019 21:23:05 +1000 Subject: [PATCH] Fix a few shellisms, configure for Z80 traditional and ANSI C only --- INSTALL | 102 +++++++++++++++++++++++++++++++++++++++++++++ em_path.h | 11 +++++ first/cp_dir | 6 +-- first/first | 8 ++-- first/get_makepars | 10 ++--- first/mk_makefile | 10 ++--- local.h | 19 +++++++++ macros | 18 ++++++++ make_macros | 79 +++++++++++++++++++++++++++++++++++ 9 files changed, 246 insertions(+), 17 deletions(-) create mode 100755 INSTALL create mode 100644 em_path.h create mode 100644 local.h create mode 100644 macros create mode 100644 make_macros diff --git a/INSTALL b/INSTALL new file mode 100755 index 0000000..050333e --- /dev/null +++ b/INSTALL @@ -0,0 +1,102 @@ +TARGET_HOME="/home/nick/src/Ack-5.5/stage"; export TARGET_HOME +UTIL_HOME="/home/nick/src/Ack-5.5/stage"; export UTIL_HOME +SRC_HOME="/home/nick/src/Ack-5.5"; export SRC_HOME +SYSNAME=""; export SYSNAME +ACM="z80"; export ACM +CURRENT="y"; export CURRENT +SYS="V7"; export SYS +LIMIT="y"; export LIMIT +CONFIG="/home/nick/src/Ack-5.5/build"; export CONFIG +DISABLE_LANG=" Modula-2 Pascal Occam Basic Fortran"; export DISABLE_LANG +DISABLE_SUP=" i86 xenix3 minix i386 6500 6800 6805 6809 i80 em22 em24 em44 m68k2 pmds minixST m68k4 pmds4 sun2 mantra m68020 sun3 sparc sparc_solaris ns pdp s2650 vax4 z8000 arm"; export DISABLE_SUP +DO_MACHINE_INDEP="y"; export DO_MACHINE_INDEP +MACH_LIST="i86 xenix3 minix i386 6500 6800 6805 6809 i80 em22 em24 em44 m68k2 pmds minixST m68k4 pmds4 sun2 mantra m68020 sun3 sparc sparc_solaris ns pdp s2650 vax4 z80 z8000 arm"; export MACH_LIST +SYSVAX=""; export SYSVAX +MACH="XXX"; export MACH +WS="4"; export WS +PS="8"; export PS +DO_FAST="n"; export DO_FAST +set -e + +PATH=::$CONFIG/bin:$UTIL_HOME/bin:/usr/ccs/bin:/usr/ucb:$PATH +export PATH + +$SRC_HOME/first/create_dir $CONFIG +$SRC_HOME/first/create_dir $CONFIG/bin + +echo "PATH=:$CONFIG/bin:$UTIL_HOME/bin:$PATH; export PATH" > $CONFIG/bin/TakeAction +cat $SRC_HOME/TakeAction >> $CONFIG/bin/TakeAction +sed '/^#PARAMS/r make_macros' < $SRC_HOME/first/mk_makefile > $CONFIG/bin/mk_makefile +cp $SRC_HOME/first/create_dir $CONFIG/bin/create_dir +cp $SRC_HOME/first/cp_dir $CONFIG/bin/cp_dir +chmod +x $CONFIG/bin/* + +$SRC_HOME/first/mk_config + +$SRC_HOME/first/mk_target + +$SRC_HOME/first/limit_impl + +case $SYSNAME in +i386) + ed -s $TARGET_HOME/lib/descr/fe << 'ABC' +1,$s/-D{NAME}/-D{NAME} -DNO_PROTOTYPE/ +w +q +ABC + ;; +esac + +: find varargs include file +: if not present use our own + +if test -f /usr/include/varargs.h +then + : +else + cp $SRC_HOME/include/_tail_cc/varargs.h $TARGET_HOME/modules/h +fi + +case X$SYSVAX in +Xvax_sysV_2) + ed -s $TARGET_HOME/lib/vax4/descr << 'ABC' +/CPP_F/s/$/ -D__USG/ +w +q +ABC + ed -s $CONFIG/mach/vax4/Action << 'ABC' +/libbsd4_2/s/libbsd4_2/libsysV_2/ +w +q +ABC + ( cd $CONFIG/mach/vax4 + for i in libcc libcc.ansi + do + ed -s $i/Makefile << 'ABC' +/BFS/s/BFS/UFS/ +w +q +ABC + done + ) + ;; +Xvax_bsd4_2) + ed -s $TARGET_HOME/lib/vax4/descr << 'ABC' +/CPP_F/s/$/ -D__BSD4_2/ +w +q +ABC + ;; +Xvax_bsd4_1a) + ed -s $CONFIG/mach/vax4/Action << 'ABC' +/libbsd4_2/s/libbsd4_2/libbsd4_1a/ +w +q +ABC + ;; +esac + +: and finally installing ... +cd $CONFIG +set +e +exec TakeAction diff --git a/em_path.h b/em_path.h new file mode 100644 index 0000000..0cb0ab3 --- /dev/null +++ b/em_path.h @@ -0,0 +1,11 @@ +/* $Id: em_path.h.src,v 2.9 1994/06/24 11:03:57 ceriel Exp $ */ +/* + * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. + * See the copyright notice in the ACK home directory, in the file "Copyright". + */ +/* Intended as a common directory for ALL temporary files */ +#define TMP_DIR "/tmp" + +/* Access to the ACK tree and parts thereof */ +#define EM_DIR "/home/nick/src/Ack-5.5/stage" /* The root directory for EM stuff */ +#define ACK_PATH "lib/descr" diff --git a/first/cp_dir b/first/cp_dir index 3bc1b28..4c5a13c 100755 --- a/first/cp_dir +++ b/first/cp_dir @@ -1,5 +1,5 @@ set -e -trap "rm -f /tmp/xx$$" 0 1 2 3 15 +trap "rm -f /tmp/xx__" 0 1 2 3 15 case $2 in /*) target_dir=$2 ;; @@ -7,10 +7,10 @@ case $2 in ;; esac cd $1 -tar cf /tmp/xx$$ . +tar cf /tmp/xx__ . if [ -d $target_dir ] then : else mkdir $target_dir fi cd $target_dir -tar xf /tmp/xx$$ +tar xf /tmp/xx__ diff --git a/first/first b/first/first index 430034d..b8d33f6 100755 --- a/first/first +++ b/first/first @@ -19,16 +19,16 @@ fi export E_FLAG E_SFX echo check write-ability of /tmp and /usr/tmp ... -if ( >/usr/tmp/aaax.$$ ) +if ( >/usr/tmp/aaax.__ ) then - rm /usr/tmp/aaax.$$ + rm /usr/tmp/aaax.__ else echo /usr/tmp must exist and be writable. exit 2 fi -if ( >/tmp/aaax.$$ ) +if ( >/tmp/aaax.__ ) then - rm /tmp/aaax.$$ + rm /tmp/aaax.__ else echo /tmp must exist and be writable. exit 2 diff --git a/first/get_makepars b/first/get_makepars index 36da886..6dc42a3 100755 --- a/first/get_makepars +++ b/first/get_makepars @@ -12,12 +12,12 @@ i86|minix|xenix3) WS=2 ; PS=2 know_target=1 ;; -*) trap "rm -f ws.c ws.o a.out t$$" 0 1 2 3 15 +*) trap "rm -f ws.c ws.o a.out t__" 0 1 2 3 15 cat > ws.c <<'EOF' #include main() { - printf("WS=%d ; PS=%d\n", sizeof(int), sizeof(char *)); + printf("WS=%d ; PS=%d\n", (int)sizeof(int), (int)sizeof(char *)); exit(0); } EOF @@ -26,9 +26,9 @@ EOF : We can find out ourselves what the word-size and : the pointer-size of the target machine is. cc ws.c 2>/dev/null - ./a.out > t$$ - . t$$ - rm -f t$$ a.out ws.[co] + ./a.out > t__ + . ./t__ + rm -f t__ a.out ws.[co] else : we will have to ask installer. echo $E_FLAG "Please give the word-size of the target-machine (sizeof(int)) in bytes: [$WS] $E_SFX" diff --git a/first/mk_makefile b/first/mk_makefile index 1b92018..34ba410 100755 --- a/first/mk_makefile +++ b/first/mk_makefile @@ -4,7 +4,7 @@ : starting with #PARAMS in "make_proto", and produces the result on : standard output. -trap "rm -f /tmp/mk_mak$$" 0 1 2 3 15 +trap "rm -f /tmp/mk_mak__" 0 1 2 3 15 case $# in 1) ;; *) echo "Usage: $0 " 1>&2 @@ -12,9 +12,9 @@ case $# in ;; esac -cp $1 /tmp/mk_mak$$ +cp $1 /tmp/mk_mak__ -ed -s /tmp/mk_mak$$ << 'EOF' +ed -s /tmp/mk_mak__ << 'EOF' /^#PARAMS/c #PARAMS do not remove this line! . @@ -23,12 +23,12 @@ q EOF case `ack_sys` in sparc_solaris) - ed -s /tmp/mk_mak$$ << 'EOF' + ed -s /tmp/mk_mak__ << 'EOF' g/^EXTRALIB/s/=/= -lelf/ w q EOF ;; esac -cat /tmp/mk_mak$$ +cat /tmp/mk_mak__ exit 0 diff --git a/local.h b/local.h new file mode 100644 index 0000000..e18ea2c --- /dev/null +++ b/local.h @@ -0,0 +1,19 @@ +/* $Id: local.h.src,v 2.8 1994/06/24 11:03:59 ceriel Exp $ */ +/* + * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. + * See the copyright notice in the ACK home directory, in the file "Copyright". + */ +/* collection of options, selected by including or excluding 'defines' */ + +/* Version number of the EM object code */ +# define VERSION 3 /* 16 bits number */ + +/* The default machine used by ack, acc, apc */ +# define ACKM "z80" + +/* size of local machine, either 0 (for 16 bit address space), or 1 */ +# define BIGMACHINE 1 + +/* operating system, SYS_5, V7, BSD4_1 or BSD4_2; Do NOT delete the comment + in the next line! */ +# define V7 1 /* SYSTEM */ diff --git a/macros b/macros new file mode 100644 index 0000000..5818f32 --- /dev/null +++ b/macros @@ -0,0 +1,18 @@ +TARGET_HOME="/home/nick/src/Ack-5.5/stage"; export TARGET_HOME +UTIL_HOME="/home/nick/src/Ack-5.5/stage"; export UTIL_HOME +SRC_HOME="/home/nick/src/Ack-5.5"; export SRC_HOME +SYSNAME=""; export SYSNAME +ACM="z80"; export ACM +CURRENT="y"; export CURRENT +SYS="V7"; export SYS +LIMIT="y"; export LIMIT +CONFIG="/home/nick/src/Ack-5.5/build"; export CONFIG +DISABLE_LANG=" Modula-2 Pascal Occam Basic Fortran"; export DISABLE_LANG +DISABLE_SUP=" i86 xenix3 minix i386 6500 6800 6805 6809 i80 em22 em24 em44 m68k2 pmds minixST m68k4 pmds4 sun2 mantra m68020 sun3 sparc sparc_solaris ns pdp s2650 vax4 z8000 arm"; export DISABLE_SUP +DO_MACHINE_INDEP="y"; export DO_MACHINE_INDEP +MACH_LIST="i86 xenix3 minix i386 6500 6800 6805 6809 i80 em22 em24 em44 m68k2 pmds minixST m68k4 pmds4 sun2 mantra m68020 sun3 sparc sparc_solaris ns pdp s2650 vax4 z80 z8000 arm"; export MACH_LIST +SYSVAX=""; export SYSVAX +MACH="XXX"; export MACH +WS="4"; export WS +PS="8"; export PS +DO_FAST="n"; export DO_FAST diff --git a/make_macros b/make_macros new file mode 100644 index 0000000..bd277c7 --- /dev/null +++ b/make_macros @@ -0,0 +1,79 @@ +# Paths: +SRC_HOME = /home/nick/src/Ack-5.5 +TARGET_HOME = /home/nick/src/Ack-5.5/stage +UTIL_HOME = /home/nick/src/Ack-5.5/stage + +# Machine independent part created? +DO_MACHINE_INDEP = y + +# Target machine, only needed for fast compilers +MACH = XXX + +# compiler set for target machine + +CC=cc# # compiler to be used for compiling ACK + +# always passed to $(CC) -c. +COPTIONS=-O -D_EM_WSIZE=4 -D_EM_PSIZE=8 -D__XXX__ + +# passed to $(CC) -c when compiling modules. +LIBOPTIONS=# +# LIBOPTIONS=-LIB -L # when $(CC) is ACK + +CC_AND_MKDEP=cc-and-mkdep.all# # when $(CC) is neither ACK or SUN, +# CC_AND_MKDEP=cc-and-mkdep.ack## when $(CC) is an ACK-derived C compiler, +# CC_AND_MKDEP=cc-and-mkdep.sun## when $(CC) is a SUN C compiler + +LDOPTIONS=# # always passed to $(CC) when linking + +SUF=o# # suffix of files produced with $(CC) -c + +AR=ar# # archiver for Unix format objects +# AR=aal# # archiver for ACK .o format objects +# AR=arch# # archiver for ACK .s format objects + +RANLIB=ranlib# # when ranlib required +# RANLIB=:# # when ranlib not required + +LIBSUF=a# # suffix of object libraries + +# compiler set for producing runnable binaries (possibly using $(UTIL_HOME)). +# This must describe the compiler with which $(UTIL_HOME) has been compiled. +# If $(TARGET_HOME) is identical to $(UTIL_HOME), which usually will be +# the case, this part does not have to be changed. Otherwise (when you are +# cross-compiling ACK), you will have to change this part. Probable +# replacements are given in comments. Maybe the installation script +# has already changed them, but they should be checked to be sure. + +UCC=$(CC) +#UCC=cc# # compiler to be used + +UCOPTIONS=$(COPTIONS) +#UCOPTIONS=-O# # always passed to $(UCC) -c. + +ULDOPTIONS=$(LDOPTIONS) +#ULDOPTIONS=# # always passed to $(UCC) when linking + +USUF=$(SUF) +#USUF=o# # suffix of files produced with $(UCC) -c + +ULIBSUF=$(LIBSUF) +#ULIBSUF=a# # suffix of object libraries for $(UCC) + +# There are two choices for lint here: ACK lint and Unix lint. +# The current setup is for ACK lint. If you want to use the Unix lint, +# put '#' signs on the next 4 lines that have ACK in them. + +LINT=/usr/bin/lint# # Unix lint +LINT=$(UTIL_HOME)/bin/lint# # ACK lint + +LINTOPTIONS=# # options always passed to lint + +LINTPREF=llib-l# # prefix of unix lint libraries +LINTPREF=# # ACK lint libraries do not have a prefix + +LINTSUF=ln# # suffix of Unix lint libraries +LINTSUF=llb# # suffix of ACK lint libraries + +MK_LINT_LIB=lint-lib.unix# # for Unix lint +MK_LINT_LIB=lint-lib.ack# # for ACK lint -- 2.34.1