#!/bin/sh
#
# Top-level configure script for NetKit.
# (This is NOT automatically generated.)
#

rm -f configure.defs
exec 5> configure.defs

echo '# configure.defs is automatically generated by configure.' >&5 
echo '# Do not edit.' >&5
echo -n '# ' >&5
date >&5
echo >&5

while [ x$1 != x ]; do case $1 in
    --help)
    cat << EOF
Usage: configure [options]
    --help                Show this message
    --with-debug          Enable debugging
    --prefix=path         Prefix for location of files [/usr]
    --root-prefix=path    Location of root partition files [prefix or /]
    --exec-prefix=path    Location for arch-depedent files [prefix]
    --installroot=root    Top of filesystem tree to install in [/]
    --binmode=mode        Mode for binaries [755]
    --daemonmode=mode     Mode for daemon binaries [same as binmode]
    --manmode=mode        Mode for manual pages [644]
    --rootmode=mode       Mode for root-only binaries [700]
    --sgidmode=mode       Mode for setgid programs [2755]
    --suidmode=mode       Mode for setuid programs [4755]
    --with-c-compiler=cc  Program for compiling C source [guessed]
    --with-c++-compiler=cc Program for compiling C++ source [guessed]
    --without-pam         Disable PAM support
    --without-readline    Disable readline support
    --without-shadow      Disable shadow password support
EOF
	exit 0;;
	--verbose) ;;
	--quiet) ;;

	--with-debug|--debug) echo 'DEBUG=1' >&5 ;;
	--prefix=*) echo "PREFIX=`echo $1 | sed 's/^[^=]*=//'`" >&5;;
	--root-prefix=*) echo "ROOTPREFIX=`echo $1 | sed 's/^[^=]*=//'`" >&5;;
	--exec-prefix=*) echo "EXECPREFIX=`echo $1 | sed 's/^[^=]*=//'`" >&5;;
	--installroot=*) echo "INSTALLROOT=`echo $1 | sed 's/^[^=]*=//'`" >&5;;
	--binmode=*) echo "BINMODE=`echo $1 | sed 's/^[^=]*=//'`" >&5;;
	--daemonmode=*) echo "DAEMONMODE=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--manmode=*) echo "MANMODE=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--rootmode=*) echo "ROOTMODE=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--sgidmode=*) echo "SGIDMODE=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--suidmode=*) echo "SUIDMODE=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--with-c-compiler=*) echo "CC=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--with-c++-compiler=*) echo "CXX=`echo $1 | sed 's/^[^=]*=//'`" >&5 ;;
	--without-pam|--disable-pam) echo WITHOUT_PAM=1 >&5;;
	--without-readline|--disable-readline) echo WITHOUT_READLINE=1 >&5;;
	--without-shadow|--disable-shadow) echo WITHOUT_SHADOW=1 >&5;;
	*) echo "Unrecognized option: $1"; exit 1;;
esac 
shift
done


for i in */configure; do
    DIR=`echo $i | sed 's@/.*@@'`
    echo "Configuring in $DIR"
    (cd $DIR && ./configure --subdir)
done
