Index: kit/.cvsignore
diff -u kit/.cvsignore:1.9 kit/.cvsignore:1.11
--- kit/.cvsignore:1.9	Mon Aug 24 12:33:25 1998
+++ kit/.cvsignore	Thu Dec 17 13:37:40 1998
@@ -16,3 +16,5 @@
 tokdefs.h
 scanner.c
 mgpembed.pl
+.depend
+ctlwords
Index: kit/Imakefile.in
diff -u kit/Imakefile.in:1.40 kit/Imakefile.in:1.44
--- kit/Imakefile.in:1.40	Sun Nov 15 02:44:38 1998
+++ kit/Imakefile.in	Thu Dec 17 14:48:27 1998
@@ -1,4 +1,4 @@
-# $Id: Imakefile.in,v 1.40 1998/11/14 17:44:38 itojun Exp $
+# $Id: Imakefile.in,v 1.44 1998/12/17 05:48:27 onoe Exp $
 
 @SET_MAKE@
 srcdir=	@srcdir@
@@ -84,24 +84,21 @@
 plist.o: $(srcdir)/plist.c ctlwords.h
 print.o: $(srcdir)/print.c ctlwords.h
 
-ctlwords.h: $(srcdir)/ctlwords.c $(srcdir)/ctlwords.pl $(srcdir)/globals.c
-	if test -x $(PERL); then \
-		$(PERL) $(srcdir)/ctlwords.pl < $(srcdir)/globals.c > ctlwords.h; \
-	else \
-		$(CC) -o ./ctlwords $(srcdir)/ctlwords.c; \
-		./ctlwords < $(srcdir)/globals.c > ctlwords.h; \
-	fi
+ctlwords.h: $(srcdir)/ctlwords.c $(srcdir)/globals.c
+	$(CC) -o ./ctlwords $(srcdir)/ctlwords.c
+	./ctlwords < $(srcdir)/globals.c > ctlwords.h
 
+clean::
+	rm -f ctlwords
+
 scanner.c: $(srcdir)/scanner.l
 	$(LEX) -t $(srcdir)/scanner.l > scanner.c
 scanner.o: scanner.c tokdefs.h
 
-grammar.c: $(srcdir)/grammar.y
+grammar.c tokdefs.h: $(srcdir)/grammar.y
 	$(YACC) -d $(srcdir)/grammar.y
 	mv y.tab.c grammar.c
 	mv y.tab.h tokdefs.h
-
-tokdefs.h: grammar.c
 
 # missing libraries
 memcmp.o: missing/memcmp.c
Index: kit/background.c
diff -u kit/background.c:1.10 kit/background.c:1.11
--- kit/background.c:1.10	Sat Sep  5 06:05:07 1998
+++ kit/background.c	Thu Dec 17 13:32:32 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: background.c,v 1.10 1998/09/04 21:05:07 itojun Exp $
+ * $Id: background.c,v 1.11 1998/12/17 04:32:32 onoe Exp $
  */
 
 #include <math.h>
@@ -37,7 +37,7 @@
 #define G_PI2	1.5707963267948966192
 
 static void draw_gradation0 __P((int, int, int, int, int, int,
-	byte *, byte *, int, int, byte));
+	byte *, byte *, int, int, u_int));
 static void g_rotate __P((byte *, struct ctrl_grad *, int, int));
 
 /*
@@ -53,7 +53,7 @@
 	int z1, z2;
 	byte *p1, *p2;
 	int dpy, dpz;	/* delta of p in x/y's direction */
-	byte mask;
+	u_int mask;
 {
 	int s, step;
 	int dx, dy;
@@ -120,15 +120,13 @@
 {
 	int bmask[8] = { 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
 	byte *pic;
-	u_int bits = 8;
+	const u_int bits = 8;
 	int i, j;
 	int x1, x2;
 	int y1, y2, dpy;
 	int z1, z2, dpz;
 	byte *p1, *p2;
 	byte mask;
-
-	bits = 8;
 
 	pic = (byte *)malloc(width * height * 3 * sizeof(byte));
 	if (!pic) {
Index: kit/configure
diff -u kit/configure:1.46 kit/configure:1.48
--- kit/configure:1.46	Mon Nov 16 22:33:56 1998
+++ kit/configure	Thu Dec 17 13:58:28 1998
@@ -1,8 +1,8 @@
-#! /bin/sh
+#!/bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated automatically using autoconf version 2.1 
+# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
@@ -45,24 +45,9 @@
 verbose=
 x_includes=NONE
 x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
 
 # Initialize some other variables.
 subdirs=
-MFLAGS= MAKEFLAGS=
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
 
 ac_prev=
 for ac_option
@@ -84,14 +69,9 @@
 
   case "$ac_option" in
 
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
-
-  -build | --build | --buil | --bui | --bu)
+  -build | --build | --buil | --bui | --bu | --b)
     ac_prev=build ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+  -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
     build="$ac_optarg" ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
@@ -101,12 +81,6 @@
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
     cache_file="$ac_optarg" ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir="$ac_optarg" ;;
-
   -disable-* | --disable-*)
     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
     # Reject names that are not valid shell variable names.
@@ -157,29 +131,12 @@
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
                           [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+  --exec-prefix=PREFIX    install architecture-dependent files in PREFIX
                           [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
-                          [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
-  --infodir=DIR           info documentation in DIR [PREFIX/info]
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
   --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
+  --program-transform-name=PROGRAM run sed PROGRAM on installed program names
 Host type:
   --build=BUILD           configure for building on BUILD [BUILD=HOST]
   --host=HOST             configure for HOST [guessed]
@@ -191,10 +148,8 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --x-includes=DIR        X include files are in DIR
   --x-libraries=DIR       X library files are in DIR
+--enable and --with options recognized:$ac_help
 EOF
-    if test -n "$ac_help"; then
-      echo "--enable and --with options recognized:$ac_help"
-    fi
     exit 0 ;;
 
   -host | --host | --hos | --ho)
@@ -202,44 +157,6 @@
   -host=* | --host=* | --hos=* | --ho=*)
     host="$ac_optarg" ;;
 
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir="$ac_optarg" ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir="$ac_optarg" ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
-
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
     with_fp=no ;;
@@ -252,15 +169,6 @@
   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
     no_recursion=yes ;;
 
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
-
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
@@ -301,23 +209,6 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
-
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
@@ -328,13 +219,6 @@
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
     srcdir="$ac_optarg" ;;
 
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" ;;
-
   -target | --target | --targe | --targ | --tar | --ta | --t)
     ac_prev=target ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
@@ -344,7 +228,7 @@
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12"
+    echo "configure generated by autoconf version 2.1"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -390,7 +274,7 @@
   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
     ;;
 
-  *)
+  *) 
     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
       echo "configure: warning: $ac_option: invalid host type" 1>&2
     fi
@@ -407,20 +291,19 @@
   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
 fi
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
 
 # File descriptor usage:
-# 0 standard input
+# 0 unused; standard input
 # 1 file creation
 # 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
+# 3 unused; some systems may open it to /dev/tty
+# 4 checking for... messages and results
 # 5 compiler messages saved in config.log
 if test "$silent" = yes; then
-  exec 6>/dev/null
+  exec 4>/dev/null
 else
-  exec 6>&1
+  exec 4>&1
 fi
 exec 5>./config.log
 
@@ -446,14 +329,11 @@
 done
 
 # NLS nuisances.
-# Only set these to C if already set.  These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -rf conftest* confdefs.h
@@ -513,9 +393,8 @@
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
+ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'
 
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
@@ -531,11 +410,10 @@
 
 
 
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:536: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking whether ${MAKE-make} sets \$MAKE""... $ac_c" 1>&4
+set dummy ${MAKE-make}; ac_make=$2
+if eval "test \"`echo '${'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftestmake <<\EOF
 all:
@@ -551,10 +429,10 @@
 rm -f conftestmake
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$ac_t""yes" 1>&4
   SET_MAKE=
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -562,10 +440,9 @@
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:567: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_prog_AWK'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -583,9 +460,9 @@
 fi
 AWK="$ac_cv_prog_AWK"
 if test -n "$AWK"; then
-  echo "$ac_t""$AWK" 1>&6
+  echo "$ac_t""$AWK" 1>&4
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 test -n "$AWK" && break
@@ -595,10 +472,9 @@
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:600: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_prog_YACC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -616,9 +492,9 @@
 fi
 YACC="$ac_cv_prog_YACC"
 if test -n "$YACC"; then
-  echo "$ac_t""$YACC" 1>&6
+  echo "$ac_t""$YACC" 1>&4
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 test -n "$YACC" && break
@@ -627,10 +503,9 @@
 
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:632: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_prog_LEX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
@@ -649,9 +524,9 @@
 fi
 LEX="$ac_cv_prog_LEX"
 if test -n "$LEX"; then
-  echo "$ac_t""$LEX" 1>&6
+  echo "$ac_t""$LEX" 1>&4
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 if test -z "$LEXLIB"
@@ -660,44 +535,37 @@
   flex*) ac_lib=fl ;;
   *) ac_lib=l ;;
   esac
