diff -urN unicon-3.0.4-20010924.orig/Makefile.in unicon-3.0.4-20010924-userland-vdc/Makefile.in
--- unicon-3.0.4-20010924.orig/Makefile.in	2001-08-08 23:32:29.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/Makefile.in	2003-11-22 11:01:19.000000000 +0900
@@ -1,8 +1,7 @@
 prefix=@prefix@
+HAVE_PTH=@HAVE_PTH@
 all:
-	cd unikey; make
-	cd fonts; make
-	cd unicon; make
+	if test "x${HAVE_PTH}" = "xyes" ; then cd unicon; make; fi
 	cd tools; make
 	cd unimap; make
 
@@ -16,16 +15,12 @@
 install: all
 	if [ ! -d $(prefix)/lib/unicon ] ; then mkdir -p $(prefix)/lib/unicon; fi
 	if [ ! -d $(prefix)/bin ] ; then mkdir -p $(prefix)/bin; fi
-	cd unicon; make install
-	cd unikey; make install
-	cd fonts; make install
+	if test "x${HAVE_PTH}" = "xyes" ; then cd unicon; make install; fi
 	cd tools; make install
 	cd unimap; make install
 
 clean:
 	cd unicon; make clean
-	cd unikey; make clean
-	cd fonts; make clean
 	cd tools; make clean
 	cd unimap; make clean
 	rm -f core *.bak *~
@@ -33,10 +28,7 @@
 distclean: clean
 	rm -f config.status config.log config.cache Makefile
 	cd unicon; make distclean
-	cd unikey; make distclean
-	cd fonts; make distclean
 	cd tools; make distclean
-	cd sfonts; make distclean
 	cd unimap; make distclean
 	rm -f *.bak
 
diff -urN unicon-3.0.4-20010924.orig/configure unicon-3.0.4-20010924-userland-vdc/configure
--- unicon-3.0.4-20010924.orig/configure	2001-08-08 23:32:29.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/configure	2003-11-22 11:02:15.000000000 +0900
@@ -1,26 +1,325 @@
 #! /bin/sh
-
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.58.
 #
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
 
-# Defaults:
-ac_help=
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
 ac_default_prefix=/usr/local
-# Any additions from configure.in:
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="unicon/include/ImmClient.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE HAVE_PTH HAVE_NEWT CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_files=''
 
 # Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
 # The variables have the same names as the options, with
 # dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
 exec_prefix=NONE
-host=NONE
 no_create=
-nonopt=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
@@ -29,10 +328,15 @@
 silent=
 site=
 srcdir=
-target=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
@@ -46,17 +350,9 @@
 infodir='${prefix}/info'
 mandir='${prefix}/man'
 
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
 ac_prev=
 for ac_option
 do
-
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
     eval "$ac_prev=\$ac_option"
@@ -64,59 +360,59 @@
     continue
   fi
 
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
-  esac
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case "$ac_option" in
+  case $ac_option in
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
+    bindir=$ac_optarg ;;
 
   -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
+    ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
+    build_alias=$ac_optarg ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
 
   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
     ac_prev=datadir ;;
   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   | --da=*)
-    datadir="$ac_optarg" ;;
+    datadir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
 
   -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
+    eval "enable_$ac_feature='$ac_optarg'" ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -125,95 +421,47 @@
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
+    exec_prefix=$ac_optarg ;;
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-Directory and file names:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
-                          [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
-  --infodir=DIR           info documentation in DIR [PREFIX/info]
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
-  --srcdir=DIR            find the sources in DIR [configure dir or ..]
-  --program-prefix=PREFIX prepend PREFIX to installed program names
-  --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
-Host type:
-  --build=BUILD           configure for building on BUILD [BUILD=HOST]
-  --host=HOST             configure for HOST [guessed]
-  --target=TARGET         configure for TARGET [TARGET=HOST]
-Features and packages:
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --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
-EOF
-    if test -n "$ac_help"; then
-      echo "--enable and --with options recognized:$ac_help"
-    fi
-    exit 0 ;;
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
 
   -host | --host | --hos | --ho)
-    ac_prev=host ;;
+    ac_prev=host_alias ;;
   -host=* | --host=* | --hos=* | --ho=*)
-    host="$ac_optarg" ;;
+    host_alias=$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" ;;
+    includedir=$ac_optarg ;;
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
+    infodir=$ac_optarg ;;
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
+    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" ;;
+    libexecdir=$ac_optarg ;;
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
   | --localstate | --localstat | --localsta | --localst \
@@ -222,19 +470,19 @@
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
+    localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
+    mandir=$ac_optarg ;;
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
     with_fp=no ;;
 
   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c)
+  | --no-cr | --no-c | -n)
     no_create=yes ;;
 
   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -248,26 +496,26 @@
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
+    oldincludedir=$ac_optarg ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" ;;
+    prefix=$ac_optarg ;;
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix="$ac_optarg" ;;
+    program_prefix=$ac_optarg ;;
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix="$ac_optarg" ;;
+    program_suffix=$ac_optarg ;;
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
@@ -284,7 +532,7 @@
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name="$ac_optarg" ;;
+    program_transform_name=$ac_optarg ;;
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
@@ -294,7 +542,7 @@
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
+    sbindir=$ac_optarg ;;
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -305,58 +553,57 @@
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
+    sharedstatedir=$ac_optarg ;;
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
+    site=$ac_optarg ;;
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
+    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" ;;
+    sysconfdir=$ac_optarg ;;
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target ;;
+    ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target="$ac_optarg" ;;
+    target_alias=$ac_optarg ;;
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
-  -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13"
-    exit 0 ;;
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "with_${ac_package}='$ac_optarg'" ;;
+    eval "with_$ac_package='$ac_optarg'" ;;
 
   -without-* | --without-*)
-    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    eval "with_${ac_package}=no" ;;
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -367,99 +614,110 @@
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes="$ac_optarg" ;;
+    x_includes=$ac_optarg ;;
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries="$ac_optarg" ;;
+    x_libraries=$ac_optarg ;;
 
-  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
     ;;
 
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
-    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-      echo "configure: warning: $ac_option: invalid host type" 1>&2
-    fi
-    if test "x$nonopt" != xNONE; then
-      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
-    fi
-    nonopt="$ac_option"
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
-  { 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
-
-# File descriptor usage:
-# 0 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
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
-  exec 6>/dev/null
-else
-  exec 6>&1
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
 fi
-exec 5>./config.log
 
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
 
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
 do
-  case "$ac_arg" in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
-  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
   esac
 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
-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
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
 
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
 
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=unicon/include/ImmClient.h
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then its parent.
-  ac_prog=$0
-  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
-  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
@@ -469,13 +727,454 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
   else
-    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
   fi
 fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.58.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
 
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
 if test -z "$CONFIG_SITE"; then
   if test "x$prefix" != xNONE; then
@@ -486,284 +1185,797 @@
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    echo "loading site script $ac_site_file"
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
 done
 
 if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
 else
-  echo "creating cache $cache_file"
-  > $cache_file
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
 
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
-  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
-    ac_n= ac_c='
-' ac_t='	'
-  else
-    ac_n=-n ac_c= ac_t=
-  fi
-else
-  ac_n= ac_c='\c' ac_t=
-fi
 
 
 
-for ac_prog in mawk gawk nawk awk
+
+
+
+
+
+
+
+
+
+
+
+for ac_prog in gawk mawk nawk awk
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+  # 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:531: 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_AWK="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
 fi
 fi
-AWK="$ac_cv_prog_AWK"
+AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$ac_t""$AWK" 1>&6
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-test -n "$AWK" && break
+  test -n "$AWK" && break
 done
 
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:563: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="gcc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
 else
-  echo "$ac_t""no" 1>&6
+  CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:593: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_prog_rejected=no
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-        ac_prog_rejected=yes
-	continue
-      fi
-      ac_cv_prog_CC="cc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
   set dummy $ac_cv_prog_CC
   shift
-  if test $# -gt 0; then
+  if test $# != 0; then
     # We chose a different compiler from the bogus one.
     # However, it has the same basename, so the bogon will be chosen
     # first if we set CC to just the basename; use the full file name.
     shift
-    set dummy "$ac_dir/$ac_word" "$@"
-    shift
-    ac_cv_prog_CC="$@"
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
   fi
 fi
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-  if test -z "$CC"; then
-    case "`uname -s`" in
-    *win32* | *WIN32*)
-      # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:644: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cl"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
- ;;
-    esac
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:676: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+  test -n "$ac_ct_CC" && break
+done
 
