2002-10-07 21:37:40 +00:00
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# SC_PATH_TCLCONFIG --
|
|
|
|
#
|
|
|
|
# Locate the tclConfig.sh file and perform a sanity check on
|
|
|
|
# the Tcl compile flags
|
|
|
|
#
|
|
|
|
# Arguments:
|
|
|
|
# none
|
|
|
|
#
|
|
|
|
# Results:
|
|
|
|
#
|
|
|
|
# Adds the following arguments to configure:
|
|
|
|
# --with-tcl=...
|
|
|
|
#
|
|
|
|
# Defines the following vars:
|
|
|
|
# TCL_BIN_DIR Full path to the directory containing
|
|
|
|
# the tclConfig.sh file
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
|
2006-02-26 19:37:20 +00:00
|
|
|
AC_DEFUN([SC_PATH_TCLCONFIG], [
|
2002-10-07 21:37:40 +00:00
|
|
|
#
|
|
|
|
# Ok, lets find the tcl configuration
|
|
|
|
# First, look for one uninstalled.
|
|
|
|
# the alternative search directory is invoked by --with-tcl
|
|
|
|
#
|
|
|
|
|
|
|
|
if test x"${no_tcl}" = x ; then
|
|
|
|
# we reset no_tcl in case something fails here
|
|
|
|
no_tcl=true
|
2009-03-23 22:49:45 +00:00
|
|
|
AC_ARG_WITH(tcl, [ --with-tcl=PATH directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval})
|
2002-10-07 21:37:40 +00:00
|
|
|
AC_MSG_CHECKING([for Tcl configuration])
|
|
|
|
AC_CACHE_VAL(ac_cv_c_tclconfig,[
|
|
|
|
|
2005-04-03 21:21:33 +00:00
|
|
|
# First check to see if --with-tcl was specified.
|
2002-10-07 21:37:40 +00:00
|
|
|
if test x"${with_tclconfig}" != x ; then
|
|
|
|
if test -f "${with_tclconfig}/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# then check for a private Tcl installation
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
for i in \
|
|
|
|
../tcl \
|
2005-04-03 21:21:33 +00:00
|
|
|
`ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
2002-10-07 21:37:40 +00:00
|
|
|
`ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
../../tcl \
|
2005-04-03 21:21:33 +00:00
|
|
|
`ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
2002-10-07 21:37:40 +00:00
|
|
|
`ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
../../../tcl \
|
2005-04-03 21:21:33 +00:00
|
|
|
`ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
2002-10-07 21:37:40 +00:00
|
|
|
`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
|
|
|
|
if test -f "$i/unix/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check in a few common install locations
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
2005-04-03 21:21:33 +00:00
|
|
|
for i in `ls -d ${libdir} 2>/dev/null` \
|
2002-10-07 21:37:40 +00:00
|
|
|
`ls -d /usr/local/lib 2>/dev/null` \
|
2005-04-03 21:21:33 +00:00
|
|
|
`ls -d /usr/contrib/lib 2>/dev/null` \
|
|
|
|
`ls -d /usr/lib 2>/dev/null` \
|
2005-04-03 22:08:35 +00:00
|
|
|
`ls -dr /usr/lib/tcl[[8-9]].[[0-9]]* 2>/dev/null` \
|
2005-04-03 21:21:33 +00:00
|
|
|
; do
|
2002-10-07 21:37:40 +00:00
|
|
|
if test -f "$i/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd $i; pwd)`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check in a few other private locations
|
2005-04-03 21:21:33 +00:00
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
2002-10-07 21:37:40 +00:00
|
|
|
for i in \
|
|
|
|
${srcdir}/../tcl \
|
2005-04-03 21:21:33 +00:00
|
|
|
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
2002-10-07 21:37:40 +00:00
|
|
|
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
|
|
|
|
if test -f "$i/unix/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
TCL_BIN_DIR="# no Tcl configs found"
|
|
|
|
AC_MSG_WARN(Can't find Tcl configuration definitions)
|
|
|
|
else
|
|
|
|
no_tcl=
|
|
|
|
TCL_BIN_DIR=${ac_cv_c_tclconfig}
|
|
|
|
AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# SC_LOAD_TCLCONFIG --
|
|
|
|
#
|
|
|
|
# Load the tclConfig.sh file
|
|
|
|
#
|
|
|
|
# Arguments:
|
|
|
|
#
|
|
|
|
# Requires the following vars to be set:
|
|
|
|
# TCL_BIN_DIR
|
|
|
|
#
|
|
|
|
# Results:
|
|
|
|
#
|
|
|
|
# Subst the following vars:
|
|
|
|
# TCL_BIN_DIR
|
|
|
|
# TCL_SRC_DIR
|
|
|
|
# TCL_LIB_FILE
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
|
2006-02-26 19:37:20 +00:00
|
|
|
AC_DEFUN([SC_LOAD_TCLCONFIG], [
|
2002-10-07 21:37:40 +00:00
|
|
|
AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
|
|
|
|
|
|
|
|
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
|
|
|
|
AC_MSG_RESULT([loading])
|
|
|
|
. $TCL_BIN_DIR/tclConfig.sh
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([file not found])
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# The eval is required to do the TCL_DBGX substitution in the
|
|
|
|
# TCL_LIB_FILE variable
|
|
|
|
#
|
|
|
|
|
|
|
|
eval TCL_LIB_FILE=${TCL_LIB_FILE}
|
|
|
|
eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
|
|
|
|
|
|
|
|
AC_SUBST(TCL_BIN_DIR)
|
|
|
|
AC_SUBST(TCL_SRC_DIR)
|
|
|
|
AC_SUBST(TCL_LIB_FILE)
|
|
|
|
])
|
|
|
|
|