diff -uNrd ircd-ratbox-1.3-1/adns/Makefile.in ircd-ratbox-1.3-1+fr-ssl/adns/Makefile.in
--- ircd-ratbox-1.3-1/adns/Makefile.in	Fri May 24 16:34:01 2002
+++ ircd-ratbox-1.3-1+fr-ssl/adns/Makefile.in	Sat Jan 24 12:34:32 2004
@@ -54,7 +54,8 @@
 
 # this is really the default rule for c files
 .c.o:
-	${CC} ${CPPFLAGS} ${CFLAGS} -c $<
+	@${CC} ${CPPFLAGS} ${CFLAGS} -c $<
+	@echo "Compiling $<"
 
 .PHONY: depend clean distclean
 
diff -uNrd ircd-ratbox-1.3-1/autoconf/configure.in ircd-ratbox-1.3-1+fr-ssl/autoconf/configure.in
--- ircd-ratbox-1.3-1/autoconf/configure.in	Wed Oct 15 11:06:56 2003
+++ ircd-ratbox-1.3-1+fr-ssl/autoconf/configure.in	Sat Jan 24 20:39:36 2004
@@ -394,7 +394,7 @@
                 cf_openssl_ciphers="${cf_openssl_ciphers}DES/56 ")
         fi
         CPPFLAGS="$save_CPPFLAGS"
-        SSL_LIBS="$SSL_LIBS -lcrypto"
+        SSL_LIBS="$SSL_LIBS -lcrypto -lssl"
     else
         AC_MSG_RESULT(no - OpenSSL support disabled)
     fi
@@ -495,11 +495,11 @@
 [
   case "$enableval" in
   yes)
-    echo "Forcing poll() to be enabled"
+    dnl echo "Forcing poll() to be enabled"
     ac_cv_func_poll="yes"
     ;;
   no)
-    echo "Forcing poll() to be disabled"
+    dnl echo "Forcing poll() to be disabled"
     ac_cv_func_poll="no"
     ;;
   esac
@@ -512,11 +512,11 @@
 [
   case "$enableval" in
   yes)
-    echo "Forcing select() to be enabled"
+    dnl echo "Forcing select() to be enabled"
     ac_cv_func_select="yes"
     ;;
   no)
-    echo "Forcing select() to be disabled"
+    dnl echo "Forcing select() to be disabled"
     ac_cv_func_select="no"
     ;;
   esac
@@ -529,11 +529,11 @@
 [
   case "$enableval" in
   yes)
-    echo "Forcing kqueue() to be enabled"
+    dnl echo "Forcing kqueue() to be enabled"
     ac_cv_func_kqueue="yes"
     ;;
   no)
-    echo "Forcing kqueue() to be disabled"
+    dnl echo "Forcing kqueue() to be disabled"
     ac_cv_func_kqueue="no"
   ;;
 esac
@@ -546,11 +546,11 @@
 [
   case "$enableval" in
   yes)
-    echo "Forcing /dev/poll to be enabled"
+    dnl echo "Forcing /dev/poll to be enabled"
     ac_cv_func_devpoll="yes"
     ;;
   no)
-    echo "Forcing /dev/poll to be disabled"
+    dnl echo "Forcing /dev/poll to be disabled"
     ac_cv_func_devpoll="no"
   ;;
 esac
@@ -563,7 +563,7 @@
 [
   case "$enableval" in
   yes)
-    echo "Forcing Linux epoll to be enabled"
+    dnl echo "Forcing Linux epoll to be enabled"
     ac_cv_func_epoll="yes"
     ;;
   no)
@@ -622,12 +622,12 @@
                 AC_DEFINE(USE_SELECT)
 	fi
 fi
-echo "Using ${SELECT_TYPE} for select loop."
+dnl echo "Using ${SELECT_TYPE} for select loop."
 AC_DEFINE_UNQUOTED(SELECT_TYPE, "$SELECT_TYPE")
 AC_SUBST(SELECT_SRC)
 
 if test "$ac_cv_func_gettext" = "yes" -o "$ac_cv_lib_intl_gettext" = "yes"; then
-	echo "Building with gettext."
+	dnl echo "Building with gettext."
 	MSGFMT="msgfmt -o"
 	SUBDIR_MESSAGES="messages"
         AC_DEFINE(HAVE_GETTEXT)
@@ -644,7 +644,7 @@
 
 if test "$ac_cv_ipv6" = "yes" ; then
 	AC_DEFINE(IPV6)
-	echo "Using IPv6 support"
+	dnl echo "Using IPv6 support"
 fi
 
 ac_cv_assert="-DNDEBUG"
@@ -713,11 +713,12 @@
 [
   case "$enableval" in
   yes)
-    echo "Enabling small net code."
+    dnl echo "Enabling small net code."
     IRC_CFLAGS="$IRC_CFLAGS -DSMALL_NET=1"
+	ac_cv_smallnet='yes'
     ;;
   no)
-    echo "Disabling small net code."
+    dnl echo "Disabling small net code."
     IRC_CFLAGS="$IRC_CFLAGS"
     ;;
   esac
@@ -732,14 +733,14 @@
 [  --with-nicklen=LENGTH        Set the nick length to LENGTH. ],
 
 [
-	echo $withval
+dnl	echo $withval
   if test "$withval" = "no"; then
 	ac_cv_nicklen="9"
   else
 	ac_cv_nicklen="$withval"
   fi
 ])
-AC_MSG_RESULT("Setting NICKLEN to $ac_cv_nicklen")
+dnl AC_MSG_RESULT("Setting NICKLEN to $ac_cv_nicklen")
 AC_DEFINE_UNQUOTED(NICKLEN, (${ac_cv_nicklen}+1))
 
 dnl Max support clients
@@ -753,7 +754,7 @@
 	ac_cv_maxclients="$withval"
   fi
 ])
-AC_MSG_RESULT("Setting MAX_CLIENTS to $ac_cv_maxclients")
+dnl AC_MSG_RESULT("Setting MAX_CLIENTS to $ac_cv_maxclients")
 AC_DEFINE_UNQUOTED(MAX_CLIENTS, ${ac_cv_maxclients})
 
 dnl Max support clients
@@ -767,7 +768,7 @@
 	ac_cv_topiclen="$withval"
   fi
 ])
-AC_MSG_RESULT("Setting TOPICLEN to $ac_cv_topiclen")
+dnl AC_MSG_RESULT("Setting TOPICLEN to $ac_cv_topiclen")
 AC_DEFINE_UNQUOTED(TOPICLEN, ${ac_cv_topiclen})
 
 dnl shared-modules
@@ -980,12 +981,48 @@
  help/Makefile                  \
 )
 
-if test "X${cf_openssl_ciphers}" != "X"; then
-  echo ""
-  echo "Available cryptlinks ciphers:"
-  echo ""
-  echo "${cf_openssl_ciphers}"
-  echo ""
+dnl if test "X${cf_openssl_ciphers}" != "X"; then
+dnl  echo ""
+dnl  echo "Available cryptlinks ciphers:"
+dnl  echo ""
+dnl  echo "${cf_openssl_ciphers}"
+dnl  echo ""
+dnl fi
+
+echo "
+
+Configuration:
+
+  Installing into ......... $prefix
+  Detected OS ............. `uname -rs`
+  Building Version ........ ${PACKAGE} ${VERSION}
+"
+
+if test "x$ac_cv_ipv6" = "xyes" ; then
+  echo "  IPv6 Support ............ yes"
+else
+  echo "  IPv6 Support ............ no"
 fi
 
-AC_MSG_RESULT(Server is configured with NICKLEN=$ac_cv_nicklen and MAX_CLIENTS=$ac_cv_maxclients)
+if test "x$ac_cv_smallnet" = "xyes" ; then
+  echo "  Small net ............... yes"
+else
+  echo "  Small net ............... no"
+fi
+
+if test "$ac_cv_func_gettext" = "yes" -o "$ac_cv_lib_intl_gettext" = "yes"; then
+  echo "  Gettext ................. yes"
+else
+  echo "  Gettext ................. no"
+fi
+
+echo "
+  Select loop ............. ${SELECT_TYPE}
+  NICKLEN ................. $ac_cv_nicklen
+  TOPICLEN ................ $ac_cv_topiclen
+  MAX_CLIENTS ............. $ac_cv_maxclients
+  Available ciphers ....... ${cf_openssl_ciphers}
+
+"
+
+dnl AC_MSG_RESULT(Server is configured with NICKLEN=$ac_cv_nicklen and MAX_CLIENTS=$ac_cv_maxclients)
diff -uNrd ircd-ratbox-1.3-1/configure ircd-ratbox-1.3-1+fr-ssl/configure
--- ircd-ratbox-1.3-1/configure	Wed Oct 15 11:06:49 2003
+++ ircd-ratbox-1.3-1+fr-ssl/configure	Sat Jan 24 20:39:45 2004
@@ -78,6 +78,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -192,6 +193,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -362,6 +364,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -527,12 +534,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -603,7 +614,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:607: checking for $ac_word" >&5
+echo "configure:618: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -633,7 +644,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:637: checking for $ac_word" >&5
+echo "configure:648: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -684,7 +695,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:688: checking for $ac_word" >&5
+echo "configure:699: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -716,7 +727,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:720: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:731: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -727,12 +738,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 731 "configure"
+#line 742 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -758,12 +769,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:762: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:773: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:767: checking whether we are using GNU C" >&5
+echo "configure:778: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -772,7 +783,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -791,7 +802,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:795: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:806: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -826,7 +837,7 @@
 
 SGS=no
 echo $ac_n "checking if we are using TenDRA or MIPSpro""... $ac_c" 1>&6
-echo "configure:830: checking if we are using TenDRA or MIPSpro" >&5
+echo "configure:841: checking if we are using TenDRA or MIPSpro" >&5
 case `$CC -version 2>&1` in
   *TenDRA*)
     echo "$ac_t""success! We will be using TenDRA." 1>&6
@@ -845,7 +856,7 @@
     ;;
 esac
 echo $ac_n "checking if we are using Sun WorkShop/Forte""... $ac_c" 1>&6
-echo "configure:849: checking if we are using Sun WorkShop/Forte" >&5
+echo "configure:860: checking if we are using Sun WorkShop/Forte" >&5
 case `$CC -V 2>&1` in
   *Sun*WorkShop*)
     echo "$ac_t""success! We are using Sun WorkShop/Forte." 1>&6
@@ -863,7 +874,7 @@
     ;;
 esac
 echo $ac_n "checking if we are using Apple GCC""... $ac_c" 1>&6
-echo "configure:867: checking if we are using Apple GCC" >&5
+echo "configure:878: checking if we are using Apple GCC" >&5
 case `$CC -v 2>&1 | tail -1` in
   *Apple*)
     echo "$ac_t""success! We are using GCC from Apple." 1>&6
@@ -876,7 +887,7 @@
 esac
 
 echo $ac_n "checking if your compiler supports the SVR4 Software Generation System interfaces""... $ac_c" 1>&6
-echo "configure:880: checking if your compiler supports the SVR4 Software Generation System interfaces" >&5
+echo "configure:891: checking if your compiler supports the SVR4 Software Generation System interfaces" >&5
 if test "$SGS" = "yes"; then
   echo "$ac_t""yes" 1>&6
 else
@@ -926,7 +937,7 @@
 
 
 echo $ac_n "checking how to generate dependancy info""... $ac_c" 1>&6
-echo "configure:930: checking how to generate dependancy info" >&5
+echo "configure:941: checking how to generate dependancy info" >&5
 if test "$SunWorkShop" = "yes"; then
   echo "$ac_t""Sun WorkShop/Forte using $CC -xM" 1>&6
   MKDEP="$CC -xM"
@@ -947,7 +958,7 @@
 fi
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:951: checking for POSIXized ISC" >&5
+echo "configure:962: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -968,7 +979,7 @@
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:972: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:983: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -997,7 +1008,7 @@
 # Extract the first word of "rm", so it can be a program name with args.
 set dummy rm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1001: checking for $ac_word" >&5
