From: dtrg Date: Tue, 18 Jul 2006 16:45:57 +0000 (+0000) Subject: Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells... X-Git-Tag: release-6-0-pre-1~145 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=454bdae81f376d61995bd059d4f51cef47e3f3ef;p=ack.git Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) --- 454bdae81f376d61995bd059d4f51cef47e3f3ef diff --cc bin/cc-and-mkdep.ack index fb7103eb8,000000000..78119d8e7 mode 100755,000000..100755 --- a/bin/cc-and-mkdep.ack +++ b/bin/cc-and-mkdep.ack @@@ -1,7 -1,0 +1,8 @@@ ++#!/bin/sh +: '$Id$' + +: Compile and make dependencies. First argument is the file on which the +: dependencies must be produced. This version is for ACK. +n=$1 +shift +exec $CC -Rcem-A$n -Rcem-m $* diff --cc bin/cc-and-mkdep.all index 3a5271ef6,000000000..c95fe300b mode 100755,000000..100755 --- a/bin/cc-and-mkdep.all +++ b/bin/cc-and-mkdep.all @@@ -1,20 -1,0 +1,21 @@@ ++#!/bin/sh +: '$Id$' + +: Compile and make dependencies. First argument is the file on which the +: dependencies must be produced. This version is a generic one that should +: work for all Unix systems. +n=$1 +shift +cpp_args= +for i in $* +do + case $i in + -I*|-D*|-U*) cpp_args="$cpp_args $i" + ;; + -*) ;; + *) cpp_args="$cpp_args $i" + ;; + esac +done - $UTIL_HOME/lib.bin/cpp -d -m $cpp_args > $n ++$UTIL_HOME/lib.bin/cpp -d -m $cpp_args > $n 2>/dev/null +exec $CC $* diff --cc bin/cc-and-mkdep.sun index 0245b9cf6,000000000..f5b3e93a6 mode 100755,000000..100755 --- a/bin/cc-and-mkdep.sun +++ b/bin/cc-and-mkdep.sun @@@ -1,7 -1,0 +1,8 @@@ ++#!/bin/sh +: '$Id$' + +: Compile and make dependencies. First argument is the file on which the +: dependencies must be produced. This version is for the SUN cc. +n=$1 +shift +exec $CC -Qpath $UTIL_HOME/lib.bin -Qoption cpp -d$n -Qoption cpp -m $* diff --cc bin/do_deps index 51418c741,000000000..a90d2034b mode 100755,000000..100755 --- a/bin/do_deps +++ b/bin/do_deps @@@ -1,18 -1,0 +1,19 @@@ ++#!/bin/sh +: '$Id$' + +: Produce dependencies for all argument files + +for i in $* +do + n=`basename $i .c` + if [ -f $n.dep ] + then + : + else + echo $n.'$(SUF): '$i > $n.dep + echo " head -5 $n.dep > $n.dp1" >> $n.dep + echo ' CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" $(CC_AND_MKDEP) '$n.dp2 '$(CFLAGS)' -c $i >> $n.dep + echo " cat $n.dp1 $n.dp2 > $n.dep" >> $n.dep + echo " rm -f $n.dp1 $n.dp2" >> $n.dep + fi +done diff --cc bin/do_resolve index 064bcbedf,000000000..020774075 mode 100755,000000..100755 --- a/bin/do_resolve +++ b/bin/do_resolve @@@ -1,47 -1,0 +1,48 @@@ ++#!/bin/sh +: '$Id$' + +: Resolve name clashes in the files on the argument list. If these +: files reside in another directory, a copy is made in the current +: directory. If not, it is overwritten. Never do this in a source +: directory! A list of the new files is produced on standard output. + +UTIL_BIN=$UTIL_HOME/bin + +trap "rm -f tmp$$ a.out nmclash.* longnames clashes" 0 1 2 3 15 + +: first find out if we have to resolve problems with identifier significance. + +cat > nmclash.c <<'EOF' +/* Accepted if many characters of long names are significant */ +abcdefghijklmnopr() { } +abcdefghijklmnopq() { } +main() { } +EOF +if $CC nmclash.c +then : no identifier significance problem + for i in $* + do + echo $i + done +else + $UTIL_BIN/prid -l7 $* > longnames + + : remove code generating routines from the clashes list. + : code generating routine names start with C_. + : also remove names starting with flt_. + + sed '/^C_/d' < longnames | sed '/^flt_/d' > tmp$$ + $UTIL_BIN/cclash -c -l7 tmp$$ > clashes + for i in $* + do + $UTIL_BIN/cid -Fclashes < $i > tmp$$ + n=`basename $i .xxx` + if cmp -s $n tmp$$ + then + rm -f tmp$$ + else + mv tmp$$ $n + fi + echo $n + done +fi diff --cc bin/lint-lib.ack index b851ac270,000000000..304b5ef2f mode 100755,000000..100755 --- a/bin/lint-lib.ack +++ b/bin/lint-lib.ack @@@ -1,12 -1,0 +1,13 @@@ ++#!/bin/sh +: '$Id$' + +: Create a lint library file. The name of the library file is constructed +: from the first argument. The second argument indicates the directory where +: the result is to be placed. This version is for ACK lint. + +n=$1 +shift +d=$1 +shift +lint -L$n $* +mv $n.llb $d diff --cc bin/lint-lib.unix index eb20c2625,000000000..dda4d9f5d mode 100755,000000..100755 --- a/bin/lint-lib.unix +++ b/bin/lint-lib.unix @@@ -1,12 -1,0 +1,13 @@@ ++#!/bin/sh +: '$Id$' + +: Create a lint library file. The name of the library file is constructed +: from the first argument. The second argument indicates the directory where +: the result is to be placed. This version is for Unix lint. + +n=$1 +shift +d=$1 +shift +/usr/bin/lint -C$n $* +mv llib-l$n.ln $d diff --cc bin/mk_manpage index 6b7d95302,000000000..254b88b4c mode 100755,000000..100755 --- a/bin/mk_manpage +++ b/bin/mk_manpage @@@ -1,18 -1,0 +1,20 @@@ ++#!/bin/sh ++ +num=`expr $1 : '.*\.\([1-8]\)'` + +if [ -d $2/man ] ; then : ; else mkdir $2/man ; fi +if [ -f $2/man/head ] ; then : ; else cat > $2/man/head <<'EOF' +.rn TH yy +.de TH +.di zz +.yy "\\$1" "\\$2" "\\$3" "\\$4" +.ds ]W 5th ACK distribution +.ds ]D Amsterdam Compiler Kit +.ds ]L "\\$3 +.di +.rm zz +.. +EOF +fi +if [ -d $2/man/man$num ] ; then : ; else mkdir $2/man/man$num ; fi +cat $2/man/head $1 | sed "s!TARGETHOME!$2!" > $2/man/man$num/`expr //$1 : '.*/\([^/]*\)'` diff --cc bin/rm_deps index 6a136f132,000000000..a343bebb0 mode 100755,000000..100755 --- a/bin/rm_deps +++ b/bin/rm_deps @@@ -1,8 -1,0 +1,9 @@@ ++#!/bin/sh +: $Id$ + +: remove dependencies from a makefile, write result on standard output. +: we cannot do this directly in a makefile because some make versions +: have # start a comment, always. + +sed -e '/^#DEPENDENCIES/,$d' $1 +echo '#DEPENDENCIES' diff --cc distr/dwalk index 6db9f0e02,000000000..1a869f105 mode 100755,000000..100755 --- a/distr/dwalk +++ b/distr/dwalk @@@ -1,24 -1,0 +1,26 @@@ ++#!/bin/sh ++ +: ${CDIR=.} +${DF-:} $CDIR .distr +if test ! -r $DESTDIR/$CDIR/.distr +then + echo ++ no .distr in $CDIR 1>&2 + exit 0 +fi +for i in `cat $DESTDIR/$CDIR/.distr` +do + if test -d $i + then + ( if cd $i + then + CDIR=$CDIR/$i + export CDIR + exec $DDIR/dwalk $* + else + echo ++ Could not access $CDIR/$i 1>&2 + fi + ) + else + ${DF-:} $CDIR $i + fi +done diff --cc distr/mk_distr_syms index 2075f7597,000000000..8263c1181 mode 100755,000000..100755 --- a/distr/mk_distr_syms +++ b/distr/mk_distr_syms @@@ -1,39 -1,0 +1,40 @@@ ++#!/bin/sh +: Utility to make a tree of symbolic links to source tree. +: Mount the source tree read-only, use this script, and then try installation. +case $# in +2) ;; +*) echo "Usage: $0 " 1>&2 + exit 1 + ;; +esac +if [ -f $1/.distr ] +then + for i in `cat $1/.distr` + do + if [ -d $1/$i ] + then + if mkdir $2/$i && $0 $1/$i $2/$i + then + : + else + exit 2 + fi + else + if [ -f $1/$i ] + then + if ln -s $1/$i $2/$i + then + : + else + exit 3 + fi + else + echo "Missing file $1/$i" 1>&2 + exit 4 + fi + fi + done +else + echo "No .distr file in $1" 1>&2 + exit 5 +fi diff --cc distr/mka index 21f738cb6,000000000..1581e662b mode 100755,000000..100755 --- a/distr/mka +++ b/distr/mka @@@ -1,9 -1,0 +1,11 @@@ ++#!/bin/sh ++ +set -e +for i in `tail +2 $DESTDIR/$1/LIST` +do + ${DF-false} $1 $i +done +cd $DESTDIR/$1 +arch cDr `cat LIST` +: I do not remove the files constituating the library, because +: they might be present in .distr diff --cc distr/mkf index 6ba970378,000000000..c7f572f91 mode 100755,000000..100755 --- a/distr/mkf +++ b/distr/mkf @@@ -1,17 -1,0 +1,19 @@@ ++#!/bin/sh ++ +if [ -f $DESTDIR/$1/$2 ] +then + : +elif grep LIST $DESTDIR/$1/.distr >/dev/null 2>&1 && + (test "$2" = "`head -1 $DESTDIR/$1/LIST`") >/dev/null 2>&1 && + ${DA-false} "$1" "$2" +then +: Fetched library contents one by one and put them together +elif ( cd $DESTDIR/$1 ; make distr ) > /dev/null 2>&1 +then + echo ++ $1/$2 made 1>&2 +elif ( cd $DESTDIR/$1 ; make $2 ) > /dev/null 2>&1 +then + echo ++ $1/$2 made 1>&2 +else + echo ++ $1/$2 not present 1>&2 +fi diff --cc first/cp_dir index 3bc1b28a7,000000000..a5c66906f mode 100755,000000..100755 --- a/first/cp_dir +++ b/first/cp_dir @@@ -1,16 -1,0 +1,18 @@@ ++#!/bin/sh ++ +set -e +trap "rm -f /tmp/xx$$" 0 1 2 3 15 +case $2 in +/*) target_dir=$2 + ;; +*) target_dir=`pwd`/$2 + ;; +esac +cd $1 +tar cf /tmp/xx$$ . +if [ -d $target_dir ] +then : +else mkdir $target_dir +fi +cd $target_dir +tar xf /tmp/xx$$ diff --cc first/create_dir index e805fd6e7,000000000..4f60bfba0 mode 100755,000000..100755 --- a/first/create_dir +++ b/first/create_dir @@@ -1,11 -1,0 +1,13 @@@ ++#!/bin/sh ++ +if ( cd $1 ) 2>/dev/null +then + : +elif mkdir $1 2>/dev/null +then + : +else + echo $0: could not create directory $1 1>&2 + exit 1 +fi +exit 0 diff --cc first/first index 0bd2d5c83,000000000..0d06efba0 mode 100755,000000..100755 --- a/first/first +++ b/first/first @@@ -1,207 -1,0 +1,208 @@@ +#! /bin/sh ++ +case $0 in +*/first) + FDIR=`expr $0 : '\(.*\)/first'` + ;; +first) FDIR=. + ;; +esac + +if echo 'a\c' | grep 'c' >/dev/null ; then + : We have BSD-like echo command. + E_FLAG='-n' + E_SFX='' +else + : We have SystemV-like echo command. + E_FLAG='' + E_SFX='\c' +fi +export E_FLAG E_SFX + +echo check write-ability of /tmp ... +if ( >/tmp/aaax.$$ ) +then + rm /tmp/aaax.$$ +else + echo /tmp must exist and be writable. + exit 2 +fi +echo "/tmp ok" + +if [ -f macros ] +then + . macros +fi + +: "Now get system name and directories" +. $FDIR/get_sys + +: "Take action according to the system used" +BM=1 +OLDACM=$ACM +OLDSYS=$SYS +case $SYSNAME in +vax_bsd4_1a) ACM=vax4 ; SYS=BSD4_1 ; BYTE_ORDER=0123 ; MACH=vax4 ;; +vax_bsd4_2) ACM=vax4 ; SYS=BSD4_2 ; BYTE_ORDER=0123 ; MACH=vax4 ;; +vax_sysV_2) ACM=vax4 ; SYS=SYS_5 ; BYTE_ORDER=0123 ; MACH=vax4 ;; +i386) ACM=i386 ; SYS=SYS_5 ; BYTE_ORDER=0123 ; MACH=i386 ;; +sun3) ACM=sun3 ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=m68020 ;; +sun2) ACM=sun2 ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=m68k4 ;; +m68_unisoft|m68k2) ACM=m68k2 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;; +m68_sysV_0|mantra) ACM=mantra ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=m68k4 ;; +m68020) ACM=m68020 ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=m68020 ;; +sparc) ACM=sparc ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=sparc ;; +sparc_solaris) ACM=sparc_solaris ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=sparc_solaris ;; +i86) ACM=i86 ; SYS=SYS_5; BYTE_ORDER=0123 ; MACH=i86 ;; +xenix3) ACM=xenix3 ; SYS=SYS_5; BYTE_ORDER=0123 ; MACH=i86 ;; +minix) ACM=minix ; SYS=V7; BYTE_ORDER=0123 ; MACH=i86 ;; +pmds) ACM=pmds ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;; +pmds4) ACM=pmds4 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k4 ;; +minixST) ACM=minixST ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;; +m68k4) ACM=m68k4 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k4 ;; +*) ACM=XXX ; SYS=XXX ; BYTE_ORDER=XXX ; MACH=XXX ;; +esac + +: do not change the order in MACH_LIST. check limit_enquire first. +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" + +while : +do + for i in $MACH_LIST + do + if [ $i = "$ACM" ] + then break + fi + done + if [ $i = "$ACM" ] + then break + fi + echo "This installation script has no knowledge about $SYSNAME. +You will have to specify the default machine that you want ACK to +compile for. Choices:" + l= + x= + for i in $MACH_LIST + do + l="$l $i" + x=x$x + case $x in + xxxxxxxxxx) echo $l + x= + l= + ;; + esac + done + ACM=$OLDACM + echo $l + echo $E_FLAG "Your choice: [$OLDACM] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$ACM";; + esac + ACM="$ANS" +done +while : +do +case $SYS in +V7|BSD4_1|BSD4_2|SYS_5) + break + ;; +*) + SYS=$OLDSYS + echo 'What kind of Unix is the target system running? +Choices: + V7 for Unix V7, BSD 2.* + BSD4_1 for Berkeley 4.1 + BSD4_2 for Berkeley 4.2, 4.3, SunOs 3, SunOs 4 + SYS_5 for Xenix, System III, System V, SunOs 5' + echo $E_FLAG "Your choice (V7|BSD4_1|BSD4_2|SYS_5): [$OLDSYS] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$SYS";; + esac + SYS="$ANS" + ;; +esac +done +rm -f local.h +sed -e /ACKM/s/'".*"'/'"'$ACM'"'/ -e /BIGMACH/s/'[01]'/$BM/ -e /SYSTEM/s/'^#[ ]*define[ ]*[a-zA-Z_][a-zA-Z0-9_]*'/"# define $SYS"/ < $FDIR/local.h.src >local.h +case $BYTE_ORDER in +XXX) ;; +*) echo '/* Optional definition of BYTE_ORDER: */' >> local.h + echo "#define BYTE_ORDER 0x$BYTE_ORDER" >> local.h + ;; +esac + +echo "Your default machine to compile for is $ACM" + +echo "Installation of the complete ACK takes a long time. Limiting the +number of languages, runtime libraries, back-ends, and assemblers to be +installed may save a lot of time. If you want to install everything, +answer no to the next question. Otherwise, answer yes, and you will be +prompted for details" +while : +do + echo $E_FLAG "Do you want to limit the installation in any way? (y/n) [$LIMIT] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$LIMIT";; + esac + case X$ANS in + Xj*|Xy|X) + LIMIT=y + . $FDIR/limit_enquire + break + ;; + Xn*) . $FDIR/get_sysvax + LIMIT=n + DO_MACHINE_INDEP=y + DO_FAST=n + DISABLE_LANG= + DISABLE_SUP= + if [ $TARGET_HOME = $UTIL_HOME ] + then + case $ACM in + sun3|m68020|i386|vax*) + DO_FAST=y + ;; + esac + fi + break + ;; + *) echo "I do not understand your answer ($ANS). Try again." + ;; + esac +done + +. $FDIR/get_makepars + +echo "TARGET_HOME=\"$TARGET_HOME\"; export TARGET_HOME" > macros +echo "UTIL_HOME=\"$UTIL_HOME\"; export UTIL_HOME" >> macros +echo "SRC_HOME=\"$SRC_HOME\"; export SRC_HOME" >> macros +echo "SYSNAME=\"$SYSNAME\"; export SYSNAME" >> macros +echo "ACM=\"$ACM\"; export ACM" >> macros +echo "CURRENT=\"$CURRENT\"; export CURRENT" >> macros +echo "SYS=\"$SYS\"; export SYS" >> macros +echo "LIMIT=\"$LIMIT\"; export LIMIT" >> macros +echo "CONFIG=\"$CONFIG\"; export CONFIG" >> macros +echo "DISABLE_LANG=\"$DISABLE_LANG\"; export DISABLE_LANG" >> macros +echo "DISABLE_SUP=\"$DISABLE_SUP\"; export DISABLE_SUP" >> macros +echo "DO_MACHINE_INDEP=\"$DO_MACHINE_INDEP\"; export DO_MACHINE_INDEP" >> macros +echo "MACH_LIST=\"$MACH_LIST\"; export MACH_LIST" >> macros +echo "SYSVAX=\"$SYSVAX\"; export SYSVAX" >> macros +echo "MACH=\"$MACH\"; export MACH" >> macros +echo "WS=\"$WS\"; export WS" >> macros +echo "PS=\"$PS\"; export PS" >> macros +echo "DO_FAST=\"$DO_FAST\"; export DO_FAST" >> macros + +cat macros $FDIR/install_tail > INSTALL +chmod +x INSTALL + +echo " +A shell-script called 'INSTALL' has been created. Running it +installs ACK. Note that this may take a (very) long time, so run it +in the background, with its output redirected, f.i.: + sh INSTALL > INSTALL.out 2>&1 & +" +exit 0 diff --cc first/get_answer index b610e24f6,000000000..672deccd2 mode 100755,000000..100755 --- a/first/get_answer +++ b/first/get_answer @@@ -1,5 -1,0 +1,7 @@@ ++#!/bin/sh ++ +if read ANS +then echo +else echo "Sorry, got EOF when reading your answer" + exit 1 +fi diff --cc first/get_makepars index 36da886cd,000000000..cadbf31c9 mode 100755,000000..100755 --- a/first/get_makepars +++ b/first/get_makepars @@@ -1,104 -1,0 +1,106 @@@ ++#!/bin/sh ++ +know_target=0 +case $SYSNAME in +vax*|i386|sun*|sparc*|m68_sysV_0|m68020|mantra|pmds4|m68k4) + WS=4 ; PS=4 + know_target=1 + ;; +m68_unisoft|m68k2|minixST|pmds) + WS=2 ; PS=4 + know_target=1 + ;; +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 + cat > ws.c <<'EOF' +#include +main() +{ + printf("WS=%d ; PS=%d\n", sizeof(int), sizeof(char *)); + exit(0); +} +EOF + if [ $TARGET_HOME = $UTIL_HOME ] && cc ws.c 2>/dev/null + then + : 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] + 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" + . $FDIR/get_answer + case $ANS in + '') ANS="$WS";; + esac + WS="$ANS" + echo $E_FLAG "Please give the pointer-size of the target-machine (sizeof(char *)) in bytes: [$PS] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$PS";; + esac + PS="$ANS" + fi + ;; +esac + +echo "# Paths: +SRC_HOME = $SRC_HOME +TARGET_HOME = $TARGET_HOME +UTIL_HOME = $UTIL_HOME + +# Machine independent part created? +DO_MACHINE_INDEP = $DO_MACHINE_INDEP + +# Target machine, only needed for fast compilers +MACH = $MACH +" > make_macros + +if [ $TARGET_HOME = $UTIL_HOME ] +then + if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ] + then + sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros + else + sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros + fi + case $ACM in + sun3|sparc) + ed -s make_macros <<'EOF' +/cc-and-mkdep.sun/s/^..// +w +q +EOF + ;; + esac + cat $FDIR/util_comp >> make_macros +else + case $know_target in + 1) sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "/cc-and-mkdep.ack/s/^..//" -e "s/^CC=cc/CC=acc -m$ACM/" -e "s/^# AR=aal/AR=aal/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros + ;; + *) if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ] + then + sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros + else + sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros + fi + ;; + esac + sed "s/^#U/U/" < $FDIR/util_comp >> make_macros +fi + +cat $FDIR/lint_params >> make_macros + +echo "A file called 'make_macros' has been created. This file defines some +'make' variables that parameterize all Makefiles in ACK. You may want +to check it before attempting to actually install ACK." +case $know_target in +0) echo "In fact, this installation script does not know much about +your target machine, so expect some things to be wrong" + ;; +esac diff --cc first/get_sys index 0ff18596a,000000000..c2358e4d2 mode 100755,000000..100755 --- a/first/get_sys +++ b/first/get_sys @@@ -1,155 -1,0 +1,157 @@@ ++#!/bin/sh ++ +rm -f em_path.h +echo "You will now be asked for the root directory of the ACK sources. +This directory will not be changed by the installation process. +" +while : +do + echo $E_FLAG "Please give the root of the ACK source tree, +an absolute path: [$SRC_HOME] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$SRC_HOME" ;; + esac + SRC_HOME="$ANS" + case $SRC_HOME in + /*) break; + ;; + *) echo "$SRC_HOME is not an absolute path; try again" + ;; + esac +done +echo "You will now be asked for a configuration directory. This is +the directory in which the compilations will take place. The tree that +resides in it will have the same structure as the ACK source tree, but +the directories will usually only contain Makefiles and .o files. +" +while : +do + echo $E_FLAG "Please give the root of the configuration tree, +an absolute path: [$CONFIG] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$CONFIG";; + esac + CONFIG="$ANS" + case $CONFIG in + /*) break; + ;; + *) echo "$CONFIG is not an absolute path; try again" + ;; + esac +done +echo "You will now be asked for the root directory of the ACK binaries. After +installation, this directory will have subdirectories bin, lib, lib.bin, +man, h, config, include, modules, doc. +Four of these directories will contain stuff that depends on the machine +for which the ACK binaries are made: bin, modules, config, and lib.bin. The +other sub-directories (lib, man, h, include and doc) will contain +machine-independent stuff. +This information may be useful if you want to use ACK on different platforms +and you have a shared file system. See the installation manual. +" +while : +do + echo $E_FLAG "Please give the root of the ACK binaries, +an absolute path: [$TARGET_HOME] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$TARGET_HOME";; + esac + TARGET_HOME="$ANS" + case $TARGET_HOME in + /*) break; + ;; + *) echo "$TARGET_HOME is not an absolute path; try again" + ;; + esac +done +sed -e "/^#define[ ]*EM_DIR/s@\".*\"@\"$TARGET_HOME\"@" <$FDIR/em_path.h.src >em_path.h + +echo "You will now be asked for the type of the system that you want +ACK binaries produced for. This is not neccessarily the system you +run this program on. In this case, if you have not done so already, +you will have to install ACK on the current machine first. +" +echo "Give me the type of the system, the current choice is: +vax_bsd4_1a VAX11 with BSD4.1a +vax_bsd4_2 VAX11 with BSD4.2 +vax_sysV_2 VAX11 with System V.2 +i386 Intel 80386 system running Xenix System V +sun3 Sun 3 M68020 workstation +sun2 Sun 2 M68000 workstation +m68_sysV_0 Motorola 68000 with Uniplus System V.0 Unix +m68020 Motorola M68020 VME131 running Unix System V/68 R2V2.1 +sparc SUN SPARC workstation running SunOs 4 +sparc_solaris SUN SPARC workstation running solaris 2 +ANY Neither of the above +" +echo $E_FLAG "system type: [$SYSNAME] $E_SFX" +. $FDIR/get_answer +case $ANS in +'') ANS="$SYSNAME";; +esac +SYSNAME="$ANS" + +while : +do +echo $E_FLAG "Is this the system you are running on? (y/n) [$CURRENT] $E_SFX" +. $FDIR/get_answer +case $ANS in +'') ANS="$CURRENT";; +esac +case X$ANS in +Xj*|Xy*|X) UTIL_HOME=$TARGET_HOME + CURRENT=y + break + ;; +Xn*) CURRENT=n + echo "You will now be asked for the root directory of ACK on the current machine. +This tree will not be changed by the installation process. +" + while : + do + echo $E_FLAG "Please give the root of a runnable ACK tree, +an absolute path: [$UTIL_HOME] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$UTIL_HOME" ;; + esac + UTIL_HOME="$ANS" + case $UTIL_HOME in + /*) break; + ;; + *) echo "$UTIL_HOME is not an absolute path; try again" + ;; + esac + done + break + ;; +*) echo "I do not understand your answer ($ANS). Try again." + ;; +esac +done + +while : +do +echo "The system to install ACK for is $SYSNAME, +the root of the ACK source tree is $SRC_HOME, +the root of the configuration tree is $CONFIG, +the root of the ACK binary tree to be created is $TARGET_HOME, +and the root of a runnable ACK binary tree is $UTIL_HOME. +If the machine to compile ACK for is the current machine, the last two names +may be identical." +echo $E_FLAG "Are you satisfied with all this? (y/n) $E_SFX" +. $FDIR/get_answer +case X$ANS in +Xj*|Xy*|X) break + ;; +Xn*) echo Ok, I will give you another chance.... + . $0 + break + ;; +*) echo "I do not understand your answer ($ANS). Try again." + ;; +esac +done diff --cc first/get_sysvax index eee8f1271,000000000..ed92a123c mode 100755,000000..100755 --- a/first/get_sysvax +++ b/first/get_sysvax @@@ -1,21 -1,0 +1,23 @@@ ++#!/bin/sh ++ +while : +do + echo $E_FLAG "Which system-call library do you want to install for the VAX? +You can choose between + libbsd4_1a for Berkeley Unix 4.1 + libbsd4_2 for Berkeley Unix 4.2 or newer, or Ultrix + libsysV_2 for Unix System V +Your choice: [$SYSVAX] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$SYSVAX";; + esac + SYSVAX="$ANS" + case $SYSVAX in + libbsd4_1a|libbsd4_2|libsysV_2) + break + ;; + *) echo "I do not understand your answer ($SYSVAX). Try again" + ;; + esac +done diff --cc first/install_tail index 5e644ce8a,000000000..bcd6d3957 mode 100644,000000..100644 --- a/first/install_tail +++ b/first/install_tail @@@ -1,84 -1,0 +1,93 @@@ ++#!/bin/sh ++ +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 ++( ++ # Slight complication here to ensure that the #! magic at the ++ # beginning of TakeAction is preserved correctly. ++ ++ head -1 $SRC_HOME/TakeAction ++ echo "PATH=:$CONFIG/bin:$UTIL_HOME/bin:$PATH; export PATH" ++ tail +2 $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 --cc first/limit_enquire index 8d9173d0b,000000000..e93e19db3 mode 100644,000000..100644 --- a/first/limit_enquire +++ b/first/limit_enquire @@@ -1,207 -1,0 +1,209 @@@ ++#!/bin/sh ++ +while : +do + echo "The libraries will end up in the machine-independent part of the +ACK binary tree. You may already have them from a previous ACK installation +on a different machine, in particular if you have an NFS file system. +Therefore, it may not be neccessary to install them again. As this part +of the ACK installation takes the most time, you are given the opportunity +to disable installation of the machine-independent part" + echo $E_FLAG \ + "Do you want to install the machine-independent part? (y/n) [$DO_MACHINE_INDEP] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$DO_MACHINE_INDEP" ;; + esac + case X$ANS in + Xj*|Xy*|X) DO_MACHINE_INDEP=y + echo "machine-independent part will be installed" + echo + break + ;; + Xn*) DO_MACHINE_INDEP=n + echo "machine-independent part will not be installed" + echo + break + ;; + *) echo "I do not understand your answer ($ANS). Try again." + ;; + esac +done +OLD_DIS_LANG="$DISABLE_LANG" +DISABLE_LANG= +case X$OLD_DIS_LANG in +X) ;; +*) set $OLD_DIS_LANG + ;; +esac +for i in Modula-2 Pascal Occam Basic ANSI-C C Fortran +do + DEF=y + if [ $# != 0 -a X$i = X$1 ] + then + DEF=n + shift + fi + while : + do + echo $E_FLAG "Do you want to install $i? (y/n) [$DEF] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$DEF";; + esac + case X$ANS in + Xj*|Xy*) + echo "$i will be installed" + echo + break + ;; + Xn*) DISABLE_LANG=$DISABLE_LANG" $i" + echo "$i will not be installed" + echo + break + ;; + *) echo "I do not understand your answer ($ANS). Try again." + ;; + esac + done +done +OLD_DIS_SUP="$DISABLE_SUP" +DISABLE_SUP= +set $MACH_LIST +while test $# != 0 +do + DEF=y + for i in $OLD_DIS_SUP + do + if [ X$i = X$1 ] + then + DEF=n + break + fi + done + while : + do + case $1 in + i86) echo "not installing i86 will disable installation of xenix3 and minix." + ;; + m68k2) echo "not installing m68k2 will disable installation of pmds, minixST, +m68k4, pmds4, sun2, and mantra." + ;; + m68k4) echo "not installing m68k4 will disable installation of pmds4, sun2, and mantra." + ;; + m68020) echo "not installing m68020 will disable installation of sun3." + ;; + esac + echo $E_FLAG "Do you want to install the $1 support? (y/n) [$DEF] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$DEF";; + esac + case X$ANS in + Xj*|Xy*) + echo "The $1 support will be installed" + echo + case $1 in + vax4) case $SYSNAME in + vax_bsd4_1a) SYSVAX=libbsd4_1a + ;; + vax_bsd4_2) SYSVAX=libbsd4_2 + ;; + vax_sysV_2) SYSVAX=libsysV_2 + ;; + *) if [ $DO_MACHINE_INDEP = y ] + then + . $FDIR/get_sysvax + fi + ;; + esac + ;; + sparc) shift + ;; + esac + break + ;; + Xn*) DISABLE_SUP=$DISABLE_SUP" $1" + echo "The $1 support will not be installed" + echo + case $1 in + i86) + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + ;; + m68k2) + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + ;; + m68k4) + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + shift + DISABLE_SUP=$DISABLE_SUP" $1" + ;; + sparc) + shift + DISABLE_SUP=$DISABLE_SUP" $1" + ;; + m68020) + shift + DISABLE_SUP=$DISABLE_SUP" $1" + ;; + esac + break + ;; + *) echo "I do not understand your answer ($ANS). Try again." + ;; + esac + done + shift +done + +if [ $TARGET_HOME = $UTIL_HOME ] +then + case $ACM in + sun3|m68020|i386|vax*) + while : + do + echo $E_FLAG "Do you want to install the fast compilers? (y/n) [$DO_FAST] $E_SFX" + . $FDIR/get_answer + case $ANS in + '') ANS="$DO_FAST" ;; + esac + case X$ANS in + Xj*|Xy*) + DO_FAST=y + echo "The fast compilers will be installed" + break + ;; + Xn*) + DO_FAST=n + echo "The fast compilers will not be installed" + break + ;; + *) echo "I do not understand your answer ($ANS). Try again." + ;; + esac + done + ;; + *) + DO_FAST=n + ;; + esac +else + DO_FAST=n +fi diff --cc first/limit_impl index 2314ab7a0,000000000..284f2c15e mode 100755,000000..100755 --- a/first/limit_impl +++ b/first/limit_impl @@@ -1,206 -1,0 +1,208 @@@ ++#!/bin/sh ++ +for i in $DISABLE_LANG +do + ed -s $CONFIG/Action <> Action <> Action < $CONFIG/bin/ack_sys ++echo "#!/bin/sh" > $CONFIG/bin/ack_sys ++echo "echo $SYSNAME" >> $CONFIG/bin/ack_sys +chmod +x $CONFIG/bin/ack_sys + +cd $SRC_HOME +find . -type d -perm -555 -print > $CONFIG/dir_list + +cd $CONFIG +for i in mach/*/libsys +do + rm -rf $i +done + +for i in `cat dir_list` +do + create_dir $i + rm -f $i/No* + if [ -f $i/Makefile ] + then + ( cd $i ; if make clean ; then exit 0 ; else exit 0 ; fi ) > /dev/null 2>&1 + fi + if [ -f $SRC_HOME/$i/proto.make ] + then mk_makefile $SRC_HOME/$i/proto.make > $i/Makefile + fi + if [ -f $SRC_HOME/$i/Action ] + then + cd $SRC_HOME/$i + cp Action* $CONFIG/$i + chmod +w $CONFIG/$i/Action* + cd $CONFIG + fi +done + +cd $CONFIG + +for i in lang/cem/cemcom.ansi lang/cem/cemcom lang/m2/comp +do + cp $SRC_HOME/$i/BigPars $CONFIG/$i/Parameters + chmod +w $CONFIG/$i/Parameters +done +for i in lang/pc/comp lang/cem/cpp.ansi +do + cp $SRC_HOME/$i/Parameters $CONFIG/$i/Parameters + chmod +w $CONFIG/$i/Parameters +done + +cd $CONFIG/mach +for i in * +do + if [ -d $i ] + then + if [ -d $i/as ] + then + cd $i/as + mk_makefile $SRC_HOME/mach/proto/as/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile + cd ../.. + fi + if [ -d $i/top ] + then + cd $i/top + mk_makefile $SRC_HOME/mach/proto/top/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile + cd ../.. + fi + if [ -d $i/cg ] + then + cd $i/cg + mk_makefile $SRC_HOME/mach/proto/cg/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile + cd ../.. + fi + if [ -d $i/ncg ] + then + cd $i/ncg + mk_makefile $SRC_HOME/mach/proto/ncg/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile + if [ -f $SRC_HOME/mach/$i/ncg/table_dir ] + then + ed -s Makefile < Makefile + cd ../.. + fi + done + for j in libbsd4_1a libbsd4_2 libsysV_2 + do + if [ -d $i/$j ] + then + cd $i/$j + mk_makefile $SRC_HOME/mach/proto/libg/proto.libsys | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" -e "s/libsys/$j/g" > Makefile + cd ../.. + fi + done + for j in libcc libcc.ansi libm2 libpc libbc liboc libf77 + do + create_dir $i/$j + rm -f $i/$j/No* + cd $i/$j + mk_makefile $SRC_HOME/mach/proto/libg/proto.$j | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile + cd ../.. + done + if [ $i = vax4 ] + then : + elif [ -d $i/libsys ] + then : + else + create_dir $i/libsys + rm -f $i/libsys/No* + cd $i/libsys + mk_makefile $SRC_HOME/mach/proto/libg/proto.sysmon | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile + cd ../.. + fi + fi +done diff --cc first/mk_makefile index 97435474b,000000000..ae0946bf1 mode 100755,000000..100755 --- a/first/mk_makefile +++ b/first/mk_makefile @@@ -1,34 -1,0 +1,35 @@@ ++#!/bin/sh +: '$Id$' + +: This shell script inserts make macros after a line +: starting with #PARAMS in "make_proto", and produces the result on +: standard output. + +trap "rm -f /tmp/mk_mak$$" 0 1 2 3 15 +case $# in +1) ;; +*) echo "Usage: $0 " 1>&2 + exit 1 + ;; +esac + +cp $1 /tmp/mk_mak$$ + +ed -s /tmp/mk_mak$$ << 'EOF' +/^#PARAMS/c +#PARAMS do not remove this line! +. +w +q +EOF +case `ack_sys` in +sparc_solaris) + ed -s /tmp/mk_mak$$ << 'EOF' +g/^EXTRALIB/s/=/= -lelf/ +w +q +EOF + ;; +esac +cat /tmp/mk_mak$$ +exit 0 diff --cc first/mk_target index 1bc50252c,000000000..8ab62a4b6 mode 100755,000000..100755 --- a/first/mk_target +++ b/first/mk_target @@@ -1,39 -1,0 +1,41 @@@ ++#!/bin/sh ++ +set -e + +: machine-dependant stuff + +create_dir $TARGET_HOME +create_dir $TARGET_HOME/config +create_dir $TARGET_HOME/lib.bin +create_dir $TARGET_HOME/modules +create_dir $TARGET_HOME/modules/h +create_dir $TARGET_HOME/bin + +cp local.h em_path.h $TARGET_HOME/config +cp_dir $SRC_HOME/bin $TARGET_HOME/bin +cp $CONFIG/bin/cp_dir $TARGET_HOME/bin/cp_dir +echo "echo $SYSNAME" > $TARGET_HOME/bin/ack_sys +chmod +x $TARGET_HOME/bin/ack_sys + +: machine-independant stuff + +if [ $DO_MACHINE_INDEP = n ] +then + exit 0 +fi + +create_dir $TARGET_HOME/lib +create_dir $TARGET_HOME/etc +create_dir $TARGET_HOME/h +create_dir $TARGET_HOME/include +create_dir $TARGET_HOME/doc + +cp $SRC_HOME/etc/ip_spec.t $TARGET_HOME/etc/ip_spec.t +cp_dir $SRC_HOME/lib $TARGET_HOME/lib +cp_dir $SRC_HOME/h $TARGET_HOME/h +cp_dir $SRC_HOME/include $TARGET_HOME/include + +cd $TARGET_HOME +find . -type f -exec chmod +w {} \; + +exit 0 diff --cc first/target_comp index bd95b42a0,000000000..db980dcfc mode 100644,000000..100644 --- a/first/target_comp +++ b/first/target_comp @@@ -1,27 -1,0 +1,28 @@@ ++#!/bin/sh +# 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=4 + +# 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 diff --cc first/util_comp index 377d04664,000000000..8f046f627 mode 100644,000000..100644 --- a/first/util_comp +++ b/first/util_comp @@@ -1,23 -1,0 +1,23 @@@ - ++#!/bin/sh +# 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) diff --cc lang/basic/src/maketokentab index bfdbc70b2,000000000..3c8b76f45 mode 100755,000000..100755 --- a/lang/basic/src/maketokentab +++ b/lang/basic/src/maketokentab @@@ -1,16 -1,0 +1,18 @@@ ++#!/bin/sh ++ +ed -s Lpars.h <<'+' +1d +1,$s/# *define // +1,$s/ ...$// +1,$s/^/ "/ +1,$-1s/$/",/ +$s/$/"/ +0a +char *tokentab[] = { +. +$a +}; +. +w tokentab.h +q ++ diff --cc lang/cem/cemcom.ansi/make.allocd index 2289a4d51,000000000..9f98e79f9 mode 100755,000000..100755 --- a/lang/cem/cemcom.ansi/make.allocd +++ b/lang/cem/cemcom.ansi/make.allocd @@@ -1,14 -1,0 +1,16 @@@ ++#!/bin/sh ++ +sed -e ' +s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +extern struct \1 *h_\1;\ +#ifdef DEBUG\ +extern int cnt_\1;\ +extern char *std_alloc();\ +#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\ +#else\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#endif\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' diff --cc lang/cem/cemcom.ansi/make.hfiles index f53fdca18,000000000..53cbdc1dd mode 100755,000000..100755 --- a/lang/cem/cemcom.ansi/make.hfiles +++ b/lang/cem/cemcom.ansi/make.hfiles @@@ -1,35 -1,0 +1,36 @@@ ++#!/bin/sh +: Update Files from database + +PATH=/bin:/usr/bin + +case $# in +1) ;; +*) echo use: $0 file >&2 + exit 1 +esac + +( +IFCOMMAND="if [ -r \$FN ] ;\ + then if cmp -s \$FN \$TMP;\ + then rm \$TMP;\ + else mv \$TMP \$FN;\ + echo update \$FN;\ + fi;\ + else mv \$TMP \$FN;\ + echo create \$FN;\ + fi" +echo 'TMP=.uf$$' +echo 'FN=$TMP' +echo 'cat >$TMP <<\!EOF!' +sed -n '/^!File:/,${ +/^$/d +/^!File:[ ]*\(.*\)$/s@@!EOF!\ +'"$IFCOMMAND"'\ +FN=\1\ +cat >$TMP <<\\!EOF!@ +p +}' $1 +echo '!EOF!' +echo $IFCOMMAND +) | +sh diff --cc lang/cem/cemcom/make.allocd index 08492fad1,000000000..a6240a213 mode 100755,000000..100755 --- a/lang/cem/cemcom/make.allocd +++ b/lang/cem/cemcom/make.allocd @@@ -1,8 -1,0 +1,10 @@@ ++#!/bin/sh ++ +sed -e ' +s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +extern struct \1 *h_\1;\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' diff --cc lang/cem/cemcom/make.hfiles index f53fdca18,000000000..53cbdc1dd mode 100755,000000..100755 --- a/lang/cem/cemcom/make.hfiles +++ b/lang/cem/cemcom/make.hfiles @@@ -1,35 -1,0 +1,36 @@@ ++#!/bin/sh +: Update Files from database + +PATH=/bin:/usr/bin + +case $# in +1) ;; +*) echo use: $0 file >&2 + exit 1 +esac + +( +IFCOMMAND="if [ -r \$FN ] ;\ + then if cmp -s \$FN \$TMP;\ + then rm \$TMP;\ + else mv \$TMP \$FN;\ + echo update \$FN;\ + fi;\ + else mv \$TMP \$FN;\ + echo create \$FN;\ + fi" +echo 'TMP=.uf$$' +echo 'FN=$TMP' +echo 'cat >$TMP <<\!EOF!' +sed -n '/^!File:/,${ +/^$/d +/^!File:[ ]*\(.*\)$/s@@!EOF!\ +'"$IFCOMMAND"'\ +FN=\1\ +cat >$TMP <<\\!EOF!@ +p +}' $1 +echo '!EOF!' +echo $IFCOMMAND +) | +sh diff --cc lang/cem/cpp.ansi/make.allocd index 08492fad1,000000000..a6240a213 mode 100755,000000..100755 --- a/lang/cem/cpp.ansi/make.allocd +++ b/lang/cem/cpp.ansi/make.allocd @@@ -1,8 -1,0 +1,10 @@@ ++#!/bin/sh ++ +sed -e ' +s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +extern struct \1 *h_\1;\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' diff --cc lang/cem/cpp.ansi/make.hfiles index f53fdca18,000000000..53cbdc1dd mode 100755,000000..100755 --- a/lang/cem/cpp.ansi/make.hfiles +++ b/lang/cem/cpp.ansi/make.hfiles @@@ -1,35 -1,0 +1,36 @@@ ++#!/bin/sh +: Update Files from database + +PATH=/bin:/usr/bin + +case $# in +1) ;; +*) echo use: $0 file >&2 + exit 1 +esac + +( +IFCOMMAND="if [ -r \$FN ] ;\ + then if cmp -s \$FN \$TMP;\ + then rm \$TMP;\ + else mv \$TMP \$FN;\ + echo update \$FN;\ + fi;\ + else mv \$TMP \$FN;\ + echo create \$FN;\ + fi" +echo 'TMP=.uf$$' +echo 'FN=$TMP' +echo 'cat >$TMP <<\!EOF!' +sed -n '/^!File:/,${ +/^$/d +/^!File:[ ]*\(.*\)$/s@@!EOF!\ +'"$IFCOMMAND"'\ +FN=\1\ +cat >$TMP <<\\!EOF!@ +p +}' $1 +echo '!EOF!' +echo $IFCOMMAND +) | +sh diff --cc lang/m2/comp/make.allocd index c4dd3e17c,000000000..e3077691d mode 100755,000000..100755 --- a/lang/m2/comp/make.allocd +++ b/lang/m2/comp/make.allocd @@@ -1,26 -1,0 +1,28 @@@ ++#!/bin/sh ++ +sed -e ' +s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +extern struct \1 *h_\1;\ +#ifdef DEBUG\ +extern int cnt_\1;\ +extern char *std_alloc();\ +#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\ +#else\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#endif\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' -e ' +s:^.*[ ]STATICALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +struct \1 *h_\1;\ +#ifdef DEBUG\ +int cnt_\1;\ +#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\ +#else\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#endif\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' diff --cc lang/m2/comp/make.hfiles index f53fdca18,000000000..53cbdc1dd mode 100755,000000..100755 --- a/lang/m2/comp/make.hfiles +++ b/lang/m2/comp/make.hfiles @@@ -1,35 -1,0 +1,36 @@@ ++#!/bin/sh +: Update Files from database + +PATH=/bin:/usr/bin + +case $# in +1) ;; +*) echo use: $0 file >&2 + exit 1 +esac + +( +IFCOMMAND="if [ -r \$FN ] ;\ + then if cmp -s \$FN \$TMP;\ + then rm \$TMP;\ + else mv \$TMP \$FN;\ + echo update \$FN;\ + fi;\ + else mv \$TMP \$FN;\ + echo create \$FN;\ + fi" +echo 'TMP=.uf$$' +echo 'FN=$TMP' +echo 'cat >$TMP <<\!EOF!' +sed -n '/^!File:/,${ +/^$/d +/^!File:[ ]*\(.*\)$/s@@!EOF!\ +'"$IFCOMMAND"'\ +FN=\1\ +cat >$TMP <<\\!EOF!@ +p +}' $1 +echo '!EOF!' +echo $IFCOMMAND +) | +sh diff --cc lang/pc/comp/make.allocd index c4dd3e17c,000000000..e3077691d mode 100755,000000..100755 --- a/lang/pc/comp/make.allocd +++ b/lang/pc/comp/make.allocd @@@ -1,26 -1,0 +1,28 @@@ ++#!/bin/sh ++ +sed -e ' +s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +extern struct \1 *h_\1;\ +#ifdef DEBUG\ +extern int cnt_\1;\ +extern char *std_alloc();\ +#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\ +#else\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#endif\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' -e ' +s:^.*[ ]STATICALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\ +/* allocation definitions of struct \1 */\ +extern char *st_alloc();\ +struct \1 *h_\1;\ +#ifdef DEBUG\ +int cnt_\1;\ +#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\ +#else\ +#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\ +#endif\ +#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\ +:' diff --cc lang/pc/comp/make.hfiles index f53fdca18,000000000..53cbdc1dd mode 100755,000000..100755 --- a/lang/pc/comp/make.hfiles +++ b/lang/pc/comp/make.hfiles @@@ -1,35 -1,0 +1,36 @@@ ++#!/bin/sh +: Update Files from database + +PATH=/bin:/usr/bin + +case $# in +1) ;; +*) echo use: $0 file >&2 + exit 1 +esac + +( +IFCOMMAND="if [ -r \$FN ] ;\ + then if cmp -s \$FN \$TMP;\ + then rm \$TMP;\ + else mv \$TMP \$FN;\ + echo update \$FN;\ + fi;\ + else mv \$TMP \$FN;\ + echo create \$FN;\ + fi" +echo 'TMP=.uf$$' +echo 'FN=$TMP' +echo 'cat >$TMP <<\!EOF!' +sed -n '/^!File:/,${ +/^$/d +/^!File:[ ]*\(.*\)$/s@@!EOF!\ +'"$IFCOMMAND"'\ +FN=\1\ +cat >$TMP <<\\!EOF!@ +p +}' $1 +echo '!EOF!' +echo $IFCOMMAND +) | +sh