Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/tkdvi/configure.in,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- configure.in	1999/06/10 12:36:50	1.1.1.1
+++ configure.in	1999/06/10 17:05:15	1.3
@@ -1,4 +1,6 @@
+dnl Configure.in script for TkDVI.
 dnl Process this file with autoconf to produce a configure script.
+dnl $Id: configure.in,v 1.3 1999/06/10 17:05:15 lingnau Exp $
 AC_INIT(dvi/dviInt.h)
 AM_INIT_AUTOMAKE(tkdvi, 0.1)
 
@@ -114,17 +116,25 @@
 AC_MSG_RESULT(Using kpathsea library in $kpathsea_libdir)
 AC_SUBST(kpathsea_libdir)
 
+kpathsea_includedir=/usr/include
+AC_ARG_WITH(kpathseainc,
+  [  --with-kpathseainc=DIR  'kpathsea/proginit.h' is in DIR],
+  kpathsea_includedir=$withval)
 AC_MSG_CHECKING(for Kpathsea include files)
-if test -f /usr/include/kpathsea/proginit.h; then
-    kpathsea_includedir=/usr/include/kpathsea
+if test -f $kpathsea_includedir/kpathsea/proginit.h; then
+    true # all's well in the world
+elif test -f /usr/include/kpathsea/proginit.h; then
+    kpathsea_includedir=/usr/include
 elif test -f $kpathsea_libdir/../kpathsea/proginit.h; then
-    kpathsea_includedir=`cd $kpathsea_libdir/../kpathsea; pwd`
+    kpathsea_includedir=`cd $kpathsea_libdir/..; pwd`
 elif test -f $kpathsea_libdir/../../kpathsea/proginit.h; then
-    kpathsea_includedir=`cd $kpathsea_libdir/../../kpathsea; pwd`
+    kpathsea_includedir=`cd $kpathsea_libdir/../..; pwd`
 elif test -f $kpathsea_libdir/../include/kpathsea/proginit.h; then
-    kpathsea_includedir=`cd $kpathsea_libdir/../include/kpathsea; pwd`
+    kpathsea_includedir=`cd $kpathsea_libdir/../include; pwd`
+elif test -f $kpathsea_libdir/../../include/kpathsea/proginit.h; then
+    kpathsea_includedir=`cd $kpathsea_libdir/../../include; pwd`
 fi