+echo "configure:1012: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1032,7 +1043,7 @@
 # Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1036: checking for $ac_word" >&5
+echo "configure:1047: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1067,7 +1078,7 @@
 # Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1071: checking for $ac_word" >&5
+echo "configure:1082: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1102,7 +1113,7 @@
 # Extract the first word of "ln", so it can be a program name with args.
 set dummy ln; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1106: checking for $ac_word" >&5
+echo "configure:1117: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1137,7 +1148,7 @@
 # Extract the first word of "sed", so it can be a program name with args.
 set dummy sed; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1141: checking for $ac_word" >&5
+echo "configure:1152: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1172,7 +1183,7 @@
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1176: checking for $ac_word" >&5
+echo "configure:1187: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1207,7 +1218,7 @@
 # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1211: checking for $ac_word" >&5
+echo "configure:1222: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1242,7 +1253,7 @@
 # Extract the first word of "touch", so it can be a program name with args.
 set dummy touch; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1246: checking for $ac_word" >&5
+echo "configure:1257: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1279,7 +1290,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1283: checking for $ac_word" >&5
+echo "configure:1294: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1321,7 +1332,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1325: checking for a BSD compatible install" >&5
+echo "configure:1336: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1376,7 +1387,7 @@
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1380: checking for $ac_word" >&5
+echo "configure:1391: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1410,7 +1421,7 @@
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1414: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1425: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1418,7 +1429,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1422 "configure"
+#line 1433 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1429,7 +1440,7 @@
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1444: \"$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
@@ -1454,7 +1465,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1458: checking for $ac_word" >&5
+echo "configure:1469: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1482,21 +1493,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1486: checking for inline" >&5
+echo "configure:1497: 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 <<EOF
-#line 1493 "configure"
+#line 1504 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1529,7 +1540,7 @@
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1533: checking for socket in -lsocket" >&5
+echo "configure:1544: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1537,7 +1548,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1541 "configure"
+#line 1552 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1548,7 +1559,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1563: \"$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
@@ -1579,12 +1590,12 @@
 
 
 echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:1583: checking for crypt" >&5
+echo "configure:1594: checking for crypt" >&5
 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1588 "configure"
+#line 1599 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -1607,7 +1618,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -1625,7 +1636,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for crypt in -ldescrypt""... $ac_c" 1>&6
-echo "configure:1629: checking for crypt in -ldescrypt" >&5
+echo "configure:1640: checking for crypt in -ldescrypt" >&5
 ac_lib_var=`echo descrypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1633,7 +1644,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldescrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1637 "configure"
+#line 1648 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1644,7 +1655,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1659: \"$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
@@ -1670,7 +1681,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1674: checking for crypt in -lcrypt" >&5
+echo "configure:1685: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1678,7 +1689,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1682 "configure"
+#line 1693 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1689,7 +1700,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:1693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1704: \"$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
@@ -1723,14 +1734,14 @@
 
 
 echo $ac_n "checking for library containing gettext""... $ac_c" 1>&6
-echo "configure:1727: checking for library containing gettext" >&5
+echo "configure:1738: checking for library containing gettext" >&5
 if eval "test \"`echo '$''{'ac_cv_search_gettext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_gettext="no"
 cat > conftest.$ac_ext <<EOF
-#line 1734 "configure"
+#line 1745 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1741,7 +1752,7 @@
 gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gettext="none required"
 else
@@ -1752,7 +1763,7 @@
 test "$ac_cv_search_gettext" = "no" && for i in intl; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1756 "configure"
+#line 1767 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1763,7 +1774,7 @@
 gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gettext="-l$i"
 break
@@ -1789,14 +1800,14 @@
     unset ac_cv_search_gettext
     
 echo $ac_n "checking for library containing gettext""... $ac_c" 1>&6
-echo "configure:1793: checking for library containing gettext" >&5
+echo "configure:1804: checking for library containing gettext" >&5
 if eval "test \"`echo '$''{'ac_cv_search_gettext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_gettext="no"
 cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
+#line 1811 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1807,7 +1818,7 @@
 gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gettext="none required"
 else
@@ -1818,7 +1829,7 @@
 test "$ac_cv_search_gettext" = "no" && for i in intl; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
+#line 1833 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1829,7 +1840,7 @@
 gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gettext="-l$i"
 break
@@ -1857,7 +1868,7 @@
 fi
 
 echo $ac_n "checking ld flags needed for gettext""... $ac_c" 1>&6
-echo "configure:1861: checking ld flags needed for gettext" >&5
+echo "configure:1872: checking ld flags needed for gettext" >&5
 if eval "test \"`echo '$''{'cf_cv_gettext_libs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1866,7 +1877,7 @@
 
 echo "$ac_t""$cf_cv_gettext_libs" 1>&6
 echo $ac_n "checking cpp flags needed for gettext""... $ac_c" 1>&6
-echo "configure:1870: checking cpp flags needed for gettext" >&5
+echo "configure:1881: checking cpp flags needed for gettext" >&5
 if eval "test \"`echo '$''{'cf_cv_gettext_incl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1881,12 +1892,12 @@
 for ac_func in gettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1885: checking for $ac_func" >&5
+echo "configure:1896: 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 <<EOF
-#line 1890 "configure"
+#line 1901 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1909,7 +1920,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1924: \"$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
@@ -1931,7 +1942,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:1935: checking for gettext in -lintl" >&5
+echo "configure:1946: checking for gettext in -lintl" >&5
 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1939,7 +1950,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1943 "configure"
+#line 1954 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1950,7 +1961,7 @@
 gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1965: \"$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
@@ -1982,7 +1993,7 @@
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1986: checking how to run the C preprocessor" >&5
+echo "configure:1997: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1997,13 +2008,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2001 "configure"
+#line 2012 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2018: \"$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
   :
@@ -2014,13 +2025,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2018 "configure"
+#line 2029 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2035: \"$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
   :
@@ -2031,13 +2042,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2035 "configure"
+#line 2046 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2052: \"$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
   :
@@ -2062,12 +2073,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2066: checking for ANSI C header files" >&5
+echo "configure:2077: 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 <<EOF
-#line 2071 "configure"
+#line 2082 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2075,7 +2086,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2090: \"$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*
@@ -2092,7 +2103,7 @@
 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
-#line 2096 "configure"
+#line 2107 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2110,7 +2121,7 @@
 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
-#line 2114 "configure"
+#line 2125 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2131,7 +2142,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2135 "configure"
+#line 2146 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2142,7 +2153,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2169,17 +2180,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2173: checking for $ac_hdr" >&5
+echo "configure:2184: checking for $ac_hdr" >&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
-#line 2178 "configure"
+#line 2189 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2194: \"$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*
@@ -2209,12 +2220,12 @@
 
 
 echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:2213: checking whether string.h and strings.h may both be included" >&5
+echo "configure:2224: checking whether string.h and strings.h may both be included" >&5
 if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2218 "configure"
+#line 2229 "configure"
 #include "confdefs.h"
 #include <string.h>
 #include <strings.h>
@@ -2222,7 +2233,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gcc_cv_header_string=yes
 else
@@ -2248,13 +2259,13 @@
 
 
 	echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:2252: checking for socklen_t" >&5
+echo "configure:2263: checking for socklen_t" >&5
 	if eval "test \"`echo '$''{'have_socklen_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 2258 "configure"
+#line 2269 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 			#include <sys/socket.h>
@@ -2262,7 +2273,7 @@
 socklen_t xxx = 75;
 ; return 0; }
 EOF
-if { (eval echo configure:2266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_socklen_t=yes
 else
@@ -2286,17 +2297,17 @@
 
 ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6
-echo "configure:2290: checking for stdarg.h" >&5
+echo "configure:2301: checking for stdarg.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
-#line 2295 "configure"
+#line 2306 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2311: \"$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*
@@ -2322,12 +2333,12 @@
 for ac_func in strlcat strlcpy writev socketpair mmap
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2326: checking for $ac_func" >&5
+echo "configure:2337: 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 <<EOF
-#line 2331 "configure"
+#line 2342 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2350,7 +2361,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2365: \"$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
@@ -2378,12 +2389,12 @@
 for ac_func in snprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2382: checking for $ac_func" >&5
+echo "configure:2393: 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 <<EOF
-#line 2387 "configure"
+#line 2398 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2406,7 +2417,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2421: \"$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
@@ -2433,12 +2444,12 @@
 for ac_func in vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2437: checking for $ac_func" >&5
+echo "configure:2448: 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 <<EOF
-#line 2442 "configure"
+#line 2453 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2461,7 +2472,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2476: \"$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
@@ -2497,9 +2508,9 @@
 cpp_flags_backup="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS -dM"
 echo $ac_n "checking for getrlimit max open files parameter""... $ac_c" 1>&6
-echo "configure:2501: checking for getrlimit max open files parameter" >&5
+echo "configure:2512: checking for getrlimit max open files parameter" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2503 "configure"
+#line 2514 "configure"
 #include "confdefs.h"
 #include <sys/resource.h>
 EOF
@@ -2511,7 +2522,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2515 "configure"
+#line 2526 "configure"
 #include "confdefs.h"
 #include <sys/resource.h>
 EOF
@@ -2523,7 +2534,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2527 "configure"
+#line 2538 "configure"
 #include "confdefs.h"
 #include <sys/resource.h>
 EOF
@@ -2545,7 +2556,7 @@
 fi
 
 echo $ac_n "checking for OpenSSL""... $ac_c" 1>&6
-echo "configure:2549: checking for OpenSSL" >&5
+echo "configure:2560: checking for OpenSSL" >&5
 # Check whether --enable-openssl or --disable-openssl was given.
 if test "${enable_openssl+set}" = set; then
   enableval="$enable_openssl"
@@ -2600,12 +2611,12 @@
 LIBS="$LIBS $SSL_LIBS"
 if test "X$cf_enable_openssl" != "Xno"; then
         echo $ac_n "checking for OpenSSL 0.9.6 or above""... $ac_c" 1>&6
-echo "configure:2604: checking for OpenSSL 0.9.6 or above" >&5
+echo "configure:2615: checking for OpenSSL 0.9.6 or above" >&5
     if test "$cross_compiling" = yes; then
   cf_openssl_version_ok='no'
 else
   cat > conftest.$ac_ext <<EOF
-#line 2609 "configure"
+#line 2620 "configure"
 #include "confdefs.h"
 
 #include <openssl/opensslv.h>
@@ -2619,7 +2630,7 @@
 }
     
 EOF
-if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   cf_openssl_version_ok='yes'
 else
@@ -2637,7 +2648,7 @@
                 save_CPPFLAGS="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS $SSL_LIBS"
         echo $ac_n "checking for RSA_free in -lcrypto""... $ac_c" 1>&6
-echo "configure:2641: checking for RSA_free in -lcrypto" >&5
+echo "configure:2652: checking for RSA_free in -lcrypto" >&5
 ac_lib_var=`echo crypto'_'RSA_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2645,7 +2656,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypto  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2649 "configure"
+#line 2660 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2656,7 +2667,7 @@
 RSA_free()
 ; return 0; }
 EOF
-if { (eval echo configure:2660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2671: \"$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
@@ -2688,12 +2699,12 @@
             for ac_func in EVP_bf_cfb
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2692: checking for $ac_func" >&5
+echo "configure:2703: 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 <<EOF
-#line 2697 "configure"
+#line 2708 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2716,7 +2727,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2731: \"$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
@@ -2743,12 +2754,12 @@
             for ac_func in EVP_cast5_cfb
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2747: checking for $ac_func" >&5
+echo "configure:2758: 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 <<EOF
-#line 2752 "configure"
+#line 2763 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2771,7 +2782,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2786: \"$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
@@ -2798,12 +2809,12 @@
             for ac_func in EVP_idea_cfb
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2802: checking for $ac_func" >&5
+echo "configure:2813: 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 <<EOF
-#line 2807 "configure"
+#line 2818 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2826,7 +2837,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2841: \"$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
@@ -2853,12 +2864,12 @@
             for ac_func in EVP_rc5_32_12_16_cfb
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2857: checking for $ac_func" >&5
+echo "configure:2868: 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 <<EOF
-#line 2862 "configure"
+#line 2873 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2881,7 +2892,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2896: \"$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
@@ -2908,12 +2919,12 @@
             for ac_func in EVP_des_ede3_cfb
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2912: checking for $ac_func" >&5
+echo "configure:2923: 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 <<EOF
-#line 2917 "configure"
+#line 2928 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2936,7 +2947,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2951: \"$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
@@ -2963,12 +2974,12 @@
             for ac_func in EVP_des_cfb
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2967: checking for $ac_func" >&5
+echo "configure:2978: 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 <<EOF
-#line 2972 "configure"
+#line 2983 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2991,7 +3002,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3006: \"$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
@@ -3017,7 +3028,7 @@
 
         fi
         CPPFLAGS="$save_CPPFLAGS"
-        SSL_LIBS="$SSL_LIBS -lcrypto"
+        SSL_LIBS="$SSL_LIBS -lcrypto -lssl"
     else
         echo "$ac_t""no - OpenSSL support disabled" 1>&6
     fi
@@ -3026,7 +3037,7 @@
 LIBS="$save_LIBS"
 
 echo $ac_n "checking if you want to try to use zlib""... $ac_c" 1>&6
-echo "configure:3030: checking if you want to try to use zlib" >&5
+echo "configure:3041: checking if you want to try to use zlib" >&5
 # Check whether --enable-zlib or --disable-zlib was given.
 if test "${enable_zlib+set}" = set; then
   enableval="$enable_zlib"
@@ -3040,7 +3051,7 @@
 case "$cf_enable_zlib" in
   yes)
     echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:3044: checking for deflate in -lz" >&5
+echo "configure:3055: checking for deflate in -lz" >&5
 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3048,7 +3059,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3052 "configure"
+#line 3063 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3059,7 +3070,7 @@
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3074: \"$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
@@ -3087,12 +3098,12 @@
 fi
 
     echo $ac_n "checking for zlibVersion""... $ac_c" 1>&6
-echo "configure:3091: checking for zlibVersion" >&5
+echo "configure:3102: checking for zlibVersion" >&5
 if eval "test \"`echo '$''{'ac_cv_func_zlibVersion'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3096 "configure"
+#line 3107 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char zlibVersion(); below.  */
@@ -3115,7 +3126,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_zlibVersion=yes"
 else
@@ -3141,7 +3152,7 @@
   *)
     LIBS="$LIBS -L$cf_enable_zlib"
     echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:3145: checking for deflate in -lz" >&5
