Debian Codegraph @

lib/app-critcl/tea/tclconfig/tcl.m4

raw
1 # tcl.m4 --
2 #
3 # This file provides a set of autoconf macros to help TEA-enable
4 # a Tcl extension.
5 #
6 # Copyright (c) 1999-2000 Ajuba Solutions.
7 # Copyright (c) 2002-2005 ActiveState Corporation.
8 #
9 # See the file "license.terms" for information on usage and redistribution
10 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
12 AC_PREREQ([2.69])
13
14 # Possible values for key variables defined:
15 #
16 # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
17 # TEA_PLATFORM - windows unix
18 # TEA_TK_EXTENSION - True if this is a Tk extension
19 #
20
21 #------------------------------------------------------------------------
22 # TEA_PATH_TCLCONFIG --
23 #
24 # Locate the tclConfig.sh file and perform a sanity check on
25 # the Tcl compile flags
26 #
27 # Arguments:
28 # none
29 #
30 # Results:
31 #
32 # Adds the following arguments to configure:
33 # --with-tcl=...
34 #
35 # Defines the following vars:
36 # TCL_BIN_DIR Full path to the directory containing
37 # the tclConfig.sh file
38 #------------------------------------------------------------------------
39
40 AC_DEFUN([TEA_PATH_TCLCONFIG], [
41 dnl TEA specific: Make sure we are initialized
42 AC_REQUIRE([TEA_INIT])
43 #
44 # Ok, lets find the tcl configuration
45 # First, look for one uninstalled.
46 # the alternative search directory is invoked by --with-tcl
47 #
48
49 if test x"${no_tcl}" = x ; then
50 # we reset no_tcl in case something fails here
51 no_tcl=true
52 AC_ARG_WITH(tcl,
53 AS_HELP_STRING([--with-tcl],
54 [directory containing tcl configuration (tclConfig.sh)]),
55 [with_tclconfig="${withval}"])
56 AC_ARG_WITH(tcl8,
57 AS_HELP_STRING([--with-tcl8],
58 [Compile for Tcl8 in Tcl9 environment]),
59 [with_tcl8="${withval}"])
60 AC_MSG_CHECKING([for Tcl configuration])
61 AC_CACHE_VAL(ac_cv_c_tclconfig,[
62
63 # First check to see if --with-tcl was specified.
64 if test x"${with_tclconfig}" != x ; then
65 case "${with_tclconfig}" in
66 */tclConfig.sh )
67 if test -f "${with_tclconfig}"; then
68 AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
69 with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
70 fi ;;
71 esac
72 if test -f "${with_tclconfig}/tclConfig.sh" ; then
73 ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
74 else
75 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
76 fi
77 fi
78
79 # then check for a private Tcl installation
80 if test x"${ac_cv_c_tclconfig}" = x ; then
81 for i in \
82 ../tcl \
83 `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
84 `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
85 `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
86 ../../tcl \
87 `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
88 `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
89 `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
90 ../../../tcl \
91 `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
92 `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
93 `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
94 if test "${TEA_PLATFORM}" = "windows" \
95 -a -f "$i/win/tclConfig.sh" ; then
96 ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
97 break
98 fi
99 if test -f "$i/unix/tclConfig.sh" ; then
100 ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
101 break
102 fi
103 done
104 fi
105
106 # on Darwin, check in Framework installation locations
107 if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
108 for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
109 `ls -d /Library/Frameworks 2>/dev/null` \
110 `ls -d /Network/Library/Frameworks 2>/dev/null` \
111 `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/Tcl.framework 2>/dev/null` \
112 `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/Tcl.framework 2>/dev/null` \
113 `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework 2>/dev/null` \
114 ; do
115 if test -f "$i/Tcl.framework/tclConfig.sh" ; then
116 ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
117 break
118 fi
119 done
120 fi
121
122 # TEA specific: on Windows, check in common installation locations
123 if test "${TEA_PLATFORM}" = "windows" \
124 -a x"${ac_cv_c_tclconfig}" = x ; then
125 for i in `ls -d C:/Tcl/lib 2>/dev/null` \
126 `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
127 ; do
128 if test -f "$i/tclConfig.sh" ; then
129 ac_cv_c_tclconfig="`(cd $i; pwd)`"
130 break
131 fi
132 done
133 fi
134
135 # check in a few common install locations
136 if test x"${ac_cv_c_tclconfig}" = x ; then
137 for i in `ls -d ${libdir} 2>/dev/null` \
138 `ls -d ${exec_prefix}/lib 2>/dev/null` \
139 `ls -d ${prefix}/lib 2>/dev/null` \
140 `ls -d /usr/local/lib 2>/dev/null` \
141 `ls -d /usr/contrib/lib 2>/dev/null` \
142 `ls -d /usr/pkg/lib 2>/dev/null` \
143 `ls -d /usr/lib 2>/dev/null` \
144 `ls -d /usr/lib64 2>/dev/null` \
145 `ls -d /usr/lib/tcl8.6 2>/dev/null` \
146 `ls -d /usr/lib/tcl8.5 2>/dev/null` \
147 `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
148 `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
149 `ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \
150 `ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \
151 ; do
152 if test -f "$i/tclConfig.sh" ; then
153 ac_cv_c_tclconfig="`(cd $i; pwd)`"
154 break
155 fi
156 done
157 fi
158
159 # check in a few other private locations
160 if test x"${ac_cv_c_tclconfig}" = x ; then
161 for i in \
162 ${srcdir}/../tcl \
163 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
164 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
165 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
166 if test "${TEA_PLATFORM}" = "windows" \
167 -a -f "$i/win/tclConfig.sh" ; then
168 ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
169 break
170 fi
171 if test -f "$i/unix/tclConfig.sh" ; then
172 ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
173 break
174 fi
175 done
176 fi
177 ])
178
179 if test x"${ac_cv_c_tclconfig}" = x ; then
180 TCL_BIN_DIR="# no Tcl configs found"
181 AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
182 else
183 no_tcl=
184 TCL_BIN_DIR="${ac_cv_c_tclconfig}"
185 AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
186 fi
187 fi
188 ])
189
190 #------------------------------------------------------------------------
191 # TEA_PATH_TKCONFIG --
192 #
193 # Locate the tkConfig.sh file
194 #
195 # Arguments:
196 # none
197 #
198 # Results:
199 #
200 # Adds the following arguments to configure:
201 # --with-tk=...
202 #
203 # Defines the following vars:
204 # TK_BIN_DIR Full path to the directory containing
205 # the tkConfig.sh file
206 #------------------------------------------------------------------------
207
208 AC_DEFUN([TEA_PATH_TKCONFIG], [
209 #
210 # Ok, lets find the tk configuration
211 # First, look for one uninstalled.
212 # the alternative search directory is invoked by --with-tk
213 #
214
215 if test x"${no_tk}" = x ; then
216 # we reset no_tk in case something fails here
217 no_tk=true
218 AC_ARG_WITH(tk,
219 AS_HELP_STRING([--with-tk],
220 [directory containing tk configuration (tkConfig.sh)]),
221 [with_tkconfig="${withval}"])
222 AC_MSG_CHECKING([for Tk configuration])
223 AC_CACHE_VAL(ac_cv_c_tkconfig,[
224
225 # First check to see if --with-tkconfig was specified.
226 if test x"${with_tkconfig}" != x ; then
227 case "${with_tkconfig}" in
228 */tkConfig.sh )
229 if test -f "${with_tkconfig}"; then
230 AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
231 with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
232 fi ;;
233 esac
234 if test -f "${with_tkconfig}/tkConfig.sh" ; then
235 ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
236 else
237 AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
238 fi
239 fi
240
241 # then check for a private Tk library
242 if test x"${ac_cv_c_tkconfig}" = x ; then
243 for i in \
244 ../tk \
245 `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
246 `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
247 `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
248 ../../tk \
249 `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
250 `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
251 `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
252 ../../../tk \
253 `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
254 `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
255 `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
256 if test "${TEA_PLATFORM}" = "windows" \
257 -a -f "$i/win/tkConfig.sh" ; then
258 ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
259 break
260 fi
261 if test -f "$i/unix/tkConfig.sh" ; then
262 ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
263 break
264 fi
265 done
266 fi
267
268 # on Darwin, check in Framework installation locations
269 if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
270 for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
271 `ls -d /Library/Frameworks 2>/dev/null` \
272 `ls -d /Network/Library/Frameworks 2>/dev/null` \
273 ; do
274 if test -f "$i/Tk.framework/tkConfig.sh" ; then
275 ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
276 break
277 fi
278 done
279 fi
280
281 # check in a few common install locations
282 if test x"${ac_cv_c_tkconfig}" = x ; then
283 for i in `ls -d ${libdir} 2>/dev/null` \
284 `ls -d ${exec_prefix}/lib 2>/dev/null` \
285 `ls -d ${prefix}/lib 2>/dev/null` \
286 `ls -d /usr/local/lib 2>/dev/null` \
287 `ls -d /usr/contrib/lib 2>/dev/null` \
288 `ls -d /usr/pkg/lib 2>/dev/null` \
289 `ls -d /usr/lib/tk8.6 2>/dev/null` \
290 `ls -d /usr/lib/tk8.5 2>/dev/null` \
291 `ls -d /usr/lib 2>/dev/null` \
292 `ls -d /usr/lib64 2>/dev/null` \
293 `ls -d /usr/local/lib/tk8.6 2>/dev/null` \
294 `ls -d /usr/local/lib/tk8.5 2>/dev/null` \
295 `ls -d /usr/local/lib/tcl/tk8.6 2>/dev/null` \
296 `ls -d /usr/local/lib/tcl/tk8.5 2>/dev/null` \
297 ; do
298 if test -f "$i/tkConfig.sh" ; then
299 ac_cv_c_tkconfig="`(cd $i; pwd)`"
300 break
301 fi
302 done
303 fi
304
305 # TEA specific: on Windows, check in common installation locations
306 if test "${TEA_PLATFORM}" = "windows" \
307 -a x"${ac_cv_c_tkconfig}" = x ; then
308 for i in `ls -d C:/Tcl/lib 2>/dev/null` \
309 `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
310 ; do
311 if test -f "$i/tkConfig.sh" ; then
312 ac_cv_c_tkconfig="`(cd $i; pwd)`"
313 break
314 fi
315 done
316 fi
317
318 # check in a few other private locations
319 if test x"${ac_cv_c_tkconfig}" = x ; then
320 for i in \
321 ${srcdir}/../tk \
322 `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
323 `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
324 `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
325 if test "${TEA_PLATFORM}" = "windows" \
326 -a -f "$i/win/tkConfig.sh" ; then
327 ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
328 break
329 fi
330 if test -f "$i/unix/tkConfig.sh" ; then
331 ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
332 break
333 fi
334 done
335 fi
336 ])
337
338 if test x"${ac_cv_c_tkconfig}" = x ; then
339 TK_BIN_DIR="# no Tk configs found"
340 AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
341 else
342 no_tk=
343 TK_BIN_DIR="${ac_cv_c_tkconfig}"
344 AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
345 fi
346 fi
347 ])
348
349 #------------------------------------------------------------------------
350 # TEA_LOAD_TCLCONFIG --
351 #
352 # Load the tclConfig.sh file
353 #
354 # Arguments:
355 #
356 # Requires the following vars to be set:
357 # TCL_BIN_DIR
358 #
359 # Results:
360 #
361 # Substitutes the following vars:
362 # TCL_BIN_DIR
363 # TCL_SRC_DIR
364 # TCL_LIB_FILE
365 # TCL_ZIP_FILE
366 # TCL_ZIPFS_SUPPORT
367 #------------------------------------------------------------------------
368
369 AC_DEFUN([TEA_LOAD_TCLCONFIG], [
370 AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
371
372 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
373 AC_MSG_RESULT([loading])
374 . "${TCL_BIN_DIR}/tclConfig.sh"
375 else
376 AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
377 fi
378
379 # If the TCL_BIN_DIR is the build directory (not the install directory),
380 # then set the common variable name to the value of the build variables.
381 # For example, the variable TCL_LIB_SPEC will be set to the value
382 # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
383 # instead of TCL_BUILD_LIB_SPEC since it will work with both an
384 # installed and uninstalled version of Tcl.
385 if test -f "${TCL_BIN_DIR}/Makefile" ; then
386 TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
387 TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
388 TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
389 elif test "`uname -s`" = "Darwin"; then
390 # If Tcl was built as a framework, attempt to use the libraries
391 # from the framework at the given location so that linking works
392 # against Tcl.framework installed in an arbitrary location.
393 case ${TCL_DEFS} in
394 *TCL_FRAMEWORK*)
395 if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
396 for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
397 "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
398 if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
399 TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
400 break
401 fi
402 done
403 fi
404 if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
405 TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
406 TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
407 fi
408 ;;
409 esac
410 fi
411
412 AC_SUBST(TCL_VERSION)
413 AC_SUBST(TCL_PATCH_LEVEL)
414 AC_SUBST(TCL_BIN_DIR)
415 AC_SUBST(TCL_SRC_DIR)
416
417 AC_SUBST(TCL_LIB_FILE)
418 AC_SUBST(TCL_LIB_FLAG)
419 AC_SUBST(TCL_LIB_SPEC)
420
421 AC_SUBST(TCL_STUB_LIB_FILE)
422 AC_SUBST(TCL_STUB_LIB_FLAG)
423 AC_SUBST(TCL_STUB_LIB_SPEC)
424
425 AC_MSG_CHECKING([platform])
426 hold_cc=$CC; CC="$TCL_CC"
427 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
428 #ifdef _WIN32
429 #error win32
430 #endif
431 ]])],[
432 # first test we've already retrieved platform (cross-compile), fallback to unix otherwise:
433 TEA_PLATFORM="${TEA_PLATFORM-unix}"
434 CYGPATH=echo
435 ],[
436 TEA_PLATFORM="windows"
437 AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo)
438 ])
439 CC=$hold_cc
440 AC_MSG_RESULT($TEA_PLATFORM)
441
442 # The BUILD_$pkg is to define the correct extern storage class
443 # handling when making this package
444 AC_DEFINE_UNQUOTED(BUILD_${PACKAGE_NAME}, [],
445 [Building extension source?])
446 # Do this here as we have fully defined TEA_PLATFORM now
447 if test "${TEA_PLATFORM}" = "windows" ; then
448 EXEEXT=".exe"
449 CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
450 fi
451
452 # TEA specific:
453 AC_SUBST(CLEANFILES)
454 AC_SUBST(TCL_LIBS)
455 AC_SUBST(TCL_DEFS)
456 AC_SUBST(TCL_EXTRA_CFLAGS)
457 AC_SUBST(TCL_LD_FLAGS)
458 AC_SUBST(TCL_SHLIB_LD_LIBS)
459 ])
460
461 #------------------------------------------------------------------------
462 # TEA_LOAD_TKCONFIG --
463 #
464 # Load the tkConfig.sh file
465 #
466 # Arguments:
467 #
468 # Requires the following vars to be set:
469 # TK_BIN_DIR
470 #
471 # Results:
472 #
473 # Sets the following vars that should be in tkConfig.sh:
474 # TK_BIN_DIR
475 #------------------------------------------------------------------------
476
477 AC_DEFUN([TEA_LOAD_TKCONFIG], [
478 AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
479
480 if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
481 AC_MSG_RESULT([loading])
482 . "${TK_BIN_DIR}/tkConfig.sh"
483 else
484 AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
485 fi
486
487 # If the TK_BIN_DIR is the build directory (not the install directory),
488 # then set the common variable name to the value of the build variables.
489 # For example, the variable TK_LIB_SPEC will be set to the value
490 # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
491 # instead of TK_BUILD_LIB_SPEC since it will work with both an
492 # installed and uninstalled version of Tcl.
493 if test -f "${TK_BIN_DIR}/Makefile" ; then
494 TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
495 TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
496 TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
497 elif test "`uname -s`" = "Darwin"; then
498 # If Tk was built as a framework, attempt to use the libraries
499 # from the framework at the given location so that linking works
500 # against Tk.framework installed in an arbitrary location.
501 case ${TK_DEFS} in
502 *TK_FRAMEWORK*)
503 if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
504 for i in "`cd "${TK_BIN_DIR}"; pwd`" \
505 "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
506 if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
507 TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
508 break
509 fi
510 done
511 fi
512 if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
513 TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
514 TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
515 fi
516 ;;
517 esac
518 fi
519
520 # TEA specific: Ensure windowingsystem is defined
521 if test "${TEA_PLATFORM}" = "unix" ; then
522 case ${TK_DEFS} in
523 *MAC_OSX_TK*)
524 AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
525 TEA_WINDOWINGSYSTEM="aqua"
526 ;;
527 *)
528 TEA_WINDOWINGSYSTEM="x11"
529 ;;
530 esac
531 elif test "${TEA_PLATFORM}" = "windows" ; then
532 TEA_WINDOWINGSYSTEM="win32"
533 fi
534
535 AC_SUBST(TK_VERSION)
536 AC_SUBST(TK_BIN_DIR)
537 AC_SUBST(TK_SRC_DIR)
538
539 AC_SUBST(TK_LIB_FILE)
540 AC_SUBST(TK_LIB_FLAG)
541 AC_SUBST(TK_LIB_SPEC)
542
543 AC_SUBST(TK_STUB_LIB_FILE)
544 AC_SUBST(TK_STUB_LIB_FLAG)
545 AC_SUBST(TK_STUB_LIB_SPEC)
546
547 # TEA specific:
548 AC_SUBST(TK_LIBS)
549 AC_SUBST(TK_XINCLUDES)
550 ])
551
552 #------------------------------------------------------------------------
553 # TEA_PROG_TCLSH
554 # Determine the fully qualified path name of the tclsh executable
555 # in the Tcl build directory or the tclsh installed in a bin
556 # directory. This macro will correctly determine the name
557 # of the tclsh executable even if tclsh has not yet been
558 # built in the build directory. The tclsh found is always
559 # associated with a tclConfig.sh file. This tclsh should be used
560 # only for running extension test cases. It should never be
561 # or generation of files (like pkgIndex.tcl) at build time.
562 #
563 # Arguments:
564 # none
565 #
566 # Results:
567 # Substitutes the following vars:
568 # TCLSH_PROG
569 #------------------------------------------------------------------------
570
571 AC_DEFUN([TEA_PROG_TCLSH], [
572 AC_MSG_CHECKING([for tclsh])
573 if test -f "${TCL_BIN_DIR}/Makefile" ; then
574 # tclConfig.sh is in Tcl build directory
575 if test "${TEA_PLATFORM}" = "windows"; then
576 if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then
577 TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
578 elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then
579 TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}"
580 elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then
581 TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}"
582 elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then
583 TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}"
584 fi
585 else
586 TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
587 fi
588 else
589 # tclConfig.sh is in install location
590 if test "${TEA_PLATFORM}" = "windows"; then
591 TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
592 else
593 TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
594 fi
595 list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
596 `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
597 `ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
598 for i in $list ; do
599 if test -f "$i/${TCLSH_PROG}" ; then
600 REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
601 break
602 fi
603 done
604 TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
605 fi
606 AC_MSG_RESULT([${TCLSH_PROG}])
607 AC_SUBST(TCLSH_PROG)
608 ])
609
610 #------------------------------------------------------------------------
611 # TEA_PROG_WISH
612 # Determine the fully qualified path name of the wish executable
613 # in the Tk build directory or the wish installed in a bin
614 # directory. This macro will correctly determine the name
615 # of the wish executable even if wish has not yet been
616 # built in the build directory. The wish found is always
617 # associated with a tkConfig.sh file. This wish should be used
618 # only for running extension test cases. It should never be
619 # or generation of files (like pkgIndex.tcl) at build time.
620 #
621 # Arguments:
622 # none
623 #
624 # Results:
625 # Substitutes the following vars:
626 # WISH_PROG
627 #------------------------------------------------------------------------
628
629 AC_DEFUN([TEA_PROG_WISH], [
630 AC_MSG_CHECKING([for wish])
631 if test -f "${TK_BIN_DIR}/Makefile" ; then
632 # tkConfig.sh is in Tk build directory
633 if test "${TEA_PLATFORM}" = "windows"; then
634 if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" ; then
635 WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}"
636 elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}s${EXEEXT}" ; then
637 WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}$s{EXEEXT}"
638 elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" ; then
639 WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}"
640 elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" ; then
641 WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}"
642 fi
643 else
644 WISH_PROG="${TK_BIN_DIR}/wish"
645 fi
646 else
647 # tkConfig.sh is in install location
648 if test "${TEA_PLATFORM}" = "windows"; then
649 WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}"
650 else
651 WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
652 fi
653 list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
654 `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
655 `ls -d ${TK_PREFIX}/bin 2>/dev/null`"
656 for i in $list ; do
657 if test -f "$i/${WISH_PROG}" ; then
658 REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
659 break
660 fi
661 done
662 WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
663 fi
664 AC_MSG_RESULT([${WISH_PROG}])
665 AC_SUBST(WISH_PROG)
666 ])
667
668 #------------------------------------------------------------------------
669 # TEA_ENABLE_SHARED --
670 #
671 # Allows the building of shared libraries
672 #
673 # Arguments:
674 # none
675 #
676 # Results:
677 #
678 # Adds the following arguments to configure:
679 # --enable-shared=yes|no
680 # --enable-stubs=yes|no
681 #
682 # Defines the following vars:
683 # STATIC_BUILD Used for building import/export libraries
684 # on Windows.
685 #
686 # Sets the following vars:
687 # SHARED_BUILD Value of 1 or 0
688 # STUBS_BUILD Value if 1 or 0
689 # USE_TCL_STUBS Value true: if SHARED_BUILD or --enable-stubs
690 # USE_TCLOO_STUBS Value true: if SHARED_BUILD or --enable-stubs
691 # USE_TK_STUBS Value true: if SHARED_BUILD or --enable-stubs
692 # AND TEA_WINDOWING_SYSTEM != ""
693 #------------------------------------------------------------------------
694 AC_DEFUN([TEA_ENABLE_SHARED], [
695 AC_MSG_CHECKING([how to build libraries])
696 AC_ARG_ENABLE(shared,
697 AS_HELP_STRING([--enable-shared],
698 [build and link with shared libraries (default: on)]),
699 [shared_ok=$enableval], [shared_ok=yes])
700
701 if test "${enable_shared+set}" = set; then
702 enableval="$enable_shared"
703 shared_ok=$enableval
704 else
705 shared_ok=yes
706 fi
707
708 AC_ARG_ENABLE(stubs,
709 AS_HELP_STRING([--enable-stubs],
710 [build and link with stub libraries. Always true for shared builds (default: on)]),
711 [stubs_ok=$enableval], [stubs_ok=yes])
712
713 if test "${enable_stubs+set}" = set; then
714 enableval="$enable_stubs"
715 stubs_ok=$enableval
716 else
717 stubs_ok=yes
718 fi
719
720 # Stubs are always enabled for shared builds
721 if test "$shared_ok" = "yes" ; then
722 AC_MSG_RESULT([shared])
723 SHARED_BUILD=1
724 STUBS_BUILD=1
725 else
726 AC_MSG_RESULT([static])
727 SHARED_BUILD=0
728 AC_DEFINE(STATIC_BUILD, 1, [This a static build])
729 if test "$stubs_ok" = "yes" ; then
730 STUBS_BUILD=1
731 else
732 STUBS_BUILD=0
733 fi
734 fi
735 if test "${STUBS_BUILD}" = "1" ; then
736 AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
737 AC_DEFINE(USE_TCLOO_STUBS, 1, [Use TclOO stubs])
738 if test "${TEA_WINDOWINGSYSTEM}" != ""; then
739 AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
740 fi
741 fi
742
743 AC_SUBST(SHARED_BUILD)
744 AC_SUBST(STUBS_BUILD)
745 ])
746
747 #------------------------------------------------------------------------
748 # TEA_ENABLE_THREADS --
749 #
750 # Specify if thread support should be enabled. If "yes" is specified
751 # as an arg (optional), threads are enabled by default, "no" means
752 # threads are disabled. "yes" is the default.
753 #
754 # TCL_THREADS is checked so that if you are compiling an extension
755 # against a threaded core, your extension must be compiled threaded
756 # as well.
757 #
758 # Note that it is legal to have a thread enabled extension run in a
759 # threaded or non-threaded Tcl core, but a non-threaded extension may
760 # only run in a non-threaded Tcl core.
761 #
762 # Arguments:
763 # none
764 #
765 # Results:
766 #
767 # Adds the following arguments to configure:
768 # --enable-threads
769 #
770 # Sets the following vars:
771 # THREADS_LIBS Thread library(s)
772 #
773 # Defines the following vars:
774 # TCL_THREADS
775 # _REENTRANT
776 # _THREAD_SAFE
777 #------------------------------------------------------------------------
778
779 AC_DEFUN([TEA_ENABLE_THREADS], [
780 AC_ARG_ENABLE(threads,
781 AS_HELP_STRING([--enable-threads],
782 [build with threads (default: on)]),
783 [tcl_ok=$enableval], [tcl_ok=yes])
784
785 if test "${enable_threads+set}" = set; then
786 enableval="$enable_threads"
787 tcl_ok=$enableval
788 else
789 tcl_ok=yes
790 fi
791
792 if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
793 TCL_THREADS=1
794
795 if test "${TEA_PLATFORM}" != "windows" ; then
796 # We are always OK on Windows, so check what this platform wants:
797
798 # USE_THREAD_ALLOC tells us to try the special thread-based
799 # allocator that significantly reduces lock contention
800 AC_DEFINE(USE_THREAD_ALLOC, 1,
801 [Do we want to use the threaded memory allocator?])
802 AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
803 if test "`uname -s`" = "SunOS" ; then
804 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
805 [Do we really want to follow the standard? Yes we do!])
806 fi
807 AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
808 AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
809 if test "$tcl_ok" = "no"; then
810 # Check a little harder for __pthread_mutex_init in the same
811 # library, as some systems hide it there until pthread.h is
812 # defined. We could alternatively do an AC_TRY_COMPILE with
813 # pthread.h, but that will work with libpthread really doesn't
814 # exist, like AIX 4.2. [Bug: 4359]
815 AC_CHECK_LIB(pthread, __pthread_mutex_init,
816 tcl_ok=yes, tcl_ok=no)
817 fi
818
819 if test "$tcl_ok" = "yes"; then
820 # The space is needed
821 THREADS_LIBS=" -lpthread"
822 else
823 AC_CHECK_LIB(pthreads, pthread_mutex_init,
824 tcl_ok=yes, tcl_ok=no)
825 if test "$tcl_ok" = "yes"; then
826 # The space is needed
827 THREADS_LIBS=" -lpthreads"
828 else
829 AC_CHECK_LIB(c, pthread_mutex_init,
830 tcl_ok=yes, tcl_ok=no)
831 if test "$tcl_ok" = "no"; then
832 AC_CHECK_LIB(c_r, pthread_mutex_init,
833 tcl_ok=yes, tcl_ok=no)
834 if test "$tcl_ok" = "yes"; then
835 # The space is needed
836 THREADS_LIBS=" -pthread"
837 else
838 TCL_THREADS=0
839 AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
840 fi
841 fi
842 fi
843 fi
844 fi
845 else
846 TCL_THREADS=0
847 fi
848 # Do checking message here to not mess up interleaved configure output
849 AC_MSG_CHECKING([for building with threads])
850 if test "${TCL_THREADS}" = 1; then
851 AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
852 AC_MSG_RESULT([yes (default)])
853 else
854 AC_MSG_RESULT([no])
855 fi
856 # TCL_THREADS sanity checking. See if our request for building with
857 # threads is the same as the way Tcl was built. If not, warn the user.
858 case ${TCL_DEFS} in
859 *THREADS=1*)
860 if test "${TCL_THREADS}" = "0"; then
861 AC_MSG_WARN([
862 Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
863 that IS thread-enabled. It is recommended to use --enable-threads.])
864 fi
865 ;;
866 esac
867 AC_SUBST(TCL_THREADS)
868 ])
869
870 #------------------------------------------------------------------------
871 # TEA_ENABLE_SYMBOLS --
872 #
873 # Specify if debugging symbols should be used.
874 # Memory (TCL_MEM_DEBUG) debugging can also be enabled.
875 #
876 # Arguments:
877 # none
878 #
879 # TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
880 # the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
881 # Requires the following vars to be set in the Makefile:
882 # CFLAGS_DEFAULT
883 # LDFLAGS_DEFAULT
884 #
885 # Results:
886 #
887 # Adds the following arguments to configure:
888 # --enable-symbols
889 #
890 # Defines the following vars:
891 # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
892 # Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false
893 # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
894 # Sets to $(LDFLAGS_OPTIMIZE) if false
895 #------------------------------------------------------------------------
896
897 AC_DEFUN([TEA_ENABLE_SYMBOLS], [
898 dnl TEA specific: Make sure we are initialized
899 AC_REQUIRE([TEA_CONFIG_CFLAGS])
900 AC_MSG_CHECKING([for build with symbols])
901 AC_ARG_ENABLE(symbols,
902 AS_HELP_STRING([--enable-symbols],
903 [build with debugging symbols (default: off)]),
904 [tcl_ok=$enableval], [tcl_ok=no])
905 if test "$tcl_ok" = "no"; then
906 CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
907 LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
908 AC_MSG_RESULT([no])
909 AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?])
910 else
911 CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
912 LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
913 if test "$tcl_ok" = "yes"; then
914 AC_MSG_RESULT([yes (standard debugging)])
915 fi
916 fi
917 AC_SUBST(CFLAGS_DEFAULT)
918 AC_SUBST(LDFLAGS_DEFAULT)
919
920 if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
921 AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
922 fi
923
924 if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
925 if test "$tcl_ok" = "all"; then
926 AC_MSG_RESULT([enabled symbols mem debugging])
927 else
928 AC_MSG_RESULT([enabled $tcl_ok debugging])
929 fi
930 fi
931 ])
932
933 #------------------------------------------------------------------------
934 # TEA_ENABLE_LANGINFO --
935 #
936 # Allows use of modern nl_langinfo check for better l10n.
937 # This is only relevant for Unix.
938 #
939 # Arguments:
940 # none
941 #
942 # Results:
943 #
944 # Adds the following arguments to configure:
945 # --enable-langinfo=yes|no (default is yes)
946 #
947 # Defines the following vars:
948 # HAVE_LANGINFO Triggers use of nl_langinfo if defined.
949 #------------------------------------------------------------------------
950
951 AC_DEFUN([TEA_ENABLE_LANGINFO], [
952 AC_ARG_ENABLE(langinfo,
953 AS_HELP_STRING([--enable-langinfo],
954 [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
955 [langinfo_ok=$enableval], [langinfo_ok=yes])
956
957 HAVE_LANGINFO=0
958 if test "$langinfo_ok" = "yes"; then
959 AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
960 fi
961 AC_MSG_CHECKING([whether to use nl_langinfo])
962 if test "$langinfo_ok" = "yes"; then
963 AC_CACHE_VAL(tcl_cv_langinfo_h, [
964 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],
965 [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
966 AC_MSG_RESULT([$tcl_cv_langinfo_h])
967 if test $tcl_cv_langinfo_h = yes; then
968 AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
969 fi
970 else
971 AC_MSG_RESULT([$langinfo_ok])
972 fi
973 ])
974
975 #--------------------------------------------------------------------
976 # TEA_CONFIG_SYSTEM
977 #
978 # Determine what the system is (some things cannot be easily checked
979 # on a feature-driven basis, alas). This can usually be done via the
980 # "uname" command.
981 #
982 # Arguments:
983 # none
984 #
985 # Results:
986 # Defines the following var:
987 #
988 # system - System/platform/version identification code.
989 #
990 #--------------------------------------------------------------------
991
992 AC_DEFUN([TEA_CONFIG_SYSTEM], [
993 AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
994 # TEA specific:
995 if test "${TEA_PLATFORM}" = "windows" ; then
996 tcl_cv_sys_version=windows
997 else
998 tcl_cv_sys_version=`uname -s`-`uname -r`
999 if test "$?" -ne 0 ; then
1000 AC_MSG_WARN([can't find uname command])
1001 tcl_cv_sys_version=unknown
1002 else
1003 if test "`uname -s`" = "AIX" ; then
1004 tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
1005 fi
1006 if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
1007 tcl_cv_sys_version=NetBSD-Debian
1008 fi
1009 fi
1010 fi
1011 ])
1012 system=$tcl_cv_sys_version
1013 ])
1014
1015 #--------------------------------------------------------------------
1016 # TEA_CONFIG_CFLAGS
1017 #
1018 # Try to determine the proper flags to pass to the compiler
1019 # for building shared libraries and other such nonsense.
1020 #
1021 # Arguments:
1022 # none
1023 #
1024 # Results:
1025 #
1026 # Defines and substitutes the following vars:
1027 #
1028 # DL_OBJS, DL_LIBS - removed for TEA, only needed by core.
1029 # LDFLAGS - Flags to pass to the compiler when linking object
1030 # files into an executable application binary such
1031 # as tclsh.
1032 # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
1033 # that tell the run-time dynamic linker where to look
1034 # for shared libraries such as libtcl.so. Depends on
1035 # the variable LIB_RUNTIME_DIR in the Makefile. Could
1036 # be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
1037 # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
1038 # that tell the run-time dynamic linker where to look
1039 # for shared libraries such as libtcl.so. Depends on
1040 # the variable LIB_RUNTIME_DIR in the Makefile.
1041 # SHLIB_CFLAGS - Flags to pass to cc when compiling the components
1042 # of a shared library (may request position-independent
1043 # code, among other things).
1044 # SHLIB_LD - Base command to use for combining object files
1045 # into a shared library.
1046 # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
1047 # creating shared libraries. This symbol typically
1048 # goes at the end of the "ld" commands that build
1049 # shared libraries. The value of the symbol defaults to
1050 # "${LIBS}" if all of the dependent libraries should
1051 # be specified when creating a shared library. If
1052 # dependent libraries should not be specified (as on
1053 # SunOS 4.x, where they cause the link to fail, or in
1054 # general if Tcl and Tk aren't themselves shared
1055 # libraries), then this symbol has an empty string
1056 # as its value.
1057 # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
1058 # extensions. An empty string means we don't know how
1059 # to use shared libraries on this platform.
1060 # LIB_SUFFIX - Specifies everything that comes after the "libfoo"
1061 # in a static or shared library name, using the $PACKAGE_VERSION variable
1062 # to put the version in the right place. This is used
1063 # by platforms that need non-standard library names.
1064 # Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, since it needs
1065 # to have a version after the .so, and ${PACKAGE_VERSION}.a
1066 # on AIX, since a shared library needs to have
1067 # a .a extension whereas shared objects for loadable
1068 # extensions have a .so extension. Defaults to
1069 # ${PACKAGE_VERSION}${SHLIB_SUFFIX}.
1070 # CFLAGS_DEBUG -
1071 # Flags used when running the compiler in debug mode
1072 # CFLAGS_OPTIMIZE -
1073 # Flags used when running the compiler in optimize mode
1074 # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
1075 #--------------------------------------------------------------------
1076
1077 AC_DEFUN([TEA_CONFIG_CFLAGS], [
1078 dnl TEA specific: Make sure we are initialized
1079 AC_REQUIRE([TEA_INIT])
1080
1081 # Step 0.a: Enable 64 bit support?
1082
1083 AC_MSG_CHECKING([if 64bit support is requested])
1084 AC_ARG_ENABLE(64bit,
1085 AS_HELP_STRING([--enable-64bit],
1086 [enable 64bit support (default: off)]),
1087 [do64bit=$enableval], [do64bit=no])
1088 AC_MSG_RESULT([$do64bit])
1089
1090 # Step 0.b: Enable Solaris 64 bit VIS support?
1091
1092 AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
1093 AC_ARG_ENABLE(64bit-vis,
1094 AS_HELP_STRING([--enable-64bit-vis],
1095 [enable 64bit Sparc VIS support (default: off)]),
1096 [do64bitVIS=$enableval], [do64bitVIS=no])
1097 AC_MSG_RESULT([$do64bitVIS])
1098 # Force 64bit on with VIS
1099 AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
1100
1101 # Step 0.c: Check if visibility support is available. Do this here so
1102 # that platform specific alternatives can be used below if this fails.
1103
1104 AC_CACHE_CHECK([if compiler supports visibility "hidden"],
1105 tcl_cv_cc_visibility_hidden, [
1106 hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
1107 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1108 extern __attribute__((__visibility__("hidden"))) void f(void);
1109 void f(void) {}]], [[f();]])],[tcl_cv_cc_visibility_hidden=yes],
1110 [tcl_cv_cc_visibility_hidden=no])
1111 CFLAGS=$hold_cflags])
1112 AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
1113 AC_DEFINE(MODULE_SCOPE,
1114 [extern __attribute__((__visibility__("hidden")))],
1115 [Compiler support for module scope symbols])
1116 AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
1117 ])
1118
1119 # Step 0.d: Disable -rpath support?
1120
1121 AC_MSG_CHECKING([if rpath support is requested])
1122 AC_ARG_ENABLE(rpath,
1123 AS_HELP_STRING([--disable-rpath],
1124 [disable rpath support (default: on)]),
1125 [doRpath=$enableval], [doRpath=yes])
1126 AC_MSG_RESULT([$doRpath])
1127
1128 # Set the variable "system" to hold the name and version number
1129 # for the system.
1130
1131 TEA_CONFIG_SYSTEM
1132
1133 # Require ranlib early so we can override it in special cases below.
1134
1135 AC_REQUIRE([AC_PROG_RANLIB])
1136
1137 # Set configuration options based on system name and version.
1138 # This is similar to Tcl's unix/tcl.m4 except that we've added a
1139 # "windows" case and removed some core-only vars.
1140
1141 do64bit_ok=no
1142 # default to '{$LIBS}' and set to "" on per-platform necessary basis
1143 SHLIB_LD_LIBS='${LIBS}'
1144 # When ld needs options to work in 64-bit mode, put them in
1145 # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
1146 # is disabled by the user. [Bug 1016796]
1147 LDFLAGS_ARCH=""
1148 UNSHARED_LIB_SUFFIX=""
1149 # TEA specific: use PACKAGE_VERSION instead of VERSION
1150 TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
1151 ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
1152 TCL_LIB_VERSIONS_OK=ok
1153 CFLAGS_DEBUG=-g
1154 AS_IF([test "$GCC" = yes], [
1155 CFLAGS_OPTIMIZE=-O2
1156 CFLAGS_WARNING="-Wall"
1157 ], [
1158 CFLAGS_OPTIMIZE=-O
1159 CFLAGS_WARNING=""
1160 ])
1161 AC_CHECK_TOOL(AR, ar)
1162 STLIB_LD='${AR} cr'
1163 LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
1164 AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION=""],[SHLIB_VERSION=".$SHLIB_VERSION"])
1165 case $system in
1166 # TEA specific:
1167 windows)
1168 MACHINE="X86"
1169 if test "$do64bit" != "no" ; then
1170 case "$do64bit" in
1171 amd64|x64|yes)
1172 MACHINE="AMD64" ; # default to AMD64 64-bit build
1173 ;;
1174 arm64|aarch64)
1175 MACHINE="ARM64"
1176 ;;
1177 ia64)
1178 MACHINE="IA64"
1179 ;;
1180 esac
1181 fi
1182
1183 if test "$GCC" != "yes" ; then
1184 if test "${SHARED_BUILD}" = "0" ; then
1185 runtime=-MT
1186 else
1187 runtime=-MD
1188 fi
1189 case "x`echo \${VisualStudioVersion}`" in
1190 x1[[4-9]]*)
1191 lflags="${lflags} -nodefaultlib:libucrt.lib"
1192 TEA_ADD_LIBS([ucrt.lib])
1193 ;;
1194 *)
1195 ;;
1196 esac
1197
1198 if test "$do64bit" != "no" ; then
1199 CC="cl.exe"
1200 RC="rc.exe"
1201 lflags="${lflags} -nologo -MACHINE:${MACHINE} "
1202 LINKBIN="link.exe"
1203 CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
1204 CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
1205 # Avoid 'unresolved external symbol __security_cookie'
1206 # errors, c.f. http://support.microsoft.com/?id=894573
1207 TEA_ADD_LIBS([bufferoverflowU.lib])
1208 else
1209 RC="rc"
1210 lflags="${lflags} -nologo"
1211 LINKBIN="link"
1212 CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
1213 CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
1214 fi
1215 fi
1216
1217 if test "$GCC" = "yes"; then
1218 # mingw gcc mode
1219 AC_CHECK_TOOL(RC, windres)
1220 CFLAGS_DEBUG="-g"
1221 CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
1222 SHLIB_LD='${CC} -shared'
1223 UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1224 LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
1225 LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
1226
1227 AC_CACHE_CHECK(for cross-compile version of gcc,
1228 ac_cv_cross,
1229 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1230 #ifdef _WIN32
1231 #error cross-compiler
1232 #endif
1233 ]], [[]])],
1234 [ac_cv_cross=yes],
1235 [ac_cv_cross=no])
1236 )
1237 if test "$ac_cv_cross" = "yes"; then
1238 case "$do64bit" in
1239 amd64|x64|yes)
1240 CC="x86_64-w64-mingw32-${CC}"
1241 LD="x86_64-w64-mingw32-ld"
1242 AR="x86_64-w64-mingw32-ar"
1243 RANLIB="x86_64-w64-mingw32-ranlib"
1244 RC="x86_64-w64-mingw32-windres"
1245 ;;
1246 arm64|aarch64)
1247 CC="aarch64-w64-mingw32-clang"
1248 LD="aarch64-w64-mingw32-ld"
1249 AR="aarch64-w64-mingw32-ar"
1250 RANLIB="aarch64-w64-mingw32-ranlib"
1251 RC="aarch64-w64-mingw32-windres"
1252 ;;
1253 *)
1254 CC="i686-w64-mingw32-${CC}"
1255 LD="i686-w64-mingw32-ld"
1256 AR="i686-w64-mingw32-ar"
1257 RANLIB="i686-w64-mingw32-ranlib"
1258 RC="i686-w64-mingw32-windres"
1259 ;;
1260 esac
1261 fi
1262
1263 else
1264 SHLIB_LD="${LINKBIN} -dll ${lflags}"
1265 # link -lib only works when -lib is the first arg
1266 STLIB_LD="${LINKBIN} -lib ${lflags}"
1267 UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
1268 PATHTYPE=-w
1269 # For information on what debugtype is most useful, see:
1270 # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
1271 # and also
1272 # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
1273 # This essentially turns it all on.
1274 LDFLAGS_DEBUG="-debug -debugtype:cv"
1275 LDFLAGS_OPTIMIZE="-release"
1276 LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
1277 LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
1278 fi
1279
1280 SHLIB_SUFFIX=".dll"
1281 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
1282
1283 TCL_LIB_VERSIONS_OK=nodots
1284 ;;
1285 AIX-*)
1286 AS_IF([test "$GCC" != "yes"], [
1287 # AIX requires the _r compiler when gcc isn't being used
1288 case "${CC}" in
1289 *_r|*_r\ *)
1290 # ok ...
1291 ;;
1292 *)
1293 # Make sure only first arg gets _r
1294 CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
1295 ;;
1296 esac
1297 AC_MSG_RESULT([Using $CC for compiling with threads])
1298 ])
1299 LIBS="$LIBS -lc"
1300 SHLIB_CFLAGS=""
1301 SHLIB_SUFFIX=".so"
1302
1303 LD_LIBRARY_PATH_VAR="LIBPATH"
1304
1305 # Check to enable 64-bit flags for compiler/linker
1306 AS_IF([test "$do64bit" = yes], [
1307 AS_IF([test "$GCC" = yes], [
1308 AC_MSG_WARN([64bit mode not supported with GCC on $system])
1309 ], [
1310 do64bit_ok=yes
1311 CFLAGS="$CFLAGS -q64"
1312 LDFLAGS_ARCH="-q64"
1313 RANLIB="${RANLIB} -X64"
1314 AR="${AR} -X64"
1315 SHLIB_LD_FLAGS="-b64"
1316 ])
1317 ])
1318
1319 AS_IF([test "`uname -m`" = ia64], [
1320 # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
1321 SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1322 AS_IF([test "$GCC" = yes], [
1323 CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
1324 ], [
1325 CC_SEARCH_FLAGS='"-R${LIB_RUNTIME_DIR}"'
1326 ])
1327 LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"'
1328 ], [
1329 AS_IF([test "$GCC" = yes], [
1330 SHLIB_LD='${CC} -shared -Wl,-bexpall'
1331 ], [
1332 SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
1333 LDFLAGS="$LDFLAGS -brtl"
1334 ])
1335 SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
1336 CC_SEARCH_FLAGS='"-L${LIB_RUNTIME_DIR}"'
1337 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1338 ])
1339 ;;
1340 BeOS*)
1341 SHLIB_CFLAGS="-fPIC"
1342 SHLIB_LD='${CC} -nostart'
1343 SHLIB_SUFFIX=".so"
1344
1345 #-----------------------------------------------------------
1346 # Check for inet_ntoa in -lbind, for BeOS (which also needs
1347 # -lsocket, even if the network functions are in -lnet which
1348 # is always linked to, for compatibility.
1349 #-----------------------------------------------------------
1350 AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
1351 ;;
1352 BSD/OS-2.1*|BSD/OS-3*)
1353 SHLIB_CFLAGS=""
1354 SHLIB_LD="shlicc -r"
1355 SHLIB_SUFFIX=".so"
1356 CC_SEARCH_FLAGS=""
1357 LD_SEARCH_FLAGS=""
1358 ;;
1359 BSD/OS-4.*)
1360 SHLIB_CFLAGS="-export-dynamic -fPIC"
1361 SHLIB_LD='${CC} -shared'
1362 SHLIB_SUFFIX=".so"
1363 LDFLAGS="$LDFLAGS -export-dynamic"
1364 CC_SEARCH_FLAGS=""
1365 LD_SEARCH_FLAGS=""
1366 ;;
1367 CYGWIN_*)
1368 SHLIB_CFLAGS=""
1369 SHLIB_LD='${CC} -shared'
1370 SHLIB_SUFFIX=".dll"
1371 SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a"
1372 EXEEXT=".exe"
1373 do64bit_ok=yes
1374 CC_SEARCH_FLAGS=""
1375 LD_SEARCH_FLAGS=""
1376 ;;
1377 dgux*)
1378 SHLIB_CFLAGS="-K PIC"
1379 SHLIB_LD='${CC} -G'
1380 SHLIB_LD_LIBS=""
1381 SHLIB_SUFFIX=".so"
1382 CC_SEARCH_FLAGS=""
1383 LD_SEARCH_FLAGS=""
1384 ;;
1385 Haiku*)
1386 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1387 SHLIB_CFLAGS="-fPIC"
1388 SHLIB_SUFFIX=".so"
1389 SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
1390 AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
1391 ;;
1392 HP-UX-*.11.*)
1393 # Use updated header definitions where possible
1394 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
1395 # TEA specific: Needed by Tcl, but not most extensions
1396 #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
1397 #LIBS="$LIBS -lxnet" # Use the XOPEN network library
1398
1399 AS_IF([test "`uname -m`" = ia64], [
1400 SHLIB_SUFFIX=".so"
1401 ], [
1402 SHLIB_SUFFIX=".sl"
1403 ])
1404 AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1405 AS_IF([test "$tcl_ok" = yes], [
1406 SHLIB_CFLAGS="+z"
1407 SHLIB_LD="ld -b"
1408 LDFLAGS="$LDFLAGS -Wl,-E"
1409 CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."'
1410 LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."'
1411 LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1412 ])
1413 AS_IF([test "$GCC" = yes], [
1414 SHLIB_LD='${CC} -shared'
1415 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1416 ], [
1417 CFLAGS="$CFLAGS -z"
1418 ])
1419
1420 # Check to enable 64-bit flags for compiler/linker
1421 AS_IF([test "$do64bit" = "yes"], [
1422 AS_IF([test "$GCC" = yes], [
1423 case `${CC} -dumpmachine` in
1424 hppa64*)
1425 # 64-bit gcc in use. Fix flags for GNU ld.
1426 do64bit_ok=yes
1427 SHLIB_LD='${CC} -shared'
1428 AS_IF([test $doRpath = yes], [
1429 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
1430 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1431 ;;
1432 *)
1433 AC_MSG_WARN([64bit mode not supported with GCC on $system])
1434 ;;
1435 esac
1436 ], [
1437 do64bit_ok=yes
1438 CFLAGS="$CFLAGS +DD64"
1439 LDFLAGS_ARCH="+DD64"
1440 ])
1441 ]) ;;
1442 HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
1443 SHLIB_SUFFIX=".sl"
1444 AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1445 AS_IF([test "$tcl_ok" = yes], [
1446 SHLIB_CFLAGS="+z"
1447 SHLIB_LD="ld -b"
1448 SHLIB_LD_LIBS=""
1449 LDFLAGS="$LDFLAGS -Wl,-E"
1450 CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."'
1451 LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."'
1452 LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1453 ]) ;;
1454 IRIX-5.*)
1455 SHLIB_CFLAGS=""
1456 SHLIB_LD="ld -shared -rdata_shared"
1457 SHLIB_SUFFIX=".so"
1458 AC_LIBOBJ(mkstemp)
1459 AS_IF([test $doRpath = yes], [
1460 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
1461 LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"'])
1462 ;;
1463 IRIX-6.*)
1464 SHLIB_CFLAGS=""
1465 SHLIB_LD="ld -n32 -shared -rdata_shared"
1466 SHLIB_SUFFIX=".so"
1467 AS_IF([test $doRpath = yes], [
1468 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
1469 LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"'])
1470 AS_IF([test "$GCC" = yes], [
1471 CFLAGS="$CFLAGS -mabi=n32"
1472 LDFLAGS="$LDFLAGS -mabi=n32"
1473 ], [
1474 case $system in
1475 IRIX-6.3)
1476 # Use to build 6.2 compatible binaries on 6.3.
1477 CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
1478 ;;
1479 *)
1480 CFLAGS="$CFLAGS -n32"
1481 ;;
1482 esac
1483 LDFLAGS="$LDFLAGS -n32"
1484 ])
1485 ;;
1486 IRIX64-6.*)
1487 SHLIB_CFLAGS=""
1488 SHLIB_LD="ld -n32 -shared -rdata_shared"
1489 SHLIB_SUFFIX=".so"
1490 AS_IF([test $doRpath = yes], [
1491 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
1492 LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"'])
1493
1494 # Check to enable 64-bit flags for compiler/linker
1495
1496 AS_IF([test "$do64bit" = yes], [
1497 AS_IF([test "$GCC" = yes], [
1498 AC_MSG_WARN([64bit mode not supported by gcc])
1499 ], [
1500 do64bit_ok=yes
1501 SHLIB_LD="ld -64 -shared -rdata_shared"
1502 CFLAGS="$CFLAGS -64"
1503 LDFLAGS_ARCH="-64"
1504 ])
1505 ])
1506 ;;
1507 Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
1508 SHLIB_CFLAGS="-fPIC"
1509 SHLIB_SUFFIX=".so"
1510
1511 # TEA specific:
1512 CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
1513
1514 # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
1515 SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS_DEFAULT} -shared'
1516 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1517
1518 case $system in
1519 DragonFly-*|FreeBSD-*)
1520 AS_IF([test "${TCL_THREADS}" = "1"], [
1521 # The -pthread needs to go in the LDFLAGS, not LIBS
1522 LIBS=`echo $LIBS | sed s/-pthread//`
1523 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1524 LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
1525 ;;
1526 esac
1527
1528 AS_IF([test $doRpath = yes], [
1529 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
1530 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1531 AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
1532 AS_IF([test $do64bit = yes], [
1533 AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
1534 hold_cflags=$CFLAGS
1535 CFLAGS="$CFLAGS -m64"
1536 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
1537 [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no])
1538 CFLAGS=$hold_cflags])
1539 AS_IF([test $tcl_cv_cc_m64 = yes], [
1540 CFLAGS="$CFLAGS -m64"
1541 do64bit_ok=yes
1542 ])
1543 ])
1544
1545 # The combo of gcc + glibc has a bug related to inlining of
1546 # functions like strtod(). The -fno-builtin flag should address
1547 # this problem but it does not work. The -fno-inline flag is kind
1548 # of overkill but it works. Disable inlining only when one of the
1549 # files in compat/*.c is being linked in.
1550
1551 AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
1552 ;;
1553 Lynx*)
1554 SHLIB_CFLAGS="-fPIC"
1555 SHLIB_SUFFIX=".so"
1556 CFLAGS_OPTIMIZE=-02
1557 SHLIB_LD='${CC} -shared'
1558 LD_FLAGS="-Wl,--export-dynamic"
1559 AS_IF([test $doRpath = yes], [
1560 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
1561 LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
1562 ;;
1563 OpenBSD-*)
1564 arch=`arch -s`
1565 case "$arch" in
1566 alpha|sparc64)
1567 SHLIB_CFLAGS="-fPIC"
1568 ;;
1569 *)
1570 SHLIB_CFLAGS="-fpic"
1571 ;;
1572 esac
1573 SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
1574 SHLIB_SUFFIX=".so"
1575 AS_IF([test $doRpath = yes], [
1576 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
1577 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1578 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}'
1579 LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
1580 CFLAGS_OPTIMIZE="-O2"
1581 # On OpenBSD: Compile with -pthread
1582 # Don't link with -lpthread
1583 LIBS=`echo $LIBS | sed s/-lpthread//`
1584 CFLAGS="$CFLAGS -pthread"
1585 # OpenBSD doesn't do version numbers with dots.
1586 UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1587 TCL_LIB_VERSIONS_OK=nodots
1588 ;;
1589 NetBSD-*)
1590 # NetBSD has ELF and can use 'cc -shared' to build shared libs
1591 SHLIB_CFLAGS="-fPIC"
1592 SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
1593 SHLIB_SUFFIX=".so"
1594 LDFLAGS="$LDFLAGS -export-dynamic"
1595 AS_IF([test $doRpath = yes], [
1596 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
1597 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1598 # The -pthread needs to go in the CFLAGS, not LIBS
1599 LIBS=`echo $LIBS | sed s/-pthread//`
1600 CFLAGS="$CFLAGS -pthread"
1601 LDFLAGS="$LDFLAGS -pthread"
1602 ;;
1603 Darwin-*)
1604 CFLAGS_OPTIMIZE="-Os"
1605 SHLIB_CFLAGS="-fno-common"
1606 # To avoid discrepancies between what headers configure sees during
1607 # preprocessing tests and compiling tests, move any -isysroot and
1608 # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
1609 CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
1610 awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
1611 if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
1612 CFLAGS="`echo " ${CFLAGS}" | \
1613 awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
1614 if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
1615 AS_IF([test $do64bit = yes], [
1616 case `arch` in
1617 ppc)
1618 AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
1619 tcl_cv_cc_arch_ppc64, [
1620 hold_cflags=$CFLAGS
1621 CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
1622 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
1623 [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no])
1624 CFLAGS=$hold_cflags])
1625 AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
1626 CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
1627 do64bit_ok=yes
1628 ]);;
1629 i386)
1630 AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
1631 tcl_cv_cc_arch_x86_64, [
1632 hold_cflags=$CFLAGS
1633 CFLAGS="$CFLAGS -arch x86_64"
1634 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
1635 [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no])
1636 CFLAGS=$hold_cflags])
1637 AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
1638 CFLAGS="$CFLAGS -arch x86_64"
1639 do64bit_ok=yes
1640 ]);;
1641 *)
1642 AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
1643 esac
1644 ], [
1645 # Check for combined 32-bit and 64-bit fat build
1646 AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
1647 && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
1648 fat_32_64=yes])
1649 ])
1650 # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
1651 SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
1652 AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
1653 hold_ldflags=$LDFLAGS
1654 LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
1655 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],
1656 [tcl_cv_ld_single_module=yes],[tcl_cv_ld_single_module=no])
1657 LDFLAGS=$hold_ldflags])
1658 AS_IF([test $tcl_cv_ld_single_module = yes], [
1659 SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
1660 ])
1661 # TEA specific: link shlib with current and compatibility version flags
1662 vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
1663 SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
1664 SHLIB_SUFFIX=".dylib"
1665 LDFLAGS="$LDFLAGS -headerpad_max_install_names"
1666 AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
1667 tcl_cv_ld_search_paths_first, [
1668 hold_ldflags=$LDFLAGS
1669 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
1670 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],
1671 [tcl_cv_ld_search_paths_first=yes],[tcl_cv_ld_search_paths_first=no])
1672 LDFLAGS=$hold_ldflags])
1673 AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
1674 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
1675 ])
1676 AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
1677 AC_DEFINE(MODULE_SCOPE, [__private_extern__],
1678 [Compiler support for module scope symbols])
1679 tcl_cv_cc_visibility_hidden=yes
1680 ])
1681 CC_SEARCH_FLAGS=""
1682 LD_SEARCH_FLAGS=""
1683 LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
1684 # TEA specific: for combined 32 & 64 bit fat builds of Tk
1685 # extensions, verify that 64-bit build is possible.
1686 AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [
1687 AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [
1688 AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
1689 for v in CFLAGS CPPFLAGS LDFLAGS; do
1690 eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
1691 done
1692 CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
1693 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
1694 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XrmInitialize();]])],
1695 [tcl_cv_lib_x11_64=yes],[tcl_cv_lib_x11_64=no])
1696 for v in CFLAGS CPPFLAGS LDFLAGS; do
1697 eval $v'="$hold_'$v'"'
1698 done])
1699 ])
1700 AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [
1701 AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [
1702 for v in CFLAGS CPPFLAGS LDFLAGS; do
1703 eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
1704 done
1705 CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
1706 LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
1707 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <tk.h>]], [[Tk_InitStubs(NULL, "", 0);]])],
1708 [tcl_cv_lib_tk_64=yes],[tcl_cv_lib_tk_64=no])
1709 for v in CFLAGS CPPFLAGS LDFLAGS; do
1710 eval $v'="$hold_'$v'"'
1711 done])
1712 ])
1713 # remove 64-bit arch flags from CFLAGS et al. if configuration
1714 # does not support 64-bit.
1715 AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [
1716 AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
1717 for v in CFLAGS CPPFLAGS LDFLAGS; do
1718 eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
1719 done])
1720 ])
1721 ;;
1722 OS/390-*)
1723 CFLAGS_OPTIMIZE="" # Optimizer is buggy
1724 AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
1725 [Should OS/390 do the right thing with sockets?])
1726 ;;
1727 OSF1-V*)
1728 # Digital OSF/1
1729 SHLIB_CFLAGS=""
1730 AS_IF([test "$SHARED_BUILD" = 1], [
1731 SHLIB_LD='ld -shared -expect_unresolved "*"'
1732 ], [
1733 SHLIB_LD='ld -non_shared -expect_unresolved "*"'
1734 ])
1735 SHLIB_SUFFIX=".so"
1736 AS_IF([test $doRpath = yes], [
1737 CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
1738 LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1739 AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
1740 CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
1741 # see pthread_intro(3) for pthread support on osf1, k.furukawa
1742 CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
1743 CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
1744 LIBS=`echo $LIBS | sed s/-lpthreads//`
1745 AS_IF([test "$GCC" = yes], [
1746 LIBS="$LIBS -lpthread -lmach -lexc"
1747 ], [
1748 CFLAGS="$CFLAGS -pthread"
1749 LDFLAGS="$LDFLAGS -pthread"
1750 ])
1751 ;;
1752 QNX-6*)
1753 # QNX RTP
1754 # This may work for all QNX, but it was only reported for v6.
1755 SHLIB_CFLAGS="-fPIC"
1756 SHLIB_LD="ld -Bshareable -x"
1757 SHLIB_LD_LIBS=""
1758 SHLIB_SUFFIX=".so"
1759 CC_SEARCH_FLAGS=""
1760 LD_SEARCH_FLAGS=""
1761 ;;
1762 SCO_SV-3.2*)
1763 AS_IF([test "$GCC" = yes], [
1764 SHLIB_CFLAGS="-fPIC -melf"
1765 LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
1766 ], [
1767 SHLIB_CFLAGS="-Kpic -belf"
1768 LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
1769 ])
1770 SHLIB_LD="ld -G"
1771 SHLIB_LD_LIBS=""
1772 SHLIB_SUFFIX=".so"
1773 CC_SEARCH_FLAGS=""
1774 LD_SEARCH_FLAGS=""
1775 ;;
1776 SunOS-5.[[0-6]])
1777 # Careful to not let 5.10+ fall into this case
1778
1779 # Note: If _REENTRANT isn't defined, then Solaris
1780 # won't define thread-safe library routines.
1781
1782 AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
1783 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
1784 [Do we really want to follow the standard? Yes we do!])
1785
1786 SHLIB_CFLAGS="-KPIC"
1787 SHLIB_SUFFIX=".so"
1788 AS_IF([test "$GCC" = yes], [
1789 SHLIB_LD='${CC} -shared'
1790 CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
1791 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1792 ], [
1793 SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1794 CC_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"'
1795 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1796 ])
1797 ;;
1798 SunOS-5*)
1799 # Note: If _REENTRANT isn't defined, then Solaris
1800 # won't define thread-safe library routines.
1801
1802 AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
1803 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
1804 [Do we really want to follow the standard? Yes we do!])
1805
1806 SHLIB_CFLAGS="-KPIC"
1807
1808 # Check to enable 64-bit flags for compiler/linker
1809 AS_IF([test "$do64bit" = yes], [
1810 arch=`isainfo`
1811 AS_IF([test "$arch" = "sparcv9 sparc"], [
1812 AS_IF([test "$GCC" = yes], [
1813 AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
1814 AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
1815 ], [
1816 do64bit_ok=yes
1817 CFLAGS="$CFLAGS -m64 -mcpu=v9"
1818 LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
1819 SHLIB_CFLAGS="-fPIC"
1820 ])
1821 ], [
1822 do64bit_ok=yes
1823 AS_IF([test "$do64bitVIS" = yes], [
1824 CFLAGS="$CFLAGS -xarch=v9a"
1825 LDFLAGS_ARCH="-xarch=v9a"
1826 ], [
1827 CFLAGS="$CFLAGS -xarch=v9"
1828 LDFLAGS_ARCH="-xarch=v9"
1829 ])
1830 # Solaris 64 uses this as well
1831 #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
1832 ])
1833 ], [AS_IF([test "$arch" = "amd64 i386"], [
1834 AS_IF([test "$GCC" = yes], [
1835 case $system in
1836 SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
1837 do64bit_ok=yes
1838 CFLAGS="$CFLAGS -m64"
1839 LDFLAGS="$LDFLAGS -m64";;
1840 *)
1841 AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
1842 esac
1843 ], [
1844 do64bit_ok=yes
1845 case $system in
1846 SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
1847 CFLAGS="$CFLAGS -m64"
1848 LDFLAGS="$LDFLAGS -m64";;
1849 *)
1850 CFLAGS="$CFLAGS -xarch=amd64"
1851 LDFLAGS="$LDFLAGS -xarch=amd64";;
1852 esac
1853 ])
1854 ], [AC_MSG_WARN([64bit mode not supported for $arch])])])
1855 ])
1856
1857 SHLIB_SUFFIX=".so"
1858 AS_IF([test "$GCC" = yes], [
1859 SHLIB_LD='${CC} -shared'
1860 CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
1861 LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1862 AS_IF([test "$do64bit_ok" = yes], [
1863 AS_IF([test "$arch" = "sparcv9 sparc"], [
1864 # We need to specify -static-libgcc or we need to
1865 # add the path to the sparv9 libgcc.
1866 # JH: static-libgcc is necessary for core Tcl, but may
1867 # not be necessary for extensions.
1868 SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
1869 # for finding sparcv9 libgcc, get the regular libgcc
1870 # path, remove so name and append 'sparcv9'
1871 #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
1872 #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
1873 ], [AS_IF([test "$arch" = "amd64 i386"], [
1874 # JH: static-libgcc is necessary for core Tcl, but may
1875 # not be necessary for extensions.
1876 SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
1877 ])])
1878 ])
1879 ], [
1880 case $system in
1881 SunOS-5.[[1-9]][[0-9]]*)
1882 # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
1883 SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
1884 *)
1885 SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
1886 esac
1887 CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
1888 LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"'
1889 ])
1890 ;;
1891 UNIX_SV* | UnixWare-5*)
1892 SHLIB_CFLAGS="-KPIC"
1893 SHLIB_LD='${CC} -G'
1894 SHLIB_LD_LIBS=""
1895 SHLIB_SUFFIX=".so"
1896 # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
1897 # that don't grok the -Bexport option. Test that it does.
1898 AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
1899 hold_ldflags=$LDFLAGS
1900 LDFLAGS="$LDFLAGS -Wl,-Bexport"
1901 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],
1902 [tcl_cv_ld_Bexport=yes],[tcl_cv_ld_Bexport=no])
1903 LDFLAGS=$hold_ldflags])
1904 AS_IF([test $tcl_cv_ld_Bexport = yes], [
1905 LDFLAGS="$LDFLAGS -Wl,-Bexport"
1906 ])
1907 CC_SEARCH_FLAGS=""
1908 LD_SEARCH_FLAGS=""
1909 ;;
1910 esac
1911
1912 AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
1913 AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
1914 ])
1915
1916 dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
1917 dnl # until the end of configure, as configure's compile and link tests use
1918 dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
1919 dnl # preprocessing tests use only CPPFLAGS.
1920 AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
1921
1922 # Add in the arch flags late to ensure it wasn't removed.
1923 # Not necessary in TEA, but this is aligned with core
1924 LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
1925
1926 # If we're running gcc, then change the C flags for compiling shared
1927 # libraries to the right flags for gcc, instead of those for the
1928 # standard manufacturer compiler.
1929
1930 AS_IF([test "$GCC" = yes], [
1931 case $system in
1932 AIX-*) ;;
1933 BSD/OS*) ;;
1934 CYGWIN_*|MINGW32_*|MINGW64_*|MSYS_*) ;;
1935 IRIX*) ;;
1936 NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
1937 Darwin-*) ;;
1938 SCO_SV-3.2*) ;;
1939 windows) ;;
1940 *) SHLIB_CFLAGS="-fPIC" ;;
1941 esac])
1942
1943 AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
1944 AC_DEFINE(MODULE_SCOPE, [extern],
1945 [No Compiler support for module scope symbols])
1946 ])
1947
1948 AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
1949 # TEA specific: use PACKAGE_VERSION instead of VERSION
1950 SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'])
1951 AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
1952 # TEA specific: use PACKAGE_VERSION instead of VERSION
1953 UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'])
1954
1955 if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
1956 AC_CACHE_CHECK(for SEH support in compiler,
1957 tcl_cv_seh,
1958 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1959 #define WIN32_LEAN_AND_MEAN
1960 #include <windows.h>
1961 #undef WIN32_LEAN_AND_MEAN
1962
1963 int main(int argc, char** argv) {
1964 int a, b = 0;
1965 __try {
1966 a = 666 / b;
1967 }
1968 __except (EXCEPTION_EXECUTE_HANDLER) {
1969 return 0;
1970 }
1971 return 1;
1972 }
1973 ]])],
1974 [tcl_cv_seh=yes],
1975 [tcl_cv_seh=no],
1976 [tcl_cv_seh=no])
1977 )
1978 if test "$tcl_cv_seh" = "no" ; then
1979 AC_DEFINE(HAVE_NO_SEH, 1,
1980 [Defined when mingw does not support SEH])
1981 fi
1982
1983 #
1984 # Check to see if the excpt.h include file provided contains the
1985 # definition for EXCEPTION_DISPOSITION; if not, which is the case
1986 # with Cygwin's version as of 2002-04-10, define it to be int,
1987 # sufficient for getting the current code to work.
1988 #
1989 AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
1990 tcl_cv_eh_disposition,
1991 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1992 # define WIN32_LEAN_AND_MEAN
1993 # include <windows.h>
1994 # undef WIN32_LEAN_AND_MEAN
1995 ]], [[
1996 EXCEPTION_DISPOSITION x;
1997 ]])],
1998 [tcl_cv_eh_disposition=yes],
1999 [tcl_cv_eh_disposition=no])
2000 )
2001 if test "$tcl_cv_eh_disposition" = "no" ; then
2002 AC_DEFINE(EXCEPTION_DISPOSITION, int,
2003 [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
2004 fi
2005
2006 # Check to see if winnt.h defines CHAR, SHORT, and LONG
2007 # even if VOID has already been #defined. The win32api
2008 # used by mingw and cygwin is known to do this.
2009
2010 AC_CACHE_CHECK(for winnt.h that ignores VOID define,
2011 tcl_cv_winnt_ignore_void,
2012 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2013 #define VOID void
2014 #define WIN32_LEAN_AND_MEAN
2015 #include <windows.h>
2016 #undef WIN32_LEAN_AND_MEAN
2017 ]], [[
2018 CHAR c;
2019 SHORT s;
2020 LONG l;
2021 ]])],
2022 [tcl_cv_winnt_ignore_void=yes],
2023 [tcl_cv_winnt_ignore_void=no])
2024 )
2025 if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
2026 AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
2027 [Defined when cygwin/mingw ignores VOID define in winnt.h])
2028 fi
2029 fi
2030
2031 # See if the compiler supports casting to a union type.
2032 # This is used to stop gcc from printing a compiler
2033 # warning when initializing a union member.
2034
2035 AC_CACHE_CHECK(for cast to union support,
2036 tcl_cv_cast_to_union,
2037 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2038 union foo { int i; double d; };
2039 union foo f = (union foo) (int) 0;
2040 ]])],
2041 [tcl_cv_cast_to_union=yes],
2042 [tcl_cv_cast_to_union=no])
2043 )
2044 if test "$tcl_cv_cast_to_union" = "yes"; then
2045 AC_DEFINE(HAVE_CAST_TO_UNION, 1,
2046 [Defined when compiler supports casting to union type.])
2047 fi
2048
2049 AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],)
2050
2051 AC_SUBST(CFLAGS_DEBUG)
2052 AC_SUBST(CFLAGS_OPTIMIZE)
2053 AC_SUBST(CFLAGS_WARNING)
2054 AC_SUBST(LDFLAGS_DEBUG)
2055 AC_SUBST(LDFLAGS_OPTIMIZE)
2056
2057 AC_SUBST(STLIB_LD)
2058 AC_SUBST(SHLIB_LD)
2059
2060 AC_SUBST(SHLIB_LD_LIBS)
2061 AC_SUBST(SHLIB_CFLAGS)
2062
2063 AC_SUBST(LD_LIBRARY_PATH_VAR)
2064
2065 # These must be called after we do the basic CFLAGS checks and
2066 # verify any possible 64-bit or similar switches are necessary
2067 TEA_TCL_EARLY_FLAGS
2068 TEA_TCL_64BIT_FLAGS
2069 ])
2070
2071 #--------------------------------------------------------------------
2072 # TEA_SERIAL_PORT
2073 #
2074 # Determine which interface to use to talk to the serial port.
2075 # Note that #include lines must begin in leftmost column for
2076 # some compilers to recognize them as preprocessor directives,
2077 # and some build environments have stdin not pointing at a
2078 # pseudo-terminal (usually /dev/null instead.)
2079 #
2080 # Arguments:
2081 # none
2082 #
2083 # Results:
2084 #
2085 # Defines only one of the following vars:
2086 # HAVE_SYS_MODEM_H
2087 # USE_TERMIOS
2088 # USE_TERMIO
2089 # USE_SGTTY
2090 #--------------------------------------------------------------------
2091
2092 AC_DEFUN([TEA_SERIAL_PORT], [
2093 AC_CHECK_HEADERS(sys/modem.h)
2094 AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
2095 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2096 #include <termios.h>
2097
2098 int main() {
2099 struct termios t;
2100 if (tcgetattr(0, &t) == 0) {
2101 cfsetospeed(&t, 0);
2102 t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2103 return 0;
2104 }
2105 return 1;
2106 }]])],[tcl_cv_api_serial=termios],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no])
2107 if test $tcl_cv_api_serial = no ; then
2108 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2109 #include <termio.h>
2110
2111 int main() {
2112 struct termio t;
2113 if (ioctl(0, TCGETA, &t) == 0) {
2114 t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2115 return 0;
2116 }
2117 return 1;
2118 }]])],[tcl_cv_api_serial=termio],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no])
2119 fi
2120 if test $tcl_cv_api_serial = no ; then
2121 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2122 #include <sgtty.h>
2123
2124 int main() {
2125 struct sgttyb t;
2126 if (ioctl(0, TIOCGETP, &t) == 0) {
2127 t.sg_ospeed = 0;
2128 t.sg_flags |= ODDP | EVENP | RAW;
2129 return 0;
2130 }
2131 return 1;
2132 }]])],[tcl_cv_api_serial=sgtty],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no])
2133 fi
2134 if test $tcl_cv_api_serial = no ; then
2135 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2136 #include <termios.h>
2137 #include <errno.h>
2138
2139 int main() {
2140 struct termios t;
2141 if (tcgetattr(0, &t) == 0
2142 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2143 cfsetospeed(&t, 0);
2144 t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2145 return 0;
2146 }
2147 return 1;
2148 }]])],[tcl_cv_api_serial=termios],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no])
2149 fi
2150 if test $tcl_cv_api_serial = no; then
2151 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2152 #include <termio.h>
2153 #include <errno.h>
2154
2155 int main() {
2156 struct termio t;
2157 if (ioctl(0, TCGETA, &t) == 0
2158 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2159 t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2160 return 0;
2161 }
2162 return 1;
2163 }]])],[tcl_cv_api_serial=termio],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no])
2164 fi
2165 if test $tcl_cv_api_serial = no; then
2166 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2167 #include <sgtty.h>
2168 #include <errno.h>
2169
2170 int main() {
2171 struct sgttyb t;
2172 if (ioctl(0, TIOCGETP, &t) == 0
2173 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2174 t.sg_ospeed = 0;
2175 t.sg_flags |= ODDP | EVENP | RAW;
2176 return 0;
2177 }
2178 return 1;
2179 }]])],[tcl_cv_api_serial=sgtty],[tcl_cv_api_serial=none],[tcl_cv_api_serial=none])
2180 fi])
2181 case $tcl_cv_api_serial in
2182 termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
2183 termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
2184 sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
2185 esac
2186 ])
2187
2188 #--------------------------------------------------------------------
2189 # TEA_PATH_X
2190 #
2191 # Locate the X11 header files and the X11 library archive. Try
2192 # the ac_path_x macro first, but if it doesn't find the X stuff
2193 # (e.g. because there's no xmkmf program) then check through
2194 # a list of possible directories. Under some conditions the
2195 # autoconf macro will return an include directory that contains
2196 # no include files, so double-check its result just to be safe.
2197 #
2198 # This should be called after TEA_CONFIG_CFLAGS as setting the
2199 # LIBS line can confuse some configure macro magic.
2200 #
2201 # Arguments:
2202 # none
2203 #
2204 # Results:
2205 #
2206 # Sets the following vars:
2207 # XINCLUDES
2208 # XLIBSW
2209 # PKG_LIBS (appends to)
2210 #--------------------------------------------------------------------
2211
2212 AC_DEFUN([TEA_PATH_X], [
2213 if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
2214 TEA_PATH_UNIX_X
2215 fi
2216 ])
2217
2218 AC_DEFUN([TEA_PATH_UNIX_X], [
2219 AC_PATH_X
2220 not_really_there=""
2221 if test "$no_x" = ""; then
2222 if test "$x_includes" = ""; then
2223 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h>]])],[],[not_really_there="yes"])
2224 else
2225 if test ! -r $x_includes/X11/Xlib.h; then
2226 not_really_there="yes"
2227 fi
2228 fi
2229 fi
2230 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
2231 AC_MSG_CHECKING([for X11 header files])
2232 found_xincludes="no"
2233 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h>]])],[found_xincludes="yes"],[found_xincludes="no"])
2234 if test "$found_xincludes" = "no"; then
2235 dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
2236 for i in $dirs ; do
2237 if test -r $i/X11/Xlib.h; then
2238 AC_MSG_RESULT([$i])
2239 XINCLUDES=" -I$i"
2240 found_xincludes="yes"
2241 break
2242 fi
2243 done
2244 fi
2245 else
2246 if test "$x_includes" != ""; then
2247 XINCLUDES="-I$x_includes"
2248 found_xincludes="yes"
2249 fi
2250 fi
2251 if test "$found_xincludes" = "no"; then
2252 AC_MSG_RESULT([couldn't find any!])
2253 fi
2254
2255 if test "$no_x" = yes; then
2256 AC_MSG_CHECKING([for X11 libraries])
2257 XLIBSW=nope
2258 dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
2259 for i in $dirs ; do
2260 if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
2261 AC_MSG_RESULT([$i])
2262 XLIBSW="-L$i -lX11"
2263 x_libraries="$i"
2264 break
2265 fi
2266 done
2267 else
2268 if test "$x_libraries" = ""; then
2269 XLIBSW=-lX11
2270 else
2271 XLIBSW="-L$x_libraries -lX11"
2272 fi
2273 fi
2274 if test "$XLIBSW" = nope ; then
2275 AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
2276 fi
2277 if test "$XLIBSW" = nope ; then
2278 AC_MSG_RESULT([could not find any! Using -lX11.])
2279 XLIBSW=-lX11
2280 fi
2281 # TEA specific:
2282 if test x"${XLIBSW}" != x ; then
2283 PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
2284 fi
2285 ])
2286
2287 #--------------------------------------------------------------------
2288 # TEA_BLOCKING_STYLE
2289 #
2290 # The statements below check for systems where POSIX-style
2291 # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
2292 # On these systems (mostly older ones), use the old BSD-style
2293 # FIONBIO approach instead.
2294 #
2295 # Arguments:
2296 # none
2297 #
2298 # Results:
2299 #
2300 # Defines some of the following vars:
2301 # HAVE_SYS_IOCTL_H
2302 # HAVE_SYS_FILIO_H
2303 # USE_FIONBIO
2304 # O_NONBLOCK
2305 #--------------------------------------------------------------------
2306
2307 AC_DEFUN([TEA_BLOCKING_STYLE], [
2308 AC_CHECK_HEADERS(sys/ioctl.h)
2309 AC_CHECK_HEADERS(sys/filio.h)
2310 TEA_CONFIG_SYSTEM
2311 AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
2312 case $system in
2313 OSF*)
2314 AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
2315 AC_MSG_RESULT([FIONBIO])
2316 ;;
2317 *)
2318 AC_MSG_RESULT([O_NONBLOCK])
2319 ;;
2320 esac
2321 ])
2322
2323 #--------------------------------------------------------------------
2324 # TEA_TIME_HANDLER
2325 #
2326 # Checks how the system deals with time.h, what time structures
2327 # are used on the system, and what fields the structures have.
2328 #
2329 # Arguments:
2330 # none
2331 #
2332 # Results:
2333 #
2334 # Defines some of the following vars:
2335 # USE_DELTA_FOR_TZ
2336 # HAVE_TM_GMTOFF
2337 # HAVE_TM_TZADJ
2338 # HAVE_TIMEZONE_VAR
2339 #
2340 #--------------------------------------------------------------------
2341
2342 AC_DEFUN([TEA_TIME_HANDLER], [
2343 AC_CHECK_HEADERS(sys/time.h)
2344 AC_HEADER_TIME
2345 AC_STRUCT_TIMEZONE
2346
2347 AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
2348
2349 AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
2350 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_tzadj;]])],
2351 [tcl_cv_member_tm_tzadj=yes],
2352 [tcl_cv_member_tm_tzadj=no])])
2353 if test $tcl_cv_member_tm_tzadj = yes ; then
2354 AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
2355 fi
2356
2357 AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
2358 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_gmtoff;]])],
2359 [tcl_cv_member_tm_gmtoff=yes],
2360 [tcl_cv_member_tm_gmtoff=no])])
2361 if test $tcl_cv_member_tm_gmtoff = yes ; then
2362 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
2363 fi
2364
2365 #
2366 # Its important to include time.h in this check, as some systems
2367 # (like convex) have timezone functions, etc.
2368 #
2369 AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
2370 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
2371 #include <stdlib.h>]],
2372 [[extern long timezone;
2373 timezone += 1;
2374 exit (0);]])],
2375 [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])])
2376 if test $tcl_cv_timezone_long = yes ; then
2377 AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
2378 else
2379 #
2380 # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
2381 #
2382 AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
2383 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
2384 #include <stdlib.h>]],
2385 [[extern time_t timezone;
2386 timezone += 1;
2387 exit (0);]])],
2388 [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])])
2389 if test $tcl_cv_timezone_time = yes ; then
2390 AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
2391 fi
2392 fi
2393 ])
2394
2395 #--------------------------------------------------------------------
2396 # TEA_BUGGY_STRTOD
2397 #
2398 # Under Solaris 2.4, strtod returns the wrong value for the
2399 # terminating character under some conditions. Check for this
2400 # and if the problem exists use a substitute procedure
2401 # "fixstrtod" (provided by Tcl) that corrects the error.
2402 # Also, on Compaq's Tru64 Unix 5.0,
2403 # strtod(" ") returns 0.0 instead of a failure to convert.
2404 #
2405 # Arguments:
2406 # none
2407 #
2408 # Results:
2409 #
2410 # Might defines some of the following vars:
2411 # strtod (=fixstrtod)
2412 #--------------------------------------------------------------------
2413
2414 AC_DEFUN([TEA_BUGGY_STRTOD], [
2415 AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
2416 if test "$tcl_strtod" = 1; then
2417 AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
2418 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2419 #include <stdlib.h>
2420 extern double strtod();
2421 int main() {
2422 char *infString="Inf", *nanString="NaN", *spaceString=" ";
2423 char *term;
2424 double value;
2425 value = strtod(infString, &term);
2426 if ((term != infString) && (term[-1] == 0)) {
2427 exit(1);
2428 }
2429 value = strtod(nanString, &term);
2430 if ((term != nanString) && (term[-1] == 0)) {
2431 exit(1);
2432 }
2433 value = strtod(spaceString, &term);
2434 if (term == (spaceString+1)) {
2435 exit(1);
2436 }
2437 exit(0);
2438 }]])], [tcl_cv_strtod_buggy=ok], [tcl_cv_strtod_buggy=buggy],
2439 [tcl_cv_strtod_buggy=buggy])])
2440 if test "$tcl_cv_strtod_buggy" = buggy; then
2441 AC_LIBOBJ([fixstrtod])
2442 USE_COMPAT=1
2443 AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
2444 fi
2445 fi
2446 ])
2447
2448 #--------------------------------------------------------------------
2449 # TEA_TCL_LINK_LIBS
2450 #
2451 # Search for the libraries needed to link the Tcl shell.
2452 # Things like the math library (-lm), socket stuff (-lsocket vs.
2453 # -lnsl), zlib (-lz) and libtommath (-ltommath) are dealt with here.
2454 #
2455 # Arguments:
2456 # None.
2457 #
2458 # Results:
2459 #
2460 # Might append to the following vars:
2461 # LIBS
2462 # MATH_LIBS
2463 #
2464 # Might define the following vars:
2465 # HAVE_NET_ERRNO_H
2466 #
2467 #--------------------------------------------------------------------
2468
2469 AC_DEFUN([TEA_TCL_LINK_LIBS], [
2470 #--------------------------------------------------------------------
2471 # On a few very rare systems, all of the libm.a stuff is
2472 # already in libc.a. Set compiler flags accordingly.
2473 #--------------------------------------------------------------------
2474
2475 AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
2476
2477 #--------------------------------------------------------------------
2478 # Interactive UNIX requires -linet instead of -lsocket, plus it
2479 # needs net/errno.h to define the socket-related error codes.
2480 #--------------------------------------------------------------------
2481
2482 AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
2483 AC_CHECK_HEADER(net/errno.h, [
2484 AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
2485
2486 #--------------------------------------------------------------------
2487 # Check for the existence of the -lsocket and -lnsl libraries.
2488 # The order here is important, so that they end up in the right
2489 # order in the command line generated by make. Here are some
2490 # special considerations:
2491 # 1. Use "connect" and "accept" to check for -lsocket, and
2492 # "gethostbyname" to check for -lnsl.
2493 # 2. Use each function name only once: can't redo a check because
2494 # autoconf caches the results of the last check and won't redo it.
2495 # 3. Use -lnsl and -lsocket only if they supply procedures that
2496 # aren't already present in the normal libraries. This is because
2497 # IRIX 5.2 has libraries, but they aren't needed and they're
2498 # bogus: they goof up name resolution if used.
2499 # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
2500 # To get around this problem, check for both libraries together
2501 # if -lsocket doesn't work by itself.
2502 #--------------------------------------------------------------------
2503
2504 tcl_checkBoth=0
2505 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
2506 if test "$tcl_checkSocket" = 1; then
2507 AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
2508 LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
2509 fi
2510 if test "$tcl_checkBoth" = 1; then
2511 tk_oldLibs=$LIBS
2512 LIBS="$LIBS -lsocket -lnsl"
2513 AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
2514 fi
2515 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
2516 [LIBS="$LIBS -lnsl"])])
2517 AC_CHECK_FUNC(mp_log_u32, , [AC_CHECK_LIB(tommath, mp_log_u32,
2518 [LIBS="$LIBS -ltommath"])])
2519 AC_CHECK_FUNC(deflateSetHeader, , [AC_CHECK_LIB(z, deflateSetHeader,
2520 [LIBS="$LIBS -lz"])])
2521 ])
2522
2523 #--------------------------------------------------------------------
2524 # TEA_TCL_EARLY_FLAGS
2525 #
2526 # Check for what flags are needed to be passed so the correct OS
2527 # features are available.
2528 #
2529 # Arguments:
2530 # None
2531 #
2532 # Results:
2533 #
2534 # Might define the following vars:
2535 # _ISOC99_SOURCE
2536 # _FILE_OFFSET_BITS
2537 #
2538 #--------------------------------------------------------------------
2539
2540 AC_DEFUN([TEA_TCL_EARLY_FLAG],[
2541 AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
2542 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])],
2543 [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[
2544 ]$2]], [[$3]])],
2545 [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
2546 [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)]))
2547 if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
2548 AC_DEFINE($1, m4_default([$4],[1]), [Add the ]$1[ flag when building])
2549 tcl_flags="$tcl_flags $1"
2550 fi
2551 ])
2552
2553 AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
2554 AC_MSG_CHECKING([for required early compiler flags])
2555 tcl_flags=""
2556 TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
2557 [char *p = (char *)strtoll; char *q = (char *)strtoull;])
2558 if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
2559 TEA_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include <sys/stat.h>],
2560 [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64)
2561 fi
2562 if test "x${tcl_flags}" = "x" ; then
2563 AC_MSG_RESULT([none])
2564 else
2565 AC_MSG_RESULT([${tcl_flags}])
2566 fi
2567 ])
2568
2569 #--------------------------------------------------------------------
2570 # TEA_TCL_64BIT_FLAGS
2571 #
2572 # Check for what is defined in the way of 64-bit features.
2573 #
2574 # Arguments:
2575 # None
2576 #
2577 # Results:
2578 #
2579 # Might define the following vars:
2580 # TCL_WIDE_INT_IS_LONG
2581 # TCL_WIDE_INT_TYPE
2582 # HAVE_STRUCT_DIRENT64, HAVE_DIR64
2583 # HAVE_STRUCT_STAT64
2584 # HAVE_TYPE_OFF64_T
2585 # _TIME_BITS
2586 #
2587 #--------------------------------------------------------------------
2588
2589 AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
2590 AC_MSG_CHECKING([for 64-bit integer type])
2591 AC_CACHE_VAL(tcl_cv_type_64bit,[
2592 tcl_cv_type_64bit=none
2593 # See if the compiler knows natively about __int64
2594 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__int64 value = (__int64) 0;]])],
2595 [tcl_type_64bit=__int64],[tcl_type_64bit="long long"])
2596 # See if we could use long anyway Note that we substitute in the
2597 # type that is our current guess for a 64-bit type inside this check
2598 # program, so it should be modified only carefully...
2599 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) {
2600 case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
2601 }]])],[tcl_cv_type_64bit=${tcl_type_64bit}],[])])
2602 if test "${tcl_cv_type_64bit}" = none ; then
2603 AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?])
2604 AC_MSG_RESULT([yes])
2605 elif test "${tcl_cv_type_64bit}" = "__int64" \
2606 -a "${TEA_PLATFORM}" = "windows" ; then
2607 # TEA specific: We actually want to use the default tcl.h checks in
2608 # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
2609 AC_MSG_RESULT([using Tcl header defaults])
2610 else
2611 AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
2612 [What type should be used to define wide integers?])
2613 AC_MSG_RESULT([${tcl_cv_type_64bit}])
2614
2615 # Now check for auxiliary declarations
2616 if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
2617 AC_CACHE_CHECK([for 64-bit time_t], tcl_cv_time_t_64,[
2618 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
2619 [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])],
2620 [tcl_cv_time_t_64=yes],[tcl_cv_time_t_64=no])])
2621 if test "x${tcl_cv_time_t_64}" = "xno" ; then
2622 # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64
2623 # which SC_TCL_EARLY_FLAGS has defined if necessary.
2624 AC_CACHE_CHECK([if _TIME_BITS=64 enables 64-bit time_t], tcl_cv__time_bits,[
2625 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _TIME_BITS 64
2626 #include <sys/types.h>]],
2627 [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])],
2628 [tcl_cv__time_bits=yes],[tcl_cv__time_bits=no])])
2629 if test "x${tcl_cv__time_bits}" = "xyes" ; then
2630 AC_DEFINE(_TIME_BITS, 64, [_TIME_BITS=64 enables 64-bit time_t.])
2631 fi
2632 fi
2633 fi
2634
2635 AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
2636 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2637 #include <dirent.h>]], [[struct dirent64 p;]])],
2638 [tcl_cv_struct_dirent64=yes],[tcl_cv_struct_dirent64=no])])
2639 if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
2640 AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
2641 fi
2642
2643 AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[
2644 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2645 #include <dirent.h>]], [[struct dirent64 *p; DIR64 d = opendir64(".");
2646 p = readdir64(d); rewinddir64(d); closedir64(d);]])],
2647 [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])])
2648 if test "x${tcl_cv_DIR64}" = "xyes" ; then
2649 AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
2650 fi
2651
2652 AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
2653 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat64 p;
2654 ]])],
2655 [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])])
2656 if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
2657 AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
2658 fi
2659
2660 AC_CHECK_FUNCS(open64 lseek64)
2661 AC_MSG_CHECKING([for off64_t])
2662 AC_CACHE_VAL(tcl_cv_type_off64_t,[
2663 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[off64_t offset;
2664 ]])],
2665 [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])])
2666 dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
2667 dnl functions lseek64 and open64 are defined.
2668 if test "x${tcl_cv_type_off64_t}" = "xyes" && \
2669 test "x${ac_cv_func_lseek64}" = "xyes" && \
2670 test "x${ac_cv_func_open64}" = "xyes" ; then
2671 AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
2672 AC_MSG_RESULT([yes])
2673 else
2674 AC_MSG_RESULT([no])
2675 fi
2676 fi
2677 ])
2678
2679 ##
2680 ## Here ends the standard Tcl configuration bits and starts the
2681 ## TEA specific functions
2682 ##
2683
2684 #------------------------------------------------------------------------
2685 # TEA_INIT --
2686 #
2687 # Init various Tcl Extension Architecture (TEA) variables.
2688 # This should be the first called TEA_* macro.
2689 #
2690 # Arguments:
2691 # none
2692 #
2693 # Results:
2694 #
2695 # Defines and substs the following vars:
2696 # CYGPATH
2697 # EXEEXT
2698 # Defines only:
2699 # TEA_VERSION
2700 # TEA_INITED
2701 # TEA_PLATFORM (windows or unix)
2702 #
2703 # "cygpath" is used on windows to generate native path names for include
2704 # files. These variables should only be used with the compiler and linker
2705 # since they generate native path names.
2706 #
2707 # EXEEXT
2708 # Select the executable extension based on the host type. This
2709 # is a lightweight replacement for AC_EXEEXT that doesn't require
2710 # a compiler.
2711 #------------------------------------------------------------------------
2712
2713 AC_DEFUN([TEA_INIT], [
2714 TEA_VERSION="3.13"
2715
2716 AC_MSG_CHECKING([TEA configuration])
2717 if test x"${PACKAGE_NAME}" = x ; then
2718 AC_MSG_ERROR([
2719 The PACKAGE_NAME variable must be defined by your TEA configure.ac])
2720 fi
2721 AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
2722
2723 # If the user did not set CFLAGS, set it now to keep macros
2724 # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
2725 if test "${CFLAGS+set}" != "set" ; then
2726 CFLAGS=""
2727 fi
2728
2729 case "`uname -s`" in
2730 *win32*|*WIN32*|*MINGW32_*|*MINGW64_*|*MSYS_*)
2731 AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo)
2732 EXEEXT=".exe"
2733 TEA_PLATFORM="windows"
2734 ;;
2735 *CYGWIN_*)
2736 EXEEXT=".exe"
2737 # CYGPATH and TEA_PLATFORM are determined later in LOAD_TCLCONFIG
2738 ;;
2739 *)
2740 CYGPATH=echo
2741 # Maybe we are cross-compiling....
2742 case ${host_alias} in
2743 *mingw32*)
2744 EXEEXT=".exe"
2745 TEA_PLATFORM="windows"
2746 ;;
2747 *)
2748 EXEEXT=""
2749 TEA_PLATFORM="unix"
2750 ;;
2751 esac
2752 ;;
2753 esac
2754
2755 # Check if exec_prefix is set. If not use fall back to prefix.
2756 # Note when adjusted, so that TEA_PREFIX can correct for this.
2757 # This is needed for recursive configures, since autoconf propagates
2758 # $prefix, but not $exec_prefix (doh!).
2759 if test x$exec_prefix = xNONE ; then
2760 exec_prefix_default=yes
2761 exec_prefix=$prefix
2762 fi
2763
2764 AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}])
2765
2766 AC_SUBST(EXEEXT)
2767 AC_SUBST(CYGPATH)
2768
2769 # This package name must be replaced statically for AC_SUBST to work
2770 AC_SUBST(PKG_LIB_FILE)
2771 AC_SUBST(PKG_LIB_FILE8)
2772 AC_SUBST(PKG_LIB_FILE9)
2773 # Substitute STUB_LIB_FILE in case package creates a stub library too.
2774 AC_SUBST(PKG_STUB_LIB_FILE)
2775
2776 # We AC_SUBST these here to ensure they are subst'ed,
2777 # in case the user doesn't call TEA_ADD_...
2778 AC_SUBST(PKG_STUB_SOURCES)
2779 AC_SUBST(PKG_STUB_OBJECTS)
2780 AC_SUBST(PKG_TCL_SOURCES)
2781 AC_SUBST(PKG_HEADERS)
2782 AC_SUBST(PKG_INCLUDES)
2783 AC_SUBST(PKG_LIBS)
2784 AC_SUBST(PKG_CFLAGS)
2785
2786 # Configure the installer.
2787 TEA_INSTALLER
2788 ])
2789
2790 #------------------------------------------------------------------------
2791 # TEA_ADD_SOURCES --
2792 #
2793 # Specify one or more source files. Users should check for
2794 # the right platform before adding to their list.
2795 # It is not important to specify the directory, as long as it is
2796 # in the generic, win or unix subdirectory of $(srcdir).
2797 #
2798 # Arguments:
2799 # one or more file names
2800 #
2801 # Results:
2802 #
2803 # Defines and substs the following vars:
2804 # PKG_SOURCES
2805 # PKG_OBJECTS
2806 #------------------------------------------------------------------------
2807 AC_DEFUN([TEA_ADD_SOURCES], [
2808 vars="$@"
2809 for i in $vars; do
2810 case $i in
2811 [\$]*)
2812 # allow $-var names
2813 PKG_SOURCES="$PKG_SOURCES $i"
2814 PKG_OBJECTS="$PKG_OBJECTS $i"
2815 ;;
2816 *)
2817 # check for existence - allows for generic/win/unix VPATH
2818 # To add more dirs here (like 'src'), you have to update VPATH
2819 # in Makefile.in as well
2820 if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
2821 -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
2822 -a ! -f "${srcdir}/macosx/$i" \
2823 ; then
2824 AC_MSG_ERROR([could not find source file '$i'])
2825 fi
2826 PKG_SOURCES="$PKG_SOURCES $i"
2827 # this assumes it is in a VPATH dir
2828 i=`basename $i`
2829 # handle user calling this before or after TEA_SETUP_COMPILER
2830 if test x"${OBJEXT}" != x ; then
2831 j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
2832 else
2833 j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
2834 fi
2835 PKG_OBJECTS="$PKG_OBJECTS $j"
2836 ;;
2837 esac
2838 done
2839 AC_SUBST(PKG_SOURCES)
2840 AC_SUBST(PKG_OBJECTS)
2841 ])
2842
2843 #------------------------------------------------------------------------
2844 # TEA_ADD_STUB_SOURCES --
2845 #
2846 # Specify one or more source files. Users should check for
2847 # the right platform before adding to their list.
2848 # It is not important to specify the directory, as long as it is
2849 # in the generic, win or unix subdirectory of $(srcdir).
2850 #
2851 # Arguments:
2852 # one or more file names
2853 #
2854 # Results:
2855 #
2856 # Defines and substs the following vars:
2857 # PKG_STUB_SOURCES
2858 # PKG_STUB_OBJECTS
2859 #------------------------------------------------------------------------
2860 AC_DEFUN([TEA_ADD_STUB_SOURCES], [
2861 vars="$@"
2862 for i in $vars; do
2863 # check for existence - allows for generic/win/unix VPATH
2864 if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
2865 -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
2866 -a ! -f "${srcdir}/macosx/$i" \
2867 ; then
2868 AC_MSG_ERROR([could not find stub source file '$i'])
2869 fi
2870 PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
2871 # this assumes it is in a VPATH dir
2872 i=`basename $i`
2873 # handle user calling this before or after TEA_SETUP_COMPILER
2874 if test x"${OBJEXT}" != x ; then
2875 j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
2876 else
2877 j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
2878 fi
2879 PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
2880 done
2881 AC_SUBST(PKG_STUB_SOURCES)
2882 AC_SUBST(PKG_STUB_OBJECTS)
2883 ])
2884
2885 #------------------------------------------------------------------------
2886 # TEA_ADD_TCL_SOURCES --
2887 #
2888 # Specify one or more Tcl source files. These should be platform
2889 # independent runtime files.
2890 #
2891 # Arguments:
2892 # one or more file names
2893 #
2894 # Results:
2895 #
2896 # Defines and substs the following vars:
2897 # PKG_TCL_SOURCES
2898 #------------------------------------------------------------------------
2899 AC_DEFUN([TEA_ADD_TCL_SOURCES], [
2900 vars="$@"
2901 for i in $vars; do
2902 # check for existence, be strict because it is installed
2903 if test ! -f "${srcdir}/$i" ; then
2904 AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
2905 fi
2906 PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
2907 done
2908 AC_SUBST(PKG_TCL_SOURCES)
2909 ])
2910
2911 #------------------------------------------------------------------------
2912 # TEA_ADD_HEADERS --
2913 #
2914 # Specify one or more source headers. Users should check for
2915 # the right platform before adding to their list.
2916 #
2917 # Arguments:
2918 # one or more file names
2919 #
2920 # Results:
2921 #
2922 # Defines and substs the following vars:
2923 # PKG_HEADERS
2924 #------------------------------------------------------------------------
2925 AC_DEFUN([TEA_ADD_HEADERS], [
2926 vars="$@"
2927 for i in $vars; do
2928 # check for existence, be strict because it is installed
2929 if test ! -f "${srcdir}/$i" ; then
2930 AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
2931 fi
2932 PKG_HEADERS="$PKG_HEADERS $i"
2933 done
2934 AC_SUBST(PKG_HEADERS)
2935 ])
2936
2937 #------------------------------------------------------------------------
2938 # TEA_ADD_INCLUDES --
2939 #
2940 # Specify one or more include dirs. Users should check for
2941 # the right platform before adding to their list.
2942 #
2943 # Arguments:
2944 # one or more file names
2945 #
2946 # Results:
2947 #
2948 # Defines and substs the following vars:
2949 # PKG_INCLUDES
2950 #------------------------------------------------------------------------
2951 AC_DEFUN([TEA_ADD_INCLUDES], [
2952 vars="$@"
2953 for i in $vars; do
2954 PKG_INCLUDES="$PKG_INCLUDES $i"
2955 done
2956 AC_SUBST(PKG_INCLUDES)
2957 ])
2958
2959 #------------------------------------------------------------------------
2960 # TEA_ADD_LIBS --
2961 #
2962 # Specify one or more libraries. Users should check for
2963 # the right platform before adding to their list. For Windows,
2964 # libraries provided in "foo.lib" format will be converted to
2965 # "-lfoo" when using GCC (mingw).
2966 #
2967 # Arguments:
2968 # one or more file names
2969 #
2970 # Results:
2971 #
2972 # Defines and substs the following vars:
2973 # PKG_LIBS
2974 #------------------------------------------------------------------------
2975 AC_DEFUN([TEA_ADD_LIBS], [
2976 vars="$@"
2977 for i in $vars; do
2978 if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
2979 # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
2980 i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.[[lL]][[iI]][[bB]][$]/-l\1/'`
2981 fi
2982 PKG_LIBS="$PKG_LIBS $i"
2983 done
2984 AC_SUBST(PKG_LIBS)
2985 ])
2986
2987 #------------------------------------------------------------------------
2988 # TEA_ADD_CFLAGS --
2989 #
2990 # Specify one or more CFLAGS. Users should check for
2991 # the right platform before adding to their list.
2992 #
2993 # Arguments:
2994 # one or more file names
2995 #
2996 # Results:
2997 #
2998 # Defines and substs the following vars:
2999 # PKG_CFLAGS
3000 #------------------------------------------------------------------------
3001 AC_DEFUN([TEA_ADD_CFLAGS], [
3002 PKG_CFLAGS="$PKG_CFLAGS $@"
3003 AC_SUBST(PKG_CFLAGS)
3004 ])
3005
3006 #------------------------------------------------------------------------
3007 # TEA_ADD_CLEANFILES --
3008 #
3009 # Specify one or more CLEANFILES.
3010 #
3011 # Arguments:
3012 # one or more file names to clean target
3013 #
3014 # Results:
3015 #
3016 # Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG
3017 #------------------------------------------------------------------------
3018 AC_DEFUN([TEA_ADD_CLEANFILES], [
3019 CLEANFILES="$CLEANFILES $@"
3020 ])
3021
3022 #------------------------------------------------------------------------
3023 # TEA_PREFIX --
3024 #
3025 # Handle the --prefix=... option by defaulting to what Tcl gave
3026 #
3027 # Arguments:
3028 # none
3029 #
3030 # Results:
3031 #
3032 # If --prefix or --exec-prefix was not specified, $prefix and
3033 # $exec_prefix will be set to the values given to Tcl when it was
3034 # configured.
3035 #------------------------------------------------------------------------
3036 AC_DEFUN([TEA_PREFIX], [
3037 if test "${prefix}" = "NONE"; then
3038 prefix_default=yes
3039 if test x"${TCL_PREFIX}" != x; then
3040 AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
3041 prefix=${TCL_PREFIX}
3042 else
3043 AC_MSG_NOTICE([--prefix defaulting to /usr/local])
3044 prefix=/usr/local
3045 fi
3046 fi
3047 if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
3048 -o x"${exec_prefix_default}" = x"yes" ; then
3049 if test x"${TCL_EXEC_PREFIX}" != x; then
3050 AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
3051 exec_prefix=${TCL_EXEC_PREFIX}
3052 else
3053 AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
3054 exec_prefix=$prefix
3055 fi
3056 fi
3057 ])
3058
3059 #------------------------------------------------------------------------
3060 # TEA_SETUP_COMPILER_CC --
3061 #
3062 # Do compiler checks the way we want. This is just a replacement
3063 # for AC_PROG_CC in TEA configure.ac files to make them cleaner.
3064 #
3065 # Arguments:
3066 # none
3067 #
3068 # Results:
3069 #
3070 # Sets up CC var and other standard bits we need to make executables.
3071 #------------------------------------------------------------------------
3072 AC_DEFUN([TEA_SETUP_COMPILER_CC], [
3073 # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
3074 # in this macro, they need to go into TEA_SETUP_COMPILER instead.
3075
3076 AC_PROG_CC
3077 AC_PROG_CPP
3078
3079 #--------------------------------------------------------------------
3080 # Checks to see if the make program sets the $MAKE variable.
3081 #--------------------------------------------------------------------
3082
3083 AC_PROG_MAKE_SET
3084
3085 #--------------------------------------------------------------------
3086 # Find ranlib
3087 #--------------------------------------------------------------------
3088
3089 AC_CHECK_TOOL(RANLIB, ranlib)
3090
3091 #--------------------------------------------------------------------
3092 # Determines the correct binary file extension (.o, .obj, .exe etc.)
3093 #--------------------------------------------------------------------
3094
3095 AC_OBJEXT
3096 AC_EXEEXT
3097 ])
3098
3099 #------------------------------------------------------------------------
3100 # TEA_SETUP_COMPILER --
3101 #
3102 # Do compiler checks that use the compiler. This must go after
3103 # TEA_SETUP_COMPILER_CC, which does the actual compiler check.
3104 #
3105 # Arguments:
3106 # none
3107 #
3108 # Results:
3109 #
3110 # Sets up CC var and other standard bits we need to make executables.
3111 #------------------------------------------------------------------------
3112 AC_DEFUN([TEA_SETUP_COMPILER], [
3113 # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
3114 AC_REQUIRE([TEA_SETUP_COMPILER_CC])
3115
3116 #------------------------------------------------------------------------
3117 # If we're using GCC, see if the compiler understands -pipe. If so, use it.
3118 # It makes compiling go faster. (This is only a performance feature.)
3119 #------------------------------------------------------------------------
3120
3121 if test -z "$no_pipe" -a -n "$GCC"; then
3122 AC_CACHE_CHECK([if the compiler understands -pipe],
3123 tcl_cv_cc_pipe, [
3124 hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
3125 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no])
3126 CFLAGS=$hold_cflags])
3127 if test $tcl_cv_cc_pipe = yes; then
3128 CFLAGS="$CFLAGS -pipe"
3129 fi
3130 fi
3131
3132 #--------------------------------------------------------------------
3133 # Common compiler flag setup
3134 #--------------------------------------------------------------------
3135
3136 AC_C_BIGENDIAN
3137 ])
3138
3139 #------------------------------------------------------------------------
3140 # TEA_MAKE_LIB --
3141 #
3142 # Generate a line that can be used to build a shared/unshared library
3143 # in a platform independent manner.
3144 #
3145 # Arguments:
3146 # none
3147 #
3148 # Requires:
3149 #
3150 # Results:
3151 #
3152 # Defines the following vars:
3153 # CFLAGS - Done late here to note disturb other AC macros
3154 # MAKE_LIB - Command to execute to build the Tcl library;
3155 # differs depending on whether or not Tcl is being
3156 # compiled as a shared library.
3157 # MAKE_SHARED_LIB Makefile rule for building a shared library
3158 # MAKE_STATIC_LIB Makefile rule for building a static library
3159 # MAKE_STUB_LIB Makefile rule for building a stub library
3160 # VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL
3161 # VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE
3162 #------------------------------------------------------------------------
3163
3164 AC_DEFUN([TEA_MAKE_LIB], [
3165 if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
3166 MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
3167 MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
3168 AC_EGREP_CPP([manifest needed], [
3169 #if defined(_MSC_VER) && _MSC_VER >= 1400
3170 print("manifest needed")
3171 #endif
3172 ], [
3173 # Could do a CHECK_PROG for mt, but should always be with MSVC8+
3174 VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi"
3175 VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi"
3176 MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
3177 TEA_ADD_CLEANFILES([*.manifest])
3178 ])
3179 MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\[$]@ \$(PKG_STUB_OBJECTS)"
3180 else
3181 MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
3182 MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
3183 MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
3184 fi
3185
3186 if test "${SHARED_BUILD}" = "1" ; then
3187 MAKE_LIB="${MAKE_SHARED_LIB} "
3188 else
3189 MAKE_LIB="${MAKE_STATIC_LIB} "
3190 fi
3191
3192 #--------------------------------------------------------------------
3193 # Shared libraries and static libraries have different names.
3194 # Use the double eval to make sure any variables in the suffix is
3195 # substituted. (@@@ Might not be necessary anymore)
3196 #--------------------------------------------------------------------
3197
3198 PACKAGE_LIB_PREFIX8="${PACKAGE_LIB_PREFIX}"
3199 PACKAGE_LIB_PREFIX9="${PACKAGE_LIB_PREFIX}tcl9"
3200 if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" == x; then
3201 PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX9}"
3202 else
3203 PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX8}"
3204 AC_DEFINE(TCL_MAJOR_VERSION, 8, [Compile for Tcl8?])
3205 fi
3206 if test "${TEA_PLATFORM}" = "windows" ; then
3207 if test "${SHARED_BUILD}" = "1" ; then
3208 # We force the unresolved linking of symbols that are really in
3209 # the private libraries of Tcl and Tk.
3210 if test x"${TK_BIN_DIR}" != x ; then
3211 SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
3212 fi
3213 SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
3214 if test "$GCC" = "yes"; then
3215 SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -static-libgcc"
3216 fi
3217 eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3218 eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3219 eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3220 else
3221 if test "$GCC" = "yes"; then
3222 PACKAGE_LIB_PREFIX=lib${PACKAGE_LIB_PREFIX}
3223 fi
3224 eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3225 eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3226 eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3227 fi
3228 # Some packages build their own stubs libraries
3229 eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
3230 if test "$GCC" = "yes"; then
3231 PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
3232 fi
3233 # These aren't needed on Windows (either MSVC or gcc)
3234 RANLIB=:
3235 RANLIB_STUB=:
3236 else
3237 RANLIB_STUB="${RANLIB}"
3238 if test "${SHARED_BUILD}" = "1" ; then
3239 SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
3240 if test x"${TK_BIN_DIR}" != x ; then
3241 SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
3242 fi
3243 eval eval "PKG_LIB_FILE8=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3244 eval eval "PKG_LIB_FILE9=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3245 eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3246 RANLIB=:
3247 else
3248 eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3249 eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3250 eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3251 fi
3252 # Some packages build their own stubs libraries
3253 eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
3254 fi
3255
3256 # These are escaped so that only CFLAGS is picked up at configure time.
3257 # The other values will be substituted at make time.
3258 CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
3259 if test "${SHARED_BUILD}" = "1" ; then
3260 CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
3261 fi
3262
3263 AC_SUBST(MAKE_LIB)
3264 AC_SUBST(MAKE_SHARED_LIB)
3265 AC_SUBST(MAKE_STATIC_LIB)
3266 AC_SUBST(MAKE_STUB_LIB)
3267 AC_SUBST(RANLIB_STUB)
3268 AC_SUBST(VC_MANIFEST_EMBED_DLL)
3269 AC_SUBST(VC_MANIFEST_EMBED_EXE)
3270 ])
3271
3272 #------------------------------------------------------------------------
3273 # TEA_LIB_SPEC --
3274 #
3275 # Compute the name of an existing object library located in libdir
3276 # from the given base name and produce the appropriate linker flags.
3277 #
3278 # Arguments:
3279 # basename The base name of the library without version
3280 # numbers, extensions, or "lib" prefixes.
3281 # extra_dir Extra directory in which to search for the
3282 # library. This location is used first, then
3283 # $prefix/$exec-prefix, then some defaults.
3284 #
3285 # Requires:
3286 # TEA_INIT and TEA_PREFIX must be called first.
3287 #
3288 # Results:
3289 #
3290 # Defines the following vars:
3291 # ${basename}_LIB_NAME The computed library name.
3292 # ${basename}_LIB_SPEC The computed linker flags.
3293 #------------------------------------------------------------------------
3294
3295 AC_DEFUN([TEA_LIB_SPEC], [
3296 AC_MSG_CHECKING([for $1 library])
3297
3298 # Look in exec-prefix for the library (defined by TEA_PREFIX).
3299
3300 tea_lib_name_dir="${exec_prefix}/lib"
3301
3302 # Or in a user-specified location.
3303
3304 if test x"$2" != x ; then
3305 tea_extra_lib_dir=$2
3306 else
3307 tea_extra_lib_dir=NONE
3308 fi
3309
3310 for i in \
3311 `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
3312 `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
3313 `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
3314 `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
3315 `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
3316 `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
3317 `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \
3318 `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \
3319 `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
3320 `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
3321 if test -f "$i" ; then
3322 tea_lib_name_dir=`dirname $i`
3323 $1_LIB_NAME=`basename $i`
3324 $1_LIB_PATH_NAME=$i
3325 break
3326 fi
3327 done
3328
3329 if test "${TEA_PLATFORM}" = "windows"; then
3330 $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
3331 else
3332 # Strip off the leading "lib" and trailing ".a" or ".so"
3333
3334 tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
3335 $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
3336 fi
3337
3338 if test "x${$1_LIB_NAME}" = x ; then
3339 AC_MSG_ERROR([not found])
3340 else
3341 AC_MSG_RESULT([${$1_LIB_SPEC}])
3342 fi
3343 ])
3344
3345 #------------------------------------------------------------------------
3346 # TEA_PRIVATE_TCL_HEADERS --
3347 #
3348 # Locate the private Tcl include files
3349 #
3350 # Arguments:
3351 #
3352 # Requires:
3353 # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
3354 # already been called.
3355 #
3356 # Results:
3357 #
3358 # Substitutes the following vars:
3359 # TCL_TOP_DIR_NATIVE
3360 # TCL_INCLUDES
3361 #------------------------------------------------------------------------
3362
3363 AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
3364 # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh}
3365 AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS])
3366 AC_MSG_CHECKING([for Tcl private include files])
3367
3368 TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
3369 TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
3370
3371 # Check to see if tcl<Plat>Port.h isn't already with the public headers
3372 # Don't look for tclInt.h because that resides with tcl.h in the core
3373 # sources, but the <plat>Port headers are in a different directory
3374 if test "${TEA_PLATFORM}" = "windows" -a \
3375 -f "${ac_cv_c_tclh}/tclWinPort.h"; then
3376 result="private headers found with public headers"
3377 elif test "${TEA_PLATFORM}" = "unix" -a \
3378 -f "${ac_cv_c_tclh}/tclUnixPort.h"; then
3379 result="private headers found with public headers"
3380 else
3381 TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
3382 if test "${TEA_PLATFORM}" = "windows"; then
3383 TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
3384 else
3385 TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
3386 fi
3387 # Overwrite the previous TCL_INCLUDES as this should capture both
3388 # public and private headers in the same set.
3389 # We want to ensure these are substituted so as not to require
3390 # any *_NATIVE vars be defined in the Makefile
3391 TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
3392 if test "`uname -s`" = "Darwin"; then
3393 # If Tcl was built as a framework, attempt to use
3394 # the framework's Headers and PrivateHeaders directories
3395 case ${TCL_DEFS} in
3396 *TCL_FRAMEWORK*)
3397 if test -d "${TCL_BIN_DIR}/Headers" -a \
3398 -d "${TCL_BIN_DIR}/PrivateHeaders"; then
3399 TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"
3400 else
3401 TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
3402 fi
3403 ;;
3404 esac
3405 result="Using ${TCL_INCLUDES}"
3406 else
3407 if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
3408 AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
3409 fi
3410 result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
3411 fi
3412 fi
3413
3414 AC_SUBST(TCL_TOP_DIR_NATIVE)
3415
3416 AC_SUBST(TCL_INCLUDES)
3417 AC_MSG_RESULT([${result}])
3418 ])
3419
3420 #------------------------------------------------------------------------
3421 # TEA_PUBLIC_TCL_HEADERS --
3422 #
3423 # Locate the installed public Tcl header files
3424 #
3425 # Arguments:
3426 # None.
3427 #
3428 # Requires:
3429 # CYGPATH must be set
3430 #
3431 # Results:
3432 #
3433 # Adds a --with-tclinclude switch to configure.
3434 # Result is cached.
3435 #
3436 # Substitutes the following vars:
3437 # TCL_INCLUDES
3438 #------------------------------------------------------------------------
3439
3440 AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
3441 AC_MSG_CHECKING([for Tcl public headers])
3442
3443 AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
3444
3445 AC_CACHE_VAL(ac_cv_c_tclh, [
3446 # Use the value from --with-tclinclude, if it was given
3447
3448 if test x"${with_tclinclude}" != x ; then
3449 if test -f "${with_tclinclude}/tcl.h" ; then
3450 ac_cv_c_tclh=${with_tclinclude}
3451 else
3452 AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
3453 fi
3454 else
3455 list=""
3456 if test "`uname -s`" = "Darwin"; then
3457 # If Tcl was built as a framework, attempt to use
3458 # the framework's Headers directory
3459 case ${TCL_DEFS} in
3460 *TCL_FRAMEWORK*)
3461 list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
3462 ;;
3463 esac
3464 fi
3465
3466 # Look in the source dir only if Tcl is not installed,
3467 # and in that situation, look there before installed locations.
3468 if test -f "${TCL_BIN_DIR}/Makefile" ; then
3469 list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
3470 fi
3471
3472 # Check order: pkg --prefix location, Tcl's --prefix location,
3473 # relative to directory of tclConfig.sh.
3474
3475 eval "temp_includedir=${includedir}"
3476 list="$list \
3477 `ls -d ${temp_includedir} 2>/dev/null` \
3478 `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
3479 `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
3480 if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
3481 list="$list /usr/local/include /usr/include"
3482 if test x"${TCL_INCLUDE_SPEC}" != x ; then
3483 d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
3484 list="$list `ls -d ${d} 2>/dev/null`"
3485 fi
3486 fi
3487 for i in $list ; do
3488 if test -f "$i/tcl.h" ; then
3489 ac_cv_c_tclh=$i
3490 break
3491 fi
3492 done
3493 fi
3494 ])
3495
3496 # Print a message based on how we determined the include path
3497
3498 if test x"${ac_cv_c_tclh}" = x ; then
3499 AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
3500 else
3501 AC_MSG_RESULT([${ac_cv_c_tclh}])
3502 fi
3503
3504 # Convert to a native path and substitute into the output files.
3505
3506 INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
3507
3508 TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3509
3510 AC_SUBST(TCL_INCLUDES)
3511 ])
3512
3513 #------------------------------------------------------------------------
3514 # TEA_PRIVATE_TK_HEADERS --
3515 #
3516 # Locate the private Tk include files
3517 #
3518 # Arguments:
3519 #
3520 # Requires:
3521 # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
3522 # already been called.
3523 #
3524 # Results:
3525 #
3526 # Substitutes the following vars:
3527 # TK_INCLUDES
3528 #------------------------------------------------------------------------
3529
3530 AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
3531 # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh}
3532 AC_REQUIRE([TEA_PUBLIC_TK_HEADERS])
3533 AC_MSG_CHECKING([for Tk private include files])
3534
3535 TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
3536 TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
3537
3538 # Check to see if tk<Plat>Port.h isn't already with the public headers
3539 # Don't look for tkInt.h because that resides with tk.h in the core
3540 # sources, but the <plat>Port headers are in a different directory
3541 if test "${TEA_PLATFORM}" = "windows" -a \
3542 -f "${ac_cv_c_tkh}/tkWinPort.h"; then
3543 result="private headers found with public headers"
3544 elif test "${TEA_PLATFORM}" = "unix" -a \
3545 -f "${ac_cv_c_tkh}/tkUnixPort.h"; then
3546 result="private headers found with public headers"
3547 else
3548 TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
3549 TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
3550 if test "${TEA_PLATFORM}" = "windows"; then
3551 TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
3552 else
3553 TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
3554 fi
3555 # Overwrite the previous TK_INCLUDES as this should capture both
3556 # public and private headers in the same set.
3557 # We want to ensure these are substituted so as not to require
3558 # any *_NATIVE vars be defined in the Makefile
3559 TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
3560 # Detect and add ttk subdir
3561 if test -d "${TK_SRC_DIR}/generic/ttk"; then
3562 TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
3563 fi
3564 if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
3565 TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\""
3566 fi
3567 if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
3568 TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\""
3569 fi
3570 if test "`uname -s`" = "Darwin"; then
3571 # If Tk was built as a framework, attempt to use
3572 # the framework's Headers and PrivateHeaders directories
3573 case ${TK_DEFS} in
3574 *TK_FRAMEWORK*)
3575 if test -d "${TK_BIN_DIR}/Headers" -a \
3576 -d "${TK_BIN_DIR}/PrivateHeaders"; then
3577 TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"
3578 else
3579 TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
3580 fi
3581 ;;
3582 esac
3583 result="Using ${TK_INCLUDES}"
3584 else
3585 if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
3586 AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
3587 fi
3588 result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}"
3589 fi
3590 fi
3591
3592 AC_SUBST(TK_TOP_DIR_NATIVE)
3593 AC_SUBST(TK_XLIB_DIR_NATIVE)
3594
3595 AC_SUBST(TK_INCLUDES)
3596 AC_MSG_RESULT([${result}])
3597 ])
3598
3599 #------------------------------------------------------------------------
3600 # TEA_PUBLIC_TK_HEADERS --
3601 #
3602 # Locate the installed public Tk header files
3603 #
3604 # Arguments:
3605 # None.
3606 #
3607 # Requires:
3608 # CYGPATH must be set
3609 #
3610 # Results:
3611 #
3612 # Adds a --with-tkinclude switch to configure.
3613 # Result is cached.
3614 #
3615 # Substitutes the following vars:
3616 # TK_INCLUDES
3617 #------------------------------------------------------------------------
3618
3619 AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
3620 AC_MSG_CHECKING([for Tk public headers])
3621
3622 AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval})
3623
3624 AC_CACHE_VAL(ac_cv_c_tkh, [
3625 # Use the value from --with-tkinclude, if it was given
3626
3627 if test x"${with_tkinclude}" != x ; then
3628 if test -f "${with_tkinclude}/tk.h" ; then
3629 ac_cv_c_tkh=${with_tkinclude}
3630 else
3631 AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
3632 fi
3633 else
3634 list=""
3635 if test "`uname -s`" = "Darwin"; then
3636 # If Tk was built as a framework, attempt to use
3637 # the framework's Headers directory.
3638 case ${TK_DEFS} in
3639 *TK_FRAMEWORK*)
3640 list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
3641 ;;
3642 esac
3643 fi
3644
3645 # Look in the source dir only if Tk is not installed,
3646 # and in that situation, look there before installed locations.
3647 if test -f "${TK_BIN_DIR}/Makefile" ; then
3648 list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
3649 fi
3650
3651 # Check order: pkg --prefix location, Tk's --prefix location,
3652 # relative to directory of tkConfig.sh, Tcl's --prefix location,
3653 # relative to directory of tclConfig.sh.
3654
3655 eval "temp_includedir=${includedir}"
3656 list="$list \
3657 `ls -d ${temp_includedir} 2>/dev/null` \
3658 `ls -d ${TK_PREFIX}/include 2>/dev/null` \
3659 `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
3660 `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
3661 `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
3662 if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
3663 list="$list /usr/local/include /usr/include"
3664 if test x"${TK_INCLUDE_SPEC}" != x ; then
3665 d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
3666 list="$list `ls -d ${d} 2>/dev/null`"
3667 fi
3668 fi
3669 for i in $list ; do
3670 if test -f "$i/tk.h" ; then
3671 ac_cv_c_tkh=$i
3672 break
3673 fi
3674 done
3675 fi
3676 ])
3677
3678 # Print a message based on how we determined the include path
3679
3680 if test x"${ac_cv_c_tkh}" = x ; then
3681 AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
3682 else
3683 AC_MSG_RESULT([${ac_cv_c_tkh}])
3684 fi
3685
3686 # Convert to a native path and substitute into the output files.
3687
3688 INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
3689
3690 TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3691
3692 AC_SUBST(TK_INCLUDES)
3693
3694 if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
3695 # On Windows and Aqua, we need the X compat headers
3696 AC_MSG_CHECKING([for X11 header files])
3697 if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
3698 INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
3699 TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3700 AC_SUBST(TK_XINCLUDES)
3701 fi
3702 AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
3703 fi
3704 ])
3705
3706 #------------------------------------------------------------------------
3707 # TEA_PATH_CONFIG --
3708 #
3709 # Locate the ${1}Config.sh file and perform a sanity check on
3710 # the ${1} compile flags. These are used by packages like
3711 # [incr Tk] that load *Config.sh files from more than Tcl and Tk.
3712 #
3713 # Arguments:
3714 # none
3715 #
3716 # Results:
3717 #
3718 # Adds the following arguments to configure:
3719 # --with-$1=...
3720 #
3721 # Defines the following vars:
3722 # $1_BIN_DIR Full path to the directory containing
3723 # the $1Config.sh file
3724 #------------------------------------------------------------------------
3725
3726 AC_DEFUN([TEA_PATH_CONFIG], [
3727 #
3728 # Ok, lets find the $1 configuration
3729 # First, look for one uninstalled.
3730 # the alternative search directory is invoked by --with-$1
3731 #
3732
3733 if test x"${no_$1}" = x ; then
3734 # we reset no_$1 in case something fails here
3735 no_$1=true
3736 AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
3737 AC_MSG_CHECKING([for $1 configuration])
3738 AC_CACHE_VAL(ac_cv_c_$1config,[
3739
3740 # First check to see if --with-$1 was specified.
3741 if test x"${with_$1config}" != x ; then
3742 case ${with_$1config} in
3743 */$1Config.sh )
3744 if test -f ${with_$1config}; then
3745 AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
3746 with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
3747 fi;;
3748 esac
3749 if test -f "${with_$1config}/$1Config.sh" ; then
3750 ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
3751 else
3752 AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
3753 fi
3754 fi
3755
3756 # then check for a private $1 installation
3757 if test x"${ac_cv_c_$1config}" = x ; then
3758 for i in \
3759 ../$1 \
3760 `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3761 `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3762 `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3763 `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3764 ../../$1 \
3765 `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3766 `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3767 `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3768 `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3769 ../../../$1 \
3770 `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3771 `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3772 `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3773 `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3774 ${srcdir}/../$1 \
3775 `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3776 `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3777 `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3778 `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3779 ; do
3780 if test -f "$i/$1Config.sh" ; then
3781 ac_cv_c_$1config=`(cd $i; pwd)`
3782 break
3783 fi
3784 if test -f "$i/unix/$1Config.sh" ; then
3785 ac_cv_c_$1config=`(cd $i/unix; pwd)`
3786 break
3787 fi
3788 done
3789 fi
3790
3791 # check in a few common install locations
3792 if test x"${ac_cv_c_$1config}" = x ; then
3793 for i in `ls -d ${libdir} 2>/dev/null` \
3794 `ls -d ${exec_prefix}/lib 2>/dev/null` \
3795 `ls -d ${prefix}/lib 2>/dev/null` \
3796 `ls -d /usr/local/lib 2>/dev/null` \
3797 `ls -d /usr/contrib/lib 2>/dev/null` \
3798 `ls -d /usr/pkg/lib 2>/dev/null` \
3799 `ls -d /usr/lib 2>/dev/null` \
3800 `ls -d /usr/lib64 2>/dev/null` \
3801 ; do
3802 if test -f "$i/$1Config.sh" ; then
3803 ac_cv_c_$1config=`(cd $i; pwd)`
3804 break
3805 fi
3806 done
3807 fi
3808 ])
3809
3810 if test x"${ac_cv_c_$1config}" = x ; then
3811 $1_BIN_DIR="# no $1 configs found"
3812 AC_MSG_WARN([Cannot find $1 configuration definitions])
3813 exit 0
3814 else
3815 no_$1=
3816 $1_BIN_DIR=${ac_cv_c_$1config}
3817 AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
3818 fi
3819 fi
3820 ])
3821
3822 #------------------------------------------------------------------------
3823 # TEA_LOAD_CONFIG --
3824 #
3825 # Load the $1Config.sh file
3826 #
3827 # Arguments:
3828 #
3829 # Requires the following vars to be set:
3830 # $1_BIN_DIR
3831 #
3832 # Results:
3833 #
3834 # Substitutes the following vars:
3835 # $1_SRC_DIR
3836 # $1_LIB_FILE
3837 # $1_LIB_SPEC
3838 #------------------------------------------------------------------------
3839
3840 AC_DEFUN([TEA_LOAD_CONFIG], [
3841 AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
3842
3843 if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
3844 AC_MSG_RESULT([loading])
3845 . "${$1_BIN_DIR}/$1Config.sh"
3846 else
3847 AC_MSG_RESULT([file not found])
3848 fi
3849
3850 #
3851 # If the $1_BIN_DIR is the build directory (not the install directory),
3852 # then set the common variable name to the value of the build variables.
3853 # For example, the variable $1_LIB_SPEC will be set to the value
3854 # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
3855 # instead of $1_BUILD_LIB_SPEC since it will work with both an
3856 # installed and uninstalled version of Tcl.
3857 #
3858
3859 if test -f "${$1_BIN_DIR}/Makefile" ; then
3860 AC_MSG_WARN([Found Makefile - using build library specs for $1])
3861 $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
3862 $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
3863 $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
3864 $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
3865 $1_LIBRARY_PATH=${$1_LIBRARY_PATH}
3866 fi
3867
3868 AC_SUBST($1_VERSION)
3869 AC_SUBST($1_BIN_DIR)
3870 AC_SUBST($1_SRC_DIR)
3871
3872 AC_SUBST($1_LIB_FILE)
3873 AC_SUBST($1_LIB_SPEC)
3874
3875 AC_SUBST($1_STUB_LIB_FILE)
3876 AC_SUBST($1_STUB_LIB_SPEC)
3877 AC_SUBST($1_STUB_LIB_PATH)
3878
3879 # Allow the caller to prevent this auto-check by specifying any 2nd arg
3880 AS_IF([test "x$2" = x], [
3881 # Check both upper and lower-case variants
3882 # If a dev wanted non-stubs libs, this function could take an option
3883 # to not use _STUB in the paths below
3884 AS_IF([test "x${$1_STUB_LIB_SPEC}" = x],
3885 [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)],
3886 [TEA_LOAD_CONFIG_LIB($1_STUB)])
3887 ])
3888 ])
3889
3890 #------------------------------------------------------------------------
3891 # TEA_LOAD_CONFIG_LIB --
3892 #
3893 # Helper function to load correct library from another extension's
3894 # ${PACKAGE}Config.sh.
3895 #
3896 # Results:
3897 # Adds to LIBS the appropriate extension library
3898 #------------------------------------------------------------------------
3899 AC_DEFUN([TEA_LOAD_CONFIG_LIB], [
3900 AC_MSG_CHECKING([For $1 library for LIBS])
3901 # This simplifies the use of stub libraries by automatically adding
3902 # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS,
3903 # but this is called before CONFIG_CFLAGS. More importantly, this adds
3904 # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
3905 if test "x${$1_LIB_SPEC}" != "x" ; then
3906 if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
3907 TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"])
3908 AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}])
3909 else
3910 TEA_ADD_LIBS([${$1_LIB_SPEC}])
3911 AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}])
3912 fi
3913 else
3914 AC_MSG_RESULT([file not found])
3915 fi
3916 ])
3917
3918 #------------------------------------------------------------------------
3919 # TEA_EXPORT_CONFIG --
3920 #
3921 # Define the data to insert into the ${PACKAGE}Config.sh file
3922 #
3923 # Arguments:
3924 #
3925 # Requires the following vars to be set:
3926 # $1
3927 #
3928 # Results:
3929 # Substitutes the following vars:
3930 #------------------------------------------------------------------------
3931
3932 AC_DEFUN([TEA_EXPORT_CONFIG], [
3933 #--------------------------------------------------------------------
3934 # These are for $1Config.sh
3935 #--------------------------------------------------------------------
3936
3937 # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
3938 eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}"
3939 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
3940 eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}"
3941 eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}"
3942 else
3943 eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`"
3944 eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`"
3945 fi
3946 $1_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${$1_LIB_FLAG}"
3947 $1_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` ${$1_LIB_FLAG}"
3948 $1_BUILD_STUB_LIB_SPEC="-L`$CYGPATH $(pwd)` [$]{$1_STUB_LIB_FLAG}"
3949 $1_STUB_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` [$]{$1_STUB_LIB_FLAG}"
3950 $1_BUILD_STUB_LIB_PATH="`$CYGPATH $(pwd)`/[$]{PKG_STUB_LIB_FILE}"
3951 $1_STUB_LIB_PATH="`$CYGPATH ${pkglibdir}`/[$]{PKG_STUB_LIB_FILE}"
3952
3953 AC_SUBST($1_BUILD_LIB_SPEC)
3954 AC_SUBST($1_LIB_SPEC)
3955 AC_SUBST($1_BUILD_STUB_LIB_SPEC)
3956 AC_SUBST($1_STUB_LIB_SPEC)
3957 AC_SUBST($1_BUILD_STUB_LIB_PATH)
3958 AC_SUBST($1_STUB_LIB_PATH)
3959
3960 AC_SUBST(MAJOR_VERSION)
3961 AC_SUBST(MINOR_VERSION)
3962 AC_SUBST(PATCHLEVEL)
3963 ])
3964
3965
3966 #------------------------------------------------------------------------
3967 # TEA_INSTALLER --
3968 #
3969 # Configure the installer.
3970 #
3971 # Arguments:
3972 # none
3973 #
3974 # Results:
3975 # Substitutes the following vars:
3976 # INSTALL
3977 # INSTALL_DATA_DIR
3978 # INSTALL_DATA
3979 # INSTALL_PROGRAM
3980 # INSTALL_SCRIPT
3981 # INSTALL_LIBRARY
3982 #------------------------------------------------------------------------
3983
3984 AC_DEFUN([TEA_INSTALLER], [
3985 INSTALL='$(SHELL) $(srcdir)/tclconfig/install-sh -c'
3986 INSTALL_DATA_DIR='${INSTALL} -d -m 755'
3987 INSTALL_DATA='${INSTALL} -m 644'
3988 INSTALL_PROGRAM='${INSTALL} -m 755'
3989 INSTALL_SCRIPT='${INSTALL} -m 755'
3990
3991 TEA_CONFIG_SYSTEM
3992 case $system in
3993 HP-UX-*) INSTALL_LIBRARY='${INSTALL} -m 755' ;;
3994 *) INSTALL_LIBRARY='${INSTALL} -m 644' ;;
3995 esac
3996
3997 AC_SUBST(INSTALL)
3998 AC_SUBST(INSTALL_DATA_DIR)
3999 AC_SUBST(INSTALL_DATA)
4000 AC_SUBST(INSTALL_PROGRAM)
4001 AC_SUBST(INSTALL_SCRIPT)
4002 AC_SUBST(INSTALL_LIBRARY)
4003 ])
4004
4005 ###
4006 # Tip 430 - ZipFS Modifications
4007 ###
4008 #------------------------------------------------------------------------
4009 # TEA_ZIPFS_SUPPORT
4010 # Locate a zip encoder installed on the system path, or none.
4011 #
4012 # Arguments:
4013 # none
4014 #
4015 # Results:
4016 # Substitutes the following vars:
4017 # MACHER_PROG
4018 # ZIP_PROG
4019 # ZIP_PROG_OPTIONS
4020 # ZIP_PROG_VFSSEARCH
4021 # ZIP_INSTALL_OBJS
4022 #------------------------------------------------------------------------
4023
4024 AC_DEFUN([TEA_ZIPFS_SUPPORT], [
4025 MACHER_PROG=""
4026 ZIP_PROG=""
4027 ZIP_PROG_OPTIONS=""
4028 ZIP_PROG_VFSSEARCH=""
4029 ZIP_INSTALL_OBJS=""
4030
4031 AC_MSG_CHECKING([for macher])
4032 AC_CACHE_VAL(ac_cv_path_macher, [
4033 search_path=`echo ${PATH} | sed -e 's/:/ /g'`
4034 for dir in $search_path ; do
4035 for j in `ls -r $dir/macher 2> /dev/null` \
4036 `ls -r $dir/macher 2> /dev/null` ; do
4037 if test x"$ac_cv_path_macher" = x ; then
4038 if test -f "$j" ; then
4039 ac_cv_path_macher=$j
4040 break
4041 fi
4042 fi
4043 done
4044 done
4045 ])
4046 if test -f "$ac_cv_path_macher" ; then
4047 MACHER_PROG="$ac_cv_path_macher"
4048 AC_MSG_RESULT([$MACHER_PROG])
4049 AC_MSG_RESULT([Found macher in environment])
4050 fi
4051 AC_MSG_CHECKING([for zip])
4052 AC_CACHE_VAL(ac_cv_path_zip, [
4053 search_path=`echo ${PATH} | sed -e 's/:/ /g'`
4054 for dir in $search_path ; do
4055 for j in `ls -r $dir/zip 2> /dev/null` \
4056 `ls -r $dir/zip 2> /dev/null` ; do
4057 if test x"$ac_cv_path_zip" = x ; then
4058 if test -f "$j" ; then
4059 ac_cv_path_zip=$j
4060 break
4061 fi
4062 fi
4063 done
4064 done
4065 ])
4066 if test -f "$ac_cv_path_zip" ; then
4067 ZIP_PROG="$ac_cv_path_zip"
4068 AC_MSG_RESULT([$ZIP_PROG])
4069 ZIP_PROG_OPTIONS="-rq"
4070 ZIP_PROG_VFSSEARCH="*"
4071 AC_MSG_RESULT([Found INFO Zip in environment])
4072 # Use standard arguments for zip
4073 else
4074 # It is not an error if an installed version of Zip can't be located.
4075 # We can use the locally distributed minizip instead
4076 ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
4077 ZIP_PROG_OPTIONS="-o -r"
4078 ZIP_PROG_VFSSEARCH="*"
4079 ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
4080 AC_MSG_RESULT([No zip found on PATH. Building minizip])
4081 fi
4082 AC_SUBST(MACHER_PROG)
4083 AC_SUBST(ZIP_PROG)
4084 AC_SUBST(ZIP_PROG_OPTIONS)
4085 AC_SUBST(ZIP_PROG_VFSSEARCH)
4086 AC_SUBST(ZIP_INSTALL_OBJS)
4087 ])
4088
4089 # Local Variables:
4090 # mode: autoconf
4091 # End: