#!/bin/sh
#
# Copyright 1996-2003 Michael Graff <explorer@flame.org>
# You may distribute this file freely providing this notice remains intact.
#
IRCD_VERSION="sor1.3.7"
CONF_DATE=`date`
LAST_VERSION="very very old"
#
trap "" 13 14 15
MV=mv
RM=rm
SETUP=include/setup.h
OPTIONS_H=include/options.h
OPTIONS=./Options
AUTO_CONFIG=""
#
STDDEFH=undef
CRYPTH=undef
NOINDEX=undef
NSTRTOKEN=undef
NSTRTOK=undef
REDHAT6=undef
LINUX_GLIBC=undef
LINUX_GLIBC_RRES=undef
NINETADDR=undef
NINETNTOA=undef
NINETNETOF=undef
NGETADDRINFO=undef
TMP=/tmp/.Configtmp$$.c
CCPATH=''
SN_MODE='1'
NETNAME='SorceryNet'
URL_CONNECTHELP='none'
REQ_VERSION_RESPONSE='1'
EXEC=/tmp/.Configtmp$$
PLATE=/tmp/.ConPlate$$
c=''
n=''

# when Config stops, make sure the /tmp file is dead
#previously, it sometimes left the file if you ^C'd out...
trap "rm -f $TMP $EXEC $PLATE; rm -f $EXEC;echo '';echo \"deleting $TMP\";exit " 1 2 11 15 4
trap "rm -f $TMP $EXEC $PLATE; rm -f $EXEC;echo '';echo \"deleting $TMP\";exit " 5 6 7 8 9

#
# Some reasonable defaults
#
DEFOPT="-O -g -Wuninitialized -Wcomment -Wall"
DEFCFLAGS="$DEFOPT"
DEFLIBS="none"
OSNAME="an unrecgonized operating system"
#
DESCRYPT="none"
NOSPOOF="1"
NOSPOOF_SEED01="0x12345678"
NOSPOOF_SEED02="0x9abcdef0"
NS_URL=""
KLINE_ADDRESS="kline@sorcery.net"
NETWORK_KLINE_ADDRESS='kline@sorcery.net'
DOMAINNAME="sorcery.net"
IMODE="700"
DPATH="/usr/local/lib/ircd"
SPATH="/usr/local/bin/ircd"
HUB=""
CRYPT_OPER_PASSWORD="1"
CRYPT_LINK_PASSWORD=""
LISTEN_SIZE="5"
MAXSENDQLENGTH="3000000"
BUFFERPOOL="(9 * MAXSENDQLENGTH)"
NICKNAMEHISTORYLENGTH="750"
MAXCONNECTIONS="1024"

#
# load $OPTIONS if present
#
if [ -r "$OPTIONS" ] ; then
    . $OPTIONS
fi

#
2>/dev/null
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
	c='\c'
else
	n='-n'
fi

clear

if [ "$LAST_VERSION" != "$IRCD_VERSION" ] ; then
    if [ -r doc/CHANGES.NEW ] ; then
	more doc/CHANGES.NEW
	echo $n "[Enter to begin]"
	read cc
    fi
fi

if [ "$1" = "-n" ] ; then
    if [ "$LAST_VERSION" != "$IRCD_VERSION" ] ; then
	echo "You specified the no-questions-asked configure, but the version"
	echo "of Config which created your Options file was [1m$LAST_VERSION[0m,"
	echo "And the current version is [1m$IRCD_VERSION[0m."
	echo " "
	echo "Please read the prompts carefully since some of them may have"
	echo "changed."
	echo " "
    else
	AUTO_CONFIG=Yes
    fi
fi

#
# Take a wild stab at the OS, and take reasonable defaults for each
#
OS=`uname -a`
case "$OS" in
    *NetBSD*)
	DEFCFLAGS="$DEFOPT"
        DESCRYPT="fcrypt.o"
	DEFLIBS="-lcrypt"
	OSNAME="NetBSD"
	;;
    *FreeBSD*)
        DESCRYPT="fcrypt.o"
	DEFCFLAGS="$DEFOPT"
	DEFLIBS="none"
	OSNAME="FreeBSD"
	;;
    *OSF1*alpha*)
	DEFCFLAGS="$DEFOPT"
	DEFLIBS="none"
	OSNAME="OSF/1 or Digital Unix"
	;;
    *SunOS*5.*)
	DEFCFLAGS="$DEFOPT -DSOL20 -DNEED_SNPRINTF"
	DEFLIBS="-lsocket -lnsl -lresolv"
	OSNAME="Solaris 2.x (or SunOS 5.x)"
	;;
    *Linux*)
	DEFCFLAGS="$DEFOPT"
	DEFLIBS=""
	OSNAME="Linux"
	GUESS="`./config.guess`"
        
	echo "Note: If compile fails, try running Config again"
	echo "and ommitting -DLINUX_GLIBC_RRES as an extra compiler"
	echo "flag when prompted."
	
	if [ -n "`echo $GUESS |grep -- -linux-gnu`" \
	     -o -e /lib/libc.so.6 -o -L /lib/libc.so.6 \
	     -o -e /lib/libc.so.6.2 \
	     -o -e /lib/libc.so.6.1 ]
        then
                OSNAME="Linux Glibc"
		DEFCFLAGS="$DEFOPT -DLINUX_GLIBC_RRES"
                DEFLIBS="-lcrypt -lresolv"
		LINUX_GLIBC="define"
        fi
        if [ -r /etc/redhat-release -a -n "`grep \"release 6.\" /etc/redhat-release`" ]
        then
                OSNAME="Linux RedHat 6.x"
                DEFLIBS="-lcrypt -lresolv"
		REDHAT6="define"
        fi

	;;
