From 687b9ee3de3a07a3544218267435f5e97e850271 Mon Sep 17 00:00:00 2001 From: calmsacibis995 <46319359+calmsacibis995@users.noreply.github.com> Date: Sun, 17 Apr 2022 22:33:16 +0300 Subject: [PATCH] Add files via upload --- :mk | 287 ++++++++++++++++++++++++++++++++++++ :mk.addon | 245 ++++++++++++++++++++++++++++++ :mk.arch | 154 +++++++++++++++++++ :mk.csds | 156 ++++++++++++++++++++ :mk.fnd | 290 ++++++++++++++++++++++++++++++++++++ :mk.i386 | 338 ++++++++++++++++++++++++++++++++++++++++++ :mkcmd | 426 +++++++++++++++++++++++++++++++++++++++++++++++++++++ :mkhead | 79 ++++++++++ :mklib | 94 ++++++++++++ :mkoam | 212 ++++++++++++++++++++++++++ :mksyshead | 71 +++++++++ :mkucb | 55 +++++++ :mkucbcmd | 188 +++++++++++++++++++++++ :mkucbhead | 32 ++++ :mkucblib | 38 +++++ :mkuts | 384 +++++++++++++++++++++++++++++++++++++++++++++++ :mkxcp | 53 +++++++ :mkxcpcmd | 168 +++++++++++++++++++++ :mkxcplib | 36 +++++ ucb.dirs | 10 ++ 20 files changed, 3316 insertions(+) create mode 100644 :mk create mode 100644 :mk.addon create mode 100644 :mk.arch create mode 100644 :mk.csds create mode 100644 :mk.fnd create mode 100644 :mk.i386 create mode 100644 :mkcmd create mode 100644 :mkhead create mode 100644 :mklib create mode 100644 :mkoam create mode 100644 :mksyshead create mode 100644 :mkucb create mode 100644 :mkucbcmd create mode 100644 :mkucbhead create mode 100644 :mkucblib create mode 100644 :mkuts create mode 100644 :mkxcp create mode 100644 :mkxcpcmd create mode 100644 :mkxcplib create mode 100644 ucb.dirs diff --git a/:mk b/:mk new file mode 100644 index 0000000..dfb214e --- /dev/null +++ b/:mk @@ -0,0 +1,287 @@ +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" + +#ident "@(#)mk::mk 1.10.8.1" + +# +# Shell script for rebuilding the Complete UNIX System V/386 Release 4.0 +# + +if [ "$ROOT" = "" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ "$ROOT" = "/" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ ! -d ${ROOT} ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +OLDPATH=$PATH +PATH=$ROOT/xenv:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc; export PATH +# + +PATH=$PATH:$OLDPATH; export PATH +MCS=${MCS:-mcs}; export MCS +# +# changed to allow the following to be setable +# +LOAD=${LOAD:-STC}; export LOAD +RELEASE=${RELEASE:-4.0}; export RELEASE +TARGET=${TARGET:-i386}; export TARGET +PRODUCT=${PRODUCT:-386unix}; export PRODUCT + +echo $0 started at `date` +trap "exit 1" 1 2 3 15 +SHELL="/bin/sh" +export SHELL +CH=`id | sed '/uid=0[^0-9].*/!s|.*|#|;/#/!d'` +export CH +CCSTYPE=ELF; export CCSTYPE +# +# NOTE: you can't get to this point with ROOT="" +# +if [ "$ROOT" = "" ] +then + PATH=/usr/ccs/bin:/usr/bin:/usr/sbin:/etc; export PATH +else + # Cross-makes may not have all the directories needed + for dir in /bin /lib /usr/include /usr/include/sys /shlib /tmp /xenv + do if [ ! -d $ROOT/$dir ] + then rm -f $ROOT/$dir + mkdir $ROOT/$dir + fi + done +fi + +echo "uname -a = \c"; uname -a + +echo 'MAKEOPTS="MAKE=make AS=as CC=cc LD=ld ROOT=$ROOT INC=$ROOT/usr/include" +export MAKEOPTS +if [ -x $ROOT/usr/ccs/bin/make ] +then ${ROOT}/usr/ccs/bin/make ${MAKEOPTS} "$@" +else /usr/ccs/bin/make ${MAKEOPTS} "$@" +fi ' > $ROOT/xenv/make +chmod +x ${ROOT}/xenv/make + +if [ -x $ROOT/usr/ccs/bin/cc ] +then echo '${ROOT}/usr/ccs/bin/cc "$@" -I$ROOT/usr/include' > $ROOT/xenv/cc +else echo '/usr/ccs/bin/cc "$@" -I$ROOT/usr/include' > $ROOT/xenv/cc +fi +chmod +x ${ROOT}/xenv/cc + +cd $ROOT/usr/src +while [ $# -ge 1 ] +do +case "$1" in +at386|AT386|at|AT) BUS=AT386; ARCH=AT386;; +vpix|VPIX) VPIX=VPIX;; +novpix|NOVPIX) VPIX=NOVPIX;; +merge386|MERGE386) MERGE386=MERGE386;; +nomerge386|NOMERGE386) MERGE386=" ";; +mca|MCA) BUS=MCA; ARCH=MCA;; +mb1|MB1|mbus1|MBUS1) BUS=MB1; ARCH=MBUS;; +mb2|MB2|mbus2|MBUS2) BUS=MB2; ARCH=MBUS;; +eisa|EISA) BUS=EISA; ARCH=AT386;; +ev\-at|EV\-AT) BUS=EV-AT; ARCH=EV-AT;; +evga|EVGA) EVGA=EVGA;; +i860|I860|860) ;; +mbus|MBUS) ;; +*) BUS="$1"; ARCH="$1";; +esac +shift +done +BUS=${BUS:-AT386}; export BUS +ARCH=${ARCH:-AT386}; export ARCH +MERGE386=${MERGE386:-MERGE386}; export MERGE386 +VPIX=${VPIX:-VPIX}; export VPIX +BLTCONS=${BLTCONS:-BLTCONS}; export BLTCONS +#EVC=${EVC:-EVC}; export EVC +EVGA=${EVGA:-EVGA}; export EVGA + +# install /usr/include and /usr/include/sys header files +sh ./:mkhead +sh ./:mksyshead +sh ./:mkucbhead + +cd cmd/sgs/xenv/i386 +sh pathedit << ! +y +y +y +! + +if [ ! -f makefile.1 ] +then mv makefile makefile.1 +fi +grep -v unix_conv makefile.1 > makefile + +cd ../../../.. + +# Build the C Compilation tools, fltused changes +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 sgs + +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/xenv/ar +cp ${ROOT}/usr/ccs/bin/as ${ROOT}/xenv/as +cp ${ROOT}/usr/ccs/bin/ld ${ROOT}/xenv/ld +# build the C library + +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 libc + +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -L $ROOT/usr/ccs/lib -L $ROOT/usr/lib -Y L,/usr/lib -Y U,/usr/ccs/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +chmod +x ${ROOT}/xenv/cc + +# Build the C Compilation tools + +cd cmd/sgs/xenv/i386 +mv makefile.1 makefile +cd ../../../.. + +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 sgs +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/xenv/ar +cp ${ROOT}/usr/ccs/bin/as ${ROOT}/xenv/as +cp ${ROOT}/usr/ccs/bin/ld ${ROOT}/xenv/ld + +# Build the Libraries +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 xlibcurses +cp ${ROOT}/usr/ccs/bin/tic ${ROOT}/xenv/tic +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 libc libcrypt libdl libgen libl libm libmalloc liby rtld zlibeti zlibetitam + +# Build all the non CSDS libraries +( +cd lib +ls -a | sed \ + -e "/^.lib.mk$/d" \ + -e "/^.libmk.temp$/d" \ + -e "/^libc$/d" \ + -e "/^libcrypt$/d" \ + -e "/^libdl$/d" \ + -e "/^libgen$/d" \ + -e "/^libl$/d" \ + -e "/^libm$/d" \ + -e "/^libmalloc$/d" \ + -e "/^liby$/d" \ + -e "/^rtld$/d" \ + -e "/^xlibcurses$/d" \ + -e "/^zlibeti$/d" \ + -e "/^zlibetitam$/d" | + sort -u | sed -n '3,$p' > /tmp/$$.doit +) +if [ -s /tmp/$$.doit ] +then sh ./:mklib $VPIX $MERGE386 `cat -s /tmp/$$.doit` +fi +rm -f /tmp/$$.doit + +( +cd ${ROOT}/usr/src/xcplib +ls -a | + sort -u | + sed -n '3,$p' > /tmp/$$.xit +) +sh ./:mkxcplib `cat -s /tmp/$$.xit` +rm -f /tmp/$$.xit + +( +cd ${ROOT}/usr/src/ucblib +ls -a | + sort -u | + sed -n '3,$p' > /tmp/$$.ucbit +) +sh ./:mkucblib `cat -s /tmp/$$.ucbit` +rm -f /tmp/$$.ucbit + + +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -Y L,${ROOT}/usr/ccs/lib -Y U,${ROOT}/usr/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +chmod +x ${ROOT}/xenv/cc + +# build all the commands + +if [ ! -x $ROOT/xenv/i386cc ] +then ln $ROOT/xenv/cc $ROOT/xenv/i386cc +fi +( +cd ${ROOT}/usr/src/cmd +ls -a | + sed -e "s/\.mk$//" -e "s/\.sh$//" -e "s/\.c$//" \ + -e "/^include$/d" | + sort -u | + sed -n '3,$p' > /tmp/$$.doit +) +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 `cat -s /tmp/$$.doit` +rm -f /tmp/$$.doit +cp $ROOT/usr/ccs/lib/llib-lcrypt $ROOT/usr/lib/llib-lcrypt +cp $ROOT/usr/ccs/lib/llib-lcrypt.ln $ROOT/usr/lib/llib-lcrypt.ln + +( +cd ${ROOT}/usr/src/ucbcmd +ls -a | + sed -e "s/\.mk$//" -e "s/\.sh$//" -e "s/\.c$//" | + sort -u | + sed -n '3,$p' > /tmp/$$.ucbit +) +sh ./:mkucbcmd `cat -s /tmp/$$.ucbit` +rm -f /tmp/$$.ucbit + +# Remove these five files which are links to other files +rm -f ${ROOT}/usr/bin/view ${ROOT}/usr/bin/vedit ${ROOT}/usr/bin/edit ${ROOT}/usr/bin/ex ${ROOT}/usr/bin/pcat +rm ${ROOT}/usr/ccs/lib/libtermcap.a ${ROOT}/usr/ccs/lib/libtermlib.a +ln ${ROOT}/usr/ccs/lib/libcurses.a ${ROOT}/usr/ccs/lib/libtermcap.a +ln ${ROOT}/usr/ccs/lib/libtermcap.a ${ROOT}/usr/ccs/lib/libtermlib.a + +# build the OS itself +ln ${ROOT}/usr/ccs/bin/as ${ROOT}/usr/bin/idas +ln ${ROOT}/usr/ccs/bin/ld ${ROOT}/usr/bin/idld +ln ${ROOT}/usr/ccs/bin/cc ${ROOT}/usr/bin/idcc +ln ${ROOT}/usr/ccs/lib/acomp ${ROOT}/usr/lib/idacomp +ln ${ROOT}/usr/ccs/lib/cpp ${ROOT}/usr/lib/idcpp + +ln -s $ROOT/usr/bin/idas $ROOT/bin/idas +ln -s $ROOT/usr/bin/idcc $ROOT/bin/idcc +ln -s $ROOT/usr/bin/idld $ROOT/bin/idld +ln -s $ROOT/usr/lib/idacomp $ROOT/lib/idacomp +ln -s $ROOT/usr/lib/idcpp $ROOT/lib/idcpp + +sh ./:mkuts ${BUS} ${ARCH} $VPIX $MERGE386 $BLTCONS $EVC $EVGA + +# Build the add-ons +# build all the add-ons that are present. +pkglist="" +for i in `cd add-on; ls` +do + # skip ones which are interactive + [ $i = source ] && continue + pkglist="$pkglist $i" +done +sh ./:mk.addon BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 $pkglist + +for i in `cd pkg; ls` +do + pkglist="$pkglist $i" +done +sh ./:mkoam BUS=${BUS} ARCH=${ARCH} $pkglist + +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/usr/bin/ar +cp ${ROOT}/usr/ccs/bin/captoinfo ${ROOT}/usr/bin/captoinfo +cp ${ROOT}/usr/ccs/bin/infocmp ${ROOT}/usr/bin/infocmp +cp ${ROOT}/usr/ccs/bin/mcs ${ROOT}/usr/bin/mcs +cp ${ROOT}/usr/ccs/bin/tic ${ROOT}/usr/bin/tic +cp ${ROOT}/usr/ccs/bin/tput ${ROOT}/usr/bin/tput +cp ${ROOT}/usr/ccs/bin/what ${ROOT}/usr/bin/what + +echo $0 done at `date` +exit 0 diff --git a/:mk.addon b/:mk.addon new file mode 100644 index 0000000..a57304b --- /dev/null +++ b/:mk.addon @@ -0,0 +1,245 @@ +#ident "@(#)mk::mk.addon 1.1.3.1" + +echo "" +echo "" +echo " Copyright (c) 1987, 1988 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" +echo ${0}: started at `date` + +MAKE=${MAKE:-make} +SLBASE=${ROOT} +export SLBASE + +# If we are in a cross compilation environment then use cross compiler +if [ "$ROOT" != "" ] +then + if u3b2 || u3b5 + then + AS=m32as export AS + CC=m32cc export CC + LD=m32ld export LD + fi + if i286 + then + AS=i286as export AS + CC=i286cc export CC + LD=i286ld export LD + fi + if i386 + then + AS=i386as export AS + CC=i386cc export CC + LD=i386ld export LD + fi + echo "You are in a cross compilation environment." + PATH=$ROOT/xenv:$PATH + echo ROOT="${ROOT}" +else + AS=as export AS + CC=cc export CC + LD=ld export LD +fi + +# +# Perform object stamping if MCS variable is set in shell env +# + +case "${MCS}" in + + mcs) + MCS=mcs export MCS + if i386 + then + TARGET=${TARGET:=i386} export TARGET + RELEASE=${RELEASE:=unk} export RELEASE + LOAD="${LOAD}" export LOAD + COMMENT="UNIX System V/386 Release 4.0 $LOAD" + export COMMENT + else + echo "The proper variables have not been set in ${0}." + echo "No mcs will be performed." + MCS="" + fi + echo "Comment sections will be modified using ${MCS}." + echo "The following string will replace the existing contents:" + echo "${COMMENT} " + break + ;; + + pstamp) + if i386 + then + PRODUCT=${PRODUCT:=386unix} export PRODUCT + TARGET=${TARGET:=i386} export TARGET + RELEASE=${RELEASE:=unk} export RELEASE + LOAD="${LOAD}" export LOAD + if [ -z "${LOAD}" ] + then + echo "The LOAD variable was not set." + echo "No pstamping will be performed." + MCS="" + else + LOAD=`echo ${LOAD} | tr "[a-z]" "[A-Z]"` + COMMENT="-p ${PRODUCT} -t ${TARGET} -r ${RELEASE} -l ${LOAD}" + export COMMENT + echo "PRODUCT=${PRODUCT}" + echo "RELEASE=${RELEASE}" + echo "TARGET=${TARGET}" + echo "LOAD=${LOAD}" + echo "Objects will be pstamped." + fi + else + echo "The proper variables have not been set in ${0}." + echo "No pstamping will be performed." + MCS="" + fi + break + ;; + + *) + echo "Null or unknown MCS variable passed to ${0}." + echo "Object comment sections will remain unchanged." + break + ;; +esac + + +# Insure that only one machine type is valid +# Note: the redirection is needed to handle the possibility +# of a nonexistent file in the $MACH machine list + +MACH="vax pdp11 u3b2 u3b u3b5 i286 i386" +(truecnt=0 +for mach in $MACH +do + `$mach` + if [ $? -eq 0 ] + then + truecnt=`expr $truecnt + 1` + fi +done +if [ $truecnt -ne 1 ] +then + echo ":${0}: **** Only one of the following machine types can" + echo " be true: $MACH" + exit 1 +fi ) 2>/dev/null + +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE +if i286 +then + ldlibs= +elif [ x$CCSTYPE = xELF ] +then + shlibs=${SHLIBS:-""} + noshlibs=${NOSHLIBS:-"-dn"} + perflibs=${PERFLIBS:-$noshlibs} + rootlibs=${ROOTLIBS:-$noshlibs} +else + shlibs=${SHLIBS:-"-lc_s"} + noshlibs=${NOSHLIBS:-""} + perflibs=${PERFLIBS:-$shlibs} + rootlibs=${ROOTLIBS:-$shlibs} +fi + +if [ "$SYMLINK" = "" ] +then + RELEASE=`uname -r | cut -c1-3` + if [ $RELEASE -lt 4.0 ] + then + SYMLINK=":" + fi +fi +symlink=${SYMLINK:-"ln -s"} + +cd ${ROOT}/usr/src/add-on +# +# check out the BUS type +VPIX=VPIX +MERGE386=MERGE386 +while [ $# -ge 1 ] +do +case "$1" in +BUS*) shift;; +ARC*) shift;; +VPIX|vpix) VPIX=VPIX; shift;; +NOVPIX|novpix) VPIX="" ; shift;; +MERGE386|merge386) MERGE386=MERGE386; shift;; +NOMERGE386|nomerge386) MERGE386="" ; shift ;; +*) break;; +esac +done +BUS=${BUS:-AT386}; export BUS +ARCH=${ARCH:-AT386}; export ARCH +BTYPE="BUS=$BUS"; export BTYPE +ATYPE="ARCH=$ARCH"; export ATYPE +DFLGS="$VPIX $MERGE386"; export DFLGS + +if [ $# = 0 ] +then + ADDONS="*" +else + ADDONS="$*" +fi + +echo "Press if not correct. You have 30 seconds to kill this build." +echo "I am PID $$." +sleep 30 ; echo "" +for addon in ${ADDONS} +do + if [ ! -f ${addon}/prototype ] + then + cd ${addon} + echo "======== ${addon}" + ${MAKE} -b -f ${addon}.mk ${BTYPE} ${ATYPE} ROOTLIBS='$rootlibs' PERFLIBS='$perflibs' NOSHLIBS='$noshlibs' SHLIBS='$shlibs' SYMLINK='$symlink' FRC=FRC DFLGS='$DFLGS' install + if [ $? -ne 0 ] + then + echo "******** Build of ${addon} add-on FAILED" + else + if [ ! -z "${MCS}" ] + then + echo "-------- Modifying comment section for ${addon}" + if [ ! -d pkg ] + then + echo "WARNING: No object stamping done for ${addon}." + else + cd pkg + for file in `find . -type f -print | grep -v Makefile` + do + if ` file ${file} | egrep "executable|archive|relocatable" >/dev/null 2>&1 ` + then + if [ "${MCS}" = "mcs" ] + then + echo mcs -d -a "@(#)${COMMENT} ${addon}:${file}" ${file} + mcs -d -a "@(#)${COMMENT} ${addon}:${file}" ${file} > /dev/null 2>&1 + if ` file ${file} | grep "archive" >/dev/null 2>&1 ` + then + echo "ar ts ${file} > /dev/null 2>&1" + ar ts ${file} > /dev/null 2>&1 + fi + fi + if [ "${MCS}" = "pstamp" ] + then + echo pstamp ${COMMENT} ${file} + pstamp ${COMMENT} ${file} + fi + fi + done + cd .. + fi + fi + fi + ${MAKE} -b -f ${addon}.mk ${BTYPE} ${ATYPE} ROOTLIBS='$rootlibs' PERFLIBS='$perflibs' NOSHLIBS='$noshlibs' SHLIBS='$shlibs' SYMLINK='$symlink' DFLGS='$DFLGS' package + ${MAKE} -b -f ${addon}.mk ${BTYPE} ${ATYPE} ROOTLIBS='$rootlibs' PERFLIBS='$perflibs' NOSHLIBS='$noshlibs' SHLIBS='$shlibs' SYMLINK='$symlink' DFLGS='$DFLGS' clobber + cd .. + fi +done + +echo ${0}: done at `date` diff --git a/:mk.arch b/:mk.arch new file mode 100644 index 0000000..fad4b6e --- /dev/null +++ b/:mk.arch @@ -0,0 +1,154 @@ +#ident "@(#)mk::mk.arch 1.1.3.1" + +echo "" +echo "" +echo " Copyright (c) 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" +echo ${0}: started at `date` + +OKFLAG=0 + +DIR="" +BUS="" +ARCH="" +while [ $# -ge 1 ] +do +case "$1" in +at386|AT386|at|AT) BUS="$BUS AT386" + ARCH="$ARCH AT386" + DIR="$DIR at";; +attva|ATTVA|att\-va|ATT\-VA) BUS="$BUS AT386" + ARCH="$ARCH AT386" + DIR="$DIR attva";; +mca|MCA) BUS="$BUS MCA" + ARCH="$ARCH MCA" + DIR="$DIR mca";; +mb1|MB1|mbus1|MBUS1) BUS="$BUS MB1" + ARCH="$ARCH MBUS" + DIR="$DIR mb1";; +mb2|MB2|mbus2|MBUS2) BUS="$BUS MB2" + ARCH="$ARCH MBUS" + DIR="$DIR mb2";; +eisa|EISA) BUS="$BUS EISA" + ARCH="$ARCH AT386" + DIR="$DIR eisa";; +ev\-at|EV\-AT) BUS="$BUS EV-AT" + ARCH="$ARCH EV-AT" + DIR="$DIR EV-AT";; +e333a|E333A) DIR="$DIR e333a";; +scsi|SCSI) DIR="$DIR scsi";; +i860|I860|860) DIR="$DIR i860";; +mbus|MBUS) DIR="$DIR mbus";; +OK|ok) OKFLAG=1;; +*) BUS="$BUS $1" + ARCH="$ARCH $1" + DIR="$DIR $1";; +esac +shift +done + +echo "\t\tBUS TYPE=$BUS" +cd arch +if [ ! -d save ] +then rm -rf save + mkdir save +fi + +# Collect the list of all files that are part of the platform binding. +SUBDIRS=`ls | grep -v "^save$"` +for i in ${SUBDIRS} +do +if [ -d $i ] +then +cd $i +find . -type f -print +cd .. +fi +done | sort -u > /tmp/save.$$ + +# Collect a list of directories that the platform binding files are in. +for i in ${SUBDIRS} +do +if [ -d $i ] +then +cd $i +find . -type d -print +cd .. +fi +done | sort -u > /tmp/dir.$$ +cd save +# Create these directories so that files can be saved. +cat /tmp/dir.$$ | xargs mkdir > /dev/null 2>&1 + +# Save all the generic/original AT386 platform binding files that will be overlayed. +cd ../.. +cat /tmp/save.$$ | while read i +do +if [ $OKFLAG = 1 ] +then + for j in ${SUBDIRS} + do + cmp -s $i arch/${j}/$i + if [ $? = 0 ] + then FLG=1 + break + fi + done + if [ ${FLG} = 0 ] + then + cp $i arch/save/$i + fi +elif [ ! -f arch/save/$i -a -f $i ] +then + FLG=0 ; export FLG + for j in ${SUBDIRS} + do + cmp -s $i arch/${j}/$i + if [ $? = 0 ] + then FLG=1 + break + fi + done + + # This file does not exist under arch/*, therefore save it under arch/save + if [ ${FLG} = 0 ] + then + cp $i arch/save/$i + fi +fi +done + +# Remove this overlayable platform binding files from the source tree. +# They'll only live under 'arch'. +cat /tmp/save.$$ | xargs rm -f +cat /tmp/dir.$$ | sort -r | xargs rmdir > /dev/null 2>&1 +rm -f /tmp/save.$$ /tmp/dir.$$ + +# Restore the generic AT386 platform binding files. +cd arch/save +find . -type f -print | cpio -pduv ../.. 2>/dev/null | xargs chmod u+w > /dev/null 2>&1 +cd .. + +# Overlay the platform binding files for the current bus architecture +for D in $DIR +do +if [ "${D}" != "save" ] +then +if [ -d ${D} ] +then +cd ${D} +find . -type f -print | cpio -pvdu ../.. 2>/dev/null | xargs chmod u+w > /dev/null 2>&1 +cd .. +fi +fi +done + +cd .. +echo ${0}: done at `date` diff --git a/:mk.csds b/:mk.csds new file mode 100644 index 0000000..578fa6d --- /dev/null +++ b/:mk.csds @@ -0,0 +1,156 @@ +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" + +#ident "@(#)mk::mk.csds 1.1.1.1" +# +# Shell script for the rebuilding of the CSDS part of the UNIX System V/386 Release 4.0 +# + +if [ "$ROOT" = "" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ "$ROOT" = "/" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ ! -d ${ROOT} ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +PATH=$ROOT/xenv:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc; export PATH +# + +echo $0 started at `date` +trap "exit 1" 1 2 3 15 +SHELL="/bin/sh" +export SHELL +CH=`id | sed '/uid=0[^0-9].*/!s|.*|#|;/#/!d'` +export CH +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE +if [ "$ROOT" = "" ] +then + PATH=/usr/ccs/bin:/usr/bin:/usr/sbin:/etc; export PATH +else + # Cross-makes may not have all the directories needed + for dir in /bin /lib /usr/include /usr/include/sys /shlib /tmp /xenv + do if [ ! -d $ROOT/$dir ] + then rm -f $ROOT/$dir + mkdir $ROOT/$dir + fi + done +fi + +echo "uname -a = \c"; uname -a + +echo 'MAKEOPTS="MAKE=make AS=as CC=cc LD=ld ROOT=$ROOT INC=$ROOT/usr/include" +export MAKEOPTS +if [ -x $ROOT/usr/ccs/bin/make ] +then ${ROOT}/usr/ccs/bin/make ${MAKEOPTS} "$@" +else /usr/ccs/bin/make ${MAKEOPTS} "$@" +fi ' > $ROOT/xenv/make +chmod +x ${ROOT}/xenv/make + +echo '/usr/ccs/bin/cc "$@" -I$ROOT/usr/include' > $ROOT/xenv/cc +chmod +x ${ROOT}/xenv/cc + +cd $ROOT/usr/src + +if [ $# -eq 1 ] +then +case "$1" in +at386|AT386|at|AT) BUS=AT386; ARCH=AT386;; +mca|MCA) BUS=MCA; ARCH=MCA;; +mb1|MB1|mbus1|MBUS1) BUS=MB1; ARCH=MBUS;; +mb2|MB2|mbus2|MBUS2) BUS=MB2; ARCH=MBUS;; +eisa|EISA) BUS=EISA; ARCH=AT386;; +ev\-at|EV\-AT) BUS=EV-AT; ARCH=EV-AT;; +i860|I860|860) ;; +mbus|MBUS) ;; +*) BUS="$1"; ARCH="$1";; +esac +elif [ $# -gt 1 ] +then echo "Usage ${0} [AT386|MB1|MB2|MCA]" + exit 2 +else + BUS=AT386 + ARCH=AT386 +fi +export BUS ARCH + +# install /usr/include and /usr/include/sys header files +sh ./:mkhead +sh ./:mksyshead + +cd cmd/sgs/xenv/i386 +sh pathedit << ! +y +y +y +! + +if [ ! -f makefile.1 ] +then mv makefile makefile.1 +fi +grep -v unix_conv makefile.1 > makefile + +cd ../../../.. + +# Build the C Compilation tools, fltused changes +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} sgs + +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/xenv/ar +cp ${ROOT}/usr/ccs/bin/as ${ROOT}/xenv/as +cp ${ROOT}/usr/ccs/bin/ld ${ROOT}/xenv/ld +# build the C library + +sh ./:mklib BUS=${BUS} ARCH=${ARCH} libc + +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -L $ROOT/usr/ccs/lib -L $ROOT/usr/lib -Y L,/usr/lib -Y U,/usr/ccs/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +chmod +x ${ROOT}/xenv/cc + +# Build the C Compilation tools +cd cmd/sgs/xenv/i386 +mv makefile.1 makefile +cd ../../../.. + +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} sgs +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/xenv/ar +cp ${ROOT}/usr/ccs/bin/as ${ROOT}/xenv/as +cp ${ROOT}/usr/ccs/bin/ld ${ROOT}/xenv/ld + +# Build the Libraries +sh ./:mklib BUS=${BUS} ARCH=${ARCH} libc libcrypt libdl libgen libl libm libmalloc liby rtld xlibcurses zlibeti zlibetitam +cp $ROOT/usr/ccs/bin/tic $ROOT/xenv/tic + +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -Y L,${ROOT}/usr/ccs/lib -Y U,${ROOT}/usr/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +chmod +x ${ROOT}/xenv/cc + +# build all the CSDS commands +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} cb cflow cscope ctrace cxref ldd make prof regcmp sccs sdb sgs +cp $ROOT/usr/ccs/lib/llib-lcrypt $ROOT/usr/lib/llib-crypt +cp $ROOT/usr/ccs/lib/llib-lcrypt.ln $ROOT/usr/lib/llib-crypt.ln + +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/usr/bin/ar +cp ${ROOT}/usr/ccs/bin/captoinfo ${ROOT}/usr/bin/captoinfo +cp ${ROOT}/usr/ccs/bin/infocmp ${ROOT}/usr/bin/infocmp +cp ${ROOT}/usr/ccs/bin/mcs ${ROOT}/usr/bin/mcs +cp ${ROOT}/usr/ccs/bin/tic ${ROOT}/usr/bin/tic +cp ${ROOT}/usr/ccs/bin/tput ${ROOT}/usr/bin/tput +cp ${ROOT}/usr/ccs/bin/what ${ROOT}/usr/bin/what + +echo $0 done at `date` +exit 0 diff --git a/:mk.fnd b/:mk.fnd new file mode 100644 index 0000000..bc19307 --- /dev/null +++ b/:mk.fnd @@ -0,0 +1,290 @@ +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" + +#ident "@(#)mk::mk.fnd 1.1.3.1" +# +# Shell script for rebuilding the UNIX System V/386 Release 4.0 except for the CSDS +# + +if [ "$ROOT" = "" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ "$ROOT" = "/" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ ! -d ${ROOT} ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +OLDPATH=$PATH +PATH=$ROOT/xenv:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc; export PATH + +PATH=$PATH:$OLDPATH; export PATH +MCS=${MCS:-mcs}; export MCS +# +# changed to allow the following to be setable +# +LOAD=${LOAD:-STC}; export LOAD +RELEASE=${RELEASE:-4.0}; export RELEASE +TARGET=${TARGET:-i386}; export TARGET +PRODUCT=${PRODUCT:-386unix}; export PRODUCT + +echo $0 started at `date` +trap "exit 1" 1 2 3 15 +SHELL="/bin/sh" +export SHELL +CH=`id | sed '/uid=0[^0-9].*/!s|.*|#|;/#/!d'` +export CH +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE +if [ "$ROOT" = "" ] +then + PATH=/usr/ccs/bin:/usr/bin:/usr/sbin:/etc; export PATH +else + # Cross-makes may not have all the directories needed + for dir in /bin /lib /usr/include /usr/include/sys /shlib /tmp /xenv + do if [ ! -d $ROOT/$dir ] + then rm -f $ROOT/$dir + mkdir $ROOT/$dir + fi + done +fi + +echo "uname -a = \c"; uname -a + +echo 'MAKEOPTS="MAKE=make AS=as CC=cc LD=ld ROOT=$ROOT INC=$ROOT/usr/include" +export MAKEOPTS +if [ -x $ROOT/usr/ccs/bin/make ] +then ${ROOT}/usr/ccs/bin/make ${MAKEOPTS} "$@" +else /usr/ccs/bin/make ${MAKEOPTS} "$@" +fi ' > $ROOT/xenv/make +chmod +x ${ROOT}/xenv/make + +# This is needed because :mkcmd set's CC to be i386cc if ROOT is unset and +# the current command to be compiled is only a .c (e.g. no .mk and no directory +if [ -x ${ROOT}/usr/ccs/bin/cc ] +then +echo '${ROOT}/usr/ccs/bin/cc -Y 0,${ROOT}/usr/ccs/lib -Y 2,${ROOT}/usr/ccs/lib -Y a,${ROOT}/usr/ccs/bin -Y l,${ROOT}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -Y L,${ROOT}/usr/ccs/lib -Y U,${ROOT}/usr/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/cc +else +echo '/usr/ccs/bin/cc -L $ROOT/usr/ccs/lib -L $ROOT/usr/lib -Y L,/usr/lib -Y U,/usr/ccs/lib "$@" -Y I,$ROOT/usr/include' > $ROOT/xenv/cc +fi +if [ ! -x $ROOT/xenv/i386cc ] +then ln $ROOT/xenv/cc $ROOT/xenv/i386cc +fi +chmod +x ${ROOT}/xenv/cc +for i in as ld ar +do +if [ -x ${ROOT}/usr/ccs/bin/${i} ] +then cp ${ROOT}/usr/ccs/bin/${i} ${ROOT}/xenv/${i} +fi +done + +cd $ROOT/usr/src +while [ $# -ge 1 ] +do +case "$1" in +at386|AT386|at|AT) BUS=AT386; ARCH=AT386;; +vpix|VPIX) VPIX=VPIX;; +novpix|NOVPIX) VPIX=NOVPIX;; +merge386|MERGE386) MERGE386=MERGE386;; +nomerge386|NOMERGE386) MERGE386=" ";; +mca|MCA) BUS=MCA; ARCH=MCA;; +mb1|MB1|mbus1|MBUS1) BUS=MB1; ARCH=MBUS;; +mb2|MB2|mbus2|MBUS2) BUS=MB2; ARCH=MBUS;; +eisa|EISA) BUS=EISA; ARCH=AT386;; +ev\-at|EV\-AT) BUS=EV-AT; ARCH=EV-AT;; +i860|I860|860) ;; +mbus|MBUS) ;; +*) BUS="$1"; ARCH="$1";; +esac +shift +done +BUS=${BUS:-AT386}; export BUS +ARCH=${ARCH:-AT386}; export ARCH +MERGE386=${MERGE386:-MERGE386}; export MERGE386 +VPIX=${VPIX:-VPIX}; export VPIX + +# install /usr/include and /usr/include/sys header files +sh ./:mkhead +sh ./:mksyshead +sh ./:mkucbhead + +if [ ! -f $ROOT/usr/include/curses.h ] +then cp /usr/include/curses.h $ROOT/usr/include/curses.h +fi +if [ ! -f $ROOT/usr/include/term.h ] +then cp /usr/include/term.h $ROOT/usr/include/term.h +fi +if [ ! -f $ROOT/usr/include/unctrl.h ] +then cp /usr/include/unctrl.h $ROOT/usr/include/unctrl.h +fi +if [ ! -f $ROOT/usr/include/regexpr.h ] +then cp /usr/include/regexpr.h $ROOT/usr/include/regexpr.h +fi +if [ ! -f $ROOT/usr/include/libgen.h ] +then cp $ROOT/usr/src/lib/libgen/libgen.h $ROOT/usr/include/libgen.h +fi + +# Build all the non CSDS libraries +( +cd lib +ls -a | sed \ + -e "/^.lib.mk$/d" \ + -e "/^.libmk.temp$/d" \ + -e "/^libc$/d" \ + -e "/^libcrypt$/d" \ + -e "/^libdl$/d" \ + -e "/^libgen$/d" \ + -e "/^libl$/d" \ + -e "/^libm$/d" \ + -e "/^libmalloc$/d" \ + -e "/^liby$/d" \ + -e "/^rtld$/d" \ + -e "/^xlibcurses$/d" \ + -e "/^zlibeti$/d" \ + -e "/^zlibetitam$/d" | + sort -u | sed -n '3,$p' > /tmp/$$.doit +) +if [ -s /tmp/$$.doit ] +then sh ./:mklib $VPIX $MERGE386 `cat -s /tmp/$$.doit` +fi +rm -f /tmp/$$.doit + +( +cd ${ROOT}/usr/src/xcplib +ls -a | + sort -u | + sed -n '3,$p' > /tmp/$$.xit +) +sh ./:mkxcplib `cat -s /tmp/$$.xit` +rm -f /tmp/$$.xit + +( +cd ${ROOT}/usr/src/ucblib +ls -a | + sort -u | + sed -n '3,$p' > /tmp/$$.ucbit +) +sh ./:mkucblib `cat -s /tmp/$$.ucbit` +rm -f /tmp/$$.ucbit + +if [ ! -f ${ROOT}/usr/lib/libcrypt_d.a -a ! -f ${ROOT}/usr/ccs/lib/libcrypt_d.a ] +then cp /usr/lib/libcrypt_d.a ${ROOT}/usr/lib/libcrypt_d.a || cp /usr/ccs/lib/libcrypt_d.a ${ROOT}/usr/ccs/lib/libcrypt_d.a +fi + +# build all the commands +( +cd ${ROOT}/usr/src/cmd +ls -a | + sed -e "s/\.mk$//" -e "s/\.sh$//" -e "s/\.c$//" | sed \ + -e "/^include$/d" \ + -e "/^cb$/d" \ + -e "/^cflow$/d" \ + -e "/^cscope$/d" \ + -e "/^ctrace$/d" \ + -e "/^cxref$/d" \ + -e "/^ldd$/d" \ + -e "/^make$/d" \ + -e "/^prof$/d" \ + -e "/^regcmp$/d" \ + -e "/^sccs$/d" \ + -e "/^sdb$/d" \ + -e "/^sgs$/d" | + sort -u | + sed -n '3,$p' > /tmp/$$.doit +) +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 `cat -s /tmp/$$.doit` +rm -f /tmp/$$.doit + +( +cd ${ROOT}/usr/src/ucbcmd +ls -a | + sed -e "s/\.mk$//" -e "s/\.sh$//" -e "s/\.c$//" | + sort -u | + sed -n '3,$p' > /tmp/$$.ucbit +) +sh ./:mkucbcmd `cat -s /tmp/$$.ucbit` +rm -f /tmp/$$.ucbit + +# Remove these five files which are links to other files +rm -f ${ROOT}/usr/bin/view ${ROOT}/usr/bin/vedit ${ROOT}/usr/bin/edit ${ROOT}/usr/bin/ex ${ROOT}/usr/bin/pcat + +# build the OS itself +if [ -x ${ROOT}/usr/ccs/bin/as ] +then cp ${ROOT}/usr/ccs/bin/as ${ROOT}/usr/bin/idas + cp ${ROOT}/usr/ccs/bin/ld ${ROOT}/usr/bin/idld + cp ${ROOT}/usr/ccs/bin/cc ${ROOT}/usr/bin/idcc + cp ${ROOT}/usr/ccs/lib/cpp ${ROOT}/usr/lib/idcpp + cp ${ROOT}/usr/ccs/lib/acomp ${ROOT}/usr/lib/idacomp + cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/usr/bin/ar + cp ${ROOT}/usr/ccs/bin/captoinfo ${ROOT}/usr/bin/captoinfo + cp ${ROOT}/usr/ccs/bin/infocmp ${ROOT}/usr/bin/infocmp + cp ${ROOT}/usr/ccs/bin/mcs ${ROOT}/usr/bin/mcs + cp ${ROOT}/usr/ccs/bin/tic ${ROOT}/usr/bin/tic + cp ${ROOT}/usr/ccs/bin/tput ${ROOT}/usr/bin/tput + cp ${ROOT}/usr/ccs/bin/what ${ROOT}/usr/bin/what +else cp /usr/ccs/bin/as ${ROOT}/usr/bin/idas + cp /usr/ccs/bin/ld ${ROOT}/usr/bin/idld + cp /usr/ccs/bin/cc ${ROOT}/usr/bin/idcc + cp /usr/ccs/lib/cpp ${ROOT}/usr/lib/idcpp + cp /usr/ccs/lib/acomp ${ROOT}/usr/lib/idacomp + cp /usr/ccs/bin/ar ${ROOT}/usr/bin/ar + cp /usr/ccs/bin/captoinfo ${ROOT}/usr/bin/captoinfo + cp /usr/ccs/bin/infocmp ${ROOT}/usr/bin/infocmp + cp /usr/ccs/bin/mcs ${ROOT}/usr/bin/mcs + cp /usr/ccs/bin/tic ${ROOT}/usr/bin/tic + cp /usr/ccs/bin/tput ${ROOT}/usr/bin/tput + cp /usr/ccs/bin/what ${ROOT}/usr/bin/what +fi +if [ ! -f $ROOT/usr/bin/tic ] +then + cp /usr/bin/captoinfo $ROOT/usr/bin/captoinfo + cp /usr/bin/infocmp $ROOT/usr/bin/infocmp + cp /usr/bin/tic $ROOT/usr/bin/tic + cp /usr/bin/tput $ROOT/usr/bin/tput +fi + +ln -s $ROOT/usr/bin/idas $ROOT/bin/idas +ln -s $ROOT/usr/bin/idcc $ROOT/bin/idcc +ln -s $ROOT/usr/bin/idld $ROOT/bin/idld +ln -s $ROOT/usr/lib/idacomp $ROOT/lib/idacomp +ln -s $ROOT/usr/lib/idcpp $ROOT/lib/idcpp + +sh ./:mkuts ${BUS} ${ARCH} $VPIX $MERGE386 + +# Build the add-ons +# build all the add-ons that are present. +pkglist="" +for i in `cd add-on; ls` +do + # skip ones which are interactive + [ $i = source ] && continue + pkglist="$pkglist $i" +done +sh ./:mk.addon BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 $pkglist + +for i in `cd pkg; ls` +do + pkglist="$pkglist $i" +done +sh ./:mkoam BUS=${BUS} ARCH=${ARCH} $pkglist + +if [ ! -f $ROOT/usr/lib/libc.so.1 ] +then cp /usr/lib/libc.so.1 $ROOT/usr/lib/libc.so.1 +fi + +echo $0 done at `date` +exit 0 diff --git a/:mk.i386 b/:mk.i386 new file mode 100644 index 0000000..88d26c7 --- /dev/null +++ b/:mk.i386 @@ -0,0 +1,338 @@ +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" + +#ident "@(#)mk::mk.i386 1.1.2.1" + +# +# Shell script for rebuilding the Complete UNIX System V/386 Release 4.0 +# + +if [ "$ROOT" = "" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ "$ROOT" = "/" ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +if [ ! -d ${ROOT} ] +then echo "$0: You must specify a \$ROOT directory, other than '/', \ +as the root of the source and output tree." + exit 1 +fi +OLDPATH=$PATH; export OLDPATH +PATH=$ROOT/xenv:$ROOT/i386/usr/ccs/bin:/bin:/etc:/usr/bin; export PATH +# + +PATH=$PATH:$OLDPATH; export PATH +MCS=${MCS:-mcs}; export MCS +# +# changed to allow the following to be setable +# +LOAD=${LOAD:-STC}; export LOAD +RELEASE=${RELEASE:-4.0}; export RELEASE +TARGET=${TARGET:-i386}; export TARGET +PRODUCT=${PRODUCT:-386unix}; export PRODUCT + +echo $0 started at `date` +trap "exit 1" 1 2 3 15 +SHELL="/bin/sh" +export SHELL +CH=`id | sed '/uid=0[^0-9].*/!s|.*|#|;/#/!d'` +export CH +CCSTYPE=COFF; export CCSTYPE +SYMLINK=: export SYMLINK +XSGS=$ROOT/i386 +export XSGS +if [ "$ROOT" = "" ] +then + PATH=/bin:/etc:/usr/bin; export PATH +else + # Cross-makes may not have all the directories needed + for dir in /bin /lib /usr/include /usr/include/sys /shlib /tmp /xenv + do if [ ! -d $ROOT/$dir ] + then rm -f $ROOT/$dir + mkdir $ROOT/$dir + chmod 755 $ROOT/$dir + fi + done +fi +echo "uname -a = \c"; uname -a + +echo "Building Cross C Compiler ...." +#chmod 644 $ROOT/xenv/lint +rm -f $ROOT/xenv/i386cc $ROOT/xenv/cc $ROOT/xenv/make $ROOT/xenv/i386 $ROOT/xenv/vax $ROOT/xenv/cpset +rm -f $ROOT/xenv/ar $ROOT/xenv/i386as $ROOT/xenv/i386ld $ROOT/xenv/tic $ROOT/xenv/lint1 +cp /bin/true ${ROOT}/xenv/i386 +chmod 755 ${ROOT}/xenv/i386 +for i in `ls -i /bin | grep "\`ls -i /bin/true | cut -c1-6\`" | grep -v true | cut -c7-` +do +if [ ${i} = "i386" ] +then continue +fi +cp /bin/false ${ROOT}/xenv/${i} +done + +echo 'MAKEOPTS="MAKE=make AS=as CC=cc LD=ld ROOT=$ROOT INC=$ROOT/usr/include CCSLIB=$ROOT/i386/usr/ccs/lib" +export MAKEOPTS +/bin/make ${MAKEOPTS} "$@" +' > $ROOT/xenv/make +chmod +x ${ROOT}/xenv/make + +echo '/bin/cc -D_STYPES -U__STDC__ "$@" -I$ROOT/usr/include' > $ROOT/xenv/cc +chmod +x ${ROOT}/xenv/cc + +cd $ROOT/usr/src +while [ $# -ge 1 ] +do +case "$1" in +at386|AT386|at|AT) BUS=AT386; ARCH=AT386;; +vpix|VPIX) VPIX=VPIX;; +novpix|NOVPIX) VPIX=NOVPIX;; +merge386|MERGE386) MERGE386=MERGE386;; +nomerge386|NOMERGE386) MERGE386=" ";; +mca|MCA) BUS=MCA; ARCH=MCA;; +mb1|MB1|mbus1|MBUS1) BUS=MB1; ARCH=MBUS;; +mb2|MB2|mbus2|MBUS2) BUS=MB2; ARCH=MBUS;; +eisa|EISA) BUS=EISA; ARCH=AT386;; +ev\-at|EV\-AT) BUS=EV-AT; ARCH=EV-AT;; +i860|I860|860) ;; +mbus|MBUS) ;; +*) BUS="$1"; ARCH="$1";; +esac +shift +done +BUS=${BUS:-AT386}; export BUS +ARCH=${ARCH:-AT386}; export ARCH +MERGE386=${MERGE386:-MERGE386}; export MERGE386 +VPIX=${VPIX:-VPIX}; export VPIX + +# install /usr/include and /usr/include/sys header files +sh ./:mkhead +sh ./:mksyshead +sh ./:mkucbhead +rm -f $ROOT/xenv/i386 $ROOT/xenv/vax + +cd cmd/sgs/xenv/i386 +sh pathedit << ! +n +y +y +! + +if [ ! -f makefile.1 ] +then mv makefile makefile.1 +fi +grep -v unix_conv makefile.1 > makefile + +cd ../../../.. + +# Build the C Compilation tools, fltused changes +rm -f $ROOT/usr/bin/tic_native $ROOT/usr/ccs/bin/tic $ROOT/usr/bin/tic_cross +rm -f $ROOT/etc/conf/bin/idconfig_native $ROOT/etc/conf/bin/idconfig $ROOT/etc/conf/bin/idconfig_cross +rm -f $ROOT/etc/conf/bin/idmkunix_native $ROOT/etc/conf/bin/idmkunix $ROOT/etc/conf/bin/idmkunix_native + +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 sgs +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 cpset +mv $ROOT/usr/bin/cpset $ROOT/xenv/cpset +echo '${XSGS}/usr/ccs/bin/i386cc -G -Y 0,${XSGS}/usr/ccs/lib -Y 2,${XSGS}/usr/ccs/lib -Y a,${XSGS}/usr/ccs/bin -Y l,${XSGS}/usr/ccs/bin "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/i386cc + +cd cmd/sgs/xenv/i386 + +mv makefile.1 makefile +sh pathedit << ! +y +y +y +! + +cd ../../../.. +rm -f ${ROOT}/xenv/cc +chmod +x ${ROOT}/xenv/i386cc + +cp ${XSGS}/usr/ccs/bin/i386ar ${ROOT}/xenv/i386ar +cp ${XSGS}/usr/ccs/bin/i386as ${ROOT}/xenv/i386as +cp ${XSGS}/usr/ccs/bin/i386ld ${ROOT}/xenv/i386ld + +CCSTYPE=ELF; export CCSTYPE +SHELL=/bin/sh; export SHELL +INC=$ROOT/usr/include; export INC +INCSYS=$ROOT/usr/include; export INCSYS +# Build the C library +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 xlibcurses +cp ${ROOT}/usr/ccs/bin/tic ${ROOT}/xenv/tic +rm -f ${ROOT}/xenv/make + +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 libc + +echo '${XSGS}/usr/ccs/bin/i386cc -G -Y 0,${XSGS}/usr/ccs/lib -Y 2,${XSGS}/usr/ccs/lib -Y a,${XSGS}/usr/ccs/bin -Y l,${XSGS}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -Y L,${ROOT}/usr/lib -Y U,${ROOT}/usr/ccs/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/i386cc + +cp $ROOT/usr/ccs/lib/crt0.o $ROOT/usr/ccs/lib/i386crt0.o +cp $ROOT/usr/ccs/lib/crt1.o $ROOT/usr/ccs/lib/i386crt1.o +cp $ROOT/usr/ccs/lib/crti.o $ROOT/usr/ccs/lib/i386crti.o +cp $ROOT/usr/ccs/lib/crtn.o $ROOT/usr/ccs/lib/i386crtn.o +cp $ROOT/usr/ccs/lib/mcrt0.o $ROOT/usr/ccs/lib/i386mcrt0.o +cp $ROOT/usr/ccs/lib/mcrt1.o $ROOT/usr/ccs/lib/i386mcrt1.o +cp $ROOT/usr/ccs/lib/pcrt1.o $ROOT/usr/ccs/lib/i386pcrt1.o +cp $ROOT/usr/ccs/lib/values-Xa.o $ROOT/usr/ccs/lib/i386values-Xa.o +cp $ROOT/usr/ccs/lib/values-Xc.o $ROOT/usr/ccs/lib/i386values-Xc.o +cp $ROOT/usr/ccs/lib/values-Xt.o $ROOT/usr/ccs/lib/i386values-Xt.o + +# Build the Libraries +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 libcrypt libdl libgen libl libm libmalloc liby rtld xlibcurses zlibeti zlibetitam +rm -f $ROOT/i386/usr/ccs/lib/libcurses.a $ROOT/usr/ccs/lib/libtermcap.a $ROOT/usr/ccs/lib/libtermlib.a +ln ${ROOT}/usr/ccs/lib/libcurses.a ${ROOT}/usr/ccs/lib/libtermlib.a +ln ${ROOT}/usr/ccs/lib/libcurses.a ${ROOT}/usr/ccs/lib/libtermcap.a +ln ${ROOT}/usr/ccs/lib/libcurses.a ${ROOT}/usr/lib/libtermcap.a + +# Build all the non CSDS libraries +( +cd lib +ls -a | sed \ + -e "/^.lib.mk$/d" \ + -e "/^.libmk.temp$/d" \ + -e "/^libc$/d" \ + -e "/^libcrypt$/d" \ + -e "/^libdl$/d" \ + -e "/^libgen$/d" \ + -e "/^libl$/d" \ + -e "/^libm$/d" \ + -e "/^libmalloc$/d" \ + -e "/^liby$/d" \ + -e "/^rtld$/d" \ + -e "/^xlibcurses$/d" \ + -e "/^zlibeti$/d" \ + -e "/^zlibetitam$/d" | + sort -u | sed -n '3,$p' > /tmp/$$.doit +) +if [ -s /tmp/$$.doit ] +then sh ./:mklib $VPIX $MERGE386 `cat -s /tmp/$$.doit` +fi +rm -f /tmp/$$.doit + +( +cd ${ROOT}/usr/src/xcplib +ls -a | + sort -u | + sed -n '3,$p' > /tmp/$$.xit +) +sh ./:mkxcplib `cat -s /tmp/$$.xit` +rm -f /tmp/$$.xit + +( +cd ${ROOT}/usr/src/ucblib +ls -a | + sort -u | + sed -n '3,$p' > /tmp/$$.ucbit +) +sh ./:mkucblib `cat -s /tmp/$$.ucbit` +rm -f /tmp/$$.ucbit + +sh ./:mklib BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 libc + +echo '${XSGS}/usr/ccs/bin/i386cc -Y 0,${XSGS}/usr/ccs/lib -Y 2,${XSGS}/usr/ccs/lib -Y a,${XSGS}/usr/ccs/bin -Y l,${XSGS}/usr/ccs/bin -Y S,${ROOT}/usr/ccs/lib -Y L,${ROOT}/usr/lib -Y U,${ROOT}/usr/ccs/lib "$@" -Y I,${ROOT}/usr/include' > $ROOT/xenv/i386cc +chmod +x ${ROOT}/xenv/i386cc + + +# build all the commands +# Build the sgs now so that libld.a is installed for other cmds. +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 sgs +mkdir $ROOT/i386/usr/ccs/lib $ROOT/i386/usr/ccs/lib/lex > /dev/null 2>&1 +cp $ROOT/usr/ccs/lib/lex/ncform $ROOT/i386/usr/ccs/lib/lex/ncform + +( +cd ${ROOT}/usr/src/cmd +ls -a | + sed -e "s/\.mk$//" -e "s/\.sh$//" -e "s/\.c$//" \ + -e "/^include$/d" | + sort -u | + egrep -v "sgs" | + sed -n '3,$p' > /tmp/$$.doit +) +sh ./:mkcmd BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 `cat -s /tmp/$$.doit` +rm -f /tmp/$$.doit +cp $ROOT/usr/ccs/lib/llib-lcrypt $ROOT/usr/lib/llib-lcrypt +cp $ROOT/usr/ccs/lib/llib-lcrypt.ln $ROOT/usr/lib/llib-lcrypt.ln + +( +cd ${ROOT}/usr/src/ucbcmd +ls -a | + sed -e "s/\.mk$//" -e "s/\.sh$//" -e "s/\.c$//" | + sort -u | + sed -n '3,$p' > /tmp/$$.ucbit +) +sh ./:mkucbcmd `cat -s /tmp/$$.ucbit` +rm -f /tmp/$$.ucbit + +# Remove these five files which are links to other files +rm -f ${ROOT}/usr/bin/view ${ROOT}/usr/bin/vedit ${ROOT}/usr/bin/edit ${ROOT}/usr/bin/ex ${ROOT}/usr/bin/pcat +rm ${ROOT}/usr/ccs/lib/libtermcap.a ${ROOT}/usr/ccs/lib/libtermlib.a +ln ${ROOT}/usr/ccs/lib/libcurses.a ${ROOT}/usr/ccs/lib/libtermcap.a +ln ${ROOT}/usr/ccs/lib/libtermcap.a ${ROOT}/usr/ccs/lib/libtermlib.a + +# build the OS itself +ln ${XSGS}/usr/ccs/bin/i386as ${ROOT}/usr/bin/idas +ln ${XSGS}/usr/ccs/bin/i386ld ${ROOT}/usr/bin/idld +ln ${XSGS}/usr/ccs/bin/i386cc ${ROOT}/usr/bin/idcc +ln ${XSGS}/usr/ccs/lib/i386cpp ${ROOT}/usr/lib/idcpp +ln ${XSGS}/usr/ccs/lib/i386acomp ${ROOT}/usr/lib/idacomp + +ln $ROOT/usr/bin/idas $ROOT/bin/idas +ln $ROOT/usr/bin/idcc $ROOT/bin/idcc +ln $ROOT/usr/bin/idld $ROOT/bin/idld +ln $ROOT/usr/lib/idcpp $ROOT/lib/idcpp +ln $ROOT/usr/lib/idacomp $ROOT/lib/idacomp + +CCSROOT=$ROOT/i386 PFX=i386 sh ./:mkuts ${BUS} ${ARCH} $VPIX $MERGE386 + +# Build the add-ons +# build all the add-ons that are present. +pkglist="" +for i in `cd add-on; ls` +do + # skip ones which are interactive + [ $i = source ] && continue + pkglist="$pkglist $i" +done +sh ./:mk.addon BUS=${BUS} ARCH=${ARCH} $VPIX $MERGE386 $pkglist + +for i in `cd pkg; ls` +do + pkglist="$pkglist $i" +done +sh ./:mkoam BUS=${BUS} ARCH=${ARCH} $pkglist + +# Put 'native' guys in +mv $ROOT/xenv/tic $ROOT/usr/bin/tic_cross +ln $ROOT/usr/ccs/bin/tic_native $ROOT/usr/bin/tic +mv $ROOT/etc/conf/bin/idconfig $ROOT/etc/conf/bin/idconfig_cross +ln $ROOT/etc/conf/bin/idconfig_native $ROOT/etc/conf/bin/idconfig +mv $ROOT/etc/conf/bin/idmkunix $ROOT/etc/conf/bin/idmkunix_cross +ln $ROOT/etc/conf/bin/idmkunix_native $ROOT/etc/conf/bin/idmkunix +ln ${ROOT}/usr/ccs/bin/as ${ROOT}/usr/bin/idas +ln ${ROOT}/usr/ccs/bin/ld ${ROOT}/usr/bin/idld +ln ${ROOT}/usr/ccs/bin/cc ${ROOT}/usr/bin/idcc +ln ${ROOT}/usr/ccs/lib/cpp ${ROOT}/usr/lib/idcpp +ln ${ROOT}/usr/ccs/lib/acomp ${ROOT}/usr/lib/idacomp + +cp ${ROOT}/usr/ccs/bin/ar ${ROOT}/usr/bin/ar +cp ${ROOT}/usr/ccs/bin/captoinfo ${ROOT}/usr/bin/captoinfo +cp ${ROOT}/usr/ccs/bin/infocmp ${ROOT}/usr/bin/infocmp +cp ${ROOT}/usr/ccs/bin/mcs ${ROOT}/usr/bin/mcs +cp ${ROOT}/usr/ccs/bin/tic ${ROOT}/usr/bin/tic +cp ${ROOT}/usr/ccs/bin/tput ${ROOT}/usr/bin/tput +cp ${ROOT}/usr/ccs/bin/what ${ROOT}/usr/bin/what + +echo $0 done at `date` +exit 0 diff --git a/:mkcmd b/:mkcmd new file mode 100644 index 0000000..c8d945a --- /dev/null +++ b/:mkcmd @@ -0,0 +1,426 @@ +#ident "@(#)mk::mkcmd 1.31" + +if i386 +then +echo +echo +echo +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo +echo " Copyright (c) 1987, 1988 Microsoft Corporation" +echo " All Rights Reserved" +echo +echo " This Module contains Proprietary Information of Microsoft" +echo " Corporation and should be treated as Confidential." +echo +echo +echo +echo $0 started at `date` +fi + +MAKE=${MAKE:-make} +CLOBBER=${CLOBBER:-"ON"} +# If we are in a cross compilation environment then use cross compiler +if [ "$ROOT" != "" ] +then + if u3b2 || u3b15 + then + AS=m32as export AS + CC=m32cc export CC + LD=m32ld export LD + fi + if i386 + then + AS=i386as export AS + CC=i386cc export CC + LD=i386ld export LD + fi +else + AS=as export AS + CC=cc export CC + LD=ld export LD +fi + +if i386 +then + if [ ! -d $ROOT/etc ] ; then mkdir $ROOT/etc ; fi + if [ ! -d $ROOT/etc/default ] ; then mkdir $ROOT/etc/default ; fi + if [ ! -d $ROOT/etc/cron.d ] ; then mkdir $ROOT/etc/cron.d ; fi + + if [ ! -d $ROOT/usr/bin ] ; then mkdir $ROOT/usr/bin ; fi + if [ ! -d $ROOT/usr/sbin ] ; then mkdir $ROOT/usr/sbin ; fi + if [ ! -d $ROOT/sbin ] ; then mkdir $ROOT/sbin ; fi + + if [ ! -d $ROOT/var ] ; then mkdir $ROOT/var ; fi + if [ ! -d $ROOT/var/spool ] ; then mkdir $ROOT/var/spool ; fi + + if [ ! -d $ROOT/usr/lbin ]; then mkdir $ROOT/usr/lbin; fi + if [ ! -d $ROOT/usr/ucb ]; then mkdir $ROOT/usr/ucb; fi + + if [ ! -d $ROOT/usr/share ]; then mkdir $ROOT/usr/share; fi + if [ ! -d $ROOT/usr/share/lib ]; then mkdir $ROOT/usr/share/lib; fi + + if [ ! -d $ROOT/usr/lib/class ]; then mkdir $ROOT/usr/lib/class; fi + + if [ ! -d $ROOT/usr/lib/fs ]; then mkdir $ROOT/usr/lib/fs; fi + if [ ! -d $ROOT/etc/fs ]; then mkdir $ROOT/etc/fs; fi +fi + +# Insure that only one machine type is valid +# Note: the redirection is needed to handle the possibility +# of a nonexistent file in the $MACH machine list +MACH="vax pdp11 u3b2 u3b u3b15 i386" +(truecnt=0 +for mach in $MACH +do + `$mach` + if [ $? -eq 0 ] + then + truecnt=`expr $truecnt + 1` + fi +done +if [ $truecnt -ne 1 ] +then + echo ":mkcmd: **** Only one of the following machine types can" + echo " be true: $MACH" + exit 1 +fi ) 2>/dev/null +# +places=${places-$ROOT/etc/places} +if [ -r $places ] +then + . $places +else + SRC=${SRC-$ROOT/usr/src} + LSRC=${LSRC-$ROOT/usr/lsrc} + BIN=${BIN-$ROOT/bin} + UBIN=${UBIN-$ROOT/usr/bin} + LBIN=${LBIN-$ROOT/usr/lbin} +fi +LDFILE=${LDFILE-${SRC}/ldflags} +# Initialize default flag values: +# fflag - controls the FFLAG varible. It is set to either null +# (use hardware floating point) or '-f' (use software +# simulation floating point). +# sflag - shared text, turns off the -i and -n loader options. +# Saves the intermediate .c file from a yacc or lex in +# .x for later :mkcmd runs. +# ldlibs - shared library flag. It is either "-lnsl_s" (build w/the +# shared libnsl_s.a) or "-lc_s -lnsl_s" (build w/both +# shared libc_s.a and libnsl_s.a). Default is both. +# iflag - seperate I&D space. It is either set to '-i' (when building +# certain commands on a 16-bit machine (e.g. PDP11/70) +# or null (for all other cases). +# symlink -variable to pass symbolic links to makefiles +fflag= +sflag= +iflag= +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE +if [ x$CCSTYPE = xCOFF ] +then + shlibs=${SHLIBS:-"-lc_s"} + noshlibs=${NOSHLIBS:-""} + perflibs=${PERFLIBS:-$shlibs} + rootlibs=${ROOTLIBS:-$shlibs} +else + shlibs=${SHLIBS:-""} + noshlibs=${NOSHLIBS:-"-dn"} + perflibs=${PERFLIBS:-$shlibs} + rootlibs=${ROOTLIBS:-$noshlibs} +fi +ldflags= +if [ "$SYMLINK" = "" ] +then + RELEASE=`uname -r | cut -c1-3` + if [ $RELEASE -lt 4.0 ] + then + SYMLINK=":" + fi +fi +symlink=${SYMLINK:-"ln -s"} + +for opt in $* +do + case $opt in + + -f) fflag="-f" + ;; + + -s) sflag=-s + yaccrm="YACCRM=:" + iflag= + ;; + + -*) echo ":mkcmd; **** unknown option '$opt' - ignored" + ;; + + *) break + ;; + esac + shift +done +# +# Process remaining arguments as source that needs to be built. +# The three interesting variables are: +# B - basename of each argument +# BASE - basename of each option with its dot suffix removed +# OBJ - file to be installed if the build is successful +# +cd $SRC/cmd + +if i386 +then + # + # check out the BUS type. + BTYPE="BUS=AT386" + ATYPE="ARCH=AT386" + VPIX=-DVPIX; + MERGE386=-DMERGE386; + while [ $# -ge 1 ] + do + case "$1" in + BUS*) BTYPE="$1"; shift;; + ARC*) ATYPE="$1"; shift;; + vpix|VPIX) VPIX=-DVPIX; shift;; + novpix|NOVPIX) VPIX=""; shift;; + merge386|MERGE386) MERGE386=-DMERGE386; shift;; + nomerge386|NOMERGE386) MERGE386=""; shift;; + *) break;; + esac + done + DFLGS="$VPIX $MERGE386"; export DFLGS + export BTYPE ATYPE + # + # for now, just always make libcmd.a + # + if [ "$ldflags" ] + then CMD="$CMD LDFLAGS='$ldflags'" + fi + echo "$CMD" + if eval $CMD + then ret=0 + else ret=1 + fi + if [ $ret -ne 0 ] + then echo "**** Build of libcmd failed ($MAKE)" + fi + cd .. +fi + +arguments=$* +for arg in $arguments +do( +# Local version takes precedence over official version + if [ -f $LSRC/cmd/$arg -o -d $LSRC/cmd/$arg ] + then source=$LSRC + else source=$SRC + fi + cd ${source}/cmd + OBJ= + B=`basename $arg` +# Is this an aberrant file with its makefile in the $SRC/cmd directory? +# If so then skip this file since it will handled by the makefile +##(not in subdir) case $B in +##(not in subdir) *.c | *.s) +##(not in subdir) b=`basename $B ".[cs]"` +##(not in subdir) if [ -f $b.mk ] +##(not in subdir) then continue +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) esac + echo "\n======== $B" + BASE=$B +# if not a directory then remove suffix and determine the file type +##(not in subdir) if [ ! -d $B ] +##(not in subdir) then BASE=`echo $B | sed -e 's/\(.*\)\..*/\1/'` +##(not in subdir) if [ -f ${BASE}.mk -o -f $LSRC/cmd/${BASE}.mk ] +##(not in subdir) then B=${BASE}.mk +##(not in subdir) elif [ -f ${BASE}.rc -o -f $LSRC/cmd/${BASE}.rc ] +##(not in subdir) then B=${BASE}.rc +##(not in subdir) elif [ -f ${BASE}.c -o -f $LSRC/cmd/${BASE}.c ] +##(not in subdir) then B=${BASE}.c +##(not in subdir) elif [ -f ${BASE}.sh -o -f $LSRC/cmd/${BASE}.sh ] +##(not in subdir) then B=${BASE}.sh +##(not in subdir) elif [ -f ${BASE}.y -o -f $LSRC/cmd/${BASE}.y ] +##(not in subdir) then B=${BASE}.y +##(not in subdir) elif [ -f ${BASE}.l -o -f $LSRC/cmd/${BASE}.l ] +##(not in subdir) then B=${BASE}.l +##(not in subdir) elif [ -f ${BASE}.s -o -f $LSRC/cmd/${BASE}.s ] +##(not in subdir) then B=${BASE}.s +##(not in subdir) elif [ -f ${BASE}.o -o -f $LSRC/cmd/${BASE}.o ] +##(not in subdir) then B=${BASE}.o +##(not in subdir) fi +##(not in subdir) fi +# + if [ "$source" = "$SRC" -a -f $LSRC/cmd/$B ] + then source=$LSRC + cd ${source}/cmd + fi +# + if [ -r $LDFILE ] + then ldflags=`grep "^${BASE} " $LDFILE | sed -e "s/${BASE} //"` + if [ -z "$fflag" ] + then ldflags=`echo $ldflags | sed -e 's/-f//'` + fi + if [ "$sflag" = "-s" ] + then ldflags=`echo $ldflags | sed -e 's/-i//'` + else if [ `expr x$ldflags : '.*-i'` != 0 ] + then ldflags=`echo $ldflags | sed -e 's/-n//'` + fi + fi + else ldflags="" + fi +# +# Now build the command according to its file type +##(not in subdir) case $B in +##(not in subdir) +##(not in subdir) *.mk) +##(not in subdir) CMD="$MAKE -b -f ${BASE}.mk LDLIBS='$ldlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" install" +##(not in subdir) if [ "$ldflags" ] +##(not in subdir) then CMD="$CMD LDFLAGS='$ldflags'" +##(not in subdir) fi +##(not in subdir) echo "$CMD" +##(not in subdir) if eval $CMD +##(not in subdir) then ret=0 +##(not in subdir) else ret=1 +##(not in subdir) fi +##(not in subdir) CMD="$MAKE -b -f ${BASE}.mk LDLIBS='$ldlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" $yaccrm clobber" +##(not in subdir) test "$CLOBBER" != "OFF" && ( echo "$CMD" ; eval $CMD ) +##(not in subdir) if [ $ret -ne 0 ] +##(not in subdir) then echo "**** Build of ${BASE} failed ($MAKE)" +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.rc) sh -x $B +##(not in subdir) if [ $? -ne 0 ] +##(not in subdir) then echo "**** Build of $B failed (sh)" +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.c) +##(not in subdir) CMD="$CC -O $ldflags -s -o ./${BASE} $B $lib" +##(not in subdir) echo "$CMD" +##(not in subdir) if eval $CMD +##(not in subdir) then OBJ=${BASE} +##(not in subdir) else echo "**** Build of ${BASE} failed ($CC)" +##(not in subdir) rm -f ./${BASE}.o ./${BASE} +##(not in subdir) fi +##(not in subdir) lib= +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.sh) echo "cp $B ${BASE}" +##(not in subdir) if cp $B ${BASE} +##(not in subdir) then OBJ=${BASE} +##(not in subdir) else echo "**** Build of ${BASE} failed (cp)" +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.s) CMD="$CC -s -o ./${BASE} $B" +##(not in subdir) echo "$CMD" +##(not in subdir) if eval $CMD +##(not in subdir) then OBJ=${BASE} +##(not in subdir) else echo "**** Build of ${BASE} failed ($CC)" +##(not in subdir) rm -f ./${BASE}.o ./{BASE} +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.y) if [ "$sflag" != "-s" ] +##(not in subdir) then echo "yacc $B" +##(not in subdir) if yacc $B +##(not in subdir) then echo "mv y.tab.c ${BASE}.c" +##(not in subdir) mv y.tab.c ${BASE}.c +##(not in subdir) lib=-ly places=$places LDFILE=$LDFILE sh $SRC/:mkcmd $sflag $fflag ${BASE}.c +##(not in subdir) else echo "**** Build of ${BASE} failed (yacc)" +##(not in subdir) fi +##(not in subdir) rm -f ${BASE}.c +##(not in subdir) else +##(not in subdir) mv ${BASE}.x ${BASE}.c +##(not in subdir) lib=-ly places=$places LDFILE=$LDFILE sh $SRC/:mkcmd $sflag $fflag ${BASE}.c +##(not in subdir) mv ${BASE}.c ${BASE}.x +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.l) if [ "$sflag" != "-s" ] +##(not in subdir) then echo "lex $B" +##(not in subdir) if lex $B +##(not in subdir) then echo "mv lex.yy.c ${BASE}.c" +##(not in subdir) mv lex.yy.c ${BASE}.c +##(not in subdir) lib=-ll places=$places LDFILE=$LDFILE sh $SRC/:mkcmd $sflag ${BASE}.c +##(not in subdir) else echo "**** Build of ${BASE} failed (lex)" +##(not in subdir) fi +##(not in subdir) rm -f ${BASE}.c +##(not in subdir) else +##(not in subdir) mv ${BASE}.x ${BASE}.c +##(not in subdir) lib=-ll places=$places LDFILE=$LDFILE sh $SRC/:mkcmd $sflag ${BASE}.c +##(not in subdir) mv ${BASE}.c ${BASE}.x +##(not in subdir) fi +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.x) continue +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *.o) rm -f $B +##(not in subdir) ;; +##(not in subdir) +##(not in subdir) *) +if [ -d $B ] +then echo "cd $B" + cd $B + if [ -f $B.mk ] + then + if i386 + then CMD="$MAKE -b -f $B.mk ${BTYPE} ${ATYPE} ARGS=\"${ARGS}\" SYMLINK='$symlink' SHLIBS='$shlibs' NOSHLIBS='$noshlibs' PERFLIBS='$perflibs' ROOTLIBS='$rootlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" DFLGS=\"${DFLGS}\" install" + else + CMD="$MAKE -b -f $B.mk ARGS=\"${ARGS}\" SYMLINK='$symlink' SHLIBS='$shlibs' NOSHLIBS='$noshlibs' PERFLIBS='$perflibs' ROOTLIBS='$rootlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" install" + fi + + if [ "$ldflags" ] + then CMD="$CMD LDFLAGS='$ldflags'" + fi + echo "$CMD" + if eval $CMD + then ret=0 + else ret=1 + fi + + if i386 + then + CMD="$MAKE -b -f $B.mk ${BTYPE} ${ATYPE} SYMLINK='$symlink' SHLIBS='$shlibs' NOSHLIBS='$noshlibs' PERFLIBS='$perflibs' ROOTLIBS='$rootlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" DFLGS=\"${DFLGS}\" $yaccrm clobber" + echo "$CMD" + eval "$CMD" + else + CMD="$MAKE -b -f $B.mk SYMLINK='$symlink' SHLIBS='$shlibs' NOSHLIBS='$noshlibs' PERFLIBS='$perflibs' ROOTLIBS='$rootlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" $yaccrm clobber" + test "$CLOBBER" != "OFF" && + (echo "$CMD" ; eval $CMD) + fi + + if [ $ret -ne 0 ] + then echo "**** Build of ${BASE} failed ($MAKE)" + fi +##(not in subdir) elif [ -f $B.rc ] +##(not in subdir) then sh -x $B.rc + else echo "**** Build of $B failed (no makefile found in directory)" + fi + rm -f *.o +else echo ":mkcmd: *** no directory found for $B under $source" +fi + +##(not in subdir) esac +# +# If build was successful install new object in appropriate bin +##(not in subdir) if [ -n "$OBJ" ] +##(not in subdir) then +##(not in subdir) if [ "$source" = "$LSRC" ] +##(not in subdir) then echo "install -n $LBIN $OBJ" +##(not in subdir) install -n $LBIN $OBJ +##(not in subdir) else echo "install -n $UBIN $OBJ" +##(not in subdir) install -n $UBIN $OBJ +##(not in subdir) fi +##(not in subdir) rm -f $OBJ +##(not in subdir) fi +);done diff --git a/:mkhead b/:mkhead new file mode 100644 index 0000000..d3adb80 --- /dev/null +++ b/:mkhead @@ -0,0 +1,79 @@ +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" + +#ident "@(#)mk::mkhead 1.20.1.1" +# +# Install UNIX System header files +# +TARGDIR=$ROOT/usr/include +SRCDIR=${SRC:-$ROOT/usr/src}/head +TMPFILE=/tmp/mkhead$$ + +trap "rm -f $TMPFILE ; exit 1" 1 2 3 15 +# +# Determine files to be processed +if [ $# -gt 0 ] +then + (cd $SRCDIR; ls $* | sed -e '/sys\.[^ ]*/d' > $TMPFILE) +else + (cd $SRCDIR; find . -type f -print | sed -e '/sys\.[^ ]*/d' > $TMPFILE) +fi +# + +echo "\nInstalling $SRCDIR into $TARGDIR:" +if [ ! -d $TARGDIR ] +then + rm -f $TARGDIR + mkdir $TARGDIR +fi +echo "./sys.s" +cat $TMPFILE | pr -ta5 +echo "\nCurses.h, unctrl.h, and term.h are installed by libcurses\n" + +# +# Copy system-dependent sysent table file +if vax +then + cp $SRCDIR/sys.vax $TARGDIR/sys.s +elif pdp11 +then + cp $SRCDIR/sys.pdp $TARGDIR/sys.s +elif i286 +then + cp $SRCDIR/sys.i286 $TARGDIR/sys.s +elif i386 +then + cp $SRCDIR/sys.i386 $TARGDIR/sys.s +elif u3b5 || u3b2 +then + cp $SRCDIR/sys.u3b5 $TARGDIR/sys.s +fi +chmod 664 $TARGDIR/sys.s +if [ "$ROOT" = "" ] +then + chgrp bin $TARGDIR/sys.s + chown bin $TARGDIR/sys.s +fi + +# +# Install requested files +(cd $SRCDIR; cat $TMPFILE | cpio -pdu $TARGDIR + +# Set file permissions +cd $TARGDIR; chmod 664 `cat $TMPFILE` +if [ "$ROOT" = "" ] +then + chgrp bin `cat $TMPFILE` + chown bin `cat $TMPFILE` +fi ) +rm -f $TMPFILE +exit 0 diff --git a/:mklib b/:mklib new file mode 100644 index 0000000..d5f379a --- /dev/null +++ b/:mklib @@ -0,0 +1,94 @@ +cat << END_COPYRIGHT + + Copyright (c) 1984, 1986, 1987, 1988 AT&T + All Rights Reserved + + THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T + The copyright notice above does not evidence any actual or + intended publication of such source code. + + + +END_COPYRIGHT + +#ident "@(#)mk::mklib 1.8.3.1" +# +# Build UNIX System libraries +# For each directory build the library by invoking its +# makefile (.mk). +# + +trap "exit 1" 1 2 3 15 + +# Need these directories for creation of libcurses +if [ "$ROOT" ] && echo $* | grep libcurses >/dev/null +then + for dir in usr/tmp usr/bin etc + do + if [ ! -d $ROOT/$dir ] ; then + rm -f $ROOT/$dir + mkdir $ROOT/$dir + fi + done +fi + +# Check that target directories exist in case build libraries don't. +# Paths should be independent of the cross-environment. +for dir in /lib /usr/lib /usr/lib/libp usr/include shlib +do + if [ ! -d $ROOT/$dir ] + then rm -f $ROOT/$dir + mkdir $ROOT/$dir + fi +done + +# check out the BUS type. +BTYPE="BUS=AT386" +ATYPE="ARCH=AT386" +VPIX=-DVPIX; +MERGE386=-DMERGE386; +while [ $# -ge 1 ] +do +case "$1" in +BUS*) BTYPE="$1"; shift;; +ARC*) ATYPE="$1"; shift;; +vpix|VPIX) VPIX=-DVPIX; shift;; +novpix|NOVPIX) VPIX=""; shift;; +merge386|MERGE386) MERGE386=-DMERGE386; shift;; +nomerge386|NOMERGE386) MERGE386=""; shift;; +*) break;; +esac +done +DFLGS="$VPIX $MERGE386"; export DFLGS +export BTYPE ATYPE + +MAKE=${MAKE:-make} +SRCDIR=${SRC:-$ROOT/usr/src}/lib +cd $SRCDIR +# +for ARG in $* +do + LIB=`basename $ARG` + if [ -d $LIB ] + then ( + echo "======== $LIB" + cd $LIB + if [ -f $LIB.mk ] + then + $MAKE -b -f $LIB.mk ${BTYPE} ${ATYPE} DFLGS="${DFLGS}" install \ + I="install -i -n $ROOT/lib $ROOT/usr/lib" + if [ $? -ne 0 ] ; then + echo ":mklib: *** $MAKE failed using $LIB.mk" + fi + $MAKE -b -f $LIB.mk ${BTYPE} ${ATYPE} DFLGS="${DFLGS}" clobber + else + echo ":mklib: *** no $LIB.mk file in $SRCDIR/$LIB" + fi + ) else + if [ $LIB != lib.mk -a $LIB != libmk.template -a $LIB != libmk.templa ] + then + echo ":mklib: *** no directory found for $LIB under $SRCDIR" + fi + fi +done +exit 0 diff --git a/:mkoam b/:mkoam new file mode 100644 index 0000000..fcb7cfe --- /dev/null +++ b/:mkoam @@ -0,0 +1,212 @@ +#ident "@(#)mk::mkoam 1.1.4.1" + +# +# Similar to :mk.addon but deals w/ OA&M style packages +# + +echo "" +echo "" +echo " Copyright (c) 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" +echo ${0}: started at `date` + +SLBASE=${ROOT} +export SLBASE + +# If we are in a cross compilation environment then use cross compiler +if [ "$ROOT" != "" ] +then + if u3b2 || u3b5 + then + AS=m32as export AS + CC=m32cc export CC + LD=m32ld export LD + fi + if i386 + then + AS=i386as export AS + CC=i386cc export CC + LD=i386ld export LD + fi + echo "You are in a cross compilation environment." + PATH=$ROOT/xenv:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc:$PATH + echo ROOT="${ROOT}" +else + AS=as export AS + CC=cc export CC + LD=ld export LD +fi + +# +# Perform object stamping if MCS variable is set in shell env +# + +case "${MCS}" in + + mcs) + MCS=mcs export MCS + if i386 + then + TARGET=${TARGET:=i386} export TARGET + RELEASE=${RELEASE:=unk} export RELEASE + LOAD="${LOAD}" export LOAD + COMMENT="UNIX System V/386 Release 4.0 $LOAD" + export COMMENT + else + echo "The proper variables have not been set in ${0}." + echo "No mcs will be performed." + MCS="" + fi + echo "Comment sections will be modified using ${MCS}." + echo "The following string will replace the existing contents:" + echo "${COMMENT} " + break + ;; + + pstamp) + if i386 + then + PRODUCT=${PRODUCT:=386unix} export PRODUCT + TARGET=${TARGET:=i386} export TARGET + RELEASE=${RELEASE:=unk} export RELEASE + LOAD="${LOAD}" export LOAD + if [ -z "${LOAD}" ] + then + echo "The LOAD variable was not set." + echo "No pstamping will be performed." + MCS="" + else + LOAD=`echo ${LOAD} | tr "[a-z]" "[A-Z]"` + COMMENT="-p ${PRODUCT} -t ${TARGET} -r ${RELEASE} -l ${LOAD}" + export COMMENT + echo "PRODUCT=${PRODUCT}" + echo "RELEASE=${RELEASE}" + echo "TARGET=${TARGET}" + echo "LOAD=${LOAD}" + echo "Objects will be pstamped." + fi + else + echo "The proper variables have not been set in ${0}." + echo "No pstamping will be performed." + MCS="" + fi + break + ;; + + *) + echo "Null or unknown MCS variable passed to ${0}." + echo "Object comment sections will remain unchanged." + break + ;; +esac + + +# Insure that only one machine type is valid +# Note: the redirection is needed to handle the possibility +# of a nonexistent file in the $MACH machine list + +MACH="vax pdp11 u3b2 u3b u3b5 i286 i386" +(truecnt=0 +for mach in $MACH +do + `$mach` + if [ $? -eq 0 ] + then + truecnt=`expr $truecnt + 1` + fi +done +if [ $truecnt -ne 1 ] +then + echo ":${0}: **** Only one of the following machine types can" + echo " be true: $MACH" + exit 1 +fi ) 2>/dev/null + +# +# check out the BUS type +while [ $# -ge 1 ] +do +case "$1" in +BUS*) shift;; +ARC*) shift;; +*) break;; +esac +done +BUS=${BUS:-AT386}; export BUS +ARCH=${ARCH:-AT386}; export ARCH +BTYPE="BUS=$BUS"; export BTYPE +ATYPE="ARCH=$ARCH"; export ATYPE + +for dir in add-on pkg +do +cd $ROOT/usr/src/$dir + +if [ $# = 0 ] +then + ADDONS="*" +else + ADDONS="$*" +fi + +for addon in ${ADDONS} +do + if [ -f ${addon}/prototype ] + then + cd ${addon} + echo "======== ${addon}" + + if [ ! -z "${MCS}" ] + then + grep "^![ ]include" prototype > /dev/null 2>&1 + if [ "$?" = "0" ] + then cat prototype > t.prototype + grep "^![ ]include" prototype | awk '{print $3}' | while read i + do cat $i >> t.prototype + done + else cat prototype > t.prototype + fi + + grep "^!" t.prototype | cut -c2- | grep '=' | + ( + while read i; do eval $i; done + bfile=`grep "^[fv][ ]" t.prototype | awk '{print $3}' | cut -f2- -d=` + for file in $bfile `grep "^[i][ ]" t.prototype | awk '{print $2}' | cut -f2- -d=` + do + file=`eval echo $file` + if [ ! -f $ROOT/$file ] + then file=usr/src/$dir/$addon/$file + fi + if [ "${MCS}" = "mcs" ] + then + echo mcs -d -a "@(#)${COMMENT} ${addon}:${file}" ${ROOT}/${file} + mcs -d -a "@(#)${COMMENT} ${addon}:${file}" ${ROOT}/${file} > /dev/null 2>&1 + if ` file ${ROOT}/${file} | grep "archive" >/dev/null 2>&1 ` + then + AR=${AR:=ar} export AR + echo "${AR} ts ${ROOT}/${file} > /dev/null 2>&1" + ${AR} ts ${ROOT}/${file} > /dev/null 2>&1 + fi + fi + if [ "${MCS}" = "pstamp" ] + then + echo pstamp ${COMMENT} ${ROOT}/${file} + pstamp ${COMMENT} ${ROOT}/${file} + fi + done + ) + rm -f t.prototype + fi + cd .. + fi +done + +done + +echo ${0}: done at `date` diff --git a/:mksyshead b/:mksyshead new file mode 100644 index 0000000..9916392 --- /dev/null +++ b/:mksyshead @@ -0,0 +1,71 @@ +#ident "@(#)mk::mksyshead 1.25.1.1" +# +# Install UNIX System 'sys' header files +# +SRCDIR=${SRC:-$ROOT/usr/src}/uts +TARGDIR=$ROOT/usr/include +SUBDIRS="sys vm fs net netinet nfs rpc des klm" +if [ ! -d $TARGDIR ] +then + mkdir $TARGDIR +fi + +trap "cd $TARGDIR; rm -fr $SUBDIRS ; exit 1" 1 2 3 15 +if vax +then + MACH=vax +elif i286 +then + MACH=i286 +elif i386 +then + MACH=i386 +elif pdp11 +then + MACH=pdp11 +elif u3b +then + MACH=3b +elif u3b2 +then + MACH=3b2 +elif u3b5 +then + MACH=3b5 +fi +# +for DIR in $SUBDIRS +do + if [ -d $SRCDIR/$MACH/$DIR ] + then ( + cd $SRCDIR/$MACH + echo "Installing $SRCDIR/$MACH/$DIR into $TARGDIR/$DIR:" + find $DIR -type f -name "*.h" -print | cpio -pduv $TARGDIR + + ) fi +done + +# +# Copy system-dependent sysent table file +echo "$TARGDIR/sys/sys.s" +[ -d $TARGDIR/sys ] || mkdir $TARGDIR/sys +if u3b5 || u3b2 +then + cp $SRCDIR/${MACH}/sys/sys.u3b5 $TARGDIR/sys/sys.s +else + cp $SRCDIR/${MACH}/sys/sys.${MACH} $TARGDIR/sys/sys.s +fi + +# Set file and directory permissions +# Arg list too long for chmod 755 * +cd $TARGDIR +find $SUBDIRS -type d -print | xargs chmod 755 +find $SUBDIRS -type f -print | xargs chmod 664 + +# If native build then set owner and group +if [ "$ROOT" = "" ] +then + find $SUBDIRS -print | xargs chgrp bin + find $SUBDIRS -print | xargs chown bin +fi +exit 0 diff --git a/:mkucb b/:mkucb new file mode 100644 index 0000000..d3064da --- /dev/null +++ b/:mkucb @@ -0,0 +1,55 @@ +#ident "@(#)mk::mkucb 1.1.4.1" +# +# Shell script for rebuilding the UNIX System Compatibility Package +# +trap "exit 1" 1 2 3 15 +if [ "$ROOT" = "" ] +then + PATH=/usr/ccs/bin:/sbin:/usr/sbin:/usr/bin:/etc ; export PATH +else + PATH=$ROOT/xenv:/usr/ccs/bin:/sbin:/usr/sbin:/usr/bin:/etc:$PATH; export PATH +fi + +UID_NAME=`id|sed 's/[()]/ /gp'|awk '{print $2}'` +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE + +# Check for the existance of target directories +test -d ${ROOT:-"/"} || mkdir -p $ROOT +cat -s ucb.dirs | # print contents of the target directory list +egrep -v "^$|^#" | # get rid of blank lines and comments +while read TARGETDIR MODE OWNER GROUP +do + if [ ! -d ${ROOT}/$TARGETDIR ] + then + mkdir ${ROOT}/$TARGETDIR + if [ ! -d ${ROOT}/$TARGETDIR ] + then + echo "$0: stop: make of directory ${ROOT}/$TARGETDIR failed" + exit 1 + fi + + fi + if [ "$UID_NAME" = "root" ] + then + if [ ! -z "$MODE" -a "$MODE" != "-" ] + then + chmod $MODE ${ROOT}/$TARGETDIR + fi + if [ ! -z "$OWNER" -a "$OWNER" != "-" ] + then + chown $OWNER ${ROOT}/$TARGETDIR + fi + if [ ! -z "$GROUP" -a "$GROUP" != "-" ] + then + chgrp $GROUP ${ROOT}/$TARGETDIR + fi + fi +done + +# install /usr/ucbinclude and /usr/ucbinclude/sys header files +sh ./:mkucbhead +# build and install the Compatibility Package library +sh ./:mkucblib \* +# build all the Compatibility Package commands +sh ./:mkucbcmd $* \* +exit 0 diff --git a/:mkucbcmd b/:mkucbcmd new file mode 100644 index 0000000..ac24020 --- /dev/null +++ b/:mkucbcmd @@ -0,0 +1,188 @@ +#ident "@(#)mk::mkucbcmd 1.1.4.1" +# + +if i386 +then +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo "" +echo "" +fi +echo $0 started at `date` +MAKE=${MAKE:-make} +CLOBBER=${CLOBBER:-"ON"} +# If we are in a cross compilation environment then use cross compiler +if [ "$ROOT" != "" ] +then + if u3b2 || u3b15 + then + AS=m32as export AS + CC=m32cc export CC + LD=m32ld export LD + fi + if i386 + then + AS=i386as export AS + CC=i386cc export CC + LD=i386ld export LD + fi +else + AS=as export AS + CC=cc export CC + LD=ld export LD +fi +LORDER=${PFX}lorder +TSORT=${PFX}tsort +export LORDER TSORT +# Insure that only one machine type is valid +# Note: the redirection is needed to handle the possibility +# of a nonexistent file in the $MACH machine list +MACH="vax pdp11 u3b2 u3b u3b15 i386" + +if [ ! -d $ROOT/usr/ucb ] ; then mkdir $ROOT/usr/ucb ; fi + +(truecnt=0 +for mach in $MACH +do + `$mach` + if [ $? -eq 0 ] + then + truecnt=`expr $truecnt + 1` + fi +done +if [ $truecnt -ne 1 ] +then + echo ":mkcmd: **** Only one of the following machine types can" + echo " be true: $MACH" + exit 1 +fi ) 2>/dev/null +# +places=${places-$ROOT/etc/places} +if [ -r $places ] +then + . $places +else + SRC=${SRC-$ROOT/usr/src} + LSRC=${LSRC-$ROOT/usr/lsrc} + BIN=${BIN-$ROOT/bin} + UBIN=${UBIN-$ROOT/usr/bin} + LBIN=${LBIN-$ROOT/usr/lbin} +fi +LDFILE=${LDFILE-${SRC}/ldflags} +# Initialize default flag values: +# fflag - controls the FFLAG varible. It is set to either null +# (use hardware floating point) or '-f' (use software +# simulation floating point). +# sflag - shared text, turns off the -i and -n loader options. +# Saves the intermediate .c file from a yacc or lex in +# .x for later :mkcmd runs. +# ldlibs - shared library flag. It is either "-lnsl_s" (build w/the +# shared libnsl_s.a) or "-lc_s -lnsl_s" (build w/both +# shared libc_s.a and libnsl_s.a). Default is both. +# iflag - seperate I&D space. It is either set to '-i' (when building +# certain commands on a 16-bit machine (e.g. PDP11/70) +# or null (for all other cases). +# symlink -variable to pass symbolic links to makefiles +fflag= +sflag= +iflag= +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE +if [ x$CCSTYPE = xCOFF ] +then + ldlibs=${LDLIBS:-"-lc_s"} +else + ldlibs=${LDLIBS:-"-dy"} +fi +ldflags= +_SHORARCH_="-dn" export _SHORARCH_ +symlink=${SYMLINK:-"ln -s"} +for opt in $* +do + case $opt in + + -f) fflag="-f" + ;; + + -s) sflag=-s + yaccrm="YACCRM=:" + iflag= + ;; + + -*) echo ":mkcmd; **** unknown option '$opt' - ignored" + ;; + + *) break + ;; + esac + shift +done +# +# Process remaining arguments as source that needs to be built. +# The three interesting variables are: +# B - basename of each argument +# BASE - basename of each option with its dot suffix removed +# OBJ - file to be installed if the build is successful +# +cd $SRC/ucbcmd +arguments=$* +for arg in $arguments +do( + OBJ= + B=`basename $arg` +# if not a directory then remove suffix and determine the file type + if [ "$source" = "$SRC" -a -f $LSRC/ucbcmd/$B ] + then source=$LSRC + cd ${source}/ucbcmd + fi +# + if [ -r $LDFILE ] + then ldflags=`grep "^${BASE} " $LDFILE | sed -e "s/${BASE} //"` + if [ -z "$fflag" ] + then ldflags=`echo $ldflags | sed -e 's/-f//'` + fi + if [ "$sflag" = "-s" ] + then ldflags=`echo $ldflags | sed -e 's/-i//'` + else if [ `expr x$ldflags : '.*-i'` != 0 ] + then ldflags=`echo $ldflags | sed -e 's/-n//'` + fi + fi + else ldflags="" + fi +# +# Now build the command +BASE=$B +if [ -d $B ] +then echo "cd $B" + cd $B + if [ -f $B.mk ] + then CMD="$MAKE -b -f $B.mk ARGS=\"${ARGS}\" SYMLINK='$symlink' LDLIBS='$ldlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" install" + if [ "$ldflags" ] + then CMD="$CMD LDFLAGS='$ldflags'" + fi + echo "$CMD" + if eval $CMD + then ret=0 + else ret=1 + fi + CMD="$MAKE -b -f $B.mk SYMLINK='$symlink' LDLIBS='$ldlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" $yaccrm clobber" + test "$CLOBBER" != "OFF" && + (echo "$CMD" ; eval $CMD) + if [ $ret -ne 0 ] + then echo "**** Build of ${BASE} failed ($MAKE)" + fi + else echo "**** Build of $B failed (no makefile found in directory)" + fi + rm -f *.o +else echo ":mkcmd: *** no directory found for $B under $source" +fi + +# +# If build was successful install new object in appropriate bin +);done diff --git a/:mkucbhead b/:mkucbhead new file mode 100644 index 0000000..0cb601b --- /dev/null +++ b/:mkucbhead @@ -0,0 +1,32 @@ +#ident "@(#)mk::mkucbhead 1.1.2.1" +# +# Install UNIX System Compatibility Package header files +# +SRCDIR=${SRC:-$ROOT/usr/src}/ucbhead +TARGDIR=$ROOT/usr/ucbinclude +TMPFILE=/tmp/mkucbhead$$ + +if [ ! -d $ROOT/usr/ucbinclude ] ; then mkdir $ROOT/usr/ucbinclude ; fi + +trap "rm -f $TMPFILE ; exit 1" 1 2 3 15 +# +# Determine files to be processed +if [ $# -gt 0 ] +then + (cd $SRCDIR; ls $* | sed -e 's/sys\.[^ ]*//g' > $TMPFILE) +else + (cd $SRCDIR; find . -type f -print | sed -e '/sys\.[^ ]*/d' > $TMPFILE) +fi +# +echo "\nInstalling $SRCDIR into $TARGDIR:" +cat $TMPFILE | pr -ta5 +(cd $SRCDIR; cat $TMPFILE | cpio -pdu $TARGDIR +# Set file permissions +cd $TARGDIR; chmod 664 `cat $TMPFILE` +if [ "$ROOT" = "" ] +then + chgrp bin `cat $TMPFILE` + chown bin `cat $TMPFILE` +fi ) +rm -f $TMPFILE +exit 0 diff --git a/:mkucblib b/:mkucblib new file mode 100644 index 0000000..00d0d55 --- /dev/null +++ b/:mkucblib @@ -0,0 +1,38 @@ +#ident "@(#)mk::mkucblib 1.1.2.1" +# +# Build Compatibility Package libraries +# For each directory build the library by invoking its +# makefile (.mk). +# +trap "exit 1" 1 2 3 15 +MAKE=${MAKE:-make} +SRCDIR=${SRC:-$ROOT/usr/src}/ucblib +CLOBBER=${CLOBBER:-"ON"} + +if [ ! -d $ROOT/usr/ucblib ] ; then mkdir $ROOT/usr/ucblib ; fi + +cd $SRCDIR +# +for ARG in $* +do + LIB=`basename $ARG` + if [ -d $LIB ] + then ( + echo "======== $LIB" + cd $LIB + if [ -f $LIB.mk ] + then + $MAKE -b -f $LIB.mk ROOT=$ROOT install I="install -i -n $ROOT/lib $ROOT/usr/lib" + if [ $? -ne 0 ] + then + echo ":mklib: *** $MAKE failed using $LIB.mk" + fi + test "$CLOBBER" != "OFF" && $MAKE -b -f $LIB.mk clobber + else + echo ":mklib: *** no $LIB.mk file in $SRCDIR/$LIB" + fi + ) else + echo ":mklib: *** no directory found for $LIB under $SRCDIR" + fi +done +exit 0 diff --git a/:mkuts b/:mkuts new file mode 100644 index 0000000..864c9c5 --- /dev/null +++ b/:mkuts @@ -0,0 +1,384 @@ +echo "" +echo "" +echo " Copyright (c) 1984, 1986, 1987, 1988 AT&T" +echo " All Rights Reserved" +echo "" +echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T" +echo " The copyright notice above does not evidence any actual or" +echo " intended publication of such source code." +echo "" +echo " Copyright (c) 1987, 1988 Microsoft Corporation" +echo " All Rights Reserved" +echo "" +echo " This Module contains Proprietary Information of Microsoft" +echo " Corporation and should be treated as Confidential." +echo "" +echo "" +echo "" + +#ident "@(#)mk::mkuts 1.15.1.4" + +# +# Configure and make the UNIX Operating System with various devices +# + +# Determine the CCSTYPE being used +${PFX}cc -V 2>&1 | grep 5.0 > /dev/null +if [ $? -eq 0 ] +then + CCSTYPE=ELF +else + CCSTYPE=COFF +fi +export CCSTYPE +echo +echo ====================== CCSTYPE is $CCSTYPE ========================= +echo + +SHELL=/bin/sh +REL= +VER= +export SHELL REL VER +echo $0: started at `date` +trap "exit 1" 1 2 3 15 +MAKE=${MAKE:-make} +SRCDIR=${SRC:-$ROOT/usr/src}/uts +if vax +then +# configure an OS with the general disk/general tape (gdgt) and the +# general disk/TS11 tape drive (gdts) units. +# Note that the general disk/TU16 tape with TM02 controller (gdht) +# is not configured or tested here. + cd $SRCDIR/vax/cf + for i in gdgt gdts + do + echo "config $i \n$MAKE install VER=$i" + config $i + $MAKE install VER=$i + if [ $? -ne 0 ] + then + echo ":mkuts: *** $MAKE of $i failed" + fi + done +elif pdp11 +then +# configure an OS with the general disk and rp disks + cd $SRCDIR/pdp11/cf + for i in gdht gdtm rpht rptm + do + echo "config $i \n$MAKE install VER=$i" + config $i + $MAKE install VER=$i + if [ $? -ne 0 ] + then + echo ":mkuts: *** $MAKE of $i failed" + fi + done +elif u3b +then +# configure an OS with the Kennedy tape drive (un32) and the +# magnetic tape controller configured into DMA channels 11 and 12. + cd $SRCDIR/3b/cf + for i in un32 mtc11 mtc12 + do + echo "$MAKE clobber" + $MAKE clobber + echo "config /etc/system.$i" + config $ROOT/etc/system.$i + if [ "$ROOT" != "" ] + then + $MAKE -f ../makefile ENV="VER=$i CH=# SGS=3bs" + else + $MAKE VER=$i + fi + if [ $? -eq 0 ] + then + mv ../unix$i $ROOT/unix.$i + else + echo ":mkuts: *** $MAKE of unix.$i failed" + fi + done +elif u3b2 +then +# + cd $SRCDIR/3b2 + echo "$MAKE -f unix.mk install SYS=unix" + $MAKE -f unix.mk install SYS=unix + if [ $? -ne 0 ] + then + echo ":mkuts: *** $MAKE of unix failed" + fi +elif u3b5 +then +# + cd $SRCDIR/3b5 + echo "$MAKE -f unix.mk install SYS=unix VER=2" + $MAKE -f unix.mk install SYS=unix VER=2 + if [ $? -ne 0 ] + then + echo ":mkuts: *** $MAKE of unix failed" + fi +elif i286 +then + # + # Make the Safari 5 core and driver modules for + # Installable Drivers and Tunable Parameters (ID/TP) + # + echo "ROOT is set to" $ROOT + unset C N + C=install + + if [ $# != 0 ] + then + + if [ $1 = "?" ] + then + echo + echo ":mkuts [SYS=s] [VER=v] [REL=r] [NODE=n] [MACH=m] [IM=W|F [DEN=HI|LO]]" + echo ":mkuts clean" + echo ":mkuts clobber" + echo + exit 0 + fi + + if [ $1 = clean ] + then echo "make clean" + C=clean + elif [ $1 = clobber ] + then echo "make clobber" + C=clobber + elif [ $1 = test ] + then echo "make test" + exit 0 + else + N=$@ + fi + fi + + if [ "$MACHINE" = "" ] + then + MACHINE=safari + fi + if [ "$MACHINE" != "safari" -a "$MACHINE" != "pcat" ] + then + Unknown Machine + exit 0 + fi + if [ "$C" = "install" ] + then + echo Building a $MACHINE kernel + + # + # make directories + # + + if [ ! -d $ROOT/etc ] + then mkdir $ROOT/etc + fi + if [ ! -d $ROOT/etc/conf ] + then mkdir $ROOT/etc/conf + fi + fi + + set -e + cd $ROOT/usr/src/uts/i286 + make -f unix.mk $C $N MACHINE=$MACHINE + +elif i386 +then +# Configure an OS for the 80386, either Multibus or ATbus(default). +# + ROOT=${ROOT:-`cd ../..;pwd`} + SRCDIR=${SRC:-$ROOT/usr/src}/uts + export ROOT + +# Put directories in object build tree. +# + if [ ! -d $ROOT/etc ] + then mkdir $ROOT/etc + fi + if [ ! -d $ROOT/etc/conf ] + then mkdir $ROOT/etc/conf + fi + if [ ! -d $ROOT/etc/conf/bin ] + then mkdir $ROOT/etc/conf/bin + fi + if [ ! -d $ROOT/etc/conf/cf.d ] + then mkdir $ROOT/etc/conf/cf.d + fi + if [ ! -d $ROOT/etc/conf/sdevice.d ] + then mkdir $ROOT/etc/conf/sdevice.d + fi + if [ ! -d $ROOT/etc/conf/pack.d ] + then mkdir $ROOT/etc/conf/pack.d + fi + if [ ! -d $ROOT/etc/conf/node.d ] + then mkdir $ROOT/etc/conf/node.d + fi + if [ ! -d $ROOT/etc/conf/rc.d ] + then mkdir $ROOT/etc/conf/rc.d + fi + if [ ! -d $ROOT/etc/conf/sd.d ] + then mkdir $ROOT/etc/conf/sd.d + fi + if [ ! -d $ROOT/etc/conf/init.d ] + then mkdir $ROOT/etc/conf/init.d + fi + if [ ! -d $ROOT/etc/conf/mfsys.d ] + then mkdir $ROOT/etc/conf/mfsys.d + fi + if [ ! -d $ROOT/etc/conf/sfsys.d ] + then mkdir $ROOT/etc/conf/sfsys.d + fi + + C= + NET= + NET2= + NET3= + VPIX= + MERGE386= + WEITEK='-DWEITEK' + BUS= + ARCH= + MORECPP= + NONETWORK= + while [ -n "$1" ] + do + case "$1" in + at386|AT386|at|AT) + BUS=AT386 + ARCH=AT386 + CONF=${CONF:-$ROOT/etc/conf} + ;; + # 380 chip support + at380|AT380) + BUS=AT386 + ARCH=AT386 + MORECPP="$MORECPP -DAT380" + ;; + # entries for multibus. + mb1|MB1) + BUS=MB1 + ARCH=MBUS + CONF=${CONF:-$ROOT/etc/conf} + ;; + mb2|MB2) + BUS=MB2 + ARCH=MBUS + CONF=${CONF:-$ROOT/etc/conf} + ;; + mb2at|MB2AT) + BUS=AT386 + ARCH=MB2AT + MORECPP="$MORECPP -DMB2AT" + ;; + MB2SA|mb2sa) + MORECPP="$MORECPP -DMB2SA" + ;; + eisa|EISA) + BUS=EISA + ARCH=AT386 + MORECPP="$MORECPP -DEISA" + ;; + mbus|MBUS) + MORECPP="$MORECPP -DMBUS" + ;; + i860) + MORECPP="$MORECPP -Di860" + ;; + BLTCONS) + BLTCONS="-DBLTCONS" + ;; + EVC) + EVC="-DEVC" + ;; + evga|EVGA) + EVGA="-DEVGA" + ;; + noevga|NOEVGA) + EVGA=" " + ;; + ev\-at|EV\-AT) + BUS=AT386 + ARCH=EV-AT + MORECPP="$MORECPP -DAT386" + ;; + # end multibus support + NOWEITEK|noweitek) + WEITEK='' + ;; + NOVPIX|novpix) + VPIX=" " + ;; + VPIX|vpix) + VPIX="-DVPIX" + ;; + NOMERGE386|nomerge386) + MERGE386=" " + ;; + MERGE386|merge386) + MERGE386="-DMERGE386" + ;; + enet|ENET|ethernet|ETHERNET|ether|ETHER|E-NET|e-net) + NET2=ENET + MORECPP="$MORECPP -DENET" + ;; + slan|SLAN|sln|SLN|starlan|STARLAN) + MORECPP="$MORECPP -DSTARLAN" + NET=STARLAN + ;; +# debug turns on ASSERTs (see sys/debug.h) for kernel logic checking + debug|DEBUG) + MORECPP="$MORECPP -DDEBUG=1" + ;; + msdebug|MSDEBUG) + MORECPP="$MORECPP -DMSDEBUGGER" + ;; + -c) shift + CONF=${1:?"-c flag requires an argument."} + ;; + nonet|NONET) + NONETWORK="nonet" + export NONETWORK + ;; + clean|clobber) + C=$1 + ;; + *) echo unknown argument $1: ignored + ;; + + esac + shift + done +# fill in default values, default is PC/AT, no debugger + BUS=${BUS:-AT386} + ARCH=${ARCH:-AT386} + CONF=${CONF:-$ROOT/etc/conf} + VPIX=${VPIX:--DVPIX} + MERGE386=${MERGE386:--DMERGE386} + EVGA=${EVGA:--DEVGA} + BLTCONS=${BLTCONS:--DBLTCONS} + #EVC=${EVC:--DEVC} + MORECPP="$MORECPP -D$BUS -D$ARCH $VPIX $WEITEK $MERGE386 $BLTCONS $EVGA $EVC" + export BUS CONF MORECPP ROOT SRCDIR C NET ARCH NONETWORK +# +case "$C" in +clobber|clean);; +*) +# Build the Installable Driver Commands with the current mkuts values +if [ -f $ROOT/usr/src/cmd/idcmd/idcmd.mk ] +then + ( cd $ROOT/usr/src/cmd/idcmd + echo "Building idcmd so that idmkunix and /unix are in sync" + make -f idcmd.mk "ROOT=$ROOT" "BUS=$BUS" "ARCH=$ARCH" "CONF=$CONF" "MORECPP=$MORECPP" "NET=$NET" "NET2=$NET2" "NET3=$NET3" install clobber + ) +fi ;; +esac +# removed WEITEK stuff for MBx (set appropriatly above) +# Go do it + cd $SRCDIR/i386 + make -f unix.mk $NONETWORK "ROOT=$ROOT" "BUS=$BUS" "ARCH=$ARCH" "CONF=$CONF" "MORECPP=$MORECPP" "NET=$NET" "NET2=$NET2" "NET3=$NET3" $C + +fi +echo $0: done at `date` +exit 0 diff --git a/:mkxcp b/:mkxcp new file mode 100644 index 0000000..c9bec1a --- /dev/null +++ b/:mkxcp @@ -0,0 +1,53 @@ +#ident "@(#)mk::mkxcp 1.1.2.1" +# +# Shell script for rebuilding the XENIX Compatibility Package +# +set -x +trap "exit 1" 1 2 3 15 +if [ "$ROOT" = "" ] +then + PATH=/usr/ccs/bin:/usr/bin:usr/sbin:/etc; export PATH +else + PATH=$ROOT/xenv:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc:$PATH; export PATH +fi + +UID_NAME=`id|sed 's/[()]/ /gp'|awk '{print $2}'` + +# Check for the existance of target directories +test -d ${ROOT:-"/"} || mkdir -p $ROOT +cat -s xcp.dirs | # print contents of the target directory list +egrep -v "^$|^#" | # get rid of blank lines and comments +while read TARGETDIR MODE OWNER GROUP +do + if [ ! -d ${ROOT}/$TARGETDIR ] + then + mkdir ${ROOT}/$TARGETDIR + if [ ! -d ${ROOT}/$TARGETDIR ] + then + echo "$0: stop: make of directory ${ROOT}/$TARGETDIR failed" + exit 1 + fi + + fi + if [ "$UID_NAME" = "root" ] + then + if [ ! -z "$MODE" -a "$MODE" != "-" ] + then + chmod $MODE ${ROOT}/$TARGETDIR + fi + if [ ! -z "$OWNER" -a "$OWNER" != "-" ] + then + chown $OWNER ${ROOT}/$TARGETDIR + fi + if [ ! -z "$GROUP" -a "$GROUP" != "-" ] + then + chgrp $GROUP ${ROOT}/$TARGETDIR + fi + fi +done + +# build and install the Compatibility Package library +./:mkxcplib \* +# build all the Compatibility Package commands +./:mkxcpcmd $* \* +exit 0 diff --git a/:mkxcpcmd b/:mkxcpcmd new file mode 100644 index 0000000..65a6b75 --- /dev/null +++ b/:mkxcpcmd @@ -0,0 +1,168 @@ +#ident "@(#)mk::mkxcpcmd 1.1.2.1" +# +MAKE=${MAKE:-make} +CLOBBER=${CLOBBER:-"ON"} +# If we are in a cross compilation environment then use cross compiler +if [ "$ROOT" != "" ] +then + if u3b2 || u3b15 + then + AS=m32as export AS + CC=m32cc export CC + LD=m32ld export LD + fi + if i386 + then + AS=i386as export AS + CC=i386cc export CC + LD=i386ld export LD + AR=i386ar export AR + fi + PATH=$ROOT/xenv:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc:$PATH +else + AS=as export AS + CC=cc export CC + LD=ld export LD +fi +# Insure that only one machine type is valid +# Note: the redirection is needed to handle the possibility +# of a nonexistent file in the $MACH machine list +MACH="vax pdp11 u3b2 u3b u3b15" +(truecnt=0 +for mach in $MACH +do + `$mach` + if [ $? -eq 0 ] + then + truecnt=`expr $truecnt + 1` + fi +done +if [ $truecnt -ne 1 ] +then + echo ":mkcmd: **** Only one of the following machine types can" + echo " be true: $MACH" + exit 1 +fi ) 2>/dev/null +# +places=${places-$ROOT/etc/places} +if [ -r $places ] +then + . $places +else + SRC=${SRC-$ROOT/usr/src} + LSRC=${LSRC-$ROOT/usr/lsrc} + BIN=${BIN-$ROOT/bin} + UBIN=${UBIN-$ROOT/usr/bin} + LBIN=${LBIN-$ROOT/usr/lbin} +fi +LDFILE=${LDFILE-${SRC}/ldflags} +# Initialize default flag values: +# fflag - controls the FFLAG varible. It is set to either null +# (use hardware floating point) or '-f' (use software +# simulation floating point). +# sflag - shared text, turns off the -i and -n loader options. +# Saves the intermediate .c file from a yacc or lex in +# .x for later :mkcmd runs. +# ldlibs - shared library flag. It is either "-lnsl_s" (build w/the +# shared libnsl_s.a) or "-lc_s -lnsl_s" (build w/both +# shared libc_s.a and libnsl_s.a). Default is both. +# iflag - seperate I&D space. It is either set to '-i' (when building +# certain commands on a 16-bit machine (e.g. PDP11/70) +# or null (for all other cases). +# symlink -variable to pass symbolic links to makefiles +fflag= +sflag= +iflag= +CCSTYPE=${CCSTYPE:-ELF}; export CCSTYPE +if [ x$CCSTYPE = xELF ] +then + ldlibs=${LDLIBS:-"-dy"} +else + ldlibs=${LDLIBS:-"-lc_s"} +fi +ldflags= +symlink=${SYMLINK:-"ln -s"} +for opt in $* +do + case $opt in + + -f) fflag="-f" + ;; + + -s) sflag=-s + yaccrm="YACCRM=:" + iflag= + ;; + + -*) echo ":mkcmd; **** unknown option '$opt' - ignored" + ;; + + *) break + ;; + esac + shift +done +# +# Process remaining arguments as source that needs to be built. +# The three interesting variables are: +# B - basename of each argument +# BASE - basename of each option with its dot suffix removed +# OBJ - file to be installed if the build is successful +# +cd $SRC/xcpcmd +arguments=$* +for arg in $arguments +do( + OBJ= + B=`basename $arg` +# if not a directory then remove suffix and determine the file type + if [ "$source" = "$SRC" -a -f $LSRC/xcpcmd/$B ] + then source=$LSRC + cd ${source}/xcpcmd + fi +# + if [ -r $LDFILE ] + then ldflags=`grep "^${BASE} " $LDFILE | sed -e "s/${BASE} //"` + if [ -z "$fflag" ] + then ldflags=`echo $ldflags | sed -e 's/-f//'` + fi + if [ "$sflag" = "-s" ] + then ldflags=`echo $ldflags | sed -e 's/-i//'` + else if [ `expr x$ldflags : '.*-i'` != 0 ] + then ldflags=`echo $ldflags | sed -e 's/-n//'` + fi + fi + else ldflags="" + fi +# +# Now build the command +BASE=$B +if [ -d $B ] +then echo "cd $B" + echo "\n======== $B" + cd $B + if [ -f $B.mk ] + then CMD="$MAKE -b -f $B.mk ARGS=\"${ARGS}\" SYMLINK='$symlink' LDLIBS='$ldlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" install" + if [ "$ldflags" ] + then CMD="$CMD LDFLAGS='$ldflags'" + fi + echo "$CMD" + if eval $CMD + then ret=0 + else ret=1 + fi + CMD="$MAKE -b -f $B.mk SYMLINK='$symlink' LDLIBS='$ldlibs' IFLAG=\"$iflag\" FFLAG=\"$fflag\" $yaccrm clobber" + test "$CLOBBER" != "OFF" && + (echo "$CMD" ; eval $CMD) + if [ $ret -ne 0 ] + then echo "**** Build of ${BASE} failed ($MAKE)" + fi + else echo "**** Build of $B failed (no makefile found in directory)" + fi + rm -f *.o +else echo ":mkcmd: *** no directory found for $B under $source" +fi + +# +# If build was successful install new object in appropriate bin +);done diff --git a/:mkxcplib b/:mkxcplib new file mode 100644 index 0000000..5dcdb45 --- /dev/null +++ b/:mkxcplib @@ -0,0 +1,36 @@ +#ident "@(#)mk::mkxcplib 1.1.2.1" +# +# Build Compatibility Package libraries +# For each directory build the library by invoking its +# makefile (.mk). +# +#set -x +trap "exit 1" 1 2 3 15 +MAKE=${MAKE:-make} +SRCDIR=${SRC:-$ROOT/usr/src}/xcplib +CLOBBER=${CLOBBER:-"ON"} +cd $SRCDIR +# +for ARG in $* +do + LIB=`basename $ARG` + if [ -d $LIB ] + then ( + echo "======== $LIB" + cd $LIB + if [ -f $LIB.mk ] + then + $MAKE -b -f $LIB.mk ROOT=$ROOT install I="install -i -n $ROOT/lib $ROOT/usr/lib" + if [ $? -ne 0 ] + then + echo ":mklib: *** $MAKE failed using $LIB.mk" + fi + test "$CLOBBER" != "OFF" && $MAKE -b -f $LIB.mk clobber + else + echo ":mklib: *** no $LIB.mk file in $SRCDIR/$LIB" + fi + ) else + echo ":mklib: *** no directory found for $LIB under $SRCDIR" + fi +done +exit 0 diff --git a/ucb.dirs b/ucb.dirs new file mode 100644 index 0000000..beac56d --- /dev/null +++ b/ucb.dirs @@ -0,0 +1,10 @@ +#ident "@(#)mk:ucb.dirs 1.1.2.1" + +# The format of this file is: +# DIRECTORY [MODE OWNER GROUP] +# The MODE/OWNER/GROUP may be left blank or else +# dashes may be used as place holders. +/usr/ucb +/usr/ucbinclude +/usr/ucblib +/usr/ucblib/reftools