Index: /trunk/gsdl/packages/mg-1.3d/acconfig.h
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/acconfig.h	(revision 30)
+++ /trunk/gsdl/packages/mg-1.3d/acconfig.h	(revision 30)
@@ -0,0 +1,35 @@
+/* Special definitions for mg, processed by autoheader.
+   Created by [TS:Aug/95] 
+   by grepping for AC_DEFINE on configure.in and using the appropriate defs 
+   of acconfig.h used by GNU tar.
+*/
+
+/* Define to the name of the distribution.  */
+#undef PACKAGE
+
+/* Define to the version of the distribution.  */
+#undef VERSION
+
+/* Define if `union wait' is the type of the first arg to wait functions.  */
+#undef HAVE_UNION_WAIT
+
+/* Define to 1 if you have the valloc function.  */
+#undef HAVE_VALLOC
+
+/* Define to 1 if ANSI function prototypes are usable.  */
+#undef PROTOTYPES
+ 
+/* Define to 1 for better use of the debugging malloc library.  See
+   site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz.  */
+#undef WITH_DMALLOC
+ 
+/* Define to 1 if GNU regex should be used instead of GNU rx.  */
+#undef WITH_REGEX
+
+/* Some braindead header files do not have the requ'd function declarations */
+#undef HAVE_FGETC_DECL
+#undef HAVE_FREAD_DECL
+
+/* See if have this field in the prstatus_t structure */
+/* It stores the size of the process heap */
+#undef HAVE_PR_BRKSIZE
Index: /trunk/gsdl/packages/mg-1.3d/aclocal.m4
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/aclocal.m4	(revision 30)
+++ /trunk/gsdl/packages/mg-1.3d/aclocal.m4	(revision 30)
@@ -0,0 +1,141 @@
+# Local additions to Autoconf macros.
+# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+# François Pinard <pinard@iro.umontreal.ca>, 1992.
+
+# [TS:Aug/95] - chopped out the NLS stuff which I don't support
+
+## ------------------------------- ##
+## Check for function prototypes.  ##
+## ------------------------------- ##
+
+AC_DEFUN(fp_C_PROTOTYPES,
+[AC_REQUIRE([fp_PROG_CC_STDC])
+AC_MSG_CHECKING([for function prototypes])
+if test "$ac_cv_prog_cc_stdc" != no; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(PROTOTYPES)
+  U= ANSI2KNR=
+else
+  AC_MSG_RESULT(no)
+  U=_ ANSI2KNR=ansi2knr
+fi
+AC_SUBST(U)dnl
+AC_SUBST(ANSI2KNR)dnl
+])
+
+## ----------------------------------------- ##
+## ANSIfy the C compiler whenever possible.  ##
+## ----------------------------------------- ##
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so.  This macro tries various
+# options that select ANSI C on some system or another.  It considers the
+# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
+# handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN(fp_PROG_CC_STDC,
+[AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(ac_cv_prog_cc_stdc,
+[ac_cv_prog_cc_stdc=no
+ac_save_CFLAGS="$CFLAGS"
+# 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			-Aa -D_HPUX_SOURCE
+# SVR4			-Xc
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
+do
+  CFLAGS="$ac_save_CFLAGS $ac_arg"
+  AC_TRY_COMPILE(
+[#if !defined(__STDC__) || __STDC__ != 1
+choke me
+#endif	
+], [int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};],
+[ac_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CFLAGS="$ac_save_CFLAGS"
+])
+AC_MSG_RESULT($ac_cv_prog_cc_stdc)
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno) ;;
+  *) CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+])
+
+## --------------------------------------------------------- ##
+## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
+## substitution.					     ##
+## --------------------------------------------------------- ##
+
+AC_DEFUN(fp_PROG_INSTALL,
+[AC_PROG_INSTALL
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+## ----------------------------------- ##
+## Check if --with-dmalloc was given.  ##
+## ----------------------------------- ##
+
+# I just checked, and GNU rx seems to work fine with a slightly
+# modified GNU m4.  So, I put out the test below in my aclocal.m4,
+# and will try to use it in my things.  The idea is to distribute
+# rx.[hc] and regex.[hc] together, for a while.  The WITH_REGEX symbol
+# (which should also be documented in acconfig.h) is used to decide
+# which of regex.h or rx.h should be included in the application.
+#
+# If `./configure --with-regex' is given, the package will use
+# the older regex.  Else, a check is made to see if rx is already
+# installed, as with newer Linux'es.  If not found, the package will
+# use the rx from the distribution.  If found, the package will use
+# the system's rx which, on Linux at least, will result in a smaller
+# executable file.
+
+AC_DEFUN(fp_WITH_DMALLOC,
+[AC_MSG_CHECKING(if malloc debugging is wanted)
+AC_ARG_WITH(dmalloc,
+[  --with-dmalloc          use dmalloc, as in
+                          ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
+[if test "$withval" = yes; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(WITH_DMALLOC)
+  LIBS="$LIBS -ldmalloc"
+  LDFLAGS="$LDFLAGS -g"
+else
+  AC_MSG_RESULT(no)
+fi], [AC_MSG_RESULT(no)])
+])
+
+## --------------------------------- ##
+## Check if --with-regex was given.  ##
+## --------------------------------- ##
+
+AC_DEFUN(fp_WITH_REGEX,
+[AC_MSG_CHECKING(which of rx or regex is wanted)
+AC_ARG_WITH(regex,
+[  --with-regex            use older regex in lieu of GNU rx for matching],
+[if test "$withval" = yes; then
+  ac_with_regex=1
+  AC_MSG_RESULT(regex)
+  AC_DEFINE(WITH_REGEX)
+  LIBOBJS="$LIBOBJS regex.o"
+fi])
+if test -z "$ac_with_regex"; then
+  AC_MSG_RESULT(rx)
+  AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
+fi
+AC_SUBST(LIBOBJS)dnl
+])
Index: /trunk/gsdl/packages/mg-1.3d/config.h.in
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/config.h.in	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/config.h.in	(revision 30)
@@ -52,7 +52,7 @@
    direction of stack growth for your system; otherwise it will be
    automatically deduced at run-time.
-	STACK_DIRECTION > 0 => grows toward higher addresses
-	STACK_DIRECTION < 0 => grows toward lower addresses
-	STACK_DIRECTION = 0 => direction of growth unknown
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
  */
 #undef STACK_DIRECTION
@@ -99,4 +99,7 @@
 #undef HAVE_FTIME
 
+/* Define if you have the ftruncate function.  */
+#undef HAVE_FTRUNCATE
+
 /* Define if you have the getpagesize function.  */
 #undef HAVE_GETPAGESIZE
@@ -114,6 +117,12 @@
 #undef HAVE_SETBUFFER
 
+/* Define if you have the strcasecmp function.  */
+#undef HAVE_STRCASECMP
+
 /* Define if you have the strftime function.  */
 #undef HAVE_STRFTIME
+
+/* Define if you have the strstr function.  */
+#undef HAVE_STRSTR
 
 /* Define if you have the strtol function.  */
Index: /trunk/gsdl/packages/mg-1.3d/configure
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/configure	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/configure	(revision 30)
@@ -2,6 +2,6 @@
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.4 
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+# Generated automatically using autoconf version 2.12 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -39,7 +39,22 @@
 x_includes=NONE
 x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
 
 # Initialize some other variables.
 subdirs=
+MFLAGS= MAKEFLAGS=
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
 
 ac_prev=
@@ -63,7 +78,12 @@
   case "$ac_option" in
 
-  -build | --build | --buil | --bui | --bu | --b)
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
     ac_prev=build ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
     build="$ac_optarg" ;;
 
@@ -74,4 +94,10 @@
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
     cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
 
   -disable-* | --disable-*)
@@ -125,10 +151,27 @@
   --prefix=PREFIX         install architecture-independent files in PREFIX
                           [$ac_default_prefix]
-  --exec-prefix=PREFIX    install architecture-dependent files in PREFIX
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                           [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
   --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
 Host type:
   --build=BUILD           configure for building on BUILD [BUILD=HOST]
@@ -142,6 +185,8 @@
   --x-includes=DIR        X include files are in DIR
   --x-libraries=DIR       X library files are in DIR
---enable and --with options recognized:$ac_help
-EOF
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
     exit 0 ;;
 
@@ -151,4 +196,42 @@
     host="$ac_optarg" ;;
 
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
@@ -162,4 +245,13 @@
   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
     no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
@@ -203,4 +295,21 @@
     silent=yes ;;
 
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
   -site | --site | --sit)
     ac_prev=site ;;
@@ -213,4 +322,11 @@
     srcdir="$ac_optarg" ;;
 
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
   -target | --target | --targe | --targ | --tar | --ta | --t)
     ac_prev=target ;;
