1 #------------------------------------------------------------------------
3 # Options: --with-tcl= : Specify location of tclConfig.sh
4 # --without-tcl= : Skip check for TCL, assume not installed
7 # Everything from tclConfig.sh
8 #------------------------------------------------------------------------
9 AC_DEFUN([SC_TCL_CFG], [
11 AC_HELP_STRING([--with-tcl=PATH],[Directory containing tclConfig.sh])
12 AC_HELP_STRING([--without-tcl], [Assume no tcl libraries available]) ,
13 [with_tcl="${withval}";require_tcl=yes],[with_tcl=yes;require_tcl=no])
15 # If user requested disabling of tcl check
16 if test "xno" = "x$with_tcl"; then
22 # Search for tclConfig.sh
23 if test "xyes" != "x$with_tcl"; then
24 # If user specified location
25 . "${with_tcl}/tclConfig.sh" || AC_MSG_ERROR("Cannot read file: ${with_tcl}/tclConfig.sh")
28 # Search for tclConfig.sh in usual spots
30 AC_MSG_CHECKING([for tclConfig.sh])
31 for i in /usr /usr/local ${prefix} /opt/sfw /usr/tcltk; do
33 for j in $i/lib $i/lib/tcl $i/lib/tcl[[8-9]].[[0-9]] $i/lib/itcl; do
34 if test -r "$j/tclConfig.sh"; then
35 tcl_cfg_file="$j/tclConfig.sh"
40 if test "x" != "x$tcl_cfg_file"; then
44 AC_MSG_RESULT("$tcl_cfg_file")
46 if test "x" != "x$tcl_cfg_file"; then
47 . "$tcl_cfg_file" || AC_MSG_ERROR("Cannot read file: $tcl_cfg_file")
50 # if TCL_INCLUDE_SPEC wasn't defined, try to define it using TCL_INC_DIR
51 if test "x" = "x$TCL_INCLUDE_SPEC"; then
52 inc_path=`expr "x$TCL_INC_DIR" : "x\(.*\)/tcl-private/generic"`
53 if test "x" != "$inc_path"; then
54 TCL_INCLUDE_SPEC="-I$inc_path"
55 elif test "x" != "x$TCL_INC_DIR"; then
56 TCL_INCLUDE_SPEC="-I$TCL_INC_DIR"
66 save_CPPFLAGS="$CPPFLAGS"
67 CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
68 AC_CHECK_HEADER([tcl.h],[],[HAVE_TCL=no])
69 CPPFLAGS="$save_CPPFLAGS"
71 if test "xyes" = "x$require_tcl"; then
72 if test "xno" = "x$HAVE_TCL"; then
73 AC_MSG_ERROR([TCL not found.])
80 #------------------------------------------------------------------------
82 # Options: --with-tk= : Specify location of Tk
83 # --without-tk= : Skip check for Tk, assume not installed
86 # Everything from tkConfig.sh
87 #------------------------------------------------------------------------
88 AC_DEFUN([SC_TK_CFG], [
90 AC_HELP_STRING([--with-tk=PATH],[Directory containing tkConfig.sh])
91 AC_HELP_STRING([--without-tk], [Assume no Tk libraries available]) ,
92 [with_tk="${withval}";require_tk=yes],[with_tk=yes;require_tk=no])
94 # If user requested disabling of Tk check
95 if test "xno" = "x$with_tk"; then
101 # Search for tkConfig.sh
102 if test "xyes" != "x$with_tk"; then
103 # If user specified location
104 . "${with_tk}/tkConfig.sh" || AC_MSG_ERROR("Cannot read file: ${with_tk}/tkConfig.sh")
107 # Search for tkConfig.sh in usual spots
109 AC_MSG_CHECKING([for tkConfig.sh])
110 for i in /usr /usr/local ${prefix} /opt/sfw /usr/tcltk; do
112 for j in $i/lib $i/lib/tk $i/lib/tk[[8-9]].[[0-9]] $i/lib/itcl; do
113 if test -r "$j/tkConfig.sh"; then
114 tk_cfg_file="$j/tkConfig.sh"
119 if test "x" != "x$tk_cfg_file"; then
123 AC_MSG_RESULT("$tk_cfg_file")
125 if test "x" != "x$tk_cfg_file"; then
126 . "$tk_cfg_file" || AC_MSG_ERROR("Cannot read file: $tk_cfg_file")
129 # if TK_INCLUDE_SPEC wasn't defined, try to define it using TK_INC_DIR
130 if test "x" = "x$TK_INCLUDE_SPEC"; then
131 inc_path=`expr "x$TK_INC_DIR" : "x\(.*\)/tk-private/generic"`
132 if test "x" != "$inc_path"; then
133 TK_INCLUDE_SPEC="-I$inc_path"
134 elif test "x" != "x$TK_INC_DIR"; then
135 TK_INCLUDE_SPEC="-I$TK_INC_DIR"
146 save_CPPFLAGS="$CPPFLAGS"
147 CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC $TK_INCLUDE_SPEC"
148 AC_CHECK_HEADER([tk.h],[],[HAVE_TK=no])
149 CPPFLAGS="$save_CPPFLAGS"
151 if test "xyes" = "x$require_tk"; then
152 if test "xno" = "x$HAVE_TK"; then
153 AC_MSG_ERROR([Tk not found.])