diff --git a/Changes b/Changes index 7acf31209..e5e3c9865 100644 --- a/Changes +++ b/Changes @@ -613,8 +613,12 @@ seen. gmtime warning still there - Added configure check for glob.h - Added the ability to use file globs in loadmodule and include (only if your system has glob) - Added ./Config option to enable IPv6 (and made a configure check to make sure we can) -- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS +- Fixed autoconf/Makefile screwup caused by codemastr +- Fixed a problem with IPv6 always enabled (could you check this fix, code?) - Fixed a bug allowing channek keys to have spaces - Cleaned up some thread porting code - Added a new versioning system to allow easy tracking of bugs +- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS - Fixed makeconf +- Changed the way modules work. We're now at MOD_VERSION 2 +- Changed ALL MODULES to version 2 diff --git a/autoconf/Makefile b/autoconf/Makefile index 0b0392d50..5402a68ef 100644 --- a/autoconf/Makefile +++ b/autoconf/Makefile @@ -1,233 +1,3 @@ -# Generated automatically from Makefile.in by configure. -#/************************************************************************ -#* 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=-O -g -export-dynamic -pthread -DSCAN_API=1 -IRCDLIBS=-ldescrypt -lcrypt -CRYPTOLIB= -OPENSSLINCLUDES= - -XCFLAGS=-g -O2 -D_THREAD_SAFE -pthread -# -# 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 - - -# -# 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=/usr/bin/openssl - -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=/bin/rm -CP=/bin/cp -TOUCH=/usr/bin/touch -RES= -all: build - -MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \ - 'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \ - 'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \ - 'INCLUDEDIR=${INCLUDEDIR}' 'IRCDDIR=${IRCDDIR}' \ - 'MANDIR=${MANDIR}' 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \ - '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 - -cleandir: clean - rm -rf include/networks.h include/setup.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!." +all: + @autoconf + cp configure .. \ No newline at end of file diff --git a/autoconf/configure.in b/autoconf/configure.in index 2858bd1ae..4312b554f 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -69,14 +69,13 @@ exit(1); exit(0); } ], ac_cv_ip6=yes, ac_cv_ip6=no) -]) - ]) if test "$ac_cv_ip6" = "no"; then AC_MSG_WARN(Your system does not support IPv6 so it will not be enabled) else AC_DEFINE(INET6) fi +]) AC_CHECK_HEADER(sys/param.h,AC_DEFINE(PARAMH)) AC_CHECK_HEADER(stdlib.h,AC_DEFINE(STDLIBH)) AC_CHECK_HEADER(stddef.h,AC_DEFINE(STDDEFH)) diff --git a/configure b/configure index 8cfcb092a..c6563ae53 100755 --- a/configure +++ b/configure @@ -1052,16 +1052,8 @@ openssl=no -if test "$ac_cv_ip6" = "no"; then -echo "configure: warning: Your system does not support IPv6 so it will not be enabled" 1>&2 -else -cat >> confdefs.h <<\EOF -#define INET6 1 -EOF - -fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1065: checking how to run the C preprocessor" >&5 +echo "configure:1057: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1076,13 +1068,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1093,13 +1085,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1110,13 +1102,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1142,17 +1134,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "sys/param.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/param.h""... $ac_c" 1>&6 -echo "configure:1146: checking for sys/param.h" >&5 +echo "configure:1138: checking for sys/param.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1178,17 +1170,17 @@ fi ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6 -echo "configure:1182: checking for stdlib.h" >&5 +echo "configure:1174: checking for stdlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1214,17 +1206,17 @@ fi ac_safe=`echo "stddef.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for stddef.h""... $ac_c" 1>&6 -echo "configure:1218: checking for stddef.h" >&5 +echo "configure:1210: checking for stddef.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1250,17 +1242,17 @@ fi ac_safe=`echo "sys/syslog.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/syslog.h""... $ac_c" 1>&6 -echo "configure:1254: checking for sys/syslog.h" >&5 +echo "configure:1246: checking for sys/syslog.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1286,17 +1278,17 @@ fi ac_safe=`echo "unistd.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for unistd.h""... $ac_c" 1>&6 -echo "configure:1290: checking for unistd.h" >&5 +echo "configure:1282: checking for unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1322,17 +1314,17 @@ fi ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for string.h""... $ac_c" 1>&6 -echo "configure:1326: checking for string.h" >&5 +echo "configure:1318: checking for string.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1358,17 +1350,17 @@ fi ac_safe=`echo "strings.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for strings.h""... $ac_c" 1>&6 -echo "configure:1362: checking for strings.h" >&5 +echo "configure:1354: checking for strings.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1394,17 +1386,17 @@ fi ac_safe=`echo "regex.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for regex.h""... $ac_c" 1>&6 -echo "configure:1398: checking for regex.h" >&5 +echo "configure:1390: checking for regex.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1438,17 +1430,17 @@ fi ac_safe=`echo "openssl/ssl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for openssl/ssl.h""... $ac_c" 1>&6 -echo "configure:1442: checking for openssl/ssl.h" >&5 +echo "configure:1434: checking for openssl/ssl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1471,17 +1463,17 @@ fi ac_safe=`echo "malloc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for malloc.h""... $ac_c" 1>&6 -echo "configure:1475: checking for malloc.h" >&5 +echo "configure:1467: checking for malloc.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1507,17 +1499,17 @@ fi ac_safe=`echo "sys/rusage.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/rusage.h""... $ac_c" 1>&6 -echo "configure:1511: checking for sys/rusage.h" >&5 +echo "configure:1503: checking for sys/rusage.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1543,17 +1535,17 @@ fi ac_safe=`echo "glob.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for glob.h""... $ac_c" 1>&6 -echo "configure:1547: checking for glob.h" >&5 +echo "configure:1539: checking for glob.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1578,12 +1570,12 @@ else fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1582: checking for working const" >&5 +echo "configure:1574: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1653,21 +1645,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1657: checking for inline" >&5 +echo "configure:1649: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1693,12 +1685,12 @@ EOF esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1697: checking for ANSI C header files" >&5 +echo "configure:1689: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1706,7 +1698,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1723,7 +1715,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1741,7 +1733,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1762,7 +1754,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1773,7 +1765,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1797,12 +1789,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1801: checking for size_t" >&5 +echo "configure:1793: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1830,12 +1822,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1834: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1826: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1844,7 +1836,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1865,12 +1857,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1869: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:1861: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1878,7 +1870,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:1882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1899,12 +1891,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:1903: checking for uid_t in sys/types.h" >&5 +echo "configure:1895: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1933,13 +1925,13 @@ EOF fi echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:1937: checking for u_int32_t" >&5 +echo "configure:1929: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_u_int32_t=yes else @@ -1970,7 +1962,7 @@ if test "$ac_cv_u_int32_t" = "no"; then NEED_UINT32_T="-DNEED_U_INT32_T" fi echo $ac_n "checking what kind of nonblocking sockets you have""... $ac_c" 1>&6 -echo "configure:1974: checking what kind of nonblocking sockets you have" >&5 +echo "configure:1966: checking what kind of nonblocking sockets you have" >&5 if eval "test \"`echo '$''{'ac_cv_nonblocking'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1979,7 +1971,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -2008,7 +2000,7 @@ exit(1); } EOF -if { (eval echo configure:2012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_nonblocking=O_NONBLOCK else @@ -2020,7 +2012,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -2048,7 +2040,7 @@ exit(0); exit(1); } EOF -if { (eval echo configure:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_nonblocking=O_NDELAY else @@ -2060,7 +2052,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -2088,7 +2080,7 @@ exit(0); exit(1); EOF -if { (eval echo configure:2092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_nonblocking=FIONBIO else @@ -2129,13 +2121,13 @@ EOF fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2133: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2125: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -2153,7 +2145,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2175,7 +2167,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:2179: checking whether setpgrp takes no argument" >&5 +echo "configure:2171: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2183,7 +2175,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -2227,7 +2219,7 @@ EOF fi echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -echo "configure:2231: checking whether setvbuf arguments are reversed" >&5 +echo "configure:2223: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2235,7 +2227,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < /* If setvbuf has the reversed format, exit 0. */ @@ -2249,7 +2241,7 @@ main () { exit(0); /* Non-reversed systems segv here. */ } EOF -if { (eval echo configure:2253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes else @@ -2273,7 +2265,7 @@ EOF fi echo $ac_n "checking if we can set the core size to unlimited""... $ac_c" 1>&6 -echo "configure:2277: checking if we can set the core size to unlimited" >&5 +echo "configure:2269: checking if we can set the core size to unlimited" >&5 if eval "test \"`echo '$''{'ac_cv_force_core'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2282,7 +2274,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -2297,7 +2289,7 @@ exit(0); } EOF -if { (eval echo configure:2301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_force_core=yes else @@ -2320,12 +2312,12 @@ EOF fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2324: checking for vprintf" >&5 +echo "configure:2316: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2372,12 +2364,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2376: checking for _doprnt" >&5 +echo "configure:2368: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2427,12 +2419,12 @@ fi for ac_func in gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2431: checking for $ac_func" >&5 +echo "configure:2423: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2482,12 +2474,12 @@ else for ac_func in lrand48 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2486: checking for $ac_func" >&5 +echo "configure:2478: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2543,12 +2535,12 @@ done for ac_func in getrusage do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2547: checking for $ac_func" >&5 +echo "configure:2539: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2598,12 +2590,12 @@ else for ac_func in times do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2602: checking for $ac_func" >&5 +echo "configure:2594: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2657,7 +2649,7 @@ fi done echo $ac_n "checking what type of signals you have""... $ac_c" 1>&6 -echo "configure:2661: checking what type of signals you have" >&5 +echo "configure:2653: checking what type of signals you have" >&5 if eval "test \"`echo '$''{'ac_cv_sigtype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2666,7 +2658,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -2675,7 +2667,7 @@ sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L); } EOF -if { (eval echo configure:2679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sigtype=POSIX else @@ -2687,7 +2679,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -2708,7 +2700,7 @@ exit(0); } EOF -if { (eval echo configure:2712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sigtype=BSD else @@ -2747,12 +2739,12 @@ fi for ac_func in strtoken do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2751: checking for $ac_func" >&5 +echo "configure:2743: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2806,12 +2798,12 @@ done for ac_func in strtok do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2810: checking for $ac_func" >&5 +echo "configure:2802: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2865,12 +2857,12 @@ done for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2869: checking for $ac_func" >&5 +echo "configure:2861: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2924,12 +2916,12 @@ done for ac_func in index do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2928: checking for $ac_func" >&5 +echo "configure:2920: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2983,12 +2975,12 @@ done for ac_func in strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2987: checking for $ac_func" >&5 +echo "configure:2979: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3039,12 +3031,12 @@ done for ac_func in bcopy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3043: checking for $ac_func" >&5 +echo "configure:3035: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3098,12 +3090,12 @@ done for ac_func in bcmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3102: checking for $ac_func" >&5 +echo "configure:3094: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3157,12 +3149,12 @@ done for ac_func in bzero do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3161: checking for $ac_func" >&5 +echo "configure:3153: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3216,12 +3208,12 @@ done for ac_func in strcasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3220: checking for $ac_func" >&5 +echo "configure:3212: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3274,12 +3266,12 @@ done for ac_func in inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3278: checking for $ac_func" >&5 +echo "configure:3270: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3333,12 +3325,12 @@ done for ac_func in inet_ntoa do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3337: checking for $ac_func" >&5 +echo "configure:3329: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3392,12 +3384,12 @@ done for ac_func in inet_netof do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3396: checking for $ac_func" >&5 +echo "configure:3388: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3657,12 +3649,12 @@ if test "${enable_dynamic_linking+set}" = set; then enableval="$enable_dynamic_linking" echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:3661: checking for dlopen" >&5 +echo "configure:3653: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -3703,7 +3695,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:3707: checking for dlopen in -ldl" >&5 +echo "configure:3699: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3711,7 +3703,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3751,20 +3743,20 @@ fi hold_cflags=$CFLAGS CFLAGS="$CFLAGS -export-dynamic" echo $ac_n "checking if we need the -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:3755: checking if we need the -export-dynamic flag" >&5 +echo "configure:3747: checking if we need the -export-dynamic flag" >&5 if eval "test \"`echo '$''{'ac_cv_export_dynamic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_export_dynamic=yes else @@ -3782,7 +3774,7 @@ CFLAGS=$hold_cflags fi echo $ac_n "checking for compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:3786: checking for compiler option to produce PIC" >&5 +echo "configure:3778: checking for compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'ac_cv_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3818,7 +3810,7 @@ if test "${enable_inet6+set}" = set; then enableval="$enable_inet6" echo $ac_n "checking if your system has IPv6 support""... $ac_c" 1>&6 -echo "configure:3822: checking if your system has IPv6 support" >&5 +echo "configure:3814: checking if your system has IPv6 support" >&5 if eval "test \"`echo '$''{'ac_cv_ip6'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3827,7 +3819,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3839,7 +3831,7 @@ exit(0); } EOF -if { (eval echo configure:3843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_ip6=yes else @@ -3855,7 +3847,14 @@ fi fi echo "$ac_t""$ac_cv_ip6" 1>&6 +if test "$ac_cv_ip6" = "no"; then +echo "configure: warning: Your system does not support IPv6 so it will not be enabled" 1>&2 +else +cat >> confdefs.h <<\EOF +#define INET6 1 +EOF +fi fi @@ -3886,7 +3885,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:3890: checking host system type" >&5 +echo "configure:3889: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -3912,17 +3911,17 @@ acx_pthread_ok=no # If it isn't, don't bother looking for the threads libraries. ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for pthread.h""... $ac_c" 1>&6 -echo "configure:3916: checking for pthread.h" >&5 +echo "configure:3915: checking for pthread.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3991,7 +3990,7 @@ esac result=none if test "$acx_pthread_ok" = "no"; then echo $ac_n "checking what flags pthreads needs""... $ac_c" 1>&6 -echo "configure:3995: checking what flags pthreads needs" >&5 +echo "configure:3994: checking what flags pthreads needs" >&5 if eval "test \"`echo '$''{'ac_cv_pthreadflag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4029,7 +4028,7 @@ for flag in $acx_pthread_flags; do # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat > conftest.$ac_ext < int main() { @@ -4038,7 +4037,7 @@ pthread_t th; pthread_join(th, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } EOF -if { (eval echo configure:4042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* acx_pthread_ok=yes else @@ -4084,20 +4083,20 @@ esac # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). echo $ac_n "checking for joinable pthread attribute""... $ac_c" 1>&6 -echo "configure:4088: checking for joinable pthread attribute" >&5 +echo "configure:4087: checking for joinable pthread attribute" >&5 if eval "test \"`echo '$''{'ac_cv_pthreadjoin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int attr=PTHREAD_CREATE_JOINABLE; ; return 0; } EOF -if { (eval echo configure:4101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_pthreadjoin=PTHREAD_CREATE_JOINABLE else @@ -4109,14 +4108,14 @@ fi rm -f conftest* if test "$ac_cv_pthreadjoin" = "unknown"; then cat > conftest.$ac_ext < int main() { int attr=PTHREAD_CREATE_UNDETACHED; ; return 0; } EOF -if { (eval echo configure:4120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_pthreadjoin=PTHREAD_CREATE_UNDETACHED else @@ -4142,7 +4141,7 @@ EOF fi echo $ac_n "checking if more special flags are required for pthreads""... $ac_c" 1>&6 -echo "configure:4146: checking if more special flags are required for pthreads" >&5 +echo "configure:4145: checking if more special flags are required for pthreads" >&5 if eval "test \"`echo '$''{'ac_cv_pthreadspecial'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4167,7 +4166,7 @@ echo "$ac_t""$ac_cv_pthreadspecial" 1>&6 # Extract the first word of "cc_r", so it can be a program name with args. set dummy cc_r; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4171: checking for $ac_word" >&5 +echo "configure:4170: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PTHREAD_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4199,7 +4198,7 @@ else fi if test "x$ac_cv_pthreadflag"!=x; then echo $ac_n "checking if pthreads uses one thread per process""... $ac_c" 1>&6 -echo "configure:4203: checking if pthreads uses one thread per process" >&5 +echo "configure:4202: checking if pthreads uses one thread per process" >&5 if eval "test \"`echo '$''{'ac_cv_thread_multi'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4212,7 +4211,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4232,7 +4231,7 @@ while (1); } EOF -if { (eval echo configure:4236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_thread_multi=no else @@ -4287,12 +4286,12 @@ CC="$PTHREAD_CC" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" IRCDLIBS="$IRCDLIBS $PTHREAD_LIBS" echo $ac_n "checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors""... $ac_c" 1>&6 -echo "configure:4291: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5 +echo "configure:4290: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4304,7 +4303,7 @@ exit(1); } EOF -if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 else diff --git a/include/modules.h b/include/modules.h index 22c031f96..40088dfb2 100644 --- a/include/modules.h +++ b/include/modules.h @@ -19,7 +19,7 @@ * $Id$ */ -#define MOD_VERSION 1 +#define MOD_VERSION 2 #define MAXMODULES 50 #define MAXHOOKTYPES 20 diff --git a/m_template.c b/m_template.c index 3daed39d9..d930bf03a 100644 --- a/m_template.c +++ b/m_template.c @@ -52,7 +52,12 @@ DLLFUNC int m_%COMMAND%(aClient *cptr, aClient *sptr, int parc, char *parv[]); #define TOK_%UCOMMAND% "%TOKEN%" +#ifndef DYNAMIC_LINKING ModuleInfo m_%COMMAND%_info +#else +#define m_%COMMAND%_info mod_header +ModuleInfo mod_header +#endif = { 1, "test", @@ -63,19 +68,18 @@ ModuleInfo m_%COMMAND%_info }; #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_%COMMAND%_init(void) +int m_%COMMAND%_init(int module_load) #endif { - module_buffer = &m_%COMMAND%_info; add_Command(MSG_%UCOMMAND%, TOK_%UCOMMAND%, m_%COMMAND%, %MAXPARA%); } #ifdef DYNAMIC_LINKING -DLLFUNC void mod_load(void) +DLLFUNC int mod_load(int module_load) #else -void m_%COMMAND%_load(void) +int m_%COMMAND%_load(int module_load) #endif { } diff --git a/src/modules.c b/src/modules.c index 26313023e..1b0b95dfb 100644 --- a/src/modules.c +++ b/src/modules.c @@ -51,7 +51,6 @@ Hook *Hooks[MAXHOOKTYPES]; Hook *global_i = NULL; int modules_loaded = 0; -ModuleInfo *module_buffer; void module_init(void) { bzero(Modules, sizeof(Modules)); @@ -67,16 +66,69 @@ int load_module(char *module) #else void *Mod; #endif - void (*mod_init) (); - void (*mod_load) (); + int (*mod_init) (); + int (*mod_load) (); void (*mod_unload) (); MSymbolTable *mod_dep; + ModuleInfo *mod_header; int i; - module_buffer = NULL; if (Mod = irc_dlopen(module, RTLD_NOW)) { /* Succeed loading module */ + /* We check header */ + mod_header = irc_dlsym(Mod, "mod_header"); + if (!mod_header) + mod_header = irc_dlsym(Mod, "_mod_header"); + if (!mod_header) + { + config_progress("%s: cannot load, no module header", + module); + irc_dlclose(Mod); + return -1; + } + if (mod_header->mversion != MOD_VERSION) + { + config_progress + ("Failed to load module %s: mversion is %i, not %i as we require", + module, mod_header->mversion, MOD_VERSION); + irc_dlclose(Mod); + return -1; + } + if (!mod_header->name || !mod_header->version + || !mod_header->description) + { + config_progress + ("Failed to load module %s: name/version/description missing", + module); + irc_dlclose(Mod); + return -1; + } + for (i = 0; i < MAXMODULES; i++) + if (Modules[i] && !strcmp(Modules[i]->name, mod_header->name)) + { + /* We will unload it without notice, its a duplicate */ + irc_dlclose(Mod); + return 1; + } + for (i = 0; i < MAXMODULES; i++) + { + if (!Modules[i]) + { + Modules[i] = mod_header; + modules_loaded++; + break; + } + } + if (i == MAXMODULES) + { + config_progress + ("Failed to load module %s: Too many modules loaded"); + Modules[i] = NULL; + irc_dlclose(Mod); + return -1; + } + /* Locate mod_depend */ mod_dep = irc_dlsym(Mod, "mod_depend"); if (!mod_dep) @@ -87,6 +139,7 @@ int load_module(char *module) { config_progress("%s: cannot load, missing dependancy", module); + Modules[i] = NULL; irc_dlclose(Mod); return -1; } @@ -102,37 +155,11 @@ int load_module(char *module) config_progress ("Failed to load module %s: Could not locate mod_init", module); + Modules[i] = NULL; irc_dlclose(Mod); return -1; } } - /* Run mod_init */ - (*mod_init) (); - if (!module_buffer) - { - config_progress - ("Failed to load module %s: mod_init did not set module_buffer", - module); - irc_dlclose(Mod); - return -1; - } - if (module_buffer->mversion != MOD_VERSION) - { - config_progress - ("Failed to load module %s: mversion is %i, not %i as we require", - module, module_buffer->mversion, MOD_VERSION); - irc_dlclose(Mod); - return -1; - } - if (!module_buffer->name || !module_buffer->version - || !module_buffer->description) - { - config_progress - ("Failed to load module %s: name/version/description missing", - module); - irc_dlclose(Mod); - return -1; - } mod_unload = irc_dlsym(Mod, "mod_unload"); if (!mod_unload) { @@ -142,51 +169,46 @@ int load_module(char *module) config_progress ("Failed to load module %s: Could not locate mod_unload", module); + Modules[i] = NULL; irc_dlclose(Mod); return -1; } } - module_buffer->dll = Mod; - module_buffer->unload = mod_unload; + mod_header->dll = Mod; + mod_header->unload = mod_unload; mod_unload = irc_dlsym(Mod, "mod_load"); - if (!mod_unload) + if (!mod_load) { - mod_unload = irc_dlsym(Mod, "_mod_load"); + mod_load = irc_dlsym(Mod, "_mod_load"); } - if (mod_unload) + if ((*mod_init)() < 0) + { + config_progress + ("Failed to load module %s: mod_init failed", + module); + Modules[i] = NULL; + irc_dlclose(Mod); + return -1; + + } + if (mod_load) { /* if ircd is booted, load it */ if (loop.ircd_booted) - (*mod_unload)(); - } - for (i = 0; i < MAXMODULES; i++) - if (Modules[i] && !strcmp(Modules[i]->name, module_buffer->name)) { - /* We will unload it without notice, its a duplicate */ - sendto_umode(UMODE_JUNK, "Ignoring load of module %s, duplicate names", module_buffer->name); - (*module_buffer->unload)(); - irc_dlclose(Mod); - return 1; + if ((*mod_load)() < 0) + { + config_progress + ("Failed to load module %s: mod_load failed", + module); + Modules[i] = NULL; + irc_dlclose(Mod); + return -1; + + } } - - for (i = 0; i < MAXMODULES; i++) - { - if (!Modules[i]) - { - Modules[i] = module_buffer; - modules_loaded++; - break; - } - } - if (i == MAXMODULES) - { - config_progress - ("Failed to load module %s: Too many modules loaded"); - (*module_buffer->unload)(); - irc_dlclose(Mod); - return -1; } return 1; } @@ -206,6 +228,26 @@ int load_module(char *module) #endif } +void unload_all_modules(void) +{ +#ifndef STATIC_LINKING + int i; + + for (i = 0; i < MAXMODULES; i++) + if (Modules[i]) + { + + /* Call unload */ + (*Modules[i]->unload)(); + + irc_dlclose(Modules[i]->dll); + + Modules[i] = NULL; + modules_loaded--; + } +#endif + return; +} int unload_module(char *name) { diff --git a/src/modules/l_commands.c b/src/modules/l_commands.c index 41fa11d40..96bd97dae 100644 --- a/src/modules/l_commands.c +++ b/src/modules/l_commands.c @@ -50,9 +50,13 @@ /* Place includes here */ /* replace this with a common name of your module */ +#ifdef DYNAMIC_LINKING +ModuleInfo mod_header +#else ModuleInfo l_commands_info +#endif = { - 1, + 2, "commands", /* Name of module */ "$Id$", /* Version */ "Wrapper library for m_ commands", /* Short description of module */ @@ -66,17 +70,11 @@ ModuleInfo l_commands_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void l_commands_init(void) +int l_commands_init(int module_load) #endif { - /* extern variable to export l_commands_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &l_commands_info; /* * We call our add_Command crap here */ @@ -89,7 +87,6 @@ void l_commands_init(void) m_svsmode_init(); m_swhois_init(); m_svsmotd_init(); - module_buffer = &l_commands_info; } #ifdef DYNAMIC_LINKING diff --git a/src/modules/m_chghost.c b/src/modules/m_chghost.c index eb12bdbb7..6c8542a35 100644 --- a/src/modules/m_chghost.c +++ b/src/modules/m_chghost.c @@ -48,10 +48,14 @@ #define TOK_CHGHOST "AL" DLLFUNC int m_chghost(aClient *cptr, aClient *sptr, int parc, char *parv[]); - +#ifndef DYNAMIC_LINKING ModuleInfo m_chghost_info +#else +#define m_chghost_info mod_header +ModuleInfo mod_header +#endif = { - 1, + 2, "chghost", /* Name of module */ "$Id$", /* Version */ "/chghost", /* Short description of module */ @@ -65,17 +69,11 @@ ModuleInfo m_chghost_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_chghost_init(void) +int m_chghost_init(int module_load) #endif { - /* extern variable to export m_chghost_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_chghost_info; /* * We call our add_Command crap here */ diff --git a/src/modules/m_chgident.c b/src/modules/m_chgident.c index 6e9060eba..ecc8821a1 100644 --- a/src/modules/m_chgident.c +++ b/src/modules/m_chgident.c @@ -49,9 +49,14 @@ DLLFUNC int m_chgident(aClient *cptr, aClient *sptr, int parc, char *parv[]); +#ifndef DYNAMIC_LINKING ModuleInfo m_chgident_info +#else +#define m_chgident_info mod_header +ModuleInfo mod_header +#endif = { - 1, + 2, "chgident", /* Name of module */ "$Id$", /* Version */ "/chgident", /* Short description of module */ @@ -65,9 +70,9 @@ ModuleInfo m_chgident_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_chgident_init(void) +int m_chgident_init(int module_load) #endif { /* extern variable to export m_chgident_info to temporary @@ -75,7 +80,6 @@ void m_chgident_init(void) the module_load() will use this to add to the modules linked list */ - module_buffer = &m_chgident_info; /* * We call our add_Command crap here */ diff --git a/src/modules/m_dummy.c b/src/modules/m_dummy.c index dead3bc80..60d6133b2 100644 --- a/src/modules/m_dummy.c +++ b/src/modules/m_dummy.c @@ -34,10 +34,13 @@ DLLFUNC int m_dummy(aClient *cptr, aClient *sptr, int parc, char *parv[]); #define MSG_DUMMY "DUMMY" /* dummy */ #define TOK_DUMMY "DU" /* 127 4ever !;) */ - +#ifndef STATIC_LINKING +ModuleInfo mod_header +#else ModuleInfo m_dummy_info +#endif = { - 1, + 2, "dummy", /* Name of module */ "$Id$", /* Version */ "command /dummy", /* Short description of module */ @@ -45,24 +48,18 @@ ModuleInfo m_dummy_info NULL }; -/* - * The purpose of these ifdefs, are that we can "static" link the ircd if we + +/* The purpose of these ifdefs, are that we can "static" link the ircd if we * want to */ /* This is called on module init, before Server Ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_dummy_init(void) +int m_dummy_init(int module_load) #endif { - /* extern variable to export m_dummy_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_dummy_info; /* * We call our add_Command crap here */ @@ -71,9 +68,9 @@ void m_dummy_init(void) /* Is first run when server is 100% ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_load(void) +DLLFUNC int mod_load(int module_load) #else -void m_dummy_load(void) +int m_dummy_load(int module_load) #endif { } diff --git a/src/modules/m_sdesc.c b/src/modules/m_sdesc.c index 94bbc1e96..1d887187e 100644 --- a/src/modules/m_sdesc.c +++ b/src/modules/m_sdesc.c @@ -50,10 +50,14 @@ DLLFUNC int m_sdesc(aClient *cptr, aClient *sptr, int parc, char *parv[]); #define MSG_SDESC "SDESC" /* sdesc */ #define TOK_SDESC "AG" /* 127 4ever !;) */ - +#ifndef DYNAMIC_LINKING ModuleInfo m_sdesc_info +#else +#define m_sdesc_info mod_header +ModuleInfo mod_header +#endif = { - 1, + 2, "sdesc", /* Name of module */ "$Id$", /* Version */ "command /sdesc", /* Short description of module */ @@ -67,17 +71,11 @@ ModuleInfo m_sdesc_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_sdesc_init(void) +int m_sdesc_init(int module_load) #endif { - /* extern variable to export m_sdesc_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_sdesc_info; /* * We call our add_Command crap here */ diff --git a/src/modules/m_sethost.c b/src/modules/m_sethost.c index 0cce421a0..41717e422 100644 --- a/src/modules/m_sethost.c +++ b/src/modules/m_sethost.c @@ -49,11 +49,14 @@ DLLFUNC int m_sethost(aClient *cptr, aClient *sptr, int parc, char *parv[]); /* Place includes here */ #define MSG_SETHOST "SETHOST" /* sethost */ #define TOK_SETHOST "AA" /* 127 4ever !;) */ - - +#ifndef DYNAMIC_LINKING +#define mod_header m_sethost_info ModuleInfo m_sethost_info +#else +ModuleInfo mod_header +#endif = { - 1, + 2, "sethost", /* Name of module */ "$Id$", /* Version */ "command /sethost", /* Short description of module */ @@ -67,17 +70,11 @@ ModuleInfo m_sethost_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_sethost_init(void) +int m_sethost_init(int module_load) #endif { - /* extern variable to export m_sethost_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_sethost_info; /* * We call our add_Command crap here */ @@ -93,7 +90,7 @@ void m_sethost_unload(void) if (del_Command(MSG_SETHOST, TOK_SETHOST, m_sethost) < 0) { sendto_realops("Failed to delete commands when unloading %s", - m_sethost_info.name); + mod_header.name); } } diff --git a/src/modules/m_setident.c b/src/modules/m_setident.c index 56698e34b..ceba5cd77 100644 --- a/src/modules/m_setident.c +++ b/src/modules/m_setident.c @@ -48,8 +48,12 @@ #define TOK_SETIDENT "AD" /* good old BASIC ;P */ DLLFUNC int m_setident(aClient *cptr, aClient *sptr, int parc, char *parv[]); - +#ifndef DYNAMIC_LINKING ModuleInfo m_setident_info +#else +#define m_setident_info mod_header +ModuleInfo mod_header +#endif = { 1, "setident", /* Name of module */ @@ -65,17 +69,11 @@ ModuleInfo m_setident_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_setident_init(void) +int m_setident_init(int module_load) #endif { - /* extern variable to export m_setident_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_setident_info; /* * We call our add_Command crap here */ diff --git a/src/modules/m_setname.c b/src/modules/m_setname.c index abe5db36a..c22a8916b 100644 --- a/src/modules/m_setname.c +++ b/src/modules/m_setname.c @@ -50,10 +50,14 @@ DLLFUNC int m_setname(aClient *cptr, aClient *sptr, int parc, char *parv[]); #define MSG_SETNAME "SETNAME" /* setname */ #define TOK_SETNAME "AE" - +#ifndef DYNAMIC_LINKING ModuleInfo m_setname_info +#else +#define m_setname_info mod_header +ModuleInfo mod_header +#endif = { - 1, + 2, "setname", /* Name of module */ "$Id$", /* Version */ "command /setname", /* Short description of module */ @@ -67,17 +71,11 @@ ModuleInfo m_setname_info */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_setname_init(void) +int m_setname_init(int module_load) #endif { - /* extern variable to export m_setname_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_setname_info; /* * We call our add_Command crap here */ diff --git a/src/modules/m_svsmode.c b/src/modules/m_svsmode.c index 1a2d661e5..425970f77 100644 --- a/src/modules/m_svsmode.c +++ b/src/modules/m_svsmode.c @@ -56,9 +56,14 @@ extern int user_modes[]; #define MSG_SVS2MODE "SVS2MODE" #define TOK_SVS2MODE "v" +#ifndef DYNAMIC_LINKING ModuleInfo m_svsmode_info +#else +#define m_svsmode_info mod_header +ModuleInfo mod_header +#endif = { - 1, + 2, "test", "$Id$", "command /svsmode and svs2mode", @@ -67,20 +72,19 @@ ModuleInfo m_svsmode_info }; #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_svsmode_init(void) +int m_svsmode_init(int module_load) #endif { - module_buffer = &m_svsmode_info; add_Command(MSG_SVSMODE, TOK_SVSMODE, m_svsmode, MAXPARA); add_Command(MSG_SVS2MODE, TOK_SVS2MODE, m_svs2mode, MAXPARA); } #ifdef DYNAMIC_LINKING -DLLFUNC void mod_load(void) +DLLFUNC int mod_load(int module_load) #else -void m_svsmode_load(void) +int m_svsmode_load(int module_load) #endif { } diff --git a/src/modules/m_svsmotd.c b/src/modules/m_svsmotd.c index df96164e2..310f80855 100644 --- a/src/modules/m_svsmotd.c +++ b/src/modules/m_svsmotd.c @@ -52,10 +52,14 @@ DLLFUNC int m_svsmotd(aClient *cptr, aClient *sptr, int parc, char *parv[]); #define MSG_SVSMOTD "SVSMOTD" #define TOK_SVSMOTD "AS" - +#ifndef DYNAMIC_LINKING ModuleInfo m_svsmotd_info +#else +#define m_svsmotd_info mod_header +ModuleInfo mod_header +#endif = { - 1, + 2, "test", "$Id$", "command /svsmotd", @@ -64,19 +68,18 @@ ModuleInfo m_svsmotd_info }; #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_svsmotd_init(void) +int m_svsmotd_init(int module_load) #endif { - module_buffer = &m_svsmotd_info; add_Command(MSG_SVSMOTD, TOK_SVSMOTD, m_svsmotd, MAXPARA); } #ifdef DYNAMIC_LINKING -DLLFUNC void mod_load(void) +DLLFUNC int mod_load(int module_load) #else -void m_svsmotd_load(void) +int m_svsmotd_load(int module_load) #endif { } diff --git a/src/modules/m_swhois.c b/src/modules/m_swhois.c index ce8f4638f..687ae8471 100644 --- a/src/modules/m_swhois.c +++ b/src/modules/m_swhois.c @@ -68,7 +68,6 @@ DLLFUNC void mod_init(void) void m_swhois_init(void) #endif { - module_buffer = &m_swhois_info; add_Command(MSG_SWHOIS, TOK_SWHOIS, m_swhois, MAXPARA); } diff --git a/src/modules/scan.c b/src/modules/scan.c index 71224830b..1fc57681e 100644 --- a/src/modules/scan.c +++ b/src/modules/scan.c @@ -69,9 +69,14 @@ DLLFUNC EVENT (VS_Ban); DLLFUNC int h_scan_info(aClient *sptr); DLLFUNC int m_scan(aClient *cptr, aClient *sptr, int parc, char *parv[]); +#ifndef DYNAMIC_LINKING ModuleInfo m_scan_info +#else +#define m_scan_info module_header +ModuleInfo module_header +#endif = { - 1, + 2, "scan", /* Name of module */ "$Id$", /* Version */ "Scanning API", /* Short description of module */ @@ -86,17 +91,11 @@ ModuleInfo m_scan_info /* This is called on module init, before Server Ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void m_scan_init(void) +int m_scan_init(int module_load) #endif { - /* extern variable to export m_dummy_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &m_scan_info; add_Hook(HOOKTYPE_LOCAL_CONNECT, h_scan_connect); add_Hook(HOOKTYPE_SCAN_INFO, h_scan_info); bzero(Hosts, sizeof(Hosts)); diff --git a/src/modules/scan_dummy.c b/src/modules/scan_dummy.c index a2619a8bb..9eb418c2e 100644 --- a/src/modules/scan_dummy.c +++ b/src/modules/scan_dummy.c @@ -31,10 +31,13 @@ void scan_dummy_scan(HStruct *h); - +#ifndef DYNAMIC_LINKING ModuleInfo scan_dummy_info +#else +ModuleInfo mod_header +#endif = { - 1, + 2, "scan_dummy", /* Name of module */ "$Id$", /* Version */ "scanning API: dummy", /* Short description of module */ @@ -49,17 +52,11 @@ ModuleInfo scan_dummy_info /* This is called on module init, before Server Ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void scan_dummy_init(void) +int scan_dummy_init(int module_load) #endif { - /* extern variable to export scan_dummy_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &scan_dummy_info; /* * Add scanning hooks */ @@ -68,9 +65,9 @@ void scan_dummy_init(void) /* Is first run when server is 100% ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_load(void) +DLLFUNC int mod_load(int module_load) #else -void scan_dummy_load(void) +int scan_dummy_load(int module_load) #endif { } diff --git a/src/modules/scan_socks.c b/src/modules/scan_socks.c index eece0bce8..723c42c36 100644 --- a/src/modules/scan_socks.c +++ b/src/modules/scan_socks.c @@ -63,10 +63,13 @@ iFP xVS_add = NULL; ConfigItem_blackhole *blackh_conf = NULL; void scan_socks_scan(HStruct *h); - +#ifndef DYNAMIC_LINKING ModuleInfo scan_socks_info +#else +ModuleInfo mod_header +#endif = { - 1, + 2, "scan_socks", /* Name of module */ "$Id$", /* Version */ "scanning API: socks", /* Short description of module */ @@ -97,18 +100,11 @@ MSymbolTable mod_depend[] = { /* This is called on module init, before Server Ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_init(void) +DLLFUNC int mod_init(int module_load) #else -void scan_socks_init(void) +int scan_socks_init(int module_load) #endif { - /* extern variable to export scan_socks_info to temporary - ModuleInfo *modulebuffer; - the module_load() will use this to add to the modules linked - list - */ - module_buffer = &scan_socks_info; - /* * Add scanning hooks */ @@ -117,9 +113,9 @@ void scan_socks_init(void) /* Is first run when server is 100% ready */ #ifdef DYNAMIC_LINKING -DLLFUNC void mod_load(void) +DLLFUNC int mod_load(int module_load) #else -void scan_socks_load(void) +int scan_socks_load(int module_load) #endif { } diff --git a/src/s_conf.c b/src/s_conf.c index 28b4572be..85f00dfd1 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -3347,6 +3347,7 @@ int rehash(aClient *cptr, aClient *sptr, int sig) MyFree(log_ptr); log_ptr = (ConfigItem_log *)&t; } + /* rehash_modules */ init_conf2(configfile); /* Clean up listen records */ close_listeners();