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