Index: kit/CHANGELOG
diff -u kit/CHANGELOG:1.9 kit/CHANGELOG:removed
--- kit/CHANGELOG:1.9	Sat Sep  5 00:11:21 1998
+++ kit/CHANGELOG	Mon Mar  1 05:10:00 2004
@@ -1,51 +0,0 @@
-CHANGELOG for magicpoint
-$Id: CHANGELOG,v 1.9 1998/09/04 15:11:21 onoe Exp $
-
-Fri Sep  5 1998  onoe@sm.sony.co.jp
-	* handle key inputs from invoked terminal as pressed on Xserver,
-	  even if the Xserver is running on a remote host.
-
-Mon Aug 26 1998  itojun@iijlab.net
-	* new copyright. (BSDish copyright without clause 3)
-
-Mon Aug 25 1998  itojun@iijlab.net
-	* print.c: better x11/freetype/vflib -> postscript font mapping.
-
-Mon Aug 23 1998  kato@wide.ad.jp
-	* embedded image support (added mgpembed.pl and embed.c)
-
-Mon Aug 22 1998  itojun@iijlab.net
-	* added contrib/xmindpath, MindPath PocketPoint user-level driver.
-
-Fri Jul 10 11:57:59 JST 1998  itojun@iijlab.net
-	* cache gs-generated image file.
-	  Suggested by: luigi@FreeBSD.org
-
-Mon Jul  6 11:38:32 JST 1998  itojun@iijlab.net
-	* capable of handling GB2312 and KSC5601 encoding.
-	  they must be encoded by using iso-2022 like escape sequences.
-	  EUC-cn or EUC-kr does not work.
-	* -x option is added.
-
-Thu Jul  2 18:04:16 JST 1998  itojun@iijlab.net
-	* eliminate gsview.
-	* revamp "xfont" directive. (see SYNTAX for detail)
-
-Thu Jun 25 13:10:28 JST 1998  itojun@iijlab.net
-	* print.c: color postscript support by "mgp2ps -c".
-
-changes between 1.02a and 1.03a:
-	* To allow color name that has space inbetween ("dark blue"), 
-	  color name after directives SHOULD come with doublequote.
-	  Therefore,
-		%fore blue
-	  should be
-		%fore "blue"
-	  At this moment, doublequote can be ommitted for backward
-	  compatibility.  We may require to have doublequote in the future.
-	  Font names and other string parameter obeys the same rule.
-	* %image is now capable of rendering encapsulated postscript files
-	  (*.eps).
-		%image foo.eps
-	  should work fine.
-	  By using -X option, you can specify device name for ghostscript.
Index: kit/Imakefile.in
diff -u kit/Imakefile.in:1.51 kit/Imakefile.in:1.52
--- kit/Imakefile.in:1.51	Sun Feb  4 03:46:49 2001
+++ kit/Imakefile.in	Sat Feb 28 06:06:14 2004
@@ -1,4 +1,4 @@
-# $Id: Imakefile.in,v 1.51 2001/02/03 18:46:49 nishida Exp $
+# $Id: Imakefile.in,v 1.52 2004/02/27 21:06:14 itojun Exp $
 
 @SET_MAKE@
 srcdir=	@srcdir@