+echo "configure:3156: checking for deflate in -lz" >&5
 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3149,7 +3160,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3153 "configure"
+#line 3164 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3160,7 +3171,7 @@
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3175: \"$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
@@ -3188,12 +3199,12 @@
 fi
 
     echo $ac_n "checking for zlibVersion""... $ac_c" 1>&6
-echo "configure:3192: checking for zlibVersion" >&5
+echo "configure:3203: checking for zlibVersion" >&5
 if eval "test \"`echo '$''{'ac_cv_func_zlibVersion'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3197 "configure"
+#line 3208 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char zlibVersion(); below.  */
@@ -3216,7 +3227,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_zlibVersion=yes"
 else
@@ -3241,7 +3252,7 @@
 
 
 echo $ac_n "checking if you want to do a profile build""... $ac_c" 1>&6
-echo "configure:3245: checking if you want to do a profile build" >&5
+echo "configure:3256: checking if you want to do a profile build" >&5
 # Check whether --enable-profile or --disable-profile was given.
 if test "${enable_profile+set}" = set; then
   enableval="$enable_profile"
@@ -3262,7 +3273,7 @@
 
 
 echo $ac_n "checking if you want ElectricFence""... $ac_c" 1>&6
-echo "configure:3266: checking if you want ElectricFence" >&5
+echo "configure:3277: checking if you want ElectricFence" >&5
 # Check whether --enable-efence or --disable-efence was given.
 if test "${enable_efence+set}" = set; then
   enableval="$enable_efence"
@@ -3286,7 +3297,7 @@
 
 
 echo $ac_n "checking if you want the block allocator""... $ac_c" 1>&6
-echo "configure:3290: checking if you want the block allocator" >&5
+echo "configure:3301: checking if you want the block allocator" >&5
 # Check whether --enable-block-alloc or --disable-block-alloc was given.
 if test "${enable_block_alloc+set}" = set; then
   enableval="$enable_block_alloc"
@@ -3315,12 +3326,10 @@
   
   case "$enableval" in
   yes)
-    echo "Forcing poll() to be enabled"
-    ac_cv_func_poll="yes"
+        ac_cv_func_poll="yes"
     ;;
   no)
-    echo "Forcing poll() to be disabled"
-    ac_cv_func_poll="no"
+        ac_cv_func_poll="no"
     ;;
   esac
 
@@ -3333,12 +3342,10 @@
   
   case "$enableval" in
   yes)
-    echo "Forcing select() to be enabled"
-    ac_cv_func_select="yes"
+        ac_cv_func_select="yes"
     ;;
   no)
-    echo "Forcing select() to be disabled"
-    ac_cv_func_select="no"
+        ac_cv_func_select="no"
     ;;
   esac
 
@@ -3351,12 +3358,10 @@
   
   case "$enableval" in
   yes)
-    echo "Forcing kqueue() to be enabled"
-    ac_cv_func_kqueue="yes"
+        ac_cv_func_kqueue="yes"
     ;;
   no)
-    echo "Forcing kqueue() to be disabled"
-    ac_cv_func_kqueue="no"
+        ac_cv_func_kqueue="no"
   ;;
 esac
 
@@ -3369,12 +3374,10 @@
   
   case "$enableval" in
   yes)
-    echo "Forcing /dev/poll to be enabled"
-    ac_cv_func_devpoll="yes"
+        ac_cv_func_devpoll="yes"
     ;;
   no)
-    echo "Forcing /dev/poll to be disabled"
-    ac_cv_func_devpoll="no"
+        ac_cv_func_devpoll="no"
   ;;
 esac
 
@@ -3387,8 +3390,7 @@
   
   case "$enableval" in
   yes)
-    echo "Forcing Linux epoll to be enabled"
-    ac_cv_func_epoll="yes"
+        ac_cv_func_epoll="yes"
     ;;
   no)
     ac_cv_func_epoll="no"
@@ -3401,13 +3403,13 @@
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:3405: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:3407: 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 <<EOF
-#line 3411 "configure"
+#line 3413 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
@@ -3425,7 +3427,7 @@
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 3429 "configure"
+#line 3431 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
@@ -3449,12 +3451,12 @@
 
 
 echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:3453: checking for u_int32_t" >&5
+echo "configure:3455: checking for u_int32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3458 "configure"
+#line 3460 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3483,12 +3485,12 @@
 
 
 echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
-echo "configure:3487: checking for uintptr_t" >&5
+echo "configure:3489: checking for uintptr_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3492 "configure"
+#line 3494 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3518,12 +3520,12 @@
 
 rm -f conftest conftest.f
 echo $ac_n "checking for poll""... $ac_c" 1>&6
-echo "configure:3522: checking for poll" >&5
+echo "configure:3524: checking for poll" >&5
 if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3527 "configure"
+#line 3529 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char poll(); below.  */
@@ -3546,7 +3548,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_poll=yes"
 else
@@ -3572,12 +3574,12 @@
 	for ac_func in kevent
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3576: checking for $ac_func" >&5
+echo "configure:3578: 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 <<EOF
-#line 3581 "configure"
+#line 3583 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3600,7 +3602,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3606: \"$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
@@ -3673,7 +3675,6 @@
 
 	fi
 fi
-echo "Using ${SELECT_TYPE} for select loop."
 cat >> confdefs.h <<EOF
 #define SELECT_TYPE "$SELECT_TYPE"
 EOF
@@ -3681,8 +3682,7 @@
 
 
 if test "$ac_cv_func_gettext" = "yes" -o "$ac_cv_lib_intl_gettext" = "yes"; then
-	echo "Building with gettext."
-	MSGFMT="msgfmt -o"
+		MSGFMT="msgfmt -o"
 	SUBDIR_MESSAGES="messages"
         cat >> confdefs.h <<\EOF
 #define HAVE_GETTEXT 1
@@ -3707,8 +3707,7 @@
 #define IPV6 1
 EOF
 
-	echo "Using IPv6 support"
-fi
+	fi
 
 ac_cv_assert="-DNDEBUG"
 
@@ -3748,12 +3747,11 @@
   
   case "$enableval" in
   yes)
-    echo "Enabling small net code."
-    IRC_CFLAGS="$IRC_CFLAGS -DSMALL_NET=1"
+        IRC_CFLAGS="$IRC_CFLAGS -DSMALL_NET=1"
+	ac_cv_smallnet='yes'
     ;;
   no)
-    echo "Disabling small net code."
-    IRC_CFLAGS="$IRC_CFLAGS"
+        IRC_CFLAGS="$IRC_CFLAGS"
     ;;
   esac
 
@@ -3768,7 +3766,6 @@
 if test "${with_nicklen+set}" = set; then
   withval="$with_nicklen"
   
-	echo $withval
   if test "$withval" = "no"; then
 	ac_cv_nicklen="9"
   else
@@ -3777,7 +3774,6 @@
 
 fi
 
-echo "$ac_t"""Setting NICKLEN to $ac_cv_nicklen"" 1>&6
 cat >> confdefs.h <<EOF
 #define NICKLEN (${ac_cv_nicklen}+1)
 EOF
@@ -3795,7 +3791,6 @@
 
 fi
 
-echo "$ac_t"""Setting MAX_CLIENTS to $ac_cv_maxclients"" 1>&6
 cat >> confdefs.h <<EOF
 #define MAX_CLIENTS ${ac_cv_maxclients}
 EOF
@@ -3813,7 +3808,6 @@
 
 fi
 
-echo "$ac_t"""Setting TOPICLEN to $ac_cv_topiclen"" 1>&6
 cat >> confdefs.h <<EOF
 #define TOPICLEN ${ac_cv_topiclen}
 EOF
@@ -3857,12 +3851,12 @@
 	SEDOBJ="s/.o:/.so:/"
         
         echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:3861: checking for shl_load" >&5
+echo "configure:3855: checking for shl_load" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3866 "configure"
+#line 3860 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shl_load(); below.  */
@@ -3885,7 +3879,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shl_load=yes"
 else
