1 AC_DEFUN(CYGNUS_PATH_TK, [
3 # Ok, lets find the tk source trees so we can use the headers
4 # If the directory (presumably symlink) named "tk" exists, use that one
5 # in preference to any others. Same logic is used when choosing library
8 AC_CHECKING(for Tk source directory)
10 for i in `ls -d ${srcdir}/../tk* 2>/dev/null` ${srcdir}/../tk ; do
11 if test -f $i/tk.h ; then
15 # if we can't find it, see if one is installed
16 if test x"$TKHDIR" = x ; then
18 if test -f $prefix/include/tk.h; then
19 installed=1 TKHDIR="-I$prefix/include"
21 AC_HEADER_CHECK(tk.h, installed=1)
23 if test $installed -eq 0 ; then
24 TKHDIR="# no Tk directory found"
25 AC_MSG_WARN(Can't find Tk directory)
28 if test x"$TKHDIR" != x ; then
29 AC_MSG_RESULT(Setting TKHDIR to be $i)
33 # Ok, lets find the tk library
34 # First, look for one uninstalled.
37 AC_CHECKING(for Tk library)
38 for i in `ls -d ../tk* 2>/dev/null` ../tk ; do
39 if test -f "$i/Makefile" ; then
43 # If not found, look for installed version
44 if test x"$TKLIB" = x ; then
45 dnl This doesn't work because of unresolved symbols.
46 dnl AC_HAVE_LIBRARY(libtk.a, installed=1, installed=0)
47 if test -f $prefix/lib/libtk.a; then
52 if test $installed -eq 1 ; then
57 # If still not found, assume Tk simply hasn't been built yet
58 if test x"$TKLIB" = x ; then
59 for i in `ls -d ../tk* 2>/dev/null` ../tk ; do
60 if test -f "$i/tk.h" ; then
66 if test x"$TKLIB" = x ; then
67 TKLIB="# no Tk library found"
68 AC_MSG_WARN(Can't find Tk library)
70 AC_MSG_RESULT(setting TKLIB to be $TKLIB)
79 AC_DEFUN(CYGNUS_PATH_TCL, [
81 # Ok, lets find the tcl source trees so we can use the headers
83 # Warning: transition of version 9 to 10 will break this algorithm
84 # because 10 sorts before 9.
86 AC_CHECKING(for Tcl source directory)
88 for i in `ls -d ${srcdir}/../tcl* 2>/dev/null` ${srcdir}/../tcl ; do
89 if test -f $i/tclInt.h ; then
93 # if we can't find it, see if one is installed
94 if test x"$TCLHDIR" = x ; then
96 if test -f $prefix/include/tclInt.h; then
97 installed=1 TCLHDIR="-I$prefix/include"
99 AC_HEADER_CHECK(tclInt.h, installed=1)
101 if test $installed -eq 0 ; then
102 TCLHDIR="# no Tcl directory found"
103 AC_MSG_WARN(Can't find Tcl directory)
106 AC_MSG_RESULT(setting TCLHDIR to be $i)
110 # Ok, lets find the tcl library
111 # First, look for the latest uninstalled
114 AC_CHECKING(for Tcl library)
115 for i in `ls -d ../tcl* 2>/dev/null` ../tcl ; do
116 if test -f "$i/Makefile" ; then
120 # If not found, look for installed version
121 if test x"$TCLLIB" = x ; then
122 dnl Don't use this, since we can't use it for libtk.a.
123 dnl AC_HAVE_LIBRARY(libtcl.a, installed=1, installed=0)
124 if test -f $prefix/lib/libtcl.a; then installed=1; else installed=0; fi
125 if test $installed -eq 1 ; then
129 # If still not found, assume Tcl simply hasn't been built yet
130 if test x"$TCLLIB" = x ; then
131 for i in `ls -d ../tcl* 2>/dev/null` ../tcl ; do
132 if test -f "$i/tcl.h" ; then
138 if test x"$TCLLIB" = x ; then
139 TCLLIB="# no Tcl library found"
140 AC_MSG_WARN(Can't find Tcl library)
142 AC_MSG_RESULT(setting TCLLIB to be $TCLLIB)