Blob Blame History Raw
diff -urN squidGuard-1.2.0/NewFeatures.txt squidGuard-1.2.0-patched/NewFeatures.txt
--- squidGuard-1.2.0/NewFeatures.txt	1969-12-31 19:00:00.000000000 -0500
+++ squidGuard-1.2.0-patched/NewFeatures.txt	2004-12-02 15:57:32.000000000 -0500
@@ -0,0 +1,133 @@
+
+This patch adds the following new features to squidguard-1.2.0:
+
+LDAP User Grouping Support:
+---------------------------
+
+Squidguard now searches LDAP using specified LDAP search URLs whenever
+a username is not found in an existing user list.  The two new keywords
+in the squidguard.conf file that enable this are as follows:
+
+    ldapusersearch	This keyword goes in the Source {} config block, and
+			specifies an LDAP URL to use to search for an unknown
+			user name.
+
+			You can specify multple LDAP URLs per Source block.
+
+			Use '%s' to reference the username in your LDAP URL.
+
+			If the search returns a record, the user is considered
+			"found", otherwise the next URL in the same Source
+			block is tried.
+
+			Squidguard caches the "found" state of each search,
+			even when a user name is not found.  The cache
+			is valid for ldapcachetime seconds.
+
+    ldapcachetime	This global keyword specifies the number of seconds
+    			to cache LDAP search results before contacting
+			the LDAP server again.  This keyword is global and
+			must go outside any Source/Destination/Rule blocks.
+
+			Setting this value to a reasonably low value can
+			allow simulation of near-realtime user groupings
+			in LDAP without restarting squidguard.
+
+			Recommended value: 300
+
+
+    ldapbinddn		This global keyword specifies the DN to bind to
+			the LDAP server as.
+
+    ldapbindpass	Password to bind to the LDAP server.  This is a
+			global keyword.
+
+    ldapprotover	LDAP protocol version.  This is a global keyword.
+			Use this to force squidguard to connect to the
+			LDAP server with a certain protocol version.  If
+			unable to use the specified protocol version,
+			squidguard will enter emergency mode.
+
+			Valid values: 2 or 3
+
+Programmatic User Lists:
+------------------------
+
+Instead of putting a list of users in a file, you can now run a program
+or script to list users on stdout.  This user list behaves exactly like
+a regular userlist, loaded at start time, and stored in memory statically.
+
+    execuserlist	This keyword goes in the Source {} block, and
+    			specifies a command to run that will write a list
+			of usernames on stdout.
+
+
+Supported LDAP URL extensions:
+------------------------------
+
+According to the available LDAP RFC's, there is only one defined extension,
+called "bindname".  This extension can be used to define a DN to bind with,
+on a per-URL basis.
+
+The format of such an URL is rather hideous, since commas are used to
+separate both the extensions in the URL and the elements of the DN.
+To handle this, commas separating the URL extensions are real commas, while
+the commas in the DN are defined with hex codes.  (Hex %2c is a comma)
+
+Example:
+
+    ldap://ldap.example.com/ou=groups,dc=example,dc=com\
+        ?homeDirectory?sub?(uid=cdfrey)\
+        ?bindname=cn=cdfrey%2cdc=example%2cdc=com,x-bindpass=password
+
+The above example shows multiple extensions specified in one URL.
+
+As it happens, both of those extensions are supported in the LDAP patch,
+and have the following meanings:
+
+    bindname		As specified in RFC2255, this extension defines
+			the DN name to use during the bind to the LDAP
+			server.
+
+    x-bindpass		As specified in RFC2255, extensions starting with
+			"x-" are user defined.  This extension allows the
+			URL to define the password required to bind to
+			the LDAP server.
+
+Both of these extensions override the global defaults "ldapbinddn" and
+"ldapbindpass" (see above).
+
+
+
+
+Example Configuration:
+----------------------
+
+Below is an example squidguard.conf file, showing the various user list
+options:
+
+-------------------  Example squidguard.conf snippet  ------------------------
+
+dbhome /var/lib/squidguard
+logdir /var/log/squidguard
+
+# ldap cache time in seconds
+ldapcachetime	300
+
+ldapbinddn	cn=root, dc=example, dc=com
+ldapbindpass	secret
+
+src INTERNAL_LAN {
+	ip		192.168.0.0/24 127.0.0.1
+	within		workhours
+	user		dave,chris,john, marconi
+
+	# uses the default binddn and bindpass above
+	ldapusersearch	ldap://ldap.example.com/cn=squidguardusers,ou=groups,dc=example,dc=com?memberUid?sub?(&(objectclass=posixGroup)(memberUid=%s))
+
+	execuserlist	sed "s/:.*$//" /etc/passwd
+	log		internal_lan
+}
+
+------------------------------  End snippet  ---------------------------------
+
diff -urN squidGuard-1.2.0/configure squidGuard-1.2.0-patched/configure
--- squidGuard-1.2.0/configure	2001-12-18 05:16:53.000000000 -0500
+++ squidGuard-1.2.0-patched/configure	2004-12-02 15:57:25.000000000 -0500
@@ -1,12 +1,81 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.
+# Generated by GNU Autoconf 2.59.
 #
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
 
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -14,22 +83,113 @@
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
 
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
 
-# Name of the executable.
-as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
 
 if expr a : '\(a\)' >/dev/null 2>&1; then
   as_expr=expr
@@ -55,24 +215,21 @@
 fi
 rm -f conf$$ conf$$.exe conf$$.file
 
-as_executable_p="test -f"
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
 else
-  as_unset=false
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
 fi
 
-# NLS nuisances.
-$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
-$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
-$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
-$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
-$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
-$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
-$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
-$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
 
 # IFS
 # We need space, tab and new line, in precisely that order.
@@ -81,7 +238,8 @@
 IFS=" 	$as_nl"
 
 # CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+$as_unset CDPATH
+
 
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -94,9 +252,11 @@
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
 cross_compiling=no
 subdirs=
-MFLAGS= MAKEFLAGS=
+MFLAGS=
+MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Maximum number of lines to put in a shell here document.
@@ -104,6 +264,13 @@
 # only ac_max_sed_lines should be used.
 : ${ac_max_here_lines=38}
 
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
 ac_unique_file="src/main.c"
 # Factoring default headers for most tests.
 ac_includes_default="\
@@ -142,6 +309,9 @@
 # include <unistd.h>
 #endif"
 
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA YACC LEX LEXLIB LEX_OUTPUT_ROOT LYNX PERL EGREP ac_n ac_c sg_config sg_cfgdir sg_logdir sg_dbhome VERSION TESTDIR FTPDIR CGIFILE SQUIDGUARDROBOT SQUIDGUARDROBOTUA ROBOTEXCEPTIONS BLACKLISTS LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
@@ -180,13 +350,6 @@
 infodir='${prefix}/info'
 mandir='${prefix}/man'
 
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
 ac_prev=
 for ac_option
 do
@@ -319,7 +482,7 @@
     with_fp=no ;;
 
   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c)
+  | --no-cr | --no-c | -n)
     no_create=yes ;;
 
   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -498,30 +661,31 @@
   eval ac_val=$`echo $ac_var`
   case $ac_val in
     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
    { (exit 1); exit 1; }; };;
   esac
 done
 
 # Be sure to have absolute paths.
 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
+	      localstatedir libdir includedir oldincludedir infodir mandir
 do
   eval ac_val=$`echo $ac_var`
   case $ac_val in
     [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
    { (exit 1); exit 1; }; };;
   esac
 done
 
 # There might be people who depend on the old broken behavior: `$host'
 # used to hold the argument of --host etc.
+# FIXME: To remove some day.
 build=$build_alias
 host=$host_alias
 target=$target_alias
 
-# FIXME: should be removed in autoconf 3.0.
+# FIXME: To remove some day.
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
@@ -537,13 +701,23 @@
 
 test "$silent" = yes && exec 6>/dev/null
 
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then its parent.
-  ac_prog=$0
-  ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
-  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
@@ -553,13 +727,16 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
    { (exit 1); exit 1; }; }
   else
-    { echo "$as_me: error: cannot find sources in $srcdir" >&2
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
   fi
 fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
 ac_env_build_alias_set=${build_alias+set}
 ac_env_build_alias_value=$build_alias
@@ -600,7 +777,7 @@
 if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<EOF
+  cat <<_ACEOF
 \`configure' configures this package to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -621,14 +798,14 @@
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-EOF
+_ACEOF
 
-  cat <<EOF
+  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
+			  [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
+			  [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -650,15 +827,15 @@
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
   --infodir=DIR          info documentation [PREFIX/info]
   --mandir=DIR           man documentation [PREFIX/man]
-EOF
+_ACEOF
 
-  cat <<\EOF
-EOF
+  cat <<\_ACEOF
+_ACEOF
 fi
 
 if test -n "$ac_init_help"; then
 
-  cat <<\EOF
+  cat <<\_ACEOF
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -682,40 +859,93 @@
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
-EOF
+_ACEOF
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   ac_popdir=`pwd`
-  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
-    cd $ac_subdir
-    # A "../" for each directory in /$ac_subdir.
-    ac_dots=`echo $ac_subdir |
-             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
-
-    case $srcdir in
-    .) # No --srcdir option.  We are building in place.
-      ac_sub_srcdir=$srcdir ;;
-    [\\/]* | ?:[\\/]* ) # Absolute path.
-      ac_sub_srcdir=$srcdir/$ac_subdir ;;
-    *) # Relative path.
-      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
-    esac
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
+    cd $ac_dir
     # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_sub_srcdir/configure.gnu; then
+    if test -f $ac_srcdir/configure.gnu; then
       echo
-      $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_sub_srcdir/configure; then
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
       echo
-      $SHELL $ac_sub_srcdir/configure  --help=recursive
-    elif test -f $ac_sub_srcdir/configure.ac ||
-           test -f $ac_sub_srcdir/configure.in; then
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
       echo
       $ac_configure --help
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
     cd $ac_popdir
   done
@@ -723,31 +953,30 @@
 
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
-  cat <<\EOF
+  cat <<\_ACEOF
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
-EOF
+_ACEOF
   exit 0
 fi
 exec 5>config.log
-cat >&5 <<EOF
+cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.52.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
 
-EOF
+_ACEOF
 {
 cat <<_ASUNAME
-## ---------- ##
-## Platform.  ##
-## ---------- ##
+## --------- ##
+## Platform. ##
+## --------- ##
 
 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
 uname -m = `(uname -m) 2>/dev/null || echo unknown`
@@ -766,79 +995,156 @@
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
 
-PATH = $PATH
-
 _ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
 } >&5
 
-cat >&5 <<EOF
-## ------------ ##
-## Core tests.  ##
-## ------------ ##
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
 
-EOF
 
 # Keep a trace of the command line.
 # Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
 # Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
 ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
 ac_sep=
-for ac_arg
+ac_must_keep_next=false
+for ac_pass in 1 2
 do
-  case $ac_arg in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
-    ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-    ac_sep=" " ;;
-  *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
-     ac_sep=" " ;;
-  esac
-  # Get rid of the leading space.
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
 done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
-  echo >&5
-  echo "## ----------------- ##" >&5
-  echo "## Cache variables.  ##" >&5
-  echo "## ----------------- ##" >&5
-  echo >&5
-  # The following way of writing the cache mishandles newlines in values,
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
 {
   (set) 2>&1 |
     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
     *ac_space=\ *)
       sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
       ;;
     *)
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
-} >&5
-  sed "/^$/d" confdefs.h >conftest.log
-  if test -s conftest.log; then
-    echo >&5
-    echo "## ------------ ##" >&5
-    echo "## confdefs.h.  ##" >&5
-    echo "## ------------ ##" >&5
-    echo >&5
-    cat conftest.log >&5
-  fi
-  (echo; echo) >&5
-  test "$ac_signal" != 0 &&
-    echo "$as_me: caught signal $ac_signal" >&5
-  echo "$as_me: exit $exit_status" >&5
-  rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
      ' 0
 for ac_signal in 1 2 13 15; do
@@ -851,6 +1157,33 @@
 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
 echo >confdefs.h
 
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
 if test -z "$CONFIG_SITE"; then
@@ -862,9 +1195,9 @@
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    { echo "$as_me:865: loading site script $ac_site_file" >&5
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
-    cat "$ac_site_file" >&5
+    sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
 done
@@ -873,7 +1206,7 @@
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:876: loading cache $cache_file" >&5
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -881,7 +1214,7 @@
     esac
   fi
 else
-  { echo "$as_me:884: creating cache $cache_file" >&5
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
 echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -890,49 +1223,49 @@
 # value.
 ac_cache_corrupted=false
 for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
   eval ac_new_val="\$ac_env_${ac_var}_value"
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:900: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:904: error: \`$ac_var' was not set in the previous run" >&5
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:910: error: \`$ac_var' has changed since the previous run:" >&5
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:912:   former value:  $ac_old_val" >&5
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:914:   current value: $ac_new_val" >&5
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
+	ac_cache_corrupted=:
       fi;;
   esac
-  # Pass precious variables to config.status.  It doesn't matter if
-  # we pass some twice (in addition to the command line arguments).
+  # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
     *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
-      ac_configure_args="$ac_configure_args '$ac_arg'"
-      ;;
-    *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
-       ;;
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:933: error: changes in the environment can compromise the build" >&5
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:935: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -943,28 +1276,26 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-echo "#! $SHELL" >conftest.sh
-echo  "exit 0"   >>conftest.sh
-chmod +x conftest.sh
-if { (echo "$as_me:955: PATH=\".;.\"; conftest.sh") >&5
-  (PATH=".;."; conftest.sh) 2>&5
-  ac_status=$?
-  echo "$as_me:958: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  ac_path_separator=';'
-else
-  ac_path_separator=:
-fi
-PATH_SEPARATOR="$ac_path_separator"
-rm -f conftest.sh
 
-ac_config_headers="$ac_config_headers src/config.h"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+          ac_config_headers="$ac_config_headers src/config.h"
+
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -974,7 +1305,7 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:977: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -982,25 +1313,28 @@
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:992: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1000: result: $CC" >&5
+  echo "$as_me:$LINENO: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1003: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1009,7 +1343,7 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:1012: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1017,25 +1351,28 @@
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1027: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1035: result: $ac_ct_CC" >&5
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1038: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1048,7 +1385,7 @@
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1051: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1056,25 +1393,28 @@
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1066: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1074: result: $CC" >&5
+  echo "$as_me:$LINENO: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1077: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1083,7 +1423,7 @@
   ac_ct_CC=$CC
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1086: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1091,25 +1431,28 @@
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1101: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1109: result: $ac_ct_CC" >&5
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1112: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1122,7 +1465,7 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1125: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1131,19 +1474,22 @@
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   ac_prog_rejected=no
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-  ac_prog_rejected=yes
-  continue
-fi
-ac_cv_prog_CC="cc"
-echo "$as_me:1145: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 if test $ac_prog_rejected = yes; then
@@ -1155,19 +1501,17 @@
     # However, it has the same basename, so the bogon will be chosen
     # first if we set CC to just the basename; use the full file name.
     shift
-    set dummy "$ac_dir/$ac_word" ${1+"$@"}
-    shift
-    ac_cv_prog_CC="$@"
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
   fi
 fi
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1167: result: $CC" >&5
+  echo "$as_me:$LINENO: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1170: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1178,7 +1522,7 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1181: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1186,25 +1530,28 @@
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1196: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1204: result: $CC" >&5
+  echo "$as_me:$LINENO: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1207: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1217,7 +1564,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:1220: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1225,25 +1572,28 @@
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1235: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1243: result: $ac_ct_CC" >&5
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1246: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1255,33 +1605,39 @@
 
 fi
 
-test -z "$CC" && { { echo "$as_me:1258: error: no acceptable cc found in \$PATH" >&5
-echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:1263:" \
+echo "$as_me:$LINENO:" \
      "checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1266: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
   (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1269: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1271: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
   (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1274: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1276: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
   (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1279: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 1283 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 int
 main ()
@@ -1292,127 +1648,152 @@
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe"
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:1299: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1302: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
   ac_status=$?
-  echo "$as_me:1305: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Find the output, starting from the most likely.  This scheme is
 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
 # resort.
-for ac_file in `ls a.exe conftest.exe 2>/dev/null;
-                ls a.out conftest 2>/dev/null;
-                ls a.* conftest.* 2>/dev/null`; do
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
-    a.out ) # We found the default executable, but exeext='' is most
-            # certainly right.
-            break;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
-          export ac_cv_exeext
-          break;;
-    * ) break;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
   esac
 done
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:1328: error: C compiler cannot create executables" >&5
-echo "$as_me: error: C compiler cannot create executables" >&2;}
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:1334: result: $ac_file" >&5
+echo "$as_me:$LINENO: result: $ac_file" >&5
 echo "${ECHO_T}$ac_file" >&6
 
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1339: checking whether the C compiler works" >&5
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:1345: \"$ac_try\"") >&5
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1348: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:1355: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'." >&5
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
 echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'." >&2;}
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
     fi
   fi
 fi
-echo "$as_me:1363: result: yes" >&5
+echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-rm -f a.out a.exe conftest$ac_cv_exeext
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1370: checking whether we are cross compiling" >&5
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1372: result: $cross_compiling" >&5
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
 echo "${ECHO_T}$cross_compiling" >&6
 
-echo "$as_me:1375: checking for executable suffix" >&5
-echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1377: \"$ac_link\"") >&5
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:1380: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
 # `rm'.
-for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
+	  export ac_cv_exeext
+	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:1396: error: cannot compute EXEEXT: cannot compile and link" >&5
-echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:1402: result: $ac_cv_exeext" >&5
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
 echo "${ECHO_T}$ac_cv_exeext" >&6
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:1408: checking for object suffix" >&5
-echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1414 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 int
 main ()
@@ -1423,40 +1804,46 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1426: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1429: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:1441: error: cannot compute OBJEXT: cannot compile" >&5
-echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:1448: result: $ac_cv_objext" >&5
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
 echo "${ECHO_T}$ac_cv_objext" >&6
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:1452: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1458 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 int
 main ()
@@ -1470,41 +1857,55 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1473: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:1476: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1479: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1482: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_compiler_gnu=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:1494: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 CFLAGS="-g"
-echo "$as_me:1500: checking whether $CC accepts -g" >&5
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1506 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 int
 main ()
@@ -1515,26 +1916,37 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1518: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:1521: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1524: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1527: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_prog_cc_g=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:1537: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -1551,30 +1963,154 @@
     CFLAGS=
   fi
 fi
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
 #ifndef __cplusplus
   choke me
 #endif
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1564: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:1567: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1570: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1573: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
+   '' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -1582,10 +2118,13 @@
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line 1585 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_declaration
+#include <stdlib.h>
 int
 main ()
 {
@@ -1595,27 +2134,41 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1598: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:1601: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1604: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1607: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 continue
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 1617 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_declaration
 int
 main ()
@@ -1626,23 +2179,34 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1629: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:1632: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1635: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1638: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 rm -f conftest*
 if test -n "$ac_declaration"; then
@@ -1653,9 +2217,10 @@
 
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -1667,7 +2232,7 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:1670: checking how to run the C preprocessor" >&5
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -1685,24 +2250,34 @@
 do
   # Use a header file that comes with gcc, so configuring glibc
   # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1691 "configure"
-#include "confdefs.h"
-#include <assert.h>
-                     Syntax error
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:1696: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1702: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -1713,7 +2288,8 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
@@ -1722,20 +2298,24 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1725 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:1729: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1735: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -1747,7 +2327,8 @@
 continue
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
@@ -1769,31 +2350,41 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:1772: result: $CPP" >&5
+echo "$as_me:$LINENO: result: $CPP" >&5
 echo "${ECHO_T}$CPP" >&6
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
   # Use a header file that comes with gcc, so configuring glibc
   # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1782 "configure"
-#include "confdefs.h"
-#include <assert.h>
-                     Syntax error
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:1787: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1793: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -1804,7 +2395,8 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
@@ -1813,20 +2405,24 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1816 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:1820: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1826: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -1838,7 +2434,8 @@
 continue
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
@@ -1851,8 +2448,10 @@
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:1854: error: C preprocessor \"$CPP\" fails sanity check" >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -1862,16 +2461,16 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-echo "$as_me:1865: checking whether ${MAKE-make} sets \${MAKE}" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.make <<\EOF
+  cat >conftest.make <<\_ACEOF
 all:
-	@echo 'ac_maketemp="${MAKE}"'
-EOF
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 if test -n "$ac_maketemp"; then
@@ -1882,11 +2481,11 @@
 rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:1885: result: yes" >&5
+  echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$as_me:1889: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
@@ -1908,7 +2507,7 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:1911: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1927,44 +2526,51 @@
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:1931: checking for a BSD compatible install" >&5
-echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    ac_save_IFS=$IFS; IFS=$ac_path_separator
-  for ac_dir in $PATH; do
-    IFS=$ac_save_IFS
-    # Account for people who put trailing slashes in PATH elements.
-    case $ac_dir/ in
-    / | ./ | .// | /cC/* \
-    | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
-    | /usr/ucb/* ) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if $as_executable_p "$ac_dir/$ac_prog"; then
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
-            grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
 	    :
 	  elif test $ac_prog = install &&
-	    grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$ac_dir/$ac_prog -c"
-	    break 2
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
 	  fi
 	fi
       done
-      ;;
-    esac
-  done
+    done
+    ;;
+esac
+done
+
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -1977,7 +2583,7 @@
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:1980: result: $INSTALL" >&5
+echo "$as_me:$LINENO: result: $INSTALL" >&5
 echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -1992,7 +2598,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:1995: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_YACC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2000,25 +2606,28 @@
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_YACC="$ac_prog"
-echo "$as_me:2010: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_YACC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 YACC=$ac_cv_prog_YACC
 if test -n "$YACC"; then
-  echo "$as_me:2018: result: $YACC" >&5
+  echo "$as_me:$LINENO: result: $YACC" >&5
 echo "${ECHO_T}$YACC" >&6
 else
-  echo "$as_me:2021: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2026,11 +2635,12 @@
 done
 test -n "$YACC" || YACC="yacc"
 
+
 for ac_prog in flex lex
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2033: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_LEX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2038,25 +2648,28 @@
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_LEX="$ac_prog"
-echo "$as_me:2048: found $ac_dir/$ac_word" >&5
-break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LEX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
 fi
 fi
 LEX=$ac_cv_prog_LEX
 if test -n "$LEX"; then
-  echo "$as_me:2056: result: $LEX" >&5
+  echo "$as_me:$LINENO: result: $LEX" >&5
 echo "${ECHO_T}$LEX" >&6
 else
-  echo "$as_me:2059: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2066,7 +2679,7 @@
 
 if test -z "$LEXLIB"
 then
-  echo "$as_me:2069: checking for yywrap in -lfl" >&5
+  echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
 if test "${ac_cv_lib_fl_yywrap+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2074,8 +2687,11 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lfl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 2077 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -2093,32 +2709,44 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2096: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2099: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2102: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2105: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_fl_yywrap=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_fl_yywrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:2116: result: $ac_cv_lib_fl_yywrap" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
 if test $ac_cv_lib_fl_yywrap = yes; then
   LEXLIB="-lfl"
 else
-  echo "$as_me:2121: checking for yywrap in -ll" >&5
+  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
 if test "${ac_cv_lib_l_yywrap+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2126,8 +2754,11 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ll  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 2129 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -2145,27 +2776,39 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2148: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2151: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2154: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2157: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_l_yywrap=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_l_yywrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:2168: result: $ac_cv_lib_l_yywrap" >&5
+echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
 if test $ac_cv_lib_l_yywrap = yes; then
   LEXLIB="-ll"
@@ -2176,30 +2819,38 @@
 fi
 
 if test "x$LEX" != "x:"; then
-  echo "$as_me:2179: checking lex output file root" >&5
+  echo "$as_me:$LINENO: checking lex output file root" >&5
 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
 if test "${ac_cv_prog_lex_root+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   # The minimal lex program is just a single line: %%.  But some broken lexes
 # (Solaris, I think it was) want two %% lines, so accommodate them.
-echo '%%
-%%' | $LEX
+cat >conftest.l <<_ACEOF
+%%
+%%
+_ACEOF
+{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
+  (eval $LEX conftest.l) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
 if test -f lex.yy.c; then
   ac_cv_prog_lex_root=lex.yy
 elif test -f lexyy.c; then
   ac_cv_prog_lex_root=lexyy
 else
-  { { echo "$as_me:2193: error: cannot find output from $LEX; giving up" >&5
+  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
    { (exit 1); exit 1; }; }
 fi
 fi
-echo "$as_me:2198: result: $ac_cv_prog_lex_root" >&5
+echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
+rm -f conftest.l
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
-echo "$as_me:2202: checking whether yytext is a pointer" >&5
+echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2215,41 +2866,53 @@
 `cat $LEX_OUTPUT_ROOT.c`
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2218: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2221: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2224: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2227: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_lex_yytext_pointer=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_save_LIBS
 rm -f "${LEX_OUTPUT_ROOT}.c"
 
 fi
-echo "$as_me:2239: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
 if test $ac_cv_prog_lex_yytext_pointer = yes; then
 
-cat >>confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define YYTEXT_POINTER 1
-EOF
+_ACEOF
 
 fi
 
 fi
 # Extract the first word of "lynx", so it can be a program name with args.
 set dummy lynx; ac_word=$2
-echo "$as_me:2252: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_LYNX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2259,16 +2922,19 @@
   ac_cv_path_LYNX="$LYNX" # Let the user override the test with a path.
   ;;
   *)
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH:/usr/bin:/usr/local/bin/:/local/bin:/local/perl/bin:/usr/local/perl/bin"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_LYNX="$ac_dir/$ac_word"
-   echo "$as_me:2269: found $ac_dir/$ac_word" >&5
-   break
-fi
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/usr/bin:/usr/local/bin/:/local/bin:/local/perl/bin:/usr/local/perl/bin"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_LYNX="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
   test -z "$ac_cv_path_LYNX" && ac_cv_path_LYNX="false"
@@ -2278,16 +2944,16 @@
 LYNX=$ac_cv_path_LYNX
 
 if test -n "$LYNX"; then
-  echo "$as_me:2281: result: $LYNX" >&5
+  echo "$as_me:$LINENO: result: $LYNX" >&5
 echo "${ECHO_T}$LYNX" >&6
 else
-  echo "$as_me:2284: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
-echo "$as_me:2290: checking for $ac_word" >&5
+echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PERL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2297,16 +2963,19 @@
   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
   ;;
   *)
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH:/usr/bin:/usr/local/bin/:/local/bin:/local/perl/bin:/usr/local/perl/bin"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_PERL="$ac_dir/$ac_word"
-   echo "$as_me:2307: found $ac_dir/$ac_word" >&5
-   break
-fi
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/usr/bin:/usr/local/bin/:/local/bin:/local/perl/bin:/usr/local/perl/bin"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 
   test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no"
@@ -2316,10 +2985,10 @@
 PERL=$ac_cv_path_PERL
 
 if test -n "$PERL"; then
-  echo "$as_me:2319: result: $PERL" >&5
+  echo "$as_me:$LINENO: result: $PERL" >&5
 echo "${ECHO_T}$PERL" >&6
 else
-  echo "$as_me:2322: result: no" >&5
+  echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2335,6 +3004,8 @@
 db_lib=-L$dbprefix/BerkeleyDB/lib
 db_inc=-I$dbprefix/BerkeleyDB/include
 
+
+
 # Check whether --with-db or --without-db was given.
 if test "${with_db+set}" = set; then
   withval="$with_db"
@@ -2346,6 +3017,7 @@
 	db_inc="-I${db_distribution}/include"
 fi
 
+
 # Check whether --with-db_lib or --without-db_lib was given.
 if test "${with_db_lib+set}" = set; then
   withval="$with_db_lib"
@@ -2358,18 +3030,21 @@
   db_inc="-I${withval}"
 fi;
 
+
 # Check whether --with-sg_config or --without-sg_config was given.
 if test "${with_sg_config+set}" = set; then
   withval="$with_sg_config"
   sg_config=$withval
 fi;
 
+
 # Check whether --with-sg_logdir or --without-sg_logdir was given.
 if test "${with_sg_logdir+set}" = set; then
   withval="$with_sg_logdir"
   sg_logdir=$withval
 fi;
 
+
 # Check whether --with-sg_dbhome or --without-sg_dbhome was given.
 if test "${with_sg_dbhome+set}" = set; then
   withval="$with_sg_dbhome"
@@ -2377,166 +3052,139 @@
 fi;
 
 if test -n "$sg_config"; then
-	cat >>confdefs.h <<\EOF
+	cat >>confdefs.h <<\_ACEOF
 #define ACCONFIG 1
-EOF
+_ACEOF
 
 	sg_cfgdir=`echo $sg_config|sed "s%/[^/][^/]*$%%"`
 fi
 
 if test -n "$sg_logdir"; then
-	cat >>confdefs.h <<\EOF
+	cat >>confdefs.h <<\_ACEOF
 #define ACLOGDIR 1
-EOF
+_ACEOF
 
 fi
 
 if test -n "$sg_dbhome"; then
-	cat >>confdefs.h <<\EOF
+	cat >>confdefs.h <<\_ACEOF
 #define ACDBHOME 1
-EOF
+_ACEOF
 
 fi
 
 CFLAGS="$CFLAGS $db_inc"
+CXXFLAGS="$CXXFLAGS $db_inc"
 CPPFLAGS="$CPPFLAGS $db_inc"
 LDFLAGS="$LDFLAGS $db_lib"
 
-echo "$as_me:2405: checking for db_version in -ldb" >&5
-echo $ECHO_N "checking for db_version in -ldb... $ECHO_C" >&6
-if test "${ac_cv_lib_db_db_version+set}" = set; then
+
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldb  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 2413 "configure"
-#include "confdefs.h"
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char db_version ();
 int
 main ()
 {
-db_version ();
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2432: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2435: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2438: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2441: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_db_db_version=yes
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_db_db_version=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
 fi
-echo "$as_me:2452: result: $ac_cv_lib_db_db_version" >&5
-echo "${ECHO_T}$ac_cv_lib_db_db_version" >&6
-if test $ac_cv_lib_db_db_version = yes; then
-  cat >>confdefs.h <<EOF
-#define HAVE_LIBDB 1
-EOF
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-  LIBS="-ldb $LIBS"
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
 else
-
-	echo
-	echo "** The Berkley DB library is required for squidGuard"
-	echo "   to compile. Get it from http://www.sleepycat.com"
-	echo "   use --with-db=DIR or --with-db-lib=DIR to specify"
-	echo "   its location. (default is $dbprefix/BerkeleyDB)"
-	echo
-	exit 1
-
-fi
-
-echo "$as_me:2473: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 2479 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-_ACEOF
-if { (eval echo "$as_me:2487: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:2493: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line 2515 "configure"
-#include "confdefs.h"
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
 fi
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2533 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
+  $EGREP "free" >/dev/null 2>&1; then
   :
 else
   ac_cv_header_stdc=no
@@ -2551,16 +3199,20 @@
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2554 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
-# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
 
@@ -2571,66 +3223,197 @@
   int i;
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
+	|| toupper (i) != TOUPPER (i))
       exit(2);
   exit (0);
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:2580: \"$ac_link\"") >&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2583: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:2585: \"$ac_try\"") >&5
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2588: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
-echo "$as_me:2601: result: $ac_cv_header_stdc" >&5
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define STDC_HEADERS 1
-EOF
+_ACEOF
 
 fi
 
-for ac_header in db.h regex.h unistd.h
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:2614: checking for $ac_header" >&5
+echo "$as_me:$LINENO: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2620 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:2624: \"$ac_cpp conftest.$ac_ext\"") >&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2630: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2638,25 +3421,211 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  eval "$as_ac_Header=yes"
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  eval "$as_ac_Header=no"
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
 fi
 rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:2649: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 fi
+
 done
 
-if test $DB.H = no; then
+
+if test "${ac_cv_header_db_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for db.h" >&5
+echo $ECHO_N "checking for db.h... $ECHO_C" >&6
+if test "${ac_cv_header_db_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5
+echo "${ECHO_T}$ac_cv_header_db_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking db.h usability" >&5
+echo $ECHO_N "checking db.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <db.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking db.h presence" >&5
+echo $ECHO_N "checking db.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <db.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: db.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: db.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: db.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: db.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: db.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: db.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: db.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: db.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: db.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: db.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for db.h" >&5
+echo $ECHO_N "checking for db.h... $ECHO_C" >&6
+if test "${ac_cv_header_db_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_db_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5
+echo "${ECHO_T}$ac_cv_header_db_h" >&6
+
+fi
+if test $ac_cv_header_db_h = yes; then
+  :
+else
+
 	echo
 	echo "** No db.h found"
 	echo "   The Berkley DB library is required for squidGuard"
@@ -2665,116 +3634,698 @@
 	echo "   its location. (default is $dbprefix/BerkeleyDB)"
 	echo
 	exit 1
+
+fi
+
+
+
+if test "${ac_cv_header_regex_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for regex.h" >&5
+echo $ECHO_N "checking for regex.h... $ECHO_C" >&6
+if test "${ac_cv_header_regex_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_regex_h" >&5
+echo "${ECHO_T}$ac_cv_header_regex_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking regex.h usability" >&5
+echo $ECHO_N "checking regex.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <regex.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking regex.h presence" >&5
+echo $ECHO_N "checking regex.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <regex.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: regex.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: regex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: regex.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: regex.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: regex.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: regex.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: regex.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: regex.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: regex.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: regex.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: regex.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: regex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: regex.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: regex.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: regex.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: regex.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for regex.h" >&5
+echo $ECHO_N "checking for regex.h... $ECHO_C" >&6
+if test "${ac_cv_header_regex_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_regex_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_regex_h" >&5
+echo "${ECHO_T}$ac_cv_header_regex_h" >&6
+
 fi
+if test $ac_cv_header_regex_h = yes; then
+  :
+else
+
+	echo
+	echo "** No regex.h found"
+	echo "   The regexp library is required for squidGuard"
+	echo "   to compile. Get it from http://www.gnu.org"
+	echo
+	exit 1
+
+fi
+
+
+
+
+
+echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5
+echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_ldap_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ldap_init ();
+int
+main ()
+{
+ldap_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ldap_ldap_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ldap_ldap_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_init" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_ldap_init" >&6
+if test $ac_cv_lib_ldap_ldap_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLDAP 1
+_ACEOF
+
+  LIBS="-lldap $LIBS"
+
+else
+
+		echo
+		echo "LDAP library not found"
+		echo
+		exit 1
+
+fi
+
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+
+	#include <ldap.h>
+	int main()
+	{
+		LDAP *p;
+		p = ldap_init("localhost", LDAP_PORT);
+		exit(0);
+	}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+		echo
+		echo "Unable to link to LDAP library."
+		echo
+		exit 1
+
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_create ();
+int
+main ()
+{
+pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
+
+else
+
+	echo
+	echo "Thread library not found, this may cause problems if your"
+	echo "db libraries require threading support, but most of the time"
+	echo "it is not an issue."
+	echo
+
+fi
+
+
+
+echo "$as_me:$LINENO: checking for db_version in -ldb" >&5
+echo $ECHO_N "checking for db_version in -ldb... $ECHO_C" >&6
+if test "${ac_cv_lib_db_db_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldb  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char db_version ();
+int
+main ()
+{
+db_version ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_db_db_version=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_db_db_version=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_db_db_version" >&5
+echo "${ECHO_T}$ac_cv_lib_db_db_version" >&6
+if test $ac_cv_lib_db_db_version = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDB 1
+_ACEOF
+
+  LIBS="-ldb $LIBS"
+
+else
+
+	echo
+	echo "** The Berkley DB library is required for squidGuard"
+	echo "   to compile. Get it from http://www.sleepycat.com"
+	echo "   use --with-db=DIR or --with-db-lib=DIR to specify"
+	echo "   its location. (default is $dbprefix/BerkeleyDB)"
+	echo
+	exit 1
+
+fi
+
+if test "$cross_compiling" = yes; then
+  db_ok_version=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+
+	#include <db.h>
+	int main()
+	{
+		int major, minor, patch;
+		float ver;
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
+		ver = major + ((float) minor / 1000);
+                if (ver >= 2.006)
+			exit (0);
+		exit (1);
+	}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  db_ok_version=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+db_ok_version=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test $db_ok_version = no; then
+	echo
+	echo "** The Berkley DB library version 2.6.4 or newer"
+	echo "   is required. Get it from http://www.sleepycat.com"
+	echo "   use --with-db=DIR or --with-db-inc=DIR, "
+	echo "   --with-db-lib=DIR to specify its location"
+	echo "   (default is $dbprefix/BerkeleyDB)"
+	echo
+	exit 1;
+fi
+
+if test "$cross_compiling" = yes; then
+  db_ok_version=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+
+	#include <db.h>
+	int main()
+	{
+		int major, minor, patch;
+		float ver;
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
+		ver = major + ((float) minor / 1000);
+                if (ver > 2.007 && ver < 3.002)
+			exit (1);
+		exit (0);
+	}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  db_ok_version=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+db_ok_version=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test $db_ok_version = no; then
+	echo
+	echo "** The Berkley DB library version 3.2.* or newer"
+	echo "   is required, when using 3.* versions of the library"
+	echo "   Get it from http://www.sleepycat.com"
+	echo "   use --with-db=DIR or --with-db-inc=DIR, "
+	echo "   --with-db-lib=DIR to specify its location"
+	echo "   (default is $dbprefix/BerkeleyDB)"
+	echo
+	exit 1;
+fi
+
+if test "$cross_compiling" = yes; then
+  dbg2_ok_version=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+
+	#include <db.h>
+	int main()
+	{
+		int major, minor, patch;
+		float ver;
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
+		ver = major + ((float) minor / 1000);
+                if (ver >= 3.002)
+			exit (0);
+		exit (1);
+	}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  dbg2_ok_version=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test $HAVE_REGEX.H = no; then
-	echo
-	echo "** No regex.h found"
-	echo "   The regexp library is required for squidGuard"
-	echo "   to compile. Get it from http://www.gnu.org"
-	echo
-	exit 1
+( exit $ac_status )
+dbg2_ok_version=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:2679: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+if test "$cross_compiling" = yes; then
+  dbg4_ok_version=no
 else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line 2687 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
+  cat >conftest.$ac_ext <<_ACEOF
+
+        #include <db.h>
+        int main()
+        {
+                int major, minor, patch;
+                float ver;
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
+                ver = major + ((float) minor / 1000);
+                if (major >= 4 && minor >= 1)
+                        exit (0);
+                exit (1);
+        }
+
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2736: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2739: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2742: \"$ac_try\"") >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2745: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  dbg4_ok_version=yes
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+dbg4_ok_version=no
 fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test $dbg4_ok_version = yes; then
+	cat >>confdefs.h <<\_ACEOF
+#define DB_VERSION_GT4 1
+_ACEOF
+
+elif test $dbg2_ok_version = yes; then
+	cat >>confdefs.h <<\_ACEOF
+#define DB_VERSION_GT2 1
+_ACEOF
 
 fi
 
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:2762: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:2765: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
 
-echo "$as_me:2770: checking for an ANSI C-conforming const" >&5
+
+
+
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2776 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 int
 main ()
@@ -2831,90 +4382,57 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2834: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2837: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2840: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2843: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_const=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_c_const=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:2853: result: $ac_cv_c_const" >&5
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
 echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
 
-cat >>confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define const
-EOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:2869: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 2875 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2881: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:2884: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2887: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:2890: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:2900: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
 
 fi
-done
 
-echo "$as_me:2910: checking for size_t" >&5
+echo "$as_me:$LINENO: checking for size_t" >&5
 echo $ECHO_N "checking for size_t... $ECHO_C" >&6
 if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2916 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
 int
 main ()
@@ -2928,45 +4446,59 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2931: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2934: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2937: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2940: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_type_size_t=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:2950: result: $ac_cv_type_size_t" >&5
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
 echo "${ECHO_T}$ac_cv_type_size_t" >&6
 if test $ac_cv_type_size_t = yes; then
   :
 else
 
-cat >>confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
 #define size_t unsigned
-EOF
+_ACEOF
 
 fi
 
-echo "$as_me:2962: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
 if test "${ac_cv_struct_tm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2968 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <time.h>
 
@@ -2979,763 +4511,889 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2982: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:2985: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2988: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2991: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_struct_tm=time.h
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:3001: result: $ac_cv_struct_tm" >&5
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
 echo "${ECHO_T}$ac_cv_struct_tm" >&6
 if test $ac_cv_struct_tm = sys/time.h; then
 
-cat >>confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define TM_IN_SYS_TIME 1
-EOF
+_ACEOF
 
 fi
 
+
+
+
 for ac_func in regcomp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3014: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3020 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3051: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3054: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3057: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3060: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3070: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 else
-  { { echo "$as_me:3078: error: No regcomp library function." >&5
+  { { echo "$as_me:$LINENO: error: No regcomp library function." >&5
 echo "$as_me: error: No regcomp library function." >&2;}
    { (exit 1); exit 1; }; }
 fi
 done
 
+
 for ac_func in regerror
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3087: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3093 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* 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.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* 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 ();
-char (*f) ();
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-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
+#ifdef __STDC__
+# include <limits.h>
 #else
-f = $ac_func;
+# include <assert.h>
 #endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3124: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:3127: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3130: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3133: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_var=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:3143: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
-
-else
-  { { echo "$as_me:3151: error: No regerror library function." >&5
-echo "$as_me: error: No regerror library function." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-done
+#undef $ac_func
 
-for ac_func in regexec
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3160: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 3166 "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.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3197: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3200: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3203: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3206: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3216: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 else
-  { { echo "$as_me:3224: error: No regexec library function." >&5
-echo "$as_me: error: No regexec library function." >&2;}
+  { { echo "$as_me:$LINENO: error: No regerror library function." >&5
+echo "$as_me: error: No regerror library function." >&2;}
    { (exit 1); exit 1; }; }
 fi
 done
 
-for ac_func in strdup
+
+for ac_func in regexec
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3233: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3239 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3270: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3273: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3276: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3279: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3289: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 else
-  { { echo "$as_me:3297: error: No strdup library function." >&5
-echo "$as_me: error: No strdup library function." >&2;}
+  { { echo "$as_me:$LINENO: error: No regexec library function." >&5
+echo "$as_me: error: No regexec library function." >&2;}
    { (exit 1); exit 1; }; }
 fi
 done
 
-for ac_func in strerror
+
+for ac_func in strdup
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3306: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3312 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3343: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3346: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3349: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3352: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3362: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 else
-  { { echo "$as_me:3370: error: No strerror library function." >&5
-echo "$as_me: error: No strerror library function." >&2;}
+  { { echo "$as_me:$LINENO: error: No strdup library function." >&5
+echo "$as_me: error: No strdup library function." >&2;}
    { (exit 1); exit 1; }; }
 fi
 done
 
-for ac_func in vsprintf
+
+for ac_func in strerror
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3379: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3385 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3416: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3419: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3422: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3425: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3435: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 else
-  { { echo "$as_me:3443: error: No vsprintf library function." >&5
-echo "$as_me: error: No vsprintf library function." >&2;}
+  { { echo "$as_me:$LINENO: error: No strerror library function." >&5
+echo "$as_me: error: No strerror library function." >&2;}
    { (exit 1); exit 1; }; }
 fi
 done
 
-for ac_func in sigaction
+
+for ac_func in vsprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3452: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3458 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3489: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3492: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3495: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3498: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3508: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
+else
+  { { echo "$as_me:$LINENO: error: No vsprintf library function." >&5
+echo "$as_me: error: No vsprintf library function." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 done
 
-for ac_func in signal
+
+for ac_func in sigaction
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3521: checking for $ac_func" >&5
+echo "$as_me:$LINENO: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3527 "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* 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 ();
-char (*f) ();
-
-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
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3558: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3561: \$? = $ac_status" >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3564: \"$ac_try\"") >&5
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3567: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3577: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+_ACEOF
 
 fi
 done
 
-if test "$cross_compiling" = yes; then
-  db_ok_version=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 3591 "configure"
-#include "confdefs.h"
-
-	#include <db.h>
-	int main()
-	{
-		int major, minor, patch;
-		float ver;
-		db_version(&major, &minor, &patch);
-		ver = major + ((float) minor / 1000);
-                if (ver >= 2.006)
-			exit (0);
-		exit (1);
-	}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:3608: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:3611: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:3613: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3616: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_ok_version=yes
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-db_ok_version=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test $db_ok_version = no; then
-	echo
-	echo "** The Berkley DB library version 2.6.4 or newer"
-	echo "   is required. Get it from http://www.sleepycat.com"
-	echo "   use --with-db=DIR or --with-db-inc=DIR, "
-	echo "   --with-db-lib=DIR to specify its location"
-	echo "   (default is $dbprefix/BerkeleyDB)"
-	echo
-	exit 1;
-fi
 
-if test "$cross_compiling" = yes; then
-  db_ok_version=no
+for ac_func in signal
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3643 "configure"
-#include "confdefs.h"
-
-	#include <db.h>
-	int main()
-	{
-		int major, minor, patch;
-		float ver;
-		db_version(&major, &minor, &patch);
-		ver = major + ((float) minor / 1000);
-                if (ver > 2.007 && ver < 3.002)
-			exit (1);
-		exit (0);
-	}
-
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:3660: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:3663: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:3665: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3668: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  db_ok_version=yes
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-db_ok_version=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test $db_ok_version = no; then
-	echo
-	echo "** The Berkley DB library version 3.2.* or newer"
-	echo "   is required, when using 3.* versions of the library"
-	echo "   Get it from http://www.sleepycat.com"
-	echo "   use --with-db=DIR or --with-db-inc=DIR, "
-	echo "   --with-db-lib=DIR to specify its location"
-	echo "   (default is $dbprefix/BerkeleyDB)"
-	echo
-	exit 1;
-fi
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-if test "$cross_compiling" = yes; then
-  dbg2_ok_version=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 3696 "configure"
-#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-	#include <db.h>
-	int main()
-	{
-		int major, minor, patch;
-		float ver;
-		db_version(&major, &minor, &patch);
-		ver = major + ((float) minor / 1000);
-                if (ver >= 3.002)
-			exit (0);
-		exit (1);
-	}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* 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 ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
 
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:3713: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:3716: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:3718: \"$ac_try\"") >&5
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3721: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  dbg2_ok_version=yes
+  eval "$as_ac_var=yes"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-dbg2_ok_version=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
 fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-
-if test $dbg2_ok_version = yes; then
-	cat >>confdefs.h <<\EOF
-#define DB_VERSION_GT2 1
-EOF
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
 fi
+done
+
+
 
 VERSION=`pwd | sed 's%.*/squidGuard-%%'`
 TESTDIR="`pwd`/test"
@@ -3755,7 +5413,24 @@
 	fi
 fi
 
-ac_config_files="$ac_config_files Makefile src/Makefile src/sg.h doc/Makefile test/Makefile test/test1.conf test/test2.conf samples/Makefile samples/sample.conf samples/squidGuard.cgi samples/squidGuard-simple.cgi contrib/Makefile contrib/squidGuardRobot/squidGuardRobot contrib/sgclean/sgclean contrib/hostbyname/hostbyname"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+                                                                                                                                                      ac_config_files="$ac_config_files Makefile src/Makefile src/sg.h doc/Makefile test/Makefile test/test1.conf test/test2.conf samples/Makefile samples/sample.conf samples/squidGuard.cgi samples/squidGuard-simple.cgi contrib/Makefile contrib/squidGuardRobot/squidGuardRobot contrib/sgclean/sgclean contrib/hostbyname/hostbyname"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -3766,7 +5441,7 @@
 # config.status only pays attention to the cache file if you give it
 # the --recheck option to rerun configure.
 #
-# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
 # loading this file, other *unset* `ac_cv_foo' will be assigned the
 # following values.
 
@@ -3784,13 +5459,13 @@
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
-        "s/'/'\\\\''/g;
-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
       ;;
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 } |
@@ -3801,7 +5476,7 @@
      t end
      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
      : end' >>confcache
-if cmp -s $cache_file confcache; then :; else
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
   if test -w $cache_file; then
     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
     cat confcache >$cache_file
@@ -3820,47 +5495,240 @@
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
 s/:*\$(srcdir):*/:/;
 s/:*\${srcdir}:*/:/;
 s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ 	]*\):*/\1/;