@@ -3909,7 +3903,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:3913: checking for shl_load in -ldld" >&5
+echo "configure:3907: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3917,7 +3911,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3921 "configure"
+#line 3915 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3928,7 +3922,7 @@
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:3932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3926: \"$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
@@ -3961,17 +3955,17 @@
         if test "$ac_cv_have_shl_load" = "no"; then
             ac_safe=`echo "mach-o/dyld.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for mach-o/dyld.h""... $ac_c" 1>&6
-echo "configure:3965: checking for mach-o/dyld.h" >&5
+echo "configure:3959: checking for mach-o/dyld.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
-#line 3970 "configure"
+#line 3964 "configure"
 #include "confdefs.h"
 #include <mach-o/dyld.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3969: \"$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*
@@ -3992,12 +3986,12 @@
   echo "$ac_t""no" 1>&6
 
         echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:3996: checking for dlopen" >&5
+echo "configure:3990: 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 <<EOF
-#line 4001 "configure"
+#line 3995 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
@@ -4020,7 +4014,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4018: \"$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
@@ -4040,7 +4034,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4044: checking for dlopen in -ldl" >&5
+echo "configure:4038: 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
@@ -4048,7 +4042,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4052 "configure"
+#line 4046 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4059,7 +4053,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4057: \"$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
@@ -4094,7 +4088,7 @@
             { echo "configure: error: shared module support could not be found - try running configure with --disable-shared-modules" 1>&2; exit 1; }
         fi
 		echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6
-echo "configure:4098: checking for dlsym in -ldl" >&5
+echo "configure:4092: checking for dlsym in -ldl" >&5
 ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4102,7 +4096,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4106 "configure"
+#line 4100 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4113,7 +4107,7 @@
 dlsym()
 ; return 0; }
 EOF
-if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4111: \"$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
@@ -4143,12 +4137,12 @@
 	for ac_func in dlopen
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4147: checking for $ac_func" >&5
+echo "configure:4141: 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 <<EOF
-#line 4152 "configure"
+#line 4146 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4171,7 +4165,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4169: \"$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
@@ -4199,17 +4193,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4203: checking for $ac_hdr" >&5
+echo "configure:4197: checking for $ac_hdr" >&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
-#line 4208 "configure"
+#line 4202 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4207: \"$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*
@@ -4240,17 +4234,17 @@
 	# all symbols visible in the dynamic symbol table.
 	hold_ldflags=$LDFLAGS
 	echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:4244: checking for the ld -export-dynamic flag" >&5
+echo "configure:4238: checking for the ld -export-dynamic flag" >&5
 	LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
 	cat > conftest.$ac_ext <<EOF
-#line 4247 "configure"
+#line 4241 "configure"
 #include "confdefs.h"
 
 int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:4254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   found=yes
 else
@@ -4267,7 +4261,7 @@
 	fi
 
 	echo $ac_n "checking for compiler option to produce PIC""... $ac_c" 1>&6
-echo "configure:4271: checking for compiler option to produce PIC" >&5
+echo "configure:4265: checking for compiler option to produce PIC" >&5
 				if test "$SGS" = "yes"; then
 		echo "$ac_t""SVR4 Software Generation System interfaces: -KPIC -DPIC -G" 1>&6
 		PICFLAGS="-KPIC -DPIC -G"
@@ -4299,12 +4293,12 @@
 
 	nlist_lib=""
 	echo $ac_n "checking for nlist""... $ac_c" 1>&6
-echo "configure:4303: checking for nlist" >&5
+echo "configure:4297: checking for nlist" >&5
 if eval "test \"`echo '$''{'ac_cv_func_nlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4308 "configure"
+#line 4302 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char nlist(); below.  */
@@ -4327,7 +4321,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_nlist=yes"
 else
@@ -4345,7 +4339,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for nlist in -ldl""... $ac_c" 1>&6
-echo "configure:4349: checking for nlist in -ldl" >&5
+echo "configure:4343: checking for nlist in -ldl" >&5
 ac_lib_var=`echo dl'_'nlist | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4353,7 +4347,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4357 "configure"
+#line 4351 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4364,7 +4358,7 @@
 nlist()
 ; return 0; }
 EOF
-if { (eval echo configure:4368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4362: \"$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
@@ -4383,7 +4377,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for nlist in -lelf""... $ac_c" 1>&6
-echo "configure:4387: checking for nlist in -lelf" >&5
+echo "configure:4381: checking for nlist in -lelf" >&5
 ac_lib_var=`echo elf'_'nlist | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4391,7 +4385,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lelf  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4395 "configure"
+#line 4389 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4402,7 +4396,7 @@
 nlist()
 ; return 0; }
 EOF
-if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4400: \"$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
@@ -4432,17 +4426,17 @@
 
                         	ac_safe=`echo "libelf/nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libelf/nlist.h""... $ac_c" 1>&6
-echo "configure:4436: checking for libelf/nlist.h" >&5
+echo "configure:4430: checking for libelf/nlist.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
-#line 4441 "configure"
+#line 4435 "configure"
 #include "confdefs.h"
 #include <libelf/nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4440: \"$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*
@@ -4465,17 +4459,17 @@
 
 	ac_safe=`echo "elf/nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for elf/nlist.h""... $ac_c" 1>&6
-echo "configure:4469: checking for elf/nlist.h" >&5
+echo "configure:4463: checking for elf/nlist.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
-#line 4474 "configure"
+#line 4468 "configure"
 #include "confdefs.h"
 #include <elf/nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4473: \"$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*
@@ -4498,17 +4492,17 @@
 
 	ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:4502: checking for nlist.h" >&5
+echo "configure:4496: checking for nlist.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
-#line 4507 "configure"
+#line 4501 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4506: \"$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*
@@ -4539,7 +4533,7 @@
 
 	else
 		echo $ac_n "checking for extra underscores prepended to symbol names""... $ac_c" 1>&6
-echo "configure:4543: checking for extra underscores prepended to symbol names" >&5
+echo "configure:4537: checking for extra underscores prepended to symbol names" >&5
 		if eval "test \"`echo '$''{'symbol_underscores'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4604,7 +4598,7 @@
 
 if test "$ac_cv_efence" = "yes"; then
 	echo $ac_n "checking for malloc in -lefence""... $ac_c" 1>&6