@@ -125,6 +125,12 @@
 snprintf.o: missing/snprintf.c
 	$(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
 		$(srcdir)/missing/snprintf.c
+strlcpy.o: missing/strlcpy.c
+	$(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+		$(srcdir)/missing/strlcpy.c
+strlcat.o: missing/strlcat.c
+	$(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+		$(srcdir)/missing/strlcat.c
 
 distclean:: clean
 	-/bin/rm -f config.status config.log config.cache ctlwords.h
Index: kit/README.xft
diff -u kit/README.xft:1.2 kit/README.xft:1.4
--- kit/README.xft:1.2	Mon Jun 16 15:26:30 2003
+++ kit/README.xft	Sat Feb 28 11:50:10 2004
@@ -24,7 +24,7 @@
 
 If you have the "fc-list" command which is part of the fontconfig package 
 and if it shows names of the fonts on your system, both libraries have been
-successfully installed. 
+successfully installed.   use %xfont directive to specify which font to use.
 
 If you don't have these libraries, the following URL will be useful.
 
Index: kit/SYNTAX
diff -u kit/SYNTAX:1.38 kit/SYNTAX:1.39
--- kit/SYNTAX:1.38	Fri Oct  3 03:31:15 2003
+++ kit/SYNTAX	Sat Feb 28 07:43:07 2004
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.38 2003/10/02 18:31:15 nishida Exp $
+$Id: SYNTAX,v 1.39 2004/02/27 22:43:07 itojun Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -139,6 +139,10 @@
 	It would be nice if we can support "adobe-specific" for symbols,
 	however, we have no escape sequence to designate the it...
 
+
+	if you have installed magicpoint with Xft2 enabled, %xfont will accept
+	"FONTNAME", "FONTNAME:STYLE", and "FONTNAME:style=STYLE".
+
 %vfont "font"
 	<font> :: use VFlib's <font> to draw Kanji characters.
 
@@ -151,12 +155,16 @@
 	<font> :: use TrueType font <font> to draw Kanji characters.
 		<font> can be full pathname, or just filename. 
 
+	you do not need it with Xft2 enabled installation.
+
 %tfont0 "font"
 	<font> :: use TrueType font <font>, if none of the font specified by
 		%tfont directive is found.  This is the last-resort for the
 		TrueType font finding code.
 		(allowed in ~/.mgprc, without "%" sign)
 
+	you do not need it with Xft2 enabled installation.
+
 %bar <color> <width> <start> <length>
 	<color> :: color of bar, foreground color will be used as default.
 	<width> :: permill of display height. default 10.
Index: kit/configure
diff -u kit/configure:1.91 kit/configure:1.92
--- kit/configure:1.91	Tue Dec  2 07:08:56 2003
+++ kit/configure	Sat Feb 28 06:06:14 2004
@@ -1,19 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.53.
+# Generated by GNU Autoconf 2.57.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
 # Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -22,11 +14,13 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
 
-# NLS nuisances.
 # Support unset when possible.
 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
   as_unset=unset
@@ -34,34 +28,42 @@
   as_unset=false
 fi
 
-(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
-    { $as_unset LANG || test "${LANG+set}" != set; } ||
-      { LANG=C; export LANG; }
-(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
-    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
-      { LC_ALL=C; export LC_ALL; }
-(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
-    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
-      { LC_TIME=C; export LC_TIME; }
-(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
-    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
-      { LC_CTYPE=C; export LC_CTYPE; }
-(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
-    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
-      { LANGUAGE=C; export LANGUAGE; }
-(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
-    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
-      { LC_COLLATE=C; export LC_COLLATE; }
-(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
-    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
-      { LC_NUMERIC=C; export LC_NUMERIC; }
-(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
-    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
-      { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
 
 
 # Name of the executable.
-as_me=`(basename "$0") 2>/dev/null ||
+as_me=`$as_basename "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)$' \| \
@@ -72,6 +74,7 @@
   	  /^X\/\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
 
+
 # PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
@@ -82,15 +85,15 @@
 
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conftest.sh
-  echo  "exit 0"   >>conftest.sh
-  chmod +x conftest.sh
-  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
     PATH_SEPARATOR=';'
   else
     PATH_SEPARATOR=:
   fi
-  rm -f conftest.sh
+  rm -f conf$$.sh
 fi
 
 
@@ -138,6 +141,8 @@
   as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
   test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
 	     CONFIG_SHELL=$as_dir/$as_base
 	     export CONFIG_SHELL
 	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
@@ -210,6 +215,12 @@
 fi
 rm -f conf$$ conf$$.exe conf$$.file
 
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
+
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
@@ -226,7 +237,7 @@
 IFS=" 	$as_nl"
 
 # CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+$as_unset CDPATH
 
 
 # Name of the host.
@@ -240,6 +251,7 @@
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
 cross_compiling=no
 subdirs=
 MFLAGS=
@@ -296,6 +308,8 @@
 # include <unistd.h>
 #endif"
 
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP AWK YACC LEX LEXLIB LEX_OUTPUT_ROOT mgp_cv_path_perl mgp_cv_path_uuencode mgp_cv_path_gzip mgp_cv_path_uudecode mgp_cv_path_gunzip OPTFLAGS DEPLIBS EGREP LIBOBJS mgp_cv_vflib_a USE_IMLIB mgp_keywords LTLIBOBJS'
+ac_subst_files=''
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -719,6 +733,9 @@
    { (exit 1); exit 1; }; }
   fi
 fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
 ac_env_build_alias_set=${build_alias+set}
 ac_env_build_alias_value=$build_alias
@@ -893,7 +910,7 @@
 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
 # absolute.
 ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
 ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
 ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
 
@@ -933,7 +950,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.53.  Invocation command line was
+generated by GNU Autoconf 2.57.  Invocation command line was
 
   $ $0 $@
 
@@ -985,27 +1002,54 @@
 
 # Keep a trace of the command line.
 # Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
 # Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
 ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
 ac_sep=
-for ac_arg
+ac_must_keep_next=false
+for ac_pass in 1 2
 do
-  case $ac_arg in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n ) continue ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    continue ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-  esac
-  case " $ac_configure_args " in
-    *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-    *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-       ac_sep=" " ;;
-  esac
-  # Get rid of the leading space.
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+        ac_must_keep_next=false # Got value, back to normal.
+      else
+        case $ac_arg in
+          *=* | --config-cache | -C | -disable-* | --disable-* \
+          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+          | -with-* | --with-* | -without-* | --without-* | --x)
+            case "$ac_configure_args0 " in
+              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+            esac
+            ;;
+          -* ) ac_must_keep_next=true ;;
+        esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
 done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -1016,6 +1060,7 @@
   # Save into config.log some information that might help in debugging.
   {
     echo
+
     cat <<\_ASBOX
 ## ---------------- ##
 ## Cache variables. ##
@@ -1038,6 +1083,35 @@
     esac;
 }
     echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+        echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
     if test -s confdefs.h; then
       cat <<\_ASBOX
 ## ----------- ##
@@ -1045,7 +1119,7 @@
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h
+      sed "/^$/d" confdefs.h | sort
       echo
     fi
     test "$ac_signal" != 0 &&
@@ -1203,15 +1277,16 @@
 
 
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.make <<\_ACEOF
 all:
-	@echo 'ac_maketemp="${MAKE}"'
+	@echo 'ac_maketemp="$(MAKE)"'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
@@ -1515,9 +1590,7 @@
     # 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 "$as_dir/$ac_word" ${1+"$@"}
-    shift
-    ac_cv_prog_CC="$@"
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
   fi
 fi
 fi
@@ -1622,8 +1695,10 @@
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;}
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
@@ -1648,14 +1723,12 @@
 
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1665,7 +1738,7 @@
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe"
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
@@ -1684,26 +1757,39 @@
 # Be careful to initialize this variable, since it used to be cached.
 # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
 ac_cv_exeext=
-for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null;
-                ls a.out conftest 2>/dev/null;
-                ls a.* conftest.* 2>/dev/null`; do
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
-    a.out ) # We found the default executable, but exeext='' is most
-            # certainly right.
-            break;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
-          export ac_cv_exeext
-          break;;
-    * ) break;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+        ;;
+    conftest.$ac_ext )
+        # This is the source file.
+        ;;
+    [ab].out )
+        # We found the default executable, but exeext='' is most
+        # certainly right.
+        break;;
+    *.* )
+        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+        # FIXME: I believe we export ac_cv_exeext for Libtool,
+        # but it would be cool to find out if it's true.  Does anybody
+        # maintain Libtool? --akim.
+        export ac_cv_exeext
+        break;;
+    * )
+        break;;
   esac
 done
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5
-echo "$as_me: error: C compiler cannot create executables" >&2;}
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }
 fi
 
@@ -1730,9 +1816,11 @@
 	cross_compiling=yes
     else
 	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'." >&5
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
 echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'." >&2;}
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
     fi
   fi
@@ -1740,7 +1828,7 @@
 echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-rm -f a.out a.exe conftest$ac_cv_exeext
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
@@ -1760,9 +1848,10 @@
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
 # `rm'.
-for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
           export ac_cv_exeext
           break;;
@@ -1770,8 +1859,10 @@
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -1789,14 +1880,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1813,16 +1902,19 @@
   (exit $ac_status); }; then
   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -1839,14 +1931,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1873,7 +1963,8 @@
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_compiler_gnu=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -1893,14 +1984,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1924,7 +2013,8 @@
   ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_prog_cc_g=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -1946,6 +2036,102 @@
     CFLAGS=
   fi
 fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
 # Some people use a C++ compiler to compile C.  Since we use `exit',
 # in C++ we need to declare it.  In case someone uses the same compiler
 # for both compiling C and C++ we need to have the C++ compiler decide
@@ -1978,15 +2164,13 @@
 do
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
 $ac_declaration
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2010,20 +2194,19 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 continue
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_declaration
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2047,7 +2230,8 @@
   break
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 done
@@ -2060,7 +2244,8 @@
 
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
@@ -2092,18 +2277,28 @@
 do
   # Use a header file that comes with gcc, so configuring glibc
   # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
-#include <assert.h>
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
                      Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -2120,7 +2315,8 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
@@ -2130,13 +2326,17 @@
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -2154,7 +2354,8 @@
 continue
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
@@ -2183,18 +2384,28 @@
 do
   # Use a header file that comes with gcc, so configuring glibc
   # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
-#include <assert.h>
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
                      Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -2211,7 +2422,8 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
@@ -2221,13 +2433,17 @@
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -2245,7 +2461,8 @@
 continue
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
@@ -2258,8 +2475,10 @@
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -2403,7 +2622,11 @@
 LIBS="-lfl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -2412,12 +2635,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char yywrap ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2441,7 +2658,8 @@
   ac_cv_lib_fl_yywrap=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_fl_yywrap=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -2461,7 +2679,11 @@
 LIBS="-ll  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -2470,12 +2692,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char yywrap ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2499,7 +2715,8 @@
   ac_cv_lib_l_yywrap=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_l_yywrap=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -2577,7 +2794,8 @@
   ac_cv_prog_lex_yytext_pointer=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_save_LIBS
@@ -2868,6 +3086,21 @@
 echo "${ECHO_T}$mgp_locale" >&6
 
 
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
@@ -2875,48 +3108,59 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <float.h>
 
+int
+main ()
+{
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_header_stdc=no
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
+  $EGREP "memchr" >/dev/null 2>&1; then
   :
 else
   ac_cv_header_stdc=no
@@ -2929,12 +3173,16 @@
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
+  $EGREP "free" >/dev/null 2>&1; then
   :
 else
   ac_cv_header_stdc=no
@@ -2950,13 +3198,18 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
-# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+# define ISLOWER(c) \
+                   (('a' <= (c) && (c) <= 'i') \
                      || ('j' <= (c) && (c) <= 'r') \
                      || ('s' <= (c) && (c) <= 'z'))
 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
@@ -2989,11 +3242,12 @@
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
@@ -3014,7 +3268,11 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/wait.h>
 #ifndef WEXITSTATUS
@@ -3024,12 +3282,6 @@
 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3055,7 +3307,8 @@
   ac_cv_header_sys_wait_h=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_header_sys_wait_h=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3091,7 +3344,11 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
 
 #include <$ac_header>
@@ -3111,7 +3368,8 @@
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_Header=no"
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3155,7 +3413,11 @@
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
 #include <$ac_header>
 _ACEOF
@@ -3174,7 +3436,8 @@
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_header_compiler=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3186,13 +3449,17 @@
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -3209,7 +3476,8 @@
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   ac_header_preproc=no
 fi
 rm -f conftest.err conftest.$ac_ext
@@ -3222,14 +3490,32 @@
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
   no:yes )
     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
 esac
 echo "$as_me:$LINENO: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
@@ -3252,103 +3538,6 @@
 done
 
 
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
 echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 if test "${ac_cv_c_const+set}" = set; then
@@ -3356,14 +3545,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3433,7 +3620,8 @@
   ac_cv_c_const=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_c_const=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3457,10 +3645,15 @@
 for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #ifndef __cplusplus
-static $ac_kw int static_foo () {return 0; }
-$ac_kw int foo () {return 0; }
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
 #endif
 
 _ACEOF
@@ -3479,7 +3672,8 @@
   ac_cv_c_inline=$ac_kw; break
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 done
@@ -3507,14 +3701,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3541,7 +3733,8 @@
   ac_cv_type_pid_t=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_type_pid_t=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3565,14 +3758,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3599,7 +3790,8 @@
   ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_type_size_t=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3623,17 +3815,15 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3658,7 +3848,8 @@
   ac_cv_header_time=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_header_time=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3680,14 +3871,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3714,7 +3903,8 @@
   ac_cv_type_u_int=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_type_u_int=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3738,14 +3928,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3772,7 +3960,8 @@
   ac_cv_type_u_char=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_type_u_char=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3800,14 +3989,12 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3855,11 +4042,12 @@
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ( exit $ac_status )
 ac_cv_func_memcmp_working=no
 fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
@@ -3873,7 +4061,11 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <signal.h>
 #ifdef signal
@@ -3885,12 +4077,6 @@
 void (*signal ()) ();
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3914,7 +4100,8 @@
   ac_cv_type_signal=void
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_type_signal=int
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -3940,37 +4127,44 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char $ac_func ();
-char (*f) ();
-
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
@@ -3990,7 +4184,8 @@
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4011,7 +4206,9 @@
 
 
 
-for ac_func in usleep strsep strdup mkstemp snprintf memcmp
+
+
+for ac_func in usleep strsep strdup mkstemp snprintf memcmp strlcpy strlcat
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -4021,37 +4218,44 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char $ac_func ();
-char (*f) ();
-
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = $ac_func;
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != $ac_func;
   ;
   return 0;
 }
@@ -4071,7 +4275,8 @@
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4155,7 +4360,11 @@
 LIBS="-lintl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4164,12 +4373,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char dgettext ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4193,7 +4396,8 @@
   ac_cv_lib_intl_dgettext=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_intl_dgettext=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4220,7 +4424,11 @@
 LIBS="-lttf  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4229,12 +4437,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char TT_Init_FreeType ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4258,7 +4460,8 @@
   ac_cv_lib_ttf_TT_Init_FreeType=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_ttf_TT_Init_FreeType=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4280,14 +4483,12 @@
 
  	  cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <freetype.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4311,7 +4512,8 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
  		echo "Fatal: freetype.h not found"
  		exit 1
 fi
@@ -4324,14 +4526,12 @@
 echo $ECHO_N "checking for num_CharMaps field in TT_Face_Properties... $ECHO_C" >&6
  	  cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <freetype.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4358,7 +4558,8 @@
 
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
@@ -4432,7 +4633,11 @@
 LIBS="-lXft -lfontconfig $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4441,12 +4646,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char XftFontOpen ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4470,7 +4669,8 @@
   ac_cv_lib_Xft_XftFontOpen=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_Xft_XftFontOpen=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4499,37 +4699,44 @@
 else
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char iconv_open (); below.  */
-#include <assert.h>
+    which can conflict with char iconv_open (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char iconv_open ();
-char (*f) ();
-
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_iconv_open) || defined (__stub___iconv_open)
 choke me
 #else
-f = iconv_open;
+char (*f) () = iconv_open;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
+int
+main ()
+{
+return f != iconv_open;
   ;
   return 0;
 }
@@ -4549,7 +4756,8 @@
   ac_cv_func_iconv_open=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_func_iconv_open=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4571,7 +4779,11 @@
 LIBS="-liconv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4580,12 +4792,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char iconv_open ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4609,7 +4815,8 @@
   ac_cv_lib_iconv_iconv_open=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_iconv_iconv_open=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4702,7 +4909,11 @@
 LIBS="-l$ac_cv_vf_libname  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4711,12 +4922,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char VF_Init ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4740,7 +4945,8 @@
   eval "$as_ac_Lib=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 eval "$as_ac_Lib=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4757,14 +4963,12 @@
 
 	cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <VF.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4788,7 +4992,8 @@
   :
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 		echo "Fatal: VF.h not found"
 		exit 1
 fi
@@ -4892,7 +5097,11 @@
 LIBS="-lpng  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4901,12 +5110,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char png_read_image ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4930,7 +5133,8 @@
   ac_cv_lib_png_png_read_image=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_png_png_read_image=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -4954,7 +5158,11 @@
 LIBS="-lpng -lz $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -4963,12 +5171,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char png_set_gray_1_2_4_to_8 ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4992,7 +5194,8 @@
   ac_cv_lib_png_png_set_gray_1_2_4_to_8=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_png_png_set_gray_1_2_4_to_8=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5035,7 +5238,11 @@
 LIBS="-lmng  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5044,12 +5251,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char mng_initialize ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5073,7 +5274,8 @@
   ac_cv_lib_mng_mng_initialize=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_mng_mng_initialize=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5097,7 +5299,11 @@
 LIBS="-lmng -ljpeg $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5106,12 +5312,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char mng_readdisplay ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5135,7 +5335,8 @@
   ac_cv_lib_mng_mng_readdisplay=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_mng_mng_readdisplay=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5256,13 +5457,17 @@
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <X11/Intrinsic.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
+  grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
@@ -5280,7 +5485,8 @@
 ac_x_includes=
 else
   echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   for ac_dir in $ac_x_header_dirs; do
   if test -r "$ac_dir/X11/Intrinsic.h"; then
     ac_x_includes=$ac_dir
@@ -5299,14 +5505,12 @@
   LIBS="-lXt $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <X11/Intrinsic.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5332,7 +5536,8 @@
 ac_x_libraries=
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 LIBS=$ac_save_LIBS
 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
 do
@@ -5398,7 +5603,11 @@
 LIBS="-lungif  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5407,12 +5616,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char DGifOpenFileHandle ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5436,7 +5639,8 @@
   ac_cv_lib_ungif_DGifOpenFileHandle=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_ungif_DGifOpenFileHandle=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5461,7 +5665,11 @@
 LIBS="-lgif  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5470,12 +5678,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char DGifOpenFileHandle ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5499,7 +5701,8 @@
   ac_cv_lib_gif_DGifOpenFileHandle=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_gif_DGifOpenFileHandle=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5524,7 +5727,11 @@
 LIBS="-lungif -L$x_libraries -lX11 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5533,12 +5740,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char DGifOpenFileName ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5562,7 +5763,8 @@
   ac_cv_lib_ungif_DGifOpenFileName=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_ungif_DGifOpenFileName=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5587,7 +5789,11 @@
 LIBS="-lgif -L$x_libraries -lX11 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5596,12 +5802,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char DGifOpenFilename ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5625,7 +5825,8 @@
   ac_cv_lib_gif_DGifOpenFilename=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_gif_DGifOpenFilename=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5702,7 +5903,11 @@
 LIBS="-lImlib -L$x_libraries -lX11 -lXext $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -5711,12 +5916,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char Imlib_init ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5740,7 +5939,8 @@
   ac_cv_lib_Imlib_Imlib_init=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 ac_cv_lib_Imlib_Imlib_init=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
@@ -5786,7 +5986,7 @@
 mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
 
 
-ac_config_files="$ac_config_files Imakefile image/Imakefile sample/Imakefile contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl"
+                                                                      ac_config_files="$ac_config_files Imakefile image/Imakefile sample/Imakefile contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -5797,7 +5997,7 @@
 # config.status only pays attention to the cache file if you give it
 # the --recheck option to rerun configure.
 #
-# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
 # loading this file, other *unset* `ac_cv_foo' will be assigned the
 # following values.
 
@@ -5832,7 +6032,7 @@
      t end
      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
      : end' >>confcache
-if cmp -s $cache_file confcache; then :; else
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
   if test -w $cache_file; then
     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
     cat confcache >$cache_file
@@ -5894,6 +6094,21 @@
 rm -f confdef2opt.sed
 
 
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -5908,11 +6123,12 @@
 # configure, is in config.log if it exists.
 
 debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
 SHELL=\${CONFIG_SHELL-$SHELL}
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -5921,11 +6137,13 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
 
-# NLS nuisances.
 # Support unset when possible.
 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
   as_unset=unset
@@ -5933,34 +6151,42 @@
   as_unset=false
 fi
 
-(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
-    { $as_unset LANG || test "${LANG+set}" != set; } ||
-      { LANG=C; export LANG; }
-(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
-    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
-      { LC_ALL=C; export LC_ALL; }
-(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
-    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
-      { LC_TIME=C; export LC_TIME; }
-(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
-    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
-      { LC_CTYPE=C; export LC_CTYPE; }
-(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
-    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
-      { LANGUAGE=C; export LANGUAGE; }
-(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
-    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
-      { LC_COLLATE=C; export LC_COLLATE; }
-(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
-    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
-      { LC_NUMERIC=C; export LC_NUMERIC; }
-(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
-    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
-      { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
 
 
 # Name of the executable.
-as_me=`(basename "$0") 2>/dev/null ||
+as_me=`$as_basename "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)$' \| \
@@ -5971,6 +6197,7 @@
   	  /^X\/\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
 
+
 # PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
@@ -5981,15 +6208,15 @@
 
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conftest.sh
-  echo  "exit 0"   >>conftest.sh
-  chmod +x conftest.sh
-  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
     PATH_SEPARATOR=';'
   else
     PATH_SEPARATOR=:
   fi
-  rm -f conftest.sh
+  rm -f conf$$.sh
 fi
 
 
@@ -6038,6 +6265,8 @@
   as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
   test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
 	     CONFIG_SHELL=$as_dir/$as_base
 	     export CONFIG_SHELL
 	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
@@ -6111,6 +6340,12 @@
 fi
 rm -f conf$$ conf$$.exe conf$$.file
 
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
+
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
@@ -6127,7 +6362,7 @@
 IFS=" 	$as_nl"
 
 # CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+$as_unset CDPATH
 
 exec 6>&1
 
@@ -6144,7 +6379,7 @@
 cat >&5 <<_CSEOF
 
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.53.  Invocation command line was
+generated by GNU Autoconf 2.57.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -6184,6 +6419,7 @@
 
   -h, --help       print this help, then exit
   -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
@@ -6198,7 +6434,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.53,
+configured by $0, generated by GNU Autoconf 2.57,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -6218,25 +6454,25 @@
   --*=*)
     ac_option=`expr "x$1" : 'x\([^=]*\)='`
     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    shift
-    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
-    shift
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
     ;;
-  -*);;
   *) # This is not an option, so the user has probably given explicit
      # arguments.
+     ac_option=$1
      ac_need_defaults=false;;
   esac
 
-  case $1 in
+  case $ac_option in
   # Handling of the options.
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
-    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
-_ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
   --version | --vers* | -V )
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
@@ -6251,13 +6487,16 @@
   --debug | --d* | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
-    shift
-    CONFIG_FILES="$CONFIG_FILES $1"
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
-    shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $1"
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
 
   # This is an error.
   -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
@@ -6272,6 +6511,20 @@
   shift
 done
 
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
 _ACEOF
 
 
@@ -6304,6 +6557,9 @@
   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
 fi
 
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
 # Create a temporary directory, and hook for its removal unless debugging.
 $debug ||
 {
@@ -6312,17 +6568,17 @@
 }
 
 # Create a (secure) tmp directory for tmp files.
-: ${TMPDIR=/tmp}
+
 {
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=$TMPDIR/cs$$-$RANDOM
+  tmp=./confstat$$-$RANDOM
   (umask 077 && mkdir $tmp)
 } ||
 {
-   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
@@ -6399,10 +6655,12 @@
 s,@mgp_cv_path_gunzip@,$mgp_cv_path_gunzip,;t t
 s,@OPTFLAGS@,$OPTFLAGS,;t t
 s,@DEPLIBS@,$DEPLIBS,;t t
+s,@EGREP@,$EGREP,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@mgp_cv_vflib_a@,$mgp_cv_vflib_a,;t t
 s,@USE_IMLIB@,$USE_IMLIB,;t t
 s,@mgp_keywords@,$mgp_keywords,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
 
 _ACEOF
@@ -6473,25 +6731,30 @@
   	  /^X\(\/\/\)$/{ s//\1/; q; }
   	  /^X\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
-  { case "$ac_dir" in
-  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
-  *)                      as_incr_dir=.;;
-esac
-as_dummy="$ac_dir"
-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
-  case $as_mkdir_dir in
-    # Skip DOS drivespec
-    ?:) as_incr_dir=$as_mkdir_dir ;;
-    *)
-      as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" ||
-        mkdir "$as_incr_dir" ||
-	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }
-    ;;
-  esac
-done; }
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$as_dir" : 'X\(//\)[^/]' \| \
+         X"$as_dir" : 'X\(//\)$' \| \
+         X"$as_dir" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
 
   ac_builddir=.
 
@@ -6521,7 +6784,7 @@
 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
 # absolute.
 ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
 ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
 ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
 
@@ -6617,8 +6880,11 @@
 # need to make the FD available again.
 if test "$no_create" != yes; then
   ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
   exec 5>/dev/null
-  $SHELL $CONFIG_STATUS || ac_cs_success=false
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
Index: kit/configure.in
diff -u kit/configure.in:1.88 kit/configure.in:1.89
--- kit/configure.in:1.88	Tue Dec  2 07:08:57 2003
+++ kit/configure.in	Sat Feb 28 06:06:14 2004
@@ -3,7 +3,7 @@
 dnl independent (using srcdir), however, xmkmf and Imake.tmpl do not
 dnl allow us to switch compilation directory.
 dnl
-dnl $Id: configure.in,v 1.88 2003/12/01 22:08:57 nishida Exp $
+dnl $Id: configure.in,v 1.89 2004/02/27 21:06:14 itojun Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -77,7 +77,7 @@
 AC_FUNC_MEMCMP
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS(poll strstr _setbufend)
-AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp)
+AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp strlcpy strlcat)
 
 dnl Checks for libraries.
 LIBS="-lm $LIBS"
Index: kit/ctlwords.pl
diff -u kit/ctlwords.pl:1.2 kit/ctlwords.pl:removed
--- kit/ctlwords.pl:1.2	Sat Sep  5 06:05:08 1998
+++ kit/ctlwords.pl	Mon Mar  1 05:10:02 2004
@@ -1,12 +0,0 @@
-#! /usr/bin/perl
-$counter = 0;	# 0 origin
-print "/* generated by ctlwords.awk. do not edit by hand. */\n";
-
-while (<>) {
-	next if (!/^\/\*CTL\*\//);
-	next if ($_ !~ /(CTL_[A-Z0-9]+)/);
-
-	$word = $1;
-	print "#define $word\t$counter\n";
-	$counter++;
-}
Index: kit/draw.c
diff -u kit/draw.c:1.208 kit/draw.c:1.216
--- kit/draw.c:1.208	Tue Dec  2 07:06:09 2003
+++ kit/draw.c	Sat Feb 28 18:59:01 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.208 2003/12/01 22:06:09 nishida Exp $
+ * $Id: draw.c,v 1.216 2004/02/28 09:59:01 nishida Exp $
  */
 
 #include "mgp.h"
@@ -134,7 +134,7 @@
 #endif
 static int valign = VL_BOTTOM;
 
-#define CHECK_CACHE {if (caching){caching = -1; return;}}
+#define CHECK_CACHE	do {if (caching) {caching = -1; return; }} while (0)
 
 #ifdef USE_XFT2
 static void set_xrender_color  __P((long, int));
@@ -232,7 +232,7 @@
 		if (state->page < maxpage) {
 			purgechild(state->page);
 			if (mgp_flag & FL_FRDCACHE &&
-				cached_page == state->page + 1){
+				cached_page == state->page + 1) {
 					/* Hit cache */
 					set_from_cache(state);
 					pcache_process(state->page);
@@ -317,7 +317,7 @@
 			pause = 0;
 			if (state->cp)
 				process_direc(state, &pause);
-			if (caching == -1){
+			if (caching == -1) {
 				/* caching failed */
 				caching = 0;
 				return;
@@ -442,7 +442,7 @@
 #endif
 		remapchild();
 		/* always cache next page */
-		if ((mgp_flag & FL_FRDCACHE) && cache_mode){
+		if ((mgp_flag & FL_FRDCACHE) && cache_mode) {
 #if 1/*ONOE*/
 			if (XCheckMaskEvent(display, emask, e) == True) 
   				goto got_event;
@@ -463,7 +463,7 @@
 			try_enable_ttykey();
 #endif
 		/* we have no event in 2sec, so..*/
-		if (!FD_ISSET(xfd, &fds)){
+		if (!FD_ISSET(xfd, &fds)) {
 			if ((mgp_flag & FL_FRDCACHE) && !cache_mode)
 				cache_page(&cache_state, state->page +1);
 			timebar(state);
@@ -492,44 +492,44 @@
 
 	switch(cp->ct_op) {
 	case CTL_SUP:
-	        if (sup_scale > 1.0 || sup_scale < 0.1){
-		      sup_scale = DEFAULT_SUPSCALE;
+		if (sup_scale > 1.0 || sup_scale < 0.1) {
+			sup_scale = DEFAULT_SUPSCALE;
 		}
-	        if (sup_off > 1.0 || sup_scale < 0.1){
-		      sup_off = DEFAULT_SUPOFF;
+		if (sup_off > 1.0 || sup_scale < 0.1) {
+			sup_off = DEFAULT_SUPOFF;
 		}
-	        state->charoff = -sup_off * nonscaled_size[caching];	   
+		state->charoff = -sup_off * nonscaled_size[caching];	   
 		char_size[caching] = (int)(nonscaled_size[caching] * sup_scale);
-	        break;
+		break;
 	case CTL_SUB:
-	        if (sup_scale > 1.0 || sup_scale < 0.1){
-		      sup_scale = DEFAULT_SUPSCALE;
+		if (sup_scale > 1.0 || sup_scale < 0.1) {
+			sup_scale = DEFAULT_SUPSCALE;
 		}
-	        if (sub_off > 1.0 || sub_off < 0.1){
-		      sub_off = DEFAULT_SUBOFF;
+		if (sub_off > 1.0 || sub_off < 0.1){
+			sub_off = DEFAULT_SUBOFF;
 		}
-	        state->charoff = sub_off * nonscaled_size[caching];
+		state->charoff = sub_off * nonscaled_size[caching];
 		char_size[caching] = (int)(nonscaled_size[caching] * sup_scale);
-	        break;
+		break;
 	case CTL_SETSUP:
-	        if (cp->cti3_value1 > 100 || cp->cti3_value1 < 10){
-	             sup_off = DEFAULT_SUPOFF;
-		}else{
-		     sup_off = cp->cti3_value1 / 100.;
-		}
-	        if (cp->cti3_value2 > 100 || cp->cti3_value2 < 10){
-	             sub_off = DEFAULT_SUBOFF;
-		}else{
-		     sub_off = cp->cti3_value2 / 100.;
+		if (cp->cti3_value1 > 100 || cp->cti3_value1 < 10){
+			sup_off = DEFAULT_SUPOFF;
+		} else {
+			sup_off = cp->cti3_value1 / 100.;
+		}
+		if (cp->cti3_value2 > 100 || cp->cti3_value2 < 10){
+			sub_off = DEFAULT_SUBOFF;
+		} else {
+			sub_off = cp->cti3_value2 / 100.;
 		}
-	        if (cp->cti3_value3 > 100 || cp->cti3_value3 < 10){
+		if (cp->cti3_value3 > 100 || cp->cti3_value3 < 10){
 		     sup_scale = DEFAULT_SUPSCALE;
-		}else{
+		} else {
 		     sup_scale = cp->cti3_value3 / 100.;
 		}
-	        break;
+		break;
 	case CTL_SIZE:
-	        nonscaled_size[caching] = state->height * cp->ctf_value / 100;
+		nonscaled_size[caching] = state->height * cp->ctf_value / 100;
 		char_size[caching] = nonscaled_size[caching];
 #ifdef FREETYPE
 		tfc_setsize(char_size[caching]);
@@ -554,13 +554,13 @@
 		break;
 
 	case CTL_PAUSE:
-		CHECK_CACHE
+		CHECK_CACHE;
 		if (seenpause)
 			*seenpause = 1;
 		break;
 
 	case CTL_AGAIN:
-		CHECK_CACHE
+		CHECK_CACHE;
 		if (state->have_mark)
 			state->ypos = state->mark_ypos;
 		state->have_mark = 0;
@@ -573,8 +573,7 @@
 
 	case CTL_BACK:
 		if (state->line){
-			fprintf(stderr, 
-				"warning: %%back directive should be put in the first line of the page. ignored.\n");
+			fprintf(stderr, "warning: %%back directive should be put in the first line of the page. ignored.\n");
 			break;
 		}
 		back_color[caching] = cp->ctl_value;
@@ -602,8 +601,8 @@
 		break;
 
 	case CTL_CONT:
-      	        state->charoff = 0;
- 	        char_size[caching] = nonscaled_size[caching];
+		state->charoff = 0;
+		char_size[caching] = nonscaled_size[caching];
 		break;
 
 #ifdef VFLIB
@@ -665,17 +664,17 @@
 		break;
 
 	case CTL_LCUTIN:
-		CHECK_CACHE
+		CHECK_CACHE;
 		state->special = SP_LCUTIN;
 		break;
 
 	case CTL_RCUTIN:
-		CHECK_CACHE
+		CHECK_CACHE;
 		state->special = SP_RCUTIN;
 		break;
 
 	case CTL_SHRINK:
-		CHECK_CACHE
+		CHECK_CACHE;
 		state->special = SP_SHRINK;
 		break;
 
@@ -717,8 +716,8 @@
 		break;
 
 	case CTL_LINESTART:
-      	        state->charoff = 0;
- 	        char_size[caching] = nonscaled_size[caching];
+		state->charoff = 0;
+		char_size[caching] = nonscaled_size[caching];
 		if (state->line == 0) {
 			/*
 			 * set background of target 
@@ -782,12 +781,12 @@
 		break;
 
 	case CTL_SYSTEM:
-		CHECK_CACHE
+		CHECK_CACHE;
 		process_system(state, cp);
 		break;
 
 	case CTL_XSYSTEM:
-		CHECK_CACHE
+		CHECK_CACHE;
 		process_xsystem(state, cp);
 		break;
 
@@ -1167,33 +1166,33 @@
 
 	while (*p && *p != '\n') {
 		/* 94x94 charset */
-		if (p[0] == 0x1b && p[1] == '$'
-		 && '@' <= p[2] && p[2] < 'C' && rtab9494[p[2] - '@']) {
+		if (p[0] == 0x1b && p[1] == '$' &&
+		    '@' <= p[2] && p[2] < 'C' && rtab9494[p[2] - '@']) {
 			registry = rtab9494[p[2] - '@'];
 			charset16 = 1;
 			p += 3;
 			continue;
 		}
-		if (p[0] == 0x1b && p[1] == '$' && p[2] == '('
-		 && '@' <= p[3] && p[3] < '@' + RTAB9494_MAX
-		 && rtab9494[p[3] - '@']) {
+		if (p[0] == 0x1b && p[1] == '$' && p[2] == '(' &&
+		    '@' <= p[3] && p[3] < '@' + RTAB9494_MAX &&
+		    rtab9494[p[3] - '@']) {
 			registry = rtab9494[p[3] - '@'];
 			charset16 = 1;
 			p += 4;
 			continue;
 		}
 		/* ascii (or JIS roman) */
-		if (p[0] == 0x1b && p[1] == '('
-		 && (p[2] == 'B' || p[2] == 'J')) {
+		if (p[0] == 0x1b && p[1] == '(' &&
+		    (p[2] == 'B' || p[2] == 'J')) {
 			registry = NULL;
 			charset16 = 0;
 			p += 3;
 			continue;
 		}
 		/* 96 charset */
-		if (p[0] == 0x1b && p[1] == '-'
-		 && '@' < p[2] && p[2] < '@' + RTAB96_MAX
-		 && rtab96[p[2] - '@']) {
+		if (p[0] == 0x1b && p[1] == '-' &&
+		    '@' < p[2] && p[2] < '@' + RTAB96_MAX &&
+		    rtab96[p[2] - '@']) {
 			registry = rtab96[p[2] - '@'];
 			charset16 = 0;
 			p += 3;
@@ -2102,7 +2101,7 @@
 				y -= obj->descent;
 				break;
 			}
-		        y += obj->y;
+			y += obj->y;
 #ifdef VFLIB
 			if (obj->type == O_VFONT) {
 				(void)vfc_image(obj->data.vfc,
@@ -2573,10 +2572,10 @@
 			fprintf(stderr, "using best [%d] <%s>\n",
 				best, fontlist[best]);
 		}
-		strncpy(fontstring, fontlist[best], sizeof(fontstring));
+		strlcpy(fontstring, fontlist[best], sizeof(fontstring));
 	} else if (scalable >= 0 || tscalable >= 0) {
 		x_fontname(fontstring, sizeof(fontstring), xfont, csize,
-			registry);
+		    registry);
 		if (verbose) {
 			fprintf(stderr, "using %sscalable <%s>\n",
 				tscalable >= 0 ? "true" : "", fontstring);
@@ -4581,7 +4580,8 @@
 	static char etab[3][20] = { "iso-2022-jp", "gb2312", "ksc5601"};
 	static char rtab[3][20] = { "jisx208", "gb2312", "ksc5601"};
 	static char prefix[3][20] = { "\033$B", "\033$A", "\033$(C"};
-	char buf16[1024], *p16;
+	char buf16[1024];
+	const char *p16;
 	char out16[1024], *o16;
 	int ileft, oleft;
 #ifdef HAVE_ICONV
@@ -4604,14 +4604,15 @@
 
 	if (charset16) {
 #ifdef HAVE_ICONV
-		for (i = 0; i < 3; i ++){
+		for (i = 0; i < 3; i ++) {
 			if (!strncmp(registry, rtab[i], 3)) break;
 		}
 		if (i == 3) return NULL; /* cannot find codeset */
 		sprintf(buf16, "%s%s\0", prefix[i], p);  	
 		if (icv[i] == (iconv_t)0) icv[i] = iconv_open("UTF-8", etab[i]);
-		if (icv[i] == (iconv_t)-1){
-			fprintf(stderr, "your iconv doesn't support %s\n", etab[i]);
+		if (icv[i] == (iconv_t)-1) {
+			fprintf(stderr, "your iconv doesn't support %s\n",
+			    etab[i]);
 			return NULL;
 		}
 		p16 = buf16; o16 = out16; 	
@@ -4622,19 +4623,21 @@
 		}
 
 		/* measure drawing are */
-    	XftTextExtentsUtf8(display, xft_font, (XftChar8 *)out16, 
-						sizeof(out16) - oleft, &extents);
+		XftTextExtentsUtf8(display, xft_font, (XftChar8 *)out16,
+		    sizeof(out16) - oleft, &extents);
 
 		/* line folding check */
-		if (state->width - state->leftfillpos / 2 - state->linewidth < extents.xOff){
+		if (state->width - state->leftfillpos / 2 - state->linewidth <
+		    extents.xOff) {
 			draw_line_end(state);
 			draw_line_start(state);
 			state->linewidth = state->leftfillpos;
 		}
 
 		draw_line_itemsize(state, xft_font->ascent, xft_font->descent);
-		if (obj_new_xftfont(state, state->linewidth, 0, out16, sizeof(out16) - oleft, 
-					fontname, registry, char_size[caching], charset16, xft_font)){
+		if (obj_new_xftfont(state, state->linewidth, 0, out16,
+		    sizeof(out16) - oleft, fontname, registry,
+		    char_size[caching], charset16, xft_font)) {
 			state->linewidth += extents.xOff;
 			return p + len;
 		} else
@@ -4642,10 +4645,10 @@
 			return NULL; 
 	}
 
-    XftTextExtents8(display, xft_font, (XftChar8 *)p, len, &extents);
+	XftTextExtents8(display, xft_font, (XftChar8 *)p, len, &extents);
 
 	/* line folding check */
-	if (state->width - state->leftfillpos / 2 - state->linewidth < extents.xOff){
+	if (state->width - state->leftfillpos / 2 - state->linewidth < extents.xOff) {
 		if (isspace(*(p + len -1))) {
 		    XftTextExtents8(display, xft_font, (XftChar8 *)p, len -1, &extents);
 			if (state->width - state->leftfillpos / 2 - state->linewidth >= extents.xOff) goto nofolding;
@@ -4665,13 +4668,14 @@
 	draw_line_itemsize(state, extents.y, extents.height - extents.y);
 #endif
 
-	if (obj_new_xftfont(state, state->linewidth, 0, p, len, 
-				fontname, registry, char_size[caching], charset16, xft_font)){
+	if (obj_new_xftfont(state, state->linewidth, 0, p, len, fontname,
+	    registry, char_size[caching], charset16, xft_font)) {
 		state->linewidth += extents.xOff;
 		return p + len;
 	} else
 		return NULL; 
 }
+
 static int
 obj_new_xftfont(state, x, y, p, len, fontname, registry, size, charset16, xft_font)
 	struct render_state *state;
@@ -4689,11 +4693,14 @@
 
 	p1 = buf;
 	bzero(buf, sizeof(buf));
-	if (sizeof(buf) > len) memcpy(buf, p, len);
-	else return 0;
+	if (sizeof(buf) > len)
+		memcpy(buf, p, len);
+	else
+		return 0;
 
 	obj = obj_alloc(state);
-	if (obj == NULL) return 0;
+	if (obj == NULL)
+		return 0;
 	obj->x = x;
 	obj->y = y;
 	obj->fore = fore_color[caching];
@@ -4707,70 +4714,103 @@
 	obj->ascent = xft_font->ascent;
 	obj->descent = xft_font->descent;
 	obj->vertloc = VL_BASE;
-    return 1;
+	return 1;
 }
 
 static XftDraw *
 xft_getdraw(Drawable drawable) 
 {
 	int i;
-	for (i = 0; i < 2; i ++){
-		if (xft_xdraw[i] == drawable) return xft_draw[i];
-	}
-	for (i = 0; i < 2; i ++){
-		if (!xft_xdraw[i]) 
-			xft_draw[i] = XftDrawCreate(display, drawable, visual, colormap);
+	for (i = 0; i < 2; i ++) {
+		if (xft_xdraw[i] == drawable)
 			return xft_draw[i];
 	}
+	for (i = 0; i < 2; i ++) {
+		if (!xft_xdraw[i])
+			xft_draw[i] = XftDrawCreate(display, drawable, visual,
+			    colormap);
+		return xft_draw[i];
+	}
 	return NULL; /* should not happen */
 }
 
 static 
 XftFont *
-xft_setfont(xfont, csize, registry)
-	char *xfont;
+xft_setfont(xfontarg, csize, registry)
+	char *xfontarg;
 	int csize;
 	char *registry;
 {
+	char *xfont;
 	static XftFont *last_xftfont;
 	static char lastfont[100];
 	static int lastsize = 0;
 	XftFont *xftfont;
-	char *p;
+	char *p, *p2;
 	char style[100];
 	char font[100];
 	int stlen;
 
-	if (!strcmp(xfont, lastfont) && lastsize == csize) return last_xftfont;
+	bzero(style, sizeof(style));
+	bzero(font, sizeof(font));
+
+	xfont = strdup(xfontarg);
+	if (!xfont)
+		return NULL;
+
+	if (!strcmp(xfont, lastfont) && lastsize == csize) {
+		free(xfont);
+		return last_xftfont;
+	}
 
-	if (!(p = strchr(xfont, ':'))){
+	/*
+	 * if xfont contains "-", we believe this is a conventional xfont name 
+	 * and try to convert it for xft
+	 */
+	if ((p = strchr(xfont, '-')) != NULL) {
+		*p++ = 0;
+		strlcpy(font, xfont, sizeof(font));
+		if (strncmp(p, "bold-i", 6) == 0)
+			strlcpy(style, "Bold Italic", sizeof(style));
+		else if (strncmp(p, "bold-", 5) == 0)
+			strlcpy(style, "Bold", sizeof(style));
+		else if ((p = strchr(p, '-')) != NULL && p[1] == 'i')
+			strlcpy(style, "Italic", sizeof(style));
+	} else if ((p = strchr(xfont, ':')) == NULL)
+		strlcpy(font, xfont, sizeof(font));
+	else {
+		p2 = p +1;
+		/* allow to use ":style=" syntax */ 
+		if ((strstr(p2, "style=") != NULL) || (strstr(p2, "STYLE=") != NULL)) 
+			p2 += 6;
+		*p = '\0';
+		strlcpy(font, xfont, sizeof(font));
+		strlcpy(style, p2, sizeof(style));
+	}
+	if (style[0]) {
 		xftfont = XftFontOpen(display, screen,
-			XFT_FAMILY, XftTypeString, xfont,
-			XFT_ENCODING, XftTypeString, registry,
-			XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
-		if (xftfont == 0) return NULL;
+		    XFT_FAMILY, XftTypeString, font,
+		    XFT_ENCODING, XftTypeString, registry,
+		    XFT_STYLE, XftTypeString, style,
+		    XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
 	} else {
-		bzero(style, sizeof(style));
-		bzero(font, sizeof(font));
-		stlen = strlen(p) - 1;
-		strncpy(font, xfont, (strlen(xfont) - (stlen +1) >= 100) ? 
-						99 : (strlen(xfont) - (stlen +1)));	
-		strncpy(style, p +1, (stlen >= 100) ? 99 : stlen);	
 		xftfont = XftFontOpen(display, screen,
-			XFT_FAMILY, XftTypeString, font,
-			XFT_ENCODING, XftTypeString, registry,
-			XFT_STYLE, XftTypeString, style,
-			XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
-		if (xftfont == 0) return NULL;
+		    XFT_FAMILY, XftTypeString, font,
+		    XFT_ENCODING, XftTypeString, registry,
+		    XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
 	}
-	if (verbose){
-		fprintf(stderr, "using xftfont [%s] size: %d\n", xfont, csize);
+	if (xftfont == 0) {
+		free(xfont);
+		return NULL;
+	}
+	snprintf(lastfont, sizeof(lastfont), "%s:%s", font, style);
+	if (verbose) {
+		fprintf(stderr, "using xftfont [%s] size: %d\n", lastfont,
+		    csize);
 	}
-//	bzero(lastfont, sizeof(lastfont)); 
-	strncpy(lastfont, xfont, strlen(xfont) >= 100 ? 99 : strlen(xfont));	
-	lastfont[strlen(xfont) >= 100 ? 99 : strlen(xfont)] = 0;
 	lastsize = csize;
 	last_xftfont = xftfont;
+	free(xfont);
 	return last_xftfont;
 }
 #endif
Index: kit/mgp.c
diff -u kit/mgp.c:1.131 kit/mgp.c:1.132
--- kit/mgp.c:1.131	Wed Sep 24 03:11:46 2003
+++ kit/mgp.c	Sat Feb 28 06:09:13 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.131 2003/09/23 18:11:46 nishida Exp $
+ * $Id: mgp.c,v 1.132 2004/02/27 21:09:13 itojun Exp $
  */
 
 static char *mgp_version = "1.10a (20030624)";
@@ -438,7 +438,7 @@
     }
 
 	init_win1(xgeometry);
-	strncpy(buf, mgp_fname, sizeof(buf));
+	strlcpy(buf, mgp_fname, sizeof(buf));
 	if ((p = rindex(buf, '/'))) {
 		*p = '\0';
         	Paths[NumPaths++]= expandPath(buf);
Index: kit/mgp.man
diff -u kit/mgp.man:1.61 kit/mgp.man:1.62
--- kit/mgp.man:1.61	Fri Sep 12 11:04:55 2003
+++ kit/mgp.man	Thu Feb 26 17:41:14 2004
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\" 
-.\"	$Id: mgp.man,v 1.61 2003/09/12 02:04:55 nishida Exp $
+.\"	$Id: mgp.man,v 1.62 2004/02/26 08:41:14 itojun Exp $
 .\"
 .Dd November 1997
 .Dt MGP 1
@@ -284,12 +284,11 @@
 The default
 .Ar gsdevice
 is "pnmraw+".
-
 .El
 .\"
 .Sh KEY OPERATION
 The keyboard/mouse commands are:
-.Bl -tag -width -diag indent
+.Bl -tag -width indent
 .It mouse button 1 (leftmost button)
 Go forward a page.
 Space key, downward cursor key, scroll down key, "f" key, "j" key,
Index: kit/mgp2ps.man
diff -u kit/mgp2ps.man:1.11 kit/mgp2ps.man:1.12
--- kit/mgp2ps.man:1.11	Fri May  2 17:11:09 2003
+++ kit/mgp2ps.man	Thu Feb 26 17:41:14 2004
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\" 
-.\"	$Id: mgp2ps.man,v 1.11 2003/05/02 08:11:09 nishida Exp $
+.\"	$Id: mgp2ps.man,v 1.12 2004/02/26 08:41:14 itojun Exp $
 .\"
 .Dd November 1997
 .Dt MGP2PS 1
@@ -120,4 +120,3 @@
 was created so that Kazu Yamamoto could
 submit his tutorial document to the committee of
 Internet Week '97.
-
Index: kit/parse.c
diff -u kit/parse.c:1.95 kit/parse.c:1.96
--- kit/parse.c:1.95	Fri Sep 12 11:04:55 2003
+++ kit/parse.c	Sat Feb 28 06:09:13 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.95 2003/09/12 02:04:55 nishida Exp $
+ * $Id: parse.c,v 1.96 2004/02/27 21:09:13 itojun Exp $
  */
 
 #include "mgp.h"
@@ -574,6 +574,7 @@
 			while (*q && isspace(*q))
 				q++;
 			strncpy(p, q, sizeof(buf) - (p - buf));
+			p[sizeof(buf) - (p - buf)] = '\0';
 			p += strlen(p);
 			if (buf < p && p[-1] == '\n') {
 				p--;
Index: kit/print.c
diff -u kit/print.c:1.104 kit/print.c:1.105
--- kit/print.c:1.104	Fri Sep 12 11:04:55 2003
+++ kit/print.c	Sat Feb 28 06:09:13 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.104 2003/09/12 02:04:55 nishida Exp $
+ * $Id: print.c,v 1.105 2004/02/27 21:09:13 itojun Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -2147,7 +2147,7 @@
     {
 	char *p;
 	loadPathsAndExts();
-	strncpy(pathbuf, mgp_fname, sizeof(pathbuf));
+	strlcpy(pathbuf, mgp_fname, sizeof(pathbuf));
 	if ((p = rindex(pathbuf, '/'))) {
 		*p = '\0';
         	Paths[NumPaths++]= expandPath(pathbuf);
@@ -2367,8 +2367,7 @@
 	pfont->ctrl = ctrl;
 	pfont->lang = lang;
 	pfont->font = font;
-	pfont->psfont = (char *)malloc(string_len +1);
-	strncpy(pfont->psfont, string, string_len);
+	pfont->psfont = strdup(string);
 	pfont->fontid = 0;
 	pfont->loaded = 0;
 
Index: kit/image/gif.h
diff -u kit/image/gif.h:1.2 kit/image/gif.h:removed
--- kit/image/gif.h:1.2	Mon Dec 28 17:23:03 1998
+++ kit/image/gif.h	Mon Mar  1 05:10:05 2004
@@ -1,72 +0,0 @@
-/* gif.h:
- *
- * gifin.h
- * kirk johnson
- * november 1989
- * external interface to gifin.c
- *
- * Copyright 1989 Kirk L. Johnson (see the included file
- * "kljcpyrght.h" for complete copyright information)
- */
-
-/*
- * gifin return codes
- */
-#define GIFIN_SUCCESS       0   /* success */
-#define GIFIN_DONE          1   /* no more images */
-
-#define GIFIN_ERR_BAD_SD   -1   /* bad screen descriptor */
-#define GIFIN_ERR_BAD_SEP  -2   /* bad image separator */
-#define GIFIN_ERR_BAD_SIG  -3   /* bad signature */
-#define GIFIN_ERR_EOD      -4   /* unexpected end of raster data */
-#define GIFIN_ERR_EOF      -5   /* unexpected end of input stream */
-#define GIFIN_ERR_FAO      -6   /* file already open */
-#define GIFIN_ERR_IAO      -7   /* image already open */
-#define GIFIN_ERR_NFO      -8   /* no file open */
-#define GIFIN_ERR_NIO      -9   /* no image open */
-
-/*
- * colormap indices 
- */
-
-#define GIF_RED  0
-#define GIF_GRN  1
-#define GIF_BLU  2
-
-/*
- * typedef BYTE for convenience
- */
-
-typedef unsigned char BYTE;
-
-static int gifin_open_file();
-static int gifin_open_image();
-static int gifin_get_pixel();
-#if 0
-static int gifin_close_image();
-#endif
-static int gifin_close_file();
-static int gifin_load_cmap();
-static int gifin_skip_extension();
-static int gifin_read_data_block();
-static int gifin_push_string();
-static void gifin_add_string();
-static void gifin_fatal();
-
-/* #defines, typedefs, and such
- */
-
-#define GIF_SIG      "GIF87a"
-#define GIF_SIG_89   "GIF89a"
-#define GIF_SIG_LEN  6          /* GIF signature length */
-#define GIF_SD_SIZE  7          /* GIF screen descriptor size */
-#define GIF_ID_SIZE  9          /* GIF image descriptor size */
-
-#define GIF_SEPARATOR   ','     /* GIF image separator */
-#define GIF_EXTENSION   '!'     /* GIF extension block marker */
-#define GIF_TERMINATOR  ';'     /* GIF terminator */
-
-#define STAB_SIZE  4096         /* string table size */
-#define PSTK_SIZE  4096         /* pixel stack size */
-
-#define NULL_CODE  -1           /* string table null code */
Index: kit/missing/strlcat.c
diff -u /dev/null kit/missing/strlcat.c:1.1
--- /dev/null	Mon Mar  1 05:10:07 2004
+++ kit/missing/strlcat.c	Sat Feb 28 06:06:15 2004
@@ -0,0 +1,59 @@
+/*	$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $	*/
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <string.h>
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left).  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+strlcat(char *dst, const char *src, size_t siz)
+{
+	register char *d = dst;
+	register const char *s = src;
+	register size_t n = siz;
+	size_t dlen;
+
+	/* Find the end of dst and adjust bytes left but don't go past end */
+	while (n-- != 0 && *d != '\0')
+		d++;
+	dlen = d - dst;
+	n = siz - dlen;
+
+	if (n == 0)
+		return(dlen + strlen(s));
+	while (*s != '\0') {
+		if (n != 1) {
+			*d++ = *s;
+			n--;
+		}
+		s++;
+	}
+	*d = '\0';
+
+	return(dlen + (s - src));	/* count does not include NUL */
+}
Index: kit/missing/strlcpy.c
diff -u /dev/null kit/missing/strlcpy.c:1.1
--- /dev/null	Mon Mar  1 05:10:07 2004
+++ kit/missing/strlcpy.c	Sat Feb 28 06:06:15 2004
@@ -0,0 +1,55 @@
+/*	$OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $	*/
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <string.h>
+
+/*
+ * Copy src to string dst of size siz.  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+strlcpy(char *dst, const char *src, size_t siz)
+{
+	register char *d = dst;
+	register const char *s = src;
+	register size_t n = siz;
+
+	/* Copy as many bytes as will fit */
+	if (n != 0 && --n != 0) {
+		do {
+			if ((*d++ = *s++) == 0)
+				break;
+		} while (--n != 0);
+	}
+
+	/* Not enough room in dst, add NUL and traverse rest of src */
+	if (n == 0) {
+		if (siz != 0)
+			*d = '\0';		/* NUL-terminate dst */
+		while (*s++)
+			;
+	}
+
+	return(s - src - 1);	/* count does not include NUL */
+}
Index: kit/sample/cloud.gif
Index: kit/sample/dad.gif
Index: kit/sample/dns-jp.mgp
diff -u kit/sample/dns-jp.mgp:1.5 kit/sample/dns-jp.mgp:removed
--- kit/sample/dns-jp.mgp:1.5	Fri Sep  4 21:33:18 1998
+++ kit/sample/dns-jp.mgp	Mon Mar  1 05:10:07 2004
@@ -1,130 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%%	This file is automatically created from the file
-%%	main.pre modified at Fri Jan 23 14:31:24 1998
-%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%include "default.mgp"
-%% "noop" cancels definitions in default.mgp
-%default 1 left, size 7, fore "light yellow", back "blue4", font "standard", ccolor "white", vgap 35
-%default 2 noop
-%default 3 fore "white", bar "gray70", vgap 10
-%default 4 noop
-%tab 1 noop
-%tab 2 noop
-%tab 3 noop
-%%%
-%page
-%nodefault
-%fore "red", back "blue4", size 9, vgap 15
-%center, fore "yellow", font "thick"
-%ccolor "white"
-
-
-
-Root DNS `M' $B$K$D$$$F(B
-
-%size 6, fore "red", font "thick"
-$B2CF#(B   $BO/(B
-
-%size 5, fore "white", font "standard"
-$BEl5~Bg3XBg7?7W;;5!%;%s%?!<(B
-
-
-%font "typewriter"
-kato@wide.ad.jp
-%font "standard"
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (1)
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS
-%fore "white", size 5, font "standard"
-       $B!&(B $B#9Bf$G1?MQ(B
-%fore "white", size 5, font "standard"
-          $B!](B $B#8Bf$,(B US
-          $B!](B Stockholm $B$K#1Bf(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B:GBg$G#1#3Bf(B
-%fore "white", size 5, font "standard"
-          $B!](B $B%Q%1%C%HD9$N@)Ls(B
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS $B$N1?MQ4p=`(B
-%fore "white", size 5, font "standard"
-       $B!&(B RFC 2010
-       $B!&(B gTLD $B$H$N4X78(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (2)
-%fore "red", size 6, font "thick"
-   $B!y(B IEPG $B$G3HD%$r8!F$(B
-   $B!y(B $B%h!<%m%C%QCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B LINX $B$K?7@_(B : 1997 $BG/(B 4 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B RIPE/NCC $B$,4IM}(B
-          $B!](B `K'
-%fore "red", size 6, font "thick"
-   $B!y(B $B%"%8%"B@J?MNCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B NSPIXP-2 $B!'(B 1997 $BG/(B 8 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B WIDE $B$,4IM}(B
-          $B!](B `M'
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  `M'
-%fore "red", size 6, font "thick"
-   $B!y(B $B9=@.(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B#2Bf$N(B PentiumPro 200MHz
-       $B!&(B Primary/Backup$B!"(B $B<+F0@Z$jBX$((B
-%fore "red", size 6, font "thick"
-   $B!y(B Root-only $B%5!<%P(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-202.12.27.33
-%font "standard"
-       $B!&(B 400 $B!A(B 500 query/sec
-%fore "red", size 6, font "thick"
-   $B!y(B $B1?MQ4IM}(B
-%fore "white", size 5, font "standard"
-       $B!&(B WIDE $B$*$h$S(B ISP $BM-;V(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B$*4j$$(B
-%fore "red", size 6, font "thick"
-   $B!y(B $B:G?7$N(B root.cache $B$NF~$l49$((B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-1997082200
-%fore "red", size 6, font "thick"
-   $B!y(B Named $B$N99?7(B
-%fore "white", size 5, font "standard"
-       $B!&(B 4.9.6/8.8.1
-%fore "red", size 6, font "thick"
-   $B!y(B $BM7$P$J$$$G!'(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-ping/traceroute
-%font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-telnet/spray/...
-%fore "red", size 6, font "thick"
-   $B!y(B Thanks to
-%fore "white", size 5, font "standard"
-       $B!&(B $BF|K\(B Cisco/$BB?$/$N(B ISP
-       $B!&(B `M' $B4IM}%0%k!<%W(B
Index: kit/sample/mgp-old1.gif
Index: kit/sample/mgp-old2.gif
Index: kit/sample/mgp-old3.gif
Index: kit/sample/mgp1.gif
Index: kit/sample/mgp2.gif
Index: kit/sample/mgp3.gif
Index: kit/sample/v6header.gif