esac

echo " "
echo You are running $OSNAME...
echo " "
	
# Create Makefile if it doesn't exist...
cp Makefile.dist Makefile

cat << __EOF__

Welcome to autoconfigure for the SorceryNet-derived IRC server
version [1m$IRCD_VERSION[0m.

Config will generate a system-specific $SETUP file, a top
level Makefile, $OPTIONS_H, and a persistant options file named
$OPTIONS

Enter "none" at any prompt to effect a null entry.

__EOF__

runonce=""
FOO=`egrep "^CC=" Makefile 2>/dev/null | sed -e 's/^[^=]*[ 	]*=\(.*\)/\1/'`
while [ -z "$CCPATH" ] ; do
	MYP=`echo "$PATH" | sed -e 's/:/ /g'`
	echo "Which compiler do you use, gcc or cc or...?"
	echo $n "[$FOO] -> $c"
	if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	    read cc
	    runonce=Yes
	else
	    cc=""
	fi
	if [ -z "$cc" ] ; then
		cc=$FOO
		CCPATH=$FOO
	elif [ -f $cc ] ; then
		CCPATH=$cc
	else
		for i in $MYP; do
			if [ -f $i/$cc -a -z "$CCPATH" ] ; then
				CCPATH=$i/$cc
			fi
		done
	fi
done
if [ "$FOO" != "$cc" ] ; then
	MYP=`echo "$CCPATH" | sed -e 's@/@ @g'`
	set $MYP
	if [ $2 ] ; then
		while [ $2 ] ; do
			shift
		done
	fi
	if [ $1 = "gcc" ] ; then
		CCPATH="$CCPATH"
	fi
fi
echo "Compiler selected: $CCPATH"
echo " "
# Check it out
cat > $TMP <<__EOF__
main() {}
__EOF__
$CCPATH $TMP -o $EXEC >/dev/null 2>&1
if [ ! -f $EXEC ] ; then
        echo "You don't have $CCPATH or it's broken!"
        exit 1
fi
# Fix Makefile
#
$RM -f Makefile.tmp
sed -e "s@^CC=\(.*\)@CC=$CCPATH@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp
#
echo "Enter additional flags to give to $CCPATH"
FOO=`egrep "^XCFLAGS=" Makefile 2>/dev/null | sed -e 's/^[^=]*=[	 ]*\(.*\)/\1/'`
if [ -z "$FOO" ] ; then
    echo "I recommend $DEFCFLAGS"
    FOO="$DEFCFLAGS"
fi
echo $n "[$FOO] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
    read cc
else
    cc=""
fi
if [ -z "$cc" ] ; then
	cc="$FOO"
fi
if [ "$cc" = "none" ] ; then
	cc=''
fi
XCFLAGS=$cc
# Fix Makefile
#
$RM -f Makefile.tmp
sed -e "s@^XCFLAGS=\(.*\)@XCFLAGS=$XCFLAGS@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp
#

cat <<__EOF__

If you need to use any extra libraries when compiling the server,
please tell me now (might need to look at the Makefiles) and please
include all the -l and -L flags.

You should use the recommended value unless you have a compelling reason
not to...
__EOF__
LIBS=`egrep "^IRCDLIBS=" Makefile 2>/dev/null | sed -e 's/^[^=]*=\(.*\)/\1/' | tr -d "\012"`
if [ -z "$LIBS" ] ; then
    echo "I suggest: $DEFLIBS"
    LIBS="$DEFLIBS"
fi
echo $n "[$LIBS] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
    read cc
else
    cc=""
fi
if [ -z "$cc" ] ; then
	cc="$LIBS"
fi
if [ "$cc" = "none" ] ; then
	cc=''
fi
LIBS=$cc



# Fix Makefile
#
$RM -f Makefile.tmp
sed -e "s@^IRCDLIBS=\(.*\)@IRCDLIBS=$LIBS@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp




#
# des crypt
COMP="$CCPATH $XCFLAGS $TMP -o $EXEC $LIBS"

echo " "
echo $n "checking if crypt() works..." $c
cat > $TMP <<__EOF__
#include <unistd.h>
#include <string.h>

main()
{
        char key[10];
        char salt[5];
        strcpy(salt, "aa");
        strcpy(key, "aaaaaaaa");
        (void)crypt(key, salt);
	exit(0);
}
__EOF__
$COMP >/dev/null 2>&1
    if [ $? -eq 0 ] ; then
      echo "yep ;)"
      DESCRYPT_CHOICE="y"
    else 
      echo "No ;/"
      DESCRYPT_CHOICE="n"
      DESCRYPT="fcrypt.o"
    fi
rm -f $TMP $EXEC

if [ "$DESCRYPT_CHOICE" = "y" ] ; then
echo " "
echo "Des_Crypt"
echo "  some FreeBsd operating system/compiler combinations may not have"
echo "the crypt routine. for these systems, part of the DES encryption"
echo "library can be linked with ircd.. type 'fcrypt.o' if you want"
echo "to do this, otherwise use 'none'"
echo "(note: in some cases, just using -lcrypt will work)"

echo $n "[$DESCRYPT] -> $c"
if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
    read cc
else
    cc=""
fi
if [ -z "$cc" ] ; then
	cc="$LIBS"
fi
if [ "$cc" = "none" ] ; then
	cc=''
fi
DESCRYPT=$cc

else
     echo " "
fi

# 
# update makefile with descrypt setting # 
#

$RM -f Makefile.tmp
sed -e "s@^DESCRYPT=\(.*\)@DESCRYPT=$DESCRYPT@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp





#
COMP="$CCPATH $XCFLAGS $TMP -o $EXEC $LIBS"
#

echo 'Checking out /usr/include'

echo $n "...Looking for stddef.h...$c"
if [ -r /usr/include/stddef.h ] ; then
        STDDEFH=define
	echo  'found!'
else
	echo 'not found :('
fi

if [ -z "$cc" ] ; then
	cc="$LIBS"
fi
if [ "$cc" = "none" ] ; then
	cc=''
fi

echo $n "...Looking for crypt.h...$c"
if [ -r /usr/include/crypt.h ] ; then
        CRYPTH=define
	echo  'found!'
else
	echo 'not found :('
fi

if [ -z "$cc" ] ; then
	cc="$LIBS"
fi
if [ "$cc" = "none" ] ; then
	cc=''
fi

#
# to b or not to b
#
echo " "
echo $n "To be or not to be...$c"
cat > $TMP <<__EOF__
main()
{
	char	a[3], b[3];
	bzero(b,3);
	bcopy(a,b,3);
	(void)bcmp(a,b,3);
	exit(0);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -eq 0 ] ; then
	echo "and so it shall be! bcopy/bzero/bcmp are about!"
	BZERO=bzero
else
	echo "and it wasn't.  No bcopy/bzero/bcmp...hmpf"
	BZERO=memset
fi

#
echo 'Now those strings libraries...hmm...which one is it...'
cat > $TMP <<__EOF__
#include <string.h>
#include <strings.h>
main()
{
	char *s = index("foo", 'o');
	exit(0);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -eq 0 ] ; then
	echo "Cool...you have index()!"
else
	NOINDEX=define
	echo "Grmpf...I guess there is a strchr() out there somewhere..."
fi
$RM -f $EXEC $TMP

#
# what do we need that isn't here already ?
#
echo "What else do I need that you don't have..."
echo $n "Lets see...$c"
cat > $TMP <<__EOF__
main()
{
	unsigned long foo;

	char  *s = strtoul("0x12345", &foo, 16);
	exit(0);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
    echo $n " strtoul$c"
    $RM -f Makefile.tmp
    sed -e "s@^STRTOUL=\(.*\)@STRTOUL=strtoul.o@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
else
    $RM -f Makefile.tmp
    sed -e "s@^STRTOUL=\(.*\)@STRTOUL=@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
fi
$RM -f $EXEC $TMP

echo "What else do I need that you don't have..."
echo $n "Lets see...$c"
cat > $TMP <<__EOF__
#include <unistd.h>
#include <netdb.h>
main()
{
	int i = getaddrinfo(NULL, NULL, NULL, NULL);
	exit(0);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
    echo $n " getaddrinfo$c"
    $RM -f Makefile.tmp
    sed -e "s@^GETADDRINFO=\(.*\)@GETADDRINFO=getaddrinfo.o@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
    NGETADDRINFO=define
else
    $RM -f Makefile.tmp
    sed -e "s@^GETADDRINFO=\(.*\)@GETADDRINFO=@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
fi
$RM -f $EXEC $TMP

cat > $TMP <<__EOF__
#include <sys/types.h>
main()
{
    u_int32_t foo;
    exit(0);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
    echo $n " u_int32_t$c"
    $RM -f Makefile.tmp
    sed -e "s@^NEED_U_INT32_T=\(.*\)@NEED_U_INT32_T=-DNEED_U_INT32_T@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
else
    $RM -f Makefile.tmp
    sed -e "s@^NEED_U_INT32_T=\(.*\)@NEED_U_INT32_T=@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
fi
$RM -f $EXEC $TMP
cat > $TMP <<__EOF__
#include <string.h>
#include <strings.h>
main()
{
	char  *t = "a", **p = NULL, *s = strtoken(&p, t, ",");
	if (!strcmp(t, s))
		exit(0);
	exit(1);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
	echo $n " strtoken$c"
	NSTRTOKEN=define
else
	$EXEC
	if [ $? -ne 0 ] ; then
		echo $n " strtoken$c"
		NSTRTOKEN=define
	fi
fi
$RM -f $EXEC $TMP
cat > $TMP <<__EOF__
#include <string.h>
#include <strings.h>
main()
{
	char t[2] = "a";
	char *s = strtok(t, ",");
	if (!strcmp(t, s))
		exit(0);
	exit(1);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
	echo $n " strtok$c"
	NSTRTOK=define
else
	$EXEC
	if [ $? -ne 0 ] ; then
		echo $n " strtok$c"
		NSTRTOK=define
	fi
fi
$RM -f $EXEC $TMP
cat > $TMP << __EOF__
#include <sys/types.h>
#include <netinet/in.h>
main()
{
	struct	in_addr in;
	(void)inet_addr("1.2.3.4");
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
	echo $n " inet_addr$c"
	NINETADDR=define
fi
$RM -f $EXEC $TMP
cat > $TMP << __EOF__
#include <sys/types.h>
#include <netinet/in.h>
main()
{
	struct	in_addr	in;
	in.s_addr = 0x12345678;
	(void)inet_ntoa(in);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
	echo $n " inet_ntoa$c"
fi
$RM -f $EXEC $TMP
cat > $TMP << __EOF__
#include <sys/types.h>
#include <netinet/in.h>
main()
{
	struct	in_addr	in;
	in.s_addr = 0x87654321;
	(void)inet_netof(in);
}
__EOF__
$COMP >/dev/null 2>&1
if [ $? -ne 0 ] ; then
	echo $n " inet_netof$c"
	NINETNETOF=define
fi
$RM -f $EXEC $TMP
echo " "
#
#
#

$RM -f $EXEC $TMP $PLATE
cat > $SETUP  <<__EOF__
#ifndef __setup_include__
#define __setup_include__
#$REDHAT6	REDHAT6
#$LINUX_GLIBC	LINUX_GLIBC
/*#$LINUX_GLIBC_RRES LINUX_GLIBC_RRES*/
#$STDDEFH	STDDEFH
#$CRYPTH	CRYPTH
#$NOINDEX	NOINDEX
#$NSTRTOKEN	NEED_STRTOKEN
#$NSTRTOK	NEED_STRTOK
#$NINETADDR	NEED_INET_ADDR
#$NINETNTOA	NEED_INET_NTOA
#$NINETNETOF	NEED_INET_NETOF
#$NGETADDRINFO	NEED_GETADDRINFO
__EOF__
if [ "$BZERO" = "memset" ] ; then
	cat >> $SETUP <<__EOF__
#define	bzero(a,b)	memset(a,0,b)
#define	bcopy(a,b,c)	memcpy(b,a,c)
#define	bcmp	memcmp
__EOF__
fi
echo "#endif" >> $SETUP

#
# Now, get site specific options.
#

FOO=""
runonce=""

while [ -z "$FOO" ] ; do
   FOO="$SN_MODE"
       if [ -n "$SN_MODE" ] ; then
             FOO="Yes"
       else
             FOO="No"
      fi

cat <<EOF
Do you want to compile in SorceryNet mode?

Answer YES here for compiling any server daemon to be linked
to SorceryNet or any SN test network.
EOF

   echo $n "[$FOO] -> $c"
       if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
               read cc
               runonce=Yes
    else
               cc=""
    fi
    if [ -z "$cc" ] ; then
       cc=$FOO
    fi
    case "$cc" in
	            [Yy]*)
	                SN_MODE="1"
	            ;;
	            [Nn]*)
	                SN_MODE=""
	            ;;
	            *)
			echo ""
		        echo "You need to enter either Yes or No here..."
			echo ""
			FOO=""
	            ;;
		    esac

done

if [ -n "$SN_MODE" ] ; then
	NETNAME='SorceryNet'
	NETWORK_KLINE_ADDRESS='kline@sorcery.net'
	NS_URL="http://www.sorcery.net/help/connecting.html"	
	URL_CONNECTHELP=''
	SN_MODE='1'
elif [ -z "$SN_MODE" ] ; then
# Lets prompt for the network name
runonce=""
FOO=""
while [ -z "$FOO" ] ; do
       FOO="$NETNAME"
       echo "What is the name of your network? This will be the name users"
       echo "see upon connect."
       echo $n "[$FOO] -> $c"
       if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
               read cc
               runonce=Yes
    else
               cc=""
    fi
    if [ -z "$cc" ] ; then
       cc=$FOO
    fi
done
NETNAME=$cc


# Ask if there is a webpage for help on connections.
runonce=""
FOO=""
while [ -z "$FOO" ] ; do
	if [ -n "$URL_CONNECTHELP" ] ; then
		FOO="$URL_CONNECTHELP"
	else
	        FOO='none'
	fi
       echo "Do you have a specific webpage for helping users with problems"
       echo "with their connection? If yes, give it here. If nothing is"
       echo "given, they will be given the default help message on connect,"
       echo "and I don\'t think you want that, unless you are linking to"
       echo "SorceryNet."
       echo $n "[$FOO] -> $c"

       if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
               read cc
               runonce=Yes
       else
               cc=""
       fi
    if [ -z "$cc" ] ; then
       cc=$FOO
    fi
done
if [ "$cc" != "none" ] ; then
       URL_CONNECTHELP=$cc
else
       URL_CONNECTHELP=""
fi


# NETWORK_KLINE_ADDRESS
FOO=""
runonce="a"
while [ -z "$FOO" ] ; do
    FOO="$NETWORK_KLINE_ADDRESS"
    echo " "
    echo "What is the contact address for connect problems due to the"
    echo "user being banned from the entire network, shown to the user when"
    echo "they attempt to connect while autokilled by services."
    echo ""
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" -o -z "$FOO" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[Kk][Ll][Ii][Nn][Ee]@[sS][oO][rR][cC][eE][rR][yY].[Nn][Ee][Tt])
	    NETWORK_KLINE_ADDRESS="$cc"
	    FOO=""
	    echo " "
	    while [ -z "$FOO" ] ; do
		FOO="No"
		echo "kline@sorcery.net is for SorceryNet servers only"

		echo "Are you sure you want to set the address to kline@sorcery.net?"
		echo $n "[$FOO] -> $c"
		if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
		    read cc
		    runonce=Yes
		else
		    cc="Yes"
		fi
		if [ -z "$cc" ] ; then
		    cc=$FOO
		fi
		case "$cc" in
		    [Yy]*)
			;;
		    [Nn]*)
			NETWORK_KLINE_ADDRESS=""
			;;
		    *)
			echo ""
			echo "You need to enter either Yes or No here..."
			echo ""
			FOO=""
			;;
		esac
	    done
	    FOO="$NETWORK_KLINE_ADDRESS"
	    ;;
	*@*.*)
	    NETWORK_KLINE_ADDRESS=$cc
	    FOO="$NETWORK_KLINE_ADDRESS"
	    ;;
	*)
	    echo " "
	    echo "Read the instructions and try again...  You did not enter a"
	    echo "proper email address (user@host.domain)."
	    FOO=""
	    ;;
    esac
done

#
fi

############################################################

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    if [ -n "$NOSPOOF" ] ; then
	FOO="Yes"
    else
	FOO="No"
    fi
    echo ""
    echo "Many operating systems are running with insecure TCP stacks."
    echo "This allows IP spoofing attacks, which are very difficult for"
    echo "operators to track down and ban."
    echo ""
    echo "Do you want to prevent users from connecting to the IRC network"
    echo "with ip addresses spoofed in the most common fashion?"
    echo ""
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[Yy]*)
	    NOSPOOF="1"
	    ;;
	[Nn]*)
	    NOSPOOF=""
	    ;;
	*)
	    echo ""
	    echo "You need to enter either Yes or No here..."
	    echo ""
	    FOO=""
	    ;;
    esac

    if [ -z "$AUTO_CONFIG" -a -n "$SN_MODE" -a -z "$NOSPOOF" ] ; then
cat << EOF
When compiling a SorceryNet server, you need to use the NOSPOOF
option.

Type 'yes' if you are sure you want to turn this off:

EOF
      read 'blah'
       if [ "$blah" != "yes" ] ; then
	       FOO=''
       fi
    fi	  
done

if [ -n "$NOSPOOF" ] ; then

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$NOSPOOF_SEED01"
    echo "For security, the nospoof code uses two special values, called"
    echo "seeds.  Here, please enter one of them.  The values are in"
    echo "hexidecimal (base 16) using the digits 0123456789abcdef.  Each"
    echo "value can contain up to 8 digits, and should be specified in the"
    echo "form 0x12345678.  If you use the defaults, that should be ok, but"
    echo "it is more secure if you choose your own special values and keep"
    echo "them secret."
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
	    NOSPOOF_SEED01=$cc
	    ;;
	[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
	    NOSPOOF_SEED01=0x$cc
	    ;;
	*)
	    echo " "
	    echo "Read the instructions and try again...  You did not enter the"
	    echo "value correctly."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$NOSPOOF_SEED02"
    echo "For security, the nospoof code uses two special values, called"
    echo "seeds.  Here, please enter one of them.  The values are in"
    echo "hexidecimal (base 16) using the digits 0123456789abcdef.  Each"
    echo "value can contain up to 8 digits, and should be specified in the"
    echo "form 0x12345678.  If you use the defaults, that should be ok, but"
    echo "it is more secure if you choose your own special values and keep"
    echo "them secret."
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
	    NOSPOOF_SEED02=$cc
	    ;;
	[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
	    NOSPOOF_SEED02=0x$cc
	    ;;
	*)
	    echo " "
	    echo "Read the instructions and try again...  You did not enter the"
	    echo "value correctly."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$NS_URL"
    echo "What is the URL for connect problems due to the"
    echo "anti-spoof system, shown to the user when they connect?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" -o -z "$FOO" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" -a -n "$FOO" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	http://*)
	   NS_URL=$cc
	    ;;
	*)
	    echo " "
	    echo "Read the instructions and try again...  You did not enter a"
	    echo "proper email address (user@host.domain)."
	    echo " "
	    FOO=""
	    runonce=Yes
	    ;;
    esac