-if test ! -f $kpathsea_includedir/proginit.h; then
+if test ! -f $kpathsea_includedir/kpathsea/proginit.h; then
     AC_MSG_ERROR(Couldn't find Kpathsea include files)
 fi
 AC_MSG_RESULT(in $kpathsea_includedir)
Index: dvi/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/tkdvi/dvi/Makefile.am,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- dvi/Makefile.am	1999/06/10 12:36:50	1.1.1.1
+++ dvi/Makefile.am	1999/06/10 17:31:33	1.3
@@ -3,7 +3,7 @@
 # Makefile for `dvi' subdirectory of TkDVI.
 # Copyright © 1999 Anselm Lingnau <lingnau@tm.informatik.uni-frankfurt.de>.
 # See file COPYING for conditions on use and distribution.
-# $Id: Makefile.am,v 1.1.1.1 1999/06/10 12:36:50 lingnau Exp $
+# $Id: Makefile.am,v 1.3 1999/06/10 17:31:33 lingnau Exp $
 
 AUTOMAKE_OPTIONS = foreign
 
@@ -24,7 +24,8 @@
 	fontPK.c fontTFM.c init.c misc.c image.c
 libdvi_la_LIBADD = -lkpathsea
 
-INCLUDES = -I$(kpathsea_includedir) -I$(tcl_includedir) -I$(tk_includedir)
+INCLUDES = -I$(kpathsea_includedir) -I$(kpathsea_includedir)/kpathsea \
+	-I$(tcl_includedir) -I$(tk_includedir)
 
 # We need to use wish here because otherwise the Tk symbols in the
 # extension cannot be resolved.
Index: dvi/findFont.c
===================================================================
RCS file: /usr/local/cvsroot/tkdvi/dvi/findFont.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- dvi/findFont.c	1999/06/10 12:36:50	1.1.1.1
+++ dvi/findFont.c	1999/06/10 17:05:36	1.2
@@ -10,14 +10,14 @@
 #define WITH_KPATHSEA 1
 #if WITH_KPATHSEA
 #include <stdio.h>		/* for FILE */
-#include "proginit.h"
-#include "tex-glyph.h"
+#include "kpathsea/proginit.h"
+#include "kpathsea/tex-glyph.h"
 #endif
 
 #include "dviInt.h"
 
 #ifndef lint
-static char rcsid[] VAR_UNUSED = "$Id: findFont.c,v 1.1.1.1 1999/06/10 12:36:50 lingnau Exp $";
+static char rcsid[] VAR_UNUSED = "$Id: findFont.c,v 1.2 1999/06/10 17:05:36 lingnau Exp $";
 #endif /* lint */
 
 int dvi_tfm_files_only = 0;
Index: dvi/init.c
===================================================================
RCS file: /usr/local/cvsroot/tkdvi/dvi/init.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- dvi/init.c	1999/06/10 12:36:50	1.1.1.1
+++ dvi/init.c	1999/06/10 17:05:37	1.2
@@ -12,11 +12,11 @@
  */
 
 #include <string.h>
-#include "kpathsea.h"
+#include "kpathsea/kpathsea.h"
 #include "dviInt.h"
 
 #ifndef lint
-static char rcsid[] VAR_UNUSED = "$Id: init.c,v 1.1.1.1 1999/06/10 12:36:50 lingnau Exp $";
+static char rcsid[] VAR_UNUSED = "$Id: init.c,v 1.2 1999/06/10 17:05:37 lingnau Exp $";
 #endif /* lint */
 
 typedef struct DviFileCookie {
--- configure.old	Thu Jun 10 14:36:50 1999
+++ configure	Thu Jun 10 19:18:35 1999
@@ -28,6 +28,8 @@
 ac_help="$ac_help
   --with-kpathsea=DIR     use kpathsearch from DIR"
 ac_help="$ac_help
+  --with-kpathseainc=DIR  'kpathsea/proginit.h' is in DIR"
+ac_help="$ac_help
   --enable-debug          enable debugging and regression tests"
 
 # Initialize some variables set by options.
@@ -570,7 +572,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./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:574: checking for a BSD compatible install" >&5
+echo "configure:576: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -623,7 +625,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:627: checking whether build environment is sane" >&5
+echo "configure:629: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -680,7 +682,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:684: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:686: 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
@@ -726,7 +728,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:730: checking for working aclocal" >&5
+echo "configure:732: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -739,7 +741,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:743: checking for working autoconf" >&5
+echo "configure:745: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -752,7 +754,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:756: checking for working automake" >&5
+echo "configure:758: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -765,7 +767,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:769: checking for working autoheader" >&5
+echo "configure:771: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -778,7 +780,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:782: checking for working makeinfo" >&5
+echo "configure:784: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -845,7 +847,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:849: checking host system type" >&5
+echo "configure:851: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -868,7 +870,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:872: checking for $ac_word" >&5
+echo "configure:874: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -898,7 +900,7 @@
 # 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:902: checking for $ac_word" >&5
+echo "configure:904: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -928,7 +930,7 @@
   # 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:932: checking for $ac_word" >&5
+echo "configure:934: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -979,7 +981,7 @@
       # 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:983: checking for $ac_word" >&5
+echo "configure:985: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1011,7 +1013,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1015: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1017: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1022,12 +1024,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1026 "configure"
+#line 1028 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1033: \"$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
@@ -1053,12 +1055,12 @@
   { 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:1057: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1059: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1062: checking whether we are using GNU C" >&5
+echo "configure:1064: 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
 else
@@ -1067,7 +1069,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1073: \"$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
@@ -1086,7 +1088,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1090: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1092: 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
@@ -1130,7 +1132,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1134: checking for ld used by GCC" >&5
+echo "configure:1136: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1148,10 +1150,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1152: checking for GNU ld" >&5
+echo "configure:1154: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1155: checking for non-GNU ld" >&5
+echo "configure:1157: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1187,7 +1189,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1191: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1193: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1203,7 +1205,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1207: checking for BSD-compatible nm" >&5
+echo "configure:1209: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1240,7 +1242,7 @@
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1244: checking whether ln -s works" >&5
+echo "configure:1246: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1276,8 +1278,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1280 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1282 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1318,7 +1320,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./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:1322: checking for a BSD compatible install" >&5
+echo "configure:1324: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1371,7 +1373,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1375: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1377: 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
@@ -1399,12 +1401,12 @@
 
 
 echo $ac_n "checking for labs""... $ac_c" 1>&6
-echo "configure:1403: checking for labs" >&5
+echo "configure:1405: checking for labs" >&5
 if eval "test \"`echo '$''{'ac_cv_func_labs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1408 "configure"
+#line 1410 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char labs(); below.  */
@@ -1427,7 +1429,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_labs=yes"
 else
@@ -1464,7 +1466,7 @@
 
 
 echo $ac_n "checking Tcl include file""... $ac_c" 1>&6
-echo "configure:1468: checking Tcl include file" >&5
+echo "configure:1470: checking Tcl include file" >&5
 tcl_includedir=
 for ac_dir in $includedir $oldincludedir \
 	$tcl_libdir $tcl_libdir/.. $tcl_libdir/../..; do
@@ -1492,7 +1494,7 @@
 # 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:1496: checking for $ac_word" >&5
+echo "configure:1498: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1552,7 +1554,7 @@
     
 
     echo $ac_n "checking Tk include file""... $ac_c" 1>&6
-echo "configure:1556: checking Tk include file" >&5
+echo "configure:1558: checking Tk include file" >&5
     tk_includedir=
     for ac_dir in $includedir $oldincludedir \
             $tk_libdir $tk_libdir/.. $tk_libdir/../..; do
@@ -1583,7 +1585,7 @@
 # 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:1587: checking for $ac_word" >&5
+echo "configure:1589: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_WISH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1648,18 +1650,29 @@
 echo "$ac_t""Using kpathsea library in $kpathsea_libdir" 1>&6
 
 
+kpathsea_includedir=/usr/include
+# Check whether --with-kpathseainc or --without-kpathseainc was given.
+if test "${with_kpathseainc+set}" = set; then
+  withval="$with_kpathseainc"
+  kpathsea_includedir=$withval
+fi
+
 echo $ac_n "checking for Kpathsea include files""... $ac_c" 1>&6
-echo "configure:1653: checking for Kpathsea include files" >&5
-if test -f /usr/include/kpathsea/proginit.h; then
-    kpathsea_includedir=/usr/include/kpathsea
+echo "configure:1662: checking for Kpathsea include files" >&5
+if test -f $kpathsea_includedir/kpathsea/proginit.h; then
+    true # all's well in the world
+elif test -f /usr/include/kpathsea/proginit.h; then
+    kpathsea_includedir=/usr/include
 elif test -f $kpathsea_libdir/../kpathsea/proginit.h; then
-    kpathsea_includedir=`cd $kpathsea_libdir/../kpathsea; pwd`
+    kpathsea_includedir=`cd $kpathsea_libdir/..; pwd`
 elif test -f $kpathsea_libdir/../../kpathsea/proginit.h; then
-    kpathsea_includedir=`cd $kpathsea_libdir/../../kpathsea; pwd`
+    kpathsea_includedir=`cd $kpathsea_libdir/../..; pwd`
 elif test -f $kpathsea_libdir/../include/kpathsea/proginit.h; then
-    kpathsea_includedir=`cd $kpathsea_libdir/../include/kpathsea; pwd`
+    kpathsea_includedir=`cd $kpathsea_libdir/../include; pwd`
+elif test -f $kpathsea_libdir/../../include/kpathsea/proginit.h; then
+    kpathsea_includedir=`cd $kpathsea_libdir/../../include; pwd`
 fi
-if test ! -f $kpathsea_includedir/proginit.h; then
+if test ! -f $kpathsea_includedir/kpathsea/proginit.h; then
     { echo "configure: error: Couldn't find Kpathsea include files" 1>&2; exit 1; }
 fi
 echo "$ac_t""in $kpathsea_includedir" 1>&6
@@ -1681,7 +1694,7 @@
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1685: checking how to run the C preprocessor" >&5
+echo "configure:1698: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1696,13 +1709,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1700 "configure"
+#line 1713 "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:1706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1719: \"$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
   :
@@ -1713,13 +1726,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1717 "configure"
+#line 1730 "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:1723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1736: \"$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
   :
@@ -1730,13 +1743,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1734 "configure"
+#line 1747 "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:1740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1753: \"$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
   :
@@ -1761,12 +1774,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1765: checking for ANSI C header files" >&5
+echo "configure:1778: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1770 "configure"
+#line 1783 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1774,7 +1787,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1791: \"$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*
@@ -1791,7 +1804,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1795 "configure"
+#line 1808 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1809,7 +1822,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1813 "configure"
+#line 1826 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1830,7 +1843,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1834 "configure"
+#line 1847 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1841,7 +1854,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1868,17 +1881,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1872: checking for $ac_hdr" >&5
+echo "configure:1885: 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 1877 "configure"
+#line 1890 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1895: \"$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*
@@ -1906,12 +1919,12 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1910: checking for working const" >&5
+echo "configure:1923: 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 1915 "configure"
+#line 1928 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1960,7 +1973,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1981,12 +1994,12 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1985: checking for off_t" >&5
+echo "configure:1998: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1990 "configure"
+#line 2003 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2014,12 +2027,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2018: checking for size_t" >&5
+echo "configure:2031: 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 2023 "configure"
+#line 2036 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2047,12 +2060,12 @@
 fi
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:2051: checking whether stat file-mode macros are broken" >&5
+echo "configure:2064: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2056 "configure"
+#line 2069 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2103,7 +2116,7 @@
 fi
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:2107: checking size of int" >&5
+echo "configure:2120: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2111,7 +2124,7 @@
   ac_cv_sizeof_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 2115 "configure"
+#line 2128 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -2122,7 +2135,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -2142,7 +2155,7 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:2146: checking size of long" >&5
+echo "configure:2159: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2150,7 +2163,7 @@
   ac_cv_sizeof_long=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 2154 "configure"
+#line 2167 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -2161,7 +2174,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:2165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -2183,12 +2196,12 @@
 
 
 echo $ac_n "checking for working attribute""... $ac_c" 1>&6
-echo "configure:2187: checking for working attribute" >&5
+echo "configure:2200: checking for working attribute" >&5
 if eval "test \"`echo '$''{'ac_cv_c_attribute'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2192 "configure"
+#line 2205 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2197,7 +2210,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_attribute=yes
 else
@@ -2222,17 +2235,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2226: checking for $ac_hdr" >&5
+echo "configure:2239: 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 2231 "configure"
+#line 2244 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2249: \"$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*
@@ -2261,12 +2274,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2265: checking for $ac_func" >&5
+echo "configure:2278: 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 2270 "configure"
+#line 2283 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2289,7 +2302,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2306: \"$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
@@ -2314,7 +2327,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2318: checking for working mmap" >&5
+echo "configure:2331: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2322,7 +2335,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2326 "configure"
+#line 2339 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2462,7 +2475,7 @@
 }
 
 EOF
-if { (eval echo configure:2466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2487,12 +2500,12 @@
 for ac_func in strtol strtoul
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2491: checking for $ac_func" >&5
+echo "configure:2504: 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 2496 "configure"
+#line 2509 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2515,7 +2528,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2532: \"$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
