#!/bin/sh # # Configure script for OS/161 tree. # This generates the file "defs.mk" at the top level of the tree. # # Usage: ./configure [options] # where you can get a list of the options by doing ./configure --help. # # Must be run with the top of the OS/161 tree as its current directory. # # Note: while this superficially acts like a GNU Autoconf configure # script, it was not generated by autoconf. Scripts generated by # autoconf are much harder to read. :-) # # If this script bombs out, you can create defs.mk by hand based on # the comments in mk/os161.config.mk. # # Target hardware platform and machine type. PLATFORM='sys161' MACHINE='mips' # Default optimize/debug flag: optimize. DEBUG='-O2' # Default location of the root of the installed system. # Note that we quote it such that the reference to the home directory # is a make variable, not a shell variable. This means it gets expanded # when make runs rather than when this script runs. OSTREE='$(HOME)/cs350-os161/root' # Assume this HOST_CC=gcc ################################################## # # Check to make sure we're in the right place. if [ ! -d kern/startup ]; then echo 'Please run configure from the top of the OS/161 tree.' exit 1 fi # UW Mod # Default toolchain name. TOOLPREFIX="cs350-" # # Process the command-line options. 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 <. echo -n "Checking for ... " cat > __conftest.c < 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 #################### # Now generate defs.mk. echo 'Generating defs.mk.' ( # First, put an explanatory comment at the top. cat < defs.mk