+s/^\([^=]*=[	 ]*\):*/\1/;
 s/:*$//;
-s/^[^=]*=[ 	]*$//;
+s/^[^=]*=[	 ]*$//;
 }'
 fi
 
 DEFS=-DHAVE_CONFIG_H
 
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:3838: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
-# Generated automatically by configure.
+# Generated by $as_me.
 # Run this file to recreate the current configuration.
 # Compiler output produced by configure, useful for debugging
 # configure, is in config.log if it exists.
 
 debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
 SHELL=\${CONFIG_SHELL-$SHELL}
-ac_cs_invocation="\$0 \$@"
-
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
 
 # Name of the executable.
-as_me=`echo "$0" |sed 's,.*[\\/],,'`
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
 
 if expr a : '\(a\)' >/dev/null 2>&1; then
   as_expr=expr
@@ -3886,24 +5754,21 @@
 fi
 rm -f conf$$ conf$$.exe conf$$.file
 
-as_executable_p="test -f"
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
 else
-  as_unset=false
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
 fi
 
-# NLS nuisances.
-$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
-$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
-$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
-$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
-$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
-$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
-$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
-$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
 
 # IFS
 # We need space, tab and new line, in precisely that order.
@@ -3912,10 +5777,34 @@
 IFS=" 	$as_nl"
 
 # CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+$as_unset CDPATH
 
 exec 6>&1
 
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
 _ACEOF
 
 # Files that config.status was made for.
@@ -3935,7 +5824,7 @@
   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
 fi
 
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
@@ -3945,12 +5834,13 @@
 
   -h, --help       print this help, then exit
   -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
+		   instantiate the configuration file FILE
   --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
+		   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -3959,23 +5849,22 @@
 $config_headers
 
 Report bugs to <bug-autoconf@gnu.org>."
-EOF
+_ACEOF
 
-cat >>$CONFIG_STATUS <<EOF
+cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.52,
+configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
 INSTALL="$INSTALL"
-EOF
+_ACEOF
 
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 # If no file are specified by the user, then we need to provide default
 # value.  By we need to know if files were specified by the user.
 ac_need_defaults=:
@@ -3985,30 +5874,30 @@
   --*=*)
     ac_option=`expr "x$1" : 'x\([^=]*\)='`
     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    shift
-    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
-    shift
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
     ;;
-  -*);;
   *) # This is not an option, so the user has probably given explicit
      # arguments.
+     ac_option=$1
      ac_need_defaults=false;;
   esac
 
-  case $1 in
+  case $ac_option in
   # Handling of the options.
-EOF
-cat >>$CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
-    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+    ac_cs_recheck=: ;;
   --version | --vers* | -V )
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:4011: error: ambiguous option: $1
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -4018,16 +5907,19 @@
   --debug | --d* | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
-    shift
-    CONFIG_FILES="$CONFIG_FILES $1"
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
-    shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $1"
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:4030: error: unrecognized option: $1
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -4039,25 +5931,27 @@
   shift
 done
 
-exec 5>>config.log
-cat >&5 << _ACEOF
+ac_configure_extra_args=
 
-## ----------------------- ##
-## Running config.status.  ##
-## ----------------------- ##
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
 
-This file was extended by $as_me 2.52, executed with
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  > $ac_cs_invocation
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
 
 _ACEOF
-EOF
 
-cat >>$CONFIG_STATUS <<\EOF
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
 for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
@@ -4078,7 +5972,7 @@
   "contrib/sgclean/sgclean" ) CONFIG_FILES="$CONFIG_FILES contrib/sgclean/sgclean" ;;
   "contrib/hostbyname/hostbyname" ) CONFIG_FILES="$CONFIG_FILES contrib/hostbyname/hostbyname" ;;
   "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
-  *) { { echo "$as_me:4081: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -4093,6 +5987,9 @@
   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
 fi
 
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
 # Create a temporary directory, and hook for its removal unless debugging.
 $debug ||
 {
@@ -4101,23 +5998,23 @@
 }
 
 # Create a (secure) tmp directory for tmp files.
-: ${TMPDIR=/tmp}
+
 {
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=$TMPDIR/cs$$-$RANDOM
+  tmp=./confstat$$-$RANDOM
   (umask 077 && mkdir $tmp)
 } ||
 {
-   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-EOF
+_ACEOF
 
-cat >>$CONFIG_STATUS <<EOF
+cat >>$CONFIG_STATUS <<_ACEOF
 
 #
 # CONFIG_FILES section.
@@ -4130,6 +6027,12 @@
   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
 s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
 s,@exec_prefix@,$exec_prefix,;t t
 s,@prefix@,$prefix,;t t
 s,@program_transform_name@,$program_transform_name,;t t
@@ -4145,19 +6048,13 @@
 s,@oldincludedir@,$oldincludedir,;t t
 s,@infodir@,$infodir,;t t
 s,@mandir@,$mandir,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
 s,@build_alias@,$build_alias,;t t
 s,@host_alias@,$host_alias,;t t
 s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
 s,@ECHO_C@,$ECHO_C,;t t
 s,@ECHO_N@,$ECHO_N,;t t
 s,@ECHO_T@,$ECHO_T,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@DEFS@,$DEFS,;t t
 s,@LIBS@,$LIBS,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
@@ -4177,6 +6074,7 @@
 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
 s,@LYNX@,$LYNX,;t t
 s,@PERL@,$PERL,;t t
+s,@EGREP@,$EGREP,;t t
 s,@ac_n@,$ac_n,;t t
 s,@ac_c@,$ac_c,;t t
 s,@sg_config@,$sg_config,;t t
@@ -4191,11 +6089,13 @@
 s,@SQUIDGUARDROBOTUA@,$SQUIDGUARDROBOTUA,;t t
 s,@ROBOTEXCEPTIONS@,$ROBOTEXCEPTIONS,;t t
 s,@BLACKLISTS@,$BLACKLISTS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
 
-EOF
+_ACEOF
 
-  cat >>$CONFIG_STATUS <<\EOF
+  cat >>$CONFIG_STATUS <<\_ACEOF
   # Split the substitutions into bite-sized pieces for seds with
   # small command number limits, like on Digital OSF/1 and HP-UX.
   ac_max_sed_lines=48
@@ -4220,9 +6120,9 @@
       (echo ':t
   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
       if test -z "$ac_sed_cmds"; then
-  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
       else
-  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
       fi
       ac_sed_frag=`expr $ac_sed_frag + 1`
       ac_beg=$ac_end
@@ -4234,86 +6134,144 @@
   fi
 fi # test -n "$CONFIG_FILES"
 
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   	  /^X\(\/\/\)$/{ s//\1/; q; }
   	  /^X\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
-  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    { case "$ac_dir" in
-  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
-  *)                      as_incr_dir=.;;
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-as_dummy="$ac_dir"
-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
-  case $as_mkdir_dir in
-    # Skip DOS drivespec
-    ?:) as_incr_dir=$as_mkdir_dir ;;
-    *)
-      as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
-    ;;
-  esac
-done; }
 
-    ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
-    # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
-  else
-    ac_dir_suffix= ac_dots=
-  fi
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
-  case $srcdir in
-  .)  ac_srcdir=.
-      if test -z "$ac_dots"; then
-         ac_top_srcdir=.
-      else
-         ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
-      fi ;;
-  [\\/]* | ?:[\\/]* )
-      ac_srcdir=$srcdir$ac_dir_suffix;
-      ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_dots$srcdir ;;
-  esac
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_dots$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:4308: creating $ac_file" >&5
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated automatically by config.status.  */
-  configure_input="Generated automatically from `echo $ac_file_in |
-                                                 sed 's,.*/,,'` by configure."
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
 
   # First look for the input files in the build tree, otherwise in the
   # src tree.
@@ -4322,37 +6280,43 @@
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:4326: error: cannot find input file: $f" >&5
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+	 echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:4339: error: cannot find input file: $f" >&5
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+	 fi;;
       esac
     done` || { (exit 1); exit 1; }
-EOF
-cat >>$CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
 $extrasub
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 s,@configure_input@,$configure_input,;t t
 s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
 s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
 s,@INSTALL@,$ac_INSTALL,;t t
 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
   rm -f $tmp/stdin
@@ -4364,8 +6328,8 @@
   fi
 
 done
-EOF
-cat >>$CONFIG_STATUS <<\EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 
 #
 # CONFIG_HEADER section.
@@ -4375,12 +6339,12 @@
 # NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
-ac_dB='[ 	].*$,\1#\2'
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
 ac_dC=' '
 ac_dD=',;t'
 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
 ac_uB='$,\1#\2define\3'
 ac_uC=' '
 ac_uD=',;t'
@@ -4389,15 +6353,15 @@
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:4400: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -4407,30 +6371,31 @@
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:4411: error: cannot find input file: $f" >&5
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:4424: error: cannot find input file: $f" >&5
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+	 fi;;
       esac
     done` || { (exit 1); exit 1; }
   # Remove the trailing spaces.
-  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
 
-EOF
+_ACEOF
 
 # Transform confdefs.h into two sed scripts, `conftest.defines' and
 # `conftest.undefs', that substitutes the proper values into
@@ -4446,16 +6411,16 @@
 # `end' is used to avoid that the second main sed command (meant for
 # 0-ary CPP macros) applies to n-ary macro definitions.
 # See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\EOF