-echo "configure:4608: checking for malloc in -lefence" >&5
+echo "configure:4602: checking for malloc in -lefence" >&5
 ac_lib_var=`echo efence'_'malloc | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4612,7 +4606,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lefence  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4616 "configure"
+#line 4610 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4623,7 +4617,7 @@
 malloc()
 ; return 0; }
 EOF
-if { (eval echo configure:4627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4621: \"$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
@@ -5080,12 +5074,40 @@
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
 
-if test "X${cf_openssl_ciphers}" != "X"; then
-  echo ""
-  echo "Available cryptlinks ciphers:"
-  echo ""
-  echo "${cf_openssl_ciphers}"
-  echo ""
+
+echo "
+
+Configuration:
+
+  Installing into ......... $prefix
+  Detected OS ............. `uname -rs`
+  Building Version ........ ${PACKAGE} ${VERSION}
+"
+
+if test "x$ac_cv_ipv6" = "xyes" ; then
+  echo "  IPv6 Support ............ yes"
+else
+  echo "  IPv6 Support ............ no"
 fi
 
-echo "$ac_t""Server is configured with NICKLEN=$ac_cv_nicklen and MAX_CLIENTS=$ac_cv_maxclients" 1>&6
+if test "x$ac_cv_smallnet" = "xyes" ; then
+  echo "  Small net ............... yes"
+else
+  echo "  Small net ............... no"
+fi
+
+if test "$ac_cv_func_gettext" = "yes" -o "$ac_cv_lib_intl_gettext" = "yes"; then
+  echo "  Gettext ................. yes"
+else
+  echo "  Gettext ................. no"
+fi
+
+echo "
+  Select loop ............. ${SELECT_TYPE}
+  NICKLEN ................. $ac_cv_nicklen
+  TOPICLEN ................ $ac_cv_topiclen
+  MAX_CLIENTS ............. $ac_cv_maxclients
+  Available ciphers ....... ${cf_openssl_ciphers}
+
+"
+
diff -uNrd ircd-ratbox-1.3-1/doc/example.conf ircd-ratbox-1.3-1+fr-ssl/doc/example.conf
--- ircd-ratbox-1.3-1/doc/example.conf	Wed Nov  5 09:10:49 2003
+++ ircd-ratbox-1.3-1+fr-ssl/doc/example.conf	Sat Jan 24 19:23:36 2004
@@ -84,6 +84,23 @@
 	 *	chmod 0644 rsa.pub
 	 */
 	#rsa_private_key_file = "/usr/local/ircd/etc/rsa.key";
+
+    /* SSL certificate file, used for client SSL connections
+     *
+     * Assuming your private RSA key is stored in rsa.key, you
+     * must first create a certificate request, then sign it:
+     *
+     *  openssl req -new -key rsa.key -out cert.csr
+     *  openssl x509 -req -in cert.csr -extensions v3_ca \
+     *   -signkey rsa.key -out cert.pem -trustout
+     */
+    #ssl_certificate_file = "/usr/local/ircd/etc/cert.pem";
+
+    /* Certification Authority certificate file, used to sign
+     * ssl_certificate_file. Shouldn't be used if certificate
+     * is self-signed
+     */
+    #ssl_ca_certificate_file = "/usr/local/ircd/etc/ca.pem";
 };
 
 /* admin {}: contains admin information about the server. (OLD A:) */
@@ -195,14 +212,19 @@
 	/* port: listen on all available IPs, ports 5000 and 6665 to 6669 */
 	port = 5000, 6665 .. 6669;
 
+	/* sslport: listen for SSL connections on all available IPs, ports 7000 to 7005 */
+	sslport = 7000 .. 7005;
+
 	/* host: set a specific IP/host the ports after the line will listen 
 	 * on.  This may be ipv4 or ipv6.
 	 */
 	host = "1.2.3.4";
 	port = 7000, 7001;
+	sslport = 7099;
 
 	host = "3ffe:1234:a:b:c::d";
-        port = 7002;
+    port = 7002;
+	sslport = 7199;
 };
 
 /* auth {}: allow users to connect to the ircd (OLD I:) */
diff -uNrd ircd-ratbox-1.3-1/include/client.h ircd-ratbox-1.3-1+fr-ssl/include/client.h
--- ircd-ratbox-1.3-1/include/client.h	Thu Nov 27 13:20:10 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/client.h	Sat Jan 24 19:25:11 2004
@@ -132,6 +132,10 @@
 	unsigned char handler;	/* Handler index */
 	unsigned long serial;	/* used to enforce 1 send per nick */
 
+#ifdef HAVE_LIBCRYPTO
+	SSL *ssl;
+#endif
+
 	/* client->name is the unique name for a client nick or host */
 	char name[HOSTLEN + 1];
 
@@ -164,6 +168,7 @@
 	dlink_list on_allow_list;	/* clients that have =me= on their allow list */
 
 	struct LocalUser *localClient;
+
 };
 
 struct LocalUser
@@ -418,6 +423,7 @@
 #define FLAGS2_IP_SPOOFING      0x400000
 #define FLAGS2_FLOODDONE        0x800000
 #define FLAGS2_EXEMPTSPAMBOT	0x1000000
+#define FLAGS2_SSL				0x2000000
 
 #define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
                       UMODE_ADMIN)
@@ -540,6 +546,9 @@
 
 #define IsFloodDone(x)          ((x)->flags2 & FLAGS2_FLOODDONE)
 #define SetFloodDone(x)         ((x)->flags2 |= FLAGS2_FLOODDONE)
+
+#define SetSSL(x)               ((x)->flags2 |= FLAGS2_SSL)
+#define IsSSL(x)                (((x)->flags2 & FLAGS2_SSL) && (x)->ssl)
 
 /*
  * definitions for get_client_name
diff -uNrd ircd-ratbox-1.3-1/include/db.h ircd-ratbox-1.3-1+fr-ssl/include/db.h
--- ircd-ratbox-1.3-1/include/db.h	Wed Dec 31 17:00:00 1969
+++ ircd-ratbox-1.3-1+fr-ssl/include/db.h	Sat Jan 24 14:08:29 2004
@@ -0,0 +1,69 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  dh.h: Diffie-Hellman key exchange header.
+ *
+ *  Copyright (C) 2003 by the past and present ircd coders, and others.
+ *
+ *  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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: dh.h,v 1.0 2003/12/03 20:17:11 Sakura Exp $
+ */
+
+#ifndef INCLUDED_dh_h
+#define INCLUDED_dh_h
+
+#include "setup.h"
+
+#ifdef HAVE_LIBCRYPTO
+#include "client.h"
+
+#define KEY_BITS 512
+
+#define RAND_BITS KEY_BITS
+#define RAND_BYTES (RAND_BITS / 8)
+#define RAND_BYTES_HEX ((RAND_BYTES * 2) + 1)
+
+#define PRIME_BITS 1024
+#define PRIME_BYTES (PRIME_BITS / 8)
+#define PRIME_BYTES_HEX ((PRIME_BYTES * 2) + 1)
+
+struct dh_session {
+   DH *dh;
+   char *session_shared;
+   int session_shared_length;
+};
+
+void dh_init(void);
+extern int dh_generate_shared(struct dh_session *, char *);
+extern int dh_get_s_shared(char *, int *, struct dh_session *);
+extern int dh_hexstr_to_raw(char *, unsigned char *, int *);
+extern void dh_end_session(struct dh_session *);
+extern struct dh_session *dh_start_session(void);
+extern char *dh_get_s_secret(char *, int, struct dh_session *);
+extern char *dh_get_s_public(char *, int, struct dh_session *);
+
+extern int safe_SSL_read(struct Client *, void *, int);
+extern int safe_SSL_write(struct Client *, const void *, int);
+extern int safe_SSL_accept(struct Client *, int);
+extern int SSL_smart_shutdown(SSL *);
+extern int initssl(void);
+extern SSL_CTX *ircdssl_ctx;
+
+#endif
+
+extern void ircd_init_ssl(void);
+
+#endif  /* INCLUDED_dh_h */
diff -uNrd ircd-ratbox-1.3-1/include/linebuf.h ircd-ratbox-1.3-1+fr-ssl/include/linebuf.h
--- ircd-ratbox-1.3-1/include/linebuf.h	Thu Jun 26 07:01:41 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/linebuf.h	Sat Jan 24 20:18:31 2004
@@ -80,7 +80,7 @@
 extern int linebuf_parse(buf_head_t *, char *, int, int);
 extern int linebuf_get(buf_head_t *, char *, int, int, int);
 extern void linebuf_putmsg(buf_head_t *, const char *, va_list *, const char *, ...);
-extern int linebuf_flush(int, buf_head_t *);
+extern int linebuf_flush(struct Client *, int, buf_head_t *);
 extern void linebuf_attach(buf_head_t *, buf_head_t *);
 extern void count_linebuf_memory(int *, u_long *);
 #endif
diff -uNrd ircd-ratbox-1.3-1/include/listener.h ircd-ratbox-1.3-1+fr-ssl/include/listener.h
--- ircd-ratbox-1.3-1/include/listener.h	Thu Jun 26 07:01:41 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/listener.h	Sat Jan 24 13:34:18 2004
@@ -48,9 +48,11 @@
 	struct irc_inaddr addr;	/* virtual address or INADDR_ANY */
 	struct DNSQuery *dns_query;
 	char vhost[HOSTLEN + 1];	/* virtual name of listener */
+
+	int	is_ssl;
 };
 
-extern void add_listener(int port, const char *vaddr_ip);
+extern void add_listener(int port, const char *vaddr_ip, int is_ssl);
 extern void close_listener(struct Listener *listener);
 extern void close_listeners(void);
 extern const char *get_listener_name(const struct Listener *listener);
diff -uNrd ircd-ratbox-1.3-1/include/numeric.h ircd-ratbox-1.3-1+fr-ssl/include/numeric.h
--- ircd-ratbox-1.3-1/include/numeric.h	Sun Oct 12 05:50:43 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/numeric.h	Sat Jan 24 19:50:54 2004
@@ -117,6 +117,8 @@
 #define RPL_LOCALUSERS       265
 #define RPL_GLOBALUSERS      266
 
+#define RPL_USINGSSL	     275
+
 #define RPL_ACCEPTLIST	     281
 #define RPL_ENDOFACCEPT      282
 
diff -uNrd ircd-ratbox-1.3-1/include/patchlevel.h ircd-ratbox-1.3-1+fr-ssl/include/patchlevel.h
--- ircd-ratbox-1.3-1/include/patchlevel.h	Fri Jan  9 13:05:13 2004
+++ ircd-ratbox-1.3-1+fr-ssl/include/patchlevel.h	Sat Jan 24 20:37:47 2004
@@ -1,10 +1,11 @@
 /*
- *  ircd-ratbox: A slightly useful ircd. 
+ *  FreeWorld-ircd: A slightly useful ircd. 
  *  patchlevel.h: A header defining the patchlevel.
  *
  *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
  *  Copyright (C) 1996-2002 Hybrid Development Team
  *  Copyright (C) 2002 ircd-ratbox development team
+ *  Copyright (C) 2004 FreeWorld development team
  *
  *  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
@@ -25,5 +26,5 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL   "ircd-ratbox-1.3-1"
+#define PATCHLEVEL   "ircd-ratbox-1.3-1+SSL"
 #endif
diff -uNrd ircd-ratbox-1.3-1/include/s_conf.h ircd-ratbox-1.3-1+fr-ssl/include/s_conf.h
--- ircd-ratbox-1.3-1/include/s_conf.h	Fri Dec 19 10:32:49 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/s_conf.h	Sat Jan 24 19:25:58 2004
@@ -32,6 +32,7 @@
 
 #ifdef HAVE_LIBCRYPTO
 #include <openssl/rsa.h>
+#include <openssl/ssl.h>
 #endif
 
 #include "config.h"		/* defines */
@@ -84,6 +85,10 @@
 	char *rsa_public_key_file;
 	RSA *rsa_public_key;
 	struct EncCapability *cipher_preference;
+	char *ssl_certificate_file;
+	char *ssl_ca_certificate_file;
+	SSL_CTX *ctx;
+	SSL_METHOD *meth;
 #endif
 };
 
@@ -305,6 +310,10 @@
 #ifdef HAVE_LIBCRYPTO
 	char *rsa_private_key_file;
 	RSA *rsa_private_key;
+  char *ssl_certificate_file;
+  char *ssl_ca_certificate_file;
+  SSL_CTX *ctx;
+  SSL_METHOD *meth;
 #endif
 	int hub;
 	struct irc_inaddr ip;
diff -uNrd ircd-ratbox-1.3-1/include/stdinc.h ircd-ratbox-1.3-1+fr-ssl/include/stdinc.h
--- ircd-ratbox-1.3-1/include/stdinc.h	Wed Oct 15 09:33:59 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/stdinc.h	Sat Jan 24 12:44:26 2004
@@ -48,6 +48,17 @@
 #include <stddef.h>
 #endif
 
+#ifdef HAVE_LIBCRYPTO
+#include <openssl/rand.h>
+#include <openssl/err.h>
+#include <openssl/bn.h>
+#include <openssl/dh.h>
+#include <openssl/rsa.h> 
+#include <openssl/crypto.h>
+#include <openssl/pem.h>
+#include <openssl/ssl.h>
+#endif
+
 
 
 #include <stdio.h>
diff -uNrd ircd-ratbox-1.3-1/include/supported.h ircd-ratbox-1.3-1+fr-ssl/include/supported.h
--- ircd-ratbox-1.3-1/include/supported.h	Mon Aug  4 12:35:23 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/supported.h	Sat Jan 24 19:28:39 2004
@@ -63,7 +63,7 @@
 		  " CHARSET=ascii" \
 		  " CALLERID" \
 		  " ETRACE" \
-		  " WALLCHOPS"
+		  " SSL WALLCHOPS"
 
 #define FEATURES2VALUES ConfigServerHide.disable_local_channels ? "#" : "#&", \
                         ConfigChannel.use_except ? "e" : "", \
diff -uNrd ircd-ratbox-1.3-1/include/tools.h ircd-ratbox-1.3-1+fr-ssl/include/tools.h
--- ircd-ratbox-1.3-1/include/tools.h	Thu Jun 26 07:01:42 2003
+++ ircd-ratbox-1.3-1+fr-ssl/include/tools.h	Sat Jan 24 14:00:28 2004
@@ -63,6 +63,7 @@
 void dlinkAddTail(void *data, dlink_node * m, dlink_list * list);
 
 void dlinkDelete(dlink_node * m, dlink_list * list);
+extern void dlinkDeleteNode(dlink_node *m, dlink_list *list);
 
 void dlinkMoveList(dlink_list * from, dlink_list * to);
 
diff -uNrd ircd-ratbox-1.3-1/modules/Makefile.in ircd-ratbox-1.3-1+fr-ssl/modules/Makefile.in
--- ircd-ratbox-1.3-1/modules/Makefile.in	Thu Nov 27 10:31:47 2003
+++ ircd-ratbox-1.3-1+fr-ssl/modules/Makefile.in	Sat Jan 24 12:34:28 2004
@@ -135,25 +135,20 @@
 
 install-mkdirs:
 	-@if test ! -d $(prefix); then \
-                echo "mkdir $(prefix)"; \
                 mkdir $(prefix); \
         fi
 	
 	-@if test -d $(moduledir)-old; then \
-		echo "rm -rf $(moduledir)-old"; \
 		rm -rf $(moduledir)-old; \
 	fi
 	-@if test -d $(moduledir); then \
-		echo "mv $(moduledir) $(moduledir)-old"; \
 		mv $(moduledir) $(moduledir)-old; \
 	fi
 
 	-@if test ! -d $(moduledir); then \
-                echo "mkdir $(moduledir)"; \
                 mkdir $(moduledir); \
         fi
 	-@if test ! -d $(automoduledir); then \
-                echo "mkdir $(automoduledir)"; \
                 mkdir $(automoduledir); \
         fi
 
@@ -185,13 +180,16 @@
 .SUFFIXES: .sl .so .o
 
 .c.o:
-	${CC} ${CPPFLAGS} ${CFLAGS} -c $< -o $@
+	@${CC} ${CPPFLAGS} ${CFLAGS} -c $< -o $@
+	@echo "Compiling $<"
 
 .c.so:
-	${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $< -o $@
+	@${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $< -o $@
+	@echo "Compiling $<"
 
 .so.sl:
-	$(LD) -b $< -o $@
+	@$(LD) -b $< -o $@
+	@echo "Compiling $<"
 
 .PHONY: depend clean distclean
 depend:
diff -uNrd ircd-ratbox-1.3-1/modules/m_whois.c ircd-ratbox-1.3-1+fr-ssl/modules/m_whois.c
--- ircd-ratbox-1.3-1/modules/m_whois.c	Fri Nov 28 08:14:51 2003
+++ ircd-ratbox-1.3-1+fr-ssl/modules/m_whois.c	Sat Jan 24 20:32:10 2004
@@ -319,7 +319,13 @@
 	else
 		sendto_one(source_p, form_str(RPL_WHOISSERVER),
 			   me.name, source_p->name, target_p->name,
-			   ServerInfo.network_name, ServerInfo.network_desc);
+		   ServerInfo.network_name, ServerInfo.network_desc);
+
+#ifdef HAVE_LIBCRYPTO
+    if (target_p->ssl)
+      sendto_one(source_p, form_str(RPL_USINGSSL),
+                 me.name, source_p->name, target_p->name);	
+#endif
 
 	if(target_p->user->away)
 		sendto_one(source_p, form_str(RPL_AWAY), me.name,
diff -uNrd ircd-ratbox-1.3-1/src/Makefile.in ircd-ratbox-1.3-1+fr-ssl/src/Makefile.in
--- ircd-ratbox-1.3-1/src/Makefile.in	Wed Oct 15 09:34:04 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/Makefile.in	Sat Jan 24 14:08:56 2004
@@ -61,6 +61,7 @@
   class.c                       \
   client.c                      \
   cluster.c			\
+  dh.c \
   dynlink.c			\
   event.c                       \
   fdlist.c                      \
@@ -107,6 +108,7 @@
   s_user.c                      \
   scache.c                      \
   send.c                        \
+  ssl.c \
   @SNPRINTF_C@			\
   sprintf_irc.c			\
   tools.c                       \
@@ -121,8 +123,8 @@
 build: all
 
 ircd: $(OBJS) y.tab.o lex.yy.o version.o
-	${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} lex.yy.o y.tab.o version.o ${IRCDLIBS} ${LEXLIB}
-	mv version.c version.c.last
+	@${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} lex.yy.o y.tab.o version.o ${IRCDLIBS} ${LEXLIB}
+	@mv version.c version.c.last
 
 install-mkdirs:
 	-@if test ! -d $(prefix); then \
@@ -162,7 +164,8 @@
 
 # this is really the default rule for c files
 .c.o:
-	${CC} ${CPPFLAGS} ${CFLAGS} -c $<
+	@${CC} ${CPPFLAGS} ${CFLAGS} -c $<
+	@echo "Compiling $<"
 
 .PHONY: depend clean distclean
 depend:
diff -uNrd ircd-ratbox-1.3-1/src/dh.c ircd-ratbox-1.3-1+fr-ssl/src/dh.c
--- ircd-ratbox-1.3-1/src/dh.c	Wed Dec 31 17:00:00 1969
+++ ircd-ratbox-1.3-1+fr-ssl/src/dh.c	Sat Jan 24 14:16:42 2004
@@ -0,0 +1,247 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  dh.c: Diffie-Hellman key exchange.
+ *
+ *  Copyright (C) 2003 by the past and present ircd coders, and others.
+ *
+ *  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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: dh.c,v 1.00 2003/12/03 20:33:17 Sakura Exp $
+ */
+
+
+#include "stdinc.h"
+#include "setup.h"
+#include "config.h"
+#include "memory.h"
+
+#ifdef HAVE_LIBCRYPTO
+#include "db.h"
+
+static unsigned int dh_gen_1024;
+static unsigned char dh_prime_1024[];
+static char *hex_to_string[256];
+
+static BIGNUM *ircd_prime;
+static BIGNUM *ircd_generator;
+
+static int verify_is_hex(char *string)
+{
+    int l = strlen(string);
+    char tmp[4] = { '\0', '\0', '\0', '\0' };
+    int tmpidx = 0;
+
+    if (l & 0x01) {		/* check if it's odd length */
+	l++;
+	tmp[tmpidx++] = '0';	/* pad with zero */
+    }
+
+    while (*string) {
+	tmp[tmpidx++] = *string++;
+	if (tmpidx == 2) {
+    char *eptr;
+    unsigned char x;
+
+	    tmpidx = 0;
+
+	    x = strtol(tmp, &eptr, 16);
+	    if (*eptr != '\0') {
+		return 0;
+	    }
+	}
+    }
+    return 1;
+}
+
+static void create_prime()
+{
+char buf[PRIME_BYTES_HEX];
+int i;
+int bufpos = 0;
+
+    for (i = 0; i < PRIME_BYTES; i++) {
+char *x = hex_to_string[dh_prime_1024[i]];
+	while (*x)
+	    buf[bufpos++] = *x++;
+    }
+    buf[bufpos] = '\0';
+
+    ircd_prime = NULL;
+    BN_hex2bn(&ircd_prime, buf);
+    ircd_generator = BN_new();
+    BN_set_word(ircd_generator, dh_gen_1024);
+}
+
+void dh_init(void)
+{
+    ERR_load_crypto_strings();
+
+    printf("Importing prime...\n");
+    create_prime();
+    printf("Prime imported.\n");
+}
+
+int dh_generate_shared(struct dh_session *si, char *public_key)
+{
+    BIGNUM *tmp;
+    int len;
+
+    if (verify_is_hex(public_key) == 0 || !si || si->session_shared)
+	return 0;
+
+    tmp = NULL;
+    BN_hex2bn(&tmp, public_key);
+    if (!tmp)
+	return 0;
+
+    si->session_shared_length = DH_size(si->dh);
+    si->session_shared = (char *) MyMalloc(DH_size(si->dh));
+    len = DH_compute_key(si->session_shared, tmp, si->dh);
+    BN_free(tmp);
+
+    if (len < 0)
+	return 0;
+
+    si->session_shared_length = len;
+
+    return 1;
+}
+
+struct dh_session *dh_start_session(void)
+{
+    struct dh_session *si = (struct dh_session *) MyMalloc(sizeof(struct dh_session));
+    if (!si)
+	abort();
+
+    memset(si, 0, sizeof(struct dh_session));
+
+    si->dh = DH_new();
+    si->dh->p = BN_dup(ircd_prime);
+    si->dh->g = BN_dup(ircd_generator);
+
+    if (!DH_generate_key(si->dh)) {
+	DH_free(si->dh);
+	MyFree(si);
+	return NULL;
+    }
+
+    return (void *) si;
+}
+
+void dh_end_session(struct dh_session *si)
+{
+    if (si->dh) {
+	DH_free(si->dh);
+	si->dh = NULL;
+    }
+
+    if (si->session_shared) {
+	memset(si->session_shared, 0, si->session_shared_length);
+	MyFree(si->session_shared);
+	si->session_shared = NULL;
+    }
+
+    MyFree(si);
+}
+
+char *dh_get_s_public(char *buf, int maxlen, struct dh_session *si)
+{
+    char *tmp;
+
+    if (!si || !si->dh || !si->dh->pub_key)
+	return NULL;
+
+    tmp = BN_bn2hex(si->dh->pub_key);
+    if (!tmp)
+	return NULL;
+
+    if (strlen(tmp) + 1 > maxlen) {
+	OPENSSL_free(tmp);
+	return NULL;
+    }
+    strcpy(buf, tmp);
+    OPENSSL_free(tmp);
+
+    return buf;
+}
+
+int dh_get_s_shared(char *buf, int *maxlen, struct dh_session *si)
+{
+    if (!si || !si->session_shared || *maxlen < si->session_shared_length)
+	return 0;
+
+    *maxlen = si->session_shared_length;
+    memcpy(buf, si->session_shared, *maxlen);
+
+    return 1;
+}
+
+static char *hex_to_string[256] = {
+    "00", "01", "02", "03", "04", "05", "06", "07",
+    "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
+    "10", "11", "12", "13", "14", "15", "16", "17",
+    "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
+    "20", "21", "22", "23", "24", "25", "26", "27",
+    "28", "29", "2a", "2b", "2c", "2d", "2e", "2f",
+    "30", "31", "32", "33", "34", "35", "36", "37",
+    "38", "39", "3a", "3b", "3c", "3d", "3e", "3f",
+    "40", "41", "42", "43", "44", "45", "46", "47",
+    "48", "49", "4a", "4b", "4c", "4d", "4e", "4f",
+    "50", "51", "52", "53", "54", "55", "56", "57",
+    "58", "59", "5a", "5b", "5c", "5d", "5e", "5f",
+    "60", "61", "62", "63", "64", "65", "66", "67",
+    "68", "69", "6a", "6b", "6c", "6d", "6e", "6f",
+    "70", "71", "72", "73", "74", "75", "76", "77",
+    "78", "79", "7a", "7b", "7c", "7d", "7e", "7f",
+    "80", "81", "82", "83", "84", "85", "86", "87",
+    "88", "89", "8a", "8b", "8c", "8d", "8e", "8f",
+    "90", "91", "92", "93", "94", "95", "96", "97",
+    "98", "99", "9a", "9b", "9c", "9d", "9e", "9f",
+    "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
+    "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af",
+    "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7",
+    "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf",
+    "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7",
+    "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf",
+    "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+    "d8", "d9", "da", "db", "dc", "dd", "de", "df",
+    "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7",
+    "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef",
+    "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+    "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"
+};
+
+static unsigned int dh_gen_1024 = 2;
+static unsigned char dh_prime_1024[] = {
+    0xF4, 0x88, 0xFD, 0x58, 0x4E, 0x49, 0xDB, 0xCD,
+    0x20, 0xB4, 0x9D, 0xE4, 0x91, 0x07, 0x36, 0x6B,
+    0x33, 0x6C, 0x38, 0x0D, 0x45, 0x1D, 0x0F, 0x7C,
+    0x88, 0xB3, 0x1C, 0x7C, 0x5B, 0x2D, 0x8E, 0xF6,
+    0xF3, 0xC9, 0x23, 0xC0, 0x43, 0xF0, 0xA5, 0x5B,
+    0x18, 0x8D, 0x8E, 0xBB, 0x55, 0x8C, 0xB8, 0x5D,
+    0x38, 0xD3, 0x34, 0xFD, 0x7C, 0x17, 0x57, 0x43,
+    0xA3, 0x1D, 0x18, 0x6C, 0xDE, 0x33, 0x21, 0x2C,
+    0xB5, 0x2A, 0xFF, 0x3C, 0xE1, 0xB1, 0x29, 0x40,
+    0x18, 0x11, 0x8D, 0x7C, 0x84, 0xA7, 0x0A, 0x72,
+    0xD6, 0x86, 0xC4, 0x03, 0x19, 0xC8, 0x07, 0x29,
+    0x7A, 0xCA, 0x95, 0x0C, 0xD9, 0x96, 0x9F, 0xAB,
+    0xD0, 0x0A, 0x50, 0x9B, 0x02, 0x46, 0xD3, 0x08,
+    0x3D, 0x66, 0xA4, 0x5D, 0x41, 0x9F, 0x9C, 0x7C,
+    0xBD, 0x89, 0x4B, 0x22, 0x19, 0x26, 0xBA, 0xAB,
+    0xA2, 0x5E, 0xC3, 0x55, 0xE9, 0x2F, 0x78, 0xC7
+};
+
+#endif
diff -uNrd ircd-ratbox-1.3-1/src/ircd.c ircd-ratbox-1.3-1+fr-ssl/src/ircd.c
--- ircd-ratbox-1.3-1/src/ircd.c	Fri Nov 28 08:36:49 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/ircd.c	Sat Jan 24 13:27:44 2004
@@ -75,7 +75,7 @@
 #include "newconf.h"
 #include "patricia.h"
 #include "reject.h"
-
+#include "db.h"
 
 /*
  * Try and find the correct name to use with getrlimit() for setting the max.
@@ -582,6 +582,22 @@
 		fprintf(stderr, "Unable to chdir to %s: %s\n", ConfigFileEntry.dpath, strerror(errno));
 		exit(EXIT_FAILURE);
 	}
+
+#ifdef HAVE_LIBCRYPTO
+  dh_init();
+  fprintf(stderr, "SSL: Initialize\n");
+
+  SSL_load_error_strings();
+  SSLeay_add_ssl_algorithms();
+  ServerInfo.ctx = SSL_CTX_new(SSLv23_server_method());
+
+  if (!ServerInfo.ctx) {
+       ERR_print_errors_fp(stderr);
+       return 0;
+  }
+
+  fprintf(stderr, "SSL: Client based SSL connections are enabled.\n");
+#endif
 
 	setup_signals();
 
diff -uNrd ircd-ratbox-1.3-1/src/linebuf.c ircd-ratbox-1.3-1+fr-ssl/src/linebuf.c
--- ircd-ratbox-1.3-1/src/linebuf.c	Fri Jan  9 12:58:49 2004
+++ ircd-ratbox-1.3-1+fr-ssl/src/linebuf.c	Sat Jan 24 20:22:29 2004
@@ -618,7 +618,7 @@
  */
 #undef HAVE_WRITEV
 int
-linebuf_flush(int fd, buf_head_t * bufhead)
+linebuf_flush(struct Client *client_p, int fd, buf_head_t * bufhead)
 {
 	buf_line_t *bufline;
 	int retval;
@@ -721,7 +721,14 @@
 	}
 
 	/* Now, try writing data */
+#ifdef HAVE_LIBCRYPTO
+	if (IsSSL(client_p))
+		retval = safe_SSL_write(client_p, bufline->buf + bufhead->writeofs, bufline->len - bufhead->writeofs);
+	else
+		retval = send(fd, bufline->buf + bufhead->writeofs, bufline->len - bufhead->writeofs, 0);
+#else
 	retval = send(fd, bufline->buf + bufhead->writeofs, bufline->len - bufhead->writeofs, 0);
+#endif
 
 	if(retval <= 0)
 		return retval;
diff -uNrd ircd-ratbox-1.3-1/src/listener.c ircd-ratbox-1.3-1+fr-ssl/src/listener.c
--- ircd-ratbox-1.3-1/src/listener.c	Thu Jun 26 07:03:16 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/listener.c	Sat Jan 24 17:02:35 2004
@@ -131,8 +131,7 @@
 		sendto_one(source_p, form_str(RPL_STATSPLINE),
 			   me.name,
 			   source_p->name,
-			   'P',
-			   listener->port,
+			   listener->is_ssl ? 'S' : 'P', listener->port,
 			   IsOperAdmin(source_p) ? listener->name : me.name,
 			   listener->ref_count, (listener->active) ? "active" : "disabled");
 	}
@@ -268,7 +267,7 @@
  * the format "255.255.255.255"
  */
 void
-add_listener(int port, const char *vhost_ip)
+add_listener(int port, const char *vhost_ip, int is_ssl)
 {
 	struct Listener *listener;
 	struct irc_inaddr vaddr;
@@ -299,6 +298,7 @@
 	else
 	{
 		listener = make_listener(port, &vaddr);
+        listener->is_ssl = is_ssl;
 		listener->next = ListenerPollList;
 		ListenerPollList = listener;
 	}
diff -uNrd ircd-ratbox-1.3-1/src/messages.tab ircd-ratbox-1.3-1+fr-ssl/src/messages.tab
--- ircd-ratbox-1.3-1/src/messages.tab	Thu Nov 20 12:44:39 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/messages.tab	Sat Jan 24 19:50:45 2004
@@ -299,7 +299,7 @@
 /* 272 */       NULL,
 /* 273 */       NULL,
 /* 274 */       NULL,
-/* 275 */       NULL,
+/* 275 RPL_USINGSSL, */			":%s 275 %s %s :connected via SSL (secure link)",
 /* 276 */       NULL,
 /* 277 */       NULL,
 /* 278 */       NULL,
diff -uNrd ircd-ratbox-1.3-1/src/newconf.c ircd-ratbox-1.3-1+fr-ssl/src/newconf.c
--- ircd-ratbox-1.3-1/src/newconf.c	Fri Dec 19 10:33:03 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/newconf.c	Sat Jan 24 18:58:44 2004
@@ -401,6 +401,72 @@
 }
 
 static void
+conf_set_serverinfo_ssl_cert (void *data)
+{
+#ifdef HAVE_LIBCRYPTO
+	if (ServerInfo.ctx)
+	{
+		if (ServerInfo.ssl_certificate_file)
+		{
+			MyFree (ServerInfo.ssl_certificate_file);
+			ServerInfo.ssl_certificate_file = NULL;
+		}
+
+		DupString (ServerInfo.ssl_certificate_file, (char *)data);
+
+		if (!ServerInfo.rsa_private_key_file)
+		{
+			conf_report_error ("Ignoring config file entry ssl_certificate -- no rsa_private_key");
+			return;
+		}
+
+		if (SSL_CTX_use_certificate_file(ServerInfo.ctx, ServerInfo.ssl_certificate_file, SSL_FILETYPE_PEM) <= 0)
+		{
+			conf_report_error ("Error using config file entry ssl_certificate -- %s", ERR_error_string(ERR_get_error(), NULL));
+			return;
+		}
+
+		if (SSL_CTX_use_PrivateKey_file(ServerInfo.ctx, ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0)
+		{
+			conf_report_error ("Error using config file entry rsa_private_key -- %s", ERR_error_string(ERR_get_error(), NULL));
+			return;
+		}
+
+		if (!SSL_CTX_check_private_key(ServerInfo.ctx))
+		{
+			conf_report_error ("RSA private key doesn't match the SSL certificate public key!");
+			return;
+		}
+	}
+
+#endif
+
+}
+
+static void
+conf_set_serverinfo_ssl_ca_cert (void *data)
+{
+#ifdef HAVE_LIBCRYPTO
+	if (ServerInfo.ctx)
+	{
+		if (ServerInfo.ssl_ca_certificate_file)
+		{
+			MyFree (ServerInfo.ssl_ca_certificate_file);
+			ServerInfo.ssl_ca_certificate_file = NULL;
+		}
+
+		DupString (ServerInfo.ssl_ca_certificate_file, (char *)data);
+
+		if (ServerInfo.ssl_ca_certificate_file != NULL && SSL_CTX_load_verify_locations(ServerInfo.ctx, ServerInfo.ssl_ca_certificate_file, NULL) != 1)
+		{
+			conf_report_error ("Error using config file entry ssl_ca_certificate -- ");
+			return;
+		}
+	}
+#endif
+}
+
+static void
 conf_set_modules_module(void *data)
 {
 #ifndef STATIC_MODULES
@@ -1052,7 +1118,24 @@
 			continue;
 		}
 
-		add_listener(args->v.number, listener_address);
+		add_listener(args->v.number, listener_address, 0);
+	}
+}
+
+static void
+conf_set_listen_sslport(void *data)
+{
+	conf_parm_t *args = data;
+
+	for (; args; args = args->next)
+	{
+		if((args->type & CF_MTYPE) != CF_INT)
+		{
+			conf_report_error("listener::port argument is not an integer -- ignoring.");
+			continue;
+		}
+
+		add_listener(args->v.number, listener_address, 1);
 	}
 }
 
@@ -2944,6 +3027,8 @@
 	add_conf_item("serverinfo", "vhost", CF_QSTRING, conf_set_serverinfo_vhost);
 	add_conf_item("serverinfo", "vhost6", CF_QSTRING, conf_set_serverinfo_vhost6);
 	add_conf_item("serverinfo", "hub", CF_YESNO, conf_set_serverinfo_hub);
+	add_conf_item("serverinfo", "ssl_certificate_file", CF_QSTRING, conf_set_serverinfo_ssl_cert);
+	add_conf_item("serverinfo", "ssl_ca_certificate_file", CF_QSTRING, conf_set_serverinfo_ssl_ca_cert);
 
 	add_top_conf("admin", NULL, NULL);
 	add_conf_item("admin", "name", CF_QSTRING, conf_set_admin_name);
@@ -3002,6 +3087,7 @@
         
 	add_top_conf("listen", conf_begin_listen, conf_end_listen);
 	add_conf_item("listen", "port", CF_INT | CF_FLIST, conf_set_listen_port);
+	add_conf_item("listen", "sslport", CF_INT | CF_FLIST, conf_set_listen_sslport);
 	add_conf_item("listen", "ip", CF_QSTRING, conf_set_listen_address);
 	add_conf_item("listen", "host", CF_QSTRING, conf_set_listen_address);
 
diff -uNrd ircd-ratbox-1.3-1/src/packet.c ircd-ratbox-1.3-1+fr-ssl/src/packet.c
--- ircd-ratbox-1.3-1/src/packet.c	Thu Jun 26 07:03:17 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/packet.c	Sat Jan 24 19:31:55 2004
@@ -38,6 +38,7 @@
 #include "memory.h"
 #include "hook.h"
 #include "send.h"
+#include "db.h"
 
 static char readBuf[READBUF_SIZE];
 static void client_dopacket(struct Client *client_p, char *buffer, size_t length);
@@ -375,6 +376,11 @@
 	 * I personally think it makes the code too hairy to make sane.
 	 *     -- adrian
 	 */
+#ifdef HAVE_LIBCRYPTO
+  if (IsSSL(client_p))
+    length = safe_SSL_read(client_p, readBuf, READBUF_SIZE);
+  else
+#endif
 	length = recv(fd_r, readBuf, READBUF_SIZE, 0);
 
 	if(length <= 0)
diff -uNrd ircd-ratbox-1.3-1/src/s_auth.c ircd-ratbox-1.3-1+fr-ssl/src/s_auth.c
--- ircd-ratbox-1.3-1/src/s_auth.c	Tue Sep  2 15:58:01 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/s_auth.c	Sat Jan 24 13:02:25 2004
@@ -54,6 +54,7 @@
 #include "send.h"
 #include "memory.h"
 #include "config.h"
+#include "db.h"
 
 /*
  * a bit different approach
@@ -93,8 +94,18 @@
 }
 ReportType;
 
+#ifdef HAVE_LIBCRYPTO
 #define sendheader(c, r) \
-   send((c)->localClient->fd, HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0)
+   if (IsSSL(c)) \
+     safe_SSL_write(c, HeaderMessages[(r)].message, HeaderMessages[(r)].length); \
+   else \
+     send((c)->localClient->fd, HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0)
+#else
+#define sendheader(c, r) \
+    send((c)->localClient->fd, HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0)
+#endif
+//#define sendheader(c, r) \
+//   send((c)->localClient->fd, HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0)
 
 static dlink_list auth_poll_list;
 static BlockHeap *auth_heap;
diff -uNrd ircd-ratbox-1.3-1/src/s_bsd.c ircd-ratbox-1.3-1+fr-ssl/src/s_bsd.c
--- ircd-ratbox-1.3-1/src/s_bsd.c	Wed Oct 15 09:34:04 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/s_bsd.c	Sat Jan 24 17:15:40 2004
@@ -50,6 +50,7 @@
 #include "s_debug.h"
 #include "memory.h"
 #include "reject.h"
+#include "db.h"
 
 #ifndef IN_LOOPBACKNET
 #define IN_LOOPBACKNET        0x7f
@@ -72,6 +73,7 @@
 static PF comm_connect_timeout;
 static void comm_connect_dns_callback(void *vptr, adns_answer * reply);
 static PF comm_connect_tryconnect;
+static void comm_tryssl_callback(int fd, void *data);
 
 /* close_all_connections() can be used *before* the system come up! */
 
@@ -359,6 +361,9 @@
 
 	socklen_t len = sizeof(struct irc_sockaddr);
 	struct irc_sockaddr irn;
+#ifdef HAVE_LIBCRYPTO
+  int new_ssl = 0;
+#endif 
 	s_assert(NULL != listener);
 
 	/* 
@@ -415,13 +420,60 @@
 	new_client->localClient->listener = listener;
 	++listener->ref_count;
 
+#ifdef HAVE_LIBCRYPTO
+  if ((listener->is_ssl) && !(new_client->ssl))
+  {
+    new_ssl = 1;
+
+    /*SSL client init */
+    if((new_client->ssl = SSL_new(ServerInfo.ctx)) == NULL)
+    {
+      dlink_node * m;
+      m = dlinkFind(&unknown_list, new_client);
+      if (m)
+        dlinkDeleteNode(m, &unknown_list);
+      report_error(L_ALL, "Could not create new ssl connection %s :%s",
+          get_listener_name(listener), errno);
+	  sendto_realops_flags (UMODE_DEBUG, L_ALL, "Could not create new ssl connection %s :%s", get_listener_name(listener), errno);
+      ServerStats->is_ref++;
+      free_client(new_client);
+      return;
+    }
+    SetSSL(new_client);
+	sendto_realops_flags (UMODE_DEBUG, L_ALL, "Created new ssl connection %s", get_listener_name(listener));
+  }
+#endif
+
 	if(!set_non_blocking(new_client->localClient->fd))
 		report_error(L_ALL, NONB_ERROR_MSG, get_client_name(new_client, SHOW_IP), errno);
 	if(!disable_sock_options(new_client->localClient->fd))
 		report_error(L_ALL, OPT_ERROR_MSG, get_client_name(new_client, SHOW_IP), errno);
 	if(check_reject(new_client))
 		return;
-	start_auth(new_client);
+	//start_auth(new_client);
+
+#ifdef HAVE_LIBCRYPTO
+  if (IsSSL(new_client) && new_ssl)
+  {
+	sendto_realops_flags (UMODE_DEBUG, L_ALL, "Accepting SSL connection %s", get_listener_name(listener));
+    SSL_set_fd(new_client->ssl, new_client->localClient->fd);
+    if (!safe_SSL_accept(new_client, new_client->localClient->fd))
+    {
+	  dlink_node * m;
+      sendto_realops_flags (UMODE_DEBUG, L_ALL, "Unsafe acception on %s", get_listener_name(listener));
+      m = dlinkFind(&unknown_list, new_client);
+      if (m)
+        dlinkDeleteNode(m, &unknown_list);
+      SSL_set_shutdown(new_client->ssl, SSL_RECEIVED_SHUTDOWN);
+      SSL_smart_shutdown(new_client->ssl);
+      SSL_free(new_client->ssl);
+      ServerStats->is_ref++;
+      free_client(new_client);
+      return;
+    }
+  }
+#endif
+  comm_setselect(fd, FDLIST_SERVER, COMM_SELECT_WRITE, comm_tryssl_callback, new_client, 0);
 }
 
 
@@ -896,4 +948,42 @@
 
 	/* .. and return */
 	return newfd;
+}
+
+static void
+comm_tryssl_callback(int fd, void *data)
+{
+  int doauth = -1;
+  struct Client *new_client = data;
+
+  fdlist_t fdlist = FDLIST_NONE;
+
+  fdlist = FDLIST_SERVER;
+  doauth = 1;
+
+#ifdef HAVE_LIBCRYPTO
+  if (IsSSL(new_client))
+  {
+    if (!SSL_is_init_finished(new_client->ssl))
+    {
+      if (!safe_SSL_accept(new_client, new_client->localClient->fd))
+      {
+        //dead_link_on_read(new_client, errno);
+		sendto_realops_flags (UMODE_DEBUG, L_ALL, "Unsafe acception.");
+        return;
+      }
+      else
+      {
+        comm_setselect(fd, fdlist, COMM_SELECT_WRITE, comm_tryssl_callback, new_client, 0);
+        return;
+      }
+    }
+  }
+#endif
+
+  if (doauth == 1)
+  {
+    sendto_realops_flags (UMODE_DEBUG, L_ALL, "Starting Auth"); 
+    start_auth(new_client);
+  }
 }
diff -uNrd ircd-ratbox-1.3-1/src/send.c ircd-ratbox-1.3-1+fr-ssl/src/send.c
--- ircd-ratbox-1.3-1/src/send.c	Mon Dec  1 14:00:10 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/send.c	Sat Jan 24 20:18:44 2004
@@ -45,6 +45,7 @@
 #include "s_log.h"
 #include "memory.h"
 #include "hook.h"
+#include "db.h"
 
 #define LOG_BUFSIZE 2048
 
@@ -264,7 +265,7 @@
 	if(linebuf_len(&to->localClient->buf_sendq))
 	{
 		while ((retlen =
-			linebuf_flush(to->localClient->fd, &to->localClient->buf_sendq)) > 0)
+			linebuf_flush(to, to->localClient->fd, &to->localClient->buf_sendq)) > 0)
 		{
 			/* We have some data written .. update counters */
 #ifndef NDEBUG
@@ -323,6 +324,7 @@
 	/* Next, lets try to write some data */
 	if(to->localClient->slinkq)
 	{
+
 		retlen = send(to->localClient->ctrlfd,
 			      to->localClient->slinkq + to->localClient->slinkq_ofs,
 			      to->localClient->slinkq_len, 0);
diff -uNrd ircd-ratbox-1.3-1/src/ssl.c ircd-ratbox-1.3-1+fr-ssl/src/ssl.c
--- ircd-ratbox-1.3-1/src/ssl.c	Wed Dec 31 17:00:00 1969
+++ ircd-ratbox-1.3-1+fr-ssl/src/ssl.c	Sat Jan 24 13:57:08 2004
@@ -0,0 +1,185 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  ssl.c: Client ssl connections.
+ *
+ *  Copyright (C) 2003 by the past and present ircd coders, and others.
+ *
+ *  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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ * $Id: ssl.c,v 1.0 2003/12/03 21:22:43 Sakura Exp $
+ *
+ */
+
+#include "stdinc.h"
+#include "common.h"
+#include "s_conf.h"
+#include "db.h"
+#include "send.h"
+#include "s_bsd.h"
+
+#define SAFE_SSL_READ  1
+#define SAFE_SSL_WRITE  2
+#define SAFE_SSL_ACCEPT  3
+
+#ifdef HAVE_LIBCRYPTO
+
+static int fatal_ssl_error(int, int, struct Client *);
+
+int safe_SSL_read(struct Client *acptr, void *buf, int sz)
+{
+  int len, ssl_err;
+
+  len = SSL_read(acptr->ssl, buf, sz);
+
+  if (len <= 0) {
+    switch (ssl_err = SSL_get_error(acptr->ssl, len)) {
+      case SSL_ERROR_SYSCALL:
+        if (errno == EWOULDBLOCK || errno == EAGAIN || errno == EINTR) {
+      case SSL_ERROR_WANT_READ:
+        errno = EWOULDBLOCK;
+          return -1;
+        }
+      case SSL_ERROR_SSL:
+        if (errno == EAGAIN)
+          return -1;
+      default:
+        return fatal_ssl_error(ssl_err, SAFE_SSL_READ, acptr);
+    }
+  }
+  return len;
+}
+
+int safe_SSL_write(struct Client *acptr, const void *buf, int sz)
+{
+  int len, ssl_err;
+
+  len = SSL_write(acptr->ssl, buf, sz);
+  if (len <= 0) {
+    switch (ssl_err = SSL_get_error(acptr->ssl, len)) {
+      case SSL_ERROR_SYSCALL:
+        if (errno == EWOULDBLOCK || errno == EAGAIN || errno == EINTR) {
+      case SSL_ERROR_WANT_WRITE:
+        errno = EWOULDBLOCK;
+          return 0;
+        }
+      case SSL_ERROR_SSL:
+        if (errno == EAGAIN)
+          return 0;
+      default:
+        return fatal_ssl_error(ssl_err, SAFE_SSL_WRITE, acptr);
+    }
+  }
+  return len;
+}
+
+int safe_SSL_accept(struct Client *acptr, int fd)
+{
+
+  int ssl_err;
+
+  if ((ssl_err = SSL_accept(acptr->ssl)) <= 0) {
+    switch (ssl_err = SSL_get_error(acptr->ssl, ssl_err)) {
+      case SSL_ERROR_SYSCALL:
+        if (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN)
+      case SSL_ERROR_WANT_READ:
+      case SSL_ERROR_WANT_WRITE:
+        /* handshake will be completed later . . */
+        return 1;
+      default:
+        return fatal_ssl_error(ssl_err, SAFE_SSL_ACCEPT, acptr);
+    }
+  /* NOTREACHED */
+  return 0;
+  }
+  return 1;
+}
+
+int SSL_smart_shutdown(SSL * ssl)
+{
+  int i;
+  int rc;
+
+  rc = 0;
+  for (i = 0; i < 4; i++) {
+    if ((rc = SSL_shutdown(ssl)))
+      break;
+  }
+
+  return rc;
+}
+
+static int fatal_ssl_error(int ssl_error, int where, struct Client *sptr)
+{
+  /* don't alter errno */
+  int errtmp = errno;
+  char *errstr = strerror(errtmp);
+  char *ssl_errstr, *ssl_func;
+
+  switch (where) {
+    case SAFE_SSL_READ:
+      ssl_func = "SSL_read()";
+      break;
+    case SAFE_SSL_WRITE:
+      ssl_func = "SSL_write()";
+      break;
+    case SAFE_SSL_ACCEPT:
+      ssl_func = "SSL_accept()";
+      break;
+    default:
+      ssl_func = "undefined SSL func [this is a bug]";
+  }
+
+  switch (ssl_error) {
+    case SSL_ERROR_NONE:
+      ssl_errstr = "No error";
+      break;
+    case SSL_ERROR_SSL:
+      ssl_errstr = "Internal OpenSSL error or protocol error";
+      break;
+    case SSL_ERROR_WANT_READ:
+      ssl_errstr = "OpenSSL functions requested a read()";
+      break;
+    case SSL_ERROR_WANT_WRITE:
+      ssl_errstr = "OpenSSL functions requested a write()";
+      break;
+    case SSL_ERROR_WANT_X509_LOOKUP:
+      ssl_errstr = "OpenSSL requested a X509 lookup which didn`t arrive";
+      break;
+    case SSL_ERROR_SYSCALL:
+      ssl_errstr = "Underlying syscall error";
+      break;
+    case SSL_ERROR_ZERO_RETURN:
+      ssl_errstr = "Underlying socket operation returned zero";
+      break;
+    case SSL_ERROR_WANT_CONNECT:
+      ssl_errstr = "OpenSSL functions wanted a connect()";
+      break;
+    default:
+      ssl_errstr = "Unknown OpenSSL error (huh?)";
+  }
+
+  /*
+  report_error(L_ADMIN, "%s to %s aborted with%serror (%s). [%s]",
+               ssl_func, get_client_name(sptr, SHOW_IP), (errno > 0) ? " " : " no ", errstr, ssl_errstr);
+  report_error(L_OPER, "%s to %s aborted with%serror (%s). [%s]",
+               ssl_func, get_client_name(sptr, MASK_IP), (errno > 0) ? " " : " no ", errstr, ssl_errstr);
+  */
+
+  errno = errtmp ? errtmp : EIO;  /* Stick a generic I/O error */
+  sptr->flags |= FLAGS_DEADSOCKET;
+  return 0;
+}
+#endif
diff -uNrd ircd-ratbox-1.3-1/src/tools.c ircd-ratbox-1.3-1+fr-ssl/src/tools.c
--- ircd-ratbox-1.3-1/src/tools.c	Wed Sep  3 09:46:29 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/tools.c	Sat Jan 24 14:07:23 2004
@@ -256,6 +256,11 @@
 	newlist->length++;
 }
 
