1
#--------------------------------------------------------------------
2
# Try to locate the Tcl package
3
#--------------------------------------------------------------------
14
AC_ARG_WITH(tclconfig,[ --with-tclconfig=path Set location of tclConfig.sh],
15
with_tclconfig="$withval")
16
AC_ARG_WITH(tcl,[ --with-tcl=path Set location of Tcl package],[
17
TCLPACKAGE="$withval"], [TCLPACKAGE=])
18
AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
19
TCLINCLUDE="-I$withval"], [TCLINCLUDE=])
20
AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
21
TCLLIB="-L$withval"], [TCLLIB=])
23
AC_MSG_CHECKING([for Tcl configuration])
24
# First check to see if --with-tclconfig was specified.
25
if test x"${with_tclconfig}" != x ; then
26
if test -f "${with_tclconfig}/tclConfig.sh" ; then
27
TCLCONFIG=`(cd ${with_tclconfig}; pwd)`
29
AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh])
32
# check in a few common install locations
33
if test x"${TCLCONFIG}" = x ; then
34
for i in `ls -d /usr/lib 2>/dev/null` \
35
`ls -d ${prefix}/lib 2>/dev/null` \
36
`ls -d /usr/local/lib 2>/dev/null` ; do
37
if test -f "$i/tclConfig.sh" ; then
38
TCLCONFIG=`(cd $i; pwd)`
43
if test x"${TCLCONFIG}" = x ; then
46
AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh)
47
. $TCLCONFIG/tclConfig.sh
48
TCLINCLUDE=-I$TCL_PREFIX/include
52
if test -z "$TCLINCLUDE"; then
53
if test -n "$TCLPACKAGE"; then
54
TCLINCLUDE="-I$TCLPACKAGE/include"
58
if test -z "$TCLLIB"; then
59
if test -n "$TCLPACKAGE"; then
60
TCLLIB="-L$TCLPACKAGE/lib -ltcl"
64
AC_MSG_CHECKING(for Tcl header files)
65
if test -z "$TCLINCLUDE"; then
66
AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="")
67
if test -z "$TCLINCLUDE"; then
68
dirs="$prefix/include /usr/local/include /usr/include /opt/local/include"
70
if test -r $i/tcl.h; then
77
if test -z "$TCLINCLUDE"; then
78
# TCLINCLUDE="-I/usr/local/include"
79
AC_MSG_RESULT(not found)
82
AC_MSG_RESULT($TCLINCLUDE)
85
AC_MSG_CHECKING(for Tcl library)
86
if test -z "$TCLLIB"; then
87
dirs="$prefix/lib /usr/local/lib /usr/lib /opt/local/lib"
89
if test -r $i/libtcl.a; then
95
if test -z "$TCLLIB"; then
96
AC_MSG_RESULT(not found)
97
# TCLLIB="-L/usr/local/lib"
100
AC_MSG_RESULT($TCLLIB)
103
# Only cygwin (Windows) needs the library for dynamic linking
104
case $ac_sys_system/$ac_sys_release in
105
CYGWIN*) TCLDYNAMICLINKING="$TCLLIB";;
106
*)TCLDYNAMICLINKING="";;
111
AC_SUBST(TCLDYNAMICLINKING)