done

FOO=''
runonce=''
while [ -z "$FOO" ] ; do
   FOO="$REQ_VERSION_RESPONSE"
          if [ -n "$REQ_VERSION_RESPONSE" ] ; then
               FOO="Yes"
          else
               FOO="No"
          fi

cat << EOF
REQ_VERSION_RESPONSE

If this option is enabled, then all clients MUST provide a response
to the CTCP VERSION check in order to connect to IRC.

Clients that do not respond to the CTCP version request will be treated
similarly to AHURT clients and will be disconnected within 5 minutes.

Do you wish to enable this option?

EOF
         echo $n "[$FOO] -> $c"
         if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
               read cc
               runonce=Yes
         else
               cc=""
         fi

         if [ -z "$cc" ] ; then
             cc=$FOO
         fi

         case "$cc" in
                    [Yy]*)
                        REQ_VERSION_RESPONSE="1"
                    ;;
                    [Nn]*)
                        REQ_VERSION_RESPONSE=""
                    ;;
                    *)
                        echo "You need to enter either Yes or No here..."
                        FOO=""
                    ;;
         esac

done


# this matches a NOSPOOF check waaaaaay up there
fi

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$KLINE_ADDRESS"
    echo " "
    echo "What is the contact address for connect problems due to the"
    echo "user being K:lined, shown to the user when they attempt to"
    echo "connect?  This should be a valid email address."
    echo " "
    echo "For SorceryNet servers, note that this message is displayed when"
    echo "the user is affected by a local K:line or k:line.  With"
    echo "Services-based autokills, the message is set up automatically"
    echo "by Services to ask the user to email kline@sorcery.net.  It is"
    echo "recommended that you set this up to give a valid email address"
    echo "for the server's admin, not kline@sorcery.net."
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" -o -z "$FOO" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[Kk][Ll][Ii][Nn][Ee]@[sS][oO][rR][cC][eE][rR][yY].[Nn][Ee][Tt])
	    KLINE_ADDRESS=$cc
	    FOO=""
	    echo " "
	    while [ -z "$FOO" ] ; do
		FOO="No"
		echo "Please note that kline@sorcery.net does not handle server-specific"
		echo "K:lines."
		echo "Are you sure you want to set the address to kline@sorcery.net?"
		echo $n "[$FOO] -> $c"
		if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
		    read cc
		    runonce=Yes
		else
		    cc=""
		fi
		if [ -z "$cc" ] ; then
		    cc=$FOO
		fi
		case "$cc" in
		    [Yy]*)
			;;
		    [Nn]*)
			KLINE_ADDRESS=""
			;;
		    *)
			echo ""
			echo "You need to enter either Yes or No here..."
			echo ""
			FOO=""
			;;
		esac
	    done
	    FOO="$KLINE_ADDRESS"
	    ;;
	*@*.*)
	    KLINE_ADDRESS=$cc
	    FOO="$KLINE_ADDRESS"
	    ;;
	*)
	    echo " "
	    echo "Read the instructions and try again...  You did not enter a"
	    echo "proper email address (user@host.domain)."
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$DPATH"
    echo ""
    echo "What directory are all the server configuration files in?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
