#!/bin/sh
#
# script to precompile compiler to C (bootstrap package)
# $Id: bootSrc,v 1.18 2001/07/09 20:16:41 stes Exp $

DST=$HOME/objc-3.1.25-bootstrap

if test -f Makefile
then
  make distclean
fi

AR=true;export AR
RANLIB=true;export RANLIB
ac_cv_func_memset=no;export ac_cv_func_memset
ac_cv_func_memcpy=no;export ac_cv_func_memcpy
ac_cv_func_snprintf=no;export ac_cv_func_snprintf
./configure --with-postlink --with-prefixed-names

OBJCOPT='-C -traditional -noFwd -noFiler -postlink -init oc_objcInit -nostdinc -I../../util/ -T../../util/'
export OBJCOPT

(cd src/objcrt;make)
(cd src/objpak;make)
(cd src/oclib;make)
(cd src/objc;make objc)
(cd src/objc;make objc1)
(cd src/objc;make postlink)

test -d $DST || mkdir $DST
test -d $DST/util || mkdir $DST/util
cp configure $DST/configure
cp config.h.in $DST
cp src/objc/objc.in $DST
cp src/objc/objc.com $DST
cp util/BOOTSTRAP $DST
cp util/Makefile.in $DST
cp util/Makefile.vms $DST
cp util/config.sub $DST/util/
cp util/config.guess $DST/util/
cp util/install-sh $DST/util/
cp util/_objc1.c $DST
cp util/_plink.c $DST

for f in util/*.i
do
  g=`basename $f .i`
  mv util/$g.i $DST/$g.c
done

rm -f util/*.[Pi]
make distclean