+cat >confdef2sed.sed <<\_ACEOF
 s/[\\&,]/\\&/g
 s,[\\$`],\\&,g
 t clear
 : clear
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\(\([^ 	(][^ 	(]*\)([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
 t end
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
 : end
-EOF
+_ACEOF
 # If some macros were called several times there might be several times
 # the same #defines, which is useless.  Nevertheless, we may not want to
 # sort them, since we want the *last* AC-DEFINE to be honored.
@@ -4466,14 +6431,14 @@
 # This sed command replaces #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\EOF
-s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-EOF
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
 
 # Break up conftest.defines because some shells have a limit on the size
 # of here documents, and old seds have small limits too (100 cmds).
 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if egrep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
 echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
 echo '  :' >>$CONFIG_STATUS
 rm -f conftest.tail
@@ -4482,7 +6447,7 @@
   # Write a limited-size here document to $tmp/defines.sed.
   echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#define' lines.
-  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -4497,7 +6462,7 @@
   mv conftest.tail conftest.defines
 done
 rm -f conftest.defines
-echo '  fi # egrep' >>$CONFIG_STATUS
+echo '  fi # grep' >>$CONFIG_STATUS
 echo >>$CONFIG_STATUS
 
 # Break up conftest.undefs because some shells have a limit on the size
@@ -4509,7 +6474,7 @@
   # Write a limited-size here document to $tmp/undefs.sed.
   echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#undef'
-  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -4525,51 +6490,59 @@
 done
 rm -f conftest.undefs
 
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated automatically by config.status.  */
+  #    /* config.h.  Generated by config.status.  */
   if test x"$ac_file" = x-; then
-    echo "/* Generated automatically by configure.  */" >$tmp/config.h
+    echo "/* Generated by configure.  */" >$tmp/config.h
   else
-    echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
   fi
   cat $tmp/in >>$tmp/config.h
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:4541: $ac_file is unchanged" >&5
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   	  /^X\(\/\/\)$/{ s//\1/; q; }
   	  /^X\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
-      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-        { case "$ac_dir" in
-  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
-  *)                      as_incr_dir=.;;
-esac
-as_dummy="$ac_dir"
-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
-  case $as_mkdir_dir in
-    # Skip DOS drivespec
-    ?:) as_incr_dir=$as_mkdir_dir ;;
-    *)
-      as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
-    ;;
-  esac
-done; }
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
 
-      fi
       rm -f $ac_file
       mv $tmp/config.h $ac_file
     fi
@@ -4578,15 +6551,16 @@
     rm -f $tmp/config.h
   fi
 done
-EOF
+_ACEOF
 
-cat >>$CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 
 { (exit 0); exit 0; }
-EOF
+_ACEOF
 chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
 # Unfortunately, on DOS this fails, as config.log is still kept open
@@ -4597,8 +6571,11 @@
 # need to make the FD available again.
 if test "$no_create" != yes; then
   ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
   exec 5>/dev/null
-  $SHELL $CONFIG_STATUS || ac_cs_success=false
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
diff -urN squidGuard-1.2.0/configure.in squidGuard-1.2.0-patched/configure.in
--- squidGuard-1.2.0/configure.in	2001-12-18 05:16:36.000000000 -0500
+++ squidGuard-1.2.0-patched/configure.in	2004-12-02 15:57:25.000000000 -0500
@@ -1,7 +1,9 @@
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(src/config.h)
 
+dnl
 dnl Checks for programs.
+dnl
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_MAKE_SET
@@ -22,6 +24,10 @@
 db_lib=-L$dbprefix/BerkeleyDB/lib
 db_inc=-I$dbprefix/BerkeleyDB/include
 
+
+dnl
+dnl Handle command line arguments
+dnl
 AC_ARG_WITH(db,
 	[  --with-db=DIR           location of the Berkley DB distribution],
                 db_distribution=$withval)
@@ -66,26 +72,19 @@
 fi
 
 CFLAGS="$CFLAGS $db_inc"
+CXXFLAGS="$CXXFLAGS $db_inc"
 CPPFLAGS="$CPPFLAGS $db_inc"
 LDFLAGS="$LDFLAGS $db_lib"
 
-dnl Checks for libraries.
-
-AC_CHECK_LIB(db,db_version,,[
-	echo
-	echo "** The Berkley DB library is required for squidGuard"
-	echo "   to compile. Get it from http://www.sleepycat.com"
-	echo "   use --with-db=DIR or --with-db-lib=DIR to specify"
-	echo "   its location. (default is $dbprefix/BerkeleyDB)"
-	echo
-	exit 1
-	])
 
+dnl
 dnl Checks for header files.
+dnl
+
 AC_HEADER_STDC
-AC_CHECK_HEADERS(db.h regex.h unistd.h)
+AC_CHECK_HEADERS(unistd.h)
 
-if test $DB.H = no; then
+AC_CHECK_HEADER(db.h,,[
 	echo
 	echo "** No db.h found"
 	echo "   The Berkley DB library is required for squidGuard"
@@ -94,40 +93,75 @@
 	echo "   its location. (default is $dbprefix/BerkeleyDB)"
 	echo
 	exit 1
-fi
+	])
 
-if test $HAVE_REGEX.H = no; then
+AC_CHECK_HEADER(regex.h,,[
 	echo 
 	echo "** No regex.h found"
 	echo "   The regexp library is required for squidGuard"
 	echo "   to compile. Get it from http://www.gnu.org"
 	echo
 	exit 1
-fi
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_STRUCT_TM
+	])
 
-dnl Checks for library functions.
+dnl
+dnl Checks for libraries. Do in least-dependent to most-dependent order.
+dnl
+
+dnl Check ldap
+AC_CHECK_LIB(ldap,ldap_init,,[
+		echo
+		echo "LDAP library not found"
+		echo
+		exit 1
+	])
+AC_RUN_IFELSE([
+	#include <ldap.h>
+	int main() 
+	{
+		LDAP *p;
+		p = ldap_init("localhost", LDAP_PORT);
+		exit(0);
+	}	
+	],,[
+		echo
+		echo "Unable to link to LDAP library."
+		echo
+		exit 1
+	],)
 
-AC_CHECK_FUNCS(regcomp, , AC_MSG_ERROR([No regcomp library function.]))
-AC_CHECK_FUNCS(regerror, , AC_MSG_ERROR([No regerror library function.]))
-AC_CHECK_FUNCS(regexec, , AC_MSG_ERROR([No regexec library function.]))
-AC_CHECK_FUNCS(strdup, , AC_MSG_ERROR([No strdup library function.]))
-AC_CHECK_FUNCS(strerror, , AC_MSG_ERROR([No strerror library function.]))
-AC_CHECK_FUNCS(vsprintf, , AC_MSG_ERROR([No vsprintf library function.]))
-AC_CHECK_FUNCS(sigaction)
-AC_CHECK_FUNCS(signal)
+dnl Check threads... ok if it fails
+AC_CHECK_LIB(pthread,pthread_create,,[
+	echo
+	echo "Thread library not found, this may cause problems if your"
+	echo "db libraries require threading support, but most of the time"
+	echo "it is not an issue."
+	echo
+	])
 
-AC_TRY_RUN([
+dnl Check DB
+AC_CHECK_LIB(db,db_version,,[
+	echo
+	echo "** The Berkley DB library is required for squidGuard"
+	echo "   to compile. Get it from http://www.sleepycat.com"
+	echo "   use --with-db=DIR or --with-db-lib=DIR to specify"
+	echo "   its location. (default is $dbprefix/BerkeleyDB)"
+	echo
+	exit 1
+	])
+AC_RUN_IFELSE([
 	#include <db.h>
 	int main() 
 	{
 		int major, minor, patch;
 		float ver;
-		db_version(&major, &minor, &patch);
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
 		ver = major + ((float) minor / 1000);
                 if (ver >= 2.006)
 			exit (0);
@@ -146,13 +180,19 @@
 	exit 1;
 fi
 
-AC_TRY_RUN([
+AC_RUN_IFELSE([
 	#include <db.h>
 	int main() 
 	{
 		int major, minor, patch;
 		float ver;
-		db_version(&major, &minor, &patch);
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
 		ver = major + ((float) minor / 1000);
                 if (ver > 2.007 && ver < 3.002)
 			exit (1);
@@ -172,13 +212,19 @@
 	exit 1;
 fi
 
-AC_TRY_RUN([
+AC_RUN_IFELSE([
 	#include <db.h>
 	int main() 
 	{
 		int major, minor, patch;
 		float ver;
-		db_version(&major, &minor, &patch);
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
 		ver = major + ((float) minor / 1000);
                 if (ver >= 3.002)
 			exit (0);
@@ -186,10 +232,55 @@
 	}	
 	], dbg2_ok_version=yes, dbg2_ok_version=no, dbg2_ok_version=no)
 
-if test $dbg2_ok_version = yes; then
+
+AC_RUN_IFELSE([
+        #include <db.h>
+        int main()
+        {
+                int major, minor, patch;
+                float ver;
+#if DB_VERSION_MAJOR
+                major = DB_VERSION_MAJOR;
+                minor = DB_VERSION_MINOR;
+                patch = DB_VERSION_PATCH;
+#else
+                db_version(&major, &minor, &patch);
+#endif
+                ver = major + ((float) minor / 1000);
+                if (major >= 4 && minor >= 1)
+                        exit (0);
+                exit (1);
+        }
+        ], dbg4_ok_version=yes, dbg4_ok_version=no, dbg4_ok_version=no)
+
+if test $dbg4_ok_version = yes; then
+	AC_DEFINE(DB_VERSION_GT4)
+elif test $dbg2_ok_version = yes; then
 	AC_DEFINE(DB_VERSION_GT2)
 fi
 
+
+
+
+
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+
+dnl Checks for library functions.
+
+AC_CHECK_FUNCS(regcomp, , AC_MSG_ERROR([No regcomp library function.]))
+AC_CHECK_FUNCS(regerror, , AC_MSG_ERROR([No regerror library function.]))
+AC_CHECK_FUNCS(regexec, , AC_MSG_ERROR([No regexec library function.]))
+AC_CHECK_FUNCS(strdup, , AC_MSG_ERROR([No strdup library function.]))
+AC_CHECK_FUNCS(strerror, , AC_MSG_ERROR([No strerror library function.]))
+AC_CHECK_FUNCS(vsprintf, , AC_MSG_ERROR([No vsprintf library function.]))
+AC_CHECK_FUNCS(sigaction)
+AC_CHECK_FUNCS(signal)
+
+
 VERSION=`pwd | sed 's%.*/squidGuard-%%'`
 TESTDIR="`pwd`/test"
 
diff -urN squidGuard-1.2.0/doc/LDAPFlow.txt squidGuard-1.2.0-patched/doc/LDAPFlow.txt
--- squidGuard-1.2.0/doc/LDAPFlow.txt	1969-12-31 19:00:00.000000000 -0500
+++ squidGuard-1.2.0-patched/doc/LDAPFlow.txt	2004-12-02 15:57:28.000000000 -0500
@@ -0,0 +1,37 @@
+This file documents the flow of control through the new LDAP logic:
+
+
+                   UserSearch
+                       |
+                       |
+                 SourceBlock *s;
+               search in s->userDb
+                    /      \
+               ----/        \-----------
+              /                         \
+          not found                   found
+           |                          /   \
+           |                         /     \
+           |                      LDAP     user list
+           |                      user       user
+           |                      /  \        |
+           |                     /    \-------+
+           |                timeout           |
+           |                   /              |
+      search LDAP ------------/               |
+        URL list                              |
+          / \                                 |
+         /   \                                |
+       not   found                            |
+     found    |                               |
+        |     |                           return success
+        \    /
+        save both
+     states in the
+      userDb cache
+    i.e. add to userDb
+       if necessary
+           |
+           |
+       return found state as success or failure
+
diff -urN squidGuard-1.2.0/src/Makefile.in squidGuard-1.2.0-patched/src/Makefile.in
--- squidGuard-1.2.0/src/Makefile.in	2000-03-07 05:06:22.000000000 -0500
+++ squidGuard-1.2.0-patched/src/Makefile.in	2004-12-02 15:57:23.000000000 -0500
@@ -38,7 +38,7 @@
 cfgdir	= @sg_cfgdir@
 infodir	= $(prefix)/info
 
-OBJS	= main.o sgLog.o sgDb.o sgDiv.o y.tab.o lex.yy.o
+OBJS	= main.o sgLog.o sgDb.o sgDiv.o sgFree.o y.tab.o lex.yy.o
 
 all::
 	@echo making $@ in `basename \`pwd\``
@@ -48,6 +48,11 @@
 
 squidGuard:	$(OBJS)
 	$(LINK) $(OBJS) $(LIBS)
+#	@echo "**********************************************************"
+#	@echo "Copying binary to /tmp for dev testing..."
+#	rm -f /tmp/squidGuard
+#	cp squidGuard /tmp
+#	@echo "**********************************************************"
 
 conf: y.tab.o lex.yy.o
 	$(COMPILE) -o conf y.tab.o lex.yy.o
@@ -58,16 +63,19 @@
 sgLog.o:	sgLog.c sg.h
 	$(COMPILE) -c sgLog.c
 
-sgDiv.o: sgDiv.c sg.h
+sgDiv.o: sgDiv.c sg.h sgEx.h
 	$(COMPILE) -c sgDiv.c
 
+sgFree.o: sgFree.c sg.h sgEx.h
+	$(COMPILE) -c sgFree.c
+
 sgDb.o:	sgDb.c sg.h
 	$(COMPILE) -c sgDb.c
 
 lex.yy.o: lex.yy.c y.tab.h sg.h
 	$(COMPILE) -c lex.yy.c
 
-y.tab.o: y.tab.c y.tab.h sg.h
+y.tab.o: y.tab.c y.tab.h sg.h sgEx.h
 	$(COMPILE) -c y.tab.c
 
 lex.yy.c: sg.l sg.h
diff -urN squidGuard-1.2.0/src/config.h.in squidGuard-1.2.0-patched/src/config.h.in
--- squidGuard-1.2.0/src/config.h.in	2001-03-01 10:37:14.000000000 -0500
+++ squidGuard-1.2.0-patched/src/config.h.in	2004-12-02 15:57:25.000000000 -0500
@@ -18,3 +18,7 @@
 
 /* Define if you have dbversion greater than 3.2  */
 #undef DB_VERSION_GT2
+
+/* Define if you have dbversion greater than 4.0  */
+#undef DB_VERSION_GT4
+
diff -urN squidGuard-1.2.0/src/lex.yy.c.flex squidGuard-1.2.0-patched/src/lex.yy.c.flex
--- squidGuard-1.2.0/src/lex.yy.c.flex	2001-12-18 09:34:04.000000000 -0500
+++ squidGuard-1.2.0-patched/src/lex.yy.c.flex	1969-12-31 19:00:00.000000000 -0500
@@ -1,2084 +0,0 @@
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif	/* __STDC__ */
-#endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-	};
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 57
-#define YY_END_OF_BUFFER 58
-static yyconst short int yy_accept[386] =
-    {   0,
-        0,    0,    0,    0,   58,   56,   54,   55,    1,   36,
-       52,   47,   52,   52,   52,   52,   52,   52,   52,   52,
-       52,   52,   52,   52,   52,   52,   52,   52,   52,    2,
-        3,   52,   52,   52,   52,   52,   52,   51,   49,   50,
-       48,   54,    1,    1,    0,   52,   42,    0,   47,   52,
-       52,   52,   52,   52,   52,   52,   52,   40,   52,   52,
-       52,   52,   52,   52,    0,   52,   52,   52,   52,   52,
-       52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
-       52,   52,   49,   48,    0,    0,   52,   42,    0,   47,
-        0,   52,   52,   52,   52,   52,   52,   52,   36,   52,
-
-       52,   34,   52,   36,   52,   52,   52,   52,    0,    0,
-       36,   52,   36,   36,   36,   52,   52,   36,   52,   52,
-       11,   52,   52,   34,    8,   52,    6,   52,    0,   52,
-       42,    0,    0,   47,    0,   52,   52,   52,   32,   52,
-       39,   52,    0,    0,   52,   52,   52,   52,   52,   52,
-       52,   22,   52,   52,    0,    0,   52,   52,   52,   52,
-       52,   52,   18,   52,   52,   52,   52,    4,   52,   52,
-       52,   10,   46,    0,   52,   52,   42,    0,    0,    0,
-       47,   44,   52,   52,   27,   52,   52,    0,    0,    0,
-        0,    0,    0,    0,   52,   52,   52,   52,   52,   52,
-
-       52,   52,   52,    0,    0,    0,    0,   52,   52,   52,
-       52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
-       52,   52,   52,   52,   52,    0,    0,    0,   52,   52,
-       21,   52,    0,    0,    0,    0,    0,    0,    0,   36,
-       26,   17,   52,   52,   36,   52,   52,   52,   53,   53,
-       53,   53,   52,   52,   36,   52,   52,   52,   52,   52,
-       52,   28,   37,   12,   52,   13,   52,    7,   52,   52,
-       41,    0,    0,   52,   52,   52,   52,   36,   36,   36,
-       36,   36,   36,   36,   36,   35,   52,   36,   38,   52,
-       23,   53,   53,   53,   52,   52,   36,   52,   36,   15,
-
-       52,   52,   52,   52,    9,   43,   52,   41,    0,   52,
-       30,   52,   52,   52,    0,    0,    0,    0,    0,    0,
-        0,   25,   24,   36,   31,   36,   36,   19,   52,   52,
-       52,   43,   41,    0,   33,   52,   52,   52,    0,    0,
-        0,    0,    0,    0,    0,   36,   36,   20,   36,   52,
-       43,   45,   29,   14,   52,   36,   36,    0,   36,    0,
-        0,    0,   36,   52,   52,   36,   36,    0,   36,    0,
-       36,    0,    5,   52,   36,   36,   36,    0,   52,   36,
-       36,   36,   16,   36,    0
-    } ;
-
-static yyconst int yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    1,    4,    1,    5,    5,    1,    1,
-        1,    6,    5,    7,    8,    9,   10,   11,   11,   11,
-       12,   11,   11,   11,   11,   11,   11,   13,    1,    1,
-        5,    1,    5,   14,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   16,   15,   15,   15,   15,   15,   15,   15,   15,
-        1,   17,    1,    1,    5,    1,   18,   19,   20,   21,
-
-       22,   23,   24,   25,   26,   15,   27,   28,   29,   30,
-       31,   32,   33,   34,   35,   36,   37,   15,   38,   39,
-       40,   15,   41,    1,   42,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst int yy_meta[43] =
-    {   0,
-        1,    1,    2,    1,    3,    1,    1,    3,    3,    3,
-        3,    3,    3,    4,    3,    3,    1,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        1,    5
-    } ;
-
-static yyconst short int yy_base[393] =
-    {   0,
-        0,   25,   61,  103,  639,  640,   43,  640,    0,   40,
-       39,   43,    0,  608,  606,   26,   43,  602,  604,  602,
-      602,   50,  595,  613,  608,   59,   55,   49,   63,  640,
-      640,   67,  100,  598,  606,  109,   99,  640,  625,  640,
-        0,   54,    0,    0,   82,    0,   89,  117,  121,  595,
-      595,  111,  595,  588,  590,  595,  583,  591,  594,  587,
-      586,  579,  579,  100,  596,  576,  580,  580,  572,  586,
-      579,  584,  127,  569,  576,  578,  567,  577,  114,  563,
-      579,  569,  595,    0,  142,  142,  144,  148,  152,  156,
-      158,  566,  559,  566,  571,  574,  569,  556,  164,  555,
-
-      562,  564,  549,  170,  550,  549,  557,  548,  125,  159,
-      172,  547,  173,  176,  179,  552,  545,  182,  551,  552,
-        0,  545,  539,   92,  540,  539,    0,  550,  176,  181,
-      186,  188,  193,  207,  195,  531,  544,  529,    0,  542,
-        0,  545,  218,  564,  547,  536,  528,  536,  525,  542,
-      533,    0,  524,  531,  539,  194,  521,  536,  535,  517,
-      530,  524,   62,  527,  520,  521,  517,  519,  518,  517,
-      522,    0,  640,  210,  212,  217,  219,  223,  532,  227,
-      225,  640,  511,  509,    0,  508,  502,    0,  502,  504,
-      209,  215,  512,  531,  492,  491,  494,  501,  506,  487,
-
-      505,  503,  488,  228,  234,  241,  243,  502,  501,  481,
-      499,  501,  483,  491,  479,  480,  474,  483,  490,  481,
-      476,  473,  486,  250,  498,  232,  254,  238,  475,  468,
-      476,  468,  476,  471,  464,  469,  461,  475,  475,  262,
-        0,    0,  473,  466,  265,  471,  472,  469,  254,  257,
-      270,  285,  472,  463,  275,  470,  447,  450,  450,  453,
-      462,    0,    0,    0,  464,    0,  459,    0,  278,  294,
-      281,  471,  299,  442,  253,  452,  451,  310,  311,  313,
-      314,  320,  321,  322,  323,    0,  436,  331,    0,  439,
-        0,  310,  323,  329,  434,  440,  357,  412,  358,    0,
-
-      415,  414,  431,  412,    0,  330,  438,  350,  360,  411,
-        0,  408,  409,  412,  424,  423,  406,  420,  401,  414,
-      412,    0,    0,  366,    0,  367,  368,    0,  414,  391,
-      404,  365,  640,  367,    0,  394,  392,  397,  384,  382,
-      397,  370,  346,  340,  316,  378,  379,    0,  380,  317,
-        0,  640,    0,    0,  286,  381,  382,  280,  388,  277,
-      239,  247,  389,  187,  187,  390,  392,  163,  396,  156,
-      398,  144,    0,  123,  402,  404,  405,   86,   63,  406,
-      412,  418,    0,  419,  640,  453,  458,   83,   76,  463,
-      466,  469
-
-    } ;
-
-static yyconst short int yy_def[393] =
-    {   0,
-      385,    1,  386,  386,  385,  385,  385,  385,  387,  385,
-      388,  385,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  385,
-      385,  388,  388,  388,  388,  388,  388,  385,  385,  385,
-      389,  385,  387,  387,  385,  388,  388,  385,  385,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  390,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  385,  389,  385,  385,  388,  388,  385,  385,
-      385,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-
-      388,  388,  388,  388,  388,  388,  388,  388,  390,  390,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  385,  388,
-      388,  385,  385,  385,  385,  388,  388,  388,  388,  388,
-      388,  388,  385,  143,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  391,  392,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  385,  385,  388,  388,  388,  385,  385,  385,
-      385,  385,  388,  388,  388,  388,  388,  143,  385,  385,
-      385,  385,  385,  143,  388,  388,  388,  388,  388,  388,
-
-      388,  388,  388,  391,  391,  392,  392,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  385,  385,  385,  388,  388,
-      388,  388,  385,  385,  385,  385,  385,  385,  385,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  385,  391,
-      391,  392,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      385,  385,  385,  388,  388,  388,  388,  385,  385,  385,
-      385,  385,  385,  385,  388,  388,  388,  388,  388,  388,
-      388,  385,  391,  392,  388,  388,  388,  388,  388,  388,
-
-      388,  388,  388,  388,  388,  388,  388,  385,  385,  388,
-      388,  388,  388,  388,  385,  385,  385,  385,  385,  385,
-      385,  388,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  388,  385,  385,  388,  388,  388,  388,  385,  385,
-      385,  385,  385,  385,  385,  388,  388,  388,  388,  388,
-      388,  385,  388,  388,  388,  385,  385,  385,  385,  385,
-      385,  385,  388,  388,  388,  385,  385,  385,  385,  385,
-      385,  385,  388,  388,  385,  385,  385,  385,  388,  385,
-      385,  385,  388,  385,    0,  385,  385,  385,  385,  385,
-      385,  385
-
-    } ;
-
-static yyconst short int yy_nxt[683] =
-    {   0,
-        6,    7,    8,    9,    6,   10,    6,    6,    6,   11,
-       12,   12,    6,    6,   13,   13,    6,   14,   13,   15,
-       16,   17,   18,   13,   19,   20,   13,   21,   22,   13,
-       23,   24,   13,   25,   26,   27,   28,   29,   13,   13,
-       30,   31,   32,   52,   42,   33,   43,   45,   45,   47,
-       47,   48,   34,   49,   49,   42,   53,   43,   35,   36,
-       37,   38,   39,   40,   38,   38,   38,   38,   38,   38,
-       54,   38,   65,   38,   38,   60,   66,   38,   84,   69,
-       61,   55,   71,   72,   73,   46,   75,   85,   74,  214,
-       67,   70,   86,   86,  215,   68,   50,   87,  383,   88,
-
-       88,   38,   38,   38,   39,   40,   38,   38,   38,   38,
-       38,   38,  169,   38,  148,   38,   38,   52,   76,   38,
-      107,   77,   65,   69,   82,  382,   66,   89,   89,   48,
-       53,   90,   90,   91,  107,   70,   94,  108,  155,   80,
-       67,  110,   81,   38,   38,   68,   95,  118,  119,  129,
-      129,  125,   85,   85,  130,  130,   87,  379,  131,  131,
-      132,  378,  133,  133,   48,  143,  134,  134,  135,  135,
-      144,  143,  156,  143,  143,  110,  144,  143,  144,  144,
-      143,  173,  144,  143,  145,  144,  174,  174,  144,  175,
-      150,  176,  176,  159,   87,  376,  177,  177,  178,  178,
-
-      109,  132,  375,  179,  179,  182,  182,  155,  157,  160,
-      207,  164,  374,  161,  180,  180,  373,  181,  181,  188,
-      173,  173,  224,  224,  144,  175,  235,  225,  225,  177,
-      177,  226,   85,  227,  227,  181,  181,  228,  228,  237,
-      189,  249,  271,  271,  205,  236,  190,  250,  273,  273,
-      205,  238,  191,  192,  251,  193,  252,  207,  269,  207,
-      270,  270,  226,  143,  272,  272,  143,  372,  144,  292,
-      249,  144,  293,  205,  311,  204,  143,  292,  371,  292,
-      293,  144,  293,  312,  206,  293,  205,  292,  306,  306,
-      293,  308,  308,  293,  370,  293,  285,  368,  251,  288,
-
-      294,  207,  269,  293,  307,  307,  309,  309,  294,  297,
-      294,  143,  143,  365,  143,  143,  144,  144,  294,  144,
-      144,  143,  143,  143,  143,  292,  144,  144,  144,  144,
-      315,  316,  143,  292,  318,  292,  249,  144,  293,  205,
-      332,  332,  251,  292,  294,  207,  293,  364,  293,  317,
-      362,  321,  294,  319,  294,  320,  293,  361,  143,  143,
-      333,  333,  294,  144,  144,  173,  360,  143,  143,  143,
-      334,  334,  144,  144,  144,  351,  351,  352,  352,  143,
-      143,  143,  143,  143,  144,  144,  144,  144,  144,  143,
-      143,  143,  327,  143,  144,  144,  144,  143,  144,  143,
-
-      346,  347,  144,  143,  144,  143,  143,  143,  144,  359,
-      144,  144,  144,  143,  363,  366,  367,  358,  144,  143,
-      143,  357,  369,  356,  144,  144,  355,  354,  353,  350,
-      349,  348,  377,  345,  344,  343,  380,  342,  381,  341,
-      340,  339,  338,  337,  336,  335,  269,  331,  330,  329,
-      328,  326,  384,   41,   41,   41,   41,   41,   44,  325,
-       44,   44,   44,  109,  109,  109,  204,  204,  204,  206,
-      206,  206,  206,  324,  323,  322,  314,  313,  310,  226,
-      305,  304,  303,  302,  301,  300,  299,  298,  296,  295,
-      291,  290,  289,  287,  286,  284,  283,  282,  281,  280,
-
-      279,  278,  277,  276,  275,  274,  175,  268,  267,  266,
-      265,  264,  263,  262,  261,  260,  259,  258,  257,  256,
-      255,  254,  253,  248,  247,  246,  245,  244,  243,  242,
-      241,  240,  194,  239,  234,  233,  232,  231,  230,  229,
-      132,  223,  222,  221,  220,  219,  218,  217,  216,  213,
-      212,  211,  210,  209,  208,  205,  203,  202,  201,  200,
-      199,  198,  197,  196,  195,  194,  187,  186,  185,  184,
-      183,  172,  171,  170,  168,  167,  166,  165,  163,  162,
-      158,  154,  153,  152,  151,  149,  148,  147,  146,  142,
-      141,  140,  139,  138,  137,  136,   83,  128,  127,  126,
-
-      124,  123,  122,  121,  120,  117,  116,  115,  114,  113,
-      112,  111,  110,  106,  105,  104,  103,  102,  101,  100,
-       99,   98,   97,   96,   93,   92,   83,   79,   78,   64,
-       63,   62,   59,   58,   57,   56,   51,   50,  385,    5,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385
-    } ;
-
-static yyconst short int yy_chk[683] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    2,   16,    7,    2,    7,   10,   10,   11,
-       11,   12,    2,   12,   12,   42,   16,   42,    2,    2,
-        2,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-       17,    3,   26,    3,    3,   22,   26,    3,  389,   27,
-       22,   17,   28,   28,   29,  388,   32,   45,   29,  163,
-       26,   27,   45,   45,  163,   26,   32,   47,  379,   47,
-
-       47,    3,    3,    4,    4,    4,    4,    4,    4,    4,
-        4,    4,  124,    4,  124,    4,    4,   33,   33,    4,
-       64,   33,   36,   37,   37,  378,   36,   48,   48,   49,
-       33,   49,   49,   49,   79,   37,   52,   64,  109,   36,
-       36,  109,   36,    4,    4,   36,   52,   73,   73,   85,
-       85,   79,   86,   86,   87,   87,   88,  374,   88,   88,
-       89,  372,   89,   89,   90,   99,   90,   90,   91,   91,
-       99,  104,  110,  111,  113,  110,  104,  114,  111,  113,
-      115,  129,  114,  118,   99,  115,  129,  129,  118,  130,
-      104,  130,  130,  113,  131,  370,  131,  131,  132,  132,
-
-      110,  133,  368,  133,  133,  135,  135,  156,  111,  114,
-      156,  118,  365,  115,  134,  134,  364,  134,  134,  143,
-      174,  174,  175,  175,  143,  176,  191,  176,  176,  177,
-      177,  178,  180,  178,  178,  181,  181,  180,  180,  192,
-      143,  204,  226,  226,  204,  191,  143,  205,  228,  228,
-      205,  192,  143,  143,  206,  143,  207,  206,  224,  207,
-      224,  224,  227,  240,  227,  227,  245,  362,  240,  249,
-      250,  245,  250,  250,  275,  205,  255,  249,  361,  249,
-      250,  255,  250,  275,  207,  251,  251,  249,  269,  269,
-      250,  271,  271,  251,  360,  251,  240,  358,  252,  245,
-
-      252,  252,  270,  251,  270,  270,  273,  273,  252,  255,
-      252,  278,  279,  355,  280,  281,  278,  279,  252,  280,
-      281,  282,  283,  284,  285,  292,  282,  283,  284,  285,
-      278,  279,  288,  292,  281,  292,  293,  288,  293,  293,
-      306,  306,  294,  292,  294,  294,  293,  350,  293,  280,
-      345,  284,  294,  282,  294,  283,  293,  344,  297,  299,
-      308,  308,  294,  297,  299,  309,  343,  324,  326,  327,
-      309,  309,  324,  326,  327,  332,  332,  334,  334,  346,
-      347,  349,  356,  357,  346,  347,  349,  356,  357,  359,
-      363,  366,  299,  367,  359,  363,  366,  369,  367,  371,
-
-      324,  326,  369,  375,  371,  376,  377,  380,  375,  342,
-      376,  377,  380,  381,  349,  356,  357,  341,  381,  382,
-      384,  340,  359,  339,  382,  384,  338,  337,  336,  331,
-      330,  329,  371,  321,  320,  319,  375,  318,  376,  317,
-      316,  315,  314,  313,  312,  310,  307,  304,  303,  302,
-      301,  298,  382,  386,  386,  386,  386,  386,  387,  296,
-      387,  387,  387,  390,  390,  390,  391,  391,  391,  392,
-      392,  392,  392,  295,  290,  287,  277,  276,  274,  272,
-      267,  265,  261,  260,  259,  258,  257,  256,  254,  253,
-      248,  247,  246,  244,  243,  239,  238,  237,  236,  235,
-
-      234,  233,  232,  231,  230,  229,  225,  223,  222,  221,
-      220,  219,  218,  217,  216,  215,  214,  213,  212,  211,
-      210,  209,  208,  203,  202,  201,  200,  199,  198,  197,
-      196,  195,  194,  193,  190,  189,  187,  186,  184,  183,
-      179,  171,  170,  169,  168,  167,  166,  165,  164,  162,
-      161,  160,  159,  158,  157,  155,  154,  153,  151,  150,
-      149,  148,  147,  146,  145,  144,  142,  140,  138,  137,
-      136,  128,  126,  125,  123,  122,  120,  119,  117,  116,
-      112,  108,  107,  106,  105,  103,  102,  101,  100,   98,
-       97,   96,   95,   94,   93,   92,   83,   82,   81,   80,
-
-       78,   77,   76,   75,   74,   72,   71,   70,   69,   68,
-       67,   66,   65,   63,   62,   61,   60,   59,   58,   57,
-       56,   55,   54,   53,   51,   50,   39,   35,   34,   25,
-       24,   23,   21,   20,   19,   18,   15,   14,    5,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385
-    } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "sg.l"
-#define INITIAL 0
-/*
-  By accepting this notice, you agree to be bound by the following
-  agreements:
-  
-  This software product, squidGuard, is copyrighted (C) 1998 by
-  ElTele ěst AS, Oslo, Norway, with all rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License (version 2) as
-  published by the Free Software Foundation.  It 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 (GPL) for more details.
-  
-  You should have received a copy of the GNU General Public License
-  (GPL) along with this program.
-*/
-#line 20 "sg.l"
-
-#include "y.tab.h"
-#include "sg.h"
-
-#define REDIRECT_STATE 1
-
-#line 666 "lex.yy.c"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( yy_current_buffer->yy_is_interactive ) \
-		{ \
-		int c = '*', n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-		  && ferror( yyin ) ) \
-		YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	if ( yyleng > 0 ) \
-		yy_current_buffer->yy_at_bol = \
-				(yytext[yyleng - 1] == '\n'); \
-	YY_USER_ACTION
-
-YY_DECL
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-
-#line 37 "sg.l"
-
-
-#line 823 "lex.yy.c"
-
-	if ( yy_init )
-		{
-		yy_init = 0;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = yy_start;
-		yy_current_state += YY_AT_BOL();
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			if ( yy_accept[yy_current_state] )
-				{
-				yy_last_accepting_state = yy_current_state;
-				yy_last_accepting_cpos = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 386 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			++yy_cp;
-			}
-		while ( yy_base[yy_current_state] != 640 );
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-		if ( yy_act == 0 )
-			{ /* have to back up */
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
-			yy_act = yy_accept[yy_current_state];
-			}
-
-		YY_DO_BEFORE_ACTION;
-
-
-do_action:	/* This label is used only to access EOF actions. */
-
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yy_hold_char;
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
-			goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 39 "sg.l"
-;
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 40 "sg.l"
-return START_BRACKET;
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 41 "sg.l"
-return STOP_BRACKET; 
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 42 "sg.l"
-return DESTINATION;
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 43 "sg.l"
-return DESTINATION;
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 44 "sg.l"
-return SOURCE;
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 45 "sg.l"
-return SOURCE;
-	YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 46 "sg.l"
-return REWRITE;
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 47 "sg.l"
-return REWRITE;
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 48 "sg.l"
-return TIME;
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 49 "sg.l"
-return ACL;
-	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 50 "sg.l"
-{yylval.string = yytext ; return DBHOME ;}
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 51 "sg.l"
-{yylval.string = yytext ; return LOGDIR ;}
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 52 "sg.l"
-return DOMAINLIST;
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 53 "sg.l"
-return URLLIST;
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 54 "sg.l"
-return EXPRESSIONLIST;
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 55 "sg.l"
-return IPLIST;
-	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 56 "sg.l"
-return USER;
-	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 57 "sg.l"
-return USERLIST;
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 58 "sg.l"
-return USERQUOTA;
-	YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 59 "sg.l"
-return DOMAIN;
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 60 "sg.l"
-return PASS;
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 61 "sg.l"
-return REWRITE;
-	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 62 "sg.l"
-{ BEGIN REDIRECT_STATE; return REDIRECT; }
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 63 "sg.l"
-return MINUTELY;
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 64 "sg.l"
-return HOURLY;
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 65 "sg.l"
-return DAILY;
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 66 "sg.l"
-return WEEKLY;
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 67 "sg.l"
-return CONTINIOUS;
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 68 "sg.l"
-return CONTINUE;
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 69 "sg.l"
-return SPORADIC;
-	YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 70 "sg.l"
-return DATE;
-	YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 71 "sg.l"
-return ANONYMOUS;
-	YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 72 "sg.l"
-return LOGFILE;
-	YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 73 "sg.l"
-return LOGFILE;
-	YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 74 "sg.l"
-{yylval.string = yytext; return WEEKDAY;}
-	YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 75 "sg.l"
-return WITHIN;
-	YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 76 "sg.l"
-return OUTSIDE;
-	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 77 "sg.l"
-return ELSE;
-	YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 78 "sg.l"
-return IP;
-	YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 79 "sg.l"
-{yylval.string = yytext; return IPADDR;}
-	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 80 "sg.l"
-{yylval.string = yytext; return CIDR;}
-	YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 81 "sg.l"
-{yylval.string = yytext; return IPCLASS;}
-	YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 82 "sg.l"
-{yylval.string = yytext; return TVAL;}
-	YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 83 "sg.l"
-{yylval.string = yytext; return DVAL;}
-	YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 84 "sg.l"
-{yylval.string = yytext; return DVALCRON;}
-	YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 85 "sg.l"
-{yylval.string = yytext; return NUMBER;}
-	YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 87 "sg.l"
-{ yylval.string = yytext ; BEGIN 0; return WORD;}
-	YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 88 "sg.l"
-;
-	YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 89 "sg.l"
-{lineno++;}
-	YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 90 "sg.l"
-{return yytext[0];}
-	YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 91 "sg.l"
-{yylval.string = yytext ; return WORD;}
-	YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 92 "sg.l"
-{yylval.string = yytext; return SUBST;}
-	YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 93 "sg.l"
-;
-	YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 94 "sg.l"
-{lineno++;}
-	YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 95 "sg.l"
-{return yytext[0];}
-	YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 98 "sg.l"
-ECHO;
-	YY_BREAK
-#line 1192 "lex.yy.c"
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(REDIRECT_STATE):
-	yyterminate();
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = yy_c_buf_p;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer() )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-	} /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
-	else
-		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
-
-			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
-						number_to_move - 1;
-#endif
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	if ( yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
-	return ret_val;
-	}
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-
-	yy_current_state = yy_start;
-	yy_current_state += YY_AT_BOL();
-
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			yy_last_accepting_state = yy_current_state;
-			yy_last_accepting_cpos = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 386 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
-
-	return yy_current_state;
-	}
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-	{
-	register int yy_is_jam;
-	register char *yy_cp = yy_c_buf_p;
-
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		yy_last_accepting_state = yy_current_state;
-		yy_last_accepting_cpos = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 386 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 385);
-
-	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-	{
-	register char *yy_cp = yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
-		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-#endif	/* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
-	{
-	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
-	yy_current_buffer->yy_at_bol = (c == '\n');
-
-	return c;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-	{
-	if ( yy_current_buffer == new_buffer )
-		return;
-
-	if ( yy_current_buffer )
-		{
-		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-	{
-	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer( b, file );
-
-	return b;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-	{
-	if ( ! b )
-		return;
-
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-	{
-	yy_flush_buffer( b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
-#else
-	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
-	{
-	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
-	}
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-	{
-	YY_BUFFER_STATE b;
-
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	yy_switch_to_buffer( b );
-
-	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-	{
-	int len;
-	for ( len = 0; yy_str[len]; ++len )
-		;
-
-	return yy_scan_bytes( yy_str, len );
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-	{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = len + 2;
-	buf = (char *) yy_flex_alloc( n );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < len; ++i )
-		buf[i] = bytes[i];
-
-	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer( buf, n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
-	{
-	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-	}
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
-		} \
-	while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-	}
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-	}
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
-	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
-#line 98 "sg.l"
-
-
-
-
diff -urN squidGuard-1.2.0/src/main.c squidGuard-1.2.0-patched/src/main.c
--- squidGuard-1.2.0/src/main.c	2001-06-14 02:56:54.000000000 -0400
+++ squidGuard-1.2.0-patched/src/main.c	2004-12-02 15:57:23.000000000 -0500
@@ -19,34 +19,33 @@
 #include "sg.h"
 
 struct Setting *lastSetting = NULL;
-struct Setting *Setting = NULL;
+struct Setting *Setting = NULL;			/* linked list, Calloc */
 
 struct Source *lastSource = NULL;
-struct Source *Source = NULL;
-struct Source *saveSource = NULL;
+struct Source *Source = NULL;			/* linked list, Calloc */
 
 struct Destination *lastDest = NULL;
-struct Destination *Dest = NULL;
+struct Destination *Dest = NULL;		/* linked list, Calloc */
 
 struct sgRewrite *lastRewrite = NULL;
-struct sgRewrite *Rewrite = NULL;
+struct sgRewrite *Rewrite = NULL;		/* linked list, Calloc */
 struct sgRegExp *lastRewriteRegExec = NULL;
 
 struct Time *lastTime = NULL;
-struct Time *Time = NULL;
+struct Time *Time = NULL;			/* linked list, Calloc */
 
 struct LogFileStat *globalErrorLog = NULL;
 struct LogFile *globalLogFile = NULL;
 
 struct LogFileStat *lastLogFileStat;
-struct LogFileStat *LogFileStat;
+struct LogFileStat *LogFileStat;		/* linked list, Calloc */
 
 struct TimeElement *lastTimeElement = NULL;
 struct TimeElement *TimeElement = NULL;
 
 struct Acl *lastAcl = NULL;
 struct Acl *defaultAcl = NULL;
-struct Acl *Acl = NULL;
+struct Acl *Acl = NULL;				/* linked list, Calloc */
 struct AclDest *lastAclDest = NULL;
 
 struct sgRegExp *lastRegExpDest;
@@ -181,6 +180,7 @@
 	src = Source;
 	for(;;){
 	  strncpy(tmp,squidInfo.src,MAX_BUF-1);
+	  tmp[MAX_BUF-1] = 0;   /* force null termination */
 	  globalLogFile = NULL;
 	  src = sgFindSource(src, tmp,squidInfo.ident,squidInfo.srcDomain);
 	  acl = sgAclCheckSource(src);
diff -urN squidGuard-1.2.0/src/main.c.leh squidGuard-1.2.0-patched/src/main.c.leh
--- squidGuard-1.2.0/src/main.c.leh	2001-05-28 10:08:53.000000000 -0400
+++ squidGuard-1.2.0-patched/src/main.c.leh	1969-12-31 19:00:00.000000000 -0500
@@ -1,240 +0,0 @@
-/*
-  By accepting this notice, you agree to be bound by the following
-  agreements:
-  
-  This software product, squidGuard, is copyrighted (C) 1998 by
-  ElTele ěst AS, Oslo, Norway, with all rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License (version 2) as
-  published by the Free Software Foundation.  It 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 (GPL) for more details.
-  
-  You should have received a copy of the GNU General Public License
-  (GPL) along with this program.
-*/
-
-#include "sg.h"
-
-struct Setting *lastSetting = NULL;
-struct Setting *Setting = NULL;
-
-struct Source *lastSource = NULL;
-struct Source *Source = NULL;
-
-struct Destination *lastDest = NULL;
-struct Destination *Dest = NULL;
-
-struct sgRewrite *lastRewrite = NULL;
-struct sgRewrite *Rewrite = NULL;
-struct sgRegExp *lastRewriteRegExec = NULL;
-
-struct Time *lastTime = NULL;
-struct Time *Time = NULL;
-
-struct LogFileStat *globalErrorLog = NULL;
-struct LogFile *globalLogFile = NULL;
-
-struct LogFileStat *lastLogFileStat;
-struct LogFileStat *LogFileStat;
-
-struct TimeElement *lastTimeElement = NULL;
-struct TimeElement *TimeElement = NULL;
-
-struct Acl *lastAcl = NULL;
-struct Acl *defaultAcl = NULL;
-struct Acl *Acl = NULL;
-struct AclDest *lastAclDest = NULL;
-
-struct sgRegExp *lastRegExpDest;
-
-struct Source *lastActiveSource;
-
-char **globalArgv ;
-char **globalEnvp ;
-int globalDebugTimeDelta = 0;
-int globalDebug = 0;
-int globalPid = 0;
-int globalUpdate = 0;
-char *globalCreateDb = NULL;
-int failsafe_mode = 0;
-int sig_hup = 0;
-int sig_alrm = 0;
-int sgtime = 0;
-char *globalLogDir = NULL;
-
-
-#if __STDC__
-int main(int    argc,
-         char   **argv,
-	 char   **envp)
-#else
-int main(argc, argv)
-     int argc;
-     char *argv[],
-     char *envp[];
-#endif
-{
-  int ch;
-  struct SquidInfo squidInfo;
-  struct Source *src;
-  struct Acl *acl;
-  struct timeval start_time,ready_time,stop_time;
-  char buf[MAX_BUF];
-  char *redirect,tmp[MAX_BUF];
-  char *configFile = NULL;
-  time_t t;
-#if HAVE_SIGACTION
-  struct sigaction act;
-#endif
-  gettimeofday(&start_time, NULL);
-  progname = argv[0];
-  globalPid = getpid();
-  while ((ch = getopt(argc, argv, "hduC:t:c:v")) != EOF)
-    switch (ch) {
-    case 'd':
-       globalDebug = 1;
-      break;
-    case 'c':
-      configFile = optarg;
-      break;
-    case 'C':
-      globalCreateDb = optarg;
-      break;
-    case 'u':
-      globalUpdate = 1;
-      break;
-    case 'v':
-      fprintf(stderr, "SquidGuard: %s %s\n", VERSION,db_version(NULL,NULL,NULL));
-      exit(0);
-      break;
-    case 't':
-      if((t = iso2sec(optarg)) == -1){
-	fprintf(stderr,"-t dateformat error, should be yyyy-mm-ddTHH:MM:SS\n");
-	exit(0);
-      }
-      if(t < 0){
-	fprintf(stderr,"-t date have to after 1970-01-01T01:00:00\n");
-	exit(0);
-      }
-      sgLogError("squidGuard emulating date %s", niso(t));
-      globalDebugTimeDelta = t - start_time.tv_sec;
-      start_time.tv_sec = start_time.tv_sec + globalDebugTimeDelta;
-      break;
-    case '?':
-    case 'h':
-    default:
-      usage();
-    }
-  globalArgv = argv;
-  globalEnvp = envp;
-  sgSetGlobalErrorLogFile();
-  sgReadConfig(configFile);
-  sgSetGlobalErrorLogFile();
-  sgLogError("squidGuard %s started (%d.%03d)",
-	     VERSION, start_time.tv_sec, start_time.tv_usec/1000);
-  if(globalUpdate || globalCreateDb != NULL){
-    sgLogError("db update done");
-    gettimeofday(&stop_time, NULL);
-    stop_time.tv_sec = stop_time.tv_sec + globalDebugTimeDelta;
-    sgLogError("squidGuard stopped (%d.%03d)",stop_time.tv_sec,stop_time.tv_usec/1000);
-    exit(0);
-  }
-  sgTimeElementSortEvents();
-  sgTimeNextEvent();
-#if HAVE_SIGACTION
-#ifndef SA_NODEFER
-#define SA_NODEFER 0
-#endif
-  act.sa_handler = sgHandlerSigHUP;
-  act.sa_flags = SA_NODEFER | SA_RESTART;
-  sigaction(SIGHUP, &act, NULL);
-#else
-#if HAVE_SIGNAL
-  signal(SIGHUP, sgHandlerSigHUP);
-#else
-#endif
-#endif
-  gettimeofday(&ready_time, NULL);
-  ready_time.tv_sec = ready_time.tv_sec + globalDebugTimeDelta;
-  sgLogError("squidGuard ready for requests (%d.%03d)",
-	     ready_time.tv_sec, ready_time.tv_usec/1000);
-  tmp[MAX_BUF-1] = '\0';
-  while(1) {
-    while(fgets(buf, MAX_BUF, stdin) != NULL){
-      if(sig_hup)
-	sgReloadConfig();
-      if(failsafe_mode) {
-	puts("");
-	fflush(stdout);
-	if(sig_hup)
-          sgReloadConfig();
-	continue;
-      }
-      if(parseLine(buf,&squidInfo) != 1){
-	sgLogError("error parsing squid line: %s",buf);
-	puts("");
-      } else {
-	strncpy(tmp,squidInfo.src,MAX_BUF-1);
-	globalLogFile = NULL;
-	src = sgFindSource(tmp,squidInfo.ident,squidInfo.srcDomain);
-	acl = sgAclCheckSource(src);
-	if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){
-	  puts("");
-	} else {
-	  if(squidInfo.srcDomain[0] == '\0'){
-	    squidInfo.srcDomain[0] = '-';
-	    squidInfo.srcDomain[1] = '\0';
-          }
-          if(squidInfo.ident[0] == '\0'){
-	    squidInfo.ident[0] = '-';
-	    squidInfo.ident[1] = '\0';
-          }
-	  fprintf(stdout,"%s %s/%s %s %s\n",redirect,squidInfo.src,
-		  squidInfo.srcDomain,squidInfo.ident,
-		  squidInfo.method);
-	}
-      }
-      fflush(stdout);
-      if(sig_hup)
-        sgReloadConfig();
-    }
-#if !HAVE_SIGACTION
-#if HAVE_SIGNAL
-    if(errno != EINTR){
-      gettimeofday(&stop_time, NULL);
-      stop_time.tv_sec = stop_time.tv_sec + globalDebugTimeDelta;
-      sgLogError("squidGuard stopped (%d.%03d)",stop_time.tv_sec,stop_time.tv_usec/1000);
-      exit(2);
-    }
-#endif
-#else 
-    gettimeofday(&stop_time, NULL);
-    stop_time.tv_sec = stop_time.tv_sec + globalDebugTimeDelta;
-    sgLogError("squidGuard stopped (%d.%03d)",stop_time.tv_sec,stop_time.tv_usec/1000);
-    exit(0);
-#endif
-  }
-  exit(0);
-}
-
-#if __STDC__
-void usage()
-#else
-void usage()
-#endif
-{
-  fprintf(stderr, 
-	  "Usage: squidGuard [-u] [-C block] [-t time] [-c file] [-v] [-d]\n");
-  fprintf(stderr, "Options:\n");
-  fprintf(stderr, "  -v          : show version number\n");
-  fprintf(stderr, "  -d          : all errors to stderr\n");
-  fprintf(stderr, "  -c file     : load alternate configfile\n");
-  fprintf(stderr, "  -t time     : specify staruptime on format: yyyy-mm-ddTHH:MM:SS\n");
-  fprintf(stderr, "  -u          : update .db files from .diff files\n");
-  fprintf(stderr, "  -C file|all : create new .db files from urls/domain files\n");
-  fprintf(stderr, "                specified in \"file\".\n");
-  exit(1);
-}
diff -urN squidGuard-1.2.0/src/main.c.new squidGuard-1.2.0-patched/src/main.c.new
--- squidGuard-1.2.0/src/main.c.new	2001-05-30 10:03:59.000000000 -0400
+++ squidGuard-1.2.0-patched/src/main.c.new	1969-12-31 19:00:00.000000000 -0500
@@ -1,250 +0,0 @@
-/*
-  By accepting this notice, you agree to be bound by the following
-  agreements:
-  
-  This software product, squidGuard, is copyrighted (C) 1998 by
-  ElTele ěst AS, Oslo, Norway, with all rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License (version 2) as
-  published by the Free Software Foundation.  It 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 (GPL) for more details.
-  
-  You should have received a copy of the GNU General Public License
-  (GPL) along with this program.
-*/
-
-#include "sg.h"
-
-struct Setting *lastSetting = NULL;
-struct Setting *Setting = NULL;
-
-struct Source *lastSource = NULL;
-struct Source *Source = NULL;
-struct Source *saveSource = NULL;
-
-struct Destination *lastDest = NULL;
-struct Destination *Dest = NULL;
-
-struct sgRewrite *lastRewrite = NULL;
-struct sgRewrite *Rewrite = NULL;
-struct sgRegExp *lastRewriteRegExec = NULL;
-
-struct Time *lastTime = NULL;
-struct Time *Time = NULL;
-
-struct LogFileStat *globalErrorLog = NULL;
-struct LogFile *globalLogFile = NULL;
-
-struct LogFileStat *lastLogFileStat;
-struct LogFileStat *LogFileStat;
-
-struct TimeElement *lastTimeElement = NULL;
-struct TimeElement *TimeElement = NULL;
-
-struct Acl *lastAcl = NULL;
-struct Acl *defaultAcl = NULL;
-struct Acl *Acl = NULL;
-struct AclDest *lastAclDest = NULL;
-
-struct sgRegExp *lastRegExpDest;
-
-struct Source *lastActiveSource;
-
-char **globalArgv ;
-char **globalEnvp ;
-int globalDebugTimeDelta = 0;
-int globalDebug = 0;
-int globalPid = 0;
-int globalUpdate = 0;
-char *globalCreateDb = NULL;
-int failsafe_mode = 0;
-int sig_hup = 0;
-int sig_alrm = 0;
-int sgtime = 0;
-char *globalLogDir = NULL;
-
-
-#if __STDC__
-int main(int    argc,
-         char   **argv,
-	 char   **envp)
-#else
-int main(argc, argv)
-     int argc;
-     char *argv[],
-     char *envp[];
-#endif
-{
-  int ch;
-  struct SquidInfo squidInfo;
-  struct Source *src;
-  struct Acl *acl;
-  struct timeval start_time,ready_time,stop_time;
-  char buf[MAX_BUF];
-  char *redirect,tmp[MAX_BUF];
-  char *configFile = NULL;
-  time_t t;
-#if HAVE_SIGACTION
-  struct sigaction act;
-#endif
-  gettimeofday(&start_time, NULL);
-  progname = argv[0];
-  globalPid = getpid();
-  while ((ch = getopt(argc, argv, "hduC:t:c:v")) != EOF)
-    switch (ch) {
-    case 'd':
-       globalDebug = 1;
-      break;
-    case 'c':
-      configFile = optarg;
-      break;
-    case 'C':
-      globalCreateDb = optarg;
-      break;
-    case 'u':
-      globalUpdate = 1;
-      break;
-    case 'v':
-      fprintf(stderr, "SquidGuard: %s %s\n", VERSION,db_version(NULL,NULL,NULL));
-      exit(0);
-      break;
-    case 't':
-      if((t = iso2sec(optarg)) == -1){
-	fprintf(stderr,"-t dateformat error, should be yyyy-mm-ddTHH:MM:SS\n");
-	exit(0);
-      }
-      if(t < 0){
-	fprintf(stderr,"-t date have to after 1970-01-01T01:00:00\n");
-	exit(0);
-      }
-      sgLogError("squidGuard emulating date %s", niso(t));
-      globalDebugTimeDelta = t - start_time.tv_sec;
-      start_time.tv_sec = start_time.tv_sec + globalDebugTimeDelta;
-      break;
-    case '?':
-    case 'h':
-    default:
-      usage();
-    }
-  globalArgv = argv;
-  globalEnvp = envp;
-  sgSetGlobalErrorLogFile();
-  sgReadConfig(configFile);
-  sgSetGlobalErrorLogFile();
-  sgLogError("squidGuard %s started (%d.%03d)",
-	     VERSION, start_time.tv_sec, start_time.tv_usec/1000);
-  if(globalUpdate || globalCreateDb != NULL){
-    sgLogError("db update done");
-    gettimeofday(&stop_time, NULL);
-    stop_time.tv_sec = stop_time.tv_sec + globalDebugTimeDelta;
-    sgLogError("squidGuard stopped (%d.%03d)",stop_time.tv_sec,stop_time.tv_usec/1000);
-    exit(0);
-  }
-  sgTimeElementSortEvents();
-  sgTimeNextEvent();
-#if HAVE_SIGACTION
-#ifndef SA_NODEFER
-#define SA_NODEFER 0
-#endif
-  act.sa_handler = sgHandlerSigHUP;
-  act.sa_flags = SA_NODEFER | SA_RESTART;
-  sigaction(SIGHUP, &act, NULL);
-#else
-#if HAVE_SIGNAL
-  signal(SIGHUP, sgHandlerSigHUP);
-#else
-#endif
-#endif
-  gettimeofday(&ready_time, NULL);
-  ready_time.tv_sec = ready_time.tv_sec + globalDebugTimeDelta;
-  sgLogError("squidGuard ready for requests (%d.%03d)",
-	     ready_time.tv_sec, ready_time.tv_usec/1000);
-  tmp[MAX_BUF-1] = '\0';
-  while(1) {
-    while(fgets(buf, MAX_BUF, stdin) != NULL){
-      if(sig_hup)
-	sgReloadConfig();
-      if(failsafe_mode) {
-	puts("");
-	fflush(stdout);
-	if(sig_hup)
-          sgReloadConfig();
-	continue;
-      }
-      if(parseLine(buf,&squidInfo) != 1){
-	sgLogError("error parsing squid line: %s",buf);
-	puts("");
-      } else {
-	saveSource=Source;
-	for(;;){
-	  strncpy(tmp,squidInfo.src,MAX_BUF-1);
-	  globalLogFile = NULL;
-	  src = sgFindSource(tmp,squidInfo.ident,squidInfo.srcDomain);
-	  acl = sgAclCheckSource(src);
-	  if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){
-	    /*	  puts(""); */
-	  } else {
-	    if(squidInfo.srcDomain[0] == '\0'){
-	      squidInfo.srcDomain[0] = '-';
-	      squidInfo.srcDomain[1] = '\0';
-	    }
-	    if(squidInfo.ident[0] == '\0'){
-	      squidInfo.ident[0] = '-';
-	      squidInfo.ident[1] = '\0';
-	    }
-	    fprintf(stdout,"%s %s/%s %s %s\n",redirect,squidInfo.src,
-		    squidInfo.srcDomain,squidInfo.ident,
-		    squidInfo.method);
-	  }
-	  if(src==NULL) {
-	    Source=saveSource;
-	    if(redirect==NULL) puts("");
-	    break;
-	  }
-	  Source=src->next;
-	} /*for(;;)*/
-      }
-      fflush(stdout);
-      if(sig_hup)
-        sgReloadConfig();
-    }
-#if !HAVE_SIGACTION
-#if HAVE_SIGNAL
-    if(errno != EINTR){
-      gettimeofday(&stop_time, NULL);
-      stop_time.tv_sec = stop_time.tv_sec + globalDebugTimeDelta;
-      sgLogError("squidGuard stopped (%d.%03d)",stop_time.tv_sec,stop_time.tv_usec/1000);
-      exit(2);
-    }
-#endif
-#else 
-    gettimeofday(&stop_time, NULL);
-    stop_time.tv_sec = stop_time.tv_sec + globalDebugTimeDelta;
-    sgLogError("squidGuard stopped (%d.%03d)",stop_time.tv_sec,stop_time.tv_usec/1000);
-    exit(0);
-#endif
-  }
-  exit(0);
-}
-
-#if __STDC__
-void usage()
-#else
-void usage()
-#endif
-{
-  fprintf(stderr, 
-	  "Usage: squidGuard [-u] [-C block] [-t time] [-c file] [-v] [-d]\n");
-  fprintf(stderr, "Options:\n");
-  fprintf(stderr, "  -v          : show version number\n");
-  fprintf(stderr, "  -d          : all errors to stderr\n");
-  fprintf(stderr, "  -c file     : load alternate configfile\n");
-  fprintf(stderr, "  -t time     : specify staruptime on format: yyyy-mm-ddTHH:MM:SS\n");
-  fprintf(stderr, "  -u          : update .db files from .diff files\n");
-  fprintf(stderr, "  -C file|all : create new .db files from urls/domain files\n");
-  fprintf(stderr, "                specified in \"file\".\n");
-  exit(1);
-}
diff -urN squidGuard-1.2.0/src/sg.h.in squidGuard-1.2.0-patched/src/sg.h.in
--- squidGuard-1.2.0/src/sg.h.in	2001-06-01 09:18:31.000000000 -0400
+++ squidGuard-1.2.0-patched/src/sg.h.in	2004-12-02 15:57:42.000000000 -0500
@@ -68,6 +68,10 @@
 #define ACL_TYPE_TERMINATOR 2
 #define ACL_TYPE_INADDR     3
 
+#define REQUEST_TYPE_REWRITE    1
+#define REQUEST_TYPE_REDIRECT   2
+#define REQUEST_TYPE_PASS       3
+
 #define MAX_BUF 4096
 
 #define DEFAULT_LOGFILE "squidGuard.log"
@@ -123,6 +127,7 @@
   char *parent_name;
   int parent_type;
   int anonymous;
+  int verbose;
   struct LogFileStat *stat;
 };
 
@@ -131,11 +136,17 @@
   struct SquidQueue *next;
 };
 
-struct UserQuotaInfo {
+struct UserInfo {
+  /* quota tracking */
   time_t time;
   time_t last;
   int consumed;
   char status;
+
+  /* LDAP tracking */
+  int ldapuser;			/* bool: 1 if user loaded from LDAP */
+  int found;			/* bool: we also cache if not found in LDAP */
+  time_t cachetime;		/* time this item was added to cache */
 };
 
 struct UserQuota {
@@ -192,8 +203,10 @@
   DBC *dbcp;
   DB_ENV *dbenv;
 #ifndef DB_VERSION_GT2
+#ifndef DB_VERSION_GT4
   DB_INFO dbinfo;
 #endif
+#endif
   DBT key;
   DBT data;
   int entries;	
@@ -263,6 +276,8 @@
   int cont_search;
   struct UserQuota userquota;
   struct LogFile *logfile;
+  char **ldapurls;			/* dynamic array of url strings */
+  int ldapurlcount;			/* current size of pointer array */
   struct Source *next;
 };
 
@@ -295,7 +310,7 @@
 char   *sgParseRedirect	__P((char *, struct SquidInfo *, struct Acl *, struct AclDest *));
 char   *sgAclAccess __P((struct Source *, struct Acl *, struct SquidInfo *));
 
-void   sgLogFile __P((int, int, char *));
+void   sgLogFile __P((int, int, int, char *));
 struct LogFileStat *sgLogFileStat __P((char *));
 
 void   sgReadConfig __P((char *));
@@ -303,7 +318,7 @@
 void   sgLogError __P((char *, ...));
 void   sgLogFatalError __P((char *, ...));
 void   sgSetGlobalErrorLogFile __P(());
-void   sgLogRequest __P((struct LogFile *, struct SquidInfo *, struct Acl *, struct AclDest *, struct sgRewrite *));
+void   sgLogRequest __P((struct LogFile *, struct SquidInfo *, struct Acl *, struct AclDest *, struct sgRewrite *, int));
 int    parseLine __P((char *, struct SquidInfo *));
 char   *sgStripUrl __P((char *));
 
@@ -321,6 +336,8 @@
 void   sgSourceEnd __P(());
 void   sgSourceUser __P((char *));
 void   sgSourceUserList __P((char *));
+void   sgSourceLdapUserSearch __P((char *));
+void   sgSourceExecUserList __P((char *));
 void   sgSourceDomain __P((char *));
 void   sgSourceIpList __P((char *));
 struct Source *sgSourceFindName __P((char *));
@@ -369,6 +386,7 @@
 struct Acl *sgAclCheckSource __P((struct Source *));
 
 struct sgRegExp *sgNewPatternBuffer __P((char *, int));
+void   sgFreePatternBuffer __P((struct sgRegExp *));
 int    sgRegExpMatch __P((struct sgRegExp *, char *));
 char   *sgRegExpSubst __P((struct sgRegExp *, char *));
 
@@ -376,9 +394,9 @@
 void   sgDbLoadTextFile __P((struct sgDb *, char *, int));
 void   sgDbUpdate __P((struct sgDb *, char *, char *, size_t));
 
-#if DB_VERSION_GT2
+#if DB_VERSION_GT2 || DB_VERSION_GT4
 int db_init __P((char *, DB_ENV **));
-int    domainCompare __P((const DB *, const DBT *, const DBT *));
+int    domainCompare __P((DB *, const DBT *, const DBT *));
 #else
 DB_ENV *db_init __P((char *));
 int    domainCompare __P((const DBT *, const DBT *));
@@ -403,3 +421,19 @@
 void   yyerror __P((char *));
 int    yyparse __P((void));
 int    yylex __P((void));
+void   sgFreeAllLists __P((void));
+void   sgFreeDestination __P((struct Destination *));
+void   sgFreeSource __P((struct Source *));
+void   sgFreeIp __P((struct Ip *));
+void   sgFreeSetting __P((struct Setting *));
+void   sgFreeTime __P((struct Time *));
+void   sgFreeRewrite __P((struct sgRewrite *));
+void   sgFreeAcl __P((struct Acl *));
+void   sgFreeAclDest __P((struct AclDest *));
+void   sgFreeLogFileStat __P((struct LogFileStat *));
+
+int    sgFindUser __P((struct Source *, char *, struct UserInfo **));
+int    sgDoLdapSearch __P((const char *, const char *));
+
+int    expand_url __P((char *, size_t, const char *, const char *));
+
diff -urN squidGuard-1.2.0/src/sg.l squidGuard-1.2.0-patched/src/sg.l
--- squidGuard-1.2.0/src/sg.l	2001-06-01 08:41:28.000000000 -0400
+++ squidGuard-1.2.0-patched/src/sg.l	2004-12-02 15:57:42.000000000 -0500
@@ -33,7 +33,63 @@
 weekday  (mon|mondays?|tue|tuesdays?|wed|wednesdays?|thu|thursdays?|fri|fridays?|sat|saturdays?|sun|sundays?)
 weekdays (({weekday}{s}*[, \t]+{s}*)*{weekday})|[\*]
 
+/* from RFC1779:
+
+<name> ::= <name-component> ( <spaced-separator> )
+          | <name-component> <spaced-separator> <name>
+
+   <spaced-separator> ::= <optional-space>
+                   <separator>
+                   <optional-space>
+
+   <separator> ::=  "," | ";"
+
+   <optional-space> ::= ( <CR> ) *( " " )
+
+   <name-component> ::= <attribute>
+           | <attribute> <optional-space> "+"
+             <optional-space> <name-component>
+
+   <attribute> ::= <string>
+           | <key> <optional-space> "=" <optional-space> <string>
+
+   <key> ::= 1*( <keychar> ) | "OID." <oid> | "oid." <oid>
+   <keychar> ::= letters, numbers, and space
+
+   <oid> ::= <digitstring> | <digitstring> "." <oid>
+   <digitstring> ::= 1*<digit>
+   <digit> ::= digits 0-9
+
+   <string> ::= *( <stringchar> | <pair> )
+            | '"' *( <stringchar> | <special> | <pair> ) '"'
+            | "#" <hex>
+
+   <special> ::= "," | "=" | <CR> | "+" | "<" |  ">"
+            | "#" | ";"
+
+   <pair> ::= "\" ( <special> | "\" | '"')
+   <stringchar> ::= any character except <special> or "\" or '"'
+
+   <hex> ::= 2*<hexchar>
+   <hexchar> ::= 0-9, a-f, A-F
+*/
+
+ldaphexchar		[0-9a-fA-f]
+ldaphex			{ldaphexchar}{ldaphexchar}
+ldapspecial		[,=+<>#;\r\n]
+ldapstringchar		[^,=+<>#;\r\n]
+ldappair		\\({ldapspecial}|\\|\")
+ldapstring		(({ldapstringchar}|{ldappair})*|\"({ldapstringchar}|{ldapspecial}|{ldappair})*\"|#{ldaphex})
+ldapkey			[a-zA-Z0-9][a-zA-Z0-9 ]*
+ldapattribute		{ldapkey}{s}*={s}*{ldapstring}
+ldapnamecomponent	({ldapattribute}{s}*+{s}*)*{ldapattribute}
+ldapspacedseparator	\ *[,;]\ *
+ldapdn			({ldapnamecomponent}{ldapspacedseparator})*{ldapnamecomponent}
+
 %x REDIRECT_STATE
+%x EXEC_STATE
+%x LDAPDN_STATE
+
 %%
 
 [ \t]*#.*        ;
@@ -47,14 +103,27 @@
 ^rewrite     return REWRITE;
 ^time        return TIME;
 ^acl         return ACL;
-^dbhome        {yylval.string = yytext ; return DBHOME ;}
-^logdir       {yylval.string = yytext ; return LOGDIR ;}
+^dbhome		return DBHOME;
+^logdir		return LOGDIR;
+^ldapcachetime	return LDAPCACHETIME;
+^ldapprotover	return LDAPPROTOVER;
+^ldapbinddn	{ BEGIN LDAPDN_STATE; return LDAPBINDDN; }
+^ldapbindpass	return LDAPBINDPASS;
 domainlist  return DOMAINLIST;
 urllist     return URLLIST;
 expressionlist return EXPRESSIONLIST;
 iplist      return IPLIST;
 user        return USER;
 userlist    return USERLIST;
+ldapusersearch {
+	/* use the REDIRECT_STATE logic, since it handles URLs nicely */
+	BEGIN REDIRECT_STATE;
+	return LDAPUSERSEARCH;
+	}
+execuserlist {
+	BEGIN EXEC_STATE;
+	return EXECUSERLIST;
+	}
 userquota   return USERQUOTA;
 domain      return DOMAIN;
 pass        return PASS;
@@ -69,6 +138,7 @@
 sporadic    return SPORADIC;
 date        return DATE;
 anonymous   return ANONYMOUS;
+verbose     return VERBOSE;
 log         return LOGFILE;
 logfile     return LOGFILE;
 {weekdays} {yylval.string = yytext; return WEEKDAY;}
@@ -84,10 +154,17 @@
 {dvalcron}  {yylval.string = yytext; return DVALCRON;}
 {d}+        {yylval.string = yytext; return NUMBER;}
 
-<REDIRECT_STATE>[a-zA-Z3\/][a-zA-Z0-9/_\-\.\/\:\%\+\?=&]*  { yylval.string = yytext ; BEGIN 0; return WORD;}
+<REDIRECT_STATE>[a-zA-Z3\/][a-zA-Z0-9/_\-\.\,\(\)\/\:\%\+\?=&]*  { yylval.string = yytext ; BEGIN 0; return WORD;}
 <REDIRECT_STATE>[ \t]+     ;
 <REDIRECT_STATE>\n        {lineno++;}
 <REDIRECT_STATE>.         {return yytext[0];}
+
+<EXEC_STATE>[^\n]* { yylval.string = yytext; BEGIN 0; return EXECCMD; }
+<EXEC_STATE>\n     {lineno++;}
+
+<LDAPDN_STATE>{ldapdn}	  {yylval.string = yytext; BEGIN 0; return LDAPDNSTR;}
+<LDAPDN_STATE>\n          {lineno++;}
+
 [a-zA-Z\/][a-zA-Z0-9/_\-\.\/\:\%\+\?=&]*  {yylval.string = yytext ; return WORD;}
 s@(([^@}]|\\@|\\\})+)@(([^@}]|\\@|\\\})+)@[girR]* {yylval.string = yytext; return SUBST;}
 [ \t]+     ;
@@ -97,5 +174,3 @@
 
 %%
 
-
-
diff -urN squidGuard-1.2.0/src/sg.y squidGuard-1.2.0-patched/src/sg.y
--- squidGuard-1.2.0/src/sg.y	2001-06-01 09:18:48.000000000 -0400
+++ squidGuard-1.2.0-patched/src/sg.y	2004-12-02 15:57:42.000000000 -0500
@@ -19,47 +19,15 @@
 
 %{
 #include "sg.h"
+#include "lber.h"
+#include "ldap.h"
+#include "sgEx.h"
 
 FILE *yyin, *yyout;
 char *configFile;
 
-extern struct Setting *lastSetting ;
-extern struct Setting *Setting;
-
-extern struct Source *lastSource ;
-extern struct Source *Source ;
-
-extern struct Destination *lastDest ;
-extern struct Destination *Dest ;
-
-extern struct sgRewrite *lastRewrite;
-extern struct sgRewrite *Rewrite;
-extern struct sgRegExp *lastRewriteRegExec;
-
-extern struct Time *lastTime;
-extern struct Time *Time;
-
-extern struct LogFile *globalLogFile;
-
-extern struct LogFileStat *lastLogFileStat;
-extern struct LogFileStat *LogFileStat;
-
-extern struct TimeElement *lastTimeElement;
-extern struct TimeElement *TimeElement;
 int numTimeElements;
 int *TimeElementsEvents;
-extern struct Acl *lastAcl ;
-extern struct Acl *defaultAcl ;
-extern struct Acl *Acl;
-extern struct AclDest *lastAclDest;
- 
-extern struct sgRegExp *lastRegExpDest;
-
-extern char *globalLogDir; /* from main.c */
-
-extern struct Source *lastActiveSource;
-
-extern int globalDebugTimeDelta;
 
 static int time_switch = 0;
 static int date_switch = 0;
@@ -76,16 +44,20 @@
   int  *integer;
 }
 
-%token WORD END START_BRACKET STOP_BRACKET WEEKDAY
+%token WORD END START_BRACKET STOP_BRACKET WEEKDAY LDAPDNSTR
 %token DESTINATION REWRITE ACL TIME TVAL DVAL DVALCRON
 %token SOURCE CIDR IPCLASS CONTINUE
 %token IPADDR DBHOME DOMAINLIST URLLIST EXPRESSIONLIST IPLIST
-%token DOMAIN USER USERLIST USERQUOTA IP NL NUMBER
+%token DOMAIN USER USERLIST LDAPUSERSEARCH USERQUOTA IP NL NUMBER
 %token PASS REDIRECT LOGDIR SUBST CHAR MINUTELY HOURLY DAILY WEEKLY DATE
-%token WITHIN OUTSIDE ELSE LOGFILE ANONYMOUS CONTINIOUS SPORADIC
+%token WITHIN OUTSIDE ELSE LOGFILE ANONYMOUS VERBOSE CONTINIOUS SPORADIC
+%token LDAPCACHETIME EXECUSERLIST EXECCMD LDAPPROTOVER
+%token LDAPBINDDN LDAPBINDPASS
 
 %type <string> WORD 
+%type <string> EXECCMD
 %type <string> WEEKDAY
+%type <string> LDAPDNSTR
 %type <string> NUMBER
 %type <tval> TVAL
 %type <string> DVAL
@@ -116,6 +88,18 @@
 logdir:    LOGDIR WORD { sgSetting("logdir",$2); }
          ;
 
+ldapcachetime: LDAPCACHETIME NUMBER { sgSetting("ldapcachetime",$2); }
+         ;
+
+ldapprotover: LDAPPROTOVER NUMBER {sgSetting("ldapprotover",$2); }
+	;
+
+ldapbinddn: LDAPBINDDN LDAPDNSTR { sgSetting("ldapbinddn",$2); }
+	;
+
+ldapbindpass: LDAPBINDPASS WORD { sgSetting("ldapbindpass",$2); }
+	;
+
 start_block:
                START_BRACKET
 	       ;
@@ -146,8 +130,11 @@
             | REWRITE WORD  {sgDestRewrite($2); }
             | WITHIN WORD { sgDestTime($2,WITHIN); }
             | OUTSIDE WORD { sgDestTime($2,OUTSIDE); }
-            | LOGFILE ANONYMOUS WORD { sgLogFile(SG_BLOCK_DESTINATION,1,$3); }
-            | LOGFILE WORD { sgLogFile(SG_BLOCK_DESTINATION,0,$2); }
+            | LOGFILE ANONYMOUS WORD { sgLogFile(SG_BLOCK_DESTINATION,1,0,$3); }
+            | LOGFILE VERBOSE WORD { sgLogFile(SG_BLOCK_DESTINATION,0,1,$3); }
+            | LOGFILE ANONYMOUS VERBOSE WORD { sgLogFile(SG_BLOCK_DESTINATION,1,1,$4); }
+            | LOGFILE VERBOSE ANONYMOUS WORD { sgLogFile(SG_BLOCK_DESTINATION,1,1,$4); }
+            | LOGFILE WORD { sgLogFile(SG_BLOCK_DESTINATION,0,0,$2); }
             ;
 
 source:      SOURCE WORD { sgSource($2); }
@@ -164,6 +151,8 @@
 source_content:     DOMAIN domain
                     | USER user 
                     | USERLIST WORD { sgSourceUserList($2); } 
+                    | LDAPUSERSEARCH WORD { sgSourceLdapUserSearch($2); } 
+                    | EXECUSERLIST EXECCMD { sgSourceExecUserList($2); }
                     | USERQUOTA NUMBER NUMBER HOURLY { 
 		      sgSourceUserQuota($2,$3,"3600");} 
                     | USERQUOTA NUMBER NUMBER DAILY { 
@@ -176,8 +165,11 @@
                     | IPLIST WORD { sgSourceIpList($2); }
                     | WITHIN WORD { sgSourceTime($2,WITHIN); }
                     | OUTSIDE WORD { sgSourceTime($2,OUTSIDE); }
-                    | LOGFILE ANONYMOUS WORD {sgLogFile(SG_BLOCK_SOURCE,1,$3);}
-                    | LOGFILE WORD { sgLogFile(SG_BLOCK_SOURCE,0,$2); }
+                    | LOGFILE ANONYMOUS WORD {sgLogFile(SG_BLOCK_SOURCE,1,0,$3);}
+                    | LOGFILE VERBOSE WORD {sgLogFile(SG_BLOCK_SOURCE,0,1,$3);}
+                    | LOGFILE ANONYMOUS VERBOSE WORD {sgLogFile(SG_BLOCK_SOURCE,1,1,$4);}
+                    | LOGFILE VERBOSE ANONYMOUS WORD {sgLogFile(SG_BLOCK_SOURCE,1,1,$4);}
+                    | LOGFILE WORD { sgLogFile(SG_BLOCK_SOURCE,0,0,$2); }
                     | CONTINUE { lastSource->cont_search = 1; }
                     ;
 
@@ -217,8 +209,11 @@
 access_content:    PASS access_pass { }
                   | REWRITE WORD { sgAclSetValue("rewrite",$2,0); }
                   | REDIRECT WORD { sgAclSetValue("redirect",$2,0); }
-                  | LOGFILE ANONYMOUS WORD {sgLogFile(SG_BLOCK_ACL,1,$3);}
-                  | LOGFILE WORD { sgLogFile(SG_BLOCK_ACL,0,$2); }
+                  | LOGFILE ANONYMOUS WORD {sgLogFile(SG_BLOCK_ACL,1,0,$3);}
+                  | LOGFILE VERBOSE WORD {sgLogFile(SG_BLOCK_ACL,0,1,$3);}
+                  | LOGFILE ANONYMOUS VERBOSE WORD {sgLogFile(SG_BLOCK_ACL,1,1,$4);}
+                  | LOGFILE VERBOSE ANONYMOUS WORD {sgLogFile(SG_BLOCK_ACL,1,1,$4);}
+                  | LOGFILE WORD { sgLogFile(SG_BLOCK_ACL,0,0,$2); }
                   ;
 
 access_pass:     
@@ -244,6 +239,7 @@
      ;
 
 rew:       REWRITE WORD { sgRewrite($2); }
+           ;
 
 rew_block:  rew start_block rew_contents stop_block 
              ;
@@ -256,12 +252,16 @@
 rew_content:    SUBST  { sgRewriteSubstitute($1); }
                 | WITHIN WORD { sgRewriteTime($2,WITHIN); }
                 | OUTSIDE WORD { sgRewriteTime($2,OUTSIDE); }
-                | LOGFILE ANONYMOUS WORD { sgLogFile(SG_BLOCK_REWRITE,1,$3); }
-                | LOGFILE WORD { sgLogFile(SG_BLOCK_REWRITE,0,$2); }
+                | LOGFILE ANONYMOUS WORD { sgLogFile(SG_BLOCK_REWRITE,1,0,$3); }
+                | LOGFILE VERBOSE WORD { sgLogFile(SG_BLOCK_REWRITE,0,1,$3); }
+                | LOGFILE ANONYMOUS VERBOSE WORD { sgLogFile(SG_BLOCK_REWRITE,1,1,$4); }
+                | LOGFILE VERBOSE ANONYMOUS WORD { sgLogFile(SG_BLOCK_REWRITE,1,1,$4); }
+                | LOGFILE WORD { sgLogFile(SG_BLOCK_REWRITE,0,0,$2); }
                 ;
 
 
 time:       TIME WORD { sgTime($2); }
+            ;
 
 time_block:  time start_block time_contents stop_block 
              ;
@@ -310,6 +310,10 @@
 	     | destination_block
              | dbhome
 	     | logdir
+	     | ldapprotover
+	     | ldapbinddn
+	     | ldapbindpass
+	     | ldapcachetime
 	     | acl_block
 	     | rew_block
 	     | time_block
@@ -348,11 +352,12 @@
 */
 
 #if __STDC__
-void sgLogFile (int block, int anonymous, char *file)
+void sgLogFile (int block, int anonymous, int verbose, char *file)
 #else
-void sgLogFile (block, anonymous, file)
+void sgLogFile (block, anonymous, verbose, file)
      int block;
      int anonymous;
+     int verbose;
      char *file;
 #endif
 {
@@ -388,6 +393,7 @@
     p->parent_name = name;
     p->parent_type = block;
     p->anonymous = anonymous;
+    p->verbose = verbose;
     *v = p;
   } else {
     sgLogError("%s: redefine of logfile %s in line %d",
@@ -501,7 +507,8 @@
 {
  struct Source *s;
  s = lastSource;
- if(s->ip == NULL && s->domainDb == NULL && s->userDb == NULL){
+ if(s->ip == NULL && s->domainDb == NULL && s->userDb == NULL
+ 	&& s->ldapurlcount == 0){
    sgLogError("sourceblock %s missing active content, set inactive",s->name);
    s->time = NULL;
    s->active = 0;
@@ -525,8 +532,10 @@
   }
   for(lc=user; *lc != '\0'; lc++) /* convert username to lowercase chars */
     *lc = tolower(*lc);
-  sgDbUpdate(sp->userDb, user, (char *) setuserquota(),
-	     sizeof(struct UserQuotaInfo));
+  sgDbUpdate(sp->userDb, user, (char *) setuserinfo(),
+	     sizeof(struct UserInfo));
+// DEBUG
+  sgLogError("Added User: %s", user);
 }
 
 #if __STDC__
@@ -579,16 +588,18 @@
       *s = '\0';
       for(lc=line; *lc != '\0'; lc++) /* convert username to lowercase chars */
 	*lc = tolower(*lc);
-      sgDbUpdate(sp->userDb, line, (char *) setuserquota(),
-		 sizeof(struct UserQuotaInfo));
+      sgDbUpdate(sp->userDb, line, (char *) setuserinfo(),
+		 sizeof(struct UserInfo));
     } else {
       do {
 	if(c != NULL && p >= c) /*find the comment */
 	  break;
 	for(lc=p; *lc != '\0'; lc++) /* convert username to lowercase chars */
 	  *lc = tolower(*lc);
-	sgDbUpdate(sp->userDb, p, (char *) setuserquota(),
-		   sizeof(struct UserQuotaInfo));
+	sgDbUpdate(sp->userDb, p, (char *) setuserinfo(),
+		   sizeof(struct UserInfo));
+// DEBUG
+        sgLogError("Added UserList source: %s", p);
       } while((p=strtok(NULL," \t,")) != NULL);
     }
   }
@@ -596,10 +607,95 @@
 }
 
 #if __STDC__
+void sgSourceLdapUserSearch(char *url)
+#else
+void sgSourceLdapUserSearch(url)
+     char *url;
+#endif
+{
+  struct Source *sp;
+  sp = lastSource;
+
+// DEBUG
+  sgLogError("sgSourceLdapUserSearch called with: %s", url);
+
+  if(!ldap_is_ldap_url(url)) {
+    sgLogError("%s: can't parse LDAP url %s",progname, url);
+    return;
+  }
+
+  /* looks ok, add the url to the source object url array */
+  sp->ldapurls = (char**) sgRealloc(sp->ldapurls,
+                                    sizeof(char*) * (sp->ldapurlcount+1));
+  sp->ldapurls[sp->ldapurlcount] = (char*) sgMalloc(strlen(url) + 1);
+  strcpy(sp->ldapurls[sp->ldapurlcount], url);
+  sp->ldapurlcount++;
+
+  /* create a userDb if it doesn't exist, since we'll need it later
+   * for caching */
+  if(sp->userDb == NULL){
+    sp->userDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
+    sp->userDb->type=SGDBTYPE_USERLIST;
+    sgDbInit(sp->userDb,NULL);
+  }
+}
+
+#if __STDC__
+void sgSourceExecUserList(char *cmd)
+#else
+void sgSourceExecUserList(cmd)
+     char *cmd;
+#endif
+{
+  FILE *pInput;
+  char buffer[100];
+  struct Source *sp;
+  char *lc;
+  sp = lastSource;
+  if(sp->userDb == NULL){
+    sp->userDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
+    sp->userDb->type=SGDBTYPE_USERLIST;
+    sgDbInit(sp->userDb,NULL);
+  }
+
+// DEBUG
+  sgLogError("sgSourceExecUserList called with: %s", cmd);
+
+  pInput = popen(cmd, "r");
+  if(pInput == NULL) {
+    sgLogError("%s: Unable to run execuserlist command: %s", progname, cmd);
+    return;
+  }
+
+  while(fgets(buffer, sizeof(buffer), pInput) != NULL) {
+    char *sc;
+    /* skip leading whitespace */
+    for(sc=buffer; *sc != '\0' && isspace(*sc); sc++)
+    ;
+    /* convert username to lowercase */
+    for(lc=sc; *lc != '\0'; lc++)
+      *lc = tolower(*lc);
+    /* remove newline and trailing whitespace */
+    while(lc>=sc && (*lc=='\0' || isspace(*lc)))
+      *lc-- = '\0';
+    if(lc >= sc) {
+      sgDbUpdate(sp->userDb, sc, (char *) setuserinfo(),
+                 sizeof(struct UserInfo));
+// DEBUG
+      sgLogError("Added exec source: %s", sc);
+    }
+  }
+
+  pclose(pInput);
+}
+
+
+
+#if __STDC__
 void sgSourceUserQuota(char *seconds, char *sporadic, char *renew)
 #else
 void sgSourceUserQuota(seconds, sporadic, renew)
-     char *file;
+     char *seconds;
      char *sporadic;
      char *renew;
 #endif
@@ -767,7 +863,7 @@
   struct Ip *ip;
   int foundip, founduser, founddomain, unblockeduser;
   unsigned long i, octet = 0, *op;
-  struct UserQuotaInfo *userquota;
+  struct UserInfo *userquota;
   if(net != NULL){
     op = sgConvDot(net);
     if(op != NULL)
@@ -804,12 +900,12 @@
     if(s->userDb != NULL){
       if(*ident == '\0')
 	founduser = 0;
-      else 
-	if(defined(s->userDb, ident, (char **) &userquota) == 1){
+      else {
+        if(sgFindUser(s, ident, &userquota)) {
 	  founduser = 1;
 	  unblockeduser = 1;
 	  if(s->userquota.seconds != 0){
-	    struct UserQuotaInfo uq;
+	    struct UserInfo uq;
 	    time_t t = time(NULL) + globalDebugTimeDelta;
 	    //sgLogError("status %d time %d lasttime %d consumed %d", userquota->status, userquota->time, userquota->last, userquota->consumed);
 	    //sgLogError("renew %d seconds %d", s->userquota.renew, s->userquota.seconds);
@@ -848,9 +944,10 @@
 		unblockeduser = 0;
 	    }
 	    sgDbUpdate(s->userDb, ident, (void *) userquota, 
-		       sizeof(struct UserQuotaInfo));
+		       sizeof(struct UserInfo));
 	  }
 	}
+      }
     } else
       founduser = 1;
     if(s->domainDb != NULL){
@@ -949,6 +1046,7 @@
     strcpy(sp->domainlist,dbhome);
     strcat(sp->domainlist,"/");
     strcat(sp->domainlist,dl);
+    sgFree(dl);
   } else {
     if (domainlist[0] == '/') {
       sp->domainlist = strdup(domainlist);
@@ -993,6 +1091,7 @@
     strcpy(sp->urllist,dbhome);
     strcat(sp->urllist,"/");
     strcat(sp->urllist,dl);
+    sgFree(dl);
   } else {
     if (urllist[0] == '/') {
       sp->urllist = strdup(urllist);
@@ -1043,6 +1142,7 @@
     strcpy(sp->expressionlist,dbhome);
     strcat(sp->expressionlist,"/");
     strcat(sp->expressionlist,dl);
+    sgFree(dl);
   } else {
     if (exprlist[0] == '/') {
       sp->expressionlist = strdup(exprlist);
@@ -1186,6 +1286,9 @@
   sp->name = strdup(name);
   sp->value = strdup(value);
 
+// DEBUG
+  sgLogError("New setting: %s: %s", name, value);
+
   if(Setting == NULL){
     Setting = sp;
     lastSetting = sp;
@@ -2109,8 +2212,15 @@
       }
     }
   }
-  if(!found)
+  else {
+// DEBUG
+    sgLogError("source not found");
+  }
+  if(!found) {
     acl = defaultAcl;
+// DEBUG
+    sgLogError("no ACL matching source, using default");
+  }
   return acl;
 }
 
@@ -2148,31 +2258,35 @@
       }
       if(aclpass->dest->domainlistDb != NULL){
 	result = defined(aclpass->dest->domainlistDb, req->domain, &dbdata);
-	if(result == DB_NOTFOUND)
-	  continue;
-	if(result){
-	  if(aclpass->access){
-	    access++;
-	    break; 
-	  } else {
-	    access = 0;
-	    break;
+	if(result != DB_NOTFOUND) {
+	  if(result){
+	    if(aclpass->access){
+	      access++;
+	      break; 
+	    } else {
+	      access = 0;
+	      break;
+	    }
 	  }
 	}
+	else {
+	}
       }
       if(aclpass->dest->urllistDb != NULL && access){
 	result = defined(aclpass->dest->urllistDb,req->strippedurl, &dbdata);
-	if(result == DB_NOTFOUND)
-	  continue;
-	if(result){
-	  if(aclpass->access){
-	    access++;
-	    break;
-	  } else {
-	    access = 0;
-	    break;
+	if(result != DB_NOTFOUND) {
+	  if(result){
+	    if(aclpass->access){
+	      access++;
+	      break;
+	    } else {
+	      access = 0;
+	      break;
+	    }
 	  }
 	}
+	else {
+	}
       }
       if(aclpass->dest->regExp != NULL && access){
 	if((result = sgRegExpMatch(aclpass->dest->regExp,req->url)) != 0){
@@ -2214,21 +2328,27 @@
       redirect = p;
       if(rewrite->logfile != NULL){
 	globalLogFile = rewrite->logfile;
-	sgLogRequest(globalLogFile,req,acl,aclpass,rewrite);
+	sgLogRequest(globalLogFile,req,acl,aclpass,rewrite,REQUEST_TYPE_REWRITE);
+	return redirect;
       }
     }
   } else if(redirect != NULL) {
     redirect = sgParseRedirect(redirect, req, acl, aclpass);
-    if(src != NULL && src->logfile != NULL)
-      globalLogFile = src->logfile;
-    if(aclpass == NULL || aclpass->dest == NULL){
-      if(defaultAcl->logfile != NULL)
-	      globalLogFile = defaultAcl->logfile;
-    } else
-      if(aclpass->dest->logfile != NULL)
-	globalLogFile = aclpass->dest->logfile;
-    if(globalLogFile != NULL)
-      sgLogRequest(globalLogFile,req,acl,aclpass,NULL);
+  }
+  if(src != NULL && src->logfile != NULL)
+    globalLogFile = src->logfile;
+  if(aclpass == NULL || aclpass->dest == NULL){
+    if(defaultAcl->logfile != NULL)
+     globalLogFile = defaultAcl->logfile;
+  } else
+    if(aclpass->dest->logfile != NULL)
+      globalLogFile = aclpass->dest->logfile;
+  if(globalLogFile != NULL) {
+    if(redirect != NULL) {
+      sgLogRequest(globalLogFile,req,acl,aclpass,NULL,REQUEST_TYPE_REDIRECT);
+    } else {
+      sgLogRequest(globalLogFile,req,acl,aclpass,NULL,REQUEST_TYPE_PASS);
+    }
   }
   return redirect;
 }
@@ -2252,3 +2372,298 @@
 {
   return 1;
 }
+
+/* returns 1 if user was found for the specified Source
+ * returns a pointer to a UserInfo structure when found
+ * handles all LDAP sub-lookups and caching
+ */
+#if __STDC__
+int sgFindUser(struct Source *src, char *ident, struct UserInfo **rval)
+#else
+int sgFindUser(src, ident, rval)
+	struct Source *src;
+	char *ident;
+	struct UserInfo **rval;
+#endif
+{
+	int i, found;
+	int CacheTimeOut;
+	char *interval;
+	struct UserInfo *userinfo;
+	static struct UserInfo info;
+
+	/* defined in the userDB? */
+	if(defined(src->userDb, ident, (char **) &userinfo) == 1) {
+		/* LDAP user? */
+		if(!userinfo->ldapuser) {
+			*rval = userinfo;
+			return 1;	/* no, return regular user */
+		}
+
+		/* from here on, we assume it is an LDAP user */
+
+		/* is this info valid? */
+		interval = sgSettingGetValue("ldapcachetime");
+		CacheTimeOut = atoi(interval != NULL ? interval : "0");
+		if((time(NULL) - userinfo->cachetime) <= CacheTimeOut) {
+			if(userinfo->found)
+				*rval = userinfo;
+			return userinfo->found;	/* yes */
+		}
+	}
+	else {
+		userinfo = NULL;	/* no record defined, must add our own*/
+	}
+
+	found = 0;			/* assume not found */
+
+	/* loop through all LDAP URLs and do a search */
+	for(i = 0; i < src->ldapurlcount; i++) {
+
+		found = sgDoLdapSearch(src->ldapurls[i], ident);
+
+		/* cache every search in the user database */
+		/* this should be safe, since squid only sends real idents
+		   that have been authenticated (?) */
+
+		/* any record defined from above? */
+		if(userinfo == NULL) {
+			/* no, must use our own memory */
+			userinfo = &info;
+			info.status = 0;
+			info.time = 0;
+			info.consumed = 0;
+			info.last = 0;
+			info.ldapuser = 1;
+			info.found = found;
+			info.cachetime = time(NULL);
+		}
+		else {
+			/* yes, just update the found flag */
+			userinfo->found = found;
+			userinfo->cachetime = time(NULL);
+		}
+
+		sgDbUpdate(src->userDb, ident, (char *) userinfo,
+			sizeof(struct UserInfo));
+		// DEBUG
+		sgLogError("Added LDAP source: %s", ident);
+
+		if(found) {
+			*rval = userinfo;
+			break;
+		}
+	}
+
+	return found;
+}
+
+#if __STDC__
+static int get_ldap_errno(LDAP *ld)
+#else
+static int get_ldap_errno(ld)
+           LDAP *ld;
+#endif
+{
+  int err = 0;
+  if(ld) {
+    if(ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &err) != LDAP_OPT_SUCCESS)
+        err = 0;
+  }
+  return err;
+}
+
+/*
+ * expand_url - expand the %s codes in the given LDAP url
+ *
+ * Returns:  1 on success, 0 on error
+ *
+ *   char *expand;		destination buffer for expanded URL
+ *   size_t expand_size;	size of dest buffer (sizeof() works here)
+ *   char *url;			original URL (MAXWORDLEN)
+ *   char *s_item;		word to replace each occurance of %s with
+ */
+int expand_url(char *expand, size_t expand_size, const char *url,
+	       const char *s_item)
+{
+	int item_length;
+	char *end = expand + expand_size;
+
+	item_length = strlen(s_item);
+
+	while (*url && expand < end) {
+		if (url[0] == '%' && url[1] == 's') {
+			/* check buffer overrun */
+			if ((expand + item_length) >= end)
+				return 0;
+			strcpy(expand, s_item);
+			expand += item_length;
+
+			url += 2;
+		}
+		else {
+			*expand++ = *url++;
+		}
+	}
+
+	if (expand < end) {
+		*expand = '\0';		/* null terminate string */
+		return 1;
+	}
+	else {
+		return 0;
+	}
+}
+
+/* does a raw LDAP search and returns 1 if found, 0 if not */
+#if __STDC__
+int sgDoLdapSearch(const char *url, const char *username)
+#else
+int sgDoLdapSearch(url, username)
+	const char *url;
+	const char *username;
+#endif
+{
+	LDAPURLDesc *lud;
+	LDAP *ld;
+	LDAPMessage *ldapresult, *ldapentry;
+	char *binddn = NULL, *bindpass = NULL;
+	int ext_i;
+	char **ldapvals;
+	char buffer[MAX_BUF];
+	int found = 0;
+	int protoversion = -1;			/* default to library defaults*/
+	char *protosetting;
+
+	/* Which protocol version should we use? */
+	protosetting = sgSettingGetValue("ldapprotover");
+	if (protosetting != NULL) {
+		if (atoi(protosetting) == 3) {
+			protoversion = LDAP_VERSION3;
+		}
+		else if (atoi(protosetting) == 2) {
+			protoversion = LDAP_VERSION2;
+		}
+	}
+
+	/* insert the username into the url, if needed... allow multiple %s */
+	if (!expand_url(buffer, sizeof(buffer), url, username)) {
+		sgLogError("%s: unable to expand LDAP URL: size: %u, username: "
+			"%s url: %s", progname, sizeof(buffer), username, url);
+		return found;
+	}
+
+	/* Parse RFC2255 LDAP URL */
+	if(ldap_url_parse(buffer, &lud)) {
+		sgLogError("%s: can't parse LDAP url %s",progname, buffer);
+		return found;
+	}
+
+	/* get a handle to an LDAP connection */
+	if((ld = ldap_init(lud->lud_host, lud->lud_port)) == NULL) {
+		sgLogError("%s: ldap_init(%s, %d) failed: %s", progname,
+			lud->lud_host, lud->lud_port, strerror(errno));
+		ldap_free_urldesc(lud);
+		return found;
+	}
+
+	/* force an LDAP protocol version if set */
+	if (protoversion != -1) {
+		if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION,
+			&protoversion) != LDAP_OPT_SUCCESS)
+		{
+			/* this will enter emergency mode */
+			sgLogFatalError("%s: ldap_set_option failed: %s",
+				progname, ldap_err2string(get_ldap_errno(ld)));
+		}
+	}
+
+	/*
+	 * Set binddn and bindpass with values from the config
+	 * file. Do this before the URL extentions so that they
+	 * override on a per-block basis.
+	 */
+	binddn = sgSettingGetValue("ldapbinddn");
+	bindpass = sgSettingGetValue("ldapbindpass");
+
+	/* check for supported URL extensions:
+	 *    bindname=<binddn>      (RFC2255)
+	 *    x-bindpass=<bindpass>  (user-specific, allowed by RFC2255)
+	 */
+	for(ext_i = 0;
+	    lud->lud_exts != NULL && lud->lud_exts[ext_i] != NULL;
+	    ext_i++) {
+
+		char *key = lud->lud_exts[ext_i];
+		char *data;
+
+		/* skip over any 'critical' markers */
+		if (*key == '!')
+			key++;
+
+		/* find '=' sign (first one is all we care about) */
+		data = strchr(key, '=');
+		if (data == NULL)
+			continue;       /* invalid extension, skip */
+		data++;             /* good extension, get data */
+
+		/* do we recognize the key? */
+		if (strncmp(key, "bindname=", 9) == 0)
+		{
+			binddn = data;
+			sgLogError("Extracted binddn: %s", binddn);
+		}
+		else if (strncmp(key, "x-bindpass=", 11) == 0)
+		{
+			bindpass = data;
+			sgLogError("Extracted x-bindpass: %s", bindpass);
+		}
+	}
+
+	/* authenticate to the directory */
+	if (ldap_simple_bind_s(ld, binddn, bindpass) != LDAP_SUCCESS) {
+		sgLogError("%s: ldap_simple_bind_s failed: %s", progname,
+		ldap_err2string(get_ldap_errno(ld)));
+		ldap_unbind(ld);
+		ldap_free_urldesc(lud);
+		return found;
+	}
+
+	/* Perform search */
+	if(ldap_search_ext_s(ld, lud->lud_dn, lud->lud_scope, lud->lud_filter,
+		lud->lud_attrs, 0, NULL, NULL, NULL, -1,
+		&ldapresult) != LDAP_SUCCESS) {
+
+		/*        sgLogError("%s: ldap_search_ext_s failed: %s",
+			progname, ldap_err2string(get_ldap_errno(ld)));
+		*/
+		sgLogError("%s: ldap_search_ext_s failed: %s "
+			"(params: %s, %d, %s, %s)",
+			progname, ldap_err2string(get_ldap_errno(ld)),
+			lud->lud_dn, lud->lud_scope, lud->lud_filter,
+			lud->lud_attrs[0]);
+
+		ldap_unbind(ld);
+		ldap_free_urldesc(lud);
+		return found;
+	}
+
+	/* return hash */
+	ldapentry = ldap_first_entry(ld, ldapresult);
+	if(ldapentry != NULL) {
+		/* Use first attribute to get value */
+		ldapvals = ldap_get_values(ld, ldapentry, lud->lud_attrs[0]);
+		if(ldapvals != NULL) {
+			if(*ldapvals != NULL)
+				found = 1;
+			ldap_value_free(ldapvals);
+		}
+	}
+
+	/* cleanup */
+	ldap_msgfree(ldapresult);
+	ldap_unbind(ld);
+	ldap_free_urldesc(lud);
+	return found;
+}
+
diff -urN squidGuard-1.2.0/src/sgDb.c squidGuard-1.2.0-patched/src/sgDb.c
--- squidGuard-1.2.0/src/sgDb.c	2001-05-14 09:40:12.000000000 -0400
+++ squidGuard-1.2.0-patched/src/sgDb.c	2004-12-02 15:57:17.000000000 -0500
@@ -74,8 +74,13 @@
   /*please feel free to experiment with cacesize and pagesize */
   //Db->dbp->set_cachesize(Db->dbp, 0, 1024 * 1024,0);
   //Db->dbp->set_pagesize(Db->dbp, 1024);
+#ifdef DB_VERSION_GT4
   if(Db->type == SGDBTYPE_DOMAINLIST)
-    Db->dbp->set_bt_compare(Db->dbp, (void *) domainCompare);
+    Db->dbp->set_bt_compare(Db->dbp, domainCompare);
+#else
+  if(Db->type == SGDBTYPE_DOMAINLIST)
+    Db->dbp->set_bt_compare(Db->dbp, domainCompare);
+#endif
 #endif
 #if DB_VERSION_MAJOR == 2
   if(globalUpdate || createdb || stat(dbfile,&st)){
@@ -97,14 +102,24 @@
     flag = DB_CREATE;
     if(createdb)
       flag = flag | DB_TRUNCATE;
+#ifdef DB_VERSION_GT4
+    if ((ret = 
+	 Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
+#else
     if ((ret = 
 	 Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
+#endif
       (void) Db->dbp->close(Db->dbp, 0);
       sgLogFatalError("Error db_open: %s", strerror(ret));
     }
   } else {
+#ifdef DB_VERSION_GT4
+    if ((ret = 
+	 Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+#else
     if ((ret = 
 	 Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+#endif
       sgLogFatalError("Error db_open: %s", strerror(ret));
     }
   }
@@ -143,7 +158,7 @@
       if(dbfile == NULL){
         sgLogError("error update dbfile %s.db. file does not exists, use -C to create",file);
       } else {
-        update = (char *) sgMalloc(strlen(file) + 5);
+        update = (char *) sgMalloc(strlen(file) + 6);
         strcpy(update,file);
         strcat(update,".diff");
         if(stat(update,&st) == 0){
@@ -151,10 +166,11 @@
   	  sgDbLoadTextFile(Db,update,1);
         }
         (void)Db->dbp->sync(Db->dbp,0);
-        sgFree(dbfile);
       }
     }
   }
+  if(dbfile != NULL)
+    sgFree(dbfile);
 }
 
 #if __STDC__
@@ -256,6 +272,8 @@
   }
   if(result == 1)
     if(retval != NULL && Db->data.size > 1){
+      if(Db->data.size >= sizeof(dbdata))
+        sgLogFatalError("Data size too large in defined()");
       memcpy(dbdata,Db->data.data,Db->data.size);
       *(dbdata + Db->data.size) = '\0';
       *retval = dbdata;
@@ -385,6 +403,8 @@
     Db->data.data = "default";
     Db->data.size = 8 ;
   } else {
+    if(len > sizeof(value_buf))
+      sgLogFatalError("Buffer too large in sgDbUpdate()");
     memcpy(value_buf,value, len);
     Db->data.data = value_buf;
     Db->data.size = len ;
@@ -423,6 +443,7 @@
 }
 /* db version greater than 2 */
 #else
+/*
 #if __STDC__
 int db_init(char *dbhome, DB_ENV **dbenvp)
 #else
@@ -445,6 +466,7 @@
   (void) dbenv->close(dbenv, 0);
   return ret;
 }
+*/
 #endif
 
 
@@ -482,7 +504,7 @@
 }
 #else
 #if __STDC__
-int domainCompare (const DB *dbp, const DBT *a, const DBT *b)
+int domainCompare (DB *dbp, const DBT *a, const DBT *b)
 #else
 int domainCompare (dbp, a, b)
      DB  *dbp;
diff -urN squidGuard-1.2.0/src/sgDiv.c squidGuard-1.2.0-patched/src/sgDiv.c
--- squidGuard-1.2.0/src/sgDiv.c	2001-05-15 04:01:37.000000000 -0400
+++ squidGuard-1.2.0-patched/src/sgDiv.c	2004-12-02 15:57:23.000000000 -0500
@@ -17,18 +17,7 @@
 */
 
 #include "sg.h"
-
-extern int sig_hup;           
-extern int sig_alrm;           
-extern int globalDebugTimeDelta;
-extern char **globalArgv;           
-extern char **globalEnvp;           
-extern struct Acl *defaultAcl;
-extern struct LogFileStat *LogFileStat;
-extern struct Source *lastActiveSource;
-
-extern struct Source *Source ;
-extern struct Destination *Dest ;
+#include "sgEx.h"
 
 #if __STDC__
 void sgHandlerSigHUP(int signal)
@@ -64,8 +53,10 @@
     if(dest->urllistDb != NULL && dest->urllistDb->dbp != NULL)
       (void)dest->urllistDb->dbp->close(dest->urllistDb->dbp,0);
   }
+  sgFreeAllLists();
   execve(*globalArgv,globalArgv, globalEnvp);
   fprintf(stderr,"error execve: %d\n",errno);
+  exit(1);
 }
 
 #if __STDC__
@@ -491,6 +482,22 @@
   return regexp;
 }
 
+/*
+   Deletes the buffer memory, so save the next pointer first before
+   calling this function.
+*/
+#if __STDC__
+void sgFreePatternBuffer(struct sgRegExp *regexp)
+#else
+void sgFreePatternBuffer(regexp)
+     struct sgRegExp *regexp;
+#endif
+{
+  sgFree(regexp->pattern);
+  sgFree(regexp->compiled);
+  sgFree(regexp);
+}
+
 #if __STDC__
 char *sgRegExpSubst(struct sgRegExp *regexp, char *pattern)
 #else
@@ -584,7 +591,7 @@
       break;
     case 'q': /* userquota info */
       if(s != NULL && s->userquota.seconds != 0 && strcmp(req->ident, "-")) {
-	struct UserQuotaInfo *userquota;
+	struct UserInfo *userquota;
 	if(defined(s->userDb, req->ident, (char **) &userquota) == 1){
 	  char qbuf[150];
 	  sprintf(qbuf, "%d-%d-%d-%d-%d-%d", 
@@ -752,16 +759,19 @@
 }
 
 #if __STDC__
-struct UserQuotaInfo *setuserquota()
+struct UserInfo *setuserinfo()
 #else
-struct UserQuotaInfo *setuserquota()
+struct UserInfo *setuserinfo()
 #endif
 {
-  static struct UserQuotaInfo uq;
+  static struct UserInfo uq;
   uq.status = 0; 
   uq.time = 0; 
   uq.consumed = 0; 
   uq.last = 0; 
+  uq.ldapuser = 0;
+  uq.found = 0;
+  uq.cachetime = 0;
   return &uq;
 }
 
diff -urN squidGuard-1.2.0/src/sgEx.h squidGuard-1.2.0-patched/src/sgEx.h
--- squidGuard-1.2.0/src/sgEx.h	1969-12-31 19:00:00.000000000 -0500
+++ squidGuard-1.2.0-patched/src/sgEx.h	2004-12-02 15:57:23.000000000 -0500
@@ -0,0 +1,64 @@
+/*
+  By accepting this notice, you agree to be bound by the following
+  agreements:
+  
+  This software product, squidGuard, is copyrighted (C) 1998 by
+  ElTele ěst AS, Oslo, Norway, with all rights reserved.
+  
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License (version 2) as
+  published by the Free Software Foundation.  It 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 (GPL) for more details.
+  
+  You should have received a copy of the GNU General Public License
+  (GPL) along with this program.
+*/
+
+
+extern struct Setting *lastSetting ;
+extern struct Setting *Setting;
+
+extern struct Source *lastSource ;
+extern struct Source *Source ;
+
+extern struct Destination *lastDest ;
+extern struct Destination *Dest ;
+
+extern struct sgRewrite *lastRewrite;
+extern struct sgRewrite *Rewrite;
+extern struct sgRegExp *lastRewriteRegExec;
+
+extern struct Time *lastTime;
+extern struct Time *Time;
+
+extern struct LogFile *globalLogFile;
+
+extern struct LogFileStat *lastLogFileStat;
+extern struct LogFileStat *LogFileStat;
+
+extern struct TimeElement *lastTimeElement;
+extern struct TimeElement *TimeElement;
+extern int *TimeElementsEvents;
+
+extern struct Acl *lastAcl ;
+extern struct Acl *defaultAcl ;
+extern struct Acl *Acl;
+extern struct AclDest *lastAclDest;
+
+extern struct sgRegExp *lastRegExpDest;
+
+extern char *globalLogDir; /* from main.c */
+
+extern struct Source *lastActiveSource;
+
+extern int globalDebugTimeDelta;
+
+extern int sig_hup;           
+extern int sig_alrm;           
+
+extern char **globalArgv;           
+extern char **globalEnvp;           
+
+
diff -urN squidGuard-1.2.0/src/sgFree.c squidGuard-1.2.0-patched/src/sgFree.c
--- squidGuard-1.2.0/src/sgFree.c	1969-12-31 19:00:00.000000000 -0500
+++ squidGuard-1.2.0-patched/src/sgFree.c	2004-12-02 15:57:23.000000000 -0500
@@ -0,0 +1,225 @@
+/*
+  By accepting this notice, you agree to be bound by the following
+  agreements:
+  
+  This software product, squidGuard, is copyrighted (C) 1998 by
+  ElTele ěst AS, Oslo, Norway, with all rights reserved.
+  
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License (version 2) as
+  published by the Free Software Foundation.  It 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 (GPL) for more details.
+  
+  You should have received a copy of the GNU General Public License
+  (GPL) along with this program.
+*/
+
+#include "sg.h"
+#include "sgEx.h"
+
+void sgFreeAllLists()
+{
+#define FREE_LIST(type, head, func) \
+	{ \
+		struct type *next; \
+		while(head != NULL) { \
+			next = head->next; \
+			func(head); \
+			head = next; \
+		} \
+	}
+
+	/* settings linked list */
+	FREE_LIST(Setting, Setting, sgFreeSetting)
+	lastSetting = NULL;
+	Setting = NULL;
+
+	/* sources */
+	FREE_LIST(Source, Source, sgFreeSource)
+	lastSource = NULL;
+	Source = NULL;
+	lastActiveSource = NULL;
+
+	/* dests */
+	FREE_LIST(Destination, Dest, sgFreeDestination)
+	lastDest = NULL;
+	Dest = NULL;
+
+	/* rewrites */
+	FREE_LIST(sgRewrite, Rewrite, sgFreeRewrite)
+	lastRewrite = NULL;
+	Rewrite = NULL;
+	lastRewriteRegExec = NULL;
+
+	/* time structures */
+	FREE_LIST(Time, Time, sgFreeTime)
+	lastTime = NULL;
+	Time = NULL;
+	lastTimeElement = NULL;
+	TimeElement = NULL;
+
+	/* log file stats */
+	FREE_LIST(LogFileStat, LogFileStat, sgFreeLogFileStat)
+	lastLogFileStat = NULL;
+	LogFileStat = NULL;
+
+	/* access control lists */
+	FREE_LIST(Acl, Acl, sgFreeAcl)
+	lastAcl = NULL;
+	defaultAcl = NULL;
+	Acl = NULL;
+	lastAclDest = NULL;
+
+
+	/* single variables */
+	free(globalLogDir);
+	globalLogDir = NULL;
+
+	sgFree(TimeElementsEvents);
+	TimeElementsEvents = NULL;
+}
+
+#if __STDC__
+void sgFreeDestination(struct Destination *dest)
+#else
+void sgFreeDestination(dest)
+	struct Destination *dest;
+#endif
+{
+	if(dest->name != NULL)		sgFree(dest->name);
+	if(dest->domainlist != NULL)	sgFree(dest->domainlist);
+	if(dest->domainlistDb != NULL)	sgFree(dest->domainlistDb);
+	if(dest->urllist != NULL)	sgFree(dest->urllist);
+	if(dest->urllistDb != NULL)	sgFree(dest->urllistDb);
+	if(dest->expressionlist != NULL)sgFree(dest->expressionlist);
+	if(dest->redirect != NULL)	sgFree(dest->redirect);
+	if(dest->logfile != NULL)	sgFree(dest->logfile);
+	/*struct Time *time;*/		/* not dynamically allocated */
+	/*struct sgRewrite *rewrite;*/
+
+	FREE_LIST(sgRegExp, dest->regExp, sgFreePatternBuffer)
+
+	/* and finally, the object itself */
+	sgFree(dest);
+}
+
+#if __STDC__
+void sgFreeSource(struct Source *src)
+#else
+void sgFreeSource(src)
+	struct Source *src;
+#endif
+{
+	int i;
+
+	if(src->name != NULL)		sgFree(src->name);
+	if(src->domainDb != NULL)	sgFree(src->domainDb);
+	if(src->userDb != NULL)		sgFree(src->userDb);
+	if(src->logfile != NULL)	sgFree(src->logfile);
+	/*struct Time *time;*/		/* not dynamically allocated */
+
+	for(i = 0; i < src->ldapurlcount; i++) {
+		sgFree(src->ldapurls[i]);
+	}
+	sgFree(src->ldapurls);
+
+	FREE_LIST(Ip, src->ip, sgFreeIp)
+
+	/* and finally, the object itself */
+	sgFree(src);
+}
+
+#if __STDC__
+void sgFreeIp(struct Ip *ip)
+#else
+void sgFreeIp(ip)
+	struct Ip *ip;
+#endif
+{
+	if(ip->str != NULL)		sgFree(ip->str);
+	sgFree(ip);
+}
+
+#if __STDC__
+void sgFreeSetting(struct Setting *set)
+#else
+void sgFreeSetting(set)
+	struct Setting *set;
+#endif
+{
+	if(set->name != NULL)		free(set->name);
+	if(set->value != NULL)		free(set->value);
+	sgFree(set);
+}
+
+#if __STDC__
+void sgFreeTime(struct Time *t)
+#else
+void sgFreeTime(t)
+	struct Time *t;
+#endif
+{
+	if(t->name != NULL)		free(t->name);
+	FREE_LIST(TimeElement, t->element, sgFree)
+	sgFree(t);
+}
+
+#if __STDC__
+void sgFreeRewrite(struct sgRewrite *rew)
+#else
+void sgFreeRewrite(rew)
+	struct sgRewrite *rew;
+#endif
+{
+	if(rew->name != NULL)		sgFree(rew->name);
+	if(rew->logfile != NULL)	sgFree(rew->logfile);
+	FREE_LIST(sgRegExp, rew->rewrite, sgFreePatternBuffer)
+	sgFree(rew);
+}
+
+#if __STDC__
+void sgFreeAcl(struct Acl *acl)
+#else
+void sgFreeAcl(acl)
+	struct Acl *acl;
+#endif
+{
+	if(acl->name != NULL)		sgFree(acl->name);
+	if(acl->redirect != NULL)	sgFree(acl->redirect);
+	if(acl->logfile != NULL)	sgFree(acl->logfile);
+
+	FREE_LIST(AclDest, acl->pass, sgFreeAclDest)
+
+	/*struct Source *source;*/	/* not dynamically allocated */
+	/*struct sgRewrite *rewrite;*/
+	/*struct Time *time;*/
+
+	sgFree(acl);
+}
+
+#if __STDC__
+void sgFreeAclDest(struct AclDest *ad)
+#else
+void sgFreeAclDest(ad)
+	struct AclDest *ad;
+#endif
+{
+	if(ad->name != NULL)		sgFree(ad->name);
+	/*struct Destination *dest;*/	/* not dynamically allocated */
+
+	sgFree(ad);
+}
+
+#if __STDC__
+void sgFreeLogFileStat(struct LogFileStat *lfs)
+#else
+void sgFreeLogFileStat(lfs)
+	struct LogFileStat *lfs;
+#endif
+{
+	if(lfs->name != NULL)		sgFree(lfs->name);
+	sgFree(lfs);
+}
+
diff -urN squidGuard-1.2.0/src/sgLog.c squidGuard-1.2.0-patched/src/sgLog.c
--- squidGuard-1.2.0/src/sgLog.c	2000-01-27 09:22:00.000000000 -0500
+++ squidGuard-1.2.0-patched/src/sgLog.c	2004-12-02 15:57:42.000000000 -0500
@@ -117,20 +117,40 @@
 		  struct SquidInfo *req,
 		  struct Acl *acl, 
 		  struct AclDest *aclpass,
-		  struct sgRewrite *rewrite)
+		  struct sgRewrite *rewrite,
+		  int request)
 #else
-void sgLogRequest(log, req, acl, aclpass, rewrite)
+void sgLogRequest(log, req, acl, aclpass, rewrite, request)
      struct LogFile *log;
      struct SquidInfo *req;
      struct Acl *acl;
      struct AclDest *aclpass;
      struct sgRewrite *rewrite;
+     int request;
 #endif
 {
   char *ident = req->ident;
   char *srcDomain = req->srcDomain;
   char *srcclass, *targetclass;
   char *rew;
+  char *action;
+  switch(request)
+  {
+  case REQUEST_TYPE_REWRITE:
+    action = "REWRITE";
+    break;
+  case REQUEST_TYPE_REDIRECT:
+    action = "REDIRECT";
+    break;
+  case REQUEST_TYPE_PASS:
+    if(!log->verbose)
+      return;
+    action = "PASS";
+    break;
+  default:
+    action = "-";
+    break;
+  }
   if(rewrite == NULL) 
     rew = "-";
   else 
@@ -143,23 +163,28 @@
     srcclass = "default";
   else
     srcclass = acl->source->name;
-  if(aclpass == NULL || aclpass->name == NULL)
+  if(aclpass == NULL)
+    targetclass = "unknown";
+  else if(aclpass->name == NULL) {
     if(aclpass->type == ACL_TYPE_INADDR)
       targetclass = "in-addr";
     else if(aclpass->type == ACL_TYPE_TERMINATOR)
       targetclass = "none";
     else
       targetclass = "unknown";
+  }
   else
     targetclass =  aclpass->name;
-  sgLog(log->stat,"Request(%s/%s/%s) %s %s/%s %s %s",
+  sgLog(log->stat,"Request(%s/%s/%s) %s %s/%s %s %s %s",
 	srcclass,
 	targetclass,
 	rew,
         req->orig,
-	req->src,srcDomain,
+	req->src,
+	srcDomain,
 	ident,
-	req->method
+	req->method,
+	action
 	);
 }
 
diff -urN squidGuard-1.2.0/src/y.tab.c.bison squidGuard-1.2.0-patched/src/y.tab.c.bison
--- squidGuard-1.2.0/src/y.tab.c.bison	2001-12-18 09:34:04.000000000 -0500
+++ squidGuard-1.2.0-patched/src/y.tab.c.bison	1969-12-31 19:00:00.000000000 -0500
@@ -1,3359 +0,0 @@
-
-/*  A Bison parser, made from sg.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#define	WORD	257
-#define	END	258
-#define	START_BRACKET	259
-#define	STOP_BRACKET	260
-#define	WEEKDAY	261
-#define	DESTINATION	262
-#define	REWRITE	263
-#define	ACL	264
-#define	TIME	265
-#define	TVAL	266
-#define	DVAL	267
-#define	DVALCRON	268
-#define	SOURCE	269
-#define	CIDR	270
-#define	IPCLASS	271
-#define	CONTINUE	272
-#define	IPADDR	273
-#define	DBHOME	274
-#define	DOMAINLIST	275
-#define	URLLIST	276
-#define	EXPRESSIONLIST	277
-#define	IPLIST	278
-#define	DOMAIN	279
-#define	USER	280
-#define	USERLIST	281
-#define	USERQUOTA	282
-#define	IP	283
-#define	NL	284
-#define	NUMBER	285
-#define	PASS	286
-#define	REDIRECT	287
-#define	LOGDIR	288
-#define	SUBST	289
-#define	CHAR	290
-#define	MINUTELY	291
-#define	HOURLY	292
-#define	DAILY	293
-#define	WEEKLY	294
-#define	DATE	295
-#define	WITHIN	296
-#define	OUTSIDE	297
-#define	ELSE	298
-#define	LOGFILE	299
-#define	ANONYMOUS	300
-#define	CONTINIOUS	301
-#define	SPORADIC	302
-
-#line 20 "sg.y"
-
-#include "sg.h"
-
-FILE *yyin, *yyout;
-char *configFile;
-
-extern struct Setting *lastSetting ;
-extern struct Setting *Setting;
-
-extern struct Source *lastSource ;
-extern struct Source *Source ;
-
-extern struct Destination *lastDest ;
-extern struct Destination *Dest ;
-
-extern struct sgRewrite *lastRewrite;
-extern struct sgRewrite *Rewrite;
-extern struct sgRegExp *lastRewriteRegExec;
-
-extern struct Time *lastTime;
-extern struct Time *Time;
-
-extern struct LogFile *globalLogFile;
-
-extern struct LogFileStat *lastLogFileStat;
-extern struct LogFileStat *LogFileStat;
-
-extern struct TimeElement *lastTimeElement;
-extern struct TimeElement *TimeElement;
-int numTimeElements;
-int *TimeElementsEvents;
-extern struct Acl *lastAcl ;
-extern struct Acl *defaultAcl ;
-extern struct Acl *Acl;
-extern struct AclDest *lastAclDest;
- 
-extern struct sgRegExp *lastRegExpDest;
-
-extern char *globalLogDir; /* from main.c */
-
-extern struct Source *lastActiveSource;
-
-extern int globalDebugTimeDelta;
-
-static int time_switch = 0;
-static int date_switch = 0;
-
-int numSource = 0;
-
-
-#line 71 "sg.y"
-typedef union {
-  char *string;
-  char *tval;
-  char *dval;
-  char *dvalcron;
-  int  *integer;
-} YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define	YYFINAL		181
-#define	YYFLAG		-32768
-#define	YYNTBASE	53
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 302 ? yytranslate[x] : 101)
-
-static const char yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,    52,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,    51,    49,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,    50,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
-    47,    48
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     2,     5,     8,    10,    12,    15,    20,    21,    24,
-    27,    30,    33,    36,    39,    43,    46,    49,    52,    55,
-    58,    62,    65,    68,    73,    74,    77,    80,    83,    86,
-    91,    96,   101,   106,   109,   112,   115,   118,   122,   125,
-   127,   128,   131,   134,   135,   138,   141,   146,   147,   150,
-   152,   156,   160,   165,   166,   176,   177,   180,   183,   186,
-   189,   193,   196,   197,   200,   204,   207,   209,   211,   212,
-   215,   219,   223,   228,   231,   233,   236,   241,   242,   245,
-   247,   250,   253,   257,   260,   263,   268,   269,   272,   273,
-   274,   280,   281,   282,   288,   289,   293,   294,   300,   304,
-   307,   309,   314,   318,   321,   323,   325,   327,   329,   330,
-   333,   335,   337,   339,   341,   343,   345,   347,   349
-};
-
-static const short yyrhs[] = {    99,
-     0,    20,     3,     0,    34,     3,     0,     5,     0,     6,
-     0,     8,     3,     0,    58,    56,    60,    57,     0,     0,
-    60,    61,     0,    21,     3,     0,    21,    49,     0,    22,
-     3,     0,    22,    49,     0,    23,    49,     0,    23,    50,
-     3,     0,    23,     3,     0,    33,     3,     0,     9,     3,
-     0,    42,     3,     0,    43,     3,     0,    45,    46,     3,
-     0,    45,     3,     0,    15,     3,     0,    62,    56,    64,
-    57,     0,     0,    64,    65,     0,    25,    66,     0,    26,
-    67,     0,    27,     3,     0,    28,    31,    31,    38,     0,
-    28,    31,    31,    39,     0,    28,    31,    31,    40,     0,
-    28,    31,    31,    31,     0,    29,    78,     0,    24,     3,
-     0,    42,     3,     0,    43,     3,     0,    45,    46,     3,
-     0,    45,     3,     0,    18,     0,     0,    66,     3,     0,
-    66,    51,     0,     0,    67,     3,     0,    67,    51,     0,
-    10,    56,    69,    57,     0,     0,    69,    71,     0,     3,
-     0,     3,    42,     3,     0,     3,    43,     3,     0,    70,
-    56,    73,    57,     0,     0,    70,    56,    73,    57,    44,
-    72,    56,    73,    57,     0,     0,    73,    74,     0,    32,
-    75,     0,     9,     3,     0,    33,     3,     0,    45,    46,
-     3,     0,    45,     3,     0,     0,    75,     3,     0,    75,
-    52,     3,     0,    75,    51,     0,    16,     0,    17,     0,
-     0,    78,    79,     0,    78,    79,    76,     0,    78,    79,
-    77,     0,    78,    79,    49,    79,     0,    78,    51,     0,
-    19,     0,     9,     3,     0,    80,    56,    82,    57,     0,
-     0,    82,    83,     0,    35,     0,    42,     3,     0,    43,
-     3,     0,    45,    46,     3,     0,    45,     3,     0,    11,
-     3,     0,    84,    56,    86,    57,     0,     0,    86,    87,
-     0,     0,     0,    40,    88,     3,    89,    93,     0,     0,
-     0,    40,    90,     7,    91,    93,     0,     0,    41,    92,
-    95,     0,     0,    93,    94,    97,    49,    97,     0,    97,
-    49,    97,     0,    96,    93,     0,    96,     0,    96,    49,
-    96,    93,     0,    96,    49,    96,     0,    98,    93,     0,
-    98,     0,    13,     0,    12,     0,    14,     0,     0,    99,
-   100,     0,    58,     0,    63,     0,    59,     0,    54,     0,
-    55,     0,    68,     0,    81,     0,    85,     0,    30,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-   108,   113,   116,   119,   123,   127,   130,   134,   135,   137,
-   139,   140,   141,   142,   143,   144,   145,   146,   147,   148,
-   149,   150,   153,   156,   159,   160,   164,   165,   166,   167,
-   169,   171,   173,   175,   176,   177,   178,   179,   180,   181,
-   185,   186,   187,   190,   191,   192,   195,   198,   199,   202,
-   203,   204,   207,   208,   210,   213,   214,   217,   218,   219,
-   220,   221,   224,   225,   226,   227,   230,   233,   235,   236,
-   237,   238,   239,   240,   243,   246,   248,   251,   252,   256,
-   257,   258,   259,   260,   264,   266,   269,   270,   274,   275,
-   276,   276,   277,   278,   278,   279,   282,   282,   283,   286,
-   287,   288,   289,   290,   291,   294,   297,   300,   303,   304,
-   307,   309,   310,   311,   312,   313,   314,   315,   316
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","WORD","END",
-"START_BRACKET","STOP_BRACKET","WEEKDAY","DESTINATION","REWRITE","ACL","TIME",
-"TVAL","DVAL","DVALCRON","SOURCE","CIDR","IPCLASS","CONTINUE","IPADDR","DBHOME",
-"DOMAINLIST","URLLIST","EXPRESSIONLIST","IPLIST","DOMAIN","USER","USERLIST",
-"USERQUOTA","IP","NL","NUMBER","PASS","REDIRECT","LOGDIR","SUBST","CHAR","MINUTELY",
-"HOURLY","DAILY","WEEKLY","DATE","WITHIN","OUTSIDE","ELSE","LOGFILE","ANONYMOUS",
-"CONTINIOUS","SPORADIC","'-'","'i'","','","'!'","start","dbhome","logdir","start_block",
-"stop_block","destination","destination_block","destination_contents","destination_content",
-"source","source_block","source_contents","source_content","domain","user","acl_block",
-"acl_contents","acl","acl_content","@1","access_contents","access_content","access_pass",
-"cidr","ipclass","ips","ip","rew","rew_block","rew_contents","rew_content","time",
-"time_block","time_contents","time_content","@2","@3","@4","@5","@6","ttime",
-"@7","date","dval","tval","dvalcron","statements","statement", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-    53,    54,    55,    56,    57,    58,    59,    60,    60,    61,
-    61,    61,    61,    61,    61,    61,    61,    61,    61,    61,
-    61,    61,    62,    63,    64,    64,    65,    65,    65,    65,
-    65,    65,    65,    65,    65,    65,    65,    65,    65,    65,
-    66,    66,    66,    67,    67,    67,    68,    69,    69,    70,
-    70,    70,    71,    72,    71,    73,    73,    74,    74,    74,
-    74,    74,    75,    75,    75,    75,    76,    77,    78,    78,
-    78,    78,    78,    78,    79,    80,    81,    82,    82,    83,
-    83,    83,    83,    83,    84,    85,    86,    86,    88,    89,
-    87,    90,    91,    87,    92,    87,    94,    93,    93,    95,
-    95,    95,    95,    95,    95,    96,    97,    98,    99,    99,
-   100,   100,   100,   100,   100,   100,   100,   100,   100
-};
-
-static const short yyr2[] = {     0,
-     1,     2,     2,     1,     1,     2,     4,     0,     2,     2,
-     2,     2,     2,     2,     3,     2,     2,     2,     2,     2,
-     3,     2,     2,     4,     0,     2,     2,     2,     2,     4,
-     4,     4,     4,     2,     2,     2,     2,     3,     2,     1,
-     0,     2,     2,     0,     2,     2,     4,     0,     2,     1,
-     3,     3,     4,     0,     9,     0,     2,     2,     2,     2,
-     3,     2,     0,     2,     3,     2,     1,     1,     0,     2,
-     3,     3,     4,     2,     1,     2,     4,     0,     2,     1,
-     2,     2,     3,     2,     2,     4,     0,     2,     0,     0,
-     5,     0,     0,     5,     0,     3,     0,     5,     3,     2,
-     1,     4,     3,     2,     1,     1,     1,     1,     0,     2,
-     1,     1,     1,     1,     1,     1,     1,     1,     1
-};
-
-static const short yydefact[] = {   109,
-     1,     0,     0,     0,     0,     0,     0,   119,     0,   114,
-   115,   111,   113,     0,   112,   116,     0,   117,     0,   118,
-   110,     6,    76,     4,    48,    85,    23,     2,     3,     8,
-    25,    78,    87,     0,     0,     0,     0,     0,    50,     5,
-    47,     0,    49,     0,     0,     0,     0,     0,     0,     0,
-     0,     7,     9,    40,     0,    41,    44,     0,     0,    69,
-     0,     0,     0,    24,    26,    80,     0,     0,     0,    77,
-    79,    89,    95,    86,    88,     0,     0,    56,    18,    10,
-    11,    12,    13,    16,    14,     0,    17,    19,    20,    22,
-     0,    35,    27,    28,    29,     0,    34,    36,    37,    39,
-     0,    81,    82,    84,     0,     0,     0,     0,    51,    52,
-     0,    15,    21,    42,    43,    45,    46,     0,    75,    74,
-    70,    38,    83,    90,    93,   106,   108,    96,   101,   105,
-     0,    63,     0,     0,    53,    57,    33,    30,    31,    32,
-    67,    68,     0,    71,    72,     0,     0,   107,     0,   100,
-     0,   104,    59,    58,    60,    62,     0,    54,    73,    91,
-    94,   103,     0,     0,    64,    66,     0,    61,     0,   102,
-     0,    99,    65,    56,     0,     0,    98,    55,     0,     0,
-     0
-};
-
-static const short yydefgoto[] = {   179,
-    10,    11,    25,    41,    12,    13,    35,    53,    14,    15,
-    36,    65,    93,    94,    16,    34,    42,    43,   169,   111,
-   136,   154,   144,   145,    97,   121,    17,    18,    37,    71,
-    19,    20,    38,    75,   106,   146,   107,   147,   108,   150,
-   163,   128,   129,   151,   130,     1,    21
-};
-
-static const short yypact[] = {-32768,
-    86,    19,    39,    40,    41,    43,    44,-32768,    82,-32768,
--32768,    40,-32768,    40,-32768,-32768,    40,-32768,    40,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,    20,    60,    47,    35,    73,    -5,-32768,
--32768,    40,-32768,    83,    11,    12,     9,    84,    85,    88,
-    10,-32768,-32768,-32768,    95,-32768,-32768,    96,    76,-32768,
-   101,   105,    16,-32768,-32768,-32768,   106,   107,    17,-32768,
--32768,   104,-32768,-32768,-32768,   109,   112,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,   114,-32768,-32768,-32768,-32768,
-   115,-32768,     0,     1,-32768,    90,    49,-32768,-32768,-32768,
-   116,-32768,-32768,-32768,   119,   120,   117,    26,-32768,-32768,
-    22,-32768,-32768,-32768,-32768,-32768,-32768,    -4,-32768,-32768,
-     8,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    -6,   113,
-   123,-32768,   124,    18,    87,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,   110,-32768,-32768,   113,   113,-32768,   121,   118,
-    79,   118,-32768,    -2,-32768,-32768,   129,-32768,-32768,   118,
-   118,   113,   113,   113,-32768,-32768,   130,-32768,    40,   118,
-    89,-32768,-32768,-32768,   113,    22,-32768,-32768,   135,   136,
--32768
-};
-
-static const short yypgoto[] = {-32768,
--32768,-32768,   -12,   -27,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -37,
--32768,-32768,-32768,-32768,-32768,    -3,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,  -114,
--32768,-32768,   -10,  -146,-32768,-32768,-32768
-};
-
-
-#define	YYLAST		157
-
-
-static const short yytable[] = {    30,
-   165,    31,   114,   116,    32,   148,    33,    52,    64,    70,
-    74,    84,    90,    80,    82,   152,   171,   172,   100,   104,
-   156,    22,    39,   141,   142,    40,   137,    40,   177,    78,
-   131,   160,   161,   138,   139,   140,    76,    77,   126,   127,
-    40,    23,   149,    26,    24,    27,    28,   170,   166,   167,
-   115,   117,    40,   132,   133,    91,   143,    85,    86,    81,
-    83,   101,   105,   157,    54,    40,   134,   119,    44,    66,
-    55,    56,    57,    58,    59,    60,    67,    68,    40,    69,
-    45,    46,    47,   135,    29,    79,    87,    88,    61,    62,
-    89,    63,    48,     2,     3,     4,     5,    92,    95,   120,
-     6,    49,    50,    98,    51,     7,    96,    99,   102,   103,
-   -92,   109,    72,    73,   110,     8,   112,   113,   122,     9,
-   118,   123,   124,   125,   148,   153,   155,   164,   119,   -97,
-   158,   168,   173,   126,   180,   181,   176,   175,   162,   159,
-     0,     0,     0,     0,     0,     0,     0,     0,   178,     0,
-     0,     0,     0,     0,     0,     0,   174
-};
-
-static const short yycheck[] = {    12,
-     3,    14,     3,     3,    17,    12,    19,    35,    36,    37,
-    38,     3,     3,     3,     3,   130,   163,   164,     3,     3,
-     3,     3,     3,    16,    17,     6,    31,     6,   175,    42,
-     9,   146,   147,    38,    39,    40,    42,    43,    13,    14,
-     6,     3,    49,     3,     5,     3,     3,   162,    51,    52,
-    51,    51,     6,    32,    33,    46,    49,    49,    50,    49,
-    49,    46,    46,    46,    18,     6,    45,    19,     9,    35,
-    24,    25,    26,    27,    28,    29,    42,    43,     6,    45,
-    21,    22,    23,   111,     3,     3,     3,     3,    42,    43,
-     3,    45,    33,     8,     9,    10,    11,     3,     3,    51,
-    15,    42,    43,     3,    45,    20,    31,     3,     3,     3,
-     7,     3,    40,    41,     3,    30,     3,     3,     3,    34,
-    31,     3,     3,     7,    12,     3,     3,    49,    19,    12,
-    44,     3,     3,    13,     0,     0,   174,    49,   149,   143,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,   169
-};
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/local/share/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   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, 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.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include <alloca.h>
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
-#include <malloc.h>
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include <malloc.h>  */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
-   It is replaced by the list of actions, each action
-   as one case of the switch.  */
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT 	goto yyabortlab
-#define YYERROR		goto yyerrlab1
-/* Like YYERROR except do call yyerror.
-   This remains here temporarily to ease the
-   transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
-#define YYRECOVERING()  (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-#ifndef YYPURE
-#define YYLEX		yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
-#endif
-
-int yynerrs;			/*  number of parse errors so far       */
-#endif  /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
-/* Since this is uninitialized, it does not stop multiple parsers
-   from coexisting.  */
-#endif
-
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
-
-#ifndef	YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/*  YYMAXDEPTH is the maximum size the stacks can grow to
-    (effective only if the built-in stack extension method is used).  */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
-
-#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#else				/* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (to, from, count)
-     char *to;
-     char *from;
-     unsigned int count;
-{
-  register char *f = from;
-  register char *t = to;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
-  register char *t = to;
-  register char *f = from;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 217 "/local/share/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
-{
-  register int yystate;
-  register int yyn;
-  register short *yyssp;
-  register YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
-
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
-
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-
-#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-#endif
-
-  int yystacksize = YYINITDEPTH;
-  int yyfree_stacks = 0;
-
-#ifdef YYPURE
-  int yychar;
-  YYSTYPE yylval;
-  int yynerrs;
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylloc;
-#endif
-#endif
-
-  YYSTYPE yyval;		/*  the variable used to return		*/
-				/*  semantic values from the action	*/
-				/*  routines				*/
-
-  int yylen;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Starting parse\n");
-#endif
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss - 1;
-  yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
-  yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in  yystate  .  */
-/* In all cases, when you get here, the value and location stacks
-   have just been pushed. so pushing a state here evens the stacks.  */
-yynewstate:
-
-  *++yyssp = yystate;
-
-  if (yyssp >= yyss + yystacksize - 1)
-    {
-      /* Give user a chance to reallocate the stack */
-      /* Use copies of these so that the &'s don't force the real ones into memory. */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
-      /* Get the current used size of the three stacks, in elements.  */
-      int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
-#ifdef YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
-#else
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
-#endif
-
-      yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
-      yyls = yyls1;
-#endif
-#else /* no yyoverflow */
-      /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  if (yyfree_stacks)
-	    {
-	      free (yyss);
-	      free (yyvs);
-#ifdef YYLSP_NEEDED
-	      free (yyls);
-#endif
-	    }
-	  return 2;
-	}
-      yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
-      yyfree_stacks = 1;
-#endif
-      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
-      __yy_memcpy ((char *)yyss, (char *)yyss1,
-		   size * (unsigned int) sizeof (*yyssp));
-      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
-      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
-		   size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
-      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
-      __yy_memcpy ((char *)yyls, (char *)yyls1,
-		   size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + size - 1;
-      yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
-      yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
-      if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
-    }
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
-  goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
-  if (yychar == YYEMPTY)
-    {
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Reading a token: ");
-#endif
-      yychar = YYLEX;
-    }
-
-  /* Convert token to internal form (in yychar1) for indexing tables with */
-
-  if (yychar <= 0)		/* This means end of input. */
-    {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
-#endif
-    }
-  else
-    {
-      yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
-      if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
-#ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
-#endif
-	  fprintf (stderr, ")\n");
-	}
-#endif
-    }
-
-  yyn += yychar1;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-
-  /* yyn is what to do for this token type in this state.
-     Negative => reduce, -yyn is rule number.
-     Positive => shift, yyn is new state.
-       New state is final state => don't bother to shift,
-       just return success.
-     0, or most negative number => error.  */
-
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  /* count tokens shifted since error; after three, turn off error status.  */
-  if (yyerrstatus) yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-/* Do the default action for the current state.  */
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-/* Do a reduction.  yyn is the number of a rule to reduce with.  */
-yyreduce:
-  yylen = yyr2[yyn];
-  if (yylen > 0)
-    yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      int i;
-
-      fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
-      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
-
-
-  switch (yyn) {
-
-case 2:
-#line 113 "sg.y"
-{ sgSetting("dbhome",yyvsp[0].string); ;
-    break;}
-case 3:
-#line 116 "sg.y"
-{ sgSetting("logdir",yyvsp[0].string); ;
-    break;}
-case 6:
-#line 127 "sg.y"
-{ sgDest(yyvsp[0].string); ;
-    break;}
-case 7:
-#line 131 "sg.y"
-{ sgDestEnd();;
-    break;}
-case 10:
-#line 138 "sg.y"
-{ sgDestDomainList(yyvsp[0].string); ;
-    break;}
-case 11:
-#line 139 "sg.y"
-{ sgDestDomainList(NULL); ;
-    break;}
-case 12:
-#line 140 "sg.y"
-{ sgDestUrlList(yyvsp[0].string); ;
-    break;}
-case 13:
-#line 141 "sg.y"
-{ sgDestUrlList(NULL); ;
-    break;}
-case 14:
-#line 142 "sg.y"
-{ sgDestExpressionList(NULL,NULL); ;
-    break;}
-case 15:
-#line 143 "sg.y"
-{ sgDestExpressionList(yyvsp[0].string,"i"); ;
-    break;}
-case 16:
-#line 144 "sg.y"
-{ sgDestExpressionList(yyvsp[0].string,"n"); ;
-    break;}
-case 17:
-#line 145 "sg.y"
-{sgDestRedirect(yyvsp[0].string); ;
-    break;}
-case 18:
-#line 146 "sg.y"
-{sgDestRewrite(yyvsp[0].string); ;
-    break;}
-case 19:
-#line 147 "sg.y"
-{ sgDestTime(yyvsp[0].string,WITHIN); ;
-    break;}
-case 20:
-#line 148 "sg.y"
-{ sgDestTime(yyvsp[0].string,OUTSIDE); ;
-    break;}
-case 21:
-#line 149 "sg.y"
-{ sgLogFile(SG_BLOCK_DESTINATION,1,yyvsp[0].string); ;
-    break;}
-case 22:
-#line 150 "sg.y"
-{ sgLogFile(SG_BLOCK_DESTINATION,0,yyvsp[0].string); ;
-    break;}
-case 23:
-#line 153 "sg.y"
-{ sgSource(yyvsp[0].string); ;
-    break;}
-case 24:
-#line 156 "sg.y"
-{sgSourceEnd();;
-    break;}
-case 29:
-#line 166 "sg.y"
-{ sgSourceUserList(yyvsp[0].string); ;
-    break;}
-case 30:
-#line 167 "sg.y"
-{ 
-		      sgSourceUserQuota(yyvsp[-2].string,yyvsp[-1].string,"3600");;
-    break;}
-case 31:
-#line 169 "sg.y"
-{ 
-		      sgSourceUserQuota(yyvsp[-2].string,yyvsp[-1].string,"86400");;
-    break;}
-case 32:
-#line 171 "sg.y"
-{ 
-		      sgSourceUserQuota(yyvsp[-2].string,yyvsp[-1].string,"604800");;
-    break;}
-case 33:
-#line 173 "sg.y"
-{ 
-		      sgSourceUserQuota(yyvsp[-2].string,yyvsp[-1].string,yyvsp[0].string);;
-    break;}
-case 35:
-#line 176 "sg.y"
-{ sgSourceIpList(yyvsp[0].string); ;
-    break;}
-case 36:
-#line 177 "sg.y"
-{ sgSourceTime(yyvsp[0].string,WITHIN); ;
-    break;}
-case 37:
-#line 178 "sg.y"
-{ sgSourceTime(yyvsp[0].string,OUTSIDE); ;
-    break;}
-case 38:
-#line 179 "sg.y"
-{sgLogFile(SG_BLOCK_SOURCE,1,yyvsp[0].string);;
-    break;}
-case 39:
-#line 180 "sg.y"
-{ sgLogFile(SG_BLOCK_SOURCE,0,yyvsp[0].string); ;
-    break;}
-case 40:
-#line 181 "sg.y"
-{ lastSource->cont_search = 1; ;
-    break;}
-case 42:
-#line 186 "sg.y"
-{ sgSourceDomain(yyvsp[0].string); ;
-    break;}
-case 45:
-#line 191 "sg.y"
-{ sgSourceUser(yyvsp[0].string); ;
-    break;}
-case 50:
-#line 202 "sg.y"
-{sgAcl(yyvsp[0].string,NULL,0);;
-    break;}
-case 51:
-#line 203 "sg.y"
-{sgAcl(yyvsp[-2].string,yyvsp[0].string,WITHIN);;
-    break;}
-case 52:
-#line 204 "sg.y"
-{ sgAcl(yyvsp[-2].string,yyvsp[0].string,OUTSIDE); ;
-    break;}
-case 54:
-#line 209 "sg.y"
-{sgAcl(NULL,NULL,ELSE);;
-    break;}
-case 58:
-#line 217 "sg.y"
-{ ;
-    break;}
-case 59:
-#line 218 "sg.y"
-{ sgAclSetValue("rewrite",yyvsp[0].string,0); ;
-    break;}
-case 60:
-#line 219 "sg.y"
-{ sgAclSetValue("redirect",yyvsp[0].string,0); ;
-    break;}
-case 61:
-#line 220 "sg.y"
-{sgLogFile(SG_BLOCK_ACL,1,yyvsp[0].string);;
-    break;}
-case 62:
-#line 221 "sg.y"
-{ sgLogFile(SG_BLOCK_ACL,0,yyvsp[0].string); ;
-    break;}
-case 64:
-#line 225 "sg.y"
-{ sgAclSetValue("pass",yyvsp[0].string,1);;
-    break;}
-case 65:
-#line 226 "sg.y"
-{ sgAclSetValue("pass",yyvsp[0].string,0);;
-    break;}
-case 67:
-#line 230 "sg.y"
-{ sgIp(yyvsp[0].string); ;
-    break;}
-case 68:
-#line 233 "sg.y"
-{ sgIp(yyvsp[0].string); ;
-    break;}
-case 70:
-#line 236 "sg.y"
-{ sgIp("255.255.255.255") ; sgSetIpType(SG_IPTYPE_HOST,NULL,0); ;
-    break;}
-case 71:
-#line 237 "sg.y"
-{ sgSetIpType(SG_IPTYPE_CIDR,NULL,0); ;
-    break;}
-case 72:
-#line 238 "sg.y"
-{ sgSetIpType(SG_IPTYPE_CLASS,NULL,0); ;
-    break;}
-case 73:
-#line 239 "sg.y"
-{ sgSetIpType(SG_IPTYPE_RANGE,NULL,0); ;
-    break;}
-case 75:
-#line 243 "sg.y"
-{ sgIp(yyvsp[0].string);;
-    break;}
-case 76:
-#line 246 "sg.y"
-{ sgRewrite(yyvsp[0].string); ;
-    break;}
-case 80:
-#line 256 "sg.y"
-{ sgRewriteSubstitute(yyvsp[0].string); ;
-    break;}
-case 81:
-#line 257 "sg.y"
-{ sgRewriteTime(yyvsp[0].string,WITHIN); ;
-    break;}
-case 82:
-#line 258 "sg.y"
-{ sgRewriteTime(yyvsp[0].string,OUTSIDE); ;
-    break;}
-case 83:
-#line 259 "sg.y"
-{ sgLogFile(SG_BLOCK_REWRITE,1,yyvsp[0].string); ;
-    break;}
-case 84:
-#line 260 "sg.y"
-{ sgLogFile(SG_BLOCK_REWRITE,0,yyvsp[0].string); ;
-    break;}
-case 85:
-#line 264 "sg.y"
-{ sgTime(yyvsp[0].string); ;
-    break;}
-case 89:
-#line 274 "sg.y"
-{sgTimeElementInit();;
-    break;}
-case 90:
-#line 275 "sg.y"
-{sgTimeElementAdd(yyvsp[0].string,T_WEEKLY);;
-    break;}
-case 92:
-#line 276 "sg.y"
-{sgTimeElementInit();;
-    break;}
-case 93:
-#line 277 "sg.y"
-{sgTimeElementAdd(yyvsp[0].string,T_WEEKDAY);;
-    break;}
-case 95:
-#line 278 "sg.y"
-{sgTimeElementInit();;
-    break;}
-case 96:
-#line 279 "sg.y"
-{sgTimeElementEnd();;
-    break;}
-case 97:
-#line 282 "sg.y"
-{ sgTimeElementClone(); ;
-    break;}
-case 106:
-#line 294 "sg.y"
-{ sgTimeElementAdd(yyvsp[0].string,T_DVAL);;
-    break;}
-case 107:
-#line 297 "sg.y"
-{ sgTimeElementAdd(yyvsp[0].tval,T_TVAL);;
-    break;}
-case 108:
-#line 300 "sg.y"
-{ sgTimeElementAdd(yyvsp[0].string,T_DVALCRON);;
-    break;}
-}
-   /* the action file gets copied in in place of this dollarsign */
-#line 543 "/local/share/bison.simple"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-#ifdef YYLSP_NEEDED
-  yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-  *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
-  yylsp++;
-  if (yylen == 0)
-    {
-      yylsp->first_line = yylloc.first_line;
-      yylsp->first_column = yylloc.first_column;
-      yylsp->last_line = (yylsp-1)->last_line;
-      yylsp->last_column = (yylsp-1)->last_column;
-      yylsp->text = 0;
-    }
-  else
-    {
-      yylsp->last_line = (yylsp+yylen-1)->last_line;
-      yylsp->last_column = (yylsp+yylen-1)->last_column;
-    }
-#endif
-
-  /* Now "shift" the result of the reduction.
-     Determine what state that goes to,
-     based on the state we popped back to
-     and the rule number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yyerrlab:   /* here on detecting error */
-
-  if (! yyerrstatus)
-    /* If not already recovering from an error, report this error.  */
-    {
-      ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
-    }
-
-  goto yyerrlab1;
-yyerrlab1:   /* here on error raised explicitly by an action */
-
-  if (yyerrstatus == 3)
-    {
-      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
-
-      /* return failure if at end of input */
-      if (yychar == YYEOF)
-	YYABORT;
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
-      yychar = YYEMPTY;
-    }
-
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
-
-  goto yyerrhandle;
-
-yyerrdefault:  /* current state does not do anything special for the error token. */
-
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (yyn) goto yydefault;
-#endif
-
-yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (yyssp == yyss) YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
-  yylsp--;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-yyerrhandle:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yyerrdefault;
-
-  yyn += YYTERROR;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
-    goto yyerrdefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrpop;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrpop;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  yystate = yyn;
-  goto yynewstate;
-
- yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 0;
-
- yyabortlab:
-  /* YYABORT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 1;
-}
-#line 319 "sg.y"
-
-
-#if __STDC__
-void sgReadConfig (char *file)
-#else
-void sgReadConfig (file)
-     char *file;
-#endif
-{
-  char *defaultFile=DEFAULT_CONFIGFILE;
-  lineno = 1;
-  configFile = file;
-  if(configFile == NULL)
-    configFile = defaultFile;
-  yyin = fopen(configFile,"r");
-  if(yyin == NULL) 
-    sgLogFatalError("%s: can't open configfile  %s",progname, configFile);
-  (void)yyparse();
-  if(defaultAcl == NULL)
-    sgLogFatalError("%s: default acl not defined in configfile  %s",
-	progname, configFile);
-  fclose(yyin);
-}
-
-
-/*
-  
-  Logfile functions
-
-*/
-
-#if __STDC__
-void sgLogFile (int block, int anonymous, char *file)
-#else
-void sgLogFile (block, anonymous, file)
-     int block;
-     int anonymous;
-     char *file;
-#endif
-{
-  void **v;
-  char *name;
-  struct LogFile *p;
-  switch(block){
-  case(SG_BLOCK_DESTINATION):
-    v = (void **) &lastDest->logfile;
-    name = lastDest->name;
-    break;
-  case(SG_BLOCK_SOURCE):
-    v = (void **) &lastSource->logfile;
-    name = lastSource->name;
-    break;
-  case(SG_BLOCK_REWRITE):
-    v = (void **) &lastRewrite->logfile;
-    name = lastRewrite->name;
-    break;
-  case(SG_BLOCK_ACL):
-    v = (void **) &lastAcl->logfile;
-    name = lastAcl->name;
-    if(strcmp(name,"default")){
-      sgLogError("logfile not allowed in acl other than default");
-    }
-    break;
-  default:
-    return;
-  }
-  if(*v == NULL){
-    p = (struct LogFile *) sgCalloc(1,sizeof(struct LogFile));
-    p->stat = sgLogFileStat(file);
-    p->parent_name = name;
-    p->parent_type = block;
-    p->anonymous = anonymous;
-    *v = p;
-  } else {
-    sgLogError("%s: redefine of logfile %s in line %d",
-		    progname,file,lineno);
-    return;
-  }
-}
-
-#if __STDC__
-struct LogFileStat *sgLogFileStat(char *file)
-#else
-struct LogFileStat *sgLogFileStat(file)
-     char *file;
-#endif
-{
-  struct LogFileStat *sg;
-  struct stat s;
-  char buf[MAX_BUF];
-  FILE *fd;
-  strncpy(buf,file,MAX_BUF);
-  if(*file != '/'){
-    if(globalLogDir == NULL)
-      strncpy(buf,DEFAULT_LOGDIR,MAX_BUF);
-    else
-      strncpy(buf,globalLogDir,MAX_BUF);
-    strcat(buf,"/");
-    strcat(buf,file);
-  }
-  if((fd = fopen(buf, "a")) == NULL){
-    sgLogError("%s: can't write to logfile %s",progname,buf);
-    return NULL;
-  }
-  if(stat(buf,&s) != 0){
-    sgLogError("%s: can't stat logfile %s",progname,buf);
-    return NULL;
-  }
-  if(LogFileStat == NULL){
-    sg = (struct LogFileStat *) sgCalloc(1,sizeof(struct LogFileStat));
-    sg->name = sgMalloc(strlen(buf) + 1);
-    strcpy(sg->name,buf);
-    sg->st_ino = s.st_ino;
-    sg->st_dev = s.st_dev;
-    sg->fd = fd;
-    sg->next = NULL;
-    LogFileStat = sg;
-    lastLogFileStat = sg;
-  } else {
-    for(sg = LogFileStat; sg != NULL; sg = sg->next){
-      if(sg->st_ino == s.st_ino && sg->st_dev == s.st_dev){
-	fclose(fd);
-	return sg;
-      }
-    }
-    sg = (struct LogFileStat *) sgCalloc(1,sizeof(struct LogFileStat));
-    sg->name = sgMalloc(strlen(buf) + 1);
-    strcpy(sg->name,buf);
-    sg->st_ino = s.st_ino;
-    sg->st_dev = s.st_dev;
-    sg->fd = fd;
-    sg->next = NULL;
-    lastLogFileStat->next = sg;
-    lastLogFileStat = sg;
-  }
-  return lastLogFileStat;
-}
-/*
-  
-  Source functions
-
-*/
-
-#if __STDC__
-void sgSource(char *source)
-#else
-void sgSource(source)
-     char *source;
-#endif
-{
-  struct Source *sp;
-  if(Source != NULL){
-    if((struct Source *) sgSourceFindName(source) != NULL)
-      sgLogFatalError("%s: source %s is defined in configfile %s",
-		      progname,source, configFile);
-  }
-  sp = (struct Source *)sgCalloc(1,sizeof(struct Source));
-  sp->ip=NULL;
-  sp->userDb=NULL;
-  sp->domainDb=NULL;
-  sp->active = 1;
-  sp->within = 0;
-  sp->cont_search = 0;
-  sp->time = NULL;
-  sp->userquota.seconds = 0;
-  sp->userquota.renew = 0;
-  sp->userquota.sporadic = 0;
-  sp->next=NULL;
-  sp->logfile = NULL;
-  sp->name = (char  *) sgCalloc(1,strlen(source) + 1);
-  strcpy(sp->name,source);
-
-  if(Source == NULL){
-    Source = sp;
-    lastSource = sp;
-  } else {
-    lastSource->next = sp;
-    lastSource = sp;
-  }
-}
-
-void sgSourceEnd()
-{
- struct Source *s;
- s = lastSource;
- if(s->ip == NULL && s->domainDb == NULL && s->userDb == NULL){
-   sgLogError("sourceblock %s missing active content, set inactive",s->name);
-   s->time = NULL;
-   s->active = 0;
- }
-}
-
-#if __STDC__
-void sgSourceUser(char *user)
-#else
-void sgSourceUser(user)
-     char *user;
-#endif
-{
-  struct Source *sp;
-  char *lc;
-  sp = lastSource;
-  if(sp->userDb == NULL){
-    sp->userDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
-    sp->userDb->type=SGDBTYPE_USERLIST;
-    sgDbInit(sp->userDb,NULL);
-  }
-  for(lc=user; *lc != '\0'; lc++) /* convert username to lowercase chars */
-    *lc = tolower(*lc);
-  sgDbUpdate(sp->userDb, user, (char *) setuserquota(),
-	     sizeof(struct UserQuotaInfo));
-}
-
-#if __STDC__
-void sgSourceUserList(char *file)
-#else
-void sgSourceUserList(file)
-     char *file;
-#endif
-{
-  char *dbhome = NULL, *f;
-  FILE *fd;
-  char line[MAX_BUF];
-  char *p,*c,*s,*lc;
-  int l=0;
-  struct Source *sp;
-  sp = lastSource;
-  if(sp->userDb == NULL){
-    sp->userDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
-    sp->userDb->type=SGDBTYPE_USERLIST;
-    sgDbInit(sp->userDb,NULL);
-  }
-  dbhome = sgSettingGetValue("dbhome");
-  if(dbhome == NULL)
-    dbhome = DEFAULT_DBHOME;
-  if (file[0] == '/') {
-    f = strdup(file);
-  } else {
-    f = (char  *) sgCalloc(1,strlen(dbhome) + strlen(file) + 5);
-    strcpy(f,dbhome);
-    strcat(f,"/");
-    strcat(f,file);
-  }
-  if((fd = fopen(f,"r")) == NULL){
-    sgLogError("%s: can't open userlist %s: %s",progname, f,strerror(errno));
-    return;
-  }
-  while(fgets(line,sizeof(line),fd) != NULL){
-    l++;
-    if(*line == '#')
-      continue;
-    p = strchr(line,'\n');
-    if(p != NULL && p != line){
-      if(*(p - 1) == '\r') /* removing ^M  */
-	p--;
-      *p = '\0';
-    }
-    c = strchr(line,'#');
-    p = strtok(line," \t,");
-    if((s = strchr(line,':')) != NULL){
-      *s = '\0';
-      for(lc=line; *lc != '\0'; lc++) /* convert username to lowercase chars */
-	*lc = tolower(*lc);
-      sgDbUpdate(sp->userDb, line, (char *) setuserquota(),
-		 sizeof(struct UserQuotaInfo));
-    } else {
-      do {
-	if(c != NULL && p >= c) /*find the comment */
-	  break;
-	for(lc=p; *lc != '\0'; lc++) /* convert username to lowercase chars */
-	  *lc = tolower(*lc);
-	sgDbUpdate(sp->userDb, p, (char *) setuserquota(),
-		   sizeof(struct UserQuotaInfo));
-      } while((p=strtok(NULL," \t,")) != NULL);
-    }
-  }
-  fclose(fd);
-}
-
-#if __STDC__
-void sgSourceUserQuota(char *seconds, char *sporadic, char *renew)
-#else
-void sgSourceUserQuota(seconds, sporadic, renew)
-     char *file;
-     char *sporadic;
-     char *renew;
-#endif
-{
-  int s;
-  struct UserQuota *uq;
-  struct Source *sp;
-  sp = lastSource;
-  uq = &sp->userquota;
-  s = atoi(seconds);
-  if(s <= 0)
-    sgLogError("Userquota seconds sporadic hourly|daily|weekly");
-  uq->seconds = s; 
-  s = atoi(sporadic);
-  if(s <= 0)
-    sgLogError("Userquota seconds sporadic hourly|daily|weekly");
-  uq->sporadic = s; 
-  s = atoi(renew);
-  if(s <= 0)
-    sgLogError("Userquota seconds sporadic hourly|daily|weekly");
-  uq->renew = s;
-}
-
-
-#if __STDC__
-void sgSourceDomain(char *domain)
-#else
-void sgSourceDomain(domain)
-     char *domain;
-#endif
-{
-  struct Source *sp;
-  sp = lastSource;
-  if(sp->domainDb == NULL){
-    sp->domainDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
-    sp->domainDb->type=SGDBTYPE_DOMAINLIST;
-    sgDbInit(sp->domainDb,NULL);
-  }
-  sgDbUpdate(sp->domainDb,domain, NULL, 0);
-}
-
-#if __STDC__
-void sgSourceTime(char *name, int within)
-#else
-void sgSourceTime(name, within)
-     char *name;
-     int within;
-#endif
-{
-  struct Time *time = NULL;
-  struct Source *sp;
-  sp = lastSource;
-  if((time = sgTimeFindName(name)) == NULL){
-    sgLogFatalError("%s: Time %s is not defined in configfile %s",
-		    progname,name, configFile);
-  }
-  sp->within = within;
-  sp->time = time;
-}
-
-#if __STDC__
-struct Source *sgSourceFindName(char *name)
-#else
-struct Source *sgSourceFindName(name)
-     char *name;
-#endif
-{
-  struct Source *p;
-  for(p=Source; p != NULL; p = p->next){
-    if(!strcmp(name,p->name))
-      return p;
-  }
-  return NULL;
-}
-
-#if __STDC__
-void sgSourceIpList(char *file)
-#else
-void sgSourceIpList(file)
-     char *file;
-#endif
-{
-  char *dbhome = NULL, *f;
-  FILE *fd;
-  char line[MAX_BUF];
-  char *p,*c,*cidr;
-  int i,l=0;
-  dbhome = sgSettingGetValue("dbhome");
-  if(dbhome == NULL)
-    dbhome = DEFAULT_DBHOME;
-  if (file[0] == '/') {
-    f = strdup(file);
-  } else {
-    f = (char  *) sgCalloc(1,strlen(dbhome) + strlen(file) + 5);
-    strcpy(f,dbhome);
-    strcat(f,"/");
-    strcat(f,file);
-  }
-  if((fd = fopen(f,"r")) == NULL){
-    sgLogError("%s: can't open iplist %s: %s",progname, f,strerror(errno));
-    return;
-  }
-  sgLogError("init iplist %s",f);
-  while(fgets(line,sizeof(line),fd) != NULL){
-    l++;
-    if(*line == '#')
-      continue;
-    p = strchr(line,'\n');
-    if(p != NULL && p != line){
-      if(*(p - 1) == '\r') /* removing ^M  */
-	p--;
-      *p = '\0';
-    }
-    c = strchr(line,'#');
-    p = strtok(line," \t,");
-    do {
-      if(c != NULL && p >= c) /*find the comment */
-	break;
-      i=strspn(p,".0123456789/-");
-      if(i == 0)
-	break;
-      *(p + i ) = '\0';
-      if((cidr = strchr(p,'/')) != NULL){
-	*cidr = '\0';
-	cidr++;
-	sgIp(p);
-	sgIp(cidr);
-	if(strchr(cidr,'.') == NULL)
-	  sgSetIpType(SG_IPTYPE_CIDR,f,l);
-	else 
-	  sgSetIpType(SG_IPTYPE_CLASS,f,l);
-      } else if((cidr = strchr(p,'-')) != NULL) {
-	*cidr = '\0';
-	cidr++;
-	sgIp(p);
-	sgIp(cidr);
-	sgSetIpType(SG_IPTYPE_RANGE,f,l);
-      } else {
-	sgIp(p);
-	sgIp(strdup("255.255.255.255"));
-	sgSetIpType(SG_IPTYPE_HOST,f,l);
-      }
-    } while((p=strtok(NULL," \t,")) != NULL);
-  }
-  fclose(fd);
-}
-
-/*
-  
-
- */
-
-#if __STDC__
-struct Source *sgFindSource (struct Source *bsrc, 
-			     char *net, char *ident, char *domain)
-#else
-struct Source *sgFindSource (bsrc, net, ident, domain)
-     struct Source *bsrc;
-     char *net;
-     char *ident;
-     char *domain;
-#endif
-{
-  struct Source *s;
-  struct Ip *ip;
-  int foundip, founduser, founddomain, unblockeduser;
-  unsigned long i, octet = 0, *op;
-  struct UserQuotaInfo *userquota;
-  if(net != NULL){
-    op = sgConvDot(net);
-    if(op != NULL)
-      octet = *op;
-  }
-  for(s=bsrc; s != NULL; s = s->next){
-    foundip = founduser = founddomain = 0;
-    unblockeduser = 1;
-    if(s->active == 0)
-      continue;
-    if(s->ip != NULL){
-      if(net == NULL)
-	foundip = 0;
-      else {
-	for(ip=s->ip; ip != NULL; ip = ip->next){
-	  if(ip->net_is_set == 0)
-	    continue;
-	  if(ip->type == SG_IPTYPE_RANGE){
-	    if(octet >= ip->net && octet <= ip->mask){
-	      foundip = 1;
-	      break;
-	    }
-	  } else { /* CIDR or HOST */
-	    i = octet & ip->mask;
-	    if(i == ip->net){
-	      foundip = 1;
-	      break;
-	    }
-	  }
-	}
-      }
-    } else
-      foundip = 1;
-    if(s->userDb != NULL){
-      if(*ident == '\0')
-	founduser = 0;
-      else 
-	if(defined(s->userDb, ident, (char **) &userquota) == 1){
-	  founduser = 1;
-	  unblockeduser = 1;
-	  if(s->userquota.seconds != 0){
-	    struct UserQuotaInfo uq;
-	    time_t t = time(NULL) + globalDebugTimeDelta;
-	    //sgLogError("status %d time %d lasttime %d consumed %d", userquota->status, userquota->time, userquota->last, userquota->consumed);
-	    //sgLogError("renew %d seconds %d", s->userquota.renew, s->userquota.seconds);
-	    if(userquota->status == 0){ //first time
-	      userquota->status = 1;
-	      userquota->time = t;
-	      userquota->last = t;
-	      //sgLogError("user %s first time %d", ident, userquota->time);
-	    } else if(userquota->status == 1){
-	      //sgLogError("user %s other time %d %d",ident,userquota->time,t);
-	      if(s->userquota.sporadic > 0){
-		if(t - userquota->last  < s->userquota.sporadic){
-		  userquota->consumed += t - userquota->last;
-		  userquota->time = t;
-		}
-		if(userquota->consumed > s->userquota.seconds){
-		  userquota->status = 2; // block this user, time is up
-		  unblockeduser = 0;
-		}
-		userquota->last = t;
-		//sgLogError("user %s consumed %d %d",ident,userquota->consumed, userquota->last);
-	      } else if(userquota->time + s->userquota.seconds < t){
-		sgLogError("time is up user %s blocket", ident);
-		userquota->status = 2; // block this user, time is up
-		unblockeduser = 0;
-	      } 
-	    } else {
-	      //sgLogError("user %s blocket %d %d %d %d", ident, userquota->status, userquota->time, t, (userquota->time + s->userquota.renew) - t);
-	      if(userquota->time + s->userquota.renew < t){ // new chance
-		//sgLogError("user %s new chance", ident);
-		unblockeduser = 1;
-		userquota->status = 1;
-		userquota->time = t;
-		userquota->consumed = 0;
-	      } else 
-		unblockeduser = 0;
-	    }
-	    sgDbUpdate(s->userDb, ident, (void *) userquota, 
-		       sizeof(struct UserQuotaInfo));
-	  }
-	}
-    } else
-      founduser = 1;
-    if(s->domainDb != NULL){
-      if(*domain == '\0')
-	founddomain = 0;
-      else {
-	if(defined(s->domainDb, domain, (char **) NULL) == 1)
-	  founddomain = 1;
-      }
-    } else
-      founddomain = 1;
-    if(founduser && foundip && founddomain){
-      if(unblockeduser)
-	return s;
-      else {
-	lastActiveSource = s;
-	return NULL;
-      }
-    }
-  }
-  return NULL;
-}
-
-
-
-/*destination block funtions */
-
-#if __STDC__
-void sgDest(char *dest)
-#else
-void sgDest(dest)
-     char *dest;
-#endif
-{
-  struct Destination *sp;
-  if(Dest != NULL){
-    if((struct Destination *) sgDestFindName(dest) != NULL)
-      sgLogFatalError("%s: destination %s is defined in configfile %s",
-		   progname,dest, configFile);
-  }
-  sp = (struct Destination *) sgCalloc(1,sizeof(struct Destination));
-  sp->domainlist=NULL;
-  sp->urllist=NULL;
-  sp->expressionlist=NULL;
-  sp->redirect=NULL;
-  sp->rewrite=NULL;
-  sp->active = 1;
-  sp->time = NULL;
-  sp->within = 0;
-  sp->logfile = NULL;
-  sp->next=NULL;
-  sp->name = (char  *) sgCalloc(1,strlen(dest) + 1);
-  strcpy(sp->name,dest);
-
-  if(Dest == NULL){
-    Dest = sp;
-    lastDest = sp;
-  } else {
-    lastDest->next = sp;
-    lastDest = sp;
-  }
-}
-
-void sgDestEnd()
-{
- struct Destination *d;
- d = lastDest;
- if(d->domainlist == NULL && d->urllist == NULL && d->expressionlist == NULL
-    && d->redirect == NULL && d->rewrite == NULL){
-   sgLogError("destblock %s missing active content, set inactive",d->name);
-   d->time = NULL;
-   d->active = 0;
- }
-}
-
-#if __STDC__
-void sgDestDomainList(char *domainlist)
-#else
-void sgDestDomainList(domainlist)
-     char *domainlist;
-#endif
-{
-  struct Destination *sp;
-  char *dbhome = NULL, *dl = domainlist, *name;
-  dbhome = sgSettingGetValue("dbhome");
-  sp = lastDest;
-  if(dbhome == NULL)
-    dbhome = DEFAULT_DBHOME;
- if(domainlist == NULL){
-    name = sp->name;
-    dl = (char *) sgCalloc(1,strlen("/dest/") + strlen(name) + strlen("/domainlist"));
-    strcpy(dl,"/dest/");
-    strcat(dl,name);
-    strcat(dl,"/domainlist");
-    sp->domainlist = (char  *) sgCalloc(1,strlen(dbhome) + strlen("/") + strlen(dl) + 4);
-    strcpy(sp->domainlist,dbhome);
-    strcat(sp->domainlist,"/");
-    strcat(sp->domainlist,dl);
-  } else {
-    if (domainlist[0] == '/') {
-      sp->domainlist = strdup(domainlist);
-    } else {
-    sp->domainlist = (char  *) sgCalloc(1,strlen(dbhome) + strlen("/") + strlen(domainlist) + 4);
-    strcpy(sp->domainlist,dbhome);
-    strcat(sp->domainlist,"/");
-    strcat(sp->domainlist,domainlist);
-    }
-  }
-  sp->domainlistDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
-  sp->domainlistDb->type=SGDBTYPE_DOMAINLIST;
-  sgLogError("init domainlist %s",sp->domainlist);
-  sgDbInit(sp->domainlistDb,sp->domainlist);
-  if(sp->domainlistDb->entries == 0) { /* empty database */
-    sgLogError("domainlist empty, removed from memory");
-    sgFree(sp->domainlistDb);
-    sp->domainlistDb = NULL;
-  }
-}
-
-#if __STDC__
-void sgDestUrlList(char *urllist)
-#else
-void sgDestUrlList(urllist)
-     char *urllist;
-#endif
-{
-  struct Destination *sp;
-  char *dbhome = NULL, *dl = urllist, *name;
-  dbhome = sgSettingGetValue("dbhome");
-  sp = lastDest;
-  if(dbhome == NULL)
-    dbhome = DEFAULT_DBHOME;
-  if(urllist == NULL){
-    name = sp->name;
-    dl = (char *) sgCalloc(1,strlen("/dest/") + strlen(name) + strlen("/urllist"));
-    strcpy(dl,"/dest/");
-    strcat(dl,name);
-    strcat(dl,"/urllist");
-    sp->urllist = (char  *) sgCalloc(1,strlen(dbhome) + strlen("/") + strlen(dl) + 4);
-    strcpy(sp->urllist,dbhome);
-    strcat(sp->urllist,"/");
-    strcat(sp->urllist,dl);
-  } else {
-    if (urllist[0] == '/') {
-      sp->urllist = strdup(urllist);
-    } else {
-    sp->urllist = (char  *) sgCalloc(1,strlen(dbhome) + strlen("/") + strlen(urllist) + 4);
-    strcpy(sp->urllist,dbhome);
-    strcat(sp->urllist,"/");
-    strcat(sp->urllist,urllist);
-    }
-  }
-  sp->urllistDb = (struct sgDb *) sgCalloc(1,sizeof(struct sgDb));
-  sp->urllistDb->type=SGDBTYPE_URLLIST;
-  sgLogError("init urllist %s",sp->urllist);
-  sgDbInit(sp->urllistDb,sp->urllist);
-  if(sp->urllistDb->entries == 0) { /* empty database */
-    sgLogError("urllist empty, removed from memory");
-    sgFree(sp->urllistDb);
-    sp->urllistDb = NULL;
-  }
-}
-
-#if __STDC__
-void sgDestExpressionList(char *exprlist, char *chcase)
-#else
-void sgDestExpressionList(exprlist, chcase)
-     char *exprlist;
-     char *chcase;
-#endif
-{
-  FILE *fp;
-  char buf[MAX_BUF],errbuf[256];
-  struct Destination *sp;
-  struct sgRegExp *regexp;
-  char *dbhome = NULL, *dl = exprlist, *name, *p;
-  int flags = REG_EXTENDED;
-  dbhome = sgSettingGetValue("dbhome");
-  sp = lastDest;
-  if(dbhome == NULL)
-    dbhome = DEFAULT_DBHOME;
-  if(exprlist == NULL){
-    name = sp->name;
-    dl = (char *) sgCalloc(1,strlen("/dest/") +strlen(name) + strlen("/expressionlist"));
-    strcpy(dl,"/dest/");
-    strcat(dl,name);
-    strcat(dl,"/expressionlist");
-    flags |= REG_ICASE; /* default case insensitive */
-    sp->expressionlist = (char  *) sgCalloc(1,strlen(dbhome)+strlen(dl)+10);
-    strcpy(sp->expressionlist,dbhome);
-    strcat(sp->expressionlist,"/");
-    strcat(sp->expressionlist,dl);
-  } else {
-    if (exprlist[0] == '/') {
-      sp->expressionlist = strdup(exprlist);
-    } else {
-    sp->expressionlist = (char  *) sgCalloc(1,strlen(dbhome) + strlen("/") + strlen(exprlist) + 4);
-    strcpy(sp->expressionlist,dbhome);
-    strcat(sp->expressionlist,"/");
-    strcat(sp->expressionlist,exprlist);
-    }
-    if(strncmp(chcase,"c",1))
-          flags |= REG_ICASE; /* set case insensitive */
-  }
-  sgLogError("init expressionlist %s",sp->expressionlist);
-  if ((fp = fopen(sp->expressionlist, "r")) == NULL) 
-    sgLogFatalError("%s: %s", sp->expressionlist, strerror(errno));
-  while(fgets(buf, sizeof(buf), fp) != NULL){
-    p = (char *) strchr(buf,'\n');
-    if(p != NULL && p != buf){
-      if(*(p - 1) == '\r') /* removing ^M  */
-	p--;
-      *p = '\0';
-    }
-    regexp=sgNewPatternBuffer(buf,flags);
-    if(regexp->error){
-      regerror(regexp->error,regexp->compiled, errbuf,sizeof(errbuf));
-      sgLogError("%s: %s", sp->expressionlist, strerror(errno));
-    }
-    if(lastDest->regExp == NULL){
-      lastDest->regExp = regexp;
-      lastRegExpDest = regexp;
-    } else {
-      lastRegExpDest->next = regexp;
-      lastRegExpDest = regexp;
-    }
-  }
-  fclose(fp);
-}
-
-#if __STDC__
-void sgDestRedirect(char *value)
-#else
-void sgDestRedirect(value)
-     char *value;
-#endif
-{
-  struct Destination *sp;
-  sp = lastDest;
-  sp->redirect = (char *) sgCalloc(1,strlen(value) + 1);
-  strcpy(sp->redirect,value);
-}
-
-void sgDestRewrite(char *value){
-  struct sgRewrite *rewrite = NULL;
-  struct Destination *sp;
-  sp = lastDest;
-  if((rewrite = sgRewriteFindName(value)) == NULL){
-    sgLogFatalError("%s: Rewrite %s is not defined in configfile %s",
-		    progname,value, configFile);
-  }
-  sp->rewrite = rewrite;
-}
-
-#if __STDC__
-int sgRegExpMatch(struct sgRegExp *regexp, char *str)
-#else
-int sgRegExpMatch(regexp, str)
-     struct sgRegExp *regexp;
-     char *str;
-#endif
-{
-  struct sgRegExp *rp;
-  static char errbuf[256];
-  int error;
-  for(rp = regexp; rp != NULL; rp = rp->next){
-    error = regexec(rp->compiled, str, 0,0,0);
-    if(error != 0 && error != REG_NOMATCH) {
-      regerror(error,rp->compiled, errbuf,sizeof(errbuf));
-      sgLogError("Error in regex %30.30s %-60.60s  %d %s\n",rp->pattern,str,error,errbuf);
-    }
-    if(error == 0) /* match */
-      return 1;
-  }
-  return 0;
-}
-
-#if __STDC__
-void sgDestTime(char *name, int within)
-#else
-void sgDestTime(name, within)
-     char *name;
-     int within;
-#endif
-{
-  struct Time *time = NULL;
-  struct Destination *sp;
-  sp = lastDest;
-  if((time = sgTimeFindName(name)) == NULL){
-    sgLogFatalError("%s: Time %s is not defined in configfile %s",
-		    progname,name, configFile);
-  }
-  sp->within = within;
-  sp->time = time;
-}
-
-#if __STDC__
-struct Destination *sgDestFindName(char *name)
-#else
-struct Destination *sgDestFindName(name)
-     char *name;
-#endif
-{
-  struct Destination *p;
-  for(p=Dest; p != NULL; p = p->next){
-    if(!strcmp(name,p->name))
-      return p;
-  }
-  return NULL;
-}
-
-/*
-  Setting functions
-*/
-
-
-#if __STDC__
-void sgSetting(char *name, char *value)
-#else
-void sgSetting(name, value)
-     char *name;
-     char *value;
-#endif
-{
-  struct Setting *sp;
-  if(Setting != NULL){
-    if((struct Setting *) sgSettingFindName(name) != NULL)
-      sgLogFatalError("%s: setting %s is defined in configfile %s",
-		      progname,name, configFile);
-  }
-  sp = (struct Setting *) sgCalloc(1,sizeof(struct Setting));
-
-  sp->name = strdup(name);
-  sp->value = strdup(value);
-
-  if(Setting == NULL){
-    Setting = sp;
-    lastSetting = sp;
-  } else {
-    lastSetting->next = sp;
-    lastSetting = sp;
-  }
-  if(!strcmp(name,"logdir")){
-    globalLogDir= strdup(value);
-  }
-}
-
-#if __STDC__
-struct Setting *sgSettingFindName(char *name)
-#else
-struct Setting *sgSettingFindName(name)
-     char *name;
-#endif
-{
-  struct Setting *p;
-  for(p=Setting; p != NULL; p = p->next){
-    if(!strcmp(name,p->name))
-      return p;
-  }
-  return NULL;
-}
-
-
-#if __STDC__
-char *sgSettingGetValue(char *name)
-#else
-char *sgSettingGetValue(name)
-     char *name;
-#endif
-{
-  struct Setting *p;
-  p = sgSettingFindName(name);
-  if(p != NULL)
-    return p->value;
-  return NULL;
-}
-
-
-/*
-  
-  sgRewrite function
-
- */
-
-#if __STDC__
-void sgRewrite(char *rewrite)
-#else
-void sgRewrite(rewrite)
-     char *rewrite;
-#endif
-{
-  struct sgRewrite *rew;
-  if(Rewrite != NULL){
-    if((struct sgRewrite *) sgRewriteFindName(rewrite) != NULL)
-      sgLogFatalError("%s: rewrite %s is defined in configfile %s",
-		      progname,rewrite, configFile);
-  }
-  rew = (struct sgRewrite *) sgCalloc(1,sizeof(struct sgRewrite));
-  rew->name = strdup(rewrite);
-  rew ->rewrite = NULL;
-  rew->logfile = NULL;
-  rew->time = NULL;
-  rew->active = 1;
-  rew->within = 0;
-  rew->next=NULL;
-
-  if(Rewrite == NULL){
-    Rewrite = rew;
-    lastRewrite = rew;
-  } else {
-    lastRewrite->next = rew;
-    lastRewrite = rew;
-  }
-}
-
-#if __STDC__
-void sgRewriteTime(char *name, int within)
-#else
-void sgRewriteTime(name, within)
-     char *name;
-     int within;
-#endif
-{
-  struct Time *time = NULL;
-  struct sgRewrite *sp;
-  sp = lastRewrite;
-  if((time = sgTimeFindName(name)) == NULL){
-    sgLogFatalError("%s: Time %s is not defined in configfile %s",
-		    progname,name, configFile);
-  }
-  sp->within = within;
-  sp->time = time;
-}
-
-#if __STDC__
-void sgRewriteSubstitute (char *string)
-#else
-void sgRewriteSubstitute (string)
-     char *string;
-#endif
-{
-  char *pattern, *subst = NULL , *p;
-  int flags = REG_EXTENDED ;
-  int global = 0;
-  char *httpcode = NULL;
-  struct sgRegExp *regexp;
-  char errbuf[256];
-  pattern = string + 2 ; /* skipping s@ */
-  p = pattern;
-  while((p = strchr(p,'@')) != NULL){
-    if(*( p - 1) != '\\'){
-      *p = '\0';
-      subst = p + 1;
-      break;
-    }
-    p++;
-  }
-  p= strrchr(subst,'@');
-  while(p != NULL && *p != '\0'){
-    if(*p == 'r' )
-      httpcode =  REDIRECT_TEMPORARILY;
-    if(*p == 'R' )
-      httpcode =  REDIRECT_PERMANENT;
-    if(*p == 'i' || *p == 'I')
-      flags |= REG_ICASE;
-    if(*p == 'g')
-      global = 1;
-    *p = '\0'; /*removes @i from string */
-    p++;
-  } 
-  regexp=sgNewPatternBuffer(pattern,flags);
-  if(regexp->error){
-      regerror(regexp->error,regexp->compiled, errbuf,sizeof(errbuf));
-      sgLogError("Error in regexp %s: %s",pattern,errbuf);
-  } else {
-    regexp->substitute = strdup(subst);
-  }
-  if(lastRewrite->rewrite == NULL)
-    lastRewrite->rewrite = regexp;
-  else 
-    lastRewriteRegExec->next=regexp;
-  regexp->httpcode = httpcode;
-  regexp->global = global;
-  lastRewriteRegExec = regexp;
-}
-
-#if __STDC__
-char *sgRewriteExpression(struct sgRewrite *rewrite, char *subst)
-#else
-char *sgRewriteExpression(rewrite, subst)
-     struct sgRewrite *rewrite;
-     char *subst;
-#endif
-{
-  char *result = NULL;
-  result = sgRegExpSubst(rewrite->rewrite, subst);
-  return result;
-}
-
-#if __STDC__
-struct sgRewrite *sgRewriteFindName(char *name)
-#else
-struct sgRewrite *sgRewriteFindName(name)
-     char *name;
-#endif
-{
-  struct sgRewrite *p;
-  for(p=Rewrite; p != NULL; p = p->next){
-    if(!strcmp(name,p->name))
-      return p;
-  }
-  return NULL;
-}
-
-
-
-/*
-  Time functions
-*/
-
-#if __STDC__
-void sgTime(char *name)
-#else
-void sgTime(name)
-     char *name;
-#endif
-{
-  struct Time *t;
-  if(Time != NULL){
-    if((struct Time *) sgTimeFindName(name) != NULL)
-      sgLogFatalError("%s: time %s is defined in configfile %s",
-		      progname,name, configFile);
-  } else 
-    numTimeElements = 0;
-  t = (struct Time *) sgCalloc(1,sizeof(struct Time));
-  t->name = strdup(name);
-  t->element = NULL;
-  t->active = 1;
-  TimeElement = NULL;
-  lastTimeElement = NULL;
-  if(Time == NULL){
-    Time = t;
-    lastTime = t;
-  } else {
-    lastTime->next = t;
-    lastTime = t;
-  }
-}
-
-#if __STDC__
-void sgTimeElementInit()
-#else
-void sgTimeElementInit()
-#endif
-{
-  struct TimeElement *te;
-  te = (struct TimeElement *) sgCalloc(1,sizeof(struct TimeElement));
-  numTimeElements++;
-  if(lastTime->element == NULL)
-    lastTime->element = te;
-  if(lastTimeElement != NULL)
-    lastTimeElement->next = te;
-  lastTimeElement = te;
-}
-
-#if __STDC__
-void sgTimeElementEnd ()
-#else
-void sgTimeElementEnd ()
-#endif
-{
-  time_switch = 0;
-  date_switch = 0;
-  if(lastTimeElement->fromdate !=0){
-    if(lastTimeElement->todate == 0)
-      lastTimeElement->todate = lastTimeElement->fromdate + 86399;
-    else 
-      lastTimeElement->todate = lastTimeElement->todate + 86399;
-  }
-  if(lastTimeElement->from == 0 && lastTimeElement->to == 0)
-    lastTimeElement->to = 1439; /* set time to 23:59 */
-}
-
-#if __STDC__
-void sgTimeElementAdd (char *element, char type) 
-#else
-void sgTimeElementAdd (element, type) 
-     char *element;
-     char type;
-#endif
-{
-  struct TimeElement *te;
-  char *p;
-  char wday = 0;
-  int h,m,Y,M = 0,D = -1;
-  time_t sec;
-  te = lastTimeElement;
-  switch(type) {
-  case T_WEEKDAY:
-    p = strtok(element," \t,");
-    do {
-      if(*p == '*'){
-	wday = 127;
-      } else if(!strncmp(p,"sun",3)){
-	wday = wday | 0x01;
-      } else if(!strncmp(p,"mon",3)){
-	wday = wday | 0x02;
-      } else if(!strncmp(p,"tue",3)){
-	wday = wday | 0x04;
-      } else if(!strncmp(p,"wed",3)){
-	wday = wday | 0x08;
-      } else if(!strncmp(p,"thu",3)){
-	wday = wday | 0x10;
-      } else if(!strncmp(p,"fri",3)){
-	wday = wday | 0x20;
-      } else if(!strncmp(p,"sat",3)){
-	wday = wday | 0x40;
-      }
-      p=strtok(NULL," \t,");
-    } while(p != NULL);
-    te->wday = wday;
-    break;
-  case T_TVAL:
-    sscanf(element,"%d:%d",&h,&m);
-    if((h < 0 && h > 24) && (m < 0 && m > 59))
-      sgLogFatalError("%s: time formaterror in %s line %d",
-		      progname, configFile,lineno);
-    if(time_switch == 0){
-      time_switch++;
-      te->from = (h * 60) + m ;
-    } else {
-      time_switch=0;
-      te->to = (h * 60) + m ;
-    }
-    break;
-  case T_DVAL:
-    sec = date2sec(element);
-    if(sec == -1){
-      sgLogFatalError("%s: date formaterror in %s line %d",
-		      progname, configFile,lineno);
-    }
-    if(date_switch == 0){
-      date_switch++;
-      te->fromdate = sec;
-    } else {
-      date_switch=0;
-      te->todate = sec;
-    }
-    break;
-  case T_DVALCRON:
-    p = strtok(element,"-.");
-    Y = atoi(p);
-    if(*p == '*')
-      Y = -1;
-    else
-      Y = atoi(p);
-    while((p=strtok(NULL,"-.")) != NULL){
-      if(*p == '*')
-	if(M == 0)
-	  M = -1;
-	else 
-	  D = -1;
-      else
-	if(M == 0)
-	  M = atoi(p);
-	else
-	  D = atoi(p);
-    }
-    te->y=Y; te->m=M; te->d=D;
-    break;
-  case T_WEEKLY:
-    p = element;
-    while(*p != '\0'){
-      switch(*p){
-      case 'S':
-      case 's':
-	wday = wday | 0x01;
-	break;
-      case 'M':
-      case 'm':
-	wday = wday | 0x02;
-	break;
-      case 'T':
-      case 't':
-	wday = wday | 0x04;
-	break;
-      case 'W':
-      case 'w':
-	wday = wday | 0x08;
-	break;
-      case 'H':
-      case 'h':
-	wday = wday | 0x10;
-	break;
-      case 'F':
-      case 'f':
-	wday = wday | 0x20;
-	break;
-      case 'A':
-      case 'a':
-	wday = wday | 0x40;
-	break;
-      default:
-	sgLogFatalError("%s: weekday formaterror in %s line %d",
-			progname, configFile,lineno);
-	break;
-      }
-      p++;
-    }
-    te->wday = wday;
-    break;
-  }
-}
-
-
-#if __STDC__
-struct Time *sgTimeFindName(char *name)
-#else
-struct Time *sgTimeFindName(name)
-     char *name;
-#endif
-{
-  struct Time *p;
-  for(p=Time; p != NULL; p = p->next){
-    if(!strcmp(name,p->name))
-      return p;
-  }
-  return NULL;
-}
-
-#if __STDC__
-int sgTimeCmp(const int *a, const int *b)
-#else
-int sgTimeCmp(a, b)
-     const int *a;
-     const int *b;
-#endif
-{
-  return *a - *b;
-}
-
-#if __STDC__
-void sgTimeElementSortEvents()
-#else
-void sgTimeElementSortEvents()
-#endif
-{
- struct Time *p;
- struct TimeElement *te;
- int i = 0,j;
- int *t;
- if(Time != NULL){
-   TimeElementsEvents = (int *) sgCalloc(numTimeElements * 2 , sizeof(int)); 
-   t = (int *) sgCalloc(numTimeElements * 2, sizeof(int)); 
-   for(p = Time; p != NULL; p = p->next){
-     for(te = p->element; te != NULL; te = te->next){
-       TimeElementsEvents[i++]= te->from == 0 ? 1440 : te->from;
-       TimeElementsEvents[i++]= te->to == 0 ? 1440 : te->to;
-     }
-   }
-   qsort(TimeElementsEvents,numTimeElements * 2,sizeof(int),
-	 (void *) &sgTimeCmp);
-   for(i=0,j=0; i < numTimeElements * 2; i++){
-     if(j==0){
-       t[j++] = TimeElementsEvents[i];
-     } else {
-       if(t[j-1] != TimeElementsEvents[i]){
-	 t[j++]=TimeElementsEvents[i];
-       }
-     }
-   }
-   sgFree(TimeElementsEvents);
-   numTimeElements = j;
-   TimeElementsEvents = t;
- }
-}
-
-#if __STDC__
-int sgTimeNextEvent()
-#else
-int sgTimeNextEvent()
-#endif
-{
-  time_t t;
-  struct tm *lt;
-  int m = 0; 
-  static int lastval= 0;
-  static int index = 0;
-#if HAVE_SIGACTION
-  struct sigaction act;
-#endif
-  if(Time == NULL)
-    return 0;
-  t = time(NULL) + globalDebugTimeDelta;
-
-  lt = localtime(&t); 
-  m = (lt->tm_hour * 60) + lt->tm_min ;
-  
-  for(index=0; index < numTimeElements; index++){
-    if(TimeElementsEvents[index] >= m){
-      break;
-    }
-  }
-  lastval = TimeElementsEvents[index];
-#if HAVE_SIGACTION
-#ifndef SA_NODEFER
-#define SA_NODEFER 0
-#endif
-  act.sa_handler = sgAlarm;
-  act.sa_flags = SA_NODEFER | SA_RESTART;
-  sigaction(SIGALRM, &act, NULL);
-#else
-#if HAVE_SIGNAL
-  signal(SIGALRM, &sgAlarm);
-#else
-#endif
-#endif
-  if(lastval < m )
-    m = (((1440 - m ) + lastval) * 60) - lt->tm_sec;
-  else
-    m = ((lastval - m) * 60) - lt->tm_sec;
-  if(m <= 0)
-    m = 30;
-  sgLogError("recalculating alarm in %d seconds", (unsigned int)m);
-  alarm((unsigned int) m);
-  sgTimeCheck(lt,t);
-  sgTimeSetAcl();
-  return 0;
-}
-
-#if __STDC__
-int sgTimeCheck(struct tm *lt, time_t t)
-#else
-int sgTimeCheck(lt, t)
-     struct tm *lt;
-     time_t t;
-#endif
-{
-  struct Time *sg;
-  struct TimeElement *te;
-  int min;
-  if(Time == NULL)
-    return -1;
-  for(sg = Time; sg != NULL; sg = sg->next){
-    sg->active = 0;
-    for(te = sg->element; te != NULL ; te = te->next){
-      if(te->wday != 0){
-	if(((1 << lt->tm_wday ) & te->wday) != 0) {
-	  min = (lt->tm_hour * 60 ) + lt->tm_min;
-	  if(min >= te->from && min < te->to){
-	    sg->active = 1;
-	    break;
-	  }
-	}
-      } else { /* date */
-	if(te->fromdate != 0){
-	  if(t >= te->fromdate && t <= te->todate){
-	    min = (lt->tm_hour * 60 ) + lt->tm_min;
-	    if(min >= te->from && min < te->to){
-	      sg->active =1;
-	      break;
-	    }
-	  }
-	} else { /* cron */
-	  if(te->y == -1 || te->y == (lt->tm_year + 1900)){
-	    if(te->m == -1 || te->m == (lt->tm_mon + 1)){
-	      if(te->d == -1 || te->d == (lt->tm_mday)){
-		min = (lt->tm_hour * 60 ) + lt->tm_min;
-		if(min >= te->from && min < te->to){
-		  sg->active =1;
-		  break;
-		}
-	      }
-	    }
-	  }
-	}
-      }
-    }
-  }
-  return 0;
-}
-
-void sgTimeSetAcl()
-{
-  struct Acl *acl = defaultAcl;
-  struct Destination *d;
-  struct Source *s;
-  struct sgRewrite *rew;
-  for(acl=Acl; acl != NULL; acl = acl->next){
-    if(acl->time != NULL){
-      acl->active = acl->time->active;
-      if(acl->within == OUTSIDE)
-	if(acl->active)
-	  acl->active = 0;
-	else
-	  acl->active = 1;
-      if(acl->next != NULL && acl->next->within == ELSE){
-	if(acl->active == 0){
-	  acl->next->active = 1;
-	} else {
-	  acl->next->active = 0;
-	}
-      }
-    }
-  }
-  for(d = Dest; d != NULL; d = d->next){
-    if(d->time != NULL){
-      d->active = d->time->active;
-      if(d->within == OUTSIDE)
-	if(d->active)
-	  d->active = 0;
-	else
-	  d->active = 1;
-    }
-  }
-  for(s = Source; s != NULL; s = s->next){
-    if(s->time != NULL){
-      s->active = s->time->active;
-      if(s->within == OUTSIDE)
-	if(s->active)
-	  s->active = 0;
-	else
-	  s->active = 1;
-    }
-  }
-  for(rew = Rewrite; rew != NULL; rew = rew->next){
-    if(rew->time != NULL){
-      rew->active = rew->time->active;
-      if(rew->within == OUTSIDE)
-	if(rew->active)
-	  rew->active = 0;
-	else
-	  rew->active = 1;
-    }
-  }
-}
-
-void sgTimeElementClone() {
-  struct TimeElement *te = lastTimeElement, *tmp;
-  if ( lastTimeElement == NULL ) {
-    sgLogFatalError("No prev TimeElement in sgTimeElementClone !");
-  } else {
-    sgTimeElementInit();
-    lastTimeElement->wday = te->wday;
-    lastTimeElement->from = te->from;
-    lastTimeElement->to = te->to;
-    lastTimeElement->y = te->y;
-    lastTimeElement->m = te->m;
-    lastTimeElement->d = te->d;
-    lastTimeElement->fromdate = te->fromdate;
-    lastTimeElement->todate = te->todate;
-    tmp = lastTimeElement;
-    lastTimeElement = te;
-    sgTimeElementEnd();
-    lastTimeElement = tmp;
-  }
-}
-
-void sgTimePrint() {
-  struct Time *t;
-  struct TimeElement *te;
-  for(t = Time; t != NULL; t = t->next){
-    printf("Time %s is ",t->name);
-    t->active ? printf("active\n") : printf("inactive\n");
-    for(te = t->element; te != NULL; te = te->next){
-      printf("\tte->wday     = %x\n",te->wday);
-      printf("\tte->from     = %d\n",te->from);
-      printf("\tte->to       = %d\n",te->to);
-      printf("\tte->y,m,d    = %d-%d-%d\n",te->y,te->m,te->d);
-      printf("\tte->fromdate = %s\n",te->fromdate == 0 ?
-             "0" : niso(te->fromdate));
-      printf("\tte->todate   = %s\n\n",te->todate == 0 ?
-             "0" : niso(te->todate));
-    }
-  }
-}
-
-
-/*
-  Ip functions
-*/
-
-
-#if __STDC__
-void sgSetIpType(int type, char *file, int line)
-#else
-void sgSetIpType(type, file, line)
-     int type;
-     char *file;
-     int line;
-#endif
-{
-  struct Ip *ip = sgIpLast(lastSource),*nip;
-  char *p;
-  char *f = file == NULL ? configFile : file;
-  int l = line == 0 ? lineno : line ;
-  unsigned long octet, *op = NULL;
-  if(type == SG_IPTYPE_HOST)
-    ip->mask = 0xffffffff;
-  if(type == SG_IPTYPE_RANGE){
-    if((op=sgConvDot(ip->str)) == NULL)
-      sgLogFatalError("%s: address error in %s line %d", progname, f,l);
-    else 
-      ip->mask = *op;
-    if(ip->net > ip->mask)
-      sgLogFatalError("%s: iprange error in %s line %d", progname, f,l);
-  }
-  if(type == SG_IPTYPE_CLASS){
-    p=ip->str;
-    if(*p == '/')
-      p++;
-    if((op=sgConvDot(p)) == NULL)
-      sgLogFatalError("%s: address error in %s line %d", progname, f,l);
-    else 
-      ip->mask = *op;
-  }
-  if(type == SG_IPTYPE_CIDR){
-    p=ip->str;
-    if(*p == '/')
-      p++;
-    octet = atoi(p);
-    if(octet < 0 || octet > 32){
-      sgLogFatalError("%s: prefix error /%s in %s line %d",
-		      progname,p, f,l);
-    }
-    if(octet == 32)
-      ip->mask = 0xffffffff;
-    else
-      ip->mask = 0xffffffff ^ (0xffffffff >> octet);
-    ip->net = ip->net & ip->mask;
-  }
-  ip->type = type;
-  nip = (struct Ip *) sgCalloc(1,sizeof(struct Ip));
-  ip->next = nip ;
-}
-
-#if __STDC__
-void sgIp(char *name)
-#else
-void sgIp(name)
-     char *name;
-#endif
-{
-  struct Ip *ip;
-  unsigned long *op;
-  if(lastSource->ip == NULL){
-    ip = (struct Ip *) sgCalloc(1,sizeof(struct Ip));
-    ip->next = NULL;
-    lastSource->ip = ip;
-    lastSource->lastip = ip;
-  } else {
-    ip = sgIpLast(lastSource);
-  }
-  if(ip->net_is_set == 0){
-    ip->net_is_set = 1;
-    if((op=sgConvDot(name)) == NULL){
-      sgLogFatalError("%s: address error in %s line %d", progname, configFile,lineno);
-    } else 
-      ip->net = *op;
-  } else {
-    ip->str = (char *) sgCalloc(1,strlen(name) + 1);
-    strcpy(ip->str,name);
-  }
-}
-
-#if __STDC__
-struct Ip *sgIpLast(struct Source *s)
-#else
-struct Ip *sgIpLast(s)
-     struct Source *s;
-#endif
-{
-  struct Ip *ip,*ret = NULL ;
-  for(ip=s->ip; ip != NULL; ip = ip->next)
-    ret = ip;
-  return ret;
-}
-
-/*
-  ACL functions
-*/
-
-
-#if __STDC__
-void sgAcl(char *name, char *value, int within)
-#else
-void sgAcl(name, value, within)
-     char *name;
-     char *value;
-     int within;
-#endif
-{
-  struct Acl *acl;
-  struct Source *source = NULL;
-  struct Time *time = NULL;
-  int def = 0;
-  char *s;
-  if(name != NULL){
-    /* due to some strange things in my yacc code */
-    if((s=(char *) strchr(name,' ')) != NULL)
-      *s='\0';    
-    if((s=(char *) strchr(name,'\t')) != NULL)
-      *s='\0';    
-    /*
-    if(Acl != NULL){
-      if((struct Acl *) sgAclFindName(name) != NULL){
-	sgLogFatalError("%s: ACL %s is defined in configfile %s",
-			progname,name, configFile);
-      }
-    }
-    */
-  }
-  if(lastAcl != NULL && name == NULL && within == ELSE) 
-    name = lastAcl->name;
-  acl = (struct Acl *)sgCalloc(1,sizeof(struct Acl));
-  if(!strcmp(name,"default")){
-    defaultAcl=acl;
-    def++;
-  } else {
-    if((source = sgSourceFindName(name)) == NULL && !def){
-      sgLogFatalError("%s: ACL source %s is not defined in configfile %s",
-		      progname,name, configFile);
-    }
-  }
-  acl->name = sgCalloc(1,strlen(name) + 1);
-  strcpy(acl->name,name);
-  acl->active = within == ELSE ? 0 : 1;
-  acl->source = source;
-  acl->pass = NULL;
-  acl->rewriteDefault = 1;
-  acl->rewrite = NULL;
-  acl->redirect = NULL;
-  acl->within = within;
-  acl->logfile = NULL;
-  acl->next = NULL;
-  if(value != NULL){
-    if((time = sgTimeFindName(value)) == NULL){
-      sgLogFatalError("%s: ACL time %s is not defined in configfile %s",
-		      progname,value, configFile);
-    }
-    acl->time = time;
-  }
-  if(Acl == NULL){
-    Acl = acl;
-    lastAcl = acl;
-  } else {
-    lastAcl->next = acl;
-    lastAcl = acl;
-  }
-}
-
-#if __STDC__
-void sgAclSetValue (char *what, char *value, int allowed) 
-#else
-void sgAclSetValue (what, value, allowed)
-     char *what;
-     char *value;
-     int allowed;
-#endif
-{
-  struct Destination *dest = NULL;
-  struct sgRewrite *rewrite = NULL;
-  struct AclDest *acldest;
-  int type = ACL_TYPE_TERMINATOR;
-  if(!strcmp(what,"pass")){
-    if(!strcmp(value,"any") || !strcmp(value,"all"))
-      allowed = 1;
-    else if(!strcmp(value,"none"))
-      allowed=0;
-    else if(!strcmp(value,"in-addr")){
-      type = ACL_TYPE_INADDR;
-    } else {
-      if((dest = sgDestFindName(value)) == NULL){
-	sgLogFatalError("%s: ACL destination %s is not defined in configfile %s",
-			progname,value, configFile);
-      } 
-      type = ACL_TYPE_DEFAULT;
-    }
-
-    acldest = sgCalloc(1,sizeof(struct AclDest));
-    acldest->name = (char *) sgCalloc(1,strlen(value) + 1);
-    strcpy(acldest->name,value);
-    acldest->dest = dest;
-    acldest->access = allowed;
-    acldest->type = type;
-    acldest->next = NULL;
-    if(lastAcl->pass == NULL){
-      lastAcl->pass = acldest;
-    } else {
-      lastAclDest->next = acldest;
-    }
-    lastAclDest = acldest;
-  }
-
-  if(!strcmp(what,"rewrite")){
-    if(!strcmp(value,"none")){
-      lastAcl->rewriteDefault = 0;
-      lastAcl->rewrite = NULL;
-    } else {
-      if((rewrite = sgRewriteFindName(value)) == NULL){
-	sgLogFatalError("%s: Rewrite %s is not defined in configfile %s",
-			progname,value, configFile);
-      }
-      lastAcl->rewriteDefault = 0;
-      lastAcl->rewrite = rewrite;
-    }
-  }
-  if(!strcmp(what,"redirect")){
-    if(strcmp(value,"default")){
-      lastAcl->redirect = (char *) sgCalloc(1,strlen(value) + 1);
-      strcpy(lastAcl->redirect,value);
-    } else {
-      lastAcl->redirect= NULL;
-    }
-  }
-}
-
-#if __STDC__
-struct Acl *sgAclFindName(char *name)
-#else
-struct Acl *sgAclFindName(name)
-     char *name;
-#endif
-{
-  struct Acl *p;
-  for(p=Acl; p != NULL; p = p->next){
-    if(!strcmp(name,p->name))
-      return p;
-  }
-  return NULL;
-}
-
-
-#if __STDC__
-struct Acl *sgAclCheckSource(struct Source *source)
-#else
-struct Acl *sgAclCheckSource(source)
-     struct Source *source;
-#endif
-{
-  struct Acl *acl = defaultAcl;
-  int found = 0;
-  if(source != NULL){
-    for(acl=Acl; acl != NULL; acl = acl->next){
-      if(acl->source == source){
-	if(acl->active){
-	  found++;
-	  break;
-	} else {
-	  if(acl->next->source == source && acl->next->active != 0){
-	    found++;
-	    acl=acl->next;
-	    break;
-	  }
-	}
-      }
-    }
-  }
-  if(!found)
-    acl = defaultAcl;
-  return acl;
-}
-
-#if __STDC__
-char *sgAclAccess(struct Source *src, struct Acl *acl, struct SquidInfo *req)
-#else
-char *sgAclAccess(src, acl, req)
-     struct Source *src;
-     struct Acl *acl;
-     struct SquidInfo *req;
-#endif
-{
-  int access = 1,result;
-  char *redirect = NULL, *dbdata = NULL, *p;
-  struct sgRewrite *rewrite = NULL;
-  struct AclDest *aclpass = NULL;
-  if(acl == NULL)
-    return NULL;
-  if(acl->pass == NULL)
-    acl->pass = defaultAcl->pass;
-  if(acl->pass != NULL){
-    for(aclpass = acl->pass; aclpass != NULL; aclpass = aclpass->next){
-      if(aclpass->dest != NULL && !aclpass->dest->active)
-	continue;
-      if(aclpass->type == ACL_TYPE_TERMINATOR){
-	access=aclpass->access;
-	break;
-      }
-      if(aclpass->type == ACL_TYPE_INADDR){
-	if(req->dot){
-	  access=aclpass->access;
-	  break;
-	}
-	continue;
-      }
-      if(aclpass->dest->domainlistDb != NULL){
-	result = defined(aclpass->dest->domainlistDb, req->domain, &dbdata);
-	if(result == DB_NOTFOUND)
-	  continue;
-	if(result){
-	  if(aclpass->access){
-	    access++;
-	    break; 
-	  } else {
-	    access = 0;
-	    break;
-	  }
-	}
-      }
-      if(aclpass->dest->urllistDb != NULL && access){
-	result = defined(aclpass->dest->urllistDb,req->strippedurl, &dbdata);
-	if(result == DB_NOTFOUND)
-	  continue;
-	if(result){
-	  if(aclpass->access){
-	    access++;
-	    break;
-	  } else {
-	    access = 0;
-	    break;
-	  }
-	}
-      }
-      if(aclpass->dest->regExp != NULL && access){
-	if((result = sgRegExpMatch(aclpass->dest->regExp,req->url)) != 0){
-	  if(aclpass->access){
-	    access++;
-	    break;
-	  } else {
-	    access = 0;
-	    break;
-	  }
-	}
-      }
-    }
-    if(!access){
-      if(dbdata != NULL)
-	redirect = dbdata;
-      else if(aclpass->dest != NULL && aclpass->dest->redirect != NULL)
-	redirect = aclpass->dest->redirect;
-      else if(aclpass->dest != NULL && aclpass->dest->rewrite != NULL &&
-	      (redirect = 
-	       sgRewriteExpression(aclpass->dest->rewrite,req->orig)) != NULL){
-	;
-      }
-      else if(acl->redirect == NULL)
-	redirect = defaultAcl->redirect;
-      else
-	redirect = acl->redirect;
-    }
-  } else {  /* acl->pass == NULL, probably defaultAcl->pass == NULL */
-    access=0;
-    redirect = defaultAcl->redirect;
-  }
-  if(acl->rewrite == NULL)
-    rewrite = defaultAcl->rewrite;
-  else
-    rewrite = acl->rewrite;
-  if(rewrite != NULL && access){
-    if((p = sgRewriteExpression(rewrite,req->orig)) != NULL){
-      redirect = p;
-      if(rewrite->logfile != NULL){
-	globalLogFile = rewrite->logfile;
-	sgLogRequest(globalLogFile,req,acl,aclpass,rewrite);
-      }
-    }
-  } else if(redirect != NULL) {
-    redirect = sgParseRedirect(redirect, req, acl, aclpass);
-    if(src != NULL && src->logfile != NULL)
-      globalLogFile = src->logfile;
-    if(aclpass == NULL || aclpass->dest == NULL){
-      if(defaultAcl->logfile != NULL)
-	      globalLogFile = defaultAcl->logfile;
-    } else
-      if(aclpass->dest->logfile != NULL)
-	globalLogFile = aclpass->dest->logfile;
-    if(globalLogFile != NULL)
-      sgLogRequest(globalLogFile,req,acl,aclpass,NULL);
-  }
-  return redirect;
-}
-
-#if __STDC__
-void yyerror(char *s)
-#else
-void yyerror(s)
-     char *s;
-#endif
-{
-  sgLogFatalError("%s in configfile %s line %d",s,configFile,lineno);
-}
-
-
-#if __STDC__
-int yywrap()
-#else
-int yywrap()
-#endif
-{
-  return 1;
-}
diff -urN squidGuard-1.2.0/src/y.tab.h.bison squidGuard-1.2.0-patched/src/y.tab.h.bison
--- squidGuard-1.2.0/src/y.tab.h.bison	2001-12-18 09:34:04.000000000 -0500
+++ squidGuard-1.2.0-patched/src/y.tab.h.bison	1969-12-31 19:00:00.000000000 -0500
@@ -1,56 +0,0 @@
-typedef union {
-  char *string;
-  char *tval;
-  char *dval;
-  char *dvalcron;
-  int  *integer;
-} YYSTYPE;
-#define	WORD	257
-#define	END	258
-#define	START_BRACKET	259
-#define	STOP_BRACKET	260
-#define	WEEKDAY	261
-#define	DESTINATION	262
-#define	REWRITE	263
-#define	ACL	264
-#define	TIME	265
-#define	TVAL	266
-#define	DVAL	267
-#define	DVALCRON	268
-#define	SOURCE	269
-#define	CIDR	270
-#define	IPCLASS	271
-#define	CONTINUE	272
-#define	IPADDR	273
-#define	DBHOME	274
-#define	DOMAINLIST	275
-#define	URLLIST	276
-#define	EXPRESSIONLIST	277
-#define	IPLIST	278
-#define	DOMAIN	279
-#define	USER	280
-#define	USERLIST	281
-#define	USERQUOTA	282
-#define	IP	283
-#define	NL	284
-#define	NUMBER	285
-#define	PASS	286
-#define	REDIRECT	287
-#define	LOGDIR	288
-#define	SUBST	289
-#define	CHAR	290
-#define	MINUTELY	291
-#define	HOURLY	292
-#define	DAILY	293
-#define	WEEKLY	294
-#define	DATE	295
-#define	WITHIN	296
-#define	OUTSIDE	297
-#define	ELSE	298
-#define	LOGFILE	299
-#define	ANONYMOUS	300
-#define	CONTINIOUS	301
-#define	SPORADIC	302
-
-
-extern YYSTYPE yylval;