done
DPATH=$cc


FOO=""
runonce=""

while [ -z "$FOO" ] ; do
    FOO="$IMODE"
echo ""
echo "What file permissions would you like the ircd binaries to have?"
echo "(just accept the default of 700 unless you have reason to do otherwise)"

    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
        read cc
        runonce=Yes
    else
        cc=""
    fi
    if [ -z "$cc" ] ; then
        cc=$FOO
    fi
done
IMODE=$cc

###  replace IRCDDIR=  in makefile (same way as with CC=)
$RM -f Makefile.tmp
sed -e "s@^IRCDDIR=\(.*\)@IRCDDIR=$DPATH@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp

### replace ircdmode=  in Makefile (same way as with CC=)
$RM -f Makefile.tmp
sed -e "s@^IRCDMODE=\(.*\)@IRCDMODE=$IMODE@" Makefile > Makefile.tmp
cp Makefile.tmp Makefile
$RM -f Makefile.tmp



FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$SPATH"
    echo ""
    echo "What is the explicit path to where the ircd binary will be"
    echo "installed?  This should point to a file, not a directory"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
done
SPATH=$cc

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$DOMAINNAME"
    echo ""
    echo "What is your local domain name?  This is used for /stats w to"
    echo "report local clients vs. remote clients."
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    FOO=$cc
done
DOMAINNAME=$cc

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    if [ -n "$HUB" ] ; then
	FOO="Yes"
    else
	FOO="No"
    fi
    echo ""
    echo "Are you running as a HUB?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[Yy]*)
	    HUB="1"
	    ;;
	[Nn]*)
	    HUB=""
	    ;;
	*)
	    echo ""
	    echo "You need to enter either Yes or No here..."
	    echo ""
	    FOO=""
	    ;;
    esac
done


FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    if [ -n "$CRYPT_OPER_PASSWORD" ] ; then
	FOO="Yes"
    else
	FOO="No"
    fi
    echo ""
    echo "Do you use encrypted operator passwords?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[Yy]*)
	    CRYPT_OPER_PASSWORD="1"
	    ;;
	[Nn]*)
	    CRYPT_OPER_PASSWORD=""
	    ;;
	*)
	    echo ""
	    echo "You need to enter either Yes or No here..."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    if [ -n "$CRYPT_LINK_PASSWORD" ] ; then
	FOO="Yes"
    else
	FOO="No"
    fi
    echo ""
    echo "Do you use encrypted incoming link passwords? (N lines only,"
    echo "C lines must remain unencrypted always)"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[Yy]*)
	    CRYPT_LINK_PASSWORD="1"
	    ;;
	[Nn]*)
	    CRYPT_LINK_PASSWORD=""
	    ;;
	*)
	    echo ""
	    echo "You need to enter either Yes or No here..."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$LISTEN_SIZE"
    echo ""
    echo "What listen() backlog value do you wish to use?  Some servers"
    echo "have problems with more than 5, others work fine with many, many"
    echo "more."
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[1-9]*)
	    LISTEN_SIZE="$cc"
	    ;;
	*)
	    echo ""
	    echo "You need to enter a number here."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$NICKNAMEHISTORYLENGTH"
    echo ""
    echo "How far back do you want to keep the nickname history?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[1-9]*)
	    NICKNAMEHISTORYLENGTH="$cc"
	    ;;
	*)
	    echo ""
	    echo "You need to enter a number here."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$MAXSENDQLENGTH"
    echo ""
    echo "What sendq length do you wish to have?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[1-9]*)
	    MAXSENDQLENGTH="$cc"
	    ;;
	*)
	    echo ""
	    echo "You need to enter a number here."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$BUFFERPOOL"
    echo ""
    echo "What size of a bufferpool (total of ALL sendq's in use) do you"
    echo "do you wish to have?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	\([1-9]*\))
	    BUFFERPOOL="$cc"
	    ;;
	*)
	    echo ""
	    echo "You need to enter a number here, either based on"
	    echo "MAXSENDQLENGTH or a literal value.  Also, this value"
	    echo "MUST be enclosed in parens -- (9*MAXSENDQLENGTH), for example."
	    echo ""
	    FOO=""
	    ;;
    esac