@@ -222,5 +338,5 @@
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.4"
+    echo "configure generated by autoconf version 2.12"
     exit 0 ;;
 
@@ -268,5 +384,5 @@
     ;;
 
-  *) 
+  *)
     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
       echo "configure: warning: $ac_option: invalid host type" 1>&2
@@ -324,9 +440,12 @@
 
 # NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
@@ -388,6 +507,7 @@
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
@@ -408,6 +528,8 @@
   program_transform_name=
 else
-  # Double any \ or $.
-  echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
   rm -f conftestsed
@@ -437,9 +559,10 @@
 
 
-for ac_prog in $CCC c++ g++ gcc CC cxx
+for ac_prog in $CCC c++ g++ gcc CC cxx cc++
 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:567: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -471,5 +594,51 @@
 
 
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:598: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 608 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  ac_cv_prog_cxx_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cxx_cross=no
+  else
+    ac_cv_prog_cxx_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:638: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:643: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -480,5 +649,5 @@
 #endif
 EOF
-if ${CXX-g++} -E conftest.C 2>&5 | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
@@ -486,27 +655,34 @@
 fi
 fi
+
 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
 if test $ac_cv_prog_gxx = yes; then
   GXX=yes
-  if test "${CXXFLAGS+set}" != set; then
-    echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_prog_gxx_g'+set}'`\" = set"; then
+  ac_test_CXXFLAGS="${CXXFLAGS+set}"
+  ac_save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS=
+  echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:667: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'void f(){}' > conftest.cc
 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
-  ac_cv_prog_gxx_g=yes
-else
-  ac_cv_prog_gxx_g=no
-fi
-rm -f conftest*
-
-fi
-    echo "$ac_t""$ac_cv_prog_gxx_g" 1>&6
-    if test $ac_cv_prog_gxx_g = yes; then
-      CXXFLAGS="-g -O"
-    else
-      CXXFLAGS="-O"
-    fi
+  ac_cv_prog_cxx_g=yes
+else
+  ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+  if test "$ac_test_CXXFLAGS" = set; then
+    CXXFLAGS="$ac_save_CXXFLAGS"
+  elif test $ac_cv_prog_cxx_g = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-O2"
   fi
 else
@@ -520,4 +696,5 @@
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:699: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -552,4 +729,5 @@
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:732: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -583,4 +761,5 @@
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:764: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -598,5 +777,4 @@
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
 fi
 fi
@@ -608,6 +786,96 @@
 fi
 
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:793: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  ac_prog_rejected=no
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # 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" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:841: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 851 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:875: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:880: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -618,5 +886,5 @@
 #endif
 EOF
-if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
@@ -624,27 +892,34 @@
 fi
 fi
+
 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  if test "${CFLAGS+set}" != set; then
-    echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:904: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
-  ac_cv_prog_gcc_g=yes
-else
-  ac_cv_prog_gcc_g=no
-fi
-rm -f conftest*
-
-fi
-    echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
-    if test $ac_cv_prog_gcc_g = yes; then
-      CFLAGS="-g -O"
-    else
-      CFLAGS="-O"
-    fi
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
   fi
 else
@@ -683,9 +958,10 @@
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:961: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
@@ -710,9 +986,16 @@
     esac
   done
-  IFS="$ac_save_ifs"
-  # As a last resort, use the slow shell script.
-  test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"
-fi
-  INSTALL="$ac_cv_path_install"
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
 fi
 echo "$ac_t""$INSTALL" 1>&6
@@ -725,4 +1008,5 @@
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1011: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -745,5 +1029,6 @@
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-set dummy ${MAKE-make}; ac_make=$2
+echo "configure:1032: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -773,4 +1058,5 @@
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1061: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -800,4 +1086,5 @@
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1089: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -814,10 +1101,11 @@
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 817 "configure"
+#line 1104 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
@@ -825,13 +1113,16 @@
 else
   echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 831 "configure"
+#line 1121 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
@@ -839,4 +1130,6 @@
 else
   echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP=/lib/cpp
@@ -854,6 +1147,7 @@
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
+echo "configure:1150: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 858 "configure"
+#line 1152 "configure"
 #include "confdefs.h"
 #ifdef _AIX
@@ -877,4 +1171,5 @@
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:1174: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
@@ -896,15 +1191,17 @@
 fi
 
-ac_safe=`echo "minix/config.h" | tr './\055' '___'`
+ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
+echo "configure:1196: checking for minix/config.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 905 "configure"
+#line 1201 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
@@ -913,4 +1210,6 @@
 else
   echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=no"
@@ -942,4 +1241,5 @@
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
+echo "configure:1244: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -957,5 +1257,5 @@
   CFLAGS="$ac_save_CFLAGS $ac_arg"
   cat > conftest.$ac_ext <<EOF
-#line 960 "configure"
+#line 1260 "configure"
 #include "confdefs.h"
 #if !defined(__STDC__) || __STDC__ != 1
@@ -963,6 +1263,5 @@
 #endif	
 
-int main() { return 0; }
-int t() {
+int main() {
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
@@ -970,10 +1269,12 @@
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:1272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_prog_cc_stdc="$ac_arg"; break
-fi
-rm -f conftest*
-
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
 done
 CFLAGS="$ac_save_CFLAGS"
@@ -989,4 +1290,5 @@
 
 echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
+echo "configure:1293: checking for function prototypes" >&5
 if test "$ac_cv_prog_cc_stdc" != no; then
   echo "$ac_t""yes" 1>&6
@@ -1002,13 +1304,13 @@
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1307: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1009 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
+#line 1312 "configure"
+#include "confdefs.h"
+
+int main() {
 
 /* Ultrix mips cc rejects this.  */
@@ -1019,5 +1321,5 @@
 /* NEC SVR4.0.2 mips cc rejects this.  */
 struct point {int x, y;};
-static struct point const zero;
+static struct point const zero = {0,0};
 /* AIX XL C 1.02.0.0 rejects this.
    It does not let you subtract one const X* pointer from another in an arm
@@ -1056,14 +1358,16 @@
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:1361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_c_const=no
 fi
 rm -f conftest*
-
-fi
+fi
+
 echo "$ac_t""$ac_cv_c_const" 1>&6
 if test $ac_cv_c_const = no; then
@@ -1074,35 +1378,11 @@
 fi
 
-# If we cannot run a trivial program, we must be cross compiling.
-echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_c_cross=yes
-else
-cat > conftest.$ac_ext <<EOF
-#line 1086 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
-  ac_cv_c_cross=no
-else
-  ac_cv_c_cross=yes
-fi
-fi
-rm -fr conftest*
-fi
-cross_compiling=$ac_cv_c_cross
-echo "$ac_t""$ac_cv_c_cross" 1>&6
-
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1382: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1107 "configure"
+#line 1387 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
@@ -1111,5 +1391,6 @@
 #include <float.h>
 EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
@@ -1118,4 +1399,6 @@
 else
   echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_stdc=no
@@ -1126,5 +1409,5 @@
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1129 "configure"
+#line 1412 "configure"
 #include "confdefs.h"
 #include <string.h>
@@ -1144,5 +1427,5 @@
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1147 "configure"
+#line 1430 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
@@ -1162,8 +1445,8 @@
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 if test "$cross_compiling" = yes; then
-  ac_cv_header_stdc=no
-else
-cat > conftest.$ac_ext <<EOF
-#line 1168 "configure"
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1451 "configure"
 #include "confdefs.h"
 #include <ctype.h>
@@ -1176,14 +1459,19 @@
 
 EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
+if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
   :
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
   ac_cv_header_stdc=no
 fi
-fi
 rm -fr conftest*
 fi
-fi
+
+fi
+fi
+
 echo "$ac_t""$ac_cv_header_stdc" 1>&6
 if test $ac_cv_header_stdc = yes; then
@@ -1195,17 +1483,19 @@
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:1486: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1202 "configure"
+#line 1491 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
+#include <stddef.h>
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "off_t" >/dev/null 2>&1; then
+  egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_off_t=yes
@@ -1226,17 +1516,19 @@
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1519: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1233 "configure"
+#line 1524 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
+#include <stddef.h>
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "size_t" >/dev/null 2>&1; then
+  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_size_t=yes
@@ -1257,28 +1549,30 @@
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:1552: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1264 "configure"
+#line 1557 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
-int main() { return 0; }
-int t() {
+int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:1566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_time=no
 fi
 rm -f conftest*
-
-fi
+fi
+
 echo "$ac_t""$ac_cv_header_time" 1>&6
 if test $ac_cv_header_time = yes; then
@@ -1290,27 +1584,29 @@
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
+echo "configure:1587: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1297 "configure"
+#line 1592 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
-int main() { return 0; }
-int t() {
+int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:1600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_struct_tm=sys/time.h
 fi
 rm -f conftest*
-
-fi
+fi
+
 echo "$ac_t""$ac_cv_struct_tm" 1>&6
 if test $ac_cv_struct_tm = sys/time.h; then
@@ -1324,26 +1620,28 @@
 if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
 cat > conftest.$ac_ext <<EOF
-#line 1327 "configure"
+#line 1623 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 
-int main() { return 0; }
-int t() {
+int main() {
  FILE *rubbish = popen("yes", "r"); 
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:1631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   CC="`echo $CC | sed 's/-Xc/-Xa/'`"    ac_cv_prog_cc_stdc='-Xa'
 fi
 rm -f conftest*
-
-fi
-
-
-echo $ac_n "checking for -lm""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_lib_m'+set}'`\" = set"; then
+fi
+
+
+echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
+echo "configure:1644: checking for main in -lm" >&5
+ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1351,18 +1649,19 @@
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1354 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
+#line 1652 "configure"
+#include "confdefs.h"
+
+int main() {
 main()
 ; return 0; }
 EOF
