krb5_save_LDFLAGS="$LDFLAGS"
CPPFLAGS="$TCL_INCLUDES $CPPFLAGS"
LDFLAGS="$TCL_LIBPATH $LDFLAGS"
- AC_CHECK_HEADER(tcl.h,dnl
- AC_CHECK_LIB(tcl7.5, Tcl_CreateCommand,
- TCL_LIBS="$TCL_LIBS -ltcl7.5 -lm $DL_LIB",
+ tcl_header=no
+ AC_CHECK_HEADER(tcl.h,AC_DEFINE(HAVE_TCL_H) tcl_header=yes)
+ if test $tcl_header=no; then
+ AC_CHECK_HEADER(tcl/tcl.h,AC_DEFINE(HAVE_TCL_TCL_H) tcl_header=yes)
+ fi
+
+ if test $tcl_header=yes; then
+ tcl_lib=no
+ AC_CHECK_LIB(tcl7.6, Tcl_CreateCommand,
+ TCL_LIBS="$TCL_LIBS -ltcl7.6 -lm $DL_LIB"
+ tcl_lib=yes,,-lm $DL_LIB)
+ if test $tcl_lib=no; then
+ AC_CHECK_LIB(tcl7.5, Tcl_CreateCommand,
+ TCL_LIBS="$TCL_LIBS -ltcl7.5 -lm $DL_LIB"
+ tcl_lib=yes,,-lm $DL_LIB)
+
+ fi
+ if test $tcl_lib=no; then
AC_CHECK_LIB(tcl, Tcl_CreateCommand,
- TCL_LIBS="$TCL_LIBS -ltcl -lm $DL_LIB",
- AC_MSG_WARN("tcl.h found but not library"),
- -lm $DL_LIB),
- -lm $DL_LIB),dnl tcl.h not found
- AC_MSG_WARN(Could not find Tcl which is needed for the kadm5 tests)
- TCL_LIBS=)
+ TCL_LIBS="$TCL_LIBS -ltcl -lm $DL_LIB"
+ tcl_lib=yes,,-lm $DL_LIB)
+
+ fi
+ if test $tcl_lib=no; then
+ AC_MSG_WARN("tcl.h found but not library")
+ fi
+ else
+ AC_MSG_WARN(Could not find Tcl which is needed for the kadm5 tests)
+ TCL_LIBS=
+ fi
CPPFLAGS="$krb5_save_CPPFLAGS"
LDFLAGS="$krb5_save_LDFLAGS"
AC_SUBST(TCL_INCLUDES)