From ee1c51020be25eb88e35b6b0eb9701eabff46ef8 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Mon, 18 Jun 2001 20:55:48 +0000 Subject: [PATCH] +- Config fixes, settings.h and Makefile.dist are now dead. RIP. --- Changes | 1 + Config | 1419 ++---------------------------------------- Makefile.dist | 239 ------- config2/configure.in | 2 +- configure | 2 +- include/config.h | 2 +- 6 files changed, 43 insertions(+), 1622 deletions(-) delete mode 100644 Makefile.dist diff --git a/Changes b/Changes index 95aa5cddf..5add92bf8 100644 --- a/Changes +++ b/Changes @@ -578,3 +578,4 @@ seen. gmtime warning still there - Added NETWORK= numeric 005 token for mIRC 5.91 - Fixed some scan-socks and blackhole fuckups - Added ./configure, autoconf generated configure script, (still need to update ./Config) +- Config fixes, settings.h and Makefile.dist are now dead. RIP. diff --git a/Config b/Config index 843622513..b92cbb76a 100755 --- a/Config +++ b/Config @@ -13,82 +13,29 @@ # $Id$ IRCD_VERSION="Unreal3.2-Selene" CONF_DATE=`date` -LAST_VERSION="very very old" # trap "" 13 14 15 -MV=mv -RM=rm -SETUP=include/setup.h -OPTIONS_H=include/settings.h OPTIONS=Settings AUTO_CONFIG="" # -STDLIBH=undef -STDDEFH=undef -SYSSYSLOGH=undef -MALLOCH=undef -PARAMH=undef -UNISTDH=undef -STRINGH=undef -STRINGSH=undef -RUSAGEH=undef -NOINDEX=undef -FORCECORE=define -NSTRERROR=undef -NSTRTOKEN=undef -NSTRTOK=undef -NINETADDR=undef -NINETNTOA=undef -NINETNETOF=undef -GETTIMEOFDAY=undef -LRAND48=undef -STRTOUL=undef -OPENSSL="" -OPENSSL_OTHERPLACE="" -REGEXP="" -NEEDSKIPNAME="" -CRYPTOLIB="" -CRYPTOIRCD="" -OPENSSLPATH="" -CCPATH='' -STRCASECMP=undef -SIGNAL='' -BLOCKING='' -TMP=/tmp/.Configtmp$$.c -EXEC=/tmp/.Configtmp$$ -PLATE=/tmp/.ConPlate$$ c='' n='' # DIR=`pwd` -# -# Some reasonable defaults -# -DEFOPT="-O -g -export-dynamic" -PTHREADFLAG="-pthread" -DEFCFLAGS="$DEFOPT" -DEFLIBS="none" -MKPASSWDLIBS="-lcrypt" -OSNAME="an unrecgonized operating system" -# -IRCNET="" NOSPOOF="1" -KLINE_ADDRESS="" DPATH="$DIR" SPATH="$DIR/src/ircd" -MODE_X="" -TRUEHUB="" CRYPT_OPER_PASSWORD="" CRYPT_LINK_PASSWORD="" CRYPT_ILINE_PASSWORD="" CRYPT_XLINE_PASSWORD="" LISTEN_SIZE="5" MAXSENDQLENGTH="3000000" -BUFFERPOOL="(9 * MAXSENDQLENGTH)" +BUFFERPOOL="9" NICKNAMEHISTORYLENGTH="2000" MAXCONNECTIONS="1024" -SHOWOPERS="Yes" DEFPERM="0600" +HUB="" # # load $OPTIONS if present # @@ -119,1063 +66,13 @@ clear clear 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 Settings file was $LAST_VERSION," - echo "And the current version is $IRCD_VERSION." - 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" - DEFLIBS="-lcrypt" - OSNAME="NetBSD" - ;; - *FreeBSD*2.2.*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="-lcrypt" - PTHREADFLAG="-kthread" - OSNAME="FreeBSD 2.2.x" - CRYPT_OPER_PASSWORD="" - CRYPT_LINK_PASSWORD="" - CRYPT_ILINE_PASSWORD="" - CRYPT_XLINE_PASSWORD="" - echo "You are using FreeBSD 2.2.x; do NOT crypt passwords at this time" - ;; - *FreeBSD*2.2*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="none" - PTHREADFLAG="-kthread" - OSNAME="FreeBSD 2.2" - CRYPT_OPER_PASSWORD="" - CRYPT_LINK_PASSWORD="" - CRYPT_ILINE_PASSWORD="" - CRYPT_XLINE_PASSWORD="" - echo "You are using FreeBSD 2.2; do NOT crypt passwords at this time" - ;; - *FreeBSD*4.0*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="-lcrypt" - PTHREADFLAG="-kthread" - OSNAME="FreeBSD 4.0" - CRYPT_OPER_PASSWORD="" - CRYPT_LINK_PASSWORD="" - CRYPT_ILINE_PASSWORD="" - CRYPT_XLINE_PASSWORD="" - echo "You are using FreeBSD 4.0; You can use encrypted passwords now." - ;; - *FreeBSD*3*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="-lcrypt" - PTHREADFLAG="-kthread" - OSNAME="FreeBSD 3.x" - CRYPT_OPER_PASSWORD="" - CRYPT_LINK_PASSWORD="" - CRYPT_ILINE_PASSWORD="" - CRYPT_XLINE_PASSWORD="" - echo "You are using FreeBSD 3.x; You can use encrypted passwords now." - ;; - *FreeBSD*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="none" - PTHREADFLAG="-kthread" - OSNAME="FreeBSD" - CRYPT_OPER_PASSWORD="" - CRYPT_LINK_PASSWORD="" - CRYPT_ILINE_PASSWORD="" - CRYPT_XLINE_PASSWORD="" - echo "You are using FreeBSD ; do NOT crypt passwords at this time" - ;; - *OpenBSD*2*) - DEFCFLAGS="-O -g" - DEFLIBS="none" - MKPASSWDLIBS="" - OSNAME="OpenBSD 2.x" - CRYPT_OPER_PASSWORD="" - CRYPT_LINK_PASSWORD="" - CRYPT_ILINE_PASSWORD="" - CRYPT_XLINE_PASSWORD="" - ;; - *SCO_SV*) - DEFCFLAGS="$DEFOPT -DSCOUNIX" - DEFLIBS="-lsocket" - PTHREADFLAG="-Kthread" - OSNAME="SCO Openserver" - NEEDSKIPNAME="Yep" - echo "You're using SCO Unix. For more support, stskeeps@tspre.org" - ;; - *Apple*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="none" - OSNAME="MacOS X" - ;; - - *OSF1*alpha*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="none" - OSNAME="OSF/1 or Digital Unix" - ;; - *AmigaOS*68020*) - DEFCFLAGS="$DEFOPT -D_AMIGA -m68020" - DEFLIBS="" - OSNAME="AmigaOS (68020)" - ;; - *AmigaOS*68030*) - DEFCFLAGS="$DEFOPT -D_AMIGA -m68030" - DEFLIBS="" - OSNAME="AmigaOS (68030)" - ;; - *AmigaOS*68040*) - DEFCFLAGS="$DEFOPT -D_AMIGA -m68040" - DEFLIBS="" - OSNAME="AmigaOS (68040)" - ;; - *AmigaOS*68060*) - DEFCFLAGS="$DEFOPT -D_AMIGA -m68060" - DEFLIBS="" - OSNAME="AmigaOS (68060)" - ;; - *SunOS*4.*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="none" - PTHREADFLAG="-pthreads" - OSNAME="SunOS 4.x" - ;; - *SunOS*5.*) - DEFCFLAGS="$DEFOPT -DSOL20" - DEFLIBS="-lsocket -lnsl -lresolv" - PTHREADFLAG="-pthreads" - OSNAME="Solaris 2.x (or SunOS 5.x)" - ;; - *IRIX*) - DEFCFLAGS="$DEFOPT -D_USE_BSD" - DEFLIBS="-lbsd" - OSNAME="IRIX" - ;; - *Linux*) - cat > $TMP << __EOF__ -#include -main() -{ - printf("%d\n", -#ifndef __GLIBC__ -0); -#else -__GLIBC__); -#endif -exit(0); -} -__EOF__ - cc $TMP -o $EXEC >/dev/null 2>&1 - GLIBCVERS=`$EXEC` - if [ -n "$GLIBCVERS" -a "$GLIBCVERS" -ge 2 ];then - OSNAME="Linux (with GLIBC 2.x or greater)" - DEFLIBS="-lcrypt -lresolv -ldl" - else - OSNAME="Linux" - DEFLIBS="-ldl" - fi - DEFCFLAGS="$DEFOPT" - ;; - *HP-UX*.09.*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="" - OSNAME="HPUX 9.x" - ;; - *HP-UX*.10.*) - DEFCFLAGS="$DEFOPT" - DEFLIBS="" - OSNAME="HPUX 10.x" - ;; -esac - -echo " " -echo You are running $OSNAME... -echo " " - -# Create Makefile if it doesn't exist... -if [ ! -f Makefile ] ; then - cp Makefile.dist Makefile -fi cat << __EOF__ Welcome to the configuration for the Unreal IRCD. This UnrealIRCD version is: $IRCD_VERSION, Good Luck. -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 - 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 - if [ -z "$CCPATH" ]; then runonce="Yes"; 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 -# - -# Fix mkpasswd Makefile -# -$RM -f crypt/Makefile.tmp -sed -e "s@^LIBS=\(.*\)@LIBS=$MKPASSWDLIBS@" crypt/Makefile > crypt/Makefile.tmp -cp crypt/Makefile.tmp crypt/Makefile -$RM -f crypt/Makefile.tmp - -# Fix modules Makefile -$RM -f crypt/Makefile.tmp -sed -e "s@^PTHREAD=\(.*\)@PTHREAD=$PTHREADFLAG@" src/modules/Makefile > src/modules/Makefile.tmp -cp src/modules/Makefile.tmp src/modules/Makefile -$RM -f src/modules/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 -# -COMP="$CCPATH $XCFLAGS $TMP -o $EXEC $LIBS" -# -echo 'Checking out /usr/include' -echo $n "...Looking for /usr/include/stdlib.h...$c" -if [ -r /usr/include/stdlib.h ] ; then - STDLIBH=define - echo 'found!' -else - echo 'not found :(' -fi -echo $n "...Looking for /usr/include/stddef.h...$c" -if [ -r /usr/include/stddef.h ] ; then - STDDEFH=define - echo 'found!' -else - echo 'not found :(' -fi -echo $n "...Looking for /usr/include/sys/syslog.h...$c" -if [ -r /usr/include/sys/syslog.h ] ; then - SYSSYSLOGH=define - echo 'found!' -else - echo 'not found :(' -fi -#echo $n "...Looking for malloc.h...$c" -#if [ -r /usr/include/malloc.h ] ; then -# MALLOCH=malloc.h -# echo 'found!' -#elif [ -r /usr/include/sys/malloc.h ] ; then -# MALLOCH=sys/malloc.h -# echo 'found!' -#else -# echo 'not found :(' -# MALLOCH=undef -#fi -echo $n "...Looking for /usr/include/sys/param.h...$c" -if [ -r /usr/include/sys/param.h ] ; then - - PARAMH=define - echo 'found!' -else - echo 'not found :(' -fi -echo $n "...Looking for /usr/include/unistd.h...$c" -if [ -r /usr/include/unistd.h ] ; then - UNISTDH=define - echo 'found!' -else - echo 'not found :(' -fi -echo $n "...Looking for /usr/include/string.h...$c" -if [ -r /usr/include/string.h ] ; then - STRINGH=define - echo 'found!' -else - echo 'not found :(' -fi -echo $n "...Looking for /usr/include/strings.h...$c" -if [ -r /usr/include/strings.h ] ; then - STRINGSH=define - echo 'found!' -else - echo 'not found :(' -fi -echo $n "...Looking for /usr/include/sys/rusage.h...$c" -if [ -r /usr/include/sys/rusage.h ] ; then - RUSAGEH=define - echo 'found!' -else - echo 'not found (good!)' -fi - -echo $n "...Looking for /usr/include/openssl/ssl.h...$c" -if [ -r /usr/include/openssl/ssl.h ] ; then - OPENSSL=define - echo 'found!' -else - echo 'not found (you will not be able to do secure connections' - echo 'If you do have it, please type in ln -s /usr/include/openssl' -fi - -echo $n "...Looking for /usr/include/regex.h...$c" -if [ -r /usr/include/regex.h ] ; then - REGEX=define - echo 'found!' -else - echo 'not found :(' - echo $n '*** configuring regex package ***' $n - cd extras/regex - ./configure - make - cd ../.. -fi - -if [ -r /usr/include/openssl/ssl.h ] ; then - echo $n "...Looking where you got the openssl binary...$c" - if [ -r /bin/openssl ] ; then - OPENSSLPATH=/bin/openssl - echo $OPENSSLPATH - elif [ -r /usr/bin/openssl ] ; then - OPENSSLPATH=/usr/bin/openssl - echo $OPENSSLPATH - elif [ -r /usr/sbin/openssl ] ; then - OPENSSLPATH=/usr/sbin/openssl - echo $OPENSSLPATH - elif [ -r /usr/local/bin/openssl ] ; then - OPENSSLPATH=/usr/local/bin/openssl - echo $OPENSSLPATH - elif [ -r /usr/local/ssl/bin/openssl ] ; then - OPENSSLPATH=/usr/local/ssl/bin/openssl - echo $OPENSSLPATH - elif [ -r `which openssl` ] ; then - OPENSSLPATH=`which openssl` - echo $OPENSSLPATH - else - echo "Couldn't find it! (bad)" - OPENSSLPATH=/bin/false - OPENSSLPATH=/bin/false - fi -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 " " -echo $n "Which one, gettimeofday, or lrand48..$c" -cat > $TMP <<__EOF__ -#include -#include -main() - { - struct timeval tv; - (void) gettimeofday(&tv, NULL); - } -__EOF__ -$COMP >/dev/null 2>&1 -if [ $? -eq 0 ] ; then - echo "We have a winner! gettimeofday found." - GETTIMEOFDAY=define -else - echo "No gettimeofday. Lets try lrand48." -cat > $TMP <<__EOF__ -main() -{ - int a; - a=lrand48(); -} -__EOF__ - $COMP >/dev/null 2>&1 - if [ $? -eq 0 ] ; then - echo "Bingo! lrand48!" - LRAND48=define - fi -fi -# -# check for non-blocking fd style available.. -# -echo " " -echo 'Checking for POSIX/BSD/SYSV non-blocking stuff' -if [ -f $TMP -o -d $TMP ] ; then - $RM -f $TMP -fi -cat > $PLATE <<__EOF__ -#include -#include -#include -#include -#include -#include -alarmed() -{ - exit(1); -} -main() -{ - char b[12], x[32]; - int f, l = sizeof(x); - f = socket(AF_INET, SOCK_DGRAM, 0); - if (f >= 0 && !(fcntl(f, F_SETFL, BLOCKING))) { - signal(SIGALRM, alarmed); - alarm(3); - recvfrom(f, b, 12, 0, x, &l); - alarm(0); - exit(0); - } - exit(1); -} -__EOF__ -sed -e 's/BLOCKING/O_NONBLOCK/' $PLATE > $TMP -$COMP >/dev/null 2>&1 -if [ 0 -eq $? ] ; then - $EXEC -fi -if [ 0 -eq $? ] ; then - BLOCK=O_NONBLOCK -else - echo 'O_NONBLOCK not present/working in fcntl.h or sys/ioctl.h' - if [ -f $TMP -o -d $TMP ] ; then - $RM -f $TMP $EXEC; - fi - sed -e 's/BLOCKING/O_NDELAY/' $PLATE > $TMP - $COMP >/dev/null 2>&1 - if [ 0 -eq $? ] ; then - $EXEC - fi - if [ 0 -eq $? ] ; then - BLOCK=O_NDELAY - else - echo 'O_NDELAY not present/working in fcntl.h or sys/ioctl.h' - if [ -f $TMP -o -d $TMP ] ; then - $RM -f $TMP $EXEC; - fi - sed -e 's/BLOCKING/FIONBIO/' $PLATE > $TMP - $COMP >/dev/null 2>&1 - if [ 0 -eq $? ] ; then - echo 'FIONBIO not found! No option found!' - BLOCK=none - else - BLOCK=FIONBIO - fi - fi -fi -$RM -f $TMP $PLATE $EXEC -echo "Blocking selected: $BLOCK"; -# -# reliable signals ? -# -echo 'Looking for reliable signals...' -echo "Hmmm...wonder if you have 'action from POSIX..." -cat > $TMP <<__EOF__ -#include - -main() -{ /* poor replacement for NULL but who cares here ? */ - sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L); -} -__EOF__ -$COMP >/dev/null 2>&1 -if [ $? -eq 0 ] ; then - echo "Ooooh, you are a lucky one! 'action from POSIX!" - SIGNAL=posix -else - $RM -f $EXEC $TMP - cat > $TMP <<__EOF__ -#include -int calls = 0; -void handler() -{ - if (calls) - return; - calls++; - kill(getpid(), SIGTERM); - sleep(1); -} -main() -{ - signal(SIGTERM, handler); - kill(getpid(), SIGTERM); - exit (0); -} -__EOF__ - echo $n "Nope, but you have...$c" - $COMP >/dev/null 2>&1 - $EXEC - if [ $? -eq 0 ] ; then - echo 'reliable signals! Cheers BSD!' - SIGNAL=bsd - else - echo "yucky, unreliable SYSV!" - SIGNAL=sysv - fi -fi -$RM -f $EXEC $TMP -# -echo 'Now those strings libraries...hmm...which one is it...' -cat > $TMP <<__EOF__ -#$STRINGH STRINGH -#$STRINGSH STRINGSH -#ifdef STRINGH -#include -#endif -#ifdef STRINGSH -#include -#endif -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 -# -# getrusage or times ? -# -echo $n "One for debugging, mainly, getrusage(2) or times(2)...$c" -cat > $TMP <<__EOF__ -#include -#include -#include -main() -{ - struct rusage rus; - (void)getrusage(RUSAGE_SELF, &rus); -} -__EOF__ -$COMP >/dev/null 2>&1 -if [ $? -eq 0 ] ; then - TIMES=getrusage - echo "getrusage()" -else - $RM -f $EXEC $TMP - cat > $TMP <<__EOF__ -#include -#include -#include -main() -{ - struct tms tmsbuf; - (void)times(&tmsbuf); -} -__EOF__ - $COMP >/dev/null 2>&1 - if [ $? -eq 0 ] ; then - TIMES=times - echo "times()" - else - echo "couldn't get either ?!" - TIMES=none - fi -fi -# -# Can we set the core size to unlimited -# - -echo $n "Can we set the core size to unlimited...$c" -cat > $TMP <<__EOF__ -#include -#include -#include -main() { - struct rlimit corelim; - corelim.rlim_cur = corelim.rlim_max = RLIM_INFINITY; - if (setrlimit(RLIMIT_CORE, &corelim)) - exit(1); - exit(0); -} -__EOF__ - -$COMP >/dev/null 2>&1 -if [ $? -ne 0 ] ; then - echo " no" - FORCECORE=undef -else - $EXEC - if [ $? -ne 1 ] ; then - echo " yes" - else - echo " no" - FORCECORE=undef - fi -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 -cat > $TMP <<__EOF__ -main() -{ - char *s = strerror(0); - exit(0); -} -__EOF__ -$COMP >/dev/null 2>&1 -if [ $? -ne 0 ] ; then - echo $n " strerror$c" - NSTRERROR=define -fi -$RM -f $EXEC $TMP -cat > $TMP <<__EOF__ -#include -#include -#include -#include - -main() -{ - dn_skipname("",""); - exit(0); -} -__EOF__ -$COMP >/dev/null 2>&1 -if [ $? -ne 0 -o "$OSNAME" = "Linux RedHat 5.0" -o -n "$NEEDSKIPNAME" ] ; then - echo $n " dn_skipname$c" - $RM -f Makefile.tmp - sed -e "s@^RES=\(.*\)@RES=res_skipname.o@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else if [ $? -ne 0 -o "$OSNAME" = "Linux RedHat 5.1" -o -n "$NEEDSKIPNAME" ] ; then - echo $n " dn_skipname$c" - $RM -f Makefile.tmp - sed -e "s@^RES=\(.*\)@RES=res_skipname.o@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else - $RM -f Makefile.tmp - sed -e "s@^RES=\(.*\)@RES=@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -fi -fi -$RM -f $EXEC $TMP -cat > $TMP <<__EOF__ -#include -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__ -#$STRINGH STRINGH -#$STRINGSH STRINGSH -#ifdef STRINGH -#include -#endif -#ifdef STRINGSH -#include -#endif -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__ -#$STRINGH STRINGH -#$STRINGSH STRINGSH -#ifdef STRINGH -#include -#endif -#ifdef STRINGSH -#include -#endif -main() -{ - char t[] = "a\0", *s; - 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 -#include -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 -#include -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 -#include -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 -echo " " -$RM -f $EXEC $TMP -cat > $TMP << __EOF__ -#include -main() -{ - strcasecmp("moo", "moo"); -} -__EOF__ -$COMP -# >/dev/null 2>&1 -if [ $? -ne 0 ] ; then - echo $n " strcasecmp $c " - STRCASECMP=undef -else - STRCASECMP=define -fi -$RM -f $EXEC $TMP - -# -# -# -echo " " -echo "Ok, here's your chance...I think you should use $BLOCK, you want" -echo "which of these ? O_NONBLOCK (POSIX) O_NDELAY (BSD) FIONBIO (SYSV)" -echo $n "[$BLOCK] -> $c" -if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then - read cc -else - cc="" -fi -if [ "$cc" = "none" ] ; then - cc='' -elif [ -z "$cc" ] ; then - cc=$BLOCK -fi -BLOCK=$cc -echo "I found $SIGNAL signals." -if [ "$cc" = "none" ] ; then - cc='' -elif [ "$SIGNAL" = "posix" ] ; then - echo "Hmmm...I'm not sure if signal() is reliable or not either..." -fi -echo "You can choose between posix, bsd and sysv. What'll it be ?" -echo $n "[$SIGNAL] -> $c" -if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then - read cc -else - cc="" -fi -if [ "$cc" = "none" ] ; then - cc='' -elif [ -z "$cc" ] ; then - cc=$SIGNAL -fi -SIGNAL=$cc -if [ "$TIMES" = "none" ] ; then - echo "I didn't find either getrusage or times earlier...If you do have" - echo "either of these, please tell me now." -else - echo "I found $TIMES, out of getrusage and times. getrusage is" - echo "more informative. If you wish to swap your choice, please" - echo "do so now." -fi -echo $n "[$TIMES] -> $c" -if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then - read cc -else - cc="" -fi -if [ "$cc" = "none" ] ; then - cc='' -elif [ -z "$cc" ] ; then - cc=$TIMES -fi -TIMES=$cc - -$RM -f $EXEC $TMP $PLATE -cat > $SETUP <<__EOF__ -#ifndef __setup_include__ -#define __setup_include__ -#$PARAMH PARAMH -#$UNISTDH UNISTDH -#$STRINGH STRINGH -#$STRINGSH STRINGSH -#$STDLIBH STDLIBH -#$STDDEFH STDDEFH -#$SYSSYSLOGH SYSSYSLOGH -#$NOINDEX NOINDEX -#$FORCECORE FORCE_CORE -#$NSTRERROR NEED_STRERROR -#$NSTRTOKEN NEED_STRTOKEN -#$NSTRTOK NEED_STRTOK -#$NINETADDR NEED_INET_ADDR -#$NINETNTOA NEED_INET_NTOA -#$NINETNETOF NEED_INET_NETOF -#$GETTIMEOFDAY GETTIMEOFDAY -#$LRAND48 LRAND48 -#$STRCASECMP GOT_STRCASECMP -__EOF__ -if [ "$MALLOCH" = "undef" ] ; then - echo "#undef MALLOCH" >> $SETUP -else - echo "#define MALLOCH <$MALLOCH>" >> $SETUP -fi -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 -if [ "$BLOCK" = "O_NONBLOCK" ] ; then - echo "#define NBLOCK_POSIX" >> $SETUP -elif [ "$BLOCK" = "O_NDELAY" ] ; then - echo "#define NBLOCK_BSD" >> $SETUP -else - echo "#define NBLOCK_SYSV" >> $SETUP -fi -if [ "$SIGNAL" = "posix" ] ; then - echo "#define POSIX_SIGNALS" >> $SETUP -elif [ "$SIGNAL" = "bsd" ] ; then - echo "#define BSD_RELIABLE_SIGNALS" >> $SETUP -else - echo "#define SYSV_UNRELIABLE_SIGNALS" >> $SETUP -fi -if [ "$TIMES" = "times" ] ; then - echo "#define TIMES_2" >> $SETUP - echo "#undef GETRUSAGE_2" >> $SETUP -elif [ "$TIMES" = "getrusage" ] ; then - echo "#undef TIMES_2" >> $SETUP - echo "#define GETRUSAGE_2" >> $SETUP -else - echo "#undef TIMES_2" >> $SETUP - echo "#undef GETRUSAGE_2" >> $SETUP -fi -echo "#endif" >> $SETUP - FOO="" runonce="" while [ -z "$FOO" ] ; do @@ -1196,19 +93,6 @@ while [ -z "$FOO" ] ; do echo "if your OS is secure or not." echo "" - if [ "$OSNAME" = "FreeBSD 2.2" ]; then - echo "Your version of FreeBSD is 2.2-Release or later, so you do not" - echo "need to run nospoof." - echo "" - FOO=No - fi - - if [ "$OSNAME" = "FreeBSD" ]; then - echo "If your version of FreeBSD is 2.2-Release or later, you do not" - echo "need to run nospoof." - echo "" - fi - echo "Do you have an insecure operating system and therefore want to" echo "use the server anti-spoof protection?" echo $n "[$FOO] -> $c" @@ -1285,8 +169,7 @@ while [ -z "$FOO" ] ; do FOO="Hub" fi echo "" - echo "Would you like to compile as a Halfhub or as a leaf?" - echo "The halfhub will be a real hub if set so in unrealircd.conf" + echo "Would you like to compile as a hub or as a leaf?" echo "Type Hub for selecting hub and Leaf for a leaf.." echo $n "[$FOO] -> $c" if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then @@ -1355,7 +238,6 @@ done DEFPERM=$cc -if [ -n "$OPENSSL" ] ; then FOO="" runonce="" while [ -z "$FOO" ] ; do @@ -1379,7 +261,6 @@ while [ -z "$FOO" ] ; do case "$cc" in [Yy]*) CRYPTOIRCD="1" - CRYPTOLIB="-lssl -lcrypto" ;; [Nn]*) CRYPTOIRCD="" @@ -1392,7 +273,6 @@ while [ -z "$FOO" ] ; do ;; esac done -fi FOO="" runonce="" @@ -1632,8 +512,7 @@ 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 "How many buffer pools would you like (number * MAXSENDQLENGTH) ?" echo $n "[$FOO] -> $c" if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then read cc @@ -1645,33 +524,18 @@ while [ -z "$FOO" ] ; do 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="" + BUFFERPOOL="$cc" ;; esac done + echo "" echo "" -$CCPATH -o src/fdmaxcounter src/fdmaxcounter.c -src/fdmaxcounter FOO="" runonce="" while [ -z "$FOO" ] ; do -if [ "$OSNAME" = "Linux" ] ; then - FOO="256" -elif [ "$OSNAME" = "Linux (with GLIBC 2.x or greater)" ] ; then - FOO="256" -else FOO="$MAXCONNECTIONS" -fi echo "" echo "How many file descriptors (or sockets) can the irc server use?" echo "(The result above, if any - shows how many sockets that the ircd can use", @@ -1698,233 +562,9 @@ fi ;; esac done - -# -# check FD_SETSIZE and override if needed. -# - -cat > $TMP <<__EOF__ -#include -#include - -#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 derrive 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 derrive 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 - -if [ -n "$CRYPTOLIB" ] ; then - $RM -f Makefile.tmp - sed -e "s@^CRYPTOLIB=\(.*\)@CRYPTOLIB=$CRYPTOLIB@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else - $RM -f Makefile.tmp - sed -e "s@^CRYPTOLIB=\(.*\)@CRYPTOLIB=@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp - -fi - -if [ -n "$CRYPTOIRCD" ] ; then - $RM -f Makefile.tmp - sed -e "s@^OPENSSLPATH=\(.*\)@OPENSSLPATH=$OPENSSLPATH@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else - $RM -f Makefile.tmp - sed -e "s@^OPENSSLPATH=\(.*\)@OPENSSLPATH=@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -fi - -if [ -n "$OPENSSL_OTHERPLACE" ] ; then - $RM -f Makefile.tmp - sed -e "s@^OPENSSLINCLUDE=\(.*\)@OPENSSLINCLUDES=-I/usr/local/ssl/include/openssl@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else - $RM -f Makefile.tmp - sed -e "s@^OPENSSLINCLUDE=\(.*\)@OPENSSLINCLUDES=@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -fi - -if [ -n "$REGEX" ] ; then - $RM -f Makefile.tmp - sed -e "s@^REGEX=\(.*\)@REGEX=@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else - $RM -f Makefile.tmp - sed -e "s@^REGEX=\(.*\)@REGEX=../extras/regex/regex.o@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -fi - -$RM -f $EXEC $TMP - -$RM -f ./core -# -# create the $OPTIONS_H file -# -rm -f $OPTIONS_H -cat > $OPTIONS_H << __EOF__ - -/* - * VERSION: $IRCD_VERSION - * DATE: $CONF_DATE - * OS: $OSNAME - * - * You shouldn't have to edit this file, if you really need to change - * something, i'd suggest running Config again. - */ - -#define MYOSNAME "$OS" -#define DPATH "$DPATH" -#define SPATH "$SPATH" -#define DOMAINNAME "$DOMAINNAME" -#define LISTEN_SIZE $LISTEN_SIZE -#define MAXSENDQLENGTH $MAXSENDQLENGTH -#define BUFFERPOOL $BUFFERPOOL -#define MAXCONNECTIONS $MAXCONNECTIONS -#define NICKNAMEHISTORYLENGTH $NICKNAMEHISTORYLENGTH -__EOF__ -if [ "$DEFPERM" != "0" ] ; then - echo "#define DEFAULT_PERMISSIONS $DEFPERM" >> $OPTIONS_H -else - echo "#undef DEFAULT_PERMISSIONS" >> $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 "$CRYPTOIRCD" ] ; then - echo "#define USE_SSL 1" >> $OPTIONS_H -else - echo "#undef USE_SSL" >> $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 "$CRYPT_ILINE_PASSWORD" ] ; then - echo "#define CRYPT_ILINE_PASSWORD 1" >> $OPTIONS_H -else - echo "#undef CRYPT_ILINE_PASSWORD" >> $OPTIONS_H -fi -if [ -n "$CRYPT_XLINE_PASSWORD" ] ; then - echo "#define CRYPT_XLINE_PASSWORD 1" >> $OPTIONS_H -else - echo "#undef CRYPT_XLINE_PASSWORD" >> $OPTIONS_H -fi -if [ -n "$HUB" ] ; then - echo "#define HUB 1" >> $OPTIONS_H -else - echo "#undef HUB" >> $OPTIONS_H -fi - -if [ -n "$REGEX" ] ; then - echo "#define HAVE_REGEX 1" >> $OPTIONS_H -else - echo "#undef HAVE_REGEX" >> $OPTIONS_H -fi - -if [ -n "$NOSPOOF" ] ; then - echo "#define NOSPOOF 1" >> $OPTIONS_H -else - echo "#undef NOSPOOF" >> $OPTIONS_H -fi - -if [ "$OSNAME" = "Linux (with GLIBC 2.x or greater)" ]; then - echo "#define GLIBC2_x" >> $OPTIONS_H -fi - -# -# create the persistant file -# rm -f $OPTIONS cat > $OPTIONS << __EOF__ # -# VERSION: $IRCD_VERSION -# DATE: $CONF_DATE -# OS: $OSNAME -# -# You shouldn't have to edit this file, if you really need to change -# something, i'd suggest running Config again. -# -# -IRCNET="$IRCNET" -LAST_VERSION="$IRCD_VERSION" NOSPOOF="$NOSPOOF" DPATH="$DPATH" SPATH="$SPATH" @@ -1941,22 +581,41 @@ HUB="$HUB" DOMAINNAME="$DOMAINNAME" DEFPERM="$DEFPERM" __EOF__ - -if [ "$OSNAME" = "Linux (with GLIBC 2.x or greater)" ]; then - echo "GLIBC2_x="YES"" >> $OPTIONS - echo "" +ARG="" +if [ "$NOSPOOF" = "1" ] ; then +ARG="$ARG--enable-nospoof " fi - -if [ -n "$CRYPTOIRCD" ] ; then - if [ ! -f server.req.pem ]; then - echo "Using openssl in $OPENSSLPATH .." - export OPENSSLPATH - make pem - cat .SICI - read cc - fi +if [ -n "$HUB" ] ; then +ARG="$ARG--enable-hub " fi - +if [ "$CRYPTOIRCD" = "1" ] ; then +ARG="$ARG--enable-ssl " +fi +if [ "$CRYPT_OPER_PASSWORD" = "1" ] ; then +ARG="$ARG--with-crypt-oper " +fi +if [ "$CRYPT_LINK_PASSWORD" = "1" ] ; then +ARG="$ARG--with-crypt-link " +fi +if [ "$CRYPT_XLINE_PASSWORD" = "1" ] ; then +ARG="$ARG--with-crypt-xline " +fi +if [ "$CRYPT_ILINE_PASSWORD" = "1" ] ; then +ARG="$ARG--with-crypt-iline " +fi +ARG="$ARG--with-listen=$LISTEN_SIZE " +ARG="$ARG--with-dpath=$DPATH " +ARG="$ARG--with-spath=$SPATH " +ARG="$ARG--with-nick-history=$NICKNAMEHISTORYLENGTH " +ARG="$ARG--with-sendq=$MAXSENDQLENGTH " +ARG="$ARG--with-bufferpool=$BUFFERPOOL " +ARG="$ARG--with-hostname=$DOMAINNAME " +ARG="$ARG--with-permissions=$DEFPERM " +ARG="$ARG--with-fd-setsize=$MAXCONNECTIONS " +ARG="$ARG--enable-dynamic-linking " +CONF="./configure $ARG" +echo $CONF +$CONF cat << __EOF__ _____________________________________________________________________ diff --git a/Makefile.dist b/Makefile.dist deleted file mode 100644 index 0e21cabdc..000000000 --- a/Makefile.dist +++ /dev/null @@ -1,239 +0,0 @@ -#/************************************************************************ -#* IRC - Internet Relay Chat, Makefile -#* Copyright (C) 1990, Jarkko Oikarinen -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 1, or (at your option) -#* any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* $Id$ -#*/ - -CC=gcc -INCLUDEDIR=../include -NETWORKSDIR= -FROMDOS=/home/cmunk/bin/4dos -# [CHANGEME] -# Default flags: -# Change XCFLAGS if you don't like what Config puts there. Same with -# IRCDLIBS. -# -# If you are configuring by hand, try "-O -g" for XCFLAGS, and leave -# IRCDLIBS blank. If that fails, try recomendations below. -# -XCFLAGS= -IRCDLIBS= -CRYPTOLIB= -OPENSSLINCLUDES= - -# -# use the following on MIPS: -#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR) -# For Irix 4.x (SGI), use the following: -#CFLAGS= -g -cckr -I$(INCLUDEDIR) -# -# on NEXT use: -#CFLAGS=-bsd -I$(INCLUDEDIR) -#on NeXT other than 2.0: -#IRCDLIBS=-lsys_s -# -# AIX 370 flags -#CFLAGS=-D_BSD -Hxa -I$(INCLUDEDIR) -#IRCDLIBS=-lbsd -# -# Dynix/ptx V2.0.x -#CFLAGS= -I$(INCLUDEDIR) -O -Xo -#IRCDLIBS= -lsocket -linet -lnsl -lseq -# -# Dynix/ptx V1.x.x -#IRCDLIBS= -lsocket -linet -lnsl -lseq -# -#use the following on SUN OS without nameserver libraries inside libc -#IRCDLIBS=-lresolv -# -# Solaris 2 -#IRCDLIBS=-lsocket -lnsl -lresolv -L/usr/ucblib -R/usr/ucblib -lgen -# -# ESIX -#CFLAGS=-O -I$(INCLUDEDIR) -I/usr/ucbinclude -#IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl -# -# LDFLAGS - flags to send the loader (ld). SunOS users may want to add -# -Bstatic here. -# -#LDFLAGS=-Bstatic -# -#Dell SVR4 -#CC=gcc -#CFLAGS= -I$(INCLUDEDIR) -O2 -#IRCDLIBS=-lsocket -lnsl -lucb - -# [CHANGEME] -# IRCDMODE is the mode you want the binary to be. -# The 4 at the front is important (allows for setuidness) -# -# WARNING: if you are making ircd SUID or SGID, check config.h to make sure -# you are not defining CMDLINE_CONFIG -IRCDMODE = 711 - -# [CHANGEME] -# IRCDDIR must be the same as DPATH in include/config.h -# -IRCDDIR=/usr/local/lib/ircd - -# [CHANGEME] -# Some SunOS versions want this. Try it without first. -#RES=res_init.o res_comp.o res_mkquery.o -# BSDI systems want this. -#RES=res_skipname.o -# The rest are perfectly content with this. -RES= - -# -# If your system is lacking regex, uncomment this line -# -#REGEX=../extras/regex/regex.o -REGEX= - -# [CHANGEME] -# If you get a compile-time error dealing with u_int32_t, comment out -# this line. -# NEED_U_INT32_T= -DNEED_U_INT32_T -NEED_U_INT32_T= - -# [CHANGEME] -# If you get a link-time error dealing with strtoul, comment out -# this line. -# STRTOUL= strtoul.o -STRTOUL= - -# [CHANGEME] -# If you get crashes around a specific number of clients, and that client -# load comes close or a little over the system-defined value of FD_SETSIZE, -# override it here and see what happens. -FD_SETSIZE= - -# Where is your openssl binary -OPENSSLPATH= - -CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(NEED_U_INT32_T) $(FD_SETSIZE) - -SHELL=/bin/sh -SUBDIRS=src -BINDIR=$(IRCDDIR) -MANDIR=/usr/local/man -INSTALL=/usr/bin/install -RM=rm -CP=cp -TOUCH=touch - -all: build - -MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \ - 'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \ - 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \ - 'INCLUDEDIR=${INCLUDEDIR}' 'IRCDDIR=${IRCDDIR}' \ - 'MANDIR=${MANDIR}' 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \ - 'RES=${RES}' 'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \ - 'CRYPTOLIB=${CRYPTOLIB}' 'REGEX=${REGEX}' \ - 'CRYPTOINCLUDES=${CRYPTOINCLUDES}' - -server: -build: - -@if [ ! -f include/setup.h ] ; then \ - echo "Hmm...doesn't look like you've run Config..."; \ - echo "Doing so now."; \ - sh Config; \ - fi - @for i in $(SUBDIRS); do \ - echo "Building $$i";\ - ( cd $$i; ${MAKE} ${MAKEARGS} build; ) \ - done - @echo ' __________________________________________________ ' - @echo '| Compile is now complete. Now you have to go do |' - @echo '| The load-time configuration - try go read the |' - @echo '| file "dynconf" using your favourite viewer or |' - @echo '| editor. The file will contain instructions on how|' - @echo '| to do the dynamic configuration :) |' - @echo '| You might want to see include/config.h to adjust |' - @echo '| some settings |' - @echo '| |' - @echo '| If you really like UnrealIRCd, and would like to |' - @echo '| make a donation, please read the Donation file in|' - @echo '| this archive. :) |' - @echo '| |' - @echo '| Thanks for using Unreal IRCd! If you are in need |' - @echo '| for any kind of help regarding the IRCd please |' - @echo '| read the Unreal.nfo file. |' - @echo '|__________________________________________________|' - -clean: - $(RM) -f *~ \#* core *.orig include/*.orig - @for i in $(SUBDIRS); do \ - echo "Cleaning $$i";\ - ( cd $$i; ${MAKE} ${MAKEARGS} clean; ) \ - done - -@if [ -f include/setup.h ] ; then \ - echo "To really restart installation, remove include/setup.h" ; \ - fi - -@if [ -f include/settings.h ] ; then \ - echo "and include/settings.h" ; \ - fi - -cleandir: clean - rm -rf include/networks.h include/setup.h include/settings.h Makefile Settings - -makex: - chmod +x Config newnet ircd ircdcron/ircdchk killircd - chmod +x makeconf rehash ircdreg - -fromdos: cleandir - $(FROMDOS) -dv * - $(FROMDOS) -dv src/* - $(FROMDOS) -dv include/* - $(FROMDOS) -dv doc/* - $(FROMDOS) -dv crypt/* - $(FROMDOS) -dv ircdcron/* -makedist: makex - echo "Stamping.." - -stamp: makedist - echo "/* Auto created release stamping */" > include/stamp.h - echo "#define RELEASEID2 \"`date +%s`\"" >> include/stamp.h - echo "#define RELEASESTUFF \"`hostname`\"" >> include/stamp.h - echo "" >> include/stamp.h - -depend: - @for i in $(SUBDIRS); do \ - echo "Making dependencies in $$i";\ - ( cd $$i; ${MAKE} ${MAKEARGS} depend; ) \ - done - -install: all - @echo "Now install by hand; make install is broken." - -pem: src/ssl.cnf - @echo "Generating certificate request .. " - $(OPENSSLPATH) req -new \ - -config src/ssl.cnf -out server.req.pem \ - -keyout server.key.pem -nodes - @echo "Generating self-signed certificate .. " - $(OPENSSLPATH) req -x509 -days 365 -in server.req.pem \ - -key server.key.pem -out server.cert.pem - @echo "Generating fingerprint .." - $(OPENSSLPATH) x509 -subject -dates -fingerprint -noout \ - -in server.cert.pem - @echo "Setting o-rwx & g-rwx for files... " - chmod o-rwx server.req.pem server.key.pem server.cert.pem - chmod g-rwx server.req.pem server.key.pem server.cert.pem - @echo "Done!." diff --git a/config2/configure.in b/config2/configure.in index 5f6e583ef..cbe5d1303 100644 --- a/config2/configure.in +++ b/config2/configure.in @@ -271,7 +271,7 @@ AC_DEFINE_UNQUOTED(NICKNAMEHISTORYLENGTH,$withval), AC_DEFINE(NICKNAMEHISTORYLEN AC_ARG_WITH(sendq, [ --with-sendq=maxsendq Specify the max sendq for the server], AC_DEFINE_UNQUOTED(MAXSENDQLENGTH,$withval),AC_DEFINE(MAXSENDQLENGTH,3000000)) AC_ARG_WITH(bufferpool, [ --with-bufferpool=size Specify the size of the buffer pool], -AC_DEFINE_UNQUOTED(BUFFERPOOL,$withval),AC_DEFINE(BUFFERPOOL,[(9 * MAXSENDQLENGTH)])) +AC_DEFINE_UNQUOTED(BUFFERPOOL,[($withval * MAXSENDQLENGTH)]),AC_DEFINE(BUFFERPOOL,[(9 * MAXSENDQLENGTH)])) AC_ARG_WITH(hostname, [ --with-hostname=host Specify the local hostname of the server], AC_DEFINE_UNQUOTED(DOMAINNAME,"$withval"),AC_DEFINE_UNQUOTED(DOMAINNAME,"`hostname`")) AC_DEFINE_UNQUOTED(MYOSNAME,"`uname -a`") diff --git a/configure b/configure index 5daf45b15..eb30db9fc 100755 --- a/configure +++ b/configure @@ -3526,7 +3526,7 @@ fi if test "${with_bufferpool+set}" = set; then withval="$with_bufferpool" cat >> confdefs.h <