-if eval $ac_link; then
-  rm -rf conftest*
-  eval "ac_cv_lib_m=yes"
-else
-  rm -rf conftest*
-  eval "ac_cv_lib_m=no"
+if { (eval echo configure:1659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
@@ -1370,7 +1669,8 @@
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'m`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo m | tr '[a-z]' '[A-Z]'`
+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
@@ -1387,32 +1687,33 @@
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:1692: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1396 "configure"
+#line 1697 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
-int main() { return 0; }
-int t() {
+int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:1705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=no"
 fi
 rm -f conftest*
-
 fi
 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
@@ -1425,6 +1726,8 @@
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-echo $ac_n "checking for -ldir""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_lib_dir'+set}'`\" = set"; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:1730: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1432,18 +1735,23 @@
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1435 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
+#line 1738 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char opendir();
+
+int main() {
 opendir()
 ; return 0; }
 EOF
-if eval $ac_link; then
-  rm -rf conftest*
-  eval "ac_cv_lib_dir=yes"
-else
-  rm -rf conftest*
-  eval "ac_cv_lib_dir=no"
+if { (eval echo configure:1749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
@@ -1451,5 +1759,5 @@
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'dir`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   LIBS="$LIBS -ldir"
@@ -1459,6 +1767,8 @@
 
 else
-echo $ac_n "checking for -lx""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_lib_x'+set}'`\" = set"; then
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:1771: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1466,18 +1776,23 @@
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1469 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
+#line 1779 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char opendir();
+
+int main() {
 opendir()
 ; return 0; }
 EOF
-if eval $ac_link; then
-  rm -rf conftest*
-  eval "ac_cv_lib_x=yes"
-else
-  rm -rf conftest*
-  eval "ac_cv_lib_x=no"
+if { (eval echo configure:1790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
@@ -1485,5 +1800,5 @@
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'x`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   LIBS="$LIBS -lx"
@@ -1495,9 +1810,10 @@
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1813: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1502 "configure"
+#line 1818 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
@@ -1506,5 +1822,6 @@
 #include <float.h>
 EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
@@ -1513,4 +1830,6 @@
 else
   echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_stdc=no
@@ -1521,5 +1840,5 @@
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1524 "configure"
+#line 1843 "configure"
 #include "confdefs.h"
 #include <string.h>
@@ -1539,5 +1858,5 @@
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1861 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
@@ -1557,8 +1876,8 @@
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 if test "$cross_compiling" = yes; then
-  ac_cv_header_stdc=no
-else
-cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1882 "configure"
 #include "confdefs.h"
 #include <ctype.h>
@@ -1571,14 +1890,19 @@
 
 EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
+if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
   :
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
   ac_cv_header_stdc=no
 fi
-fi
 rm -fr conftest*
 fi
-fi
+
+fi
+fi
+
 echo "$ac_t""$ac_cv_header_stdc" 1>&6
 if test $ac_cv_header_stdc = yes; then
@@ -1591,15 +1915,17 @@
 for ac_hdr in fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h
 do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1920: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1600 "configure"
+#line 1925 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
@@ -1608,4 +1934,6 @@
 else
   echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=no"
@@ -1615,5 +1943,5 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
@@ -1626,5 +1954,5 @@
 
 cat > conftest.$ac_ext <<EOF
-#line 1629 "configure"
+#line 1957 "configure"
 #include "confdefs.h"
 #include <stdio.h>
@@ -1641,5 +1969,5 @@
 
 cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1972 "configure"
 #include "confdefs.h"
 #include <stdio.h>
@@ -1656,5 +1984,5 @@
 
 cat > conftest.$ac_ext <<EOF
-#line 1659 "configure"
+#line 1987 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
@@ -1674,26 +2002,28 @@
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
+echo "configure:2005: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1681 "configure"
+#line 2010 "configure"
 #include "confdefs.h"
 #include <alloca.h>
-int main() { return 0; }
-int t() {
+int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_alloca_h=no
 fi
 rm -f conftest*
-
-fi
+fi
+
 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
 if test $ac_cv_header_alloca_h = yes; then
@@ -1705,9 +2035,10 @@
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then
+echo "configure:2038: checking for alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1712 "configure"
+#line 2043 "configure"
 #include "confdefs.h"
 
@@ -1728,21 +2059,22 @@
 #endif
 
-int main() { return 0; }
-int t() {
+int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if eval $ac_link; then
-  rm -rf conftest*
-  ac_cv_func_alloca=yes
-else
-  rm -rf conftest*
-  ac_cv_func_alloca=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_func_alloca" 1>&6
-if test $ac_cv_func_alloca = yes; then
+if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ac_cv_func_alloca_works=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_func_alloca_works=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
   cat >> confdefs.h <<\EOF
 #define HAVE_ALLOCA 1
@@ -1751,5 +2083,5 @@
 fi
 
-if test $ac_cv_func_alloca = no; then
+if test $ac_cv_func_alloca_works = no; then
   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
   # that cause trouble.  Some versions do not even contain alloca or
@@ -1763,9 +2095,10 @@
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:2098: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1770 "configure"
+#line 2103 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
@@ -1787,13 +2120,15 @@
 
 fi
+
 echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2128: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1798 "configure"
+#line 2133 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -1801,8 +2136,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char $ac_func(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -1817,14 +2153,16 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
@@ -1842,4 +2180,5 @@
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:2183: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1848,6 +2187,6 @@
   ac_cv_c_stack_direction=0
 else
-cat > conftest.$ac_ext <<EOF
-#line 1852 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 2191 "configure"
 #include "confdefs.h"
 find_stack_direction ()
@@ -1868,13 +2207,18 @@
 }
 EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
+if { (eval echo configure:2210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
   ac_cv_c_stack_direction=1
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
   ac_cv_c_stack_direction=-1
 fi
-fi
 rm -fr conftest*
 fi
+
+fi
+
 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
 cat >> confdefs.h <<EOF
@@ -1885,5 +2229,6 @@
 
 if test $ac_cv_prog_gcc = yes; then
-  echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
+    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
+echo "configure:2233: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1891,5 +2236,5 @@
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 1894 "configure"
+#line 2239 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
@@ -1909,5 +2254,5 @@
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 1912 "configure"
+#line 2257 "configure"
 #include "confdefs.h"
 #include <termio.h>
@@ -1923,5 +2268,6 @@
   fi
 fi
-  echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
+
+echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
@@ -1930,9 +2276,10 @@
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:2279: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1937 "configure"
+#line 2284 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
@@ -1942,22 +2289,25 @@
 #endif
 #ifdef __cplusplus
-extern "C"
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
 #endif
-void (*signal ()) ();
-int main() { return 0; }
-int t() {
+
+int main() {
 int i;
 ; return 0; }
 EOF
-if eval $ac_compile; then
+if { (eval echo configure:2301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_type_signal=int
 fi
 rm -f conftest*
-
-fi
+fi
+
 echo "$ac_t""$ac_cv_type_signal" 1>&6
 cat >> confdefs.h <<EOF
@@ -1967,9 +2317,10 @@
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:2320: checking for vprintf" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 2325 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -1977,8 +2328,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char vprintf(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char vprintf();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -1993,14 +2345,16 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_vprintf=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
   echo "$ac_t""yes" 1>&6
@@ -2015,9 +2369,10 @@
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:2372: checking for _doprnt" >&5
 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2022 "configure"
+#line 2377 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -2025,8 +2380,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char _doprnt(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char _doprnt();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -2041,14 +2397,16 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func__doprnt=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
   echo "$ac_t""yes" 1>&6
@@ -2066,9 +2424,10 @@
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2427: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2073 "configure"
+#line 2432 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -2076,8 +2435,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char $ac_func(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -2092,17 +2452,19 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_func 1
@@ -2117,9 +2479,10 @@
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2482: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2124 "configure"
+#line 2487 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -2127,8 +2490,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char $ac_func(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -2143,23 +2507,29 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  :
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
 else
   echo "$ac_t""no" 1>&6
 LIBOBJS="$LIBOBJS ${ac_func}.o"
 fi
-
 done
+
 
 
@@ -2168,4 +2538,5 @@
 # ---------------------------------------------------------------------------
 echo $ac_n "checking for HP-UX needing gmalloc""... $ac_c" 1>&6
+echo "configure:2541: checking for HP-UX needing gmalloc" >&5
 if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
   echo "$ac_t""yes" 1>&6
@@ -2180,9 +2551,10 @@
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2554: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2187 "configure"
+#line 2559 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -2190,8 +2562,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char $ac_func(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -2206,17 +2579,19 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_func 1
@@ -2231,7 +2606,8 @@
 
 echo $ac_n "checking if malloc debugging is wanted""... $ac_c" 1>&6
+echo "configure:2609: checking if malloc debugging is wanted" >&5
 # Check whether --with-dmalloc or --without-dmalloc was given.
-withval="$with_dmalloc"
-if test -n "$withval"; then
+if test "${with_dmalloc+set}" = set; then
+  withval="$with_dmalloc"
   if test "$withval" = yes; then
   echo "$ac_t""yes" 1>&6
@@ -2251,7 +2627,8 @@
 
 echo $ac_n "checking which of rx or regex is wanted""... $ac_c" 1>&6
+echo "configure:2630: checking which of rx or regex is wanted" >&5
 # Check whether --with-regex or --without-regex was given.
-withval="$with_regex"
-if test -n "$withval"; then
+if test "${with_regex+set}" = set; then
+  withval="$with_regex"
   if test "$withval" = yes; then
   ac_with_regex=1
@@ -2268,9 +2645,10 @@
   echo "$ac_t""rx" 1>&6
   echo $ac_n "checking for re_rx_search""... $ac_c" 1>&6
+echo "configure:2648: checking for re_rx_search" >&5
 if eval "test \"`echo '$''{'ac_cv_func_re_rx_search'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2275 "configure"
+#line 2653 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -2278,8 +2656,9 @@
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
-char re_rx_search(); 
-
-int main() { return 0; }
-int t() {
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char re_rx_search();
+
+int main() {
 
 /* The GNU C library defines this for functions which it implements
@@ -2294,14 +2673,16 @@
 ; return 0; }
 EOF
-if eval $ac_link; then
+if { (eval echo configure:2676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_re_rx_search=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_re_rx_search=no"
 fi
 rm -f conftest*
-
-fi
+fi
+
 if eval "test \"`echo '$ac_cv_func_'re_rx_search`\" = yes"; then
   echo "$ac_t""yes" 1>&6
@@ -2340,9 +2721,23 @@
 #
 EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
-  >> confcache
+  case `(ac_space=' '; set) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
 if cmp -s $cache_file confcache; then
   :
@@ -2399,5 +2794,5 @@
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.4"
+    echo "$CONFIG_STATUS generated by autoconf version 2.12"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
@@ -2412,8 +2807,10 @@
 trap 'rm -fr `echo "Makefile src/text/Makefile src/images/Makefile 
           src/scripts/Makefile lib/Makefile  config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-
-# Protect against being on the right side of a sed subst in config.status. 
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
 $ac_vpsub
 $extrasub
@@ -2427,4 +2824,16 @@
 s%@prefix@%$prefix%g
 s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
@@ -2446,4 +2855,40 @@
 CEOF
 EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# 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_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
 cat >> $CONFIG_STATUS <<EOF
 
@@ -2453,12 +2898,12 @@
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile]", defaulting infile="outfile.in".
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
   *) ac_file_in="${ac_file}.in" ;;
   esac
 
-  # Adjust relative srcdir, etc. for subdirectories.
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
 
   # Remove last slash and all that follows it.  Not all systems have dirname.
@@ -2488,4 +2933,5 @@
   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
   esac
+
   echo creating "$ac_file"
   rm -f "$ac_file"
@@ -2496,4 +2942,6 @@
   *) ac_comsub= ;;
   esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
   sed -e "$ac_comsub
 s%@configure_input@%$configure_input%g
@@ -2501,7 +2949,7 @@
 s%@top_srcdir@%$top_srcdir%g
 s%@INSTALL@%$INSTALL%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
 fi; done
-rm -f conftest.subs
+rm -f conftest.s*
 
 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
@@ -2524,9 +2972,15 @@
 ac_eD='%g'
 
-CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+  CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile]", defaulting infile="outfile.in".
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
   *) ac_file_in="${ac_file}.in" ;;
@@ -2536,5 +2990,6 @@
 
   rm -f conftest.frag conftest.in conftest.out
-  cp $ac_given_srcdir/$ac_file_in conftest.in
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  cat $ac_file_inputs > conftest.in
 
 EOF
@@ -2542,5 +2997,5 @@
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
-# Protect against being on the right side of a sed subst in config.status. 
+# Protect against being on the right side of a sed subst in config.status.
 # Protect against being in an unquoted here document in config.status.
 rm -f conftest.vals
@@ -2548,5 +3003,5 @@
 s/[\\&%]/\\&/g
 s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
 s%ac_d%ac_u%gp
 s%ac_u%ac_e%gp
@@ -2564,6 +3019,4 @@
 # Break up conftest.vals because some shells have a limit on
 # the size of here documents, and old seds have small limits too.
-# Maximum number of lines to put in a single here document.
-ac_max_here_lines=12
 
 rm -f conftest.tail
@@ -2596,4 +3049,10 @@
     rm -f conftest.h
   else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
     rm -f $ac_file
     mv conftest.h $ac_file
@@ -2601,5 +3060,9 @@
 fi; done
 
-
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 exit 0
Index: /trunk/gsdl/packages/mg-1.3d/lib/Makefile.in
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/Makefile.in	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/Makefile.in	(revision 30)
@@ -37,4 +37,11 @@
 DEFS = @DEFS@
 RANLIB = @RANLIB@
+
+##########################################
+# Uncomment for compiling for the nzdl project
+#
+CFLAGS = @CFLAGS@ -DQUIET
+##########################################
+
  
 prefix = @prefix@
@@ -76,5 +83,5 @@
     bitio_m_mems.h     bitio_stdio.h      huffman_stdio.h    sptree.h \
     regex.h            rx.h               pathmax.h          getpagesize.h \
-    random.h
+    random.h           frenchstem.h
 
 SOURCES = \
@@ -86,5 +93,6 @@
     timing.c          regex.c           rx.c              \
     alloca.c          error.c           xmalloc.c         strstr.c \
-    gmalloc.c         ftruncate.c       strcasecmp.c      random.c          
+    gmalloc.c         ftruncate.c       strcasecmp.c      random.c \
+    frenchstem.c
 
 OBJECTS = @ALLOCA@ @LIBOBJS@ \
@@ -96,5 +104,5 @@
     timing$o          regex$o		rx$o \
     error$o           xmalloc$o \
-    gmalloc$o         random$o
+    gmalloc$o         random$o          frenchstem$o
  
 DISTFILES = Makefile.in $(HEADERS) $(SOURCES)
Index: /trunk/gsdl/packages/mg-1.3d/lib/WIN32.MAK
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/WIN32.MAK	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/WIN32.MAK	(revision 30)
@@ -31,5 +31,5 @@
 #CFLAGS = -g -O 
 CPPFLAGS = 
-DEFS = -DHAVE_CONFIG_H -D__WIN32__ -D_LITTLE_ENDIAN
+DEFS = -DQUIET -DHAVE_CONFIG_H -D__WIN32__ -D_LITTLE_ENDIAN
  
 COMPILE = $(CC) -c $(DEFS) -I. -I..
@@ -53,6 +53,6 @@
     bitio_m_mem.h      bitio_random.h     huffman_mem.h      perf_hash.h \
     bitio_m_mems.h     bitio_stdio.h      huffman_stdio.h    sptree.h \
-    regex.h            rx.h               pathmax.h          getpagesize.h \
-    random.h
+                       rx.h               pathmax.h          getpagesize.h \
+    random.h           win32in.h          frenchstem.h
 
 SOURCES = \
@@ -62,9 +62,10 @@
     bitio_mem.c       getopt.c          huffman_stdio.c   sptree.c \
     bitio_mems.c      getopt1.c         local_strings.c   stem.c \
-    timing.c          regex.c           rx.c              \
+    timing.c                            rx.c              \
     alloca.c          error.c           xmalloc.c         strstr.c \
-    ftruncate.c       strcasecmp.c      random.c          
+    ftruncate.c       strcasecmp.c      random.c          win32in.c \
+    frenchstem.c
 
-OBJECTS =   rx.obj \
+OBJECTS =   rx$o \
     bitio_random$o    heap$o            memlib$o \
     bitio_stdio$o     huffman$o         messages$o \
@@ -72,7 +73,7 @@
     bitio_mem$o       getopt$o          huffman_stdio$o   sptree$o \
     bitio_mems$o      getopt1$o         local_strings$o   stem$o \
-    timing$o          regex$o \
+    timing$o           \
     error$o           xmalloc$o \
-    random$o
+    random$o          win32in$o         frenchstem$o
  
 DISTFILES = Makefile.in $(HEADERS) $(SOURCES)
@@ -101,8 +102,8 @@
 
 mostlyclean:
-	rm -f *.o *_.o
+	del *.obj
  
 clean: mostlyclean
-	rm -f libmg.lib
+	del libmg.lib
  
 distclean: clean
Index: /trunk/gsdl/packages/mg-1.3d/lib/alloca.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/alloca.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/alloca.c	(revision 30)
@@ -26,5 +26,5 @@
 #  include <win32cfg.h>
 # else
-#  include <config.h>
+#  include <sysfuncs.h>
 # endif
 #endif
Index: /trunk/gsdl/packages/mg-1.3d/lib/error.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/error.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/error.c	(revision 30)
@@ -22,5 +22,5 @@
 #  include <win32cfg.h>
 # else
-#  include <config.h>
+#  include <sysfuncs.h>
 # endif
 #endif
Index: /trunk/gsdl/packages/mg-1.3d/lib/frenchstem.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/frenchstem.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/frenchstem.c	(revision 30)
@@ -1,28 +1,61 @@
+/**************************************************************************
+ *
+ * frenchstem.c -- a simple french stemmer
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ *
+ **************************************************************************/
 
-static char * frenchstem (word)
-char *word;
-{      
-  int len = strlen(word)-1;
-  if (len > 4) {
-    if (word[len]=='x') {
-      if (word[len-1]=='u' && word[len-2]=='a') {
-	word[len-1]='l';
+#include "frenchstem.h"
+
+
+
+/* =========================================================================
+ * Function: frenchstem
+ * Description: a simple french stemmer
+ * Input: a word string with the length in the first byte
+ * Output: the stemmed word
+ * ========================================================================= */
+
+void frenchstem (unsigned char *word) {      
+  unsigned char *wordstart = word + 1; /* points to first letter of word */
+  int last = (int)word[0]-1;           /* last points to the last character */
+
+  if (last > 4) {
+    if (wordstart[last]=='x') {
+      if (wordstart[last-1]=='u' && wordstart[last-2]=='a') {
+	wordstart[last-1]='l';
       }
-      word[len]='\0';
-      return(word);
-    }
-    else {
-      if (word[len]=='s')
-	{word[len]='\0';len--;}
-      if (word[len]=='r')
-	{word[len]='\0';len--;}
-      if (word[len]=='e')
-	{word[len]='\0';len--;}
-      if (word[len]=='é')    /* letter with accent e + ' */
-	{word[len]='\0';len--;}
-      if (word[len] == word[len-1])
-	word[len]='\0';
+      wordstart[last]='\0';
+      last--;
+
+    } else {
+      if (wordstart[last]=='s' && last>=0) 
+	{wordstart[last]='\0'; last--;}
+      if (wordstart[last]=='r' && last>=0)
+	{wordstart[last]='\0'; last--;}
+      if (wordstart[last]=='e' && last>=0)
+	{wordstart[last]='\0'; last--;}
+      if (wordstart[last]=='é' && last>=0) /* letter with accent e + ' */
+	{wordstart[last]='\0'; last--;}
+      if (wordstart[last]==wordstart[last-1] && last>=1)
+	{wordstart[last]='\0'; last--;}
     }  /* end else */
+
+    word[0] = (unsigned char)(last+1);
   } /* end if (len > 4) */
-  return(word);
 }
Index: /trunk/gsdl/packages/mg-1.3d/lib/frenchstem.h
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/frenchstem.h	(revision 30)
+++ /trunk/gsdl/packages/mg-1.3d/lib/frenchstem.h	(revision 30)
@@ -0,0 +1,37 @@
+/**************************************************************************
+ *
+ * frenchstem.h -- a simple french stemmer
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ *
+ **************************************************************************/
+
+/*
+   $Log$
+   Revision 1.1  1998/11/24 06:37:53  rjmcnab
+
+   Incorporated the french stemmer better.
+
+
+ */
+
+#ifndef FRENCH_STEM_H
+#define FRENCH_STEM_H
+
+void frenchstem (unsigned char *word);
+
+#endif
Index: /trunk/gsdl/packages/mg-1.3d/lib/ftruncate.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/ftruncate.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/ftruncate.c	(revision 30)
@@ -6,5 +6,5 @@
 #  include <win32cfg.h>
 # else
-#  include <config.h>
+#  include <sysfuncs.h>
 # endif
 #endif
Index: /trunk/gsdl/packages/mg-1.3d/lib/getopt.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/getopt.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/getopt.c	(revision 30)
@@ -23,5 +23,5 @@
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "sysfuncs.h"
 #endif
 
Index: /trunk/gsdl/packages/mg-1.3d/lib/getopt1.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/getopt1.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/getopt1.c	(revision 30)
@@ -19,5 +19,5 @@
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "sysfuncs.h"
 #endif
 
Index: /trunk/gsdl/packages/mg-1.3d/lib/gmalloc.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/gmalloc.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/gmalloc.c	(revision 30)
@@ -34,5 +34,5 @@
 
 #ifdef	HAVE_CONFIG_H
-#include <config.h>
+#include <sysfuncs.h>
 #endif
 
Index: /trunk/gsdl/packages/mg-1.3d/lib/messages.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/messages.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/messages.c	(revision 30)
@@ -24,6 +24,10 @@
 /*
    $Log$
-   Revision 1.1  1998/11/17 09:32:14  rjmcnab
-   *** empty log message ***
+   Revision 1.2  1998/11/23 03:38:06  rjmcnab
+
+   combined unix and windows versions of mg
+
+   Revision 1.1  1998/11/19 03:00:32  sjboddie
+   Added windows gdbm and mg versions
 
    * Revision 1.1  1994/08/22  00:24:48  tes
@@ -72,4 +76,9 @@
   char *s, *pfx;
   va_list args;
+
+#ifdef QUIET
+  return; /* stop those messages!!!! */
+#endif  
+
   va_start (args, fmt);
   vsprintf (buf, fmt, args);
Index: /trunk/gsdl/packages/mg-1.3d/lib/regex.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/regex.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/regex.c	(revision 30)
@@ -31,5 +31,5 @@
 #  include <win32cfg.h>
 # else
-#  include <config.h>
+#  include <sysfuncs.h>
 # endif
 #endif
@@ -57,5 +57,5 @@
 /* If we are not linking with Emacs proper,
    we can't use the relocating allocator
-   even if config.h says that we can.  */
+   even if sysfuncs.h says that we can.  */
 #undef REL_ALLOC
 
@@ -160,8 +160,10 @@
    eliminate the && through constant folding."  */
 
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-#define ISASCII(c) 1
-#else
-#define ISASCII(c) isascii(c)
+#ifndef ISASCII
+#  if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
+#    define ISASCII(c) 1
+#  else
+#    define ISASCII(c) isascii(c)
+#  endif
 #endif
 
@@ -966,5 +968,5 @@
 
 /* When using GNU C, we are not REALLY using the C alloca, no matter
-   what config.h may say.  So don't take precautions for it.  */
+   what sysfuncs.h may say.  So don't take precautions for it.  */
 #ifdef __GNUC__
 #undef C_ALLOCA
Index: /trunk/gsdl/packages/mg-1.3d/lib/rx.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/rx.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/rx.c	(revision 30)
@@ -36,5 +36,5 @@
 #  include <malloc.h>
 # else
-#  include <config.h>
+#  include <sysfuncs.h>
 # endif
 #endif
Index: /trunk/gsdl/packages/mg-1.3d/lib/rx.h
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/rx.h	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/rx.h	(revision 30)
@@ -2185,5 +2185,5 @@
  * that make sense only in Emacs. 
  */
-#include "config.h"
+#include "sysfuncs.h"
 #include "lisp.h"
 #include "buffer.h"
Index: /trunk/gsdl/packages/mg-1.3d/lib/win32in.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/win32in.c	(revision 30)
+++ /trunk/gsdl/packages/mg-1.3d/lib/win32in.c	(revision 30)
@@ -0,0 +1,72 @@
+/* This module provides an equivalent of <netinet/in.h> on  */
+/* unix systems. */
+
+unsigned long htonl(unsigned long x) {
+#if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
+	x = ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) |
+		((x << 8) & 0x00FF0000) | ((x << 24) & 0xFF000000);
+#endif
+
+	return x;
+}
+
+unsigned long ntohl(unsigned long x) {
+#if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
+	x = ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) |
+		((x << 8) & 0x00FF0000) | ((x << 24) & 0xFF000000);
+#endif
+	return x;
+}
+
+unsigned short htons(unsigned short x) {
+#if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
+	x = ((x >> 8) & 0x00FF) | ((x << 8) & 0xFF00);
+#endif
+	return x;
+}
+
+unsigned short ntohs(unsigned short x) {
+#if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
+	x = ((x >> 8) & 0x00FF) | ((x << 8) & 0xFF00);
+#endif
+	return x;
+}
+
+/* just to test stuff
+#include <stdio.h>
+
+main () {
+	long x;
+	short sx;
+
+	x = 0x000000FF;
+	printf ("before %i, ",(int)x);
+	x = htonl (x);
+	printf ("after %i\n",(int)x);
+
+	x = 0x0000FF00;
+	printf ("before %i, ",(int)x);
+	x = htonl (x);
+	printf ("after %i\n",(int)x);
+
+	x = 0x00FF0000;
+	printf ("before %i, ",(int)x);
+	x = htonl (x);
+	printf ("after %i\n",(int)x);
+
+	x = 0xFF000000;
+	printf ("before %i, ",(int)x);
+	x = htonl (x);
+	printf ("after %i\n\n",(int)x);
+
+	sx = 0x00FF;
+	printf ("before %i, ",(int)sx);
+	sx = htons (sx);
+	printf ("after %i\n",(int)sx);
+
+	sx = 0xFF00;
+	printf ("before %i, ",(int)sx);
+	sx = htons (sx);
+	printf ("after %i\n",(int)sx);
+}
+*/
Index: /trunk/gsdl/packages/mg-1.3d/lib/xmalloc.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/lib/xmalloc.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/lib/xmalloc.c	(revision 30)
@@ -20,5 +20,5 @@
 #  include <win32cfg.h>
 # else
-#  include <config.h>
+#  include <sysfuncs.h>
 # endif
 #endif
Index: /trunk/gsdl/packages/mg-1.3d/src/text/MGPASS.C
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/src/text/MGPASS.C	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/src/text/MGPASS.C	(revision 30)
@@ -49,4 +49,12 @@
 /*
    $Log$
+   Revision 1.3  1998/11/24 03:39:23  rjmcnab
+
+   Fixed a small error in the windows compilation
+
+   Revision 1.2  1998/11/24 01:29:39  rjmcnab
+
+   Fixed a few problems with the windows build
+
    Revision 1.1  1998/11/17 09:34:12  rjmcnab
    *** empty log message ***
@@ -82,7 +90,7 @@
 FILE *Comp_Stats = NULL;
 int comp_stat_point = 0;
-u_long bytes_processed = 0;
+double bytes_processed = 0;
 int num_docs = 0;
-u_long bytes_received = 0;
+double bytes_received = 0;
 int stem_method = 0;
 
Index: /trunk/gsdl/packages/mg-1.3d/src/text/WIN32.MAK
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/src/text/WIN32.MAK	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/src/text/WIN32.MAK	(revision 30)
@@ -14,5 +14,5 @@
 #CFLAGS = -g -O
 CPPFLAGS =
-DEFS = -DHAVE_CONFIG_H -D__WIN32__ -D_LITTLE_ENDIAN
+DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H -D__WIN32__ -D_LITTLE_ENDIAN
 #INSTALL = /usr/local/gnu/bin/install -c
 #INSTALL_DATA = ${INSTALL} -m 644
@@ -78,5 +78,5 @@
   ivf.pass2.c             mg_text_estimate.c      text_get.c           \
   lists.c                 mg_text_merge.c         weights.c            \
-  query_term_list.c       mgpass.c                builder.cpp
+  mgpass.c                query_term_list.c       
 
 HEADERS = \
@@ -105,6 +105,6 @@
 		mg_hilite_words$e     mg_invf_merge$e \
 		mg_text_merge$e     bool_tester$e  mgpass$e \
-		mg_stem_idx$e  mgstemidxlist$e  mg_decompress_text$e \
-		builder$e
+		mg_stem_idx$e  mgstemidxlist$e \
+                mg_decompress_text$e
 
 MAN           = mgquery.1 mg_weights_build.1 mgstat.1 mg_invf_dump.1 mg_invf_dict.1 \
@@ -117,5 +117,5 @@
 
 
-all:    $(EXEC)
+all:    $(EXEC) libtextin.lib
 
 
@@ -253,6 +253,5 @@
 	$(LINK) $(PERF_HASH_OBJS) $(LIBS)
 
-STEM_IDX_OBJS = \
-                mg_stem_idx$o mg_files$o stemmer$o locallib$o \
+STEM_IDX_OBJS = mg_stem_idx$o mg_files$o stemmer$o locallib$o \
                 mg_errors$o term_lists$o
 
@@ -265,8 +264,7 @@
 	$(LINK) $(STEM_IDX_LIST_OBJS) $(LIBS)
 
-DECOMPRESS_TEXT_OBJS = \
-                mg_decompress_text$o mg_files$o mg_errors$o \
-                text_get$o locallib$o backend$o stem_search$o \
-                term_lists$o stemmer$o weights$o invf_get$o lists$o
+DECOMPRESS_TEXT_OBJS = mg_decompress_text$o query_term_list$o mg_files$o mg_errors$o \
+                       text_get$o locallib$o backend$o stem_search$o \
+                       term_lists$o stemmer$o weights$o invf_get$o lists$o
 
 mg_decompress_text$e: $(DECOMPRESS_TEXT_OBJS)
@@ -317,4 +315,17 @@
 
 
+LIB_OBJS = \
+	query_term_list$o \
+	locallib$o lists$o \
+	query.ranked$o query.docnums$o stem_search$o \
+	environment$o commands$o weights$o text_get$o stemmer$o \
+	read_line$o mg_errors$o backend$o invf_get$o \
+	term_lists$o bool_tree$o bool_parser$o bool_optimiser$o bool_query$o
+
+libtextin.lib: $(LIB_OBJS)
+	del libtextin.lib
+	lib /out:libtextin.lib $(LIB_OBJS)
+
+
 mostlyclean:
 	rm -f *$o _*.c _*.o *._c *._o core core.*
Index: /trunk/gsdl/packages/mg-1.3d/src/text/bool_parser.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/src/text/bool_parser.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/src/text/bool_parser.c	(revision 30)
@@ -1,6 +1,12 @@
 #ifndef lint
-static char yysccsid[] = "@(#)yaccpar	1.8 (Berkeley) 01/20/90";
+static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
 #endif
 #define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+#define yyclearin (yychar=(-1))
+#define yyerrok (yyerrflag=0)
+#define YYRECOVERING (yyerrflag!=0)
+#define YYPREFIX "yy"
 #line 25 "bool_parser.y"
  
@@ -46,5 +52,5 @@
   bool_tree_node *node;
 } YYSTYPE;
-#line 49 "y.tab.c"
+#line 55 "y.tab.c"
 #define TERM 257
 #define YYERRCODE 256
@@ -158,10 +164,7 @@
 };
 #endif
-#define yyclearin (yychar=(-1))
-#define yyerrok (yyerrflag=0)
 #ifdef YYSTACKSIZE
-#ifndef YYMAXDEPTH
+#undef YYMAXDEPTH
 #define YYMAXDEPTH YYSTACKSIZE
-#endif
 #else
 #ifdef YYMAXDEPTH
@@ -401,6 +404,7 @@
  
 
-#line 404 "y.tab.c"
+#line 407 "y.tab.c"
 #define YYABORT goto yyabort
+#define YYREJECT goto yyabort
 #define YYACCEPT goto yyaccept
 #define YYERROR goto yyerrlab
@@ -440,6 +444,6 @@
             if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
             if (!yys) yys = "illegal-symbol";
-            printf("yydebug: state %d, reading %d (%s)\n", yystate,
-                    yychar, yys);
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
         }
 #endif
@@ -450,6 +454,6 @@
 #if YYDEBUG
         if (yydebug)
-            printf("yydebug: state %d, shifting to state %d\n",
-                    yystate, yytable[yyn]);
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
 #endif
         if (yyssp >= yyss + yystacksize - 1)
@@ -491,6 +495,6 @@
 #if YYDEBUG
                 if (yydebug)
-                    printf("yydebug: state %d, error recovery shifting\
- to state %d\n", *yyssp, yytable[yyn]);
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
 #endif
                 if (yyssp >= yyss + yystacksize - 1)
@@ -506,6 +510,6 @@
 #if YYDEBUG
                 if (yydebug)
-                    printf("yydebug: error recovery discarding state %d\n",
-                            *yyssp);
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yyssp);
 #endif
                 if (yyssp <= yyss) goto yyabort;
@@ -524,6 +528,6 @@
             if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
             if (!yys) yys = "illegal-symbol";
-            printf("yydebug: state %d, error recovery discards token %d (%s)\n",
-                    yystate, yychar, yys);
+            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
         }
 #endif
@@ -534,6 +538,6 @@
 #if YYDEBUG
     if (yydebug)
-        printf("yydebug: state %d, reducing by rule %d (%s)\n",
-                yystate, yyn, yyrule[yyn]);
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
 #endif
     yym = yylen[yyn];
@@ -577,5 +581,5 @@
 { yyval.node = CreateBoolTreeNode(N_or, yyvsp[-2].node, yyvsp[0].node); }
 break;
-#line 580 "y.tab.c"
+#line 584 "y.tab.c"
     }
     yyssp -= yym;
@@ -587,6 +591,6 @@
 #if YYDEBUG
         if (yydebug)
-            printf("yydebug: after reduction, shifting from state 0 to\
- state %d\n", YYFINAL);
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
 #endif
         yystate = YYFINAL;
@@ -602,6 +606,6 @@
                 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
                 if (!yys) yys = "illegal-symbol";
-                printf("yydebug: state %d, reading %d (%s)\n",
-                        YYFINAL, yychar, yys);
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
             }
 #endif
@@ -617,6 +621,6 @@
 #if YYDEBUG
     if (yydebug)
-        printf("yydebug: after reduction, shifting from state %d \
-to state %d\n", *yyssp, yystate);
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yyssp, yystate);
 #endif
     if (yyssp >= yyss + yystacksize - 1)
Index: /trunk/gsdl/packages/mg-1.3d/src/text/mg_hilite_words.c
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/src/text/mg_hilite_words.c	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/src/text/mg_hilite_words.c	(revision 30)
@@ -628,5 +628,5 @@
  * ========================================================================= */
 
-void
+int
 main (int argc, char *argv[])
 {
@@ -684,3 +684,4 @@
 #endif
 
-}
+  return 0;
+}
Index: /trunk/gsdl/packages/mg-1.3d/src/text/stemmer.h
===================================================================
--- /trunk/gsdl/packages/mg-1.3d/src/text/stemmer.h	(revision 20)
+++ /trunk/gsdl/packages/mg-1.3d/src/text/stemmer.h	(revision 30)
@@ -44,7 +44,2 @@
 
 #endif
-
-
-
-
-
Index: /trunk/gsdl/src/library/gdbmclass.cpp
===================================================================
--- /trunk/gsdl/src/library/gdbmclass.cpp	(revision 20)
+++ /trunk/gsdl/src/library/gdbmclass.cpp	(revision 30)
@@ -574,2 +574,113 @@
   return 1;
 }
+
+// functions related to sorting
+
+// returns whatever comes after ':#:' in str
+// -- this is a nasty hack that I'm sure Rodger will want to change ;-)
+text_t get_section_str(const text_t &str) {
+
+  text_t ret;
+  int found = 0;
+
+  text_t::const_iterator here = str.begin();
+  text_t::const_iterator end = str.end();
+
+  while (here != end) {
+    if (found) {
+      ret.push_back(*here);
+    } else {
+      here = findchar (here, end, ':');
+      if ((*(here+1) == '#') && (*(here+2) == ':')) {
+	found = 1;
+	here = here+2;
+      }
+    }
+    here ++;
+  }
+  return ret;
+}
+
+// removes leading spaces and leading 'the' 'a' and 'an' 
+// from string
+void alphabetize_string_english (text_t &text) {
+  
+  if (text.empty()) return;
+
+  text_t firstword;
+  char *word;
+
+  text_t::iterator here = text.begin();
+  text_t::const_iterator end = text.end();
+
+  if ((*here != ' ') && (*here != 'a') && (*here != 'A') &&
+      (*here != 't') && (*here != 'T')) return;
+
+  int foundchar = 0;
+  while (here != end) {
+    if (*here == ' ' && !foundchar) {here ++; continue;}
+    if (*here == ' ' && foundchar) {
+      text.erase(text.begin(), (here+1));
+      break;
+    }
+    foundchar ++;
+    if (foundchar == 1) {
+      getdelimitstr (here, end, ' ', firstword);
+      word = firstword.getcstr();
+      if ((_stricmp(word, "the") != 0) && (_stricmp(word, "a") != 0) &&
+	  (_stricmp(word, "an") != 0)) break;
+    }
+    here ++;
+  }
+  delete word;
+}
+
+// removes leading space, puts last name before 
+// any preceeding names
+void alphabetize_string_name (text_t &text) {
+  
+  if (text.empty()) return;
+  
+  text_t lastname;
+  char *lname;
+  vector<text_t> words;
+  splitchar (text.begin(), text.end(), ' ', words);
+  lastname = words.back();
+  words.pop_back();
+  lname = lastname.getcstr();
+  
+  while ((_stricmp(lname, "jnr") == 0) || (_stricmp(lname, "snr") == 0) ||
+	 (_stricmp(lname, "esq") == 0)) {
+    lastname = words.back();
+    words.pop_back();
+    lname = lastname.getcstr();
+  }
+
+  text.clear();
+  joinchar (words, ' ', text);
+  text = lastname + text;
+}
+
+char ** string_add (char **array, int *len, char *str) {
+  char **ret;
+
+  ret = (char**)realloc(array, (*len+1)*sizeof(char*));
+  ret[*len] = (char*)strdup(str);
+  (*len) ++;
+
+  return ret;
+}
+
+void string_sort (char **array, int len) {
+  qsort((void*)array, (unsigned int)(len), sizeof(char*), compare_str);
+}
+
+static int compare_str (const void *e1, const void *e2) {
+  return _stricmp(*((char**)e1), *((char**)e2));
+}
+
+void string_free(char **array, int len) {
+  for (int i = 0; i < len; i++)
+    free (array[i]);
+  free (array);
+}
Index: /trunk/gsdl/src/library/gdbmclass.h
===================================================================
--- /trunk/gsdl/src/library/gdbmclass.h	(revision 20)
+++ /trunk/gsdl/src/library/gdbmclass.h	(revision 30)
@@ -82,3 +82,10 @@
 void get_first_section(const text_t &instring, text_t &returnstring);
 int is_number (text_t &text);
+text_t get_section_str(const text_t &str);
+void alphabetize_string_english (text_t &text);
+void alphabetize_string_name (text_t &text);
+char ** string_add (char **array, int *len, char *str);
+void string_sort (char **array, int len);
+static int compare_str (const void *e1, const void *e2);
+void string_free(char **array, int len);
 #endif