-  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:665: checking for yywrap in -l$ac_lib" >&5
-ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo $ac_n "checking for -l$ac_lib""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_lib_$ac_lib'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   ac_save_LIBS="$LIBS"
-LIBS="-l$ac_lib  $LIBS"
+LIBS="$LIBS -l$ac_lib "
 cat > conftest.$ac_ext <<EOF
-#line 673 "configure"
+#line 546 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char yywrap();
 
-int main() {
-yywrap()
+int main() { return 0; }
+int t() {
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if eval $ac_link; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_lib_$ac_lib=yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_lib_$ac_lib=no"
 fi
 rm -f conftest*
 LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib`\" = yes"; then
+  echo "$ac_t""yes" 1>&4
   LEXLIB="-l$ac_lib"
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 fi
@@ -706,10 +574,9 @@
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:711: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_perl'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_path_mgp_cv_path_perl'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   case "$mgp_cv_path_perl" in
   /*)
@@ -730,9 +597,9 @@
 fi
 mgp_cv_path_perl="$ac_cv_path_mgp_cv_path_perl"
 if test -n "$mgp_cv_path_perl"; then
-  echo "$ac_t""$mgp_cv_path_perl" 1>&6
+  echo "$ac_t""$mgp_cv_path_perl" 1>&4
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 test -n "$mgp_cv_path_perl" && break
@@ -744,10 +611,9 @@
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:749: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_uuencode'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_path_mgp_cv_path_uuencode'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   case "$mgp_cv_path_uuencode" in
   /*)
@@ -768,9 +634,9 @@
 fi
 mgp_cv_path_uuencode="$ac_cv_path_mgp_cv_path_uuencode"
 if test -n "$mgp_cv_path_uuencode"; then
-  echo "$ac_t""$mgp_cv_path_uuencode" 1>&6
+  echo "$ac_t""$mgp_cv_path_uuencode" 1>&4
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 test -n "$mgp_cv_path_uuencode" && break
@@ -782,10 +648,9 @@
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:787: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_gzip'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_path_mgp_cv_path_gzip'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   case "$mgp_cv_path_gzip" in
   /*)
@@ -806,9 +671,9 @@
 fi
 mgp_cv_path_gzip="$ac_cv_path_mgp_cv_path_gzip"
 if test -n "$mgp_cv_path_gzip"; then
-  echo "$ac_t""$mgp_cv_path_gzip" 1>&6
+  echo "$ac_t""$mgp_cv_path_gzip" 1>&4
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 
 test -n "$mgp_cv_path_gzip" && break
@@ -822,47 +687,43 @@
 DEPLIBS=
 
 
-echo $ac_n "checking if --enable-debug option specified""... $ac_c" 1>&6
-echo "configure:827: checking if --enable-debug option specified" >&5
+echo $ac_n "checking if --enable-debug option specified""... $ac_c" 1>&4
 # Check whether --enable-debug or --disable-debug was given.
-if test "${enable_debug+set}" = set; then
-  enableval="$enable_debug"
+enableval="$enable_debug"
+if test -n "$enableval"; then
   mgp_debug="yes"; OPTFLAGS="$OPTFLAGS -g -DDEBUG -Wall"
 else
   mgp_debug="no"
 fi
 
-echo "$ac_t""$mgp_debug" 1>&6
+echo "$ac_t""$mgp_debug" 1>&4
 
-echo $ac_n "checking if --enable-locale option specified""... $ac_c" 1>&6
-echo "configure:839: checking if --enable-locale option specified" >&5
+echo $ac_n "checking if --enable-locale option specified""... $ac_c" 1>&4
 # Check whether --enable-locale or --disable-locale was given.
-if test "${enable_locale+set}" = set; then
-  enableval="$enable_locale"
+enableval="$enable_locale"
+if test -n "$enableval"; then
   mgp_locale="yes"; OPTFLAGS="$OPTFLAGS -DUSE_SETLOCALE"
 else
   mgp_locale="no"
 fi
 
-echo "$ac_t""$mgp_locale" 1>&6
+echo "$ac_t""$mgp_locale" 1>&4
 
 LIBS="-lm $LIBS"
 
-echo $ac_n "checking if --disable-freetype option specified""... $ac_c" 1>&6
-echo "configure:853: checking if --disable-freetype option specified" >&5
+echo $ac_n "checking if --disable-freetype option specified""... $ac_c" 1>&4
 # Check whether --enable-freetype or --disable-freetype was given.
-if test "${enable_freetype+set}" = set; then
-  enableval="$enable_freetype"
+enableval="$enable_freetype"
+if test -n "$enableval"; then
   mgp_skip_freetype="yes"; mgp_use_freetype="no"
 else
   mgp_skip_freetype="no"; mgp_use_freetype="yes"
 fi
 
-echo "$ac_t""$mgp_skip_freetype" 1>&6
+echo "$ac_t""$mgp_skip_freetype" 1>&4
  
 if test "$mgp_use_freetype" = "yes"; then
- 	echo $ac_n "checking for freetype library/header""... $ac_c" 1>&6
-echo "configure:866: checking for freetype library/header" >&5
+ 	echo $ac_n "checking for freetype library/header""... $ac_c" 1>&4
  	for dir in /usr/local/freetype /usr/local; do
  		ac_cv_ft_lib=no
  		ac_cv_ft_include=no
@@ -883,128 +744,117 @@
  		fi
  	done
  	if test "$ac_cv_ft_lib" = "no" -a "$ac_cv_ft_include" = "no"; then
- 		echo "$ac_t""no - not using freetype" 1>&6
+ 		echo "$ac_t""no - not using freetype" 1>&4
  		mgp_use_freetype=no
  	else
- 		echo "$ac_t""$ac_cv_ft_lib and $ac_cv_ft_include" 1>&6
+ 		echo "$ac_t""$ac_cv_ft_lib and $ac_cv_ft_include" 1>&4
  	fi
 fi
 if test "$mgp_use_freetype" = "yes"; then
 	LIBS="-L$ac_cv_ft_lib $LIBS"
 	OPTFLAGS="-I$ac_cv_ft_include $OPTFLAGS"
 	DEPLIBS="$ac_cv_ft_lib/$ac_cv_ft_libpath $DEPLIBS"
- 	echo $ac_n "checking for TT_Init_FreeType in -lttf""... $ac_c" 1>&6
-echo "configure:898: checking for TT_Init_FreeType in -lttf" >&5
-ac_lib_var=`echo ttf'_'TT_Init_FreeType | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ 	echo $ac_n "checking for -lttf""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_lib_ttf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lttf  $LIBS"
+LIBS="$LIBS -lttf "
 cat > conftest.$ac_ext <<EOF
-#line 906 "configure"
+#line 765 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char TT_Init_FreeType();
 
-int main() {
+int main() { return 0; }
+int t() {
 TT_Init_FreeType()
 ; return 0; }
 EOF
-if { (eval echo configure:917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if eval $ac_link; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_lib_ttf=yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_lib_ttf=no"
 fi
 rm -f conftest*
 LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo ttf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+if eval "test \"`echo '$ac_cv_lib_'ttf`\" = yes"; then
+  echo "$ac_t""yes" 1>&4
+    ac_tr_lib=HAVE_LIB`echo ttf | tr '[a-z]' '[A-Z]'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lttf $LIBS"
+  LIBS="$LIBS -lttf"
 
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 echo "Fatal: libttf.a not found"
 		exit 1
 fi
 
  	cat > conftest.$ac_ext <<EOF
-#line 947 "configure"
+#line 800 "configure"
 #include "confdefs.h"
 #include <freetype.h>
-int main() {
+int main() { return 0; }
+int t() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
    		echo "Fatal: freetype.h not found"
  		exit 1
 fi
 rm -f conftest*
+
  	cat >> confdefs.h <<\EOF
 #define FREETYPE 1
 EOF
 
-	echo $ac_n "checking for num_CharMaps field in TT_Face_Properties""... $ac_c" 1>&6
-echo "configure:969: checking for num_CharMaps field in TT_Face_Properties" >&5
+	echo $ac_n "checking for num_CharMaps field in TT_Face_Properties""... $ac_c" 1>&4
  	cat > conftest.$ac_ext <<EOF
-#line 971 "configure"
+#line 823 "configure"
 #include "confdefs.h"
 #include <freetype.h>
-int main() {
+int main() { return 0; }
+int t() {
 TT_Face_Properties x; return x.num_CharMaps;
 ; return 0; }
 EOF
-if { (eval echo configure:978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   rm -rf conftest*
   result=yes; cat >> confdefs.h <<\EOF
 #define HAVE_TT_FACE_PROPERTIES_CHARMAPS 1
 EOF
 
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   result=no
 fi
 rm -f conftest*
-	echo "$ac_t""$result" 1>&6
+
+	echo "$ac_t""$result" 1>&4
 fi
 
-echo $ac_n "checking if --disable-vflib option specified""... $ac_c" 1>&6
-echo "configure:995: checking if --disable-vflib option specified" >&5
+echo $ac_n "checking if --disable-vflib option specified""... $ac_c" 1>&4
 # Check whether --enable-vflib or --disable-vflib was given.
-if test "${enable_vflib+set}" = set; then
-  enableval="$enable_vflib"
+enableval="$enable_vflib"
+if test -n "$enableval"; then
   mgp_skip_vflib="yes"; mgp_use_vflib="no"
 else
   mgp_skip_vflib="no"; mgp_use_vflib="yes"
 fi
 
-echo "$ac_t""$mgp_skip_vflib" 1>&6
+echo "$ac_t""$mgp_skip_vflib" 1>&4
 
 if test "$mgp_use_vflib" = "yes"; then
-	echo $ac_n "checking for VFlib library/header""... $ac_c" 1>&6
-echo "configure:1008: checking for VFlib library/header" >&5
+	echo $ac_n "checking for VFlib library/header""... $ac_c" 1>&4
 	for dir in /usr/local/VFlib /usr/local/vflib /usr/local; do
 		ac_cv_vf_libname=VFlib
 		ac_cv_vf_libdir=no
@@ -1034,86 +884,78 @@
 		fi
 	done
 	if test "$ac_cv_vf_libdir" = "no" -a "$ac_cv_vf_hdrdir" = "no"; then
-		echo "$ac_t""no - not using VFlib" 1>&6
+		echo "$ac_t""no - not using VFlib" 1>&4
 		mgp_use_vflib=no
 	else
-		echo "$ac_t""$ac_cv_vf_libdir and $ac_cv_vf_hdrdir" 1>&6
+		echo "$ac_t""$ac_cv_vf_libdir and $ac_cv_vf_hdrdir" 1>&4
 	fi
 fi
 if test "$mgp_use_vflib" = "yes"; then
 	LIBS="-L$ac_cv_vf_libdir -l$ac_cv_vf_libname $LIBS"
 	OPTFLAGS="-I$ac_cv_vf_hdrdir $OPTFLAGS"
 	DEPLIBS="$ac_cv_vf_libdir/$ac_cv_vf_libpath $DEPLIBS"
-	echo $ac_n "checking for VF_Init in -l$ac_cv_vf_libname""... $ac_c" 1>&6
-echo "configure:1049: checking for VF_Init in -l$ac_cv_vf_libname" >&5
-ac_lib_var=`echo $ac_cv_vf_libname'_'VF_Init | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo $ac_n "checking for -l$ac_cv_vf_libname""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_lib_$ac_cv_vf_libname'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   ac_save_LIBS="$LIBS"
-LIBS="-l$ac_cv_vf_libname  $LIBS"
+LIBS="$LIBS -l$ac_cv_vf_libname "
 cat > conftest.$ac_ext <<EOF
-#line 1057 "configure"
+#line 905 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char VF_Init();
 
-int main() {
+int main() { return 0; }
+int t() {
 VF_Init()
 ; return 0; }
 EOF
-if { (eval echo configure:1068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if eval $ac_link; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_lib_$ac_cv_vf_libname=yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_lib_$ac_cv_vf_libname=no"
 fi
 rm -f conftest*
 LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+if eval "test \"`echo '$ac_cv_lib_'$ac_cv_vf_libname`\" = yes"; then
+  echo "$ac_t""yes" 1>&4
   mgp_cv_vflib_a=$ac_cv_vf_libpath
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 echo "Fatal: $ac_cv_vf_libpath not found"
 		exit 1
 fi
 
 	cat > conftest.$ac_ext <<EOF
-#line 1091 "configure"
+#line 934 "configure"
 #include "confdefs.h"
 #include <VF.h>
-int main() {
+int main() { return 0; }
+int t() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   		echo "Fatal: VF.h not found"
 		exit 1
 fi
 rm -f conftest*
+
 	cat >> confdefs.h <<\EOF
 #define VFLIB 1
 EOF
 
 
-	echo $ac_n "checking for VFlib configuration file""... $ac_c" 1>&6
-echo "configure:1114: checking for VFlib configuration file" >&5
+	echo $ac_n "checking for VFlib configuration file""... $ac_c" 1>&4
 	# Check whether --with-vfontcap or --without-vfontcap was given.
-if test "${with_vfontcap+set}" = set; then
-  withval="$with_vfontcap"
+withval="$with_vfontcap"
+if test -n "$withval"; then
   :
 fi
 
@@ -1133,7 +975,7 @@
 			fi
 		done
 	fi
-	echo "$ac_t""$ac_cv_vf_fontcap" 1>&6
+	echo "$ac_t""$ac_cv_vf_fontcap" 1>&4
 	if test "$ac_cv_vf_fontcap" = "no"; then
 		echo Fatal: no vfontcap file found.  cannot continue.
 		echo Please use the option --with-vfontcap=PATH to specify the path to vfontcap.
@@ -1146,15 +988,14 @@
 	
 fi
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1151: checking how to run the C preprocessor" >&5
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if eval "test \"`echo '${'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
     # This must be in double quotes, not single quotes, because CPP may get
   # substituted into the Makefile and "${CC-cc}" will confuse make.
@@ -1162,37 +1003,31 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1166 "configure"
+#line 1007 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
 else
   echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1183 "configure"
+#line 1021 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
 else
   echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP=/lib/cpp
 fi
@@ -1201,39 +1036,33 @@
 rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
-  CPP="$ac_cv_prog_CPP"
-else
-  ac_cv_prog_CPP="$CPP"
 fi
-echo "$ac_t""$CPP" 1>&6
+CPP="$ac_cv_prog_CPP"
+echo "$ac_t""$CPP" 1>&4
 
 # If we find X, set shell vars x_includes and x_libraries to the
 # paths, otherwise set no_x=yes.
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
-echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1216: checking for X" >&5
+echo $ac_n "checking for X""... $ac_c" 1>&4
 
 # Check whether --with-x or --without-x was given.
-if test "${with_x+set}" = set; then
-  withval="$with_x"
+withval="$with_x"
+if test -n "$withval"; then
   :
 fi
 
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
 if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
+  no_x=yes
 else
   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
+    no_x=
   else
-if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if eval "test \"`echo '${'ac_cv_path_x'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=NO ac_x_libraries=NO
+no_x=yes
 rm -fr conftestdir
 if mkdir conftestdir; then
   cd conftestdir
@@ -1243,76 +1072,66 @@
 	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
 EOF
   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    no_x=
     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    eval `make acfindx 2>/dev/null | grep -v make`
     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-        test -f $ac_im_libdir/libX11.$ac_extension; then
-        ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
+    if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a
+    then
+      ac_im_usrlibdir=$ac_im_libdir
+    fi
     case "$ac_im_incroot" in
 	/usr/include) ;;
-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+	*) ac_x_includes="$ac_im_incroot" ;;
     esac
     case "$ac_im_usrlibdir" in
 	/usr/lib | /lib) ;;
-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+	*) ac_x_libraries="$ac_im_usrlibdir" ;;
     esac
   fi
   cd ..
   rm -fr conftestdir
 fi
-
-if test "$ac_x_includes" = NO; then
-  # Guess where to find include files, by looking for this one X11 .h file.
-  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
 
-  # First, try using that file with no special directory specified.
+if test "$no_x" = yes; then
+test -z "$x_direct_test_library" && x_direct_test_library=Xt
+test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
 cat > conftest.$ac_ext <<EOF
-#line 1278 "configure"
+#line 1102 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
+  no_x= ac_x_includes=
 else
   echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  # Look for the header file in a standard set of common directories.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-  for ac_dir in               \
-    /usr/X11/include          \
+    for ac_dir in               \
     /usr/X11R6/include        \
     /usr/X11R5/include        \
     /usr/X11R4/include        \
                               \
-    /usr/include/X11          \
     /usr/include/X11R6        \
     /usr/include/X11R5        \
     /usr/include/X11R4        \
                               \
-    /usr/local/X11/include    \
     /usr/local/X11R6/include  \
     /usr/local/X11R5/include  \
     /usr/local/X11R4/include  \
                               \
-    /usr/local/include/X11    \
     /usr/local/include/X11R6  \
     /usr/local/include/X11R5  \
     /usr/local/include/X11R4  \
                               \
+    /usr/X11/include          \
+    /usr/include/X11          \
+    /usr/local/X11/include    \
+    /usr/local/include/X11    \
+                              \
     /usr/X386/include         \
     /usr/x386/include         \
     /usr/XFree86/include/X11  \
@@ -1329,65 +1148,56 @@
     ; \
   do
     if test -r "$ac_dir/$x_direct_test_include"; then
-      ac_x_includes=$ac_dir
+      no_x= ac_x_includes=$ac_dir
       break
     fi
   done
 fi
 rm -f conftest*
-fi # $ac_x_includes = NO
 
-if test "$ac_x_libraries" = NO; then
-  # Check for the libraries.
-
-  test -z "$x_direct_test_library" && x_direct_test_library=Xt
-  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
-
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS="$LIBS"
-  LIBS="-l$x_direct_test_library $LIBS"
+# Check for the libraries.
+# See if we find them without any special options.
+# Don't add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="$LIBS -l$x_direct_test_library"
 cat > conftest.$ac_ext <<EOF
-#line 1352 "configure"
+#line 1165 "configure"
 #include "confdefs.h"
 
-int main() {
+int main() { return 0; }
+int t() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if eval $ac_link; then
   rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# We can link X programs with no special library path.
-ac_x_libraries=
+  LIBS="$ac_save_LIBS" no_x= ac_x_libraries=
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # First see if replacing the include by lib works.
-# Check X11 before X11Rn because it is often a symlink to the current release.
 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
-    /usr/X11/lib          \
     /usr/X11R6/lib        \
     /usr/X11R5/lib        \
     /usr/X11R4/lib        \
                           \
-    /usr/lib/X11          \
     /usr/lib/X11R6        \
     /usr/lib/X11R5        \
     /usr/lib/X11R4        \
                           \
-    /usr/local/X11/lib    \
     /usr/local/X11R6/lib  \
     /usr/local/X11R5/lib  \
     /usr/local/X11R4/lib  \
                           \
-    /usr/local/lib/X11    \
     /usr/local/lib/X11R6  \
     /usr/local/lib/X11R5  \
     /usr/local/lib/X11R4  \
                           \
+    /usr/X11/lib          \
+    /usr/lib/X11          \
+    /usr/local/X11/lib    \
+    /usr/local/lib/X11    \
+                          \
     /usr/X386/lib         \
     /usr/x386/lib         \
     /usr/XFree86/lib/X11  \
@@ -1398,7 +1208,6 @@
     /usr/athena/lib       \
     /usr/local/x11r5/lib  \
     /usr/lpp/Xamples/lib  \
-    /lib/usr/lib/X11	  \
                           \
     /usr/openwin/lib      \
     /usr/openwin/share/lib \
@@ -1406,64 +1215,78 @@
 do
   for ac_extension in a so sl; do
     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
-      ac_x_libraries=$ac_dir
+      no_x= ac_x_libraries=$ac_dir
       break 2
     fi
   done
 done
 fi
 rm -f conftest*
-fi # $ac_x_libraries = NO
 
-if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
-else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
 fi
+if test "$no_x" = yes; then
+  ac_cv_path_x="no_x=yes"
+else
+  ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
 fi
+fi
   fi
-  eval "$ac_cv_have_x"
+  eval "$ac_cv_path_x"
 fi # $with_x != no
 
-if test "$have_x" != yes; then
-  echo "$ac_t""$have_x" 1>&6
-  no_x=yes
+if test "$no_x" = yes; then
+  echo "$ac_t""no" 1>&4
 else
-  # If each of the values was on the command line, it overrides each guess.
   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes \
-		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+  ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&4
 fi
 
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1446: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+# If we cannot run a trivial program, we must be cross compiling.
+echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
+  if test "$cross_compiling" = yes; then
+  ac_cv_cross=yes
+else
+cat > conftest.$ac_ext <<EOF
+#line 1256 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+eval $ac_link
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
+  ac_cv_c_cross=no
+else
+  ac_cv_c_cross=yes
+fi
+fi
+rm -fr conftest*
+fi
+cross_compiling=$ac_cv_c_cross
+echo "$ac_t""$ac_cv_c_cross" 1>&4
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_header_stdc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
+else
   cat > conftest.$ac_ext <<EOF
-#line 1451 "configure"
+#line 1277 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <float.h>
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
   ac_cv_header_stdc=yes
 else
   echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_stdc=no
 fi
@@ -1472,7 +1295,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1476 "configure"
+#line 1299 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1490,7 +1313,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1494 "configure"
+#line 1317 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1508,10 +1331,10 @@
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 if test "$cross_compiling" = yes; then
-  :
+  ac_cv_header_stdc=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1515 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 1338 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1522,22 +1345,17 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
+eval $ac_link
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
   ac_cv_header_stdc=no
 fi
-rm -fr conftest*
 fi
-
+rm -fr conftest*
 fi
 fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$ac_t""$ac_cv_header_stdc" 1>&4
 if test $ac_cv_header_stdc = yes; then
   cat >> confdefs.h <<\EOF
 #define STDC_HEADERS 1
@@ -1545,13 +1363,12 @@
 
 fi
 
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1550: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1555 "configure"
+#line 1372 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1561,25 +1378,24 @@
 #ifndef WIFEXITED
 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
 #endif
-int main() {
+int main() { return 0; }
+int t() {
 int s;
 wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_sys_wait_h=no
 fi
 rm -f conftest*
-fi
 
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+fi
+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&4
 if test $ac_cv_header_sys_wait_h = yes; then
   cat >> confdefs.h <<\EOF
 #define HAVE_SYS_WAIT_H 1
@@ -1589,55 +1405,51 @@
 
 for ac_hdr in fcntl.h strings.h sys/file.h unistd.h sys/time.h sys/select.h stdarg.h varargs.h termios.h locale.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1595: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1600 "configure"
+#line 1415 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  echo "$ac_t""yes" 1>&4
+    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
  
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 done
 
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1633: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for working const""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_c_const'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1638 "configure"
+#line 1449 "configure"
 #include "confdefs.h"
 
-int main() {
+int main() { return 0; }
+int t() {
 
 /* Ultrix mips cc rejects this.  */
 typedef int charset[2]; const charset x;
@@ -1646,7 +1458,7 @@
 char **p;
 /* NEC SVR4.0.2 mips cc rejects this.  */
 struct point {int x, y;};
-static struct point const zero = {0,0};
+static struct point const zero;
 /* AIX XL C 1.02.0.0 rejects this.
    It does not let you subtract one const X* pointer from another in an arm
    of an if-expression whose if-part is not a constant expression */
@@ -1683,19 +1495,17 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_c_const=no
 fi
 rm -f conftest*
-fi
 
-echo "$ac_t""$ac_cv_c_const" 1>&6
+fi
+echo "$ac_t""$ac_cv_c_const" 1>&4
 if test $ac_cv_c_const = no; then
   cat >> confdefs.h <<\EOF
 #define const 
@@ -1703,62 +1513,55 @@
 
 fi
 
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1708: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for inline""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_c_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 1715 "configure"
+  if test "$GCC" = yes; then
+cat > conftest.$ac_ext <<EOF
+#line 1523 "configure"
 #include "confdefs.h"
 
-int main() {
-} $ac_kw foo() {
+int main() { return 0; }
+int t() {
+} inline foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   rm -rf conftest*
-  ac_cv_c_inline=$ac_kw; break
+  ac_cv_c_inline=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_inline=no
 fi
 rm -f conftest*
-done
 
+else
+  ac_cv_c_inline=no
 fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
-  inline | yes) ;;
-  no) cat >> confdefs.h <<\EOF
-#define inline 
-EOF
- ;;
-  *)  cat >> confdefs.h <<EOF
-#define inline $ac_cv_c_inline
+fi
+echo "$ac_t""$ac_cv_c_inline" 1>&4
+if test $ac_cv_c_inline = no; then
+  cat >> confdefs.h <<\EOF
+#define inline __inline
 EOF
- ;;
-esac
 
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1748: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo $ac_n "checking for pid_t""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_type_pid_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1753 "configure"
+#line 1557 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
-#include <stddef.h>
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "pid_t" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_pid_t=yes
 else
@@ -1768,7 +1571,7 @@
 rm -f conftest*
 
 fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+echo "$ac_t""$ac_cv_type_pid_t" 1>&4
 if test $ac_cv_type_pid_t = no; then
   cat >> confdefs.h <<\EOF
 #define pid_t int
@@ -1776,22 +1579,20 @@
 
 fi
 
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1781: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for size_t""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_type_size_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1786 "configure"
+#line 1588 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
-#include <stddef.h>
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "size_t" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_size_t=yes
 else
@@ -1801,7 +1602,7 @@
 rm -f conftest*
 
 fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
+echo "$ac_t""$ac_cv_type_size_t" 1>&4
 if test $ac_cv_type_size_t = no; then
   cat >> confdefs.h <<\EOF
 #define size_t unsigned
@@ -1809,34 +1610,32 @@
 
 fi
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1814: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_header_time'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1819 "configure"
+#line 1619 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
-int main() {
+int main() { return 0; }
+int t() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_header_time=no
 fi
 rm -f conftest*
-fi
 
-echo "$ac_t""$ac_cv_header_time" 1>&6
+fi
+echo "$ac_t""$ac_cv_header_time" 1>&4
 if test $ac_cv_header_time = yes; then
   cat >> confdefs.h <<\EOF
 #define TIME_WITH_SYS_TIME 1
@@ -1844,22 +1643,20 @@
 
 fi
 
-echo $ac_n "checking for u_int""... $ac_c" 1>&6
-echo "configure:1849: checking for u_int" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for u_int""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_type_u_int'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1854 "configure"
+#line 1652 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
-#include <stddef.h>
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "u_int[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "u_int" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_u_int=yes
 else
@@ -1869,7 +1666,7 @@
 rm -f conftest*
 
 fi
-echo "$ac_t""$ac_cv_type_u_int" 1>&6
+echo "$ac_t""$ac_cv_type_u_int" 1>&4
 if test $ac_cv_type_u_int = no; then
   cat >> confdefs.h <<\EOF
 #define u_int unsigned int
@@ -1877,22 +1674,20 @@
 
 fi
 
-echo $ac_n "checking for u_char""... $ac_c" 1>&6
-echo "configure:1882: checking for u_char" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_char'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for u_char""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_type_u_char'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1887 "configure"
+#line 1683 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
-#include <stddef.h>
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "u_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "u_char" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_u_char=yes
 else
@@ -1902,7 +1697,7 @@
 rm -f conftest*
 
 fi
-echo "$ac_t""$ac_cv_type_u_char" 1>&6
+echo "$ac_t""$ac_cv_type_u_char" 1>&4
 if test $ac_cv_type_u_char = no; then
   cat >> confdefs.h <<\EOF
 #define u_char unsigned char
@@ -1911,16 +1706,15 @@
 fi
 
 
-echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:1916: checking for 8-bit clean memcmp" >&5
-if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_func_memcmp'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   if test "$cross_compiling" = yes; then
-  ac_cv_func_memcmp_clean=no
+  ac_cv_func_memcmp=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1924 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 1718 "configure"
 #include "confdefs.h"
 
 main()
@@ -1930,59 +1724,47 @@
 }
 
 EOF
-if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_func_memcmp_clean=yes
+eval $ac_link
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
+  ac_cv_func_memcmp=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_memcmp_clean=no
+  ac_cv_func_memcmp=no
 fi
-rm -fr conftest*
 fi
-
+rm -fr conftest*
 fi
+echo "$ac_t""$ac_cv_func_memcmp" 1>&4
+test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o"
 
-echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1952: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_type_signal'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1957 "configure"
+#line 1745 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
 #ifdef signal
 #undef signal
 #endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
+extern void (*signal ()) ();
+int main() { return 0; }
+int t() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if eval $ac_compile; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   ac_cv_type_signal=int
 fi
 rm -f conftest*
-fi
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
+fi
+echo "$ac_t""$ac_cv_type_signal" 1>&4
 cat >> confdefs.h <<EOF
 #define RETSIGTYPE $ac_cv_type_signal
 EOF
@@ -1990,23 +1772,19 @@
 
 for ac_func in poll strstr _setbufend
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1995: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 2000 "configure"
+#line 1781 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+#include <ctype.h> /* Arbitrary system header to define __stub macros. */
 /* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+char $ac_func(); 
 
-int main() {
+int main() { return 0; }
+int t() {
 
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
@@ -2019,49 +1797,43 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if eval $ac_link; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-fi
 
+fi
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  echo "$ac_t""yes" 1>&4
+    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_func 1
 EOF
  
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 fi
 done
 
 for ac_func in usleep strsep strdup mkstemp snprintf memcmp
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2050: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
+if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&4
 else
   cat > conftest.$ac_ext <<EOF
-#line 2055 "configure"
+#line 1830 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+#include <ctype.h> /* Arbitrary system header to define __stub macros. */
 /* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+char $ac_func(); 
 
-int main() {
+int main() { return 0; }
+int t() {
 
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
@@ -2074,41 +1846,31 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if eval $ac_link; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-fi
 
+fi
 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
+  echo "$ac_t""yes" 1>&4
+  :
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&4
 LIBOBJS="$LIBOBJS ${ac_func}.o"
 fi
-done
-
-
 
-mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
-
+done
 
-echo "be sure to generate Makefile from Imakefile, using xmkmf -a."
-/bin/rm -f Makefile image/Makefile
 
 trap '' 1 2 15
-cat > confcache <<\EOF
+if test -w $cache_file; then
+echo "updating cache $cache_file"
+cat > $cache_file <<\EOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
 # scripts and configure runs.  It is not useful on other systems.
@@ -2124,38 +1886,15 @@
 # --recheck option to rerun configure.
 #
 EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
+# Ultrix sh set writes to stderr and can't be redirected directly.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
+  sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
+  >> $cache_file
 else
-  if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
+echo "not updating unwritable cache $cache_file"
 fi
-rm -f confcache
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
 
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
@@ -2174,7 +1913,7 @@
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
 cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
 s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
 s%\[%\\&%g
 s%\]%\\&%g
@@ -2190,7 +1929,7 @@
 echo creating $CONFIG_STATUS
 rm -f $CONFIG_STATUS
 cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
+#!/bin/sh
 # Generated automatically by configure.
 # Run this file to recreate the current configuration.
 # This directory was configured as follows,
@@ -2209,7 +1948,7 @@
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12"
+    echo "$CONFIG_STATUS generated by autoconf version 2.1"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2219,14 +1958,12 @@
 
 ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo "Imakefile image/Imakefile sample/Imakefile
-	contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+trap 'rm -f Imakefile image/Imakefile sample/Imakefile
+	contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl; exit 1' 1 2 15
 
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+# Protect against being on the right side of a sed subst in config.status. 
+sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
+ s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
 $ac_vpsub
 $extrasub
 s%@CFLAGS@%$CFLAGS%g
@@ -2238,18 +1975,6 @@
 s%@exec_prefix@%$exec_prefix%g
 s%@prefix@%$prefix%g
 s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@AWK@%$AWK%g
 s%@YACC@%$YACC%g
@@ -2263,46 +1988,9 @@
 s%@mgp_cv_vflib_a@%$mgp_cv_vflib_a%g
 s%@CPP@%$CPP%g
 s%@LIBOBJS@%$LIBOBJS%g
-s%@mgp_keywords@%$mgp_keywords%g
 
 CEOF
 EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
-  if test $ac_beg -gt 1; then
-    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
-  else
-    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
-  fi
-  if test ! -s conftest.s$ac_file; then
-    ac_more_lines=false
-    rm -f conftest.s$ac_file
-  else
-    if test -z "$ac_sed_cmds"; then
-      ac_sed_cmds="sed -f conftest.s$ac_file"
-    else
-      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
-    fi
-    ac_file=`expr $ac_file + 1`
-    ac_beg=$ac_end
-    ac_end=`expr $ac_end + $ac_max_sed_cmds`
-  fi
-done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
-fi
-EOF
-
 cat >> $CONFIG_STATUS <<EOF
 
 CONFIG_FILES=\${CONFIG_FILES-"Imakefile image/Imakefile sample/Imakefile
@@ -2310,21 +1998,21 @@
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  # Support "outfile[:infile]", defaulting infile="outfile.in".
   case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
   *) ac_file_in="${ac_file}.in" ;;
   esac
 
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+  # Adjust relative srcdir, etc. for subdirectories.
 
   # Remove last slash and all that follows it.  Not all systems have dirname.
   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
     # The file is in a subdirectory.
     test ! -d "$ac_dir" && mkdir "$ac_dir"
-    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    ac_dir_suffix="/$ac_dir"
     # A "../" for each directory in $ac_dir_suffix.
     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
   else
@@ -2341,7 +2029,6 @@
     top_srcdir="$ac_dots$ac_given_srcdir" ;;
   esac
 
-
   echo creating "$ac_file"
   rm -f "$ac_file"
   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
@@ -2350,25 +2037,23 @@
 # $configure_input" ;;
   *) ac_comsub= ;;
   esac
-
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
   sed -e "$ac_comsub
 s%@configure_input@%$configure_input%g
 s%@srcdir@%$srcdir%g
 s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
 fi; done
-rm -f conftest.s*
+rm -f conftest.subs
 
-EOF
-cat >> $CONFIG_STATUS <<EOF
 
-EOF
-cat >> $CONFIG_STATUS <<\EOF
 
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
 rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
+
+
+/bin/rm -f Makefile image/Makefile
 
+echo "be sure to generate Makefile from Imakefile, xmkmf and make Makefiles"
Index: kit/configure.in
diff -u kit/configure.in:1.44 kit/configure.in:1.46
--- kit/configure.in:1.44	Mon Nov 16 22:33:57 1998
+++ kit/configure.in	Thu Dec 17 13:58:30 1998
@@ -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.44 1998/11/16 13:33:57 itojun Exp $
+dnl $Id: configure.in,v 1.46 1998/12/17 04:58:30 onoe Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -205,12 +205,9 @@
 AC_CHECK_FUNCS(poll strstr _setbufend)
 AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp)
 
-dnl keyword substitution.
-mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
-AC_SUBST(mgp_keywords)
+AC_OUTPUT(Imakefile image/Imakefile sample/Imakefile
+	contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl)
 
-echo "be sure to generate Makefile from Imakefile, using xmkmf -a."
 /bin/rm -f Makefile image/Makefile
 
-AC_OUTPUT(Imakefile image/Imakefile sample/Imakefile
-	contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl)
+echo "be sure to generate Makefile from Imakefile, xmkmf and make Makefiles"
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 Dec 21 05:10:10 1998
@@ -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.132 kit/draw.c:1.134
--- kit/draw.c:1.132	Wed Dec  9 07:20:31 1998
+++ kit/draw.c	Thu Dec 17 13:32:33 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.132 1998/12/08 22:20:31 itojun Exp $
+ * $Id: draw.c,v 1.134 1998/12/17 04:32:33 onoe Exp $
  */
 
 #include "mgp.h"
@@ -57,16 +57,16 @@
 static int set_position __P((struct render_state *));
 static void draw_line_start __P((struct render_state *));
 static void draw_line_itemsize __P((struct render_state *, int, int));
-static void draw_line_output __P((struct render_state *, u_char *));
+static void draw_line_output __P((struct render_state *, char *));
 static void draw_line_end __P((struct render_state *));
 static void cutin __P((struct render_state *, int, int, int));
 #if 0
-static void shrink __P((u_char *, u_int));
+static void shrink __P((char *, u_int));
 #endif
 
-static void draw_string __P((struct render_state *, u_char *));
+static void draw_string __P((struct render_state *, char *));
 static void draw_fragment __P((struct render_state *, u_char *, u_int, char *, int));
-static int iskinsokuchar __P((u_short));
+static int iskinsokuchar __P((u_int));
 static struct render_object *obj_alloc __P((struct render_state *state));
 static void obj_free __P((struct render_state *, struct render_object *));
 static int obj_new_xfont __P((struct render_state *, int, int, int,
@@ -86,9 +86,9 @@
 static u_int draw_onechar_tf __P((struct render_state *, u_int, int, int,
 	u_int, int));
 #endif
-static u_char *x_fontname __P((u_char *, int, u_char *, int, char *));
+static char *x_fontname __P((char *, int, char *, int, char *));
 static int x_parsefont __P((char *, int *, int*));
-static XFontStruct *x_setfont __P((u_char *, u_int, char *, int *));
+static XFontStruct *x_setfont __P((char *, u_int, char *, int *));
 static u_int draw_onechar_x __P((struct render_state *, u_int, int, int, int,
 	char *, int));
 
@@ -536,7 +536,7 @@
 
 	case CTL_PREFIXPOS:
 	    {
-		u_char *p;
+		char *p;
 
 		p = (state->tabprefix) ? state->tabprefix : state->curprefix;
 		if (!p)
@@ -717,7 +717,7 @@
 static void
 draw_line_output(state, data)
 	struct render_state *state;
-	u_char *data;
+	char *data;
 {
 	draw_string(state, data);
 }
@@ -726,7 +726,7 @@
 draw_line_end(state)
 	struct render_state *state;
 {
-	u_int xpos;
+	int xpos;
 
 	xpos = set_position(state);
 
@@ -738,10 +738,10 @@
 		break;
 #endif
 	case SP_LCUTIN:
-		cutin(state, (int)xpos, state->ypos, 1);
+		cutin(state, xpos, state->ypos, 1);
 		break;
 	case SP_RCUTIN:
-		cutin(state, (int)xpos, state->ypos, -1);
+		cutin(state, xpos, state->ypos, -1);
 		break;
 	default:
 		break;
@@ -810,7 +810,7 @@
 #if 0
 static void
 shrink(data, page)
-	u_char *data;
+	char *data;
 	u_int page;
 {
 	u_int min_csize = char_size;
@@ -854,10 +854,9 @@
 static void
 draw_string(state, data)
 	struct render_state *state;
-	u_char *data;
+	char *data;
 {
-	u_char *p;
-	u_char *q;
+	u_char *p, *q;
 	char *registry = NULL;
 	u_int code2;
 	static char *rtab96[] = {
@@ -877,7 +876,7 @@
 #define RTAB9494_MAX	(sizeof(rtab9494)/sizeof(rtab9494[0]))
 	int charset16 = 0;
 
-	p = data;
+	p = (u_char *)data;
 
 	while (*p && *p != '\n') {
 		/* 94x94 charset */
@@ -1155,7 +1154,7 @@
 
 static int
 iskinsokuchar(code)
-	u_short code;
+	u_int code;
 {
 	u_short *kinsoku;
 
@@ -1377,7 +1376,7 @@
 	RGBMap rgb;
 	int r, g, b;
 	char hist[256];
-	u_char *p;
+	byte *p;
 
 	switch (bimage->type) {
 	case IBITMAP:
@@ -1597,7 +1596,7 @@
 	u_int code;
 	char *registry;
 	XChar2b kch[2];
-	u_char ch[2];
+	char ch[2];
 	u_int isize;
 	int i;
 #ifdef RASTERLIB
@@ -1631,10 +1630,9 @@
 #endif /* FREETYPE */
 	}
 	if (obj != NULL) {	/* VFONT exist */
-		/*XXX "depth" is wrong - mgp-users-jp 135*/
 		xim = XCreateImage(display, visual, depth, ZPixmap,
 				0, NULL, width, height,
-				depth == 24 ? 32 : depth, 0);
+				8 << (depth - 1) / 8, 0);
 		xim->data = malloc(xim->bytes_per_line * height);
 		if (COMPLEX_BGIMAGE) {
 			u_int bw, bh, bx, by, ox, oy;
@@ -1870,18 +1868,18 @@
 }
 #endif /* VFLIB */
 
-static u_char *
+static char *
 x_fontname(buf, bufsiz, seed, siz, registry)
-	u_char *buf;
+	char *buf;
 	int bufsiz;
-	u_char *seed;
+	char *seed;
 	int siz;
 	char *registry;	/* already canonicalized */
 {
 	int hyphen;
 	char *p;
-	u_char tmp[BUFSIZ];
-	u_char tmp2[BUFSIZ];
+	char tmp[BUFSIZ];
+	char tmp2[BUFSIZ];
 	char **fontlist;
 	int count;
 
@@ -1982,14 +1980,14 @@
 
 static XFontStruct *
 x_setfont(xfont, csize, registry, truescalable)
-	u_char *xfont;
+	char *xfont;
 	u_int csize;
 	char *registry;
 	int *truescalable;
 {
 	static XFontStruct *xfontstruct;
 	int i, fsize;
-	u_char fontstring[BUFSIZ];
+	char fontstring[BUFSIZ];
 #define	FONTTYPEMAX	10	/* number of used fontlist type (in cache) */
 #define	FONTLISTMAX	20	/* number of list for specified font type */
 #define	FONTALLOWMAX	105	/* % of desired font */
@@ -2000,16 +1998,16 @@
 	int maxsize, minsize;
 	int scalable, tscalable, tsflag;
 	static struct {
-		u_char *xlfd;
+		char *xlfd;
 		char **list;
 		int count;
 	} fontnames[FONTTYPEMAX];
 #define	FONTCACHEMAX	200	/* number of used font type (in cache) */
 	static struct {
-		u_char *xfont;
+		char *xfont;
 		u_int csize;
 		char *registry;
-		u_char *xlfd;
+		char *xlfd;
 		XFontStruct *xfontstruct;
 	} fonts[FONTCACHEMAX];
 
@@ -3089,8 +3087,8 @@
 			}
 		}
 	} else {
-		u_char	geom_arg1[] = {"-geometry"};
-		u_char  geom_arg2[512];
+		char geom_arg1[] = {"-geometry"};
+		char geom_arg2[512];
 
 		sprintf(geom_arg2, "+%d+%d", DisplayWidth(display, 
 			DefaultScreen(display)),
Index: kit/font.c
diff -u kit/font.c:1.19 kit/font.c:1.20
--- kit/font.c:1.19	Thu Oct 15 21:37:54 1998
+++ kit/font.c	Thu Dec 17 13:32:36 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: font.c,v 1.19 1998/10/15 12:37:54 itojun Exp $
+ * $Id: font.c,v 1.20 1998/12/17 04:32:36 onoe Exp $
  */
 
 #include "mgp.h"
@@ -320,7 +320,7 @@
 				*s = revbitmap[*s];
 		}
 	}
-	xim->data = bitmap;
+	xim->data = (char *)bitmap;
 	vfc->image = xim;
 	/* horizontal gap of 1 dot is included by default */
 	char_len = max_x - min_x + 2;
Index: kit/grammar.y
diff -u kit/grammar.y:1.25 kit/grammar.y:1.26
--- kit/grammar.y:1.25	Wed Dec  9 07:20:33 1998
+++ kit/grammar.y	Thu Dec 17 10:41:48 1998
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.25 1998/12/08 22:20:33 itojun Exp $
+ * $Id: grammar.y,v 1.26 1998/12/17 01:41:48 onoe Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -638,6 +638,7 @@
 %token KW_LINESTART KW_LINEEND KW_MARK KW_SYSTEM KW_FILTER KW_ENDFILTER
 %token KW_QUALITY KW_ICON KW_LEFTFILL KW_XSYSTEM KW_VFCAP KW_TFONT KW_TFDIR
 %token KW_DEFFONT KW_FONT KW_TFONT0 KW_EMBED KW_ENDEMBED KW_NEWIMAGE
+%token KW_CHARSET
 
 %type <ct> toplevel
 %type <ct> line defaultline tabline shellline deffontline
Index: kit/keywords.pl
diff -u kit/keywords.pl:1.1 kit/keywords.pl:removed
--- kit/keywords.pl:1.1	Tue Nov 11 15:07:40 1997
+++ kit/keywords.pl	Mon Dec 21 05:10:16 1998
@@ -1,14 +0,0 @@
-@keywords = ();
-
-die if (@ARGV != 1);
-open(IN, "< $ARGV[0]") || die;
-while (<IN>) {
-	next if (! /^\/\*CTL\*\//);
-	next if (! /CTL_([A-Z0-9]+),/);
-	$t = $1;
-	$t =~ tr/A-Z/a-z/;
-	push(@keywords, $t);
-}
-close(IN);
-
-print join(' ', @keywords) . "\n";
Index: kit/mgp.c
diff -u kit/mgp.c:1.91 kit/mgp.c:1.92
--- kit/mgp.c:1.91	Fri Nov 20 10:51:31 1998
+++ kit/mgp.c	Thu Dec 17 13:32:37 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.91 1998/11/20 01:51:31 itojun Exp $
+ * $Id: mgp.c,v 1.92 1998/12/17 04:32:37 onoe Exp $
  */
 
 static char *mgp_version = "1.04a (980906)";
@@ -192,7 +192,7 @@
 	int opt;
 	extern char *optarg;
 	extern int optind;
-	u_char *progname;
+	char *progname;
 	u_int start_page = 1;
 	char buf[BUFSIZ], *p;
 	extern char *Paths[];
Index: kit/mgp.h
diff -u kit/mgp.h:1.100 kit/mgp.h:1.101
--- kit/mgp.h:1.100	Tue Nov 24 19:25:49 1998
+++ kit/mgp.h	Thu Dec 17 13:32:39 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.100 1998/11/24 10:25:49 itojun Exp $
+ * $Id: mgp.h,v 1.101 1998/12/17 04:32:39 onoe Exp $
  */
 
 #include <stdio.h>
@@ -186,22 +186,22 @@
 };
 
 struct ctrl_char {
-	u_char *ct_value;
+	char *ct_value;
 };
 
 struct ctrl_char2 {
-	u_char *ct_value1;
-	u_char *ct_value2;
+	char *ct_value1;
+	char *ct_value2;
 };
 
 struct ctrl_args {
 	u_int ct_argc;
-	u_char **ct_argv;
+	char **ct_argv;
 	int ct_flag;
 };
 
 struct ctrl_image {
-	u_char *ct_fname;
+	char *ct_fname;
 	u_int ct_numcolor;
 	u_int ct_ximagesize;
 	u_int ct_yimagesize;
@@ -245,7 +245,7 @@
 };
 
 struct ctrl_icon {
-	u_char *ct_value; 
+	char *ct_value; 
 	u_long ct_color; 
 	u_int ct_size;   
 };  
@@ -337,8 +337,8 @@
 		 * DEFAULT - doing default_control
 		 * PAGE    - doing page_control
 		 */
-	u_char *curprefix;
-	u_char *tabprefix;
+	char *curprefix;
+	char *tabprefix;
 	u_int align;
 	u_int special;
 	u_int leftfillpos;
@@ -393,7 +393,7 @@
 		struct tfont *tfc;
 #endif /* FREETYPE */
 		struct {
-			u_char *xfont;
+			char *xfont;
 			u_int csize;
 			u_int code;
 			char *registry;
@@ -465,7 +465,7 @@
  * they are available in both "mgp" and "mgp2ps" binary.
  */
 #if 0
-extern u_char *page_data[MAXPAGE][MAXLINE];
+extern char *page_data[MAXPAGE][MAXLINE];
 #endif
 extern struct ctrl *page_control[MAXPAGE][MAXLINE];
 extern struct ctrl *default_control[MAXLINE];
@@ -584,15 +584,15 @@
 extern void draw_reinit __P((struct render_state *));
 
 /*parse.c*/
-extern void load_file __P((u_char *));
+extern void load_file __P((char *));
 extern void cleanup_file __P(());
 extern int ctlcmp __P((struct ctrl *, struct ctrl *));
 extern FILE *fsearchopen __P((char *, char *, char **));
-extern int chkfile __P((u_char *));
+extern int chkfile __P((char *));
 extern struct ctrl *ctllastitem __P((struct ctrl *));
 extern void ctlappend __P((struct ctrl *, struct ctrl *));
 extern void ctlinsert __P((struct ctrl **, struct ctrl *));
-extern struct ctrl *ctlalloc1 __P((u_char));
+extern struct ctrl *ctlalloc1 __P((u_int));
 extern void ctlfree __P((struct ctrl *));
 extern struct ctrl *ctlcopy __P((struct ctrl *));
 extern void debug0 __P((struct ctrl *));
@@ -620,8 +620,8 @@
 extern void init_win1 __P((char *));
 extern void init_win2 __P((void));
 extern void init_win3 __P((void));
-extern int get_color __P((u_char *, u_long *));
-extern struct g_color *name2gcolor __P((u_char *));
+extern int get_color __P((char *, u_long *));
+extern struct g_color *name2gcolor __P((char *));
 extern void regist_alloc_colors __P((struct alloc_color *, u_long *, int));
 extern void free_alloc_colors __P((struct alloc_color *));
 
Index: kit/parse.c
diff -u kit/parse.c:1.73 kit/parse.c:1.74
--- kit/parse.c:1.73	Mon Nov  9 14:28:19 1998
+++ kit/parse.c	Thu Dec 17 13:32:41 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.73 1998/11/09 05:28:19 itojun Exp $
+ * $Id: parse.c,v 1.74 1998/12/17 04:32:41 onoe Exp $
  */
 
 #include "mgp.h"
@@ -34,7 +34,7 @@
 # include <fcntl.h>
 #endif
 
-static struct ctrl *parse_text __P((u_char *, u_int));
+static struct ctrl *parse_text __P((char *, u_int));
 static void read_rc __P((FILE *, char *));
 static void read_file __P((FILE *, char *, u_int *, u_int *, int));
 static void secondpass __P((void));
@@ -56,7 +56,7 @@
 
 void
 load_file(filename)
-	u_char *filename;
+	char *filename;
 {
 	FILE *fp;
 	u_int page;
@@ -125,7 +125,7 @@
 
 static struct ctrl *
 parse_text(p, page)
-	u_char *p;
+	char *p;
 	u_int page;
 {
 	struct ctrl sentinel;
@@ -155,7 +155,7 @@
 	FILE *fp;
 	char *filename;
 {
-	u_char buf[BUFSIZ];
+	char buf[BUFSIZ];
 	struct ctrl *cp;
 	int lineno;
 
@@ -244,12 +244,12 @@
 	u_int *line;
 	int preamble;
 {
-	u_char buf[BUFSIZ];
+	char buf[BUFSIZ];
 	struct ctrl **ch;
 	struct ctrl *cp;
 	struct ctrl *p;
 	int line_cont;
-	u_char *infilename;
+	char *infilename;
 	struct ctrl *filtermode;
 	int filterfd = -1;
 	char filtername[MAXPATHLEN];
@@ -415,7 +415,7 @@
 			continue;
 		}
 	    {
-		u_char *p;
+		char *p;
 
 		p = buf + strlen(buf);
 		if (buf < p && p[-1] == '\n') {
@@ -730,7 +730,7 @@
 	struct ctrl *cp;
 	struct ctrl *cp1;
 	struct ctrl *cp2;
-	u_char *p;
+	char *p;
 	struct ctrl *carryover[MAXPAGE];
 
     {
@@ -1091,7 +1091,7 @@
 					p++;
 				}
 				if (p) {
-					u_char *tmp;
+					char *tmp;
 
 					tmp = cp->ctc_value;
 					p = cp->ctc_value = strdup(p);
@@ -1105,8 +1105,8 @@
 			}
 			/* special: style escape */
 			if (p && *p == '&') {
-				u_char *p0;
-				u_char *tmp;
+				char *p0;
+				char *tmp;
 				int i;
 
 				p0 = p;
@@ -1334,7 +1334,7 @@
 
 int
 chkfile(p)
-	u_char *p;
+	char *p;
 {
 	char buf[BUFSIZ];
 
@@ -1395,7 +1395,7 @@
 
 struct ctrl *
 ctlalloc1(op)
-	u_char op;
+	u_int op;
 {
 	struct ctrl *p;
 
Index: kit/postscript.c
diff -u kit/postscript.c:1.5 kit/postscript.c:1.7
--- kit/postscript.c:1.5	Thu Nov 26 15:33:17 1998
+++ kit/postscript.c	Thu Dec 17 14:09:22 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: postscript.c,v 1.5 1998/11/26 06:33:17 itojun Exp $
+ * $Id: postscript.c,v 1.7 1998/12/17 05:09:22 onoe Exp $
  */
 
 #include "mgp.h"
@@ -153,7 +153,7 @@
 		x = x * state->width / width;
 		break;
 	case Z_SCREEN0:	/* original screen size specified */
-		x = state->width / x;
+		x = state->width / (double)*xp;
 		break;
 	default:
 		fprintf(stderr, "wrong zooming mode for x axis %d\n", xmode);
@@ -171,7 +171,7 @@
 		y = y * state->height / height;
 		break;
 	case Z_SCREEN0:
-		y = state->height / y;
+		y = state->height / (double)*yp;
 		break;
 	case Z_OBEY:
 		y = x;
@@ -208,6 +208,6 @@
 	if (mgp_flag & FL_VERBOSE) {
 		fprintf(stderr, "resulting zoom=(%f,%f)\n", x, y);
 	}
-	*xp = (int)(x * 100);
-	*yp = (int)(y * 100);
+	*xp = (int)x * 100;
+	*yp = (int)y * 100;
 }
Index: kit/print.c
diff -u kit/print.c:1.71 kit/print.c:1.72
--- kit/print.c:1.71	Wed Dec  9 07:20:34 1998
+++ kit/print.c	Thu Dec 17 13:54:53 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.71 1998/12/08 22:20:34 itojun Exp $
+ * $Id: print.c,v 1.72 1998/12/17 04:54:53 onoe Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -35,8 +35,8 @@
 #include "mgp.h"
 
 static u_int align = AL_LEFT;
-static u_char *curprefix = NULL;
-static u_char *tabprefix = NULL;
+static char *curprefix = NULL;
+static char *tabprefix = NULL;
 static u_int lineheight;
 static u_int linewidth;
 
@@ -48,7 +48,7 @@
 
 static FILE *fp;
 static u_int reverse;
-static u_char outputfile[MAXVALLEN];
+static char outputfile[MAXVALLEN];
 static int colorps = 0;
 static int painticon = 0;
 static u_int curlinenum;
@@ -193,9 +193,9 @@
 static void line_skip __P((int, int));
 static void print_bar __P((struct ctrl *));
 static void print_icon __P((struct ctrl *));
-static void print_line __P((u_char *, int));
-static int iskinsokuchar __P((u_short));
-static void print_string __P((u_char *, int));
+static void print_line __P((char *, int));
+static int iskinsokuchar __P((u_int));
+static void print_string __P((char *, int));
 static void print_fragment __P((u_char *, u_int, int, int));
 static void text_remember __P((char *, int, int, int, int));
 static void icon_remember __P((int, int, int, u_long));
@@ -992,7 +992,7 @@
 
 static void
 print_line(data, pfx)
-	u_char *data;
+	char *data;
 	int pfx;
 {
 	if (data && *data)
@@ -1001,7 +1001,7 @@
 
 static int
 iskinsokuchar(code)
-	u_short code;
+	u_int code;
 {
 	u_short *kinsoku;
 
@@ -1014,15 +1014,14 @@
 
 static void
 print_string(data, pfx)
-	u_char *data;
+	char *data;
 	int pfx;
 {
-	u_char *p;
-	u_char *q;
+	u_char *p, *q;
 	int kanji = 0;
 	u_int code2;
 
-	p = data;
+	p = (u_char *)data;
 
 	while (*p && *p != '\n') {
 		if (p[0] == 0x1b && p[1] == '$'
@@ -1079,7 +1078,7 @@
 	int pfx;
 {
 	u_char *p;
-	u_char *q;
+	char *q;
 	char buf[4096];
 	u_int code;
 	int textstartpos = 0;
@@ -1702,7 +1701,7 @@
 	u_int opt;
 	extern char *optarg;
 	extern int optind;
-	u_char *progname;
+	char *progname;
 	static char pathbuf[MAXPATHLEN];
 
 	progname = argv[0];
Index: kit/scanner.l
diff -u kit/scanner.l:1.12 kit/scanner.l:1.14
--- kit/scanner.l:1.12	Wed Dec  9 06:49:09 1998
+++ kit/scanner.l	Thu Dec 17 13:25:13 1998
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.12 1998/12/08 21:49:09 itojun Exp $
+ * $Id: scanner.l,v 1.14 1998/12/17 04:25:13 onoe Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -98,6 +98,8 @@
 JSTR	{JISIN}([\041-\176][\041-\176])*{ASCIIIN}
 
 %a 6000
+%p 4000
+%o 8000
 
 %%
 (NOOP|noop)		return KW_NOOP;
Index: kit/x11.c
diff -u kit/x11.c:1.19 kit/x11.c:1.20
--- kit/x11.c:1.19	Tue Nov 10 15:20:54 1998
+++ kit/x11.c	Thu Dec 17 13:32:42 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: x11.c,v 1.19 1998/11/10 06:20:54 itojun Exp $
+ * $Id: x11.c,v 1.20 1998/12/17 04:32:42 onoe Exp $
  */
 
 #include "mgp.h"
@@ -284,7 +284,7 @@
 
 int
 get_color(colorname, value)
-	u_char *colorname;
+	char *colorname;
 	u_long *value;
 {
 	XColor c0, c1;
@@ -302,7 +302,7 @@
 
 struct g_color *
 name2gcolor(colorname)
-	u_char *colorname;
+	char *colorname;
 {
 	XColor c0, c1;
 	struct g_color *color;
@@ -343,10 +343,10 @@
  
 	if (!(mgp_flag & FL_PRIVATE)) return;
 	if (!clr->num)
-		clr->colors = (u_long *)malloc(sizeof(u_long) * num);
+		clr->colors = (long *)malloc(sizeof(u_long) * num);
 	else
-		clr->colors = (u_long *)realloc(clr->colors,
-							sizeof(u_long) * (clr->num + num));
+		clr->colors = (long *)realloc(clr->colors,
+						sizeof(u_long) * (clr->num + num));
 	for (i = 0; i < num; i++)
 		clr->colors[clr->num +i] = (u_long)*(colors +i);
 	clr->num += num;
Index: kit/x11dummy.c
diff -u kit/x11dummy.c:1.9 kit/x11dummy.c:1.10
--- kit/x11dummy.c:1.9	Wed Aug 26 14:30:03 1998
+++ kit/x11dummy.c	Thu Dec 17 13:32:44 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: x11dummy.c,v 1.9 1998/08/26 05:30:03 itojun Exp $
+ * $Id: x11dummy.c,v 1.10 1998/12/17 04:32:44 onoe Exp $
  */
 
 #include "mgp.h"
@@ -78,7 +78,7 @@
 #if 0
 int
 get_color(colorname, value)
-	u_char *colorname;
+	char *colorname;
 	u_long *value;
 {
 	if (*value)
@@ -89,7 +89,7 @@
 
 int
 get_color(colorname, value)
-	u_char *colorname;
+	char *colorname;
 	u_long *value;
 {
 	XColor c0, c1;
@@ -109,7 +109,7 @@
 
 struct g_color *
 name2gcolor(colorname)
-	u_char *colorname;
+	char *colorname;
 {
 	Colormap cmap;
 	XColor c0, c1;
@@ -151,10 +151,10 @@
 
 	if (!(mgp_flag & FL_PRIVATE)) return;
 	if (!clr->num)
-		clr->colors = (u_long *)malloc(sizeof(u_long) * num);
+		clr->colors = (long *)malloc(sizeof(u_long) * num);
 	else
-		clr->colors = (u_long *)realloc(clr->colors,
-							sizeof(u_long) * (clr->num + num));
+		clr->colors = (long *)realloc(clr->colors,
+						sizeof(u_long) * (clr->num + num));
 	for (i = 0; i < num; i++)
 		clr->colors[clr->num +i] = (u_long)*(colors +i);
 	clr->num += num;
Index: kit/image/image.h
diff -u kit/image/image.h:1.3 kit/image/image.h:1.4
--- kit/image/image.h:1.3	Fri Feb 13 16:48:49 1998
+++ kit/image/image.h	Thu Dec 17 14:23:42 1998
@@ -11,8 +11,7 @@
 #include "copyright.h"
 #include <stdio.h>
 
-#define SYSV	/* actually, POSIX */
-#if defined(SYSV) || defined(VMS)
+#if defined(SYSV) || defined(VMS) || 1
 #include <string.h>
 #ifndef index /* some SysV's do this for you */
 #define index strchr
Index: kit/image/path.c
diff -u kit/image/path.c:1.3 kit/image/path.c:1.4
--- kit/image/path.c:1.3	Fri Feb 13 16:48:58 1998
+++ kit/image/path.c	Thu Dec 17 14:23:43 1998
@@ -17,7 +17,7 @@
 #include <pwd.h>
 #endif
 #include <errno.h>
-#ifdef SYSV
+#if 1 /* SYSV */
 #include <unistd.h>
 #endif
 
Index: kit/image/xbitmap.c
diff -u kit/image/xbitmap.c:1.3 kit/image/xbitmap.c:1.4
--- kit/image/xbitmap.c:1.3	Sat Sep  5 00:07:18 1998
+++ kit/image/xbitmap.c	Thu Dec 17 14:23:45 1998
@@ -19,7 +19,7 @@
 
 /* SUPPRESS 560 */
 
-#if defined(SYSV) || defined(VMS)
+#if defined(SYSV) || defined(VMS) || 1
 #include <string.h>
 #define rindex strrchr
 #else
Index: kit/image/xpixmap.c
diff -u kit/image/xpixmap.c:1.4 kit/image/xpixmap.c:1.5
--- kit/image/xpixmap.c:1.4	Sat Sep  5 00:07:18 1998
+++ kit/image/xpixmap.c	Thu Dec 17 14:23:46 1998
@@ -19,7 +19,7 @@
 /* SUPPRESS 530 */
 /* SUPPRESS 560 */
 
-#if defined(SYSV) || defined(VMS)
+#if defined(SYSV) || defined(VMS) || 1
 #include <string.h>
 #define rindex strrchr
 #else