done

FOO=""
runonce=""
while [ -z "$FOO" ] ; do
    FOO="$MAXCONNECTIONS"
    echo ""
    echo "How many file descriptors (or sockets) can the irc server use?"
    echo $n "[$FOO] -> $c"
    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
	read cc
	runonce=Yes
    else
	cc=""
    fi
    if [ -z "$cc" ] ; then
	cc=$FOO
    fi
    case "$cc" in
	[1-9][0-9][0-9]*)
	    MAXCONNECTIONS="$cc"
	    ;;
	*)
	    echo ""
	    echo "You need to enter a number here, greater or equal to 100."
	    echo ""
	    FOO=""
	    ;;
    esac
done

#
# check FD_SETSIZE and override if needed.
#

cat > $TMP <<__EOF__
#include <stdio.h>
#include <sys/types.h>
#include <time.h>

#ifndef FD_SETSIZE
#define FD_SETSIZE -1
#endif

/*
 * Prints "notdef" if FD_SETSIZE is undefined,
 *        "ok"     if FD_SETSIZE is at least as large as provided on the
 *                 compile command line (-DMAXCONNECTIONS=1234)
 *        "###"    if it is less.  (### is the FD_SETSIZE value)
 */
int
main(int argc, char *argv[])
{
	if (FD_SETSIZE == -1)
		printf("notdef\n");
	else if (FD_SETSIZE >= MAXCONNECTIONS)
		printf("ok\n");
	else
		printf("%d\n", FD_SETSIZE);

	return 0;
}
__EOF__
$COMP "-DMAXCONNECTIONS=$MAXCONNECTIONS" >/dev/null 2>&1
if [ $? -ne 0 ] ; then
    echo " "
    echo "I could not determine what your system allows for the maximum number"
    echo "of connections becuase the test program did not compile."
    echo " "
    FD_SETSIZE=""
else
    fd_setsize_ok=`$EXEC`
    case $fd_setsize_ok in
	notdef)
	    echo " "
	    echo "I could not deterimne what your system allows for the maximum"
	    echo "number of connections because the test program did not find"
	    echo "a system-supplied value for FD_SETSIZE.  Assuming it is"
	    echo "defined correctly but the test program cannot find it."
	    echo " "
	    FD_SETSIZE=""
	    ;;
	ok)
	    echo " "
	    echo "Your system-supplied value for FD_SETSIZE is large enough"
	    echo "for ircd to leave it untouched."
	    echo " "
	    FD_SETSIZE=""
	    ;;
	*)
	    echo " "
	    echo "Your system-supplied value for FD_SETSIZE is $fd_setsize_ok"
	    echo "but you requested $MAXCONNECTIONS for ircd.  FD_SETSIZE will"
	    echo "be overridden using -DFD_SETSIZE=$MAXCONNECTIONS when"
	    echo "compiling ircd."
	    echo " "
	    FD_SETSIZE=$MAXCONNECTIONS
	    ;;
    esac
fi

if [ -n "$FD_SETSIZE" ] ; then
    $RM -f Makefile.tmp
    sed -e "s@^FD_SETSIZE=\(.*\)@FD_SETSIZE=-DFD_SETSIZE=$FD_SETSIZE@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
else
    $RM -f Makefile.tmp
    sed -e "s@^FD_SETSIZE=\(.*\)@FD_SETSIZE=@" Makefile > Makefile.tmp
    cp Makefile.tmp Makefile
    $RM -f Makefile.tmp
fi

cat <<__EOF__

The file "$OPTIONS" was either created or rewritten to contain your
answers to the above questions.

This file is automatically generated and will be updated each time you
run Config.  You should retain a copy of this to help migrate to future
versions of the SorceryNet server with ease.

__EOF__

