+if test x"${ac_cv_c_tkh}" != x ; then
+# no_tk=""
+ if test x"${ac_cv_c_tkh}" = x"installed" ; then
+ echo "$as_me:$LINENO: result: is installed" >&5
+echo "${ECHO_T}is installed" >&6
+ TKHDIRDASHI=""
+ else
+ echo "$as_me:$LINENO: result: found in ${ac_cv_c_tkh}" >&5
+echo "${ECHO_T}found in ${ac_cv_c_tkh}" >&6
+ # this hack is cause the TKHDIRDASHI won't print if there is a "-I" in it.
+ TKHDIRDASHI="-I${ac_cv_c_tkh}"
+ fi
+else
+ TKHDIRDASHI="# no Tk directory found"
+ { echo "$as_me:$LINENO: WARNING: Can't find Tk private headers" >&5
+echo "$as_me: WARNING: Can't find Tk private headers" >&2;}
+ no_tk=true
+fi
+
+
+
+
+#
+# Ok, lets find the tk configuration
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-tk
+#
+
+if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+
+# Check whether --with-tk or --without-tk was given.
+if test "${with_tk+set}" = set; then
+ withval="$with_tk"
+ with_tkconfig=${withval}
+fi;
+ echo "$as_me:$LINENO: checking for Tk configuration" >&5
+echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6
+ if test "${ac_cv_c_tkconfig+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+ # First check to see if --with-tk was specified.
+ if test x"${with_tkconfig}" != x ; then
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
+ else
+ { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5
+echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[4-9].[0-9].[0-9] ../tk[4-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tk[4-9].[0-9].[0-9] ../tk[4-9].[0-9] 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[4-9].[0-9].[0-9] ../../tk[4-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tk[4-9].[0-9].[0-9] ../../tk[4-9].[0-9] 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[4-9].[0-9].[0-9] ../../../tk[4-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tk[4-9].[0-9].[0-9] ../../../tk[4-9].[0-9] 2>/dev/null` ; do
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check Debian-specific locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ `ls -dr /usr/lib/tk[4-9].[0-9].[0-9] /usr/lib/tk[4-9].[0-9] 2>/dev/null` \
+ `ls -dr /usr/lib/tk[4-9].[0-9].[0-9] /usr/lib/tk[4-9].[0-9] 2>/dev/null` ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[4-9].[0-9].[0-9] ${srcdir}/../tk[4-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[4-9].[0-9].[0-9] ${srcdir}/../tk[4-9].[0-9] 2>/dev/null` ; do
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TKCONFIG="# no Tk configs found"
+ { echo "$as_me:$LINENO: WARNING: Can't find Tk configuration definitions" >&5
+echo "$as_me: WARNING: Can't find Tk configuration definitions" >&2;}
+ else
+ no_tk=
+ TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
+ echo "$as_me:$LINENO: result: found $TKCONFIG" >&5
+echo "${ECHO_T}found $TKCONFIG" >&6
+ fi
+fi
+
+
+
+ if test -f "$TKCONFIG" ; then
+ . $TKCONFIG
+ fi
+
+
+
+
+
+
+
+
+
+
+
+# if Tk's build directory has been removed, TK_LIB_SPEC should
+# be used instead of TK_BUILD_LIB_SPEC
+SAVELIBS=$LIBS
+# eval used to expand out TK_DBGX
+eval "LIBS=\"$TK_BUILD_LIB_SPEC $TCL_BUILD_LIB_SPEC $TK_LIBS\""
+echo "$as_me:$LINENO: checking for Tk_Init" >&5
+echo $ECHO_N "checking for Tk_Init... $ECHO_C" >&6
+if test "${ac_cv_func_Tk_Init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char Tk_Init (); 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 Tk_Init ();
+char (*f) ();
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_Tk_Init) || defined (__stub___Tk_Init)
+choke me
+#else
+f = Tk_Init;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext 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='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_Tk_Init=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_Tk_Init=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_Tk_Init" >&5
+echo "${ECHO_T}$ac_cv_func_Tk_Init" >&6
+if test $ac_cv_func_Tk_Init = yes; then
+
+ echo "$as_me:$LINENO: checking if Tk library build specification is valid" >&5
+echo $ECHO_N "checking if Tk library build specification is valid... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+
+ TK_BUILD_LIB_SPEC=$TK_LIB_SPEC
+ # Can't pull the following CHECKING call out since it will be
+ # broken up by the CHECK_FUNC just above.
+ echo "$as_me:$LINENO: checking if Tk library build specification is valid" >&5
+echo $ECHO_N "checking if Tk library build specification is valid... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+
+LIBS=$SAVELIBS
+
+
+
+
+TK_INC_DIR=$TK_INC_DIR
+
+if [[ $TK_VERSION < "8.4" ]]; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TK_84PREV
+_ACEOF
+
+fi
+
+ac_config_files="$ac_config_files Makefile etc/Makefile etc/fgis.rc dll/Makefile epu/Makefile include/Makefile lib/Makefile tcl/Makefile tcl/pkgIndex.tcl"