1 dnl configure.in.tk --
2 dnl
3 dnl autoconf rules to find tk
4 dnl
5 dnl Copyright (c) 2000-2002 The Regents of the University of California.
6 dnl All rights reserved.
7 dnl
8 dnl Redistribution and use in source and binary forms, with or without
9 dnl modification, are permitted provided that the following conditions are met:
10 dnl
11 dnl A. Redistributions of source code must retain the above copyright notice,
12 dnl this list of conditions and the following disclaimer.
13 dnl B. Redistributions in binary form must reproduce the above copyright
14 dnl notice, this list of conditions and the following disclaimer in the
15 dnl documentation and/or other materials provided with the distribution.
16 dnl C. Neither the names of the copyright holders nor the names of its
17 dnl contributors may be used to endorse or promote products derived from
18 dnl this software without specific prior written permission.
19 dnl
20 dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
21 dnl IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 dnl THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
24 dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 dnl POSSIBILITY OF SUCH DAMAGE.
31 dnl
32 dnl $Header: /usr/mash/src/repository/conf/configure.in.tk,v 1.10 2004/12/08 00:37:26 aswan Exp $
33
34
35 AC_ARG_WITH(tk, [ --with-tk=path specify a pathname for tk], d=$withval, d="")
36
37 AC_ARG_WITH(tk-ver, [ --with-tk-ver=path specify the version of tk], TK_VERS=$withval, TK_VERS=8.3.3)
38
39
40 if test "$macosx" = "yes" ; then
41 framework_places="\
42 $HOME/Library/Frameworks \
43 /Library/Frameworks \
44 /Network/Library/Frameworks \
45 /System/Library/Frameworks"
46
47 AC_MSG_CHECKING(for Tk)
48 tk_framework="notfound"
49 for f in $framework_places ; do
50 if test -r $f/Tk.framework/Versions/Current/Tk ; then
51 tk_framework=$f
52 break
53 fi
54 done
55 AC_MSG_RESULT($tk_framework)
56
57 if test "$tk_framework" = "notfound" ; then
58 AC_MSG_ERROR(Cannot find Tk)
59 fi
60
61 V_INCLUDES="$V_INCLUDES -I$tk_framework/Tk.framework/Headers -I$tk_framework/Tk.framework/PrivateHeaders"
62 V_LIBRARY_TK="$tk_framework/Tk.framework/Resources/Scripts"
63 V_TKDOSNAMES=""
64 V_TK_PROLOG_PS="$V_LIBRARY_TK/prolog.ps"
65 V_DEFINE="$V_DEFINE -DMAC_OSX_TK"
66
67 if test "$tk_framework" = "$tcl_framework" ; then
68 V_LIB_TK="-framework Tk"
69 else
70 V_LIB_TK="-F$tk_framework -framework Tk"
71 fi
72
73 else
74 dnl Truncate anything beyond and including the second decimal point
75
76 TK_HI_VERS=`echo $TK_VERS | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1.\2/'`
77 TK_MAJOR_VERS=`echo $TK_VERS | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
78 TK_ALT_VERS=`echo $TK_VERS | sed 's/\.//'`
79
80 TK_TCL_PLACES_D="$d \
81 $d/lib/tk$TK_VERS \
82 $d/lib/tk$TK_ALT_VERS \
83 $d/lib/tk$TK_HI_VERS \
84 $d/library \
85 $d/lib/tk \
86 $d/../lib/tk$TK_VERS \
87 $d/../lib/tk$TK_ALT_VERS \
88 $d/../lib/tk$TK_HI_VERS \
89 $d/../lib/tk \
90 $d/../lib/tk \
91 $d/lib \
92 $d/library \
93 $d/../library"
94 TK_TCL_PLACES=" \
95 ../lib/tk$TK_HI_VERS \
96 ../lib/tk$TK_VERS \
97 ../lib/tk$TK_ALT_VERS \
98 ../tk$TK_VERS/library \
99 ../tk$TK_ALT_VERS/library \
100 ../tk$TK_HI_VERS/library \
101 ../tk/library \
102 /usr/src/local/tk$TK_VERS/library \
103 /usr/src/local/tk$TK_ALT_VERS/library \
104 /usr/src/local/tk$TK_HI_VERS/library \
105 /usr/contrib/include \
106 /usr/local/lib/tk$TK_VERS \
107 /usr/local/lib/tk$TK_ALT_VERS \
108 /usr/local/lib/tk$TK_HI_VERS \
109 /usr/local/include/tk$TK_VERS \
110 /usr/local/include/tk$TK_ALT_VERS \
111 /usr/local/include/tk$TK_HI_VERS \
112 /usr/local/include \
113 /usr/lib/tk$TK_VERS \
114 /usr/lib/tk$TK_ALT_VERS \
115 /usr/lib/tk$TK_HI_VERS \
116 $prefix/include \
117 $prefix/lib/tk \
118 $x_includes/tk \
119 $x_includes \
120 /usr/include"
121 TK_H_PLACES_D="$d \
122 $d/generic \
123 $d/../generic \
124 $d/../include/tk$TK_VERS \
125 $d/../include/tk$TK_HI_VERS \
126 $d/include/tk$TK_VERS \
127 $d/include/tk$TK_HI_VERS \
128 $d/include"
129 TK_H_PLACES=" \
130 ../include \
131 ../tk$TK_VERS/generic \
132 ../tk$TK_ALT_VERS/generic \
133 ../tk$TK_HI_VERS/generic \
134 /usr/src/local/tk$TK_VERS/generic \
135 /usr/src/local/tk$TK_ALT_VERS/generic \
136 /usr/src/local/tk$TK_HI_VERS/generic \
137 /usr/contrib/include \
138 /usr/local/lib/tk$TK_VERS \
139 /usr/local/lib/tk$TK_ALT_VERS \
140 /usr/local/lib/tk$TK_HI_VERS \
141 /usr/local/include/tk$TK_VERS \
142 /usr/local/include/tk$TK_ALT_VERS \
143 /usr/local/include/tk$TK_HI_VERS \
144 /usr/local/include \
145 /import/tk/include/tk$TK_VERS \
146 /import/tk/include/tk$TK_ALT_VERS \
147 /import/tk/include/tk$TK_HI_VERS \
148 $prefix/include \
149 $x_includes/tk \
150 $x_includes \
151 /usr/include \
152 /usr/include/tcl"
153 TK_LIB_PLACES_D="$d \
154 $d/lib \
155 $d/unix"
156 TK_LIB_PLACES=" \
157 ../lib \
158 ../lib/tk$TK_HI_VERS \
159 ../lib/tk$TK_VERS \
160 ../lib/tk$TK_ALT_VERS \
161 ../tk$TK_VERS/unix \
162 ../tk$TK_ALT_VERS/unix \
163 ../tk$TK_HI_VERS/unix \
164 /usr/src/local/tk$TK_VERS/unix \
165 /usr/src/local/tk$TK_ALT_VERS/unix \
166 /usr/src/local/tk$TK_HI_VERS/unix \
167 /usr/contrib/lib \
168 /usr/local/lib/tk$TK_VERS \
169 /usr/local/lib/tk$TK_ALT_VERS \
170 /usr/local/lib/tk$TK_HI_VERS \
171 /usr/local/lib \
172 $prefix/lib \
173 $x_libs/tk \
174 $x_libs \
175 /usr/lib"
176
177 dnl
178 dnl If the --with-tk argument points to a build directory that
179 dnl is separate from the source directory, try to read tkConfig.sh
180 dnl to chase it back to the source and add that directory to
181 dnl some search paths.
182 dnl
183
184 if test -r $d/tkConfig.sh ; then
185 d2=`(. $d/tkConfig.sh ; echo $TK_SRC_DIR)`
186
187 TK_TCL_PLACES_D="${TK_TCL_PLACES_D} $d2/library"
188 TK_H_PLACES_D="${TK_H_PLACES_D} $d2/generic"
189 fi
190
191
192 NS_BEGIN_PACKAGE(tk)
193 NS_CHECK_HEADER_PATH(tk.h,$TK_H_PLACES,$d,$TK_H_PLACES_D,V_INCLUDE_TK,tk)
194 NS_CHECK_LIB_PATH(tk$TK_HI_VERS,$TK_LIB_PLACES,$d,$TK_LIB_PLACES_D,V_LIB_TK,tk)
195 NS_CHECK_ANY_PATH(tk.tcl,$TK_TCL_PLACES,$d,$TK_TCL_PLACES_D,V_LIBRARY_TK,tk)
196 NS_END_PACKAGE(tk,no)
197
198 if test -r $V_LIBRARY_TK/optionMenu.tcl ; then
199 V_TKDOSNAMES='$(LIBRARY_TK)/optionMenu.tcl $(LIBRARY_TK)/scrollbar.tcl'
200 V_NEED_DL=""
201 else
202 V_TKDOSNAMES='$(LIBRARY_TK)/optMenu.tcl $(LIBRARY_TK)/scrlbar.tcl'
203 V_NEED_DL=YES
204 fi
205 V_TK_PROLOG_PS="$V_LIBRARY_TK/../generic/prolog.ps"
206 fi
207
208 AC_SUBST(V_TKDOSNAMES)
209 AC_SUBST(V_TK_PROLOG_PS)
210 AC_SUBST(V_LIBRARY_TK)
211
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.