$NetBSD: patch-ak,v 1.1 2002/10/21 13:27:25 wiz Exp $

--- configure.orig	Wed Nov 25 12:21:07 1998
+++ configure
@@ -19,7 +19,7 @@ ac_help="$ac_help
   --with-libwww=DIR       Specify path to W3C Reference Library distribution."
 ac_help="$ac_help
   --with-libwww-libdir=DIR
-                          Specify directory where the libwww.a resides."
+                          Specify directory where the libwww modules reside."
 ac_help="$ac_help
   --with-libwww-include=DIR
                           Specify the libwww header files location."
@@ -740,6 +745,40 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # 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:755: 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
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
@@ -2560,7 +2654,7 @@ if test "${with_libwww_libdir+set}" = se
    then
     if test "${with_libwww_libdir}" = "no" ;
      then
-      echo "configure: warning: Without libwww.a library? =O" 1>&2
+      echo "configure: warning: Without libwww modules? =O" 1>&2
      else
       libwww_library_dir="${with_libwww_libdir}"
       if test -d ${libwww_library_dir} ;
@@ -2622,7 +2716,7 @@ if test "${with_libwww_config_h_dir+set}
 fi
 
 
-libwww="libwww"
+libwww="libwwwinit"
 
 #
 if test "${libwww_include+set}" = "set" && \
@@ -2742,7 +2836,7 @@ if test "${libwww_standard}" = "no" ;
     fi
   fi
   #
-  libwww_dep="$libwww"
+  libwww_dep="$libwwwinit"
   #
   # Aren't all the necessary symbols already defined?
   #
@@ -2800,7 +2894,7 @@ echo "configure:2766: checking for W3C R
     #
     for ac_dir in $LibWWWPATH ;
      do
-      if test -f ${ac_dir}/libwww.a && \
+      if test -f ${ac_dir}/libwwwinit.a && \
          test -f ${ac_dir}/include/WWWLib.h && \
          test -f ${ac_dir}/config.h ;
        then
@@ -2835,7 +2929,7 @@ echo "configure:2766: checking for W3C R
          test -f ${ac_dir}/config.h.in ;
        then
         ac_dir_f="`cd $ac_dir ; $BINPWD`"
-        libwww_dep="libwww"
+        libwww_dep="libwwwinit"
         : ${libwww_dir:="$ac_dir_f"}
         libwww_version="5"
         libwww_distribution="source"
@@ -2994,7 +3088,7 @@ else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ARENA_cv_VERSION_LibWWW_version_is_501=yes
+  ARENA_cv_VERSION_LibWWW_version_is_501=no
 fi
 rm -f conftest*
   echo "$ac_t""$ARENA_cv_VERSION_LibWWW_version_is_501" 1>&6
@@ -4736,7 +4830,65 @@ fi
 for ac_func in snprintf vsnprintf strerror strncpy strndup strdup strstr
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4740: checking for $ac_func" >&5
+echo "configure:4834: 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 4839 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4862: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+if test "${ac_cv_header_sys_time_h}" = "yes" ;
+ then
+  for ac_func in setitimer
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:4892: 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
@@ -4788,7 +4940,14 @@ else
 fi
 done
 
+  if test "${ac_cv_func_setitimer}" = "yes" ;
+   then
+    cat >> confdefs.h <<\EOF
+#define SETITIMER_USES_TIMEVAL 1
+EOF
 
+  fi
+fi
 
 #
 # Check if we want to use index or strchr
