3
# Autoconf macros to check for Tcl related things
6
AC_DEFUN([PGAC_PATH_TCLSH],
7
[AC_PATH_PROGS(TCLSH, [tclsh tcl tclsh8.5 tclsh85 tclsh8.4 tclsh84 tclsh8.3 tclsh83])
8
if test x"$TCLSH" = x""; then
9
AC_MSG_ERROR([Tcl shell not found])
14
# PGAC_PATH_TCLCONFIGSH([SEARCH-PATH])
15
# ------------------------------------
16
AC_DEFUN([PGAC_PATH_TCLCONFIGSH],
17
[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
18
AC_BEFORE([$0], [PGAC_PATH_TKCONFIGSH])[]dnl
19
AC_MSG_CHECKING([for tclConfig.sh])
20
# Let user override test
21
if test -z "$TCL_CONFIG_SH"; then
24
set X $pgac_test_dirs; shift
25
if test $[#] -eq 0; then
26
test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tclConfig.sh because no Tcl shell was found])
27
set X `echo 'puts $auto_path' | $TCLSH`; shift
31
if test -r "$pgac_dir/tclConfig.sh"; then
32
TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
38
if test -z "$TCL_CONFIG_SH"; then
40
AC_MSG_ERROR([file 'tclConfig.sh' is required for Tcl])
42
AC_MSG_RESULT([$TCL_CONFIG_SH])
45
AC_SUBST([TCL_CONFIG_SH])
46
])# PGAC_PATH_TCLCONFIGSH
49
# PGAC_PATH_TKCONFIGSH([SEARCH-PATH])
50
# ------------------------------------
51
AC_DEFUN([PGAC_PATH_TKCONFIGSH],
52
[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
53
AC_MSG_CHECKING([for tkConfig.sh])
54
# Let user override test
55
if test -z "$TK_CONFIG_SH"; then
58
set X $pgac_test_dirs; shift
59
if test $[#] -eq 0; then
60
test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tkConfig.sh because no Tcl shell was found])
61
set X `echo 'puts $auto_path' | $TCLSH`; shift
65
if test -r "$pgac_dir/tkConfig.sh"; then
66
TK_CONFIG_SH=$pgac_dir/tkConfig.sh
72
if test -z "$TK_CONFIG_SH"; then
74
AC_MSG_ERROR([file 'tkConfig.sh' is required for Tk])
76
AC_MSG_RESULT([$TK_CONFIG_SH])
79
AC_SUBST([TK_CONFIG_SH])
80
])# PGAC_PATH_TKCONFIGSH
83
# PGAC_EVAL_TCLCONFIGSH(FILE, WANTED-VARS)
84
# ----------------------------------------
85
# Assigns variables listed in WANTED-VARS by reading FILE and
86
# evaluating it according to the quoting scheme of tclConfig.sh and
87
# tkConfig.sh. Calls AC_SUBST for each variable.
89
AC_DEFUN([PGAC_EVAL_TCLCONFIGSH],
91
m4_foreach([pgac_item], [$2],
92
[eval pgac_item=\"[$]pgac_item\"
93
AC_SUBST(pgac_item)])])