-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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-cat > conftest.$ac_ext << EOF
+int
+main ()
+{
 
-#line 687 "configure"
-#include "confdefs.h"
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-main(){return(0);}
-EOF
-if { (eval echo configure:692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  ac_cv_prog_cc_works=yes
-  # If we can't run a trivial program, we are probably using a cross compiler.
-  if (./conftest; exit) 2>/dev/null; then
-    ac_cv_prog_cc_cross=no
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
   else
-    ac_cv_prog_cc_cross=yes
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
   fi
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_prog_cc_works=no
 fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
-  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:718: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:723: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
 else
-  cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
 #endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
-  ac_cv_prog_gcc=yes
-else
-  ac_cv_prog_gcc=no
-fi
-fi
 
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
-else
-  GCC=
-fi
+int
+main ()
+{
 
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:751: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
-  ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_prog_cc_g=no
 fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
-  CFLAGS="$ac_save_CFLAGS"
+  CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
     CFLAGS="-g -O2"
@@ -777,6 +1989,265 @@
     CFLAGS=
   fi
 fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
@@ -788,14 +2259,20 @@
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -804,212 +2281,565 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:813: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
-  for ac_dir in $PATH; do
-    # Account for people who put trailing slashes in PATH elements.
-    case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if test -f $ac_dir/$ac_prog; then
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
-            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
 	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
 	  else
-	    ac_cv_path_install="$ac_dir/$ac_prog -c"
-	    break 2
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
 	  fi
 	fi
       done
-      ;;
-    esac
-  done
-  IFS="$ac_save_IFS"
+    done
+    ;;
+esac
+done
+
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
-    INSTALL="$ac_cv_path_install"
+    INSTALL=$ac_cv_path_install
   else
     # As a last resort, use the slow shell script.  We don't cache a
     # path for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
     # removed, or if the path is relative.
-    INSTALL="$ac_install_sh"
+    INSTALL=$ac_install_sh
   fi
 fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:866: 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 "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftestmake <<\EOF
+  cat >conftest.make <<\_ACEOF
 all:
-	@echo 'ac_maketemp="${MAKE}"'
-EOF
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 if test -n "$ac_maketemp"; then
   eval ac_cv_prog_make_${ac_make}_set=yes
 else
   eval ac_cv_prog_make_${ac_make}_set=no
 fi
-rm -f conftestmake
+rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
 
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:895: checking how to run the C preprocessor" >&5
+echo "$as_me:$LINENO: checking for pth_init in -lpth" >&5
+echo $ECHO_N "checking for pth_init in -lpth... $ECHO_C" >&6
+if test "${ac_cv_lib_pth_pth_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpth  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pth_init ();
+int
+main ()
+{
+pth_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pth_pth_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pth_pth_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pth_pth_init" >&5
+echo "${ECHO_T}$ac_cv_lib_pth_pth_init" >&6
+if test $ac_cv_lib_pth_pth_init = yes; then
+  HAVE_PTH="yes"
+fi
+
+
+echo "$as_me:$LINENO: checking for newtInit in -lnewt" >&5
+echo $ECHO_N "checking for newtInit in -lnewt... $ECHO_C" >&6
+if test "${ac_cv_lib_newt_newtInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnewt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char newtInit ();
+int
+main ()
+{
+newtInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_newt_newtInit=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_newt_newtInit=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_newt_newtInit" >&5
+echo "${ECHO_T}$ac_cv_lib_newt_newtInit" >&6
+if test $ac_cv_lib_newt_newtInit = yes; then
+  HAVE_NEWT="yes"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   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 test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 910 "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:916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  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 927 "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:933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   :
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 944 "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:950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
+  ac_cpp_err=yes
 fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
 fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
 fi
-  CPP="$ac_cv_prog_CPP"
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
 else
-  ac_cv_prog_CPP="$CPP"
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-echo "$ac_t""$CPP" 1>&6
+rm -f conftest.err conftest.$ac_ext
 
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:975: 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
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 980 "configure"
-#include "confdefs.h"
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_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
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1005 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <string.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
+  $EGREP "memchr" >/dev/null 2>&1; then
   :
 else
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
 rm -f conftest*
@@ -1018,16 +2848,19 @@
 
 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 1023 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
+  $EGREP "free" >/dev/null 2>&1; then
   :
 else
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
 rm -f conftest*
@@ -1036,362 +2869,750 @@
 
 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
+  if test "$cross_compiling" = yes; then
   :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1044 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:1055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
 fi
-rm -fr conftest*
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 fi
 fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
 #define STDC_HEADERS 1
-EOF
+_ACEOF
 
 fi
 
-for ac_hdr in fcntl.h sys/ioctl.h sys/time.h unistd.h
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1082: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1087 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-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"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 fi
-rm -f conftest*
+
+done
+
+
+
+
+
+
+for ac_header in fcntl.h sys/ioctl.h sys/time.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
 fi
-if 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___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1120: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1125 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this.  */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this.  */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
-   It does not let you subtract one const X* pointer from another in an arm
-   of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this.  */
-  char *t;
-  char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-  *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-  int x[] = {25, 17};
-  const int *foo = &x[0];
-  ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-  typedef const int *iptr;
-  iptr p = 0;
-  ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
-     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-  struct s { int j; const int *ap[3]; };
-  struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-  const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_c_const=yes
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_const=no
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
 fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-echo "$ac_t""$ac_cv_c_const" 1>&6
+fi
+
+done
+
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+  }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_const=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
-  cat >> confdefs.h <<\EOF
-#define const 
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
 
 fi
 
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1195: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 1202 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:1209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
 
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+
+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
-EOF
- ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
 esac
 
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1235: 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
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1240 "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 "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+  return 0;
+if (sizeof (pid_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_pid_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_pid_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
-  cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
 #define pid_t int
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1268: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1273 "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 "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+  return 0;
+if (sizeof (size_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_size_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_size_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
-  cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
 #define size_t unsigned
-EOF
+_ACEOF
 
 fi
 
 
-if test $ac_cv_prog_gcc = yes; then
-    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1303: checking whether ${CC-cc} needs -traditional" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test $ac_cv_c_compiler_gnu = yes; then
+    echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
     ac_pattern="Autoconf.*'x'"
-  cat > conftest.$ac_ext <<EOF
-#line 1309 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sgtty.h>
 Autoconf TIOCGETP
-EOF
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "$ac_pattern" >/dev/null 2>&1; then
-  rm -rf conftest*
+  $EGREP "$ac_pattern" >/dev/null 2>&1; then
   ac_cv_prog_gcc_traditional=yes
 else
-  rm -rf conftest*
   ac_cv_prog_gcc_traditional=no
 fi
 rm -f conftest*
 
 
   if test $ac_cv_prog_gcc_traditional = no; then
-    cat > conftest.$ac_ext <<EOF
-#line 1327 "configure"
-#include "confdefs.h"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <termio.h>
 Autoconf TCGETA
-EOF
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "$ac_pattern" >/dev/null 2>&1; then
-  rm -rf conftest*
+  $EGREP "$ac_pattern" >/dev/null 2>&1; then
   ac_cv_prog_gcc_traditional=yes
 fi
 rm -f conftest*
 
   fi
 fi
-
-echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
-echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:1349: 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 "$as_me:$LINENO: checking for working memcmp" >&5
+echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
+if test "${ac_cv_func_memcmp_working+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
-  ac_cv_func_memcmp_clean=no
+  ac_cv_func_memcmp_working=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1357 "configure"
-#include "confdefs.h"
-
-main()
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
 {
+
+  /* Some versions of memcmp are not 8-bit clean.  */
   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
-  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
-}
+  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+    exit (1);
 
-EOF
-if { (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_func_memcmp_clean=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_memcmp_clean=no
-fi
-rm -fr conftest*
-fi
+  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+     or more and with at least one buffer not starting on a 4-byte boundary.
+     William Lewis provided this test program.   */
+  {
+    char foo[21];
+    char bar[21];
+    int i;
+    for (i = 0; i < 4; i++)
+      {
+	char *a = foo + i;
+	char *b = bar + i;
+	strcpy (a, "--------01111111");
+	strcpy (b, "--------10000000");
+	if (memcmp (a, b, 16) >= 0)
+	  exit (1);
+      }
+    exit (0);
+  }
 
-fi
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_memcmp_working=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
+test $ac_cv_func_memcmp_working = no && case $LIBOBJS in
+    "memcmp.$ac_objext"   | \
+  *" memcmp.$ac_objext"   | \
+    "memcmp.$ac_objext "* | \
+  *" memcmp.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;;
+esac
 
-echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1385: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1390 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <signal.h>
 #ifdef signal
-#undef signal
+# undef signal
 #endif
 #ifdef __cplusplus
 extern "C" void (*signal (int, void (*)(int)))(int);
@@ -1399,451 +3620,1286 @@
 void (*signal ()) ();
 #endif
 
-int main() {
+int
+main ()
+{
 int i;
-; return 0; }
-EOF
-if { (eval echo configure:1407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_signal=void
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_type_signal=int
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
 #define RETSIGTYPE $ac_cv_type_signal
-EOF
+_ACEOF
 
 
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:1426: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1431 "configure"
-#include "confdefs.h"
+
+for ac_func in vprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char vprintf(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char vprintf();
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-int main() {
+#undef $ac_func
 
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_vprintf) || defined (__stub___vprintf)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-vprintf();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+echo "$as_me:$LINENO: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
+if test "${ac_cv_func__doprnt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define _doprnt innocuous__doprnt
 
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _doprnt (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-else
-  echo "$ac_t""no" 1>&6
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef _doprnt
 
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:1478: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1483 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt(); below.  */
-#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char _doprnt();
-
-int main() {
-
+   builtin and then its argument prototype would still apply.  */
+char _doprnt ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub__doprnt) || defined (__stub____doprnt)
 choke me
 #else
-_doprnt();
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:1506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != _doprnt;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func__doprnt=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func__doprnt=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+if test $ac_cv_func__doprnt = yes; then
 
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_DOPRNT 1
-EOF
+_ACEOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
+done
+
+
+
 
 for ac_func in strdup strerror
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1533: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1538 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* 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();
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-int main() {
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 
-trap '' 1 2 15
-cat > confcache <<\EOF
+                                                                                                                                            ac_config_files="$ac_config_files Makefile tools/Makefile unicon/Makefile unicon/unicon/Makefile unicon/server/Makefile unicon/client/Makefile unicon/ImmModules/cce/Makefile unicon/ImmModules/cce/inputs/Makefile unicon/ImmModules/cxterm/Makefile unicon/ImmModules/cxterm/utils/Makefile unicon/ImmModules/cxterm/dict/Makefile unicon/ImmModules/kscm/Makefile unicon/ImmModules/turbo/Makefile unimap/Makefile"
+cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
 #
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
 #
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
 # So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 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
-  :
-else
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
   if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
   else
     echo "not updating unwritable cache $cache_file"
   fi
 fi
 rm -f confcache
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
 fi
 
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
 # Transform confdefs.h into DEFS.
 # 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%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
 
+LTLIBOBJS=$ac_ltlibobjs
 
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
 
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
 # Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
 # Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
 
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
 do
-  case "\$ac_option" in
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    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.13"
-    exit 0 ;;
-  -help | --help | --hel | --he | --h)
-    echo "\$ac_cs_usage"; exit 0 ;;
-  *) echo "\$ac_cs_usage"; exit 1 ;;
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
   esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
 done
+;;
+  esac
 
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
 
-trap 'rm -fr `echo "unimap/Makefile sfonts/Makefile sfonts/tools/Makefile sfonts/genfont/Makefile unicon/unicon/Makefile unicon/client/Makefile unicon/Makefile unicon/server/Makefile unicon/ImmModules/cce/Makefile unicon/ImmModules/cce/inputs/Makefile unicon/ImmModules/cxterm/Makefile unicon/ImmModules/cxterm/utils/Makefile unicon/ImmModules/cxterm/dict/Makefile unicon/ImmModules/turbo/Makefile unikey/Makefile tools/Makefile fonts/Makefile fonts/gb/Makefile fonts/big5/Makefile fonts/gbk/Makefile fonts/jis/Makefile fonts/kscm/Makefile tools/Makefile Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-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%@AWK@%$AWK%g
-s%@CC@%$CC%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CPP@%$CPP%g
-s%@LIBOBJS@%$LIBOBJS%g
 
-CEOF
-EOF
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
 
-cat >> $CONFIG_STATUS <<\EOF
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
 
-# 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
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
   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`
+    as_ln_s='ln -s'
   fi
-done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
 fi
-EOF
+rm -f conf$$ conf$$.exe conf$$.file
 
-cat >> $CONFIG_STATUS <<EOF
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
 
-CONFIG_FILES=\${CONFIG_FILES-"unimap/Makefile sfonts/Makefile sfonts/tools/Makefile sfonts/genfont/Makefile Makefile unicon/unicon/Makefile unicon/client/Makefile unicon/Makefile unicon/server/Makefile unicon/ImmModules/cce/Makefile unicon/ImmModules/cce/inputs/Makefile unicon/ImmModules/cxterm/Makefile unicon/ImmModules/cxterm/utils/Makefile unicon/ImmModules/cxterm/dict/Makefile unicon/ImmModules/turbo/Makefile tools/Makefile unikey/Makefile fonts/Makefile fonts/gb/Makefile fonts/gbk/Makefile fonts/big5/Makefile fonts/jis/Makefile fonts/kscm/Makefile"}
-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".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.58.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.58,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
   esac
 
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
 
-  # 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%^\./%%'`"
-    # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
-  else
-    ac_dir_suffix= ac_dots=
-  fi
-
-  case "$ac_given_srcdir" in
-  .)  srcdir=.
-      if test -z "$ac_dots"; then top_srcdir=.
-      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
-  *) # Relative path.
-    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
-    top_srcdir="$ac_dots$ac_given_srcdir" ;;
   esac
+  shift
+done
 
-  case "$ac_given_INSTALL" in
-  [/$]*) INSTALL="$ac_given_INSTALL" ;;
-  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
+  "unicon/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/Makefile" ;;
+  "unicon/unicon/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/unicon/Makefile" ;;
+  "unicon/server/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/server/Makefile" ;;
+  "unicon/client/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/client/Makefile" ;;
+  "unicon/ImmModules/cce/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/cce/Makefile" ;;
+  "unicon/ImmModules/cce/inputs/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/cce/inputs/Makefile" ;;
+  "unicon/ImmModules/cxterm/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/cxterm/Makefile" ;;
+  "unicon/ImmModules/cxterm/utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/cxterm/utils/Makefile" ;;
+  "unicon/ImmModules/cxterm/dict/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/cxterm/dict/Makefile" ;;
+  "unicon/ImmModules/kscm/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/kscm/Makefile" ;;
+  "unicon/ImmModules/turbo/Makefile" ) CONFIG_FILES="$CONFIG_FILES unicon/ImmModules/turbo/Makefile" ;;
+  "unimap/Makefile" ) CONFIG_FILES="$CONFIG_FILES unimap/Makefile" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
   esac
+done
 
-  echo creating "$ac_file"
-  rm -f "$ac_file"
-  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
-  case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
-  *) ac_comsub= ;;
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@AWK@,$AWK,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@HAVE_PTH@,$HAVE_PTH,;t t
+s,@HAVE_NEWT@,$HAVE_NEWT,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   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
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
 
-EOF
-cat >> $CONFIG_STATUS <<EOF
+done
+_ACEOF
 
-EOF
-cat >> $CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 
-exit 0
-EOF
+{ (exit 0); exit 0; }
+_ACEOF
 chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
 
diff -urN unicon-3.0.4-20010924.orig/configure.in unicon-3.0.4-20010924-userland-vdc/configure.in
--- unicon-3.0.4-20010924.orig/configure.in	2001-09-04 23:31:49.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/configure.in	2003-11-22 11:01:30.000000000 +0900
@@ -1,9 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(unicon/include/ImmClient.h)
-AC_INIT(unicon/include/ImmComm.h)  
-AC_INIT(unicon/include/ImmDefs.h)
-AC_INIT(unicon/include/ImmModule.h)  
-AC_INIT(unicon/include/Phrase.h)
+AC_INIT([unicon/include/ImmClient.h])
 
 dnl Checks for programs.
 AC_PROG_AWK
@@ -12,6 +8,10 @@
 AC_PROG_MAKE_SET
 
 dnl Checks for libraries.
+AC_CHECK_LIB(pth, pth_init, HAVE_PTH="yes")
+AC_SUBST(HAVE_PTH)
+AC_CHECK_LIB(newt, newtInit, HAVE_NEWT="yes")
+AC_SUBST(HAVE_NEWT)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -30,17 +30,7 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(strdup strerror)
 
-AC_OUTPUT(fonts/Makefile                         \
-          fonts/gb/Makefile                      \
-          fonts/gbk/Makefile                     \
-          fonts/jis/Makefile                     \
-          fonts/kscm/Makefile                    \
-          fonts/big5/Makefile                    \
-          fonts/bdf/Makefile                     \
-          sfonts/Makefile                        \
-          sfonts/tools/Makefile                  \
-          sfonts/genfont/Makefile                \
-          scripts/Makefile                       \
+AC_OUTPUT(Makefile				\
           tools/Makefile                         \
           unicon/Makefile                        \
           unicon/unicon/Makefile                 \
@@ -51,6 +41,6 @@
           unicon/ImmModules/cxterm/Makefile  	 \
           unicon/ImmModules/cxterm/utils/Makefile  \
           unicon/ImmModules/cxterm/dict/Makefile  \
+          unicon/ImmModules/kscm/Makefile	\
           unicon/ImmModules/turbo/Makefile	\
-	  unikey/Makefile                        \
           unimap/Makefile) 
diff -urN unicon-3.0.4-20010924.orig/include/xl_key.h unicon-3.0.4-20010924-userland-vdc/include/xl_key.h
--- unicon-3.0.4-20010924.orig/include/xl_key.h	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/include/xl_key.h	2003-11-22 11:04:05.000000000 +0900
@@ -96,6 +96,7 @@
 #define KEY_END         247
 #define KEY_PGU         248
 #define KEY_PGD         249
+#define CTRL_F3		250
 
 void SetupKeymap(void);
 void RestoreKeymap(void);
diff -urN unicon-3.0.4-20010924.orig/scripts/Makefile unicon-3.0.4-20010924-userland-vdc/scripts/Makefile
--- unicon-3.0.4-20010924.orig/scripts/Makefile	2001-09-04 23:32:57.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/scripts/Makefile	2003-11-22 10:55:14.000000000 +0900
@@ -1,10 +1,10 @@
-prefix=/usr
+prefix=/usr/local
 all:
 install:
 	if [ ! -d $(prefix)/bin ] ; then mkdir -p $(prefix)/bin; fi
 	echo Installing unicon startup script into system directory...
-	install -m 755 -o root -g root unicon-start $(prefix)/bin/unicon-start
-	install -m 755 -o root -g root unicon-init /etc/rc.d/init.d/unicon
+	install -m 755 unicon-start $(prefix)/bin/unicon-start
+	install -m 755 unicon-init /etc/rc.d/init.d/unicon
 	chkconfig --add unicon
 	chkconfig unicon on
 clean:
diff -urN unicon-3.0.4-20010924.orig/scripts/Makefile.in unicon-3.0.4-20010924-userland-vdc/scripts/Makefile.in
--- unicon-3.0.4-20010924.orig/scripts/Makefile.in	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/scripts/Makefile.in	2003-11-22 10:45:24.000000000 +0900
@@ -3,8 +3,8 @@
 install:
 	if [ ! -d $(prefix)/bin ] ; then mkdir -p $(prefix)/bin; fi
 	echo Installing unicon startup script into system directory...
-	install -m 755 -o root -g root unicon-start $(prefix)/bin/unicon-start
-	install -m 755 -o root -g root unicon-init /etc/rc.d/init.d/unicon
+	install -m 755 unicon-start $(prefix)/bin/unicon-start
+	install -m 755 unicon-init /etc/rc.d/init.d/unicon
 	chkconfig --add unicon
 	chkconfig unicon on
 clean:
diff -urN unicon-3.0.4-20010924.orig/scripts/install.sh unicon-3.0.4-20010924-userland-vdc/scripts/install.sh
--- unicon-3.0.4-20010924.orig/scripts/install.sh	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/scripts/install.sh	2003-11-22 10:45:24.000000000 +0900
@@ -1,6 +1,6 @@
 #!/bin/bash
 echo Installing unicon startup script into system directory...
-install -m 755 -o root -g root unicon-start /usr/bin/unicon-start
-install -m 755 -o root -g root unicon-init /etc/rc.d/init.d/unicon
-chkconfig --add unicon
-chkconfig unicon on
+install -m 755 unicon-start /usr/bin/unicon-start
+install -m 755 unicon-init /etc/rc.d/init.d/unicon
+#chkconfig --add unicon
+#chkconfig unicon on
diff -urN unicon-3.0.4-20010924.orig/scripts/unicon-start unicon-3.0.4-20010924-userland-vdc/scripts/unicon-start
--- unicon-3.0.4-20010924.orig/scripts/unicon-start	2001-09-21 02:01:52.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/scripts/unicon-start	2003-11-22 10:40:02.000000000 +0900
@@ -50,7 +50,7 @@
   modinstall vga16fb
 fi
 modinstall unikey
-loadunimap /usr/lib/unicon/direct.uni
+consolechars --screen-font-map=/usr/lib/unicon/direct.uni
 
 case $UNICONLANG in
 	zh_CN.GB18030|GB18030)
diff -urN unicon-3.0.4-20010924.orig/sfonts/tools/Makefile.in unicon-3.0.4-20010924-userland-vdc/sfonts/tools/Makefile.in
--- unicon-3.0.4-20010924.orig/sfonts/tools/Makefile.in	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/sfonts/tools/Makefile.in	2003-11-22 10:45:03.000000000 +0900
@@ -5,7 +5,7 @@
 OBJS = main.o sfont.o filter.o encode-gb.o encode-gbk.o \
        encode-big5.o encode-jis.o encode-kscm.o
 FONT_PATH=../../fonts
-CC=gcc -g $(CFLAGS) -I. -I../../include 
+CC=g++ -g $(CFLAGS) -I. -I../../include 
 
 all: $(PROG)
 
diff -urN unicon-3.0.4-20010924.orig/sfonts/tools/main.cpp unicon-3.0.4-20010924-userland-vdc/sfonts/tools/main.cpp
--- unicon-3.0.4-20010924.orig/sfonts/tools/main.cpp	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/sfonts/tools/main.cpp	2003-11-22 10:45:09.000000000 +0900
@@ -25,6 +25,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <assert.h>
 #include <mytype.h>
 #include <filter.hpp>
diff -urN unicon-3.0.4-20010924.orig/tools/Makefile.in unicon-3.0.4-20010924-userland-vdc/tools/Makefile.in
--- unicon-3.0.4-20010924.orig/tools/Makefile.in	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/tools/Makefile.in	2003-11-22 10:46:17.000000000 +0900
@@ -2,24 +2,33 @@
 LIBDIR=$(prefix)/lib/unicon
 CFLAGS = @CFLAGS@
 CFLAGS += -I. -I../include
-PROG = uniconcfg uniconctrl
+PROG = uniconcfg uniconctrl unireset
+HAVE_NEWT = @HAVE_NEWT@
 
 CC=gcc $(CFLAGS)
 
 all: $(PROG)
-uniconcfg: 
-	$(CC) -lnewt uniconcfg.c -o uniconcfg
-uniconctrl:
+uniconcfg: uniconcfg.c
+	if test "x${HAVE_NEWT}" = "xyes" ; then \
+		$(CC) -lnewt uniconcfg.c -o uniconcfg; \
+	fi
+uniconctrl: uniconctrl.c
 	$(CC) uniconctrl.c -o uniconctrl
+unireset: unireset.c
+	$(CC) unireset.c -o unireset
 clean:
 	rm -f a.out *.bak *.o core *~ $(PROG)
 
 install: all
 	mkdir -p $(prefix)/bin $(LIBDIR)/bin
-	install -o root -g root -m755 uniconcfg $(LIBDIR)/bin/uniconcfg
+	if test "x${HAVE_NEWT}" = "xyes" ; then \
+		install -o root -g root -m755 uniconcfg $(LIBDIR)/bin/uniconcfg; \
+		ln -sf $(prefix)/lib/unicon/bin/uniconcfg $(prefix)/bin/uniconcfg; \
+	fi
 	install -o root -g root -m755 uniconctrl $(LIBDIR)/bin/uniconctrl
-	ln -sf $(prefix)/lib/unicon/bin/uniconctrl /usr/bin/uniconctrl
-	ln -sf $(prefix)/lib/unicon/bin/uniconcfg /usr/bin/uniconcfg
+	install -o root -g root -m755 unireset $(LIBDIR)/bin/unireset
+	ln -sf $(prefix)/lib/unicon/bin/uniconctrl $(prefix)/bin/uniconctrl
+	ln -sf $(prefix)/lib/unicon/bin/unireset $(prefix)/bin/unireset
 
 distclean: clean
 	rm -f Makefile tags TAGS
diff -urN unicon-3.0.4-20010924.orig/tools/uniconcfg.c unicon-3.0.4-20010924-userland-vdc/tools/uniconcfg.c
--- unicon-3.0.4-20010924.orig/tools/uniconcfg.c	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/tools/uniconcfg.c	2003-11-22 10:40:38.000000000 +0900
@@ -37,19 +37,19 @@
 #include <sys/time.h>
 #include <errno.h>
 #include <signal.h>
-#if (__GNU_LIBRARY__ >= 6)
+/*#if (__GNU_LIBRARY__ >= 6)
 #include <sys/perm.h>
 #else
 #include <linux/types.h>
 #include <linux/termios.h>
-#endif
+#endif */
 #include <linux/vt.h>
 #include <termios.h>
 #include <locale.h>
 
 #include "unikey.h"
 
-#define  MAX_LANG         5
+#define  MAX_LANG         7
 #define NEWT_KEY_ESC '\033'
 
 /* font_type */
@@ -58,6 +58,8 @@
 #define XL_DB_JIS      2
 #define XL_DB_KSCM     3
 #define XL_DB_GBK      4
+#define XL_DB_EUCJP    5
+#define XL_DB_SJIS     6
 
 typedef struct menuAction_T
 {
@@ -73,6 +75,8 @@
     "JIS",
     "KSCM",
     "GBK",
+    "EUCJP",
+    "SJIS",
 };
 
 #define OK                1
@@ -152,6 +156,12 @@
         case XL_DB_GBK:
             setlocale (LC_ALL, "zh_CN.GBK");
             break;
+        case XL_DB_EUCJP:
+            setlocale (LC_ALL, "ja_JP.eucJP");
+            break;
+        case XL_DB_SJIS:
+            setlocale (LC_ALL, "ja_JP.SJIS");
+            break;
     }
 }
 
@@ -202,6 +212,8 @@
         case XL_DB_JIS:
         case XL_DB_KSCM:
         case XL_DB_GBK:
+        case XL_DB_EUCJP:
+        case XL_DB_SJIS:
     }
     return 1;
 }
@@ -254,7 +266,7 @@
 
 void Usages (char *name)
 {
-    printf ("%s [--gb | --big5 | --gbk | --kscm | --jis \n", name);
+    printf ("%s [--gb | --big5 | --gbk | --kscm | --jis | --eucjp | --sjis \n", name);
     printf ("   [--notify_input_method]] \n");
     printf ("   [--tty 1-6] \n");
     exit (0);
@@ -299,6 +311,10 @@
             coding_int = XL_DB_JIS;
         else if (strcmp (argv[i], "--kscm") == 0)
             coding_int = XL_DB_KSCM;
+        else if (strcmp (argv[i], "--eucjp") == 0)
+            coding_int = XL_DB_EUCJP;
+        else if (strcmp (argv[i], "--sjis") == 0)
+            coding_int = XL_DB_SJIS;
         else if (strcmp (argv[i], "--notify_input_method") == 0)
             inputmethod_notify = 1;
         else if (strcmp (argv[i], "--tty") == 0)
diff -urN unicon-3.0.4-20010924.orig/tools/uniconctrl.c unicon-3.0.4-20010924-userland-vdc/tools/uniconctrl.c
--- unicon-3.0.4-20010924.orig/tools/uniconctrl.c	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/tools/uniconctrl.c	2003-11-22 10:40:38.000000000 +0900
@@ -21,6 +21,8 @@
 #define XL_DB_JIS      2
 #define XL_DB_KSCM     3
 #define XL_DB_GBK      4
+#define XL_DB_EUCJP    5
+#define XL_DB_SJIS     6
 #define UNIKEY_DEV	"/dev/unikey"
 
 int SetUniconFont(int ttyNo, int FontType)
@@ -41,7 +43,7 @@
 #if MAIN
 void PrintUseage(char *arg)
 {
-	fprintf(stderr, "Useage: %s <--gb or --gbk --big5 --jis --kscm> [ttyX]\n",
+	fprintf(stderr, "Useage: %s <--gb or --gbk --big5 --jis --kscm --eucjp --sjis> [ttyX]\n",
 		arg);
 }
 
@@ -64,6 +66,10 @@
 		font_type = XL_DB_JIS;
 	else if (strcmp (argv[1], "--kscm") == 0)
 		font_type = XL_DB_KSCM;
+	else if (strcmp (argv[1], "--eucjp") == 0)
+		font_type = XL_DB_EUCJP;
+	else if (strcmp (argv[1], "--sjis") == 0)
+		font_type = XL_DB_SJIS;
 	else {
 		PrintUseage(argv[0]);
 		exit(-2);
diff -urN unicon-3.0.4-20010924.orig/tools/unireset.c unicon-3.0.4-20010924-userland-vdc/tools/unireset.c
--- unicon-3.0.4-20010924.orig/tools/unireset.c	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/tools/unireset.c	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,54 @@
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <linux/vt.h>
+#include <termios.h>
+
+#define MAJOR_NUM 100
+#define UNI_INPUT_SET_UNRESIZE_FLAG _IOR(MAJOR_NUM, 10, char *)
+
+int main(int argc, char** argv) {
+    int size = 48;
+    int ret_val;
+    int fd = open("/dev/unikey", 0);
+
+    int tty;
+    struct vt_sizes vtsizes;
+    struct winsize winsize;
+    char dev[12];
+
+    if(argc != 1) size = atoi(argv[1]);
+
+    tty = 1;
+    sprintf(dev, "/dev/tty%d", tty);
+    fd = open(dev, O_RDWR);
+
+    if(ioctl(fd, TIOCGWINSZ, &winsize)) {
+        perror("TIOCGWINSZ");
+        exit(1);
+    }
+
+    vtsizes.v_rows = size;//winsize.ws_row
+    vtsizes.v_cols = winsize.ws_col;
+    vtsizes.v_scrollsize = 0;
+
+    if(ioctl(fd, VT_RESIZE, &vtsizes)) {
+        perror("VT_RESIZE");
+        exit(1);
+    }
+    close (fd);
+
+    ret_val = ioctl(fd, UNI_INPUT_SET_UNRESIZE_FLAG, (char *) NULL);
+
+    return 0;
+}
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/cce/inputs/Makefile.in unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/cce/inputs/Makefile.in
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/cce/inputs/Makefile.in	2001-09-11 16:12:10.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/cce/inputs/Makefile.in	2003-11-22 10:45:24.000000000 +0900
@@ -78,11 +78,11 @@
 install: all
 	mkdir -p $(LIBDIR)/bin
 	mkdir -p $(LIBDIR)/modules/cce/dict
-	$(INSTALL) -o root -g $(GROUP) -m 755 -d $(LIBDIR)
-	$(INSTALL) -s -o root -g $(GROUP) -m 755 $(EXECPROGS) $(LIBDIR)/bin
-	$(INSTALL) -o root -g $(GROUP) -m 644 *.tab* $(LIBDIR)/modules/cce/dict
-	$(INSTALL) -o root -g $(GROUP) -m 644 pinyin.map $(LIBDIR)/modules/cce/dict
-	$(INSTALL) -o root -g $(GROUP) -m 644 *.def $(LIBDIR)/modules/cce/dict
+	$(INSTALL) -m 755 -d $(LIBDIR)
+	$(INSTALL) -s -m 755 $(EXECPROGS) $(LIBDIR)/bin
+	$(INSTALL) -m 644 *.tab* $(LIBDIR)/modules/cce/dict
+	$(INSTALL) -m 644 pinyin.map $(LIBDIR)/modules/cce/dict
+	$(INSTALL) -m 644 *.def $(LIBDIR)/modules/cce/dict
 
 ifeq (.depend, $(wildcard .depend))
 include .depend
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/cxterm/dict/Makefile.in unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/cxterm/dict/Makefile.in
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/cxterm/dict/Makefile.in	2001-08-08 23:32:35.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/cxterm/dict/Makefile.in	2003-11-22 10:45:24.000000000 +0900
@@ -26,7 +26,7 @@
 	do \
 		echo "installing" "in $$i..."; \
 		mkdir -p $(dictdir)/$$i; \
-	 	install -o root -g root -m644 $$i/*.cit $(dictdir)/$$i/; \
+	 	install -m644 $$i/*.cit $(dictdir)/$$i/; \
 	done
 
 
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/cxterm/utils/Makefile.in unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/cxterm/utils/Makefile.in
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/cxterm/utils/Makefile.in	2001-08-08 23:32:35.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/cxterm/utils/Makefile.in	2003-11-22 10:45:24.000000000 +0900
@@ -28,9 +28,9 @@
 
 install: all
 	mkdir -p $(LIBDIR)/bin
-	$(INSTALL) -o root -g $(GROUP) -m 755 -d $(LIBDIR)/bin
-	$(INSTALL) -s -o root -g $(GROUP) -m 755 tit2cit $(LIBDIR)/bin
-	$(INSTALL) -s -o root -g $(GROUP) -m 755 cit2tit $(LIBDIR)/bin
+	$(INSTALL) -m 755 -d $(LIBDIR)/bin
+	$(INSTALL) -s -m 755 tit2cit $(LIBDIR)/bin
+	$(INSTALL) -s -m 755 cit2tit $(LIBDIR)/bin
 
 
 
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/Makefile.in unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/Makefile.in
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/Makefile.in	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/Makefile.in	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,28 @@
+prefix=@prefix@
+CFLAGS = @CFLAGS@
+
+CC = gcc
+CFLAGS += -I.
+PROG = hinput.so
+OBJS = hinput.o automata.o comp.o johabcode2.o hanja.o
+SRCS = $(OBJS:%.o=%.c)
+
+CFLAGS = -g -Wall -I../../include -I.
+
+all: hinput.so
+
+hinput.so : $(OBJS)
+	$(CC) $(CFLAGS) -shared -o hinput.so $(OBJS)
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+install:
+	mkdir -p $(prefix)/lib/unicon/modules/kscm
+	cp *.so $(prefix)/lib/unicon/modules/kscm
+	cp -r keyboard $(prefix)/lib/unicon/modules/kscm
+clean:
+	rm -f *.o core a.out *.bak test *.so
+
+distclean: clean
+	rm -f Makefile
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/automata.c unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/automata.c
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/automata.c	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/automata.c	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,257 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "comp.h"
+#include "automata.h"
+
+#define has_temp_han() (han_compose_buf[0] != 0)
+
+int han_kbd = 2;
+int han_code;
+int han_esc_toggle;
+char* han_dubul_keyboard_file = "dubulsik";
+char* han_sebul_keyboard_file = "sebulsik_final";
+
+Char han_compose_buf[8] = {0};
+int hangul_state = 1;
+
+int han_new_typed_row = -999;
+
+static Composer *composer = NULL;
+
+static void han_cursor_color_update(void);
+
+void get_ime_status(char* buf) {
+    buf[0] = han_compose_buf[0];
+    buf[1] = han_compose_buf[1];
+}
+
+void set_keyboard_file(int keyboard, char* filename) {
+    if(keyboard == 2) han_dubul_keyboard_file = filename;
+    else if(keyboard == 3) han_sebul_keyboard_file = filename;
+    hangul_set_keyboard(keyboard);
+}
+
+void toggle_keyboard_layout(void) {
+    hangul_set_keyboard(han_kbd == 2 ? 3 : 2);
+}
+
+static int
+fill_return_buffer_c(char *buf, char c)
+{
+    if (has_temp_han()) {
+	*buf++ = han_compose_buf[0];
+	*buf++ = han_compose_buf[1];
+	*buf = c;
+	han_compose_buf[0] = 0;
+	return 3;
+    }
+    *buf = c;
+    return 1;
+}
+
+static int
+fill_return_buffer_s(char *buf, char *s)
+{
+    int len;
+    if (!s) {
+	if (has_temp_han()) {
+	    strcpy(buf, han_compose_buf);
+	    return 2;
+	}
+	return 0;
+    }
+    len = strlen(s);
+    if (has_temp_han()) {
+	*buf++ = han_compose_buf[0];
+	*buf++ = han_compose_buf[1];
+	strcpy(buf, s);
+	han_compose_buf[0] = 0;
+	return len + 2;
+    }
+    strcpy(buf, s);
+    return len;
+}
+
+int 
+hangul_automata_flush(Char *buf)
+{
+    composer_reset(composer);
+    if (has_temp_han()) {
+	buf[0] = han_compose_buf[0];
+	buf[1] = han_compose_buf[1];
+	han_compose_buf[0] = 0;
+	//ShowCursor();
+	return 2;
+    }
+    return 0;
+}
+
+static void
+han_cursor_color_update(void)
+{
+/*
+    TScreen *screen = &term->screen;
+    if (hangul_state) {
+	screen->cursorcolor = screen->han_cursorcolor;
+    } else {
+	screen->cursorcolor = screen->eng_cursorcolor;
+    }
+    set_cursor_gcs(screen);
+    ShowCursor();
+*/
+}
+
+int
+hangul_automata_toggle(Char *buf)
+{
+
+    hangul_state = !hangul_state;
+    composer_reset(composer);
+    //han_show_status(&term->screen, 0, 0);
+    han_cursor_color_update();
+    return hangul_automata_flush(buf);
+}
+
+void
+hangul_set_keyboard(int keyboard)
+{
+    if (keyboard == 2) {
+	composer_set_keymap(han_dubul_keyboard_file);
+    } else {
+	composer_set_keymap(han_sebul_keyboard_file);
+    }
+}
+
+void
+hangul_set_code(int code)
+{
+    if (!composer) {
+	hangul_automata_init();
+    }
+    if (code == C_WANSUNG) {
+	composer_set_output_encoding(composer, "WANSUNG");
+    } else if (code == C_JOHAB) {
+	composer_set_output_encoding(composer, "JOHAB");
+    }
+}
+
+
+void 
+hangul_automata_clear(void)
+{
+    composer_reset(composer);
+    han_compose_buf[0] = 0;
+}
+
+void
+hangul_automata_init(void)
+{
+    int i, n;
+    char **kbd_names;
+    char *dubul = han_dubul_keyboard_file;
+    char *sebul = han_sebul_keyboard_file;
+    kbd_names = composer_get_keyboard_list(KEYBOARD_DIR, &n);
+    for(i = 0; i < n; i++) {
+	if (strcmp(kbd_names[i], dubul) == 0) break;
+    }
+    if (i == n) {
+	fprintf(stderr, "µÎ¹ú½Ä ÀÚÆÇ ÆÄÀÏ(%s)À» Ã£À» ¼ö ¾ø½À´Ï´Ù\n", dubul);
+	exit(1);
+    }
+    for(i = 0; i < n; i++) {
+	if (strcmp(kbd_names[i], sebul) == 0) break;
+    }
+    if (i == n) {
+	fprintf(stderr, "¼¼¹ú½Ä ÀÚÆÇ ÆÄÀÏ(%s)À» Ã£À» ¼ö ¾ø½À´Ï´Ù\n", sebul);
+	exit(1);
+    }
+    hangul_set_keyboard(han_kbd);
+    composer = composer_new();
+    hangul_set_code(han_code);
+}
+
+int 
+hangul_automata(int c, Char *buf)
+{
+    int ret = 0;
+    int process_ret;
+    if (!composer) {
+	hangul_automata_init();
+    }
+    if (c == -2) return hangul_automata_flush(buf);
+    if (c == -1) return hangul_automata_toggle(buf);
+
+    assert (c >= 0);
+
+    if (!hangul_state) {
+	buf[0] = c;
+	return 1;
+    }
+    switch ((process_ret = composer_process(composer, c))) {
+	case COMPOSER_NEW:
+	    ret = fill_return_buffer_s(buf, NULL);
+	    strcpy(han_compose_buf, composer_get_buffer(composer));
+	    break;
+	case COMPOSER_RAW:
+	    ret = fill_return_buffer_c(buf, c);
+	    han_compose_buf[0] = 0;
+	    if (c == 27 && han_esc_toggle) {
+		hangul_state = 0;
+		//han_show_status(&term->screen, 0, 0);
+		han_cursor_color_update();
+	    }
+	    break;
+	case COMPOSER_NULL:
+	    han_compose_buf[0] = 0;
+	    break;
+	case COMPOSER_NOT_HAN:
+	    ret = fill_return_buffer_s(buf, composer_get_buffer(composer));
+	    han_compose_buf[0] = 0;
+	    break;
+	case COMPOSER_CORRECT:
+	    strcpy(han_compose_buf, composer_get_buffer(composer));
+	    ret = 0;
+	    break;
+	case COMPOSER_ERROR:
+	    return 0;
+	case COMPOSER_CORRECT_NEW:
+	    strcpy(buf, composer_get_buffer(composer));
+	    strcpy(han_compose_buf, composer_get_buffer(composer) + 2);
+	    ret = 2;
+	    break;
+    }
+    if (ret || process_ret == COMPOSER_NULL) {
+	int c = han_compose_buf[0];
+	han_compose_buf[0] = 0;
+	//ScrnRefresh(&term->screen, 
+	//    term->screen.cursor_row, term->screen.cursor_col,
+	//    1, 2, True);
+	han_compose_buf[0] = c;
+	//term->screen.cursor_state = OFF;
+    } else {
+	//ShowCursor();
+    }
+    //han_new_typed_row = term->screen.cursor_row;
+    return ret;
+}
+
+int main(int argc, char** argv) {
+    Char buf[20];
+    int i, ret;
+
+    for(i = 0; i < strlen(argv[1]); i++) {
+	ret = hangul_automata(argv[1][i], buf);
+	if(ret != 0) {
+	    buf[ret] = '\0';
+	    printf("%s(%d)\n", buf, ret);
+	}
+    }
+    hangul_automata(-2, buf);
+    buf[19] = '\0';
+    printf("%s(%d)\n", buf, ret);
+
+    return 0;
+}
+
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/automata.h unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/automata.h
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/automata.h	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/automata.h	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,18 @@
+#ifndef __AUTOMATA_H__
+#define __AUTOMATA_H__
+
+#define C_WANSUNG	0		/* Hangul Code  */
+#define C_JOHAB	1
+#define KEYBOARD_DIR "/usr/lib/unicon/modules/kscm/keyboard"
+
+typedef unsigned char Char;		/* to support 8 bit chars */
+
+void hangul_automata_init(void);
+int hangul_automata(int c, Char *buf);
+void hangul_set_keyboard(int keyboard);
+void hangul_automata_clear(void);
+void get_ime_status(char*);
+void set_keyboard_file(int keyboard, char* filename);
+void toggle_keyboard_layout(void);
+
+#endif // __AUTOMATA_H__
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/comp.c unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/comp.c
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/comp.c	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/comp.c	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,1074 @@
+/* This file is a part of Ami software, (C) Hwang chi-deok 2001 */
+
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <dirent.h>
+
+#include "comp.h"
+#include "johabcode.h"
+typedef unsigned int unit;
+typedef unsigned char bool;
+
+#define CHO_SHIFT 10
+#define JUNG_SHIFT 5
+#define JONG_SHIFT 0
+
+#define CHO_MASK	(0x3f << CHO_SHIFT)
+#define JUNG_MASK	(0x1f << JUNG_SHIFT)
+#define JONG_MASK 	(0x1f << JONG_SHIFT)
+
+#define CHO_JUNG_MASK	(CHO_MASK | JUNG_MASK)
+#define CHO_JONG_MASK	(CHO_MASK | JONG_MASK)
+#define JUNG_JONG_MASK	(JUNG_MASK | JONG_MASK)
+
+#define CHO_NULL	(0x01 << CHO_SHIFT)
+#define JUNG_NULL	(0x02 << JUNG_SHIFT)
+#define JONG_NULL	(0x01 << JONG_SHIFT)
+
+#define COMPOSER_KEYMAP_MAX 256
+
+typedef enum {
+    NOT_HAN, CHO, JUNG, JONG,
+    CHO_JONG
+} JamoType;
+
+typedef enum {
+    ENC_UTF8, ENC_WANSUNG, ENC_JOHAB
+} Encoding;
+
+typedef struct {
+    JamoType type;
+    int jung;
+    int cho;
+    int jong;
+    int not_han;
+} JamoInfo;
+
+struct _Keymap {
+    int ref;
+    JamoInfo **jamoinfo;
+    int *translation;
+};
+
+struct _Composer {
+    JamoInfo *jamo[6];
+    uint code[6];
+    int stack_index;
+    Keymap *keymap;
+    char return_buffer[8];
+    Encoding enc;
+    int error_level;
+};
+
+typedef struct {
+    char *name;
+    char *filename;
+} KeyboardFile;
+
+enum {
+    Kiyeog = 2,
+    SsangKiyeog = 3,
+    Nieun = 4,
+    Dikeud = 5,
+    SsangDikeud = 6,
+    Rieul = 7,
+    Mieum = 8,
+    Pieub = 9,
+    SsangPieub = 10,
+    Sios = 11,
+    SsangSios = 12,
+    Ieung = 13,
+    Jieuj = 14,
+    SsangJieuj = 15,
+    Cieuc = 16,
+    Khieuq = 17,
+    Theut = 18,
+    Phieuf = 19,
+    Hieuh = 20
+};
+enum {
+    A = 3,
+    AE = 4,
+    YA = 5,
+    YAE = 6,
+    EO = 7,
+    E = 10,
+    YEO = 11,
+    YE = 12,
+    O = 13,
+    WA = 14,
+    WAE = 15,
+    OE = 18,
+    YO = 19,
+    U = 20,
+    WEO = 21,
+    WE = 22,
+    WI = 23,
+    YU = 26,
+    EU = 27,
+    YI = 28,
+    I = 29
+};
+enum {
+    J_Kiyeog = 2,
+    J_SsangKiyeog = 3,
+    J_KiyeogSios = 4,
+    J_Nieun = 5,
+    J_NieunJieuj = 6,
+    J_NieunHieuh = 7,
+    J_Dikeud = 8,
+    J_Rieul = 9,
+    J_RieulKiyeog = 10,
+    J_RieulMieum = 11,
+    J_RieulPieub = 12,
+    J_RieulSios = 13,
+    J_RieulTieut = 14,
+    J_RieulPhieuf = 15,
+    J_RieulHieuh = 16,
+    J_Mieum = 17,
+    J_Pieub = 19,
+    J_PieubSios = 20, 
+    J_Sios = 21,
+    J_SsangSios = 22,
+    J_Ieung = 23,
+    J_Jieuj = 24,
+    J_Cieuc = 25,
+    J_Khieuq = 26,
+    J_Tieut = 27,
+    J_Phieuf = 28,
+    J_Hieuh = 29
+};
+
+static Keymap * keymap_load(char *keyboard);
+static void keymap_free(Keymap *keymap);
+static Keymap *def_keymap = 0;
+static KeyboardFile *kbd = 0;
+static int num_kbd = 0;
+static char *public_dir = 0, *private_dir = 0;
+
+
+static const char *
+cho_code[] = {
+    [Kiyeog] = "¤¡",
+    [SsangKiyeog] = "¤¢",
+    [Nieun] = "¤¤",
+    [Dikeud] = "¤§",
+    [SsangDikeud] = "¤¨",
+    [Rieul] = "¤©",
+    [Mieum] = "¤±",
+    [Pieub] = "¤²",
+    [SsangPieub] = "¤³",
+    [Sios] = "¤µ",
+    [SsangSios] = "¤¶",
+    [Ieung] = "¤·",
+    [Jieuj] = "¤¸",
+    [SsangJieuj] = "¤¹",
+    [Cieuc] = "¤º",
+    [Khieuq] = "¤»",
+    [Theut] = "¤¼",
+    [Phieuf] = "¤½",
+    [Hieuh] = "¤¾"
+};
+
+static const char *
+jung_code[] = {
+    [A] = "¤¿",
+    [AE] = "¤À",
+    [YA] = "¤Á",
+    [YAE] = "¤Â",
+    [EO] = "¤Ã",
+    [E] = "¤Ä",
+    [YEO] = "¤Å",
+    [YE] = "¤Æ",
+    [O] = "¤Ç",
+    [WA] = "¤È",
+    [WAE] = "¤É",
+    [OE] = "¤Ê",
+    [YO] = "¤Ë",
+    [U] = "¤Ì",
+    [WEO] = "¤Í",
+    [WE] = "¤Î",
+    [WI] = "¤Ï",
+    [YU] = "¤Ð",
+    [EU] = "¤Ñ",
+    [YI] = "¤Ò",
+    [I] = "¤Ó"
+};
+
+static const char *
+jong_code[] = {
+    [J_Kiyeog] = "¤¡",
+    [J_SsangKiyeog] = "¤¢",
+    [J_KiyeogSios] = "¤¡¤µ",
+    [J_Nieun] = "¤¤",
+    [J_NieunJieuj] = "¤¤¤¸",
+    [J_NieunHieuh] = "¤¤¤¾",
+    [J_Dikeud] = "¤§",
+    [J_Rieul] = "¤©",
+    [J_RieulKiyeog] = "¤©¤¡",
+    [J_RieulMieum] = "¤©¤±",
+    [J_RieulPieub] = "¤©¤²",
+    [J_RieulSios] = "¤©¤µ",
+    [J_RieulTieut] = "¤©¤¼",
+    [J_RieulPhieuf] = "¤©¤½",
+    [J_RieulHieuh] = "¤©¤¾",
+    [J_Mieum] = "¤±",
+    [J_Pieub] = "¤²",
+    [J_PieubSios] = "¤²¤µ", 
+    [J_Sios] = "¤µ",
+    [J_SsangSios] = "¤¶",
+    [J_Ieung] = "¤·",
+    [J_Jieuj] = "¤¸",
+    [J_Cieuc] = "¤º",
+    [J_Khieuq] = "¤»",
+    [J_Tieut] = "¤¼",
+    [J_Phieuf] = "¤½",
+    [J_Hieuh] = "¤¾"
+};
+
+
+static int
+cho_combine(int c1, int c2)
+{
+    if (c1 != c2) return 0;
+    switch (c1) {
+	case Kiyeog: return SsangKiyeog;
+	case Dikeud: return SsangDikeud;
+	case Pieub: return SsangPieub;
+	case Sios: return SsangSios;
+	case Jieuj: return SsangJieuj;
+    }
+    return 0;
+}
+
+static int
+jung_combine(int c1, int c2)
+{
+    if (c1 == O) {
+	if (c2 == A) return WA;
+	if (c2 == AE) return WAE;
+	if (c2 == I) return OE;
+	return 0;
+    }
+    if (c1 == U) {
+	if (c2 == EO) return WEO;
+	if (c2 == E) return WE;
+	if (c2 == I) return WI;
+    }
+    if (c1 == EU) {
+	if (c2 == I) return YI;
+    }
+    return 0;
+}
+
+static int
+jong_combine(int c1, int c2)
+{
+    if (c1 == J_Kiyeog) {
+	if (c2 == J_Kiyeog) return J_SsangKiyeog;
+	if (c2 == J_Sios) return J_KiyeogSios;
+	return 0;
+    }
+    if (c1 == J_Nieun) {
+	if (c2 == J_Jieuj) return J_NieunJieuj;
+	if (c2 == J_Hieuh) return J_NieunHieuh;
+	return 0;
+    }
+    if (c1 == J_Rieul) {
+	if (c2 == J_Kiyeog) return J_RieulKiyeog;
+	if (c2 == J_Mieum) return J_RieulMieum;
+	if (c2 == J_Pieub) return J_RieulPieub;
+	if (c2 == J_Sios) return J_RieulSios;
+	if (c2 == J_Tieut) return J_RieulTieut;
+	if (c2 == J_Phieuf) return J_RieulPhieuf;
+	if (c2 == J_Hieuh) return J_RieulHieuh;
+	return 0;
+    }
+    if (c1 == J_Pieub) {
+	if (c2 == J_Sios) return J_PieubSios;
+	return 0;
+    }
+    return 0;
+}
+
+static uint
+composer_get_last_code(Composer *comp) 
+{
+    if (comp->stack_index >= 0) 
+	return comp->code[comp->stack_index];
+    else
+    	return CHO_NULL | JUNG_NULL | JONG_NULL;
+}
+
+static bool
+composer_has_chosung(Composer *comp)
+{
+    uint c = composer_get_last_code(comp);
+    return ((CHO_MASK & c) != CHO_NULL);
+}
+
+static bool
+composer_has_jungsung(Composer *comp)
+{
+    uint c = composer_get_last_code(comp);
+    return ((JUNG_MASK & c) != JUNG_NULL);
+}
+
+static bool
+composer_has_jongsung(Composer *comp)
+{
+    uint c = composer_get_last_code(comp);
+    return ((JONG_MASK & c) != JONG_NULL);
+}
+
+static JamoInfo *
+composer_get_last_char(Composer *composer)
+{
+    return composer->jamo[composer->stack_index];
+}
+
+void
+composer_reset(Composer *comp)
+{
+    comp->stack_index = -1;
+}
+
+static void
+composer_pop(Composer *comp)
+{
+    comp->stack_index--;
+}
+
+static void
+composer_set_cho(Composer *comp, JamoInfo *jamo, uint cho)
+{
+    uint code;
+    if (jamo->type != CHO && jamo->type != CHO_JONG) {
+	fprintf(stderr, "internal error at %s\n", __FUNCTION__);
+	return;
+    }
+    if (!cho) cho = jamo->cho;
+    cho <<= CHO_SHIFT;
+    if (comp->stack_index < 0) {
+	code = JUNG_NULL | JONG_NULL | cho;
+    } else {
+	code = comp->code[comp->stack_index];
+	code = (JUNG_JONG_MASK & code) | cho;
+    }
+    comp->stack_index++;
+    comp->jamo[comp->stack_index] = jamo;
+    comp->code[comp->stack_index] = code;
+}
+
+static void
+composer_set_jung(Composer *comp, JamoInfo *jamo, uint jung)
+{
+    uint code;
+    if (jamo->type != JUNG) {
+	fprintf(stderr, "internal error at %s\n", __FUNCTION__);
+	return;
+    }
+    if (!jung) jung = jamo->jung;
+    jung <<= JUNG_SHIFT;
+    if (comp->stack_index < 0) {
+	code = CHO_NULL | JONG_NULL | jung;
+    } else {
+	code = comp->code[comp->stack_index];
+	code = (CHO_JONG_MASK &code) | jung;
+    }
+    comp->stack_index++;
+    comp->jamo[comp->stack_index] = jamo;
+    comp->code[comp->stack_index] = code;
+}
+
+static void
+composer_set_jong(Composer *comp, JamoInfo *jamo, uint jong)
+{
+    uint code;
+    if (jamo->type != JONG && jamo->type != CHO_JONG) {
+	fprintf(stderr, "internal error at %s\n", __FUNCTION__);
+	return;
+    }
+    if (!jong) jong = jamo->jong;
+    if (comp->stack_index < 0) {
+	code = CHO_NULL | JUNG_NULL | jong;
+    } else {
+	code = comp->code[comp->stack_index];
+	//printf("set jong code = %x jong = %x\n", code, jong);
+	code = (CHO_JUNG_MASK & code) | jong;
+    }
+    comp->stack_index++;
+    comp->jamo[comp->stack_index] = jamo;
+    comp->code[comp->stack_index] = code;
+    //printf("set jong code = %x jong = %x\n", code, jong);
+}
+
+static uint
+composer_try_combine_cho(Composer *composer, JamoInfo *info)
+{
+    JamoInfo *last;
+    if (composer->stack_index >= 1) return 0;
+    last = composer->jamo[composer->stack_index];
+    return cho_combine(last->cho, info->cho);
+}
+
+static uint
+composer_try_combine_jung(Composer *composer, JamoInfo *info)
+{
+    JamoInfo *last;
+    if (composer->stack_index >= 1) {
+	last = composer->jamo[composer->stack_index-1];
+	if (last->type == JUNG) return 0;
+    }
+    last = composer->jamo[composer->stack_index];
+    return jung_combine(last->jung, info->jung);
+}
+
+static uint
+composer_try_combine_jong(Composer *composer, JamoInfo *info)
+{
+    JamoInfo *last;
+    if (composer->stack_index >= 2) {
+	last = composer->jamo[composer->stack_index - 1];
+	if (last->type != JUNG) return 0;
+    }
+    last = composer->jamo[composer->stack_index];
+    return jong_combine(last->jong, info->jong);
+}
+
+void
+composer_set_output_encoding(Composer *comp, char *enc)
+{
+    if (!enc) return;
+    if (strcmp(enc, "UTF-8") == 0) comp->enc = ENC_UTF8;
+    else if (strcmp(enc, "WANSUNG") == 0) comp->enc = ENC_WANSUNG;
+    else if (strcmp(enc, "JOHAB") == 0) comp->enc = ENC_JOHAB;
+}
+
+static int
+composer_set_return_buffer(Composer *comp, uint code1, uint code2)
+{
+    char *result = comp->return_buffer;
+    int (*converter)(char *, int) = 0;
+    switch (comp->enc) {
+	case ENC_WANSUNG: converter = johab_to_wansung; break;
+	case ENC_UTF8: converter = johab_to_utf8; break;
+	case ENC_JOHAB: converter = johab_to_johab; break;
+    }
+    result += (converter)(result, code1);
+    if (!result) return 0;
+    if (code2) result += (converter)(result, code2);
+    *result = '\0';
+    return 1;
+}
+
+char *
+composer_get_buffer(Composer *comp)
+{
+    return comp->return_buffer;
+}
+
+
+static JamoInfo *
+composer_get_char_info(Composer *comp, int c)
+{
+    Keymap *keymap = (comp->keymap?:def_keymap);
+    JamoInfo *jamo = keymap->jamoinfo[c];
+    if (!jamo && (c >= 'A' && c <= 'Z')) {
+	jamo = keymap->jamoinfo[c - ('A' - 'a')];
+    }
+    return jamo;
+}
+
+static int
+composer_is_valid_code(Composer *composer)
+{
+    if (composer->enc == ENC_WANSUNG) {
+	int code = composer->code[composer->stack_index];
+	char buf[2];
+	return 2 == johab_to_wansung(buf, code);
+    }
+    return 1;
+}
+
+static void
+composer_set_return1(Composer *composer)
+{
+    composer_set_return_buffer(composer, composer->code[composer->stack_index], 0);
+}
+
+/*
+static void
+composer_set_return2(Composer *composer, uint code1)
+{
+    composer_set_return_buffer(composer, code1, composer->code[composer->stack_index]);
+}
+*/
+
+#define CORRECT_RETURN composer_set_return1(composer); return COMPOSER_CORRECT;
+#define NEW_RETURN composer_set_return1(composer); return COMPOSER_NEW;
+
+static ComposerProcessState
+composer_erase_backward(Composer *composer)
+{
+    if (composer->stack_index < 0) return COMPOSER_RAW;
+    if (composer->stack_index == 0) {
+	composer_reset(composer);
+	return COMPOSER_NULL;
+    }
+    composer_pop(composer);
+    CORRECT_RETURN
+}
+
+ComposerProcessState
+composer_process(Composer *composer, int c)
+{
+    JamoInfo * info;
+    Keymap *keymap;
+
+    if (c == '\b' || c == '') {
+	return composer_erase_backward(composer);
+    }
+    keymap = composer->keymap?composer->keymap:def_keymap;
+    if (keymap->translation) {
+	if (keymap->translation[c]) c = keymap->translation[c];
+    }
+    info = composer_get_char_info(composer, c);
+    if (!info) {
+	composer_reset(composer);
+	return COMPOSER_RAW;
+    }
+    switch (info->type) {
+	case NOT_HAN:
+	    composer_reset(composer);
+	    composer_set_return_buffer(composer, info->not_han, 0);
+	    return COMPOSER_NOT_HAN;
+	case CHO:
+	    if (composer_has_jongsung(composer)) {
+		/* ? + ? + jong */
+		composer_reset(composer);
+		composer_set_cho(composer, info, 0);
+		NEW_RETURN
+	    } else if (!composer_has_chosung(composer)) {
+		/*  0 + ? + 0 */
+		composer_set_cho(composer, info, 0);
+		if (composer_is_valid_code(composer)) {
+		    if (composer->stack_index > 0) {
+			CORRECT_RETURN
+		    } else {
+			NEW_RETURN
+		    }
+		} else {
+		    composer_reset(composer);
+		    composer_set_cho(composer, info, 0);
+		    NEW_RETURN
+		}
+	    } else if (composer_has_jungsung(composer)) {
+		/*  cho + jung + 0 */
+		composer_reset(composer);
+		composer_set_cho(composer, info, 0);
+		NEW_RETURN
+	    } else if (composer_has_chosung(composer)) {
+		/* cho + 0 + 0 */
+		uint cho = composer_try_combine_cho(composer, info);
+		if (cho) {
+		    composer_set_cho(composer, info, cho);
+		    CORRECT_RETURN
+		} 
+		if (composer->error_level > 0) {
+		    return COMPOSER_ERROR;
+		} else {
+		    composer_reset(composer);
+		    composer_set_cho(composer, info, 0);
+		    NEW_RETURN
+		}
+	    } 
+	    break;
+	case JUNG:
+	    if (composer_has_jongsung(composer)) {
+		/* ? + ? + jong */
+		JamoInfo *last_char = composer_get_last_char(composer);
+		if (last_char->type == CHO_JONG) {
+		    /* µÎ¹ú½Ä */
+		    int code1;
+		    composer_pop(composer);
+		    code1 = composer_get_last_code(composer);
+		    composer_reset(composer);
+		    composer_set_cho(composer, last_char, 0);
+		    composer_set_jung(composer, info, 0);
+		    composer_set_return_buffer(composer, code1, composer_get_last_code(composer));
+		    return COMPOSER_CORRECT_NEW;
+		} else {
+		    /* ¼¼¹ú½Ä */
+		    composer_reset(composer);
+		    composer_set_jung(composer, info, 0);
+		    NEW_RETURN
+		}
+	    } else if (composer_has_jungsung(composer)) {
+		/* ? + jung + 0 */
+		uint jung = composer_try_combine_jung(composer, info);
+		if (jung) {
+		    composer_set_jung(composer, info, jung);
+		    if (composer_is_valid_code(composer)) {
+			CORRECT_RETURN
+		    } 
+		    composer_pop(composer);
+		} 
+		if (composer->error_level > 0) {
+		    return COMPOSER_ERROR;
+		} else {
+		    composer_reset(composer);
+		    composer_set_jung(composer, info, 0);
+		    NEW_RETURN
+		}
+	    } else if (composer_has_chosung(composer)) {
+		/* cho + 0 + 0 */
+		composer_set_jung(composer, info, 0);
+		CORRECT_RETURN
+	    } else {
+		/* 0 + 0 + 0 */
+		composer_set_jung(composer, info, 0);
+		NEW_RETURN
+	    }
+	    break;
+	case JONG:
+	    if (composer_has_chosung(composer) && composer_has_jungsung(composer)) {
+		/* cho + jung + ? */
+		if (!composer_has_jongsung(composer)) {
+		    /* cho + jung + 0 */
+		    composer_set_jong(composer, info, 0);
+		    if (composer_is_valid_code(composer)) {
+			CORRECT_RETURN
+		    } else {
+			composer_pop(composer);
+			return COMPOSER_ERROR;
+		    }
+		} else {
+		    /* cho + jung + jong */
+		    uint jong = composer_try_combine_jong(composer, info);
+		    if (jong) {
+			composer_set_jong(composer, info, jong);
+			if (composer_is_valid_code(composer)) {
+			    CORRECT_RETURN
+			} else {
+			    composer_pop(composer);
+			    return COMPOSER_ERROR;
+			}
+		    } else {
+			return COMPOSER_ERROR;
+		    }
+		}
+	    } else {
+		/* 0 + jung + ? */
+		/* cho + 0 + ? */
+	        return COMPOSER_ERROR;
+	    }
+	    break;
+	case CHO_JONG:
+	    if (composer_has_jongsung(composer)) {
+		/* ? + ? + jong */
+		uint jong = composer_try_combine_jong(composer, info);
+		if (jong) {
+		    composer_set_jong(composer, info, jong);
+		    if (composer_is_valid_code(composer)) {
+			CORRECT_RETURN
+		    } 
+		} 
+		composer_reset(composer);
+		composer_set_cho(composer, info, 0);
+		NEW_RETURN
+	    } else if (composer_has_jungsung(composer)) {
+		/* ? + jung + 0 */
+		composer_set_jong(composer, info, 0);
+		if (composer_is_valid_code(composer)) {
+		    CORRECT_RETURN
+		} 
+		composer_reset(composer);
+		composer_set_cho(composer, info, 0);
+		NEW_RETURN;
+	    } else if (composer_has_chosung(composer)) {
+		/* cho + 0 + 0 */
+		uint cho = composer_try_combine_cho(composer, info);
+		if (cho) {
+		    composer_set_cho(composer, info, cho);
+		    CORRECT_RETURN
+		} else {
+		    if (composer->error_level > 0) {
+			return COMPOSER_ERROR;
+		    } else {
+			composer_reset(composer);
+			composer_set_cho(composer, info, 0);
+			NEW_RETURN
+		    }
+		}
+	    } else {
+		/* 0 + 0 + 0 */
+		composer_set_cho(composer, info, 0);
+		NEW_RETURN
+	    }
+	    break;
+    }
+    return COMPOSER_ERROR;
+}
+
+int
+composer_has_temp_hangul(Composer *composer)
+{
+    return composer->stack_index >= 0;
+}
+
+Composer *
+composer_new(void)
+{
+    return composer_new_with_keymap(NULL);
+}
+
+Composer *
+composer_new_with_keyboard(char *keyboard)
+{
+    //Composer *comp;
+    Keymap *keymap;
+
+    if (!keyboard) return NULL;
+    keymap = keymap_load(keyboard);
+    if (!keymap) return NULL;
+    return composer_new_with_keymap(keymap);
+}
+
+int
+composer_set_keymap(char *keyboard)
+{
+    Keymap * keymap;
+    if (!keyboard) return 0;
+    keymap = keymap_load(keyboard);
+    if (keymap) {
+	if (def_keymap) keymap_free(def_keymap);
+	def_keymap = keymap;
+	return 1;
+    }
+    return 0;
+}
+
+Composer *
+composer_new_with_keymap(Keymap *keymap)
+{
+    Composer *comp;
+    comp = (Composer *)malloc(sizeof(Composer));
+    memset(comp, 0, sizeof(Composer));
+    comp->keymap = keymap;
+    if (keymap) keymap->ref++;
+    composer_reset(comp);
+    comp->enc = ENC_WANSUNG;
+    comp->error_level = 1;
+    return comp;
+}
+
+
+void
+composer_free(Composer *composer)
+{
+    //int i;
+    keymap_free(composer->keymap);
+    free(composer);
+}
+
+static void
+keymap_free(Keymap *keymap)
+{
+    int i;
+    if (!keymap) return;
+    keymap->ref--;
+    if (keymap->ref) return;
+    for(i=0;i<COMPOSER_KEYMAP_MAX;i++) {
+	if (keymap->jamoinfo[i]) free(keymap->jamoinfo[i]);
+    }
+    free(keymap);
+}
+
+static char *
+skip_space(char *s)
+{
+    while (isspace((unsigned char)*s)) s++;
+    return s;
+}
+
+static char *
+skip_word(char *s)
+{
+    while (!isspace((unsigned char)*s)) s++;
+    return s;
+}
+
+#define FIND_KEY(a, b) find_key(a, b, sizeof(a)/sizeof(a[0]))
+
+static int
+find_key(const char * code[], char *value, int max)
+{
+    int i;
+    for(i=1;i<max;i++) if (code[i] && (strcmp(code[i], value) == 0)) return i;
+    return 0;
+}
+
+static void
+read_translation_table(char *map_file, int *table)
+{
+    unsigned char line[256];
+    char filename[256];
+    FILE *fp;
+
+    snprintf(filename, sizeof(filename), "%s/%s", private_dir, map_file);
+    fp = fopen(filename, "r");
+    if (!fp) {
+	snprintf(filename, sizeof(filename), "%s/%s", public_dir, map_file);
+	fp = fopen(filename, "r");
+    }
+    if (!fp) {
+	printf("cannot read map file: %s\n", map_file);
+	return;
+    }
+    while (!feof(fp)) {
+	fgets(line, 256, fp);
+	table[line[0]] = line[5];
+    }
+    fclose(fp);
+}
+
+
+static Keymap *
+keymap_load(char *keyboard)
+{
+    Keymap *keymap;
+    unsigned char line[256];
+    FILE *fp;
+    unsigned char *s;
+    unsigned char key;
+    unsigned char *value;
+    uint cho = 0, jong = 0, jung = 0, not_han = 0;
+    int type = NOT_HAN;
+    int line_num = 0;
+    int i;
+
+    for(i = 0; i < num_kbd; i++) {
+	if (strcmp(keyboard, kbd[i].name) == 0) break;
+    }
+    if (i == num_kbd) {
+	fprintf(stderr, "cannot load '%s'\n", keyboard);
+	fprintf(stderr, "No such keyboard file\n");
+	return NULL;
+    }
+    fp = fopen(kbd[i].filename, "r");
+    if(!fp) {
+	fprintf(stderr, "cannot  open for reading '%s'\n", kbd[i].filename);
+	return NULL;
+    }
+
+    keymap = (Keymap *)malloc(sizeof(Keymap));
+    keymap->jamoinfo = (JamoInfo **)malloc(sizeof(JamoInfo *) * COMPOSER_KEYMAP_MAX);
+    memset(keymap->jamoinfo, 0, sizeof(JamoInfo *) * COMPOSER_KEYMAP_MAX);
+    keymap->translation = 0;
+    while (!feof(fp)) {
+	fgets(line, sizeof(line), fp);
+	line_num++;
+	if (line[0] == ' ' || (line[0] == '#' && line[1] == '#')) continue;
+	s = skip_space(line);
+	if (s[0] == 0) continue;
+	if (strncmp(s, "import", 6) == 0) {
+	    Keymap *ji;
+	    char *kb;
+	    int i;
+	    kb = skip_space(s + 6);
+	    s = kb + strlen(kb) - 1;
+	    while (isspace((unsigned char)*s)) s--;
+	    s++;
+	    *s = '\0';
+	    ji = keymap_load(kb);
+	    if (!ji) continue;
+	    for(i=0;i<COMPOSER_KEYMAP_MAX;i++) {
+		if (ji->jamoinfo[i]) {
+		    if (!keymap->jamoinfo[i]) keymap->jamoinfo[i] = (JamoInfo *)malloc(sizeof(JamoInfo));
+		    keymap->jamoinfo[i]->type = ji->jamoinfo[i]->type;
+		    keymap->jamoinfo[i]->cho = ji->jamoinfo[i]->cho;
+		    keymap->jamoinfo[i]->jung = ji->jamoinfo[i]->jung;
+		    keymap->jamoinfo[i]->jong = ji->jamoinfo[i]->jong;
+		    keymap->jamoinfo[i]->not_han = ji->jamoinfo[i]->not_han;
+		}
+	    }
+	    keymap_free(ji);
+	    continue;
+	} else if (strcmp(s, "usemap") == 0) {
+	    char *map;
+	    if (!keymap->translation) {
+		keymap->translation = (int *)malloc(sizeof(int)*COMPOSER_KEYMAP_MAX);
+		memset(keymap->translation, 0, sizeof(int)*COMPOSER_KEYMAP_MAX);
+	    }
+	    map = s = skip_space(s + 6);
+	    s = map + strlen(map) - 1;
+	    while (isspace((unsigned char)*s)) s--;
+	    s++;
+	    *s = '\0';
+	    read_translation_table(map, keymap->translation);
+	    continue;
+	}
+	key = *s;
+	s = skip_space(s + 1);
+	value = s;
+	s = skip_word(s); *s = '\0';
+	s = skip_space(s + 1);
+	if (s[0] && strncmp(s, "cho", 3) == 0) {
+	    type = CHO;
+	    cho = FIND_KEY(cho_code, value);
+	    if (!cho) {
+		fprintf(stderr, "%s: invalid line: # = %d\n", kbd[i].filename,
+			line_num);
+		continue;
+	    }
+	} else if (s[0] && strncmp(s, "jon", 3) == 0) {
+	    type = JONG;
+	    jong = FIND_KEY(jong_code, value);
+	} else {
+	    cho = FIND_KEY(cho_code, value);
+	    jong = FIND_KEY(jong_code, value);
+	    jung = FIND_KEY(jung_code, value);
+	    //printf("cho = %d jong = %d jung = %d value = %s\n", cho, jong, jung, value);
+	    if (jung) type = JUNG;
+	    else if (cho && jong) type = CHO_JONG;
+	    else if (cho) type = CHO;
+	    else if (jong) type = JONG;
+	    else if (!cho && !jung && !jong) {
+		type = NOT_HAN;
+		not_han = value[0];
+		if (not_han >= 128) {
+		    not_han  = (not_han << 8) + value[1];
+		    johab_from_wansung(value, not_han);
+		    not_han = (value[0] << 8) + value[1];
+		}
+	    } else {
+		fprintf(stderr, "%s: invalid line: # = %d\n", kbd[i].filename,
+			line_num);
+	    }
+	}
+	if (!keymap->jamoinfo[key]) keymap->jamoinfo[key] = (JamoInfo *)malloc(sizeof(JamoInfo));
+	keymap->jamoinfo[key]->type = type;
+	keymap->jamoinfo[key]->cho = cho;
+	keymap->jamoinfo[key]->jung = jung;
+	keymap->jamoinfo[key]->jong = jong;
+	keymap->jamoinfo[key]->not_han = not_han;
+    }
+    fclose(fp);
+    keymap->ref = 1;
+    return keymap;
+}
+
+
+static KeyboardFile *
+get_kbd_names(char *directory, int *n)
+{
+    DIR *dir;
+    int num_kbd;
+    KeyboardFile *kbd;
+    struct dirent *ent;
+    dir = opendir(directory);
+    if (!dir) {
+	*n = 0;
+	return NULL;
+    }
+    num_kbd = 0;
+    while ((ent = readdir(dir)) != NULL) {
+	char *name = ent->d_name;
+	int len = strlen(name);
+	if (len <= 4) continue;
+	if (strcmp(".kbd", name + len - 4) != 0) continue;
+	num_kbd++;
+    }
+    kbd = (KeyboardFile *)malloc(sizeof(KeyboardFile) * num_kbd);
+    rewinddir(dir);
+    num_kbd = 0;
+    while ((ent = readdir(dir)) != NULL) {
+	char *name = ent->d_name;
+	int len = strlen(name);
+	if (len <= 4) continue;
+	if (strcmp(".kbd", name + len - 4) != 0) continue;
+
+	kbd[num_kbd].filename = malloc(len + strlen(directory) + 2);
+	strcpy(kbd[num_kbd].filename, directory);
+	strcat(kbd[num_kbd].filename, "/");
+	strcat(kbd[num_kbd].filename, name);
+
+	kbd[num_kbd].name = (char *)malloc(len - 3);
+	memcpy(kbd[num_kbd].name, name, len - 4);
+	kbd[num_kbd].name[len-4] = '\0';
+	num_kbd++;
+    }
+    *n = num_kbd;
+    closedir(dir);
+    return kbd;
+}
+
+char **
+composer_get_keyboard_list(char *pdir, int *n)
+{
+    //DIR *dir;
+    //struct dirent *ent;
+    KeyboardFile *kbd1, *kbd2;
+    static char **keyboard_list = NULL;
+    char my_dir[256];
+    int n1, n2;
+    int i;
+
+    if (keyboard_list) {
+	*n = num_kbd;
+	return keyboard_list;
+    }
+
+    public_dir = pdir;
+
+    if (!public_dir) {
+	public_dir = getenv("HANGUL_KEYBOARD_DIRECTORY");
+    }
+
+    kbd1 = get_kbd_names(public_dir, &n1);
+    snprintf(my_dir, sizeof(my_dir), "%s/.hangul_keyboard", getenv("HOME"));
+
+    private_dir = strdup(my_dir);
+
+    kbd2 = get_kbd_names(my_dir, &n2);
+
+    if ((n1 + n2) == 0) {
+	fprintf(stderr, "cannot find any keyboard files\n");
+	exit(-1);
+    }
+    if (n2) {
+	if (n1) {
+	    int k = 0;
+	    kbd = realloc(kbd2, sizeof(KeyboardFile)*(n1 + n2));
+	    for (i=0;i<n1;i++) {
+		int j;
+		char *name = kbd1[i].name;
+		for(j=0;j<n2;j++) {
+		    if (strcmp(kbd[j].name, name) == 0) break;
+		}
+		if (j>=n2) {
+		    kbd[n2 + k++] = kbd1[i];
+		}
+	    }
+	    n1 = k;
+	    free(kbd1);
+	} else {
+	    kbd = kbd2;
+	}
+    } else {
+	kbd = kbd1;
+    }
+
+    num_kbd = n1 + n2;
+    keyboard_list = (char **)malloc(sizeof(char *) * (num_kbd));
+    for(i=0;i<num_kbd;i++) {
+	keyboard_list[i] = kbd[i].name;
+    }
+    *n = num_kbd;
+    return keyboard_list;
+}
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/comp.h unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/comp.h
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/comp.h	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/comp.h	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,30 @@
+/* This file is a part of Ami software, (C) Hwang chi-deok 2001 */
+
+#ifndef __COMP_H__
+#define __COMP_H__
+
+typedef struct _Composer Composer;
+typedef struct _Keymap Keymap;
+typedef enum {
+    COMPOSER_NEW,
+    COMPOSER_RAW,
+    COMPOSER_NULL,
+    COMPOSER_NOT_HAN,
+    COMPOSER_CORRECT,
+    COMPOSER_ERROR,
+    COMPOSER_CORRECT_NEW
+} ComposerProcessState;
+
+Composer *composer_new(void);
+Composer * composer_new_with_keymap(Keymap *keymap);
+ComposerProcessState composer_process(Composer *comp, int c);
+char * composer_get_buffer(Composer *comp);
+void composer_set_output_encoding(Composer *comp, char *enc);
+void composer_reset(Composer *comp);
+char **composer_get_keyboard_list(char *directory_name, int *num_kbd);
+int composer_set_keymap(char *keyboard);
+int composer_has_temp_hangul(Composer *composer);
+Keymap * composer_get_keymap(Composer *composer);
+void composer_free(Composer *composer);
+
+#endif
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/hanja.c unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/hanja.c
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/hanja.c	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/hanja.c	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,560 @@
+/*
+   Hanja handling routine
+   written by Yang, Woosuk.
+   3. 10. 1994.
+ */
+#include "error.h"
+#include <stdio.h>
+
+#include "johabcode.h"
+
+
+#define MAX_HANJA_TABLE	500    
+
+static void put_hanja (int item);
+
+static const unsigned int 
+hanja_table[][2] = {
+	{ 0xb0a1, 0xcaa1 },  /* °¡ */
+	{ 0xb0a2, 0xcabe },  /* °¢ */
+	{ 0xb0a3, 0xcac9 },  /* °£ */
+	{ 0xb0a5, 0xcae1 },  /* °¥ */
+	{ 0xb0a8, 0xcaeb },  /* °¨ */
+	{ 0xb0a9, 0xcba1 },  /* °© */
+	{ 0xb0ad, 0xcba7 },  /* °­ */
+	{ 0xb0b3, 0xcbbf },  /* °³ */
+	{ 0xb0b4, 0xcbd3 },  /* °´ */
+	{ 0xb0bb, 0xcbd5 },  /* °» */
+	{ 0xb0bd, 0xcbd9 },  /* °½ */
+	{ 0xb0c5, 0xcbda },  /* °Å */
+	{ 0xb0c7, 0xcbeb },  /* °Ç */
+	{ 0xb0c9, 0xcbf7 },  /* °É */
+	{ 0xb0cb, 0xcbfb },  /* °Ë */
+	{ 0xb0cc, 0xcca4 },  /* °Ì */
+	{ 0xb0d4, 0xcca7 },  /* °Ô */
+	{ 0xb0dd, 0xccaa },  /* °Ý */
+	{ 0xb0df, 0xccb1 },  /* °ß */
+	{ 0xb0e1, 0xccbc },  /* °á */
+	{ 0xb0e2, 0xccc2 },  /* °â */
+	{ 0xb0e6, 0xccc8 },  /* °æ */
+	{ 0xb0e8, 0xccf5 },  /* °è */
+	{ 0xb0ed, 0xcdaf },  /* °í */
+	{ 0xb0ee, 0xcdd6 },  /* °î */
+	{ 0xb0ef, 0xcddd },  /* °ï */
+	{ 0xb0f1, 0xcde7 },  /* °ñ */
+	{ 0xb0f8, 0xcdea },  /* °ø */
+	{ 0xb0f9, 0xcdfa },  /* °ù */
+	{ 0xb0fa, 0xcdfb },  /* °ú */
+	{ 0xb0fb, 0xcea9 },  /* °û */
+	{ 0xb0fc, 0xcead },  /* °ü */
+	{ 0xb0fd, 0xcebe },  /* °ý */
+	{ 0xb1a4, 0xcec2 },  /* ±¤ */
+	{ 0xb1a5, 0xcecf },  /* ±¥ */
+	{ 0xb1ab, 0xced2 },  /* ±« */
+	{ 0xb1b2, 0xcedb },  /* ±² */
+	{ 0xb1b3, 0xcedf },  /* ±³ */
+	{ 0xb1b8, 0xcef8 },  /* ±¸ */
+	{ 0xb1b9, 0xcfd0 },  /* ±¹ */
+	{ 0xb1ba, 0xcfd6 },  /* ±º */
+	{ 0xb1bc, 0xcfdc },  /* ±¼ */
+	{ 0xb1c3, 0xcfe0 },  /* ±Ã */
+	{ 0xb1c7, 0xcfe6 },  /* ±Ç */
+	{ 0xb1c8, 0xcff0 },  /* ±È */
+	{ 0xb1cb, 0xcff5 },  /* ±Ë */
+	{ 0xb1cd, 0xcffb },  /* ±Í */
+	{ 0xb1d4, 0xd0a3 },  /* ±Ô */
+	{ 0xb1d5, 0xd0b2 },  /* ±Õ */
+	{ 0xb1d6, 0xd0b9 },  /* ±Ö */
+	{ 0xb1d8, 0xd0ba },  /* ±Ø */
+	{ 0xb1d9, 0xd0c1 },  /* ±Ù */
+	{ 0xb1db, 0xd0d0 },  /* ±Û */
+	{ 0xb1dd, 0xd0d1 },  /* ±Ý */
+	{ 0xb1de, 0xd0df },  /* ±Þ */
+	{ 0xb1e0, 0xd0e6 },  /* ±à */
+	{ 0xb1e2, 0xd0ea },  /* ±â */
+	{ 0xb1e4, 0xd1cc },  /* ±ä */
+	{ 0xb1e6, 0xd1cd },  /* ±æ */
+	{ 0xb1e8, 0xd1d1 },  /* ±è */
+	{ 0xb3a3, 0xd1d2 },  /* ³£ */
+	{ 0xb3aa, 0xd1d3 },  /* ³ª */
+	{ 0xb3ab, 0xd1e2 },  /* ³« */
+	{ 0xb3ad, 0xd1ea },  /* ³­ */
+	{ 0xb3af, 0xd1f3 },  /* ³¯ */
+	{ 0xb3b2, 0xd1f5 },  /* ³² */
+	{ 0xb3b3, 0xd1fe },  /* ³³ */
+	{ 0xb3b6, 0xd2a5 },  /* ³¶ */
+	{ 0xb3bb, 0xd2ac },  /* ³» */
+	{ 0xb3c3, 0xd2b2 },  /* ³Ã */
+	{ 0xb3e0, 0xd2b3 },  /* ³à */
+	{ 0xb3e2, 0xd2b4 },  /* ³â */
+	{ 0xb3e4, 0xd2b7 },  /* ³ä */
+	{ 0xb3e7, 0xd2bb },  /* ³ç */
+	{ 0xb3eb, 0xd2bd },  /* ³ë */
+	{ 0xb3ec, 0xd2cf },  /* ³ì */
+	{ 0xb3ed, 0xd2d5 },  /* ³í */
+	{ 0xb3f3, 0xd2d6 },  /* ³ó */
+	{ 0xb3fa, 0xd2dd },  /* ³ú */
+	{ 0xb4a2, 0xd2e3 },  /* ´¢ */
+	{ 0xb4a9, 0xd2e4 },  /* ´© */
+	{ 0xb4ab, 0xd2ec },  /* ´« */
+	{ 0xb4ad, 0xd2ed },  /* ´­ */
+	{ 0xb4ba, 0xd2ee },  /* ´º */
+	{ 0xb4c1, 0xd2f0 },  /* ´Á */
+	{ 0xb4c6, 0xd2f2 },  /* ´Æ */
+	{ 0xb4c9, 0xd2f3 },  /* ´É */
+	{ 0xb4cf, 0xd2f9 },  /* ´Ï */
+	{ 0xb4d0, 0xd2fb },  /* ´Ð */
+	{ 0xb4d9, 0xd2fd },  /* ´Ù */
+	{ 0xb4dc, 0xd3a1 },  /* ´Ü */
+	{ 0xb4de, 0xd3b5 },  /* ´Þ */
+	{ 0xb4e3, 0xd3ba },  /* ´ã */
+	{ 0xb4e4, 0xd3cb },  /* ´ä */
+	{ 0xb4e7, 0xd3d0 },  /* ´ç */
+	{ 0xb4eb, 0xd3db },  /* ´ë */
+	{ 0xb4ec, 0xd3eb },  /* ´ì */
+	{ 0xb4f6, 0xd3ec },  /* ´ö */
+	{ 0xb5b5, 0xd3ee },  /* µµ */
+	{ 0xb5b6, 0xd4b8 },  /* µ¶ */
+	{ 0xb5b7, 0xd4c2 },  /* µ· */
+	{ 0xb5b9, 0xd4cc },  /* µ¹ */
+	{ 0xb5bf, 0xd4ce },  /* µ¿ */
+	{ 0xb5ce, 0xd4df },  /* µÎ */
+	{ 0xb5d0, 0xd4ea },  /* µÐ */
+	{ 0xb5e6, 0xd4f0 },  /* µæ */
+	{ 0xb5ee, 0xd4f1 },  /* µî */
+	{ 0xb6f3, 0xd4fa },  /* ¶ó */
+	{ 0xb3aa, 0xd5a1 },  /* ³ª */
+	{ 0xb6f3, 0xd5a2 },  /* ¶ó */
+	{ 0xb6f4, 0xd5a5 },  /* ¶ô */
+	{ 0xb6f5, 0xd5ae },  /* ¶õ */
+	{ 0xb6f6, 0xd5b7 },  /* ¶ö */
+	{ 0xb6f7, 0xd5b9 },  /* ¶÷ */
+	{ 0xb6f8, 0xd5c3 },  /* ¶ø */
+	{ 0xb6fb, 0xd5c6 },  /* ¶û */
+	{ 0xb7a1, 0xd5ce },  /* ·¡ */
+	{ 0xb7a9, 0xd5d2 },  /* ·© */
+	{ 0xb7ab, 0xd5d4 },  /* ·« */
+	{ 0xb7ae, 0xd5d5 },  /* ·® */
+	{ 0xb7c1, 0xd5e2 },  /* ·Á */
+	{ 0xb7c2, 0xd5f4 },  /* ·Â */
+	{ 0xb7c3, 0xd5fb },  /* ·Ã */
+	{ 0xb7c4, 0xd6a9 },  /* ·Ä */
+	{ 0xb7c5, 0xd6af },  /* ·Å */
+	{ 0xb7c6, 0xd6b4 },  /* ·Æ */
+	{ 0xb7c9, 0xd6b5 },  /* ·É */
+	{ 0xb7ca, 0xd6c7 },  /* ·Ê */
+	{ 0xb7ce, 0xd6cc },  /* ·Î */
+	{ 0xb7cf, 0xd6de },  /* ·Ï */
+	{ 0xb7d0, 0xd6e5 },  /* ·Ð */
+	{ 0xb7d5, 0xd6e6 },  /* ·Õ */
+	{ 0xb7da, 0xd6ed },  /* ·Ú */
+	{ 0xb7e1, 0xd6f5 },  /* ·á */
+	{ 0xb7e6, 0xd7a3 },  /* ·æ */
+	{ 0xb7e7, 0xd7a4 },  /* ·ç */
+	{ 0xb7f9, 0xd7b1 },  /* ·ù */
+	{ 0xb7fa, 0xd7bf },  /* ·ú */
+	{ 0xb7fb, 0xd7c2 },  /* ·û */
+	{ 0xc0b2, 0xd7c8 },  /* À² */
+	{ 0xb7fc, 0xd7c9 },  /* ·ü */
+	{ 0xb8a2, 0xd7cc },  /* ¸¢ */
+	{ 0xb8a4, 0xd7cd },  /* ¸¤ */
+	{ 0xb8a7, 0xd7cf },  /* ¸§ */
+	{ 0xb8aa, 0xd7d0 },  /* ¸ª */
+	{ 0xb8ae, 0xd7d6 },  /* ¸® */
+	{ 0xb8b0, 0xd7f0 },  /* ¸° */
+	{ 0xb8b2, 0xd7f9 },  /* ¸² */
+	{ 0xb8b3, 0xd7fe },  /* ¸³ */
+	{ 0xb8b6, 0xd8a4 },  /* ¸¶ */
+	{ 0xb8b7, 0xd8ac },  /* ¸· */
+	{ 0xb8b8, 0xd8b2 },  /* ¸¸ */
+	{ 0xb8bb, 0xd8c5 },  /* ¸» */
+	{ 0xb8c1, 0xd8cc },  /* ¸Á */
+	{ 0xb8c5, 0xd8d8 },  /* ¸Å */
+	{ 0xb8c6, 0xd8e6 },  /* ¸Æ */
+	{ 0xb8cd, 0xd8eb },  /* ¸Í */
+	{ 0xb8e8, 0xd8f1 },  /* ¸è */
+	{ 0xb8e9, 0xd8f3 },  /* ¸é */
+	{ 0xb8ea, 0xd8fe },  /* ¸ê */
+	{ 0xb8ed, 0xd9a2 },  /* ¸í */
+	{ 0xb8ef, 0xd9b1 },  /* ¸ï */
+	{ 0xb8f0, 0xd9b2 },  /* ¸ð */
+	{ 0xb8f1, 0xd9ca },  /* ¸ñ */
+	{ 0xb8f4, 0xd9d1 },  /* ¸ô */
+	{ 0xb8f9, 0xd9d3 },  /* ¸ù */
+	{ 0xb9a6, 0xd9d6 },  /* ¹¦ */
+	{ 0xb9ab, 0xd9e2 },  /* ¹« */
+	{ 0xb9ac, 0xd9f8 },  /* ¹¬ */
+	{ 0xb9ae, 0xd9fa },  /* ¹® */
+	{ 0xb9b0, 0xdaa8 },  /* ¹° */
+	{ 0xb9cc, 0xdaab },  /* ¹Ì */
+	{ 0xb9ce, 0xdabe },  /* ¹Î */
+	{ 0xb9d0, 0xdacb },  /* ¹Ð */
+	{ 0xb9da, 0xdace },  /* ¹Ú */
+	{ 0xb9dd, 0xdae1 },  /* ¹Ý */
+	{ 0xb9df, 0xdafa },  /* ¹ß */
+	{ 0xb9e6, 0xdba7 },  /* ¹æ */
+	{ 0xb9e8, 0xdbc3 },  /* ¹è */
+	{ 0xb9e9, 0xdbd7 },  /* ¹é */
+	{ 0xb9f8, 0xdbdf },  /* ¹ø */
+	{ 0xb9fa, 0xdbe9 },  /* ¹ú */
+	{ 0xb9fc, 0xdbed },  /* ¹ü */
+	{ 0xb9fd, 0xdbf6 },  /* ¹ý */
+	{ 0xbaae, 0xdbf8 },  /* º® */
+	{ 0xbaaf, 0xdca5 },  /* º¯ */
+	{ 0xbab0, 0xdcac },  /* º° */
+	{ 0xbab4, 0xdcb0 },  /* º´ */
+	{ 0xbab8, 0xdcc1 },  /* º¸ */
+	{ 0xbab9, 0xdcd1 },  /* º¹ */
+	{ 0xbabb, 0xdce2 },  /* º» */
+	{ 0xbabc, 0xdce3 },  /* º¼ */
+	{ 0xbac0, 0xdce4 },  /* ºÀ */
+	{ 0xbace, 0xdcf4 },  /* ºÎ */
+	{ 0xbacf, 0xddc1 },  /* ºÏ */
+	{ 0xbad0, 0xddc2 },  /* ºÐ */
+	{ 0xbad2, 0xddd5 },  /* ºÒ */
+	{ 0xbad8, 0xddda },  /* ºØ */
+	{ 0xbaf1, 0xdde0 },  /* ºñ */
+	{ 0xbaf3, 0xdead },  /* ºó */
+	{ 0xbaf9, 0xdebb },  /* ºù */
+	{ 0xbbe7, 0xdebf },  /* »ç */
+	{ 0xbbe8, 0xdefb },  /* »è */
+	{ 0xbbea, 0xdfa1 },  /* »ê */
+	{ 0xbbec, 0xdfad },  /* »ì */
+	{ 0xbbef, 0xdfb2 },  /* »ï */
+	{ 0xbbf0, 0xdfba },  /* »ð */
+	{ 0xbbf3, 0xdfbe },  /* »ó */
+	{ 0xbbf5, 0xdfdd },  /* »õ */
+	{ 0xbbf6, 0xdfe0 },  /* »ö */
+	{ 0xbbfd, 0xdfe5 },  /* »ý */
+	{ 0xbcad, 0xdfea },  /* ¼­ */
+	{ 0xbcae, 0xe0aa },  /* ¼® */
+	{ 0xbcb1, 0xe0b9 },  /* ¼± */
+	{ 0xbcb3, 0xe0d9 },  /* ¼³ */
+	{ 0xbcb6, 0xe0e6 },  /* ¼¶ */
+	{ 0xbcb7, 0xe0ee },  /* ¼· */
+	{ 0xbcba, 0xe0f2 },  /* ¼º */
+	{ 0xbcbc, 0xe1a6 },  /* ¼¼ */
+	{ 0xbcd2, 0xe1af },  /* ¼Ò */
+	{ 0xbcd3, 0xe1d4 },  /* ¼Ó */
+	{ 0xbcd5, 0xe1dd },  /* ¼Õ */
+	{ 0xbcd6, 0xe1e3 },  /* ¼Ö */
+	{ 0xbcdb, 0xe1e4 },  /* ¼Û */
+	{ 0xbce2, 0xe1ec },  /* ¼â */
+	{ 0xbce8, 0xe1f1 },  /* ¼è */
+	{ 0xbcf6, 0xe1f3 },  /* ¼ö */
+	{ 0xbcf7, 0xe2d2 },  /* ¼÷ */
+	{ 0xbcf8, 0xe2de },  /* ¼ø */
+	{ 0xbcfa, 0xe2f9 },  /* ¼ú */
+	{ 0xbcfe, 0xe2fd },  /* ¼þ */
+	{ 0xbdbd, 0xe3a2 },  /* ½½ */
+	{ 0xbdc0, 0xe3a5 },  /* ½À */
+	{ 0xbdc2, 0xe3aa },  /* ½Â */
+	{ 0xbdc3, 0xe3b4 },  /* ½Ã */
+	{ 0xbdc4, 0xe3d0 },  /* ½Ä */
+	{ 0xbdc5, 0xe3df },  /* ½Å */
+	{ 0xbdc7, 0xe3f7 },  /* ½Ç */
+	{ 0xbdc9, 0xe3fb },  /* ½É */
+	{ 0xbdca, 0xe4a7 },  /* ½Ê */
+	{ 0xbdd6, 0xe4aa },  /* ½Ö */
+	{ 0xbebe, 0xe4ab },  /* ¾¾ */
+	{ 0xbec6, 0xe4ac },  /* ¾Æ */
+	{ 0xbec7, 0xe4be },  /* ¾Ç */
+	{ 0xbec8, 0xe4cc },  /* ¾È */
+	{ 0xbecb, 0xe4d6 },  /* ¾Ë */
+	{ 0xbecf, 0xe4da },  /* ¾Ï */
+	{ 0xbed0, 0xe4e2 },  /* ¾Ð */
+	{ 0xbed3, 0xe4e6 },  /* ¾Ó */
+	{ 0xbed6, 0xe4ed },  /* ¾Ö */
+	{ 0xbed7, 0xe4f8 },  /* ¾× */
+	{ 0xbede, 0xe5a1 },  /* ¾Þ */
+	{ 0xbedf, 0xe5a5 },  /* ¾ß */
+	{ 0xbee0, 0xe5b0 },  /* ¾à */
+	{ 0xbee7, 0xe5b9 },  /* ¾ç */
+	{ 0xbeee, 0xe5d8 },  /* ¾î */
+	{ 0xbeef, 0xe5e2 },  /* ¾ï */
+	{ 0xbef0, 0xe5e7 },  /* ¾ð */
+	{ 0xbef3, 0xe5ed },  /* ¾ó */
+	{ 0xbef6, 0xe5ef },  /* ¾ö */
+	{ 0xbef7, 0xe5f5 },  /* ¾÷ */
+	{ 0xbfa3, 0xe5f7 },  /* ¿£ */
+	{ 0xbfa9, 0xe5f8 },  /* ¿© */
+	{ 0xbfaa, 0xe6b2 },  /* ¿ª */
+	{ 0xbfac, 0xe6bf },  /* ¿¬ */
+	{ 0xbfad, 0xe6ea },  /* ¿­ */
+	{ 0xbfb0, 0xe6f4 },  /* ¿° */
+	{ 0xbfb1, 0xe7a5 },  /* ¿± */
+	{ 0xbfb5, 0xe7a9 },  /* ¿µ */
+	{ 0xbfb9, 0xe7d1 },  /* ¿¹ */
+	{ 0xbfc0, 0xe7e9 },  /* ¿À */
+	{ 0xbfc1, 0xe8a9 },  /* ¿Á */
+	{ 0xbfc2, 0xe8ae },  /* ¿Â */
+	{ 0xbfc3, 0xe8b4 },  /* ¿Ã */
+	{ 0xbfcb, 0xe8b5 },  /* ¿Ë */
+	{ 0xbfcd, 0xe8be },  /* ¿Í */
+	{ 0xbfcf, 0xe8c6 },  /* ¿Ï */
+	{ 0xbfd0, 0xe8d8 },  /* ¿Ð */
+	{ 0xbfd5, 0xe8d9 },  /* ¿Õ */
+	{ 0xbfd6, 0xe8de },  /* ¿Ö */
+	{ 0xbfdc, 0xe8e2 },  /* ¿Ü */
+	{ 0xbfe4, 0xe8e7 },  /* ¿ä */
+	{ 0xbfe5, 0xe9af },  /* ¿å */
+	{ 0xbfeb, 0xe9b5 },  /* ¿ë */
+	{ 0xbfec, 0xe9cd },  /* ¿ì */
+	{ 0xbfed, 0xe9ed },  /* ¿í */
+	{ 0xbfee, 0xe9f6 },  /* ¿î */
+	{ 0xbfef, 0xeaa5 },  /* ¿ï */
+	{ 0xbff5, 0xeaa8 },  /* ¿õ */
+	{ 0xbff8, 0xeaaa },  /* ¿ø */
+	{ 0xbff9, 0xeac5 },  /* ¿ù */
+	{ 0xc0a7, 0xeac8 },  /* À§ */
+	{ 0xc0af, 0xeae1 },  /* À¯ */
+	{ 0xc0b0, 0xebbb },  /* À° */
+	{ 0xc0b1, 0xebc2 },  /* À± */
+	{ 0xc0b2, 0xebcf },  /* À² */
+	{ 0xc0b6, 0xebd4 },  /* À¶ */
+	{ 0xc0ba, 0xebd9 },  /* Àº */
+	{ 0xc0bb, 0xebe0 },  /* À» */
+	{ 0xc0bd, 0xebe1 },  /* À½ */
+	{ 0xc0be, 0xebe7 },  /* À¾ */
+	{ 0xc0c0, 0xebea },  /* ÀÀ */
+	{ 0xc0c7, 0xebee },  /* ÀÇ */
+	{ 0xc0cc, 0xeca3 },  /* ÀÌ */
+	{ 0xc0cd, 0xecc9 },  /* ÀÍ */
+	{ 0xc0ce, 0xecd1 },  /* ÀÎ */
+	{ 0xc0cf, 0xece9 },  /* ÀÏ */
+	{ 0xc0d3, 0xecf2 },  /* ÀÓ */
+	{ 0xc0d4, 0xecfd },  /* ÀÔ */
+	{ 0xc0d7, 0xeda4 },  /* À× */
+	{ 0xc0da, 0xeda8 },  /* ÀÚ */
+	{ 0xc0db, 0xedc2 },  /* ÀÛ */
+	{ 0xc0dc, 0xedcf },  /* ÀÜ */
+	{ 0xc0e1, 0xedd4 },  /* Àá */
+	{ 0xc0e2, 0xedda },  /* Àâ */
+	{ 0xc0e5, 0xeddb },  /* Àå */
+	{ 0xc0e7, 0xeea2 },  /* Àç */
+	{ 0xc0ef, 0xeeb3 },  /* Àï */
+	{ 0xc0fa, 0xeeb7 },  /* Àú */
+	{ 0xc0fb, 0xeed3 },  /* Àû */
+	{ 0xc0fc, 0xeeec },  /* Àü */
+	{ 0xc0fd, 0xefb7 },  /* Àý */
+	{ 0xc1a1, 0xefbf },  /* Á¡ */
+	{ 0xc1a2, 0xefc8 },  /* Á¢ */
+	{ 0xc1a4, 0xefcb },  /* Á¤ */
+	{ 0xc1a6, 0xf0a4 },  /* Á¦ */
+	{ 0xc1b6, 0xf0bb },  /* Á¶ */
+	{ 0xc1b7, 0xf0e9 },  /* Á· */
+	{ 0xc1b8, 0xf0ed },  /* Á¸ */
+	{ 0xc1b9, 0xf0ef },  /* Á¹ */
+	{ 0xc1be, 0xf0f2 },  /* Á¾ */
+	{ 0xc1c2, 0xf1a5 },  /* ÁÂ */
+	{ 0xc1cb, 0xf1aa },  /* ÁË */
+	{ 0xc1d6, 0xf1ab },  /* ÁÖ */
+	{ 0xc1d7, 0xf1d3 },  /* Á× */
+	{ 0xc1d8, 0xf1d5 },  /* ÁØ */
+	{ 0xc1d9, 0xf1e8 },  /* ÁÙ */
+	{ 0xc1df, 0xf1e9 },  /* Áß */
+	{ 0xc1ef, 0xf1ed },  /* Áï */
+	{ 0xc1f1, 0xf1ee },  /* Áñ */
+	{ 0xc1f3, 0xf1ef },  /* Áó */
+	{ 0xc1f5, 0xf1f2 },  /* Áõ */
+	{ 0xc1f6, 0xf1fd },  /* Áö */
+	{ 0xc1f7, 0xf2c1 },  /* Á÷ */
+	{ 0xc1f8, 0xf2c6 },  /* Áø */
+	{ 0xc1fa, 0xf2e9 },  /* Áú */
+	{ 0xc1fc, 0xf2f8 },  /* Áü */
+	{ 0xc1fd, 0xf2fa },  /* Áý */
+	{ 0xc2a1, 0xf3a3 },  /* Â¡ */
+	{ 0xc2f7, 0xf3a6 },  /* Â÷ */
+	{ 0xc2f8, 0xf3b5 },  /* Âø */
+	{ 0xc2f9, 0xf3bc },  /* Âù */
+	{ 0xc2fb, 0xf3cb },  /* Âû */
+	{ 0xc2fc, 0xf3d0 },  /* Âü */
+	{ 0xc3a2, 0xf3da },  /* Ã¢ */
+	{ 0xc3a4, 0xf3f0 },  /* Ã¤ */
+	{ 0xc3a5, 0xf3fc },  /* Ã¥ */
+	{ 0xc3b3, 0xf4a2 },  /* Ã³ */
+	{ 0xc3b4, 0xf4a6 },  /* Ã´ */
+	{ 0xc3b5, 0xf4b5 },  /* Ãµ */
+	{ 0xc3b6, 0xf4c8 },  /* Ã¶ */
+	{ 0xc3b7, 0xf4d2 },  /* Ã· */
+	{ 0xc3b8, 0xf4dc },  /* Ã¸ */
+	{ 0xc3bb, 0xf4e6 },  /* Ã» */
+	{ 0xc3bc, 0xf4ee },  /* Ã¼ */
+	{ 0xc3ca, 0xf4f8 },  /* ÃÊ */
+	{ 0xc3cb, 0xf5b5 },  /* ÃË */
+	{ 0xc3cc, 0xf5bb },  /* ÃÌ */
+	{ 0xc3d1, 0xf5be },  /* ÃÑ */
+	{ 0xc3d4, 0xf5c9 },  /* ÃÔ */
+	{ 0xc3d6, 0xf5ca },  /* ÃÖ */
+	{ 0xc3df, 0xf5cd },  /* Ãß */
+	{ 0xc3e0, 0xf5e4 },  /* Ãà */
+	{ 0xc3e1, 0xf5f0 },  /* Ãá */
+	{ 0xc3e2, 0xf5f3 },  /* Ãâ */
+	{ 0xc3e6, 0xf5f6 },  /* Ãæ */
+	{ 0xc3e9, 0xf5fc },  /* Ãé */
+	{ 0xc3eb, 0xf6a1 },  /* Ãë */
+	{ 0xc3f8, 0xf6b0 },  /* Ãø */
+	{ 0xc3fe, 0xf6b5 },  /* Ãþ */
+	{ 0xc4a1, 0xf6b6 },  /* Ä¡ */
+	{ 0xc4a2, 0xf6ce },  /* Ä¢ */
+	{ 0xc4a3, 0xf6d1 },  /* Ä£ */
+	{ 0xc4a5, 0xf6d2 },  /* Ä¥ */
+	{ 0xc4a7, 0xf6d5 },  /* Ä§ */
+	{ 0xc4a8, 0xf6de },  /* Ä¨ */
+	{ 0xc4aa, 0xf6df },  /* Äª */
+	{ 0xc4e8, 0xf6e1 },  /* Äè */
+	{ 0xc5b8, 0xf6e2 },  /* Å¸ */
+	{ 0xc5b9, 0xf6f0 },  /* Å¹ */
+	{ 0xc5ba, 0xf7a2 },  /* Åº */
+	{ 0xc5bb, 0xf7ac },  /* Å» */
+	{ 0xc5bd, 0xf7ae },  /* Å½ */
+	{ 0xc5be, 0xf7b2 },  /* Å¾ */
+	{ 0xc5c1, 0xf7b5 },  /* ÅÁ */
+	{ 0xc5c2, 0xf7ba },  /* ÅÂ */
+	{ 0xc5c3, 0xf7c8 },  /* ÅÃ */
+	{ 0xc5ca, 0xf7cb },  /* ÅÊ */
+	{ 0xc5cd, 0xf7cc },  /* ÅÍ */
+	{ 0xc5e4, 0xf7cd },  /* Åä */
+	{ 0xc5eb, 0xf7d1 },  /* Åë */
+	{ 0xc5f0, 0xf7d8 },  /* Åð */
+	{ 0xc5f5, 0xf7de },  /* Åõ */
+	{ 0xc6af, 0xf7e4 },  /* Æ¯ */
+	{ 0xc6b4, 0xf7e6 },  /* Æ´ */
+	{ 0xc6c4, 0xf7e7 },  /* ÆÄ */
+	{ 0xc6c7, 0xf7f7 },  /* ÆÇ */
+	{ 0xc6c8, 0xf8a2 },  /* ÆÈ */
+	{ 0xc6d0, 0xf8a5 },  /* ÆÐ */
+	{ 0xc6d8, 0xf8b0 },  /* ÆØ */
+	{ 0xc6da, 0xf8b4 },  /* ÆÚ */
+	{ 0xc6ed, 0xf8b5 },  /* Æí */
+	{ 0xc6ef, 0xf8bf },  /* Æï */
+	{ 0xc6f2, 0xf8c0 },  /* Æò */
+	{ 0xc6f3, 0xf8c5 },  /* Æó */
+	{ 0xc6f7, 0xf8cf },  /* Æ÷ */
+	{ 0xc6f8, 0xf8eb },  /* Æø */
+	{ 0xc7a5, 0xf8f1 },  /* Ç¥ */
+	{ 0xc7b0, 0xf9a1 },  /* Ç° */
+	{ 0xc7b3, 0xf9a3 },  /* Ç³ */
+	{ 0xc7c7, 0xf9a8 },  /* ÇÇ */
+	{ 0xc7ca, 0xf9af },  /* ÇÊ */
+	{ 0xc7cc, 0xf9b9 },  /* ÇÌ */
+	{ 0xc7cf, 0xf9bb },  /* ÇÏ */
+	{ 0xc7d0, 0xf9c9 },  /* ÇÐ */
+	{ 0xc7d1, 0xf9ce },  /* ÇÑ */
+	{ 0xc7d2, 0xf9dc },  /* ÇÒ */
+	{ 0xc7d4, 0xf9de },  /* ÇÔ */
+	{ 0xc7d5, 0xf9ea },  /* ÇÕ */
+	{ 0xc7d7, 0xf9f1 },  /* Ç× */
+	{ 0xc7d8, 0xfaa4 },  /* ÇØ */
+	{ 0xc7d9, 0xfab6 },  /* ÇÙ */
+	{ 0xc7e0, 0xfab8 },  /* Çà */
+	{ 0xc7e2, 0xfabd },  /* Çâ */
+	{ 0xc7e3, 0xfac6 },  /* Çã */
+	{ 0xc7e5, 0xfaca },  /* Çå */
+	{ 0xc7e6, 0xface },  /* Çæ */
+	{ 0xc7e8, 0xfacf },  /* Çè */
+	{ 0xc7f5, 0xfad1 },  /* Çõ */
+	{ 0xc7f6, 0xfad5 },  /* Çö */
+	{ 0xc7f7, 0xfaea },  /* Ç÷ */
+	{ 0xc7f8, 0xfaee },  /* Çø */
+	{ 0xc7f9, 0xfaef },  /* Çù */
+	{ 0xc7fc, 0xfafb },  /* Çü */
+	{ 0xc7fd, 0xfbb1 },  /* Çý */
+	{ 0xc8a3, 0xfbba },  /* È£ */
+	{ 0xc8a4, 0xfbe3 },  /* È¤ */
+	{ 0xc8a5, 0xfbe6 },  /* È¥ */
+	{ 0xc8a6, 0xfbec },  /* È¦ */
+	{ 0xc8ab, 0xfbef },  /* È« */
+	{ 0xc8ad, 0xfbf9 },  /* È­ */
+	{ 0xc8ae, 0xfca9 },  /* È® */
+	{ 0xc8af, 0xfcaf },  /* È¯ */
+	{ 0xc8b0, 0xfcc0 },  /* È° */
+	{ 0xc8b2, 0xfcc5 },  /* È² */
+	{ 0xc8b8, 0xfcdd },  /* È¸ */
+	{ 0xc8b9, 0xfcf1 },  /* È¹ */
+	{ 0xc8be, 0xfcf3 },  /* È¾ */
+	{ 0xc8bf, 0xfcf6 },  /* È¿ */
+	{ 0xc8c4, 0xfda5 },  /* ÈÄ */
+	{ 0xc8c6, 0xfdb2 },  /* ÈÆ */
+	{ 0xc8cb, 0xfdbc },  /* ÈË */
+	{ 0xc8cd, 0xfdbd },  /* ÈÍ */
+	{ 0xc8d1, 0xfdc1 },  /* ÈÑ */
+	{ 0xc8d6, 0xfdc4 },  /* ÈÖ */
+	{ 0xc8de, 0xfdcc },  /* ÈÞ */
+	{ 0xc8e1, 0xfdd1 },  /* Èá */
+	{ 0xc8e4, 0xfdd4 },  /* Èä */
+	{ 0xc8e6, 0xfdd9 },  /* Èæ */
+	{ 0xc8e7, 0xfdda },  /* Èç */
+	{ 0xc8ea, 0xfdde },  /* Èê */
+	{ 0xc8ec, 0xfde2 },  /* Èì */
+	{ 0xc8ed, 0xfde5 },  /* Èí */
+	{ 0xc8ef, 0xfde9 },  /* Èï */
+	{ 0xc8f1, 0xfdea },  /* Èñ */
+	{ 0xc8fa, 0xfdfe },  /* Èú */
+	{ 0xffff, 0xfdff },   /* ¸¶Áö¸· °¡»óÄÚµå */
+
+	/* Æ¯¼ö¹®ÀÚ Å×ÀÌºí --- ¤¡ ¿¡¼­ ¤¼±îÁöÀÇ ÄÚµå·Î ¸ÅÇÎ */
+
+	{ 0xa4a1, 0xa1a2 },       	/* ¤¡  ¼öÇÐ±âÈ£ */
+	{ 0xffff, 0xa1ff },		
+	{ 0xa4a4, 0xa2a1 },		/* ¤¤  ±âÈ£¹®ÀÚ */
+	{ 0xffff, 0xa2e6 },		
+	{ 0xa4a7, 0xa3a1 },		/* ¤§  Àü°¢¹®ÀÚ */
+	{ 0xffff, 0xa3ff },		
+	{ 0xa4a9, 0xa4a1 },		/* ¤©  ÇÑ±Û¹®ÀÚ */
+	{ 0xffff, 0xa4ff },		
+	{ 0xa4b1, 0xa5a1 },		/* ¤±  ¼öÇÐ¹®ÀÚ */
+	{ 0xffff, 0xa5f9 },		
+	{ 0xa4b2, 0xa6a1 },		/* ¤²  ¹Ú½º¹®ÀÚ */
+	{ 0xffff, 0xa6e5 },		
+	{ 0xa4b5, 0xa7a1 },		/* ¤µ  ´ÜÀ§¹®ÀÚ */
+	{ 0xffff, 0xa7f0 },		
+	{ 0xa4b7, 0xa8a1 },		/* ¤·  ¿ø¹®ÀÚ   */
+	{ 0xffff, 0xa8ff },		
+	{ 0xa4b8, 0xa9a1 },		/* ¤¸  °ýÈ£¹®ÀÚ */
+	{ 0xffff, 0xa9ff },		
+	{ 0xa4ba, 0xaaa1 },		/* ¤º  È÷¶ó°¡³ª */
+	{ 0xffff, 0xaaf4 },		
+	{ 0xa4bb, 0xaba1 },		/* ¤»  Ä«Å¸Ä«³ª */
+	{ 0xffff, 0xabf7 },		
+	{ 0xa4bc, 0xaca1 },		/* ¤¼  ¼Ò·Ã¹®ÀÚ */
+	{ 0xffff, 0xacf2 }		
+};
+
+
+/*
+   ÀÔ·Â : ÇÑ±Û ÄÚµå (int han_code)
+   Ãâ·Â : ÇÑÀÚ Å×ÀÌºí (int hanja_code_table[] : ¸ÅÄªµÇ´Â ÇÑÀÚµé.)
+   ¸®ÅÏ°ª : ¸ÅÄªµÈ ¼ö.
+ */
+int hanja_mode = 0;
+
+int 
+get_hanja_codes(unsigned int han_code,
+	        unsigned int hanja_code_table[])
+{
+    unsigned int j;
+    int i, k, count;
+
+    for (i = 0; i < MAX_HANJA_TABLE; i++) {
+	if (han_code == hanja_table[i][0]) {
+	    count = hanja_table[i + 1][1] - hanja_table[i][1];
+	    if (count > 0x80) {	/* gap exist */
+		count -= 0xa2;
+	    }
+	    for (j = hanja_table[i][1], k = 0; k < count; j++, k++) {
+		if ((j & 0x00ff) > 0xfe)
+		    j += 0xa2;
+		hanja_code_table[k] = j;
+	    }
+	    return count;
+	}
+    }
+    return 0;
+}
+
+#define MAXHANJABUF 200
+
+static int hanja_sx, hanja_count, hanja_max_item, hanja_max_disp;
+
+static unsigned int hanja_codes[MAXHANJABUF];
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/hanja.h unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/hanja.h
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/hanja.h	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/hanja.h	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1 @@
+int get_hanja_codes(unsigned int han_code, unsigned int hanja_code_table[]);
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/hinput.c unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/hinput.c
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/hinput.c	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/hinput.c	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,389 @@
+/*
+ * Korean input method implimentation.
+ * written by ByoungLae Kim <pos7hink@okpos.com>
+ */
+
+/* Imm Standard Interfaces */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ImmModule.h>
+#include "automata.h"
+#include "hanja.h"
+
+static void SetPhraseBuffer(PhraseItem *p, char *buf, int buflen) {
+  char *p1 = buf;
+
+  p->szKeys = p1;
+  p1 += 32;
+
+  p->KeyLen = (u_char *) p1;
+  p1 += sizeof (*p->KeyLen);
+
+  p->frequency = (freq_t *) p1;
+  p1 += sizeof (freq_t);
+
+  p->szPhrase = p1;
+}
+
+enum { DUBULSIK = 2, SEBULSIK = 3, DVORAK_DUBULSIK = 4,
+       SEBULSIK_FINAL = 5, SEBULSIK_390 = 6,
+       DVORAK_SEBULSIK_FINAL = 7, DVORAK_SEBULSIK_390 = 8 };
+
+static int get_keyboard_layout(int type) {
+    int kb = type;
+    char* keyboard = getenv("HANGUL_KEYBOARD_TYPE");
+
+    if(keyboard != NULL) {
+	if(strcmp(keyboard, "390") == 0)
+	    kb = SEBULSIK_390;
+	else if(strcmp(keyboard, "3FINAL") == 0)
+	    kb = SEBULSIK_FINAL;
+	else if(strcmp(keyboard, "390D") == 0)
+	    kb = DVORAK_SEBULSIK_390;
+	else if(strcmp(keyboard, "3FINALD") == 0)
+	    kb = DVORAK_SEBULSIK_FINAL;
+	else if(strcmp(keyboard, "2D") == 0)
+	    kb = DVORAK_DUBULSIK;
+	else
+	    kb = DUBULSIK;
+    }
+
+    switch(kb) {
+	case DUBULSIK :
+	    set_keyboard_file(2, "dubulsik");
+	    return DUBULSIK;
+	case DVORAK_DUBULSIK :
+	    set_keyboard_file(2, "dvorak_dubulsik");
+	    return DUBULSIK;
+	case SEBULSIK_390 :
+	    set_keyboard_file(3, "sebulsik_390");
+	    return SEBULSIK;
+	case SEBULSIK_FINAL :
+	    set_keyboard_file(3, "sebulsik_final");
+	    return SEBULSIK;
+	case DVORAK_SEBULSIK_390 :
+	    set_keyboard_file(3, "dvorak_sebulsik_390");
+	    return SEBULSIK;
+	case DVORAK_SEBULSIK_FINAL :
+	    set_keyboard_file(3, "dvorak_sebulsik_final");
+	    return SEBULSIK;
+	default :
+	    set_keyboard_file(2, "dubulsik");
+	    return DUBULSIK;
+    }
+}
+
+static IMM_CLIENT *IMM_open(char *szFileName, long type) {
+  IMM_CLIENT *q;
+
+  q = (IMM_CLIENT *) malloc (sizeof (IMM_CLIENT));
+  if(q == NULL)
+    return NULL;
+  hangul_automata_init();
+  hangul_set_keyboard(get_keyboard_layout(type));
+  q->pImmClientData = (void *) malloc(sizeof(char));
+  SetPhraseBuffer(&q->m, q->buf, sizeof (q->buf));
+  return q;
+}
+
+static int IMM_save(IMM_CLIENT *p, char *szFileName) {
+  return 1;
+}
+
+static int IMM_close(IMM_CLIENT *p) {
+  free(p->pImmClientData);
+  free(p);
+  return 1;
+}
+
+/* ime composition status */
+#define IME_MAX 80
+#define SYMBOL_SIZE 12
+
+static char ime[IME_MAX];
+static unsigned int hanjas[200];
+static int hanja_i = 0;
+static int hanja_mode = 0, hanja_total;
+static int symbol_mode = 0;
+static int symbol_i = 0;
+static int symbol = 0;
+static int symbol_table[] = {
+  0xa1a0, // ¼öÇÐ±âÈ£
+  0xa2a0, // ±âÈ£¹®ÀÚ
+  0xa3a0, // ¿µ¹®Àü°¢
+  0xa4a0, // ÇÑ±ÛÀÚ¸ð
+  0xa5a0, // ¼öÇÐ¹®ÀÚ
+  0xa6a0, // ±¥¼±¹®ÀÚ
+  0xa7a0, // ´ÜÀ§¹®ÀÚ
+  0xa8a0, // ¿ø¹®ÀÚ
+  0xa9a0, // °ýÈ£¹®ÀÚ
+  0xaaa0, // È÷¶ó°¡³ª
+  0xaba0, // °¡Å¸Ä«³ª
+  0xaca0 // ·¯½Ã¾Æ¾î
+};
+
+static char* symbol_table_name[] = {
+  "¼öÇÐ", "±âÈ£", "¿µ¹®", "ÇÑ±Û", "±×¸®½º", "±¥¼±",
+  "´ÜÀ§", "¿ø", "°ýÈ£", "ÀÏº»1", "ÀÏº»2", "·¯½Ã¾Æ"
+};
+
+void clean(char* array, int size) {
+  int i;
+  for(i = 0; i < size; i++) array[i] = ' '; array[size] = 0;
+}
+
+/* Indepent Modules support */
+int IMM_KeyFilter(IMM_CLIENT *p, u_char key, char *buf, int *len) {
+
+  if(key == 254) { // shift space
+    *len = hangul_automata(-2, buf);
+    ime[0] = '\0';
+    hanja_mode = 0;
+    symbol_mode = 0;
+  }
+  else if(key == 253) { // ctrl + , : hanja mode
+    unsigned int han_code;
+    unsigned char* hangul;
+    unsigned char chars[64];
+    int i;
+
+    *len = hangul_automata(-2, buf);
+    hangul = buf;
+
+    han_code = (hangul[0] << 8) + hangul[1];
+    hanja_total = get_hanja_codes(han_code, hanjas);
+    if(hanja_total == 0) {
+      sprintf(ime, "'%s'¿¡ ÇØ´çÇÏ´Â ÇÑÀÚ°¡ ¾ø½À´Ï´Ù.", buf);
+      return -1;
+    }
+
+    clean(chars, 64);
+    for(i = 0; i < hanja_total && i < 10; i++) {
+	chars[i * 4 + 1] = '0' + i;
+	chars[i * 4 + 2] = hanjas[i] >> 8;
+	chars[i * 4 + 3] = hanjas[i] & 0xff;
+	chars[i * 4 + 4] = ' ';
+    }
+    if(hanja_total > 10) chars[i * 4 + 1] = '>';
+
+    sprintf(ime, "%s [%2d/%2d] %s", buf, hanja_i, hanja_total, chars);
+
+    hanja_i = 0;
+    hanja_mode = 1;
+
+    return -1;
+  }
+  else if(key == 252) { // alt + space : simbol mode
+    clean(ime, IME_MAX);
+    sprintf(ime, "0%s 1%s 2%s 3%s 4%s 5%s 6%s 7%s 8%s 9%s -%s +%s",
+	    symbol_table_name[0], symbol_table_name[1], symbol_table_name[2],
+	    symbol_table_name[3], symbol_table_name[4], symbol_table_name[5],
+	    symbol_table_name[6], symbol_table_name[7], symbol_table_name[8],
+	    symbol_table_name[9], symbol_table_name[10], symbol_table_name[11]);
+
+    symbol_mode = 1;
+    *len = hangul_automata(-2, buf);
+    return -1;
+  }
+  else {
+    int i;
+    unsigned char chars[64];
+    if(hanja_mode == 1) {
+      switch(key) {
+	case '.' :
+	case ',' :
+	case '>' :
+	case '<' :
+	  if(key == ',') key = '<';
+	  if(key == '.') key = '>';
+	  if(key == '>' && hanja_i + 10 < hanja_total) hanja_i += 10;
+	  if(key == '<' && hanja_i - 10 >= 0) hanja_i -= 10;
+
+	  clean(ime, IME_MAX);
+	  clean(chars, 64);
+	  if(hanja_i >= 10) chars[0] = '<';
+	  for(i = 0; i < hanja_total - hanja_i && i < 10; i++) {
+	    chars[i * 4 + 1] = '0' + i;
+	    chars[i * 4 + 2] = hanjas[hanja_i + i] >> 8;
+	    chars[i * 4 + 3] = hanjas[hanja_i + i] & 0xff;
+	    chars[i * 4 + 4] = ' ';
+	  }
+	  if(hanja_total - hanja_i > 10) chars[i * 4 + 1] = '>';
+
+	  sprintf(ime, "[%2d/%2d] %s", hanja_i, hanja_total, chars);
+	  break;
+	case '0' :
+	case '1' :
+	case '2' :
+	case '3' :
+	case '4' :
+	case '5' :
+	case '6' :
+	case '7' :
+	case '8' :
+	case '9' :
+	  buf[0] = hanjas[hanja_i + key - '0'] >> 8;
+	  buf[1] = hanjas[hanja_i + key - '0'] & 0xff;
+	  *len = 2;
+	  clean(ime, IME_MAX);
+	  hanja_mode = 0;
+	  return 2;
+	default :
+	  clean(ime, IME_MAX);
+	  hanja_mode = 0;
+	  return -1;
+      }
+      return -1;
+    }
+    else if(symbol_mode == 1) {
+      int i;
+      unsigned char symbols[80];
+      hangul_automata(-1, buf); // change to english mode.
+      switch(key) {
+	case '0' :
+	case '1' :
+	case '2' :
+	case '3' :
+	case '4' :
+	case '5' :
+	case '6' :
+	case '7' :
+	case '8' :
+	case '9' :
+	  symbol = key - '0';
+	  symbol_i = 0;
+	  break;
+	case '-' :
+	case '_' :
+	  symbol = 10;
+	  symbol_i = 0;
+	  break;
+	case '+' :
+	case '=' :
+	  symbol = 11;
+	  symbol_i = 0;
+	  break;
+	case '.' :
+	case '>' :
+	  if(symbol_i + 0x10 < 0x60) symbol_i += 0x10;
+	  break;
+	case '<' :
+	case ',' :
+	  if(symbol_i - 0x10 >= 0) symbol_i -= 0x10;
+	  break;
+	case 'a' :
+	case 'b' :
+	case 'c' :
+	case 'd' :
+	case 'e' :
+	case 'f' :
+	case 'g' :
+	case 'h' :
+	case 'i' :
+	case 'j' :
+	case 'k' :
+	case 'l' :
+	case 'm' :
+	case 'n' :
+	case 'o' :
+          hangul_automata(-1, buf); // restore to korean input method.
+	  buf[0] = (symbol_table[symbol] + symbol_i + key - 'a') >> 8;
+	  buf[1] = (symbol_table[symbol] + symbol_i + key - 'a') & 0xff;
+	  *len = 2;
+	  return 2;
+	default :
+          hangul_automata(-1, buf); // restore to korean input method.
+	  symbol_mode = 0;
+	  return -1;
+      }
+      clean(ime, IME_MAX);
+      clean(symbols, 80);
+      if(symbol_i > 0) symbols[0] = '<';
+      for(i = 0; i < 0x10; i++) {
+	symbols[i * 4 + 1] = 'a' + i;
+	symbols[i * 4 + 2] = (symbol_table[symbol] + symbol_i + i) >> 8;
+	symbols[i * 4 + 3] = (symbol_table[symbol] + symbol_i + i) & 0xff;
+	symbols[i * 4 + 4] = ' ';
+      }
+      if(symbol_i < 0x50) symbols[i * 4] = '>';
+      sprintf(ime, "%6s [%2d/%2d] %s", symbol_table_name[symbol], symbol_i, 16 * 6, symbols);
+      hangul_automata(-1, buf); // restore to korean input method.
+      return -1;
+    }
+    else {
+      clean(ime, IME_MAX);
+      *len = hangul_automata(key, buf);
+      get_ime_status(ime);
+    }
+  }
+
+  if(*len == 0) return -1;
+  return 2;
+}
+
+/* Input Area Configuration & Operation */
+static int IMM_ConfigInputArea(IMM_CLIENT *p, int SelectionLen) {
+  return 0;
+}
+
+static int IMM_GetInputDisplay(IMM_CLIENT *p, char *buf, long buflen) {
+  int i;
+  for(i = 0; ime[i] != '\0'; i++) buf[i] = ime[i];
+  buf[i] = '\0';
+  return 1;
+}
+
+static int IMM_GetSelectDisplay(IMM_CLIENT *p, char *buf, long buflen) {
+  buf[0] = '\0';
+  return 1;
+}
+
+int IMM_ResetInput(IMM_CLIENT *p) {
+  return 1;
+}
+
+PhraseItem * IMM_pGetItem(IMM_CLIENT *p, u_long n) {
+  return &p->m;
+}
+
+/* Phrase Operation */
+/*
+  static int IMM_AddPhrase(PhraseItem *p) {
+  return 1;
+  }
+
+  static int IMM_ModifyPhraseItem(PhraseItem *pOld, PhraseItem *pNew) {
+  return 1;
+  }
+*/
+
+static int IMM_Flush(IMM_CLIENT *p) {
+  return 0;
+}
+
+#ifdef  __cplusplus
+extern "C" 
+#endif
+struct ImmOperation ImmOp_Ptr = {
+  "Han", 
+  "Free Korean IMM Version 1.0",
+  "Author: ByoungLae Kim",
+  IMM_CCE | IMM_LC_KSC5601 << 24,
+  IMM_open,
+  IMM_save,
+  IMM_close,
+  /* Indepent Modules support */
+  IMM_KeyFilter,
+  IMM_ResetInput,
+
+  /* Input Area Configuration & Operation */
+  IMM_ConfigInputArea,
+  IMM_GetInputDisplay,
+  IMM_GetSelectDisplay,
+
+  IMM_pGetItem,
+  NULL,            // AddPhrase,
+  NULL,            // ModifyPhraseItem,
+  IMM_Flush,
+};
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/johabcode.h unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/johabcode.h
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/johabcode.h	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/johabcode.h	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,13 @@
+
+int johab_to_wansung(char *s, int johab);
+int johab_from_wansung(char *s, int wansung);
+
+int johab_to_johab(char *s, int johab);
+
+int johab_to_utf8(char *s, int johab);
+
+int johab_to_wansung_str(char *s, char *johab, int len);
+int johab_from_wansung_str(char *s, char *wansung, int len);
+
+void johab_to_3(int johab, int *cho, int *jung, int *jong);
+int johab_from_3(int cho, int jung, int jong);
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/johabcode2.c unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/johabcode2.c
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/johabcode2.c	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/johabcode2.c	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,179 @@
+/* This file is a part of Ami software, (C) Hwang chi-deok 2001 */
+
+/*
+
+ÀÏ¹Ý ¿Ï¼ºÇü ÇÑ±Û
+0xb0a1    => 0x8861
+...
+0xc8fe    => 0xd3b7
+
+ÀÚ¸ð
+0xa4a1    => 0x
+0xa4fe    => 0x
+
+Æ¯¼ö¹®ÀÚ
+0xa1a1    => 0xd931
+...
+0xacf1    => 0xdef1
+
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <iconv.h>
+
+#if defined(__sun__)
+#define CD_EUC_KR "ko_KR-euc"
+#define CD_JOHAB  "ko_KR-johap92"
+#define CD_UTF8   "ko_KR-UTF-8"
+#else
+#define CD_EUC_KR "EUC-KR"
+#define CD_JOHAB  "JOHAB"
+#define CD_UTF8   "UTF-8"
+#endif
+
+static iconv_t johab_to_wan_cd = (iconv_t) -1;
+static iconv_t wan_to_johab_cd = (iconv_t) -1;
+static iconv_t johab_to_utf8_cd = (iconv_t) -1;
+      
+int
+johab_to_wansung(char *s, int johab)
+{
+    int in_len, out_len;
+    char in[2];
+    char *in_p, *out_p;
+    if (johab < 128) {
+	*s = johab;
+	return 1;
+    }
+    if (johab_to_wan_cd == (iconv_t) -1) {
+	johab_to_wan_cd = iconv_open(CD_EUC_KR, CD_JOHAB);
+	if (johab_to_wan_cd == (iconv_t) -1) {
+	    perror("johab_to_wansung");
+	    exit(-1);
+	}
+    }
+    in_p = in; out_p = s;
+    in_len = 2; out_len = 2;
+    in[0] = (johab >> 8) | 0x80;
+    in[1] = johab & 0xff;
+    iconv(johab_to_wan_cd, &in_p, &in_len, &out_p, &out_len);
+
+    return 2 - out_len;
+}
+
+int
+johab_to_wansung_str(char *s, char *johab, int len)
+{
+    char *out_p = s;
+    char *in_p = johab;
+    int in_len = len;
+    int out_len = len;
+    if (johab_to_wan_cd == (iconv_t) -1) {
+	johab_to_wan_cd = iconv_open(CD_EUC_KR, CD_JOHAB);
+	if (johab_to_wan_cd == (iconv_t) -1) {
+	    perror("johab_to_wansung_str");
+	    exit(-1);
+	}
+    }
+    iconv(johab_to_wan_cd, &in_p, &in_len, &out_p, &out_len);
+    return len - in_len;
+}
+
+int
+johab_from_wansung(char *s, int wansung)
+{
+    int in_len, out_len;
+    char in[2];
+    char *in_p, *out_p;
+    if (wansung < 128) {
+	*s = wansung;
+	return 1;
+    }
+    if (wan_to_johab_cd == (iconv_t) -1) {
+	wan_to_johab_cd = iconv_open(CD_JOHAB, CD_EUC_KR);
+	if (wan_to_johab_cd == (iconv_t) -1) {
+	    perror("johab_from_wansung");
+	    exit(-1);
+	}
+    }
+    in_p = in; out_p = s;
+    in_len = 2; out_len = 2;
+    in[0] = (wansung >> 8) | 0x80;
+    in[1] = wansung & 0xff;
+    iconv(wan_to_johab_cd, &in_p, &in_len, &out_p, &out_len);
+    *out_p = 0;
+    return 2 - out_len;
+}
+
+int
+johab_from_wansung_str(char *s, char *wansung, int len)
+{
+    char *out_p = s;
+    char *in_p = wansung;
+    int in_len = len;
+    int out_len = len;
+    if (wan_to_johab_cd == (iconv_t) -1) {
+	wan_to_johab_cd = iconv_open(CD_JOHAB, CD_EUC_KR);
+	if (wan_to_johab_cd == (iconv_t) -1) {
+	    perror("johab_from_wansung_str");
+	    exit(-1);
+	}
+    }
+    iconv(wan_to_johab_cd, &in_p, &in_len, &out_p, &out_len);
+    *out_p = 0;
+    return len - in_len;
+}
+
+int
+johab_to_johab(char *s, int johab)
+{
+    if (johab < 128) {
+	*s = johab;
+	return 1;
+    }
+    *s++ = 0x80 | (johab >> 8);
+    *s = johab & 0xff;
+    return 2;
+}
+
+void 
+johab_to_3(int johab, int *cho, int *jung, int *jong)
+{
+    *cho = (johab >> 10) & 0x1f;
+    *jung = (johab >> 5) & 0x1f;
+    *jong = (johab) & 0x1f;
+}
+
+int
+johab_from_3(int cho, int jung, int jong)
+{
+    return 0x8000 | (cho << 10) | (jung << 5) | jong;
+}
+
+int
+johab_to_utf8(char *s, int johab)
+{
+    int in_len, out_len;
+    char in[2];
+    char *in_p, *out_p;
+    if (johab < 128) {
+	*s = johab;
+	return 1;
+    }
+    if (johab_to_utf8_cd == (iconv_t) -1) {
+	johab_to_utf8_cd = iconv_open(CD_UTF8, CD_JOHAB);
+	if (johab_to_utf8_cd == (iconv_t) -1) {
+	    perror("johab_to_utf8");
+	    exit(-1);
+	}
+    }
+    in_p = in; out_p = s;
+    in_len = 3; out_len = 2;
+    in[0] = (johab >> 8) | 0x80;
+    in[1] = johab & 0xff;
+    iconv(johab_to_utf8_cd, &in_p, &in_len, &out_p, &out_len);
+
+    return 3 - out_len;
+}
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dubulsik.kbd unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dubulsik.kbd
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dubulsik.kbd	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dubulsik.kbd	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,33 @@
+q	¤² 
+Q	¤³
+w	¤¸
+W	¤¹
+e	¤§
+E	¤¨
+r	¤¡
+R	¤¢
+t	¤µ
+T	¤¶
+y	¤Ë
+u	¤Å
+i	¤Á
+o	¤À
+O	¤Â
+p	¤Ä
+P	¤Æ
+a	¤±
+s	¤¤
+d	¤·
+f	¤©
+g	¤¾
+h	¤Ç
+j	¤Ã
+k	¤¿
+l	¤Ó
+z	¤»
+x	¤¼
+c	¤º
+v	¤½
+b	¤Ð
+n	¤Ì
+m	¤Ñ
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak.map unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak.map
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak.map	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak.map	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,66 @@
+" -> Q
+' -> q
++ -> }
+, -> w
+- -> '
+. -> e
+/ -> [
+: -> Z
+; -> z
+< -> W
+= -> ]
+> -> E
+? -> {
+B -> N
+C -> I
+D -> H
+E -> D
+F -> F
+G -> U
+H -> J
+I -> G
+J -> C
+K -> V
+L -> P
+N -> L
+O -> S
+P -> R
+Q -> X
+R -> O
+S -> :
+T -> K
+U -> F
+V -> >
+W -> <
+X -> B
+Y -> T
+Z -> ?
+[ -> -
+] -> =
+_ -> "
+b -> n
+c -> i
+d -> h
+e -> d
+f -> y
+g -> u
+h -> j
+i -> g
+j -> c
+k -> v
+l -> p
+n -> l
+o -> s
+p -> r
+q -> x
+r -> o
+s -> ;
+t -> k
+u -> f
+v -> .
+w -> ,
+x -> b
+y -> t
+z -> /
+{ -> _
+} -> +
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak_dubulsik.kbd unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak_dubulsik.kbd
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak_dubulsik.kbd	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak_dubulsik.kbd	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,4 @@
+
+usemap dvorak.map
+
+import dubulsik
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_390.kbd unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_390.kbd
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_390.kbd	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_390.kbd	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,4 @@
+
+usemap dvorak.map
+
+import sebulsik_390
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_final.kbd unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_final.kbd
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_final.kbd	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/dvorak_sebulsik_final.kbd	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,4 @@
+
+usemap dvorak.map
+
+import sebulsik_final
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/sebulsik_390.kbd unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/sebulsik_390.kbd
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/sebulsik_390.kbd	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/sebulsik_390.kbd	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,68 @@
+q	¤µ	jong
+Q	¤½	jong
+w	¤©	jong
+W	¤¼	jong
+e	¤Å 
+E	¤»	jong
+r	¤À
+R	¤Â
+t	¤Ã
+T	;
+y	¤©	cho
+Y	<
+u	¤§	cho
+U	7
+i	¤±	cho
+I	8
+o	¤º	cho
+O	9
+p	¤½	cho
+P	>
+a	¤·	jong
+A	¤§	jong
+s	¤¤	jong
+S	¤¤¤¾	jong
+d	¤Ó
+D	¤©¤¡	jong
+f	¤¿
+F	¤¢
+g	¤Ñ
+G	/
+h 	¤¤ 	cho
+H	'
+j 	¤·	cho
+J	4
+k 	¤¡	cho
+K	5
+l 	¤¸	cho
+L	6
+z 	¤±	jong
+Z	¤º	jong
+x 	¤¡	jong
+X	¤²¤µ	jong
+c	¤Ä
+C	¤©¤±	jong
+v	¤Ç
+V	¤©¤¾	jong
+b	¤Ì
+B	!
+n	¤µ	cho
+N	0
+m	¤¾	cho
+M	1
+<	2
+>	3
+/	¤Ç
+;	¤²	cho
+'	¤¼	cho
+1	¤¾	jong
+2	¤¶	jong
+3	¤²	jong
+4	¤Ë
+5	¤Ð
+6	¤Á
+7	¤Æ
+8	¤Ò
+9	¤Ì
+0	¤»	cho
+!	¤¸	jong
diff -urN unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/sebulsik_final.kbd unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/sebulsik_final.kbd
--- unicon-3.0.4-20010924.orig/unicon/ImmModules/kscm/keyboard/sebulsik_final.kbd	1970-01-01 09:00:00.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/ImmModules/kscm/keyboard/sebulsik_final.kbd	2003-11-22 10:40:02.000000000 +0900
@@ -0,0 +1,48 @@
+
+import sebulsik_390
+
+M	"
+<	,
+>	.
+,	,
+.	.
+/	¤Ç
+?	!
+
+H	0
+J	1
+K	2
+L	3
+:	4
+"	¡¤
+
+E	¤¤¤¸	jong
+R	¤©¤¾	jong
+T	¤©¤µ	jong
+Y	5
+U	6
+I	7
+O	8
+P	9
+[	(
+{	%
+]	<
+}	/
+
+~	¡Ø
+`	*
+!	¤¢	jong
+@	¤©¤¡	jong
+#	¤¸	jong
+$	¤©¤½	jong
+%	¤©¤¼	jong
+^	=
+&	¡°
+*	¡±
+(	'
+)	~
+-	)
+_	;
+=	>
+\	:
+|	\
diff -urN unicon-3.0.4-20010924.orig/unicon/Makefile.in unicon-3.0.4-20010924-userland-vdc/unicon/Makefile.in
--- unicon-3.0.4-20010924.orig/unicon/Makefile.in	2001-08-08 23:32:33.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/Makefile.in	2003-11-22 10:40:02.000000000 +0900
@@ -6,6 +6,7 @@
 	cd ImmModules/cce && make
 	cd ImmModules/cxterm && make
 	cd ImmModules/turbo && make
+	cd ImmModules/kscm && make
 ccedata:
 	cd ImmModules/cce/inputs && make
 gbdata:
@@ -30,6 +31,7 @@
 	cd unicon; make install
 	cd ImmModules/cce; make install
 	cd ImmModules/cxterm; make install
+	cd ImmModules/kscm; make install
 	cd ImmModules/turbo; make install
 
 clean:
@@ -41,6 +43,7 @@
 	cd ImmModules/cxterm; make clean
 	cd ImmModules/cxterm/dict; make clean
 	cd ImmModules/cxterm/utils; make clean
+	cd ImmModules/kscm; make clean
 	cd ImmModules/turbo; make clean
 	rm -f *.bak core a.out *~ 
 
@@ -52,5 +55,6 @@
 	cd ImmModules/cce; make distclean
 	cd ImmModules/cce/inputs; make distclean
 	cd ImmModules/cxterm; make distclean
+	cd ImmModules/kscm; make distclean
 	cd ImmModules/turbo; make distclean
 
diff -urN unicon-3.0.4-20010924.orig/unicon/server/TLS_Debug.cpp unicon-3.0.4-20010924-userland-vdc/unicon/server/TLS_Debug.cpp
--- unicon-3.0.4-20010924.orig/unicon/server/TLS_Debug.cpp	2001-08-08 23:32:39.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/server/TLS_Debug.cpp	2003-11-22 10:45:03.000000000 +0900
@@ -30,10 +30,11 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <assert.h>
 #include <string.h>
 #include <TLS_Debug.hpp>
-TLS_CDebug::TLS_CDebug (char *szFileName, int mode = 0)
+TLS_CDebug::TLS_CDebug (char *szFileName, int mode)
 {
     if (szFileName == NULL)
     {
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/AImmHzInput.cpp unicon-3.0.4-20010924-userland-vdc/unicon/unicon/AImmHzInput.cpp
--- unicon-3.0.4-20010924.orig/unicon/unicon/AImmHzInput.cpp	2001-08-08 23:32:39.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/AImmHzInput.cpp	2003-11-22 10:40:02.000000000 +0900
@@ -201,10 +201,8 @@
 
 void CAImmHzInput::DoFlush ()
 {
-/*
     if (pImm != NULL) 
         IMM_FlushUserPhrase (pImm); 
- */
 }
 
 int CAImmHzInput::WriteUserDefinedPhrase (char *szPhrase, int len)
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/ConfigManager.hpp unicon-3.0.4-20010924-userland-vdc/unicon/unicon/ConfigManager.hpp
--- unicon-3.0.4-20010924.orig/unicon/unicon/ConfigManager.hpp	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/ConfigManager.hpp	2003-11-22 10:40:38.000000000 +0900
@@ -28,7 +28,7 @@
 
 #include "MyConfig.hpp"
 
-#define  MAX_CODE             5
+#define  MAX_CODE             7
 #define  MAX_TTY              6
 
 /* font_type */
@@ -37,6 +37,8 @@
 #define XL_DB_JIS      2
 #define XL_DB_KSCM     3
 #define XL_DB_GBK      4
+#define XL_DB_EUCJP    5
+#define XL_DB_SJIS     6
 
 class CConfigManager
 {
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/ImmHzInput.cpp unicon-3.0.4-20010924-userland-vdc/unicon/unicon/ImmHzInput.cpp
--- unicon-3.0.4-20010924.orig/unicon/unicon/ImmHzInput.cpp	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/ImmHzInput.cpp	2003-11-22 10:40:38.000000000 +0900
@@ -42,6 +42,10 @@
 }
 
 #include <MyConfig.hpp>
+enum { DUBULSIK = 2, SEBULSIK = 3, DVORAK_DUBULSIK = 4,
+       SEBULSIK_FINAL = 5, SEBULSIK_390 = 6,
+       DVORAK_SEBULSIK_FINAL = 7, DVORAK_SEBULSIK_390 = 8 };
+
 int CImmHzInput::DoSelectMethod (int method)
 {
     assert (method >= 0 && method < 10); //Rat:Ö»ÓÐ0-9¸öÑ¡Ôñ¼ü
@@ -49,8 +53,20 @@
 //Rat:È¡µÃµ±Ç°TTYµÄÊäÈë·¨
     if (p->szImmModule != NULL)
     {
+	int type;
+	if(pMyConfig->GetTtyCoding(nTty - 1) == XL_DB_KSCM) {
+	    if(strcmp(p->szMethodName, "390") == 0) type = SEBULSIK_390;
+	    else if(strcmp(p->szMethodName, "3FINAL") == 0) type = SEBULSIK_FINAL;
+	    else if(strcmp(p->szMethodName, "390D") == 0) type = DVORAK_SEBULSIK_390;
+	    else if(strcmp(p->szMethodName, "3FINALD") == 0) type = DVORAK_SEBULSIK_FINAL;
+	    else if(strcmp(p->szMethodName, "2D") == 0) type = DVORAK_DUBULSIK;
+	    else type = DUBULSIK;
+	}
+	else
+	    type = p->type;
+
         int b = OpenInputMethod (p->szImmModule, p->szImmTable, 
-                                 p->type, p->szMethodName);
+                                 type, p->szMethodName);
         if (b == 0)
             return 0;
         if (!IsHanziInput)
@@ -209,6 +225,12 @@
         case XL_DB_GBK:
             ResetCoding (Tty, XL_DB_GBK);
             break;
+        case XL_DB_EUCJP:
+            ResetCoding (Tty, XL_DB_EUCJP);
+            break;
+        case XL_DB_SJIS:
+            ResetCoding (Tty, XL_DB_SJIS);
+            break;
     }
 }
 
@@ -237,6 +259,12 @@
         case '5':     // GBK 
             DoSwitchLang (nTty, XL_DB_GBK);
             break;
+        case '6':     // EUCJP
+            DoSwitchLang (nTty, XL_DB_EUCJP);
+            break;
+        case '7':     // SJIS
+            DoSwitchLang (nTty, XL_DB_SJIS);
+            break;
         default:
             nDone = 0;
             break;
@@ -286,8 +314,16 @@
             DoSelectMethod (key - CTRL_ALT_0);
             break;
         case SHIFT_TAB: //Need inpbuf has some codes
+	case CTRL_F3:
+	    if(pMyConfig->GetTtyCoding(nTty - 1) == XL_DB_KSCM) {
+		int len;
+		char buf[32];
+		if(IsHanziInput != 1) ToggleInputMethod();
+		KeyFilter(252, buf, &len);
+	    }
+	    break;
 	case CTRL_PLUS:
-            ToggleUserDefinePhrase ();
+	    ToggleUserDefinePhrase ();
             break;
         case CTRL_F5:
             IsSysMenu = 1;
@@ -295,7 +331,8 @@
             pCMyInputArea->ShowSysMenu ();
             break;
         case CTRL_SPACE:
-            ToggleInputMethod(); //ShowHideInputMethod(int flag)
+	    if(pMyConfig->GetTtyCoding(nTty - 1) != XL_DB_KSCM)
+                ToggleInputMethod(); //ShowHideInputMethod(int flag)
             break;
 	case CTRL_ALT_G:
             DoSwitchLang (nTty, XL_DB_GBK);
@@ -325,8 +362,24 @@
 */
 
         case SHIFT_SPACE:
+	    if(pMyConfig->GetTtyCoding(nTty - 1) == XL_DB_KSCM) {
+		int len;
+		char buf[32];
+		KeyFilter(254, buf, &len);
+                pCMyKey->WriteKeys(nTty, buf, len);
+		ToggleInputMethod();
+	    }
+	    else
+		ToggleHalfFull();
+	    break;
 	case CTRL_COMMA:
-            ToggleHalfFull();
+	    if(pMyConfig->GetTtyCoding(nTty - 1) == XL_DB_KSCM) {
+		int len;
+		char buf[32];
+		KeyFilter(253, buf, &len);
+	    }
+	    else
+                ToggleHalfFull();
             break;
         case ALT_SPACE:
             if (IsHanziInput == 1)
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/Main.cpp unicon-3.0.4-20010924-userland-vdc/unicon/unicon/Main.cpp
--- unicon-3.0.4-20010924.orig/unicon/unicon/Main.cpp	2001-09-09 00:38:55.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/Main.cpp	2003-11-22 10:40:38.000000000 +0900
@@ -209,7 +209,7 @@
     int LocaleCode = XL_DB_GB, resize = -1;
     if (argc < 2)
     {
-        printf ("Usage: %s <--gb | --gbk | --big5 | --jis | --kscm>  [--resize num] \n", argv[0]);
+        printf ("Usage: %s <--gb | --gbk | --big5 | --jis | --kscm | --eucjp | --sjis>  [--resize num] \n", argv[0]);
         exit (-1);
     }
     if (strcmp (argv[1], "--gb") == 0)
@@ -237,6 +237,16 @@
         LocaleCode = XL_DB_KSCM;
 	setlocale(LC_CTYPE, "ko_KR");
     }
+    else if (strcmp (argv[1], "--eucjp") == 0)
+    {
+	LocaleCode = XL_DB_EUCJP;
+	setlocale(LC_CTYPE, "ja_JP.eucJP");
+    }
+    else if (strcmp (argv[1], "--sjis") == 0)
+    {
+	LocaleCode = XL_DB_SJIS;
+	setlocale(LC_CTYPE, "ja_JP.sjis");
+    }
     else {
         printf ("bad parameter.....\n");
         exit (-1);
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/Makefile.in unicon-3.0.4-20010924-userland-vdc/unicon/unicon/Makefile.in
--- unicon-3.0.4-20010924.orig/unicon/unicon/Makefile.in	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/Makefile.in	2003-11-22 10:45:24.000000000 +0900
@@ -39,10 +39,10 @@
 
 install: all
 	mkdir -p $(prefix)/bin $(prefix)/lib/unicon
-	install -o root -g root -m755 unicon $(prefix)/bin
-	install -o root -g root -m644 unicon.ini $(prefix)/lib/unicon
-	install -o root -g root -m644 sys-gb.tab $(prefix)/lib/unicon
-	install -o root -g root -m644 sys-big5.tab $(prefix)/lib/unicon
+	install -m755 unicon $(prefix)/bin
+	install -m644 unicon.ini $(prefix)/lib/unicon
+	install -m644 sys-gb.tab $(prefix)/lib/unicon
+	install -m644 sys-big5.tab $(prefix)/lib/unicon
 
 clean:
 	rm -f *.o core *.bak a.out unicon.ini *~ $(PROG) 
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/MyConfig.cpp unicon-3.0.4-20010924-userland-vdc/unicon/unicon/MyConfig.cpp
--- unicon-3.0.4-20010924.orig/unicon/unicon/MyConfig.cpp	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/MyConfig.cpp	2003-11-22 10:40:38.000000000 +0900
@@ -131,6 +131,10 @@
         return IMM_LC_GBK;
     else if (strcasecmp (szLanguageCode, "gb18030") == 0)
         return IMM_LC_GB18030;
+    else if (strcasecmp (szLanguageCode, "eucjp") == 0)
+	return IMM_LC_JISX0208;
+    else if (strcasecmp (szLanguageCode, "sjis") == 0)
+	return IMM_LC_JISX0208;
     else
     {
         printf ("Wrong Language Code = %s\n", szLanguageCode);
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/SysConfig.cpp unicon-3.0.4-20010924-userland-vdc/unicon/unicon/SysConfig.cpp
--- unicon-3.0.4-20010924.orig/unicon/unicon/SysConfig.cpp	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/SysConfig.cpp	2003-11-22 10:45:03.000000000 +0900
@@ -28,8 +28,11 @@
 #include <stdio.h>
 #include <iostream.h>
 #include <fstream.h>
+#include <string.h>
 #include <SysConfig.hpp>
 
+using namespace std;
+
 /* CSysConfigGroup Implementation */
 
 CSysConfigGroup::CSysConfigGroup (const char *szGroupName0)
@@ -114,14 +117,17 @@
 
 ifstream & operator >> (ifstream &a, CSysConfigGroup &b)
 {
-   char *p, szTemp[128];
+   const char *p;
+   char szTemp[128];
    char szItemName[128], szValue[128];
    int i;
-   char *buf;
+   string tmp;
+   const char *buf;
    /* read the name */
    do
    {
-       a.gets (&buf);
+     a >> tmp;
+     buf = tmp.data();
    }
    while (buf != NULL && buf[0] == '\0');
 
@@ -137,7 +143,8 @@
 
    do
    {
-       a.gets (&buf);
+     a >> tmp;
+     buf = tmp.data();
 
        if (buf == NULL)
            break;
diff -urN unicon-3.0.4-20010924.orig/unicon/unicon/unicon.ini.in unicon-3.0.4-20010924-userland-vdc/unicon/unicon/unicon.ini.in
--- unicon-3.0.4-20010924.orig/unicon/unicon/unicon.ini.in	2001-08-08 23:32:40.000000000 +0900
+++ unicon-3.0.4-20010924-userland-vdc/unicon/unicon/unicon.ini.in	2003-11-22 10:40:02.000000000 +0900
@@ -178,20 +178,37 @@
 MethodTable1=
 
 [KSCM]
-FullSymbolLeftMark= [
-FullSymbolRightMark= ]
-SingleSymbolLeftMark= [
-SingleSymbolRightMark= ]
-FullChar=FChar
-SingleChar=SChar
-FullSymbol=Full
-SingleSymbol=Half
-VersionInfo=Unicon Korean Enivronment 3.0.4
+FullChar=Àü°¢
+SingleChar=¹Ý°¢
+FullSymbol=Àü°¢½Éº¼
+SingleSymbol=¹Ý°¢½Éº¼
+VersionInfo=Unicon ÇÑ±Û ÀÔ/Ãâ·Â ÄÜ¼Ö 3.0.4 ¹öÀü
 LanguageCode=KSCM
-FirstMessage=<Unicon Korean 3.0.4> KSCM
-TotalHelp=1
-Help1=Not Aavailable yet.
-SysMenu=SysMenu: 1.GB 2.Big5 3.JIS 4.KSCM 5.GBK  0.Exit  ESC.Return
-TotalMethod=0
-MethodModule1=
+FirstMessage=[À¯´ÏÄÜ ÇÑ±ÛÄÜ¼Ö] | ÇÑ/¿µ ÀüÈ¯ : Shift + SPACE | ÀÚÆÇ º¯°æ : Alt + Ctrl + 0~9
+TotalHelp=3
+Help1=ÀÌ ÇÁ·Î±×·¥Àº ±èº´·¡<pos7hink@okpos.com> ´Ô²²¼­ ¼ö°íÇØ ÁÖ¼Ì½À´Ï´Ù.
+Help2=ÇÑ±Û/¿µ¹® ÀüÈ¯Àº ¿ÞÂÊ Shift + SPACE ÀÔ´Ï´Ù.
+Help3=ÀÚÆÇ º¯°æÀº Ctrl + Alt + 0 ~ 9·Î ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
+SysMenu=SysMenu: 1.Áß±¹¾î(GBK) 2.Áß±¹¾î(Big5) 3.ÀÏº»¾î(SJIS) 4.ÇÑ±Û 0.³ª°¡±â ESC.¸Þ´º³ª°¡±â
+TotalMethod=7
+MethodModule1=@PREFIX@/lib/unicon/modules/kscm/hinput.so
 MethodTable1=
+MethodName1=2
+MethodModule2=@PREFIX@/lib/unicon/modules/kscm/hinput.so
+MethodTable2=
+MethodName2=2D
+MethodModule3=@PREFIX@/lib/unicon/modules/kscm/hinput.so
+MethodTable3=
+MethodName3=2
+MethodModule4=@PREFIX@/lib/unicon/modules/kscm/hinput.so
+MethodTable4=
+MethodName4=3FINAL
+MethodModule5=@PREFIX@/lib/unicon/modules/kscm/hinput.so
+MethodTable5=
+MethodName5=390
+MethodModule6=@PREFIX@/lib/unicon/modules/kscm/hinput.so
+MethodTable6=
+MethodName6=390D
+MethodModule7=@PREFIX@/lib/unicon/modules/kscm/hinput.so
+MethodTable7=
+MethodName7=3FINALD
