cproto-4.6/lex.yy.c
cproto-4.6/stamp-h
cproto-4.6/y.tab.c
+lib/c2/c2
lib/cpp/cpp
lib/cpp/cpy.c
lib/libc/compat-4.1/compat-4.1lib
/*#include "asnumber.h" as.h*/
/*#include "instrs.h" as.h*/
+#ifdef X_
+/* temporarily pass atof() to host library until we have a better solution */
+#pragma include <math.h>
+#endif
+
/*
* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
Bignum as_atof(numbuf, radix, ovfp) char *numbuf; int radix; Ovf *ovfp; {
Bignum number;
extern int errno;
+#ifdef X_
+ double nox_atof();
+#else
double atof();
+#endif
number = Znumber;
errno = 0;
case TYPD:
number.num_tag = TYPD;
*ovfp = 0;
+#ifdef X_
+ number.num_num.numFd_float.Fd_value = nox_atof(numbuf);
+#else
number.num_num.numFd_float.Fd_value = atof(numbuf);
+#endif
break;
case TYPG:
case TYPH:
DESTDIR=
INSTALL=install -m 644
DFLMON= mon.o
-MACHINE=linux
-#vax
+MACHINE=vax
DEFS=
COMPAT= compat-4.1 compat-sys5
ALL= gen inet net ns stdio sys ${COMPAT} ${MACHINE}
-mkdir tmp
for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done
cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib
-# ls tmp/*.o | sort -t/ +1 > t1
- ls tmp/*.o | LC_ALL=C sort -t/ > t1
- ar cr libc.a `lorder \`cat t1\` | tsort`
-# ${MACHINE}/csu/${DFLMON}
+ ls tmp/*.o | sort -t/ +1 > t1
+ ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
ar ma findiop.o libc.a exit.o
ar ma exit.o libc.a fakcu.o
rm -f t1 tmp/*
for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib_p
-# ls tmp/*.o | sort -t/ +1 > t1
- ls tmp/*.o | LC_ALL=C sort -t/ > t1
- ar cr libc_p.a `lorder \`cat t1\` | tsort`
-# ${MACHINE}/csu/${DFLMON}
+ ls tmp/*.o | sort -t/ +1 > t1
+ ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
ar ma findiop.o libc_p.a exit.o
ar ma exit.o libc_p.a fakcu.o
rm -rf t1 tmp
--- /dev/null
+#
+# Copyright (c) 1980 Regents of the University of California.
+# All rights reserved. The Berkeley software License Agreement
+# specifies the terms and conditions for redistribution.
+#
+# @(#)Makefile 4.19 (Berkeley) 3/9/86
+#
+#
+# The system has two monitoring schemes, utilizing either ``prof''
+# or ``gprof''. DFLMON determines the default profiler; mon.o
+# specifies that ``prof'' is the default, gmon.o specifies that
+# ``gprof'' is the default.
+#
+# Machine dependent routines are located in a subtree which parallels
+# the top directories. This subtree is identified by the machine name.
+#
+# Compatibility routines are kept in directories with a prefixing
+# ``compat'' (so they all sort together).
+#
+# The C run-time startup code is always machine dependent and expected
+# to be located in ${MACHINE}/csu
+#
+# All files contain sccsid strings, but these are not compiled into
+# library objects by default, as a space-saving measure. To produce
+# a library that contains these strings in every object except
+# system call stubs, add -DLIBC_SCCS to DEFS below; to put these
+# strings into system call stubs, use -DSYSLIBC_SCCS.
+#
+# There are two possible methods of doing host name look up. They are
+# to use the name server or /etc/hosts. HOSTLOOKUP defines which method
+# is to be compiled into libc :
+#
+# defining HOSTLOOKUP to be "named", compiles the
+# host lookup routines that use the BIND name server.
+#
+# defining HOSTLOOKUP to be "hosttable", compiles
+# the host lookup routines that use /etc/hosts.
+#
+#HOSTLOOKUP= hosttable
+HOSTLOOKUP= named
+#
+DESTDIR=
+INSTALL=install -m 644
+DFLMON= mon.o
+MACHINE=linux
+#vax
+DEFS=
+COMPAT= compat-4.1 compat-sys5
+ALL= gen inet net ns stdio sys ${COMPAT} ${MACHINE}
+TAGSFILE=tags
+
+libc.a libc_p.a: ${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}
+ rm -rf t1 tmp
+ -mkdir tmp
+ for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done
+ cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib
+# ls tmp/*.o | sort -t/ +1 > t1
+ ls tmp/*.o | LC_ALL=C sort -t/ > t1
+ ar cr libc.a `lorder \`cat t1\` | tsort`
+# ${MACHINE}/csu/${DFLMON}
+ ar ma findiop.o libc.a exit.o
+ ar ma exit.o libc.a fakcu.o
+ rm -f t1 tmp/*
+ for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
+ cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib_p
+# ls tmp/*.o | sort -t/ +1 > t1
+ ls tmp/*.o | LC_ALL=C sort -t/ > t1
+ ar cr libc_p.a `lorder \`cat t1\` | tsort`
+# ${MACHINE}/csu/${DFLMON}
+ ar ma findiop.o libc_p.a exit.o
+ ar ma exit.o libc_p.a fakcu.o
+ rm -rf t1 tmp
+
+${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}: FRC
+ cd $@; make ${MFLAGS} DEFS=${DEFS}
+
+FRC:
+
+install:
+ ${INSTALL} libc.a ${DESTDIR}/lib/libc.a
+ ranlib ${DESTDIR}/lib/libc.a
+ ${INSTALL} libc_p.a ${DESTDIR}/usr/lib/libc_p.a
+ ranlib ${DESTDIR}/usr/lib/libc_p.a
+ cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install
+
+tags:
+ for i in ${ALL}; do \
+ (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
+ done
+ cd net/${HOSTLOOKUP}; \
+ make ${MFLAGS} TAGSFILE=../../${TAGSFILE} tags
+
+clean:
+ for i in ${MACHINE}/csu ${ALL} net/hosttable net/named; \
+ do (cd $$i; make ${MFLAGS} clean); done
+ rm -f t1 tmp/*.o
+ -rmdir tmp
+
+depend:
+ for i in ${MACHINE}/csu ${ALL} net/hosttable net/named; \
+ do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done
+CPP=/lib/cpp
LD=ld
#
# Copyright (c) 1980 Regents of the University of California.
${CC} -DGCRT0 -o $@ -c crt0.c
#crt0.o: crt0.c
-# cc -S ${DFLAGS} -DCRT0 crt0.c
-# /lib/cpp crt0.s > x.s
+# ${CC} -S ${DFLAGS} -DCRT0 crt0.c
+# ${CPP} crt0.s > x.s
# as -o x.o x.s
# ${LD} -x -r -o crt0.o x.o
# rm -f x.s x.o crt0.s
#
#moncrt0.o: crt0.c
-# cc -S ${DFLAGS} -DMCRT0 crt0.c
-# /lib/cpp crt0.s > x.s
+# ${CC} -S ${DFLAGS} -DMCRT0 crt0.c
+# ${CPP} crt0.s > x.s
# as -o x.o x.s
# ${LD} -x -r -o moncrt0.o x.o
# rm -f x.s x.o crt0.s
# ${LD} -x -r -o mcrt0.o moncrt0.o mon.o
#
#mon.o: mon.c mon.ex
-# cc -S ${DEFS} ${DFLAGS} mon.c
+# ${CC} -S ${DEFS} ${DFLAGS} mon.c
# ex - mon.s < mon.ex
# as -o x.o mon.s
# ${LD} -x -r -o mon.o x.o
# rm -f x.o mon.s
#
#gmon.o: gmon.c gmon.h gmon.ex
-# cc -S ${DEFS} ${DFLAGS} gmon.c
+# ${CC} -S ${DEFS} ${DFLAGS} gmon.c
# ex - gmon.s < gmon.ex
# as -o x.o gmon.s
# ${LD} -x -r -o gmon.o x.o
depend:
for i in ${SRCS}; do \
- cc -M ${DEFS} ${DFLAGS} $$i | awk ' { if ($$1 != prev) \
+ ${CC} -M ${DEFS} ${DFLAGS} $$i | awk ' { if ($$1 != prev) \
{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } \
depend:
for i in ${SRCS}; do \
- cc -M ${DEFS} $$i | awk ' { if ($$1 != prev) \
+ ${CC} -M ${DEFS} $$i | awk ' { if ($$1 != prev) \
{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } \
_exit.c fchmod.c fchown.c fork.c fstat.c ftruncate.c getdtablesize.c \
getegid.c geteuid.c getgid.c getpagesize.c getpgrp.c getpid.c \
getppid.c getrusage.c gettimeofday.c getuid.c ioctl.c link.c linux.c \
- lseek.c lstat.c pipe.c read.c readlink.c readv.c sbrk.c setpgrp.c \
- setregid.c setreuid.c settimeofday.c sigblock.c sigpause.c \
- sigsetmask.c sigvec.c stat.c symlink.c sync.c truncate.c umask.c \
- unlink.c utimes.c vopen.c wait.c wait3.c write.c writev.c
+ lseek.c lstat.c mkdir.c pipe.c read.c readlink.c rmdir.c readv.c \
+ sbrk.c setpgrp.c setregid.c setreuid.c settimeofday.c sigblock.c \
+ sigpause.c sigsetmask.c sigvec.c stat.c symlink.c sync.c truncate.c \
+ umask.c unlink.c utimes.c vopen.c wait.c wait3.c write.c writev.c
OBJS= brk.o chdir.o chmod.o chown.o chroot.o close.o dup2.o dup.o execve.o \
_exit.o fchmod.o fchown.o fork.o fstat.o ftruncate.o getdtablesize.o \
getegid.o geteuid.o getgid.o getpagesize.o getpgrp.o getpid.o \
getppid.o getrusage.o gettimeofday.o getuid.o ioctl.o link.o linux.o \
- lseek.o lstat.o pipe.o read.o readlink.o readv.o sbrk.o setpgrp.o \
- setregid.o setreuid.o settimeofday.o sigblock.o sigpause.o \
- sigsetmask.o sigvec.o stat.o symlink.o sync.o truncate.o umask.o \
- unlink.o utimes.o vopen.o wait.o wait3.o write.o writev.o
+ lseek.o lstat.o mkdir.o pipe.o read.o readlink.o rmdir.o readv.o \
+ sbrk.o setpgrp.o setregid.o setreuid.o settimeofday.o sigblock.o \
+ sigpause.o sigsetmask.o sigvec.o stat.o symlink.o sync.o truncate.o \
+ umask.o unlink.o utimes.o vopen.o wait.o wait3.o write.o writev.o
TAGSFILE=tags
depend:
for i in ${SRCS}; do \
- cc -M ${DEFS} $$i | awk ' { if ($$1 != prev) \
+ ${CC} -M ${DEFS} $$i | awk ' { if ($$1 != prev) \
{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } \
--- /dev/null
+#pragma include <errno.h>
+#pragma include <sys/stat.h>
+
+#include <errno.h>
+#include <sys/stat.h>
+#include "linux.h"
+
+int mkdir(p, m) char *p; int m; {
+ if (nox_mkdir(p, ttoh_mode(m))) {
+ errno = htot_errno(nox_errno);
+ return -1;
+ }
+ return 0;
+}
--- /dev/null
+#pragma include <errno.h>
+#pragma include <unistd.h>
+
+#include <errno.h>
+#include <sys/file.h>
+#include "linux.h"
+
+int rmdir(p) char *p; {
+ if (nox_rmdir(p)) {
+ errno = htot_errno(nox_errno);
+ return -1;
+ }
+ return 0;
+}
+CPP=/lib/cpp
LD=ld
#
# Copyright (c) 1980 Regents of the University of California.
TAGSFILE=tags
.c.o:
- /lib/cpp -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o
+ ${CPP} -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o
-${LD} -X -r $*.o
mv a.out profiled/$*.o
- /lib/cpp -E ${CFLAGS} $*.c | ${AS} -o $*.o
+ ${CPP} -E ${CFLAGS} $*.c | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out $*.o
+CPP=/lib/cpp
LD=ld
#
# Copyright (c) 1980 Regents of the University of California.
TAGSFILE=tags
.c.o:
- /lib/cpp -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o
+ ${CPP} -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o
-${LD} -X -r $*.o
mv a.out profiled/$*.o
- /lib/cpp -E ${CFLAGS} $*.c | ${AS} -o $*.o
+ ${CPP} -E ${CFLAGS} $*.c | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out $*.o
+CPP=${CPP}
LD=ld
#
# Copyright (c) 1980 Regents of the University of California.
crt0.o: crt0.c
${CC} -S ${DFLAGS} -DCRT0 crt0.c
- /lib/cpp crt0.s > x.s
+ ${CPP} crt0.s > x.s
as -o x.o x.s
${LD} -x -r -o crt0.o x.o
rm -f x.s x.o crt0.s
moncrt0.o: crt0.c
${CC} -S ${DFLAGS} -DMCRT0 crt0.c
- /lib/cpp crt0.s > x.s
+ ${CPP} crt0.s > x.s
as -o x.o x.s
${LD} -x -r -o moncrt0.o x.o
rm -f x.s x.o crt0.s
+CPP=/lib/cpp
LD=ld
# Makefile 4.13 86/01/09
#
TAGSFILE=tags
.s.o:
- /lib/cpp -E ${DEFS} -DPROF $*.s | ${AS} -o $*.o
+ ${CPP} -E ${DEFS} -DPROF $*.s | ${AS} -o $*.o
-${LD} -X -r $*.o
mv a.out profiled/$*.o
- /lib/cpp -E ${DEFS} $*.s | ${AS} -o $*.o
+ ${CPP} -E ${DEFS} $*.s | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out $*.o
+CPP=/lib/cpp
LD=ld
#
# Copyright (c) 1983 Regents of the University of California.
TAGSFILE=tags
.c.o:
- /lib/cpp -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o
+ ${CPP} -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out profiled/$*.o
- /lib/cpp -E ${CFLAGS} $*.c | ${AS} -o $*.o
+ ${CPP} -E ${CFLAGS} $*.c | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out $*.o
+CPP=/lib/cpp
LD=ld
#
# Copyright (c) 1980 Regents of the University of California.
TAGSFILE=tags
.c.o:
- /lib/cpp -E ${DEFS} -DPROF $*.c | ${AS} -o $*.o
+ ${CPP} -E ${DEFS} -DPROF $*.c | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out profiled/$*.o
- /lib/cpp -E ${DEFS} $*.c | ${AS} -o $*.o
+ ${CPP} -E ${DEFS} $*.c | ${AS} -o $*.o
-${LD} -x -r $*.o
mv a.out $*.o
install: all
install -s ${TESTDIR}/ccom ${DESTDIR}/lib/ccom
- install -s ${TESTDIR}/sccom ${DESTDIR}/lib/sccom
- install -s ${TESTDIR}/f1 ${DESTDIR}/lib/f1
+# install -s ${TESTDIR}/sccom ${DESTDIR}/lib/sccom
+# install -s ${TESTDIR}/f1 ${DESTDIR}/lib/f1
GREP= egrep
/*
* These flags control global compiler operation.
*/
-#define BUFSTDERR 1 /* buffer output to stderr */
+/* note: following doesn't work, because returning from main() destroys buf */
+/*#define BUFSTDERR 1*/ /* buffer output to stderr */
#define STDPRTREE 1 /* means include prtree */
#define NESTCALLS 1 /* disallow two concurrent store()'s */
#define FLEXNAMES 1 /* arbitrary length identifiers */
#else
char *name;
int stalign;
+#endif
+#ifdef __x86_64__
+ /* this is very non-ideal, code such as the following in pftn.c,
+ * p->tn.rval = p->in.left->tn.rval;
+ * p->in.type = p->in.left->in.type;
+ * uses the different node types interchangeably, just align them for now
+ */
+ int pad0;
#endif
CONSZ lval;
+#ifdef __x86_64__
+ int pad1;
+#endif
int rval;
+#ifdef __x86_64__
+ int pad2;
+#endif
} tn;
struct { /* branch node */
int op;
register NODE *p;
p = talloc();
+ /*fprintf(stderr, "block(%d, %p, %p, %d, %d, %d)=%p\n", o, l, r, t, d, s, p);*/
p->in.op = o;
p->in.left = l;
p->in.right = r;
STAGE1=$ROOT/stage1
OLDPATH="$PATH"
-# these should always exist, but are sometimes lost due to git on empty dirs
-mkdir -p lib/libc/compat-4.1/profiled
-mkdir -p lib/libc/compat-sys5/profiled
-mkdir -p lib/libc/gen/profiled
-mkdir -p lib/libc/inet/profiled
-mkdir -p lib/libc/linux/gen/profiled
-mkdir -p lib/libc/linux/profiled
-mkdir -p lib/libc/linux/sys/profiled
-mkdir -p lib/libc/net/hosttable/profiled
-mkdir -p lib/libc/net/named/profiled
-mkdir -p lib/libc/net/profiled
-mkdir -p lib/libc/ns/profiled
-mkdir -p lib/libc/stdio/profiled
-mkdir -p lib/libc/sys/profiled
+## these should always exist, but are sometimes lost due to git on empty dirs
+#mkdir -p lib/libc/compat-4.1/profiled
+#mkdir -p lib/libc/compat-sys5/profiled
+#mkdir -p lib/libc/gen/profiled
+#mkdir -p lib/libc/inet/profiled
+#mkdir -p lib/libc/linux/gen/profiled
+#mkdir -p lib/libc/linux/profiled
+#mkdir -p lib/libc/linux/sys/profiled
+#mkdir -p lib/libc/net/hosttable/profiled
+#mkdir -p lib/libc/net/named/profiled
+#mkdir -p lib/libc/net/profiled
+#mkdir -p lib/libc/ns/profiled
+#mkdir -p lib/libc/stdio/profiled
+#mkdir -p lib/libc/sys/profiled
+#
+#rm -rf $STAGE0
+#mkdir -p $STAGE0/bin
+#mkdir -p $STAGE0/lib
+#mkdir -p $STAGE0/usr/bin
+#mkdir -p $STAGE0/usr/include
+#mkdir -p $STAGE0/usr/lib
+#
+#(cd xify && make clean && PATH="$OLDPATH" make && make DESTDIR=$STAGE0 install)
+#(cd include && make SHARED=copies DESTDIR=$STAGE0 install)
+#cat <<EOF >$STAGE0/usr/include/setjmp.h
+##pragma include <setjmp.h>
+##pragma keyword setjmp longjmp
+##pragma typedef jmp_buf
+#EOF
+#cat <<EOF >$STAGE0/usr/include/stdarg.h
+##pragma include <stdarg.h>
+##pragma keyword va_start va_arg va_end
+##pragma typedef va_list
+#EOF
+#cat <<EOF >$STAGE0/usr/include/stdint.h
+##pragma include <stdint.h>
+##pragma typedef int8_t int16_t int32_t int64_t intptr_t ssize_t
+##pragma typedef uint8_t uint16_t uint32_t uint64_t uintptr_t size_t
+#EOF
+#cat <<EOF >$STAGE0/usr/include/varargs.h
+##pragma include <varargs.h>
+##pragma keyword va_alist va_dcl va_start va_arg va_end
+##pragma typedef va_list
+#EOF
+#
+#export PATH="$STAGE0/bin:$STAGE0/usr/bin:$OLDPATH"
+#
+#(cd lib/libc && make clean && make -f Makefile.linux && make -f Makefile.linux DESTDIR=$STAGE0 install)
+#(cd usr.bin/yacc && make clean && make && make DESTDIR=$STAGE0 install)
+#cat - usr.bin/yacc/yaccpar <<EOF >$STAGE0/usr/lib/yaccpar
+##pragma ifdef __GNUC__
+##pragma pragma GCC diagnostic ignored "-Wunused-label"
+##pragma endif
+#EOF
+#(cd usr.bin/lex && make clean && make && make DESTDIR=$STAGE0 install)
+#
+#rm -rf $STAGE1
+#mkdir -p $STAGE1/bin
+#mkdir -p $STAGE1/lib
+#mkdir -p $STAGE1/usr/bin
+#mkdir -p $STAGE1/usr/include
+#mkdir -p $STAGE1/usr/lib
+#
+#(cd bin && make clean && make SUBDIR="as csh diff sed sh tp" NSTD= KMEM= && make DESTDIR=$STAGE1 SUBDIR="as csh diff sed sh tp" NSTD= KMEM= install)
+#(cd usr.bin && make clean && make SUBDIR="find lex yacc" NSTD= KMEM= && make DESTDIR=$STAGE1 SUBDIR="find lex yacc" NSTD= KMEM= install)
+#(cd lib && make clean && make SUBDIR="c2 cpp pcc" && make SUBDIR="c2 cpp pcc" DESTDIR=$STAGE1 install)
+#(cd include && make SHARED=copies DESTDIR=$STAGE1 install)
+#
+export PATH="$STAGE1/bin:$STAGE1/usr/bin:$OLDPATH"
-rm -rf $STAGE0
-mkdir -p $STAGE0/bin
-mkdir -p $STAGE0/lib
-mkdir -p $STAGE0/usr/bin
-mkdir -p $STAGE0/usr/include
-mkdir -p $STAGE0/usr/lib
-
-export PATH="$STAGE0/bin:$STAGE0/usr/bin:$OLDPATH"
-
-(cd xify && make clean && PATH="$OLDPATH" make && make DESTDIR=$STAGE0 install)
-(cd include && make SHARED=copies DESTDIR=$STAGE0 install)
-cat <<EOF >$STAGE0/usr/include/setjmp.h
-#pragma include <setjmp.h>
-#pragma keyword setjmp longjmp
-#pragma typedef jmp_buf
-EOF
-cat <<EOF >$STAGE0/usr/include/stdarg.h
-#pragma include <stdarg.h>
-#pragma keyword va_start va_arg va_end
-#pragma typedef va_list
-EOF
-cat <<EOF >$STAGE0/usr/include/stdint.h
-#pragma include <stdint.h>
-#pragma typedef int8_t int16_t int32_t int64_t intptr_t ssize_t
-#pragma typedef uint8_t uint16_t uint32_t uint64_t uintptr_t size_t
-EOF
-cat <<EOF >$STAGE0/usr/include/varargs.h
-#pragma include <varargs.h>
-#pragma keyword va_alist va_dcl va_start va_arg va_end
-#pragma typedef va_list
-EOF
-(cd lib/libc && make clean && make && make DESTDIR=$STAGE0 install)
-(cd usr.bin/yacc && make clean && make && make DESTDIR=$STAGE0 install)
-cat - usr.bin/yacc/yaccpar <<EOF >$STAGE0/usr/lib/yaccpar
-#pragma ifdef __GNUC__
-#pragma pragma GCC diagnostic ignored "-Wunused-label"
-#pragma endif
-EOF
-(cd usr.bin/lex && make clean && make && make DESTDIR=$STAGE0 install)
-
-rm -rf $STAGE1
-mkdir -p $STAGE1/bin
-mkdir -p $STAGE1/lib
-mkdir -p $STAGE1/usr/bin
-mkdir -p $STAGE1/usr/include
-mkdir -p $STAGE1/usr/lib
-
-(cd bin && make clean && make SUBDIR="as csh diff sed sh tp" NSTD= KMEM= && make DESTDIR=$STAGE1 SUBDIR="as csh diff sed sh tp" NSTD= KMEM= install)
-(cd usr.bin && make clean && make SUBDIR="find lex yacc" NSTD= KMEM= && make DESTDIR=$STAGE1 SUBDIR="find lex yacc" NSTD= KMEM= install)
-(cd lib/cpp && make clean && make && make DESTDIR=$STAGE1 install)
-(cd include && make SHARED=copies DESTDIR=$STAGE1 install)
+(cd lib/libc && make clean && make CPP=$STAGE1/lib/cpp && make DESTDIR=$STAGE1 install)
while test $# -ge 1
do
- sed -e 's/ \(-\)\?cc / \1${CC} /; s/ \(-\)\?ld / \1${LD} /; s/ \(-\)\?yacc / \1${YACC} /; s/ \(-\)\?lex / \1${LEX} /; s/\([ ]\)cc -M /\1${CC} -M /g; /^# DO NOT DELETE THIS LINE -- make depend uses it$/{N; q}' -i $1
+ sed -e 's/ \(-\)\?cc / \1${CC} /; s/ \(-\)\?ld / \1${LD} /; s/ \(-\)\?yacc / \1${YACC} /; s/ \(-\)\?lex / \1${LEX} /; s/ \(-\)\?\/lib\/cpp / \1${CPP} /; s/\([ ]\)cc -M /\1${CC} -M /g; /^# DO NOT DELETE THIS LINE -- make depend uses it$/{N; q}' -i $1
if grep -q '\${LD}' $1 && ! grep -q '^LD[ ]*=' $1
then
sed -e '1iLD=ld' -i $1
then
sed -e '1iLEX=lex' -i $1
fi
+ if grep -q '\${CPP}' $1 && ! grep -q '^CPP[ ]*=' $1
+ then
+ sed -e '1iCPP=/lib/cpp' -i $1
+ fi
shift
done