+void dlinkDeleteNode(dlink_node *m, dlink_list *list)
+{
+    dlinkDelete(m, list);
+    free_dlink_node(m);
+}
 
 /*
  * init_dlink_nodes
diff -uNrd ircd-ratbox-1.3-1/src/version.c.SH ircd-ratbox-1.3-1+fr-ssl/src/version.c.SH
--- ircd-ratbox-1.3-1/src/version.c.SH	Sun Jul  6 08:01:03 2003
+++ ircd-ratbox-1.3-1+fr-ssl/src/version.c.SH	Sat Jan 24 12:34:36 2004
@@ -65,6 +65,7 @@
   "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
   "Copyright (c) 1996-2001 Hybrid Development Team", 
   "Copyright (c) 2002-2003 ircd-ratbox Development Team",
+  "Copyright (c) 2004 FreeWorld Development Team",
   "",
   "This program is free software; you can redistribute it and/or",
   "modify it under the terms of the GNU General Public License as",
diff -uNrd ircd-ratbox-1.3-1/tools/public.key ircd-ratbox-1.3-1+fr-ssl/tools/public.key
--- ircd-ratbox-1.3-1/tools/public.key	Wed Dec 31 17:00:00 1969
+++ ircd-ratbox-1.3-1+fr-ssl/tools/public.key	Sat Jan 24 16:24:43 2004
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1hNLQE+//uCVtqYAZJ5X
+C+jdgyCa9NHYI9Mus9RixEPsgoTOmEUWMCoOGoSEF2UPtL07iKvGsV39394vrw7G
+b+msHVmLLqJcRbeXNpxnwjoS0oOkkvv/NcpptKre5rLYeO1+WiwHxjbl/Blc315b
+UCJjaLvEHS56YtmZ0sW3emaHIGWvpr+mhUwB6aiKgWMunG9ZkHN9wcmx2R5UX3HR
+kGkfEwgCmXOQnZC9PG/2TdjEhmLHD0nHR+sy5yjvLEvRTC4AFzzB59wLWup/PJfH
+M2YIi3KYRbGT4dFFOQ/Ro40pDHeS3AThaikRnkwgX/zAd1op2bSG8W9xeOQiwjZg
+xQIDAQAB
+-----END PUBLIC KEY-----
