123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- PLATFORM='sys161'
- MACHINE='mips'
- DEBUG='-O2'
- OSTREE='$(HOME)/cs350-os161/root'
- HOST_CC=gcc
- if [ ! -d kern/startup ]; then
- echo 'Please run configure from the top of the OS/161 tree.'
- exit 1
- fi
- TOOLPREFIX="cs350-"
- while [ "x$1" != x ]; do
- case "$1" in
- --debug) DEBUG='-g';;
- --ostree=*) OSTREE=`echo $1 | sed 's,^[^=]*=,,'`;;
- # UW Mod
- --toolprefix=*) TOOLPREFIX=`echo $1 | sed 's,^[^=]*=,,'`;;
- --help|*)
- more <<EOF
- Usage: ./configure [options]
- where the options are:
- --help Print this message.
- --debug Compile the user-level programs with debug info.
- This is disabled by default because there's no
- support for userlevel source debugging in OS/161.
- (Note: debug info in the kernel is controlled by
- the kernel config file.)
- --ostree=PATH Install the compiled system in a directory tree
- rooted at PATH. Default is \$HOME/cs161/root.
- --toolprefix=NAME Set up to use compiler and tools named with a
- prefix of NAME. The default is "cs350-", so the
- tools used are called cs350-gcc, cs350-ld, etc.
- The directory with these tools should be on your
- shell's search path.
- EOF
- exit
- ;;
- esac
- shift
- done
- echo -n "Checking for <err.h>... "
- cat > __conftest.c <<EOF
- int
- main()
- {
- err(0, "works");
- return 1;
- }
- EOF
- OK=0
- if $HOST_CC __conftest.c -o __conftest >/dev/null 2>&1; then
- if ./__conftest >/dev/null 2>&1; then
- OK=1
- fi
- fi
- rm -f __conf*
- if [ $OK = 1 ]; then
- echo 'yes'
- else
- echo 'no'
- COMPAT_CFLAGS="${COMPATCFLAGS} -DNEED_ERR"
- COMPAT_TARGETS="${HOSTTARGETS} install-errh"
- fi
- echo 'Generating defs.mk.'
- (
- # First, put an explanatory comment at the top.
- cat <<EOF
- EOF
- echo "OSTREE=${OSTREE}"
- echo "PLATFORM=${PLATFORM}"
- echo "MACHINE=${MACHINE}"
- echo "COMPAT_CFLAGS=${COMPAT_CFLAGS}"
- echo "COMPAT_TARGETS=${COMPAT_TARGETS}"
- # UW Mod
- echo "TOOLPREFIX=${TOOLPREFIX}"
- ) > defs.mk
|