dnl dnl dnl AC_DEFUN([rlr_PROG_TCL], [ _with_tcl="" AC_ARG_WITH(tcl, [ --with-tcl=DIR Find Tcl install in DIR], _with_tcl=$withval) dnl dnl look for tcl in /usr if not specified with --with-tcl dnl if test "x$_with_tcl" = "x" ; then if test -r "/usr/lib/tclConfig.sh" ; then _with_tcl="/usr" else AC_MSG_ERROR([/usr/lib/tclConfig.sh not readable...must specify tcl installation with --with-tcl flag]) fi fi dnl dnl if flag not saved in cache, set cache value to command-line flag and dnl reset any associated vars dnl (NOTE: not using AC_CACHE_CHECK since the cached value will be printed, dnl but not necessarily used if the command-line overrides it...cache can be dnl simply checked by looking at _cv_ vars loaded during AC_INIT) dnl AC_MSG_CHECKING( [Tcl] ) _cachedMsg="" if test "x${_with_tcl_cv_}" = "x" ; then _with_tcl_cv_=${_with_tcl} TCL_LIB_NAME_cv_="" TK_LIB_NAME_cv_="" TCL_PREFIX_cv_="" else dnl dnl if flag was defined in the cache, check that it is the same as dnl what was given on the command-line...if not, set cached value to dnl that of the command-line and reset any associated vars dnl if test "${_with_tcl_cv_}" != "${_with_tcl}" ; then _with_tcl_cv_=${_with_tcl} TCL_LIB_NAME_cv_="" TK_LIB_NAME_cv_="" TCL_PREFIX_cv_="" else _cachedMsg="(cached) " fi fi AC_MSG_RESULT( [${_cachedMsg}${_with_tcl_cv_}] ) TCL_DIR=${_with_tcl_cv_} dnl dnl if TCL_LIB_NAME is not set, assume all are not set and source tclConfig.sh dnl if test "x${TCL_LIB_NAME_cv_}" = "x" ; then if test -r "${_with_tcl}/lib/tclConfig.sh" ; then tcl_config_sh="${_with_tcl}/lib/tclConfig.sh" else AC_MSG_ERROR([can't find tclConfig.sh in tcl installation \"${_with_tcl}/lib/tclConfig.sh\"]) fi . ${tcl_config_sh} TCL_LIB_NAME_cv_="-L${TCL_DIR}/lib -ltcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" TK_LIB_NAME_cv_="-L${TCL_DIR}/lib -ltk${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" TCL_PREFIX_cv_=${TCL_DIR} fi TCL_INCLUDES="${TCL_PREFIX_cv_}/include" TCL_LIB_NAME=${TCL_LIB_NAME_cv_} TK_LIB_NAME=${TK_LIB_NAME_cv_} TCL_PREFIX=${TCL_PREFIX_cv_} dnl dnl export results of tests dnl AC_SUBST(TCL_LIB_NAME) AC_SUBST(TCL_INCLUDES) AC_SUBST(TK_LIB_NAME) AC_SUBST(TCL_DIR) AC_SUBST(TCL_PREFIX) ] )