#
# create the $OPTIONS_H file
#
rm -f $OPTIONS_H
cat > $OPTIONS_H << __EOF__
/*
 * VERSION: $IRCD_VERSION
 * DATE:    $CONF_DATE
 *
 * This file is automatically generated and will be updated each time you
 * run Config.  YOU SHOULD NOT EDIT THIS FILE.  Instead, edit "$OPTIONS" in
 * the same directory as Config, and rerun to regenerate this file.
 */

#define NETWORK "$NETNAME"
#define DPATH "$DPATH"
#define SPATH "$SPATH"
#define LISTEN_SIZE $LISTEN_SIZE
#define MAXSENDQLENGTH $MAXSENDQLENGTH
#define BUFFERPOOL $BUFFERPOOL
#define MAXCONNECTIONS $MAXCONNECTIONS
#define NICKNAMEHISTORYLENGTH $NICKNAMEHISTORYLENGTH
__EOF__
if [ -n "$HUB" ] ; then
    echo "#define HUB 1" >> $OPTIONS_H
else
    echo "#undef HUB" >> $OPTIONS_H
fi

if [ -n "$SN_MODE" ] ; then
	echo "#define SN_MODE" >> $OPTIONS_H
fi

if [ -n "$URL_CONNECTHELP" ] ; then
       echo "#define URL_CONNECTHELP \"$URL_CONNECTHELP\"" >> $OPTIONS_H
fi

if [ -n "$CRYPT_OPER_PASSWORD" ] ; then
    echo "#define CRYPT_OPER_PASSWORD 1" >> $OPTIONS_H
else
    echo "#undef CRYPT_OPER_PASSWORD" >> $OPTIONS_H
fi

if [ -n "$REQ_VERSION_RESPONSE" ] ; then
    echo "#define REQ_VERSION_RESPONSE 1" >> $OPTIONS_H	
fi

if [ -n "$CRYPT_LINK_PASSWORD" ] ; then
    echo "#define CRYPT_LINK_PASSWORD 1" >> $OPTIONS_H
else
    echo "#undef CRYPT_LINK_PASSWORD" >> $OPTIONS_H
fi
if [ -n "$NOSPOOF" ] ; then
    echo "#define NOSPOOF 1" >> $OPTIONS_H
else
    echo "#undef NOSPOOF" >> $OPTIONS_H
fi
if [ -n "$NOSPOOF_SEED01" ] ; then
    echo "#define NOSPOOF_SEED01 $NOSPOOF_SEED01" >> $OPTIONS_H
fi
if [ -n "$NOSPOOF_SEED02" ] ; then
    echo "#define NOSPOOF_SEED02 $NOSPOOF_SEED02" >> $OPTIONS_H
fi
if [ -n "$NS_URL" ] ; then
    echo "#define NS_URL \"$NS_URL\"" >> $OPTIONS_H
fi
if [ -n "$KLINE_ADDRESS" ] ; then
    echo "#define KLINE_ADDRESS \"$KLINE_ADDRESS\"" >> $OPTIONS_H
fi
if [ -n "$NETWORK_KLINE_ADDRESS" ] ; then
	    echo "#define NETWORK_KLINE_ADDRESS \"$NETWORK_KLINE_ADDRESS\"" >> $OPTIONS_H
fi 

if [ -n "$DOMAINNAME" ] ; then
    echo "#define DOMAINNAME \"$DOMAINNAME\"" >> $OPTIONS_H
else
    echo "undef DOMAINNAME" >> $OPTIONS_H
fi

#
# create the persistant file
#
rm -f $OPTIONS
cat > $OPTIONS << __EOF__
#
# VERSION: $IRCD_VERSION
# DATE:    $CONF_DATE
#
# This file is automatically generated and will be updated each time you
# run Config.  You should retain a copy of this to help migrate to future
# versions of the DALnet server with ease.
#
LAST_VERSION="$IRCD_VERSION"
SN_MODE="$SN_MODE"
NETNAME="$NETNAME"
URL_CONNECTHELP="$URL_CONNECTHELP"
NOSPOOF="$NOSPOOF"
NOSPOOF_SEED01="$NOSPOOF_SEED01"
NOSPOOF_SEED02="$NOSPOOF_SEED02"
IMODE="$IMODE"
REQ_VERSION_RESPONSE="$REQ_VERSION_RESPONSE"
NS_URL="$NS_URL"
KLINE_ADDRESS="$KLINE_ADDRESS"
NETWORK_KLINE_ADDRESS="$NETWORK_KLINE_ADDRESS"
DPATH="$DPATH"
SPATH="$SPATH"
HUB="$HUB"
CRYPT_OPER_PASSWORD="$CRYPT_OPER_PASSWORD"
CRYPT_LINK_PASSWORD="$CRYPT_LINK_PASSWORD"
LISTEN_SIZE="$LISTEN_SIZE"
MAXSENDQLENGTH="$MAXSENDQLENGTH"
BUFFERPOOL="$BUFFERPOOL"
MAXCONNECTIONS="$MAXCONNECTIONS"
DOMAINNAME="$DOMAINNAME"
NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
NICK_DELAY="$NICK_DELAY"
__EOF__

cat <<__EOF__

 Config is complete.

 Before compiling, check the contents of [1minclude/config.h[0m for any strange
 things you usually set.  If you want them to be included in the future,
 ask them to be moved to the [1moptions.h[0m file on [1mcoders@sorcery.net[0m.

__EOF__
