[25] | 1 | #! /bin/bash -norc |
---|
| 2 | dnl This file is an input file used by the GNU "autoconf" program to |
---|
| 3 | dnl generate the file "configure", which is run during Tcl installation |
---|
| 4 | dnl to configure the system for the local environment. |
---|
| 5 | # |
---|
| 6 | # RCS: @(#) $Id: configure.in,v 1.180 2008/03/28 17:31:47 dgp Exp $ |
---|
| 7 | |
---|
| 8 | AC_INIT([tcl],[8.5]) |
---|
| 9 | AC_PREREQ(2.59) |
---|
| 10 | |
---|
| 11 | dnl This is only used when included from macosx/configure.ac |
---|
| 12 | m4_ifdef([SC_USE_CONFIG_HEADERS], [ |
---|
| 13 | AC_CONFIG_HEADERS([tclConfig.h:../unix/tclConfig.h.in]) |
---|
| 14 | AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TCL_CONFIG_H -imacros tclConfig.h"]) |
---|
| 15 | AH_TOP([ |
---|
| 16 | #ifndef _TCLCONFIG |
---|
| 17 | #define _TCLCONFIG]) |
---|
| 18 | AH_BOTTOM([ |
---|
| 19 | /* Undef unused package specific autoheader defines so that we can |
---|
| 20 | * include both tclConfig.h and tkConfig.h at the same time: */ |
---|
| 21 | /* override */ #undef PACKAGE_NAME |
---|
| 22 | /* override */ #undef PACKAGE_STRING |
---|
| 23 | /* override */ #undef PACKAGE_TARNAME |
---|
| 24 | #endif /* _TCLCONFIG */]) |
---|
| 25 | ]) |
---|
| 26 | |
---|
| 27 | TCL_VERSION=8.5 |
---|
| 28 | TCL_MAJOR_VERSION=8 |
---|
| 29 | TCL_MINOR_VERSION=5 |
---|
| 30 | TCL_PATCH_LEVEL=".2" |
---|
| 31 | VERSION=${TCL_VERSION} |
---|
| 32 | |
---|
| 33 | #------------------------------------------------------------------------ |
---|
| 34 | # Handle the --prefix=... option |
---|
| 35 | #------------------------------------------------------------------------ |
---|
| 36 | |
---|
| 37 | if test "${prefix}" = "NONE"; then |
---|
| 38 | prefix=/usr/local |
---|
| 39 | fi |
---|
| 40 | if test "${exec_prefix}" = "NONE"; then |
---|
| 41 | exec_prefix=$prefix |
---|
| 42 | fi |
---|
| 43 | # Make sure srcdir is fully qualified! |
---|
| 44 | srcdir="`cd "$srcdir" ; pwd`" |
---|
| 45 | TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" |
---|
| 46 | |
---|
| 47 | #------------------------------------------------------------------------ |
---|
| 48 | # Compress and/or soft link the manpages? |
---|
| 49 | #------------------------------------------------------------------------ |
---|
| 50 | |
---|
| 51 | SC_CONFIG_MANPAGES |
---|
| 52 | |
---|
| 53 | #------------------------------------------------------------------------ |
---|
| 54 | # Standard compiler checks |
---|
| 55 | #------------------------------------------------------------------------ |
---|
| 56 | |
---|
| 57 | # If the user did not set CFLAGS, set it now to keep |
---|
| 58 | # the AC_PROG_CC macro from adding "-g -O2". |
---|
| 59 | if test "${CFLAGS+set}" != "set" ; then |
---|
| 60 | CFLAGS="" |
---|
| 61 | fi |
---|
| 62 | |
---|
| 63 | AC_PROG_CC |
---|
| 64 | AC_C_INLINE |
---|
| 65 | |
---|
| 66 | #-------------------------------------------------------------------- |
---|
| 67 | # Supply substitutes for missing POSIX header files. Special notes: |
---|
| 68 | # - stdlib.h doesn't define strtol, strtoul, or |
---|
| 69 | # strtod insome versions of SunOS |
---|
| 70 | # - some versions of string.h don't declare procedures such |
---|
| 71 | # as strstr |
---|
| 72 | # Do this early, otherwise an autoconf bug throws errors on configure |
---|
| 73 | #-------------------------------------------------------------------- |
---|
| 74 | |
---|
| 75 | SC_MISSING_POSIX_HEADERS |
---|
| 76 | |
---|
| 77 | #------------------------------------------------------------------------ |
---|
| 78 | # If we're using GCC, see if the compiler understands -pipe. If so, use it. |
---|
| 79 | # It makes compiling go faster. (This is only a performance feature.) |
---|
| 80 | #------------------------------------------------------------------------ |
---|
| 81 | |
---|
| 82 | if test -z "$no_pipe" && test -n "$GCC"; then |
---|
| 83 | AC_CACHE_CHECK([if the compiler understands -pipe], |
---|
| 84 | tcl_cv_cc_pipe, [ |
---|
| 85 | hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" |
---|
| 86 | AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) |
---|
| 87 | CFLAGS=$hold_cflags]) |
---|
| 88 | if test $tcl_cv_cc_pipe = yes; then |
---|
| 89 | CFLAGS="$CFLAGS -pipe" |
---|
| 90 | fi |
---|
| 91 | fi |
---|
| 92 | |
---|
| 93 | #------------------------------------------------------------------------ |
---|
| 94 | # Threads support |
---|
| 95 | #------------------------------------------------------------------------ |
---|
| 96 | |
---|
| 97 | SC_ENABLE_THREADS |
---|
| 98 | |
---|
| 99 | #------------------------------------------------------------------------ |
---|
| 100 | # Embedded configuration information, encoding to use for the values, TIP #59 |
---|
| 101 | #------------------------------------------------------------------------ |
---|
| 102 | |
---|
| 103 | SC_TCL_CFG_ENCODING |
---|
| 104 | |
---|
| 105 | #-------------------------------------------------------------------- |
---|
| 106 | # Look for libraries that we will need when compiling the Tcl shell |
---|
| 107 | #-------------------------------------------------------------------- |
---|
| 108 | |
---|
| 109 | SC_TCL_LINK_LIBS |
---|
| 110 | |
---|
| 111 | # Add the threads support libraries |
---|
| 112 | LIBS="$LIBS$THREADS_LIBS" |
---|
| 113 | |
---|
| 114 | SC_ENABLE_SHARED |
---|
| 115 | |
---|
| 116 | #-------------------------------------------------------------------- |
---|
| 117 | # The statements below define a collection of compile flags. This |
---|
| 118 | # macro depends on the value of SHARED_BUILD, and should be called |
---|
| 119 | # after SC_ENABLE_SHARED checks the configure switches. |
---|
| 120 | #-------------------------------------------------------------------- |
---|
| 121 | |
---|
| 122 | SC_CONFIG_CFLAGS |
---|
| 123 | |
---|
| 124 | SC_ENABLE_SYMBOLS(bccdebug) |
---|
| 125 | |
---|
| 126 | AC_DEFINE(TCL_TOMMATH, 1, [Build libtommath?]) |
---|
| 127 | AC_DEFINE(MP_PREC, 4, [Default libtommath precision.]) |
---|
| 128 | |
---|
| 129 | #-------------------------------------------------------------------- |
---|
| 130 | # Detect what compiler flags to set for 64-bit support. |
---|
| 131 | #-------------------------------------------------------------------- |
---|
| 132 | |
---|
| 133 | SC_TCL_EARLY_FLAGS |
---|
| 134 | |
---|
| 135 | SC_TCL_64BIT_FLAGS |
---|
| 136 | |
---|
| 137 | #-------------------------------------------------------------------- |
---|
| 138 | # Check endianness because we can optimize comparisons of |
---|
| 139 | # Tcl_UniChar strings to memcmp on big-endian systems. |
---|
| 140 | #-------------------------------------------------------------------- |
---|
| 141 | |
---|
| 142 | AC_C_BIGENDIAN |
---|
| 143 | |
---|
| 144 | #-------------------------------------------------------------------- |
---|
| 145 | # Supply substitutes for missing POSIX library procedures, or |
---|
| 146 | # set flags so Tcl uses alternate procedures. |
---|
| 147 | #-------------------------------------------------------------------- |
---|
| 148 | |
---|
| 149 | # Check if Posix compliant getcwd exists, if not we'll use getwd. |
---|
| 150 | AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD, 1, [Is getcwd Posix-compliant?])]) |
---|
| 151 | # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really |
---|
| 152 | # define USEGETWD even if the posix getcwd exists. Add a test ? |
---|
| 153 | |
---|
| 154 | AC_REPLACE_FUNCS(opendir strtol waitpid) |
---|
| 155 | AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR, 1, [Do we have strerror()])]) |
---|
| 156 | AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD, 1, [Do we have getwd()])]) |
---|
| 157 | AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3, 1, [Do we have wait3()])]) |
---|
| 158 | AC_CHECK_FUNC(uname, , [AC_DEFINE(NO_UNAME, 1, [Do we have uname()])]) |
---|
| 159 | |
---|
| 160 | if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 && \ |
---|
| 161 | test "`uname -r | awk -F. '{print [$]1}'`" -lt 7; then |
---|
| 162 | # prior to Darwin 7, realpath is not threadsafe, so don't |
---|
| 163 | # use it when threads are enabled, c.f. bug # 711232 |
---|
| 164 | ac_cv_func_realpath=no |
---|
| 165 | fi |
---|
| 166 | AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH, 1, [Do we have realpath()])]) |
---|
| 167 | |
---|
| 168 | SC_TCL_GETADDRINFO |
---|
| 169 | |
---|
| 170 | #-------------------------------------------------------------------- |
---|
| 171 | # Look for thread-safe variants of some library functions. |
---|
| 172 | #-------------------------------------------------------------------- |
---|
| 173 | |
---|
| 174 | if test "${TCL_THREADS}" = 1; then |
---|
| 175 | SC_TCL_GETPWUID_R |
---|
| 176 | SC_TCL_GETPWNAM_R |
---|
| 177 | SC_TCL_GETGRGID_R |
---|
| 178 | SC_TCL_GETGRNAM_R |
---|
| 179 | if test "`uname -s`" = "Darwin" && \ |
---|
| 180 | test "`uname -r | awk -F. '{print [$]1}'`" -gt 5; then |
---|
| 181 | # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX |
---|
| 182 | # are actually MT-safe as they always return pointers |
---|
| 183 | # from TSD instead of static storage. |
---|
| 184 | AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1, |
---|
| 185 | [Do we have MT-safe gethostbyname() ?]) |
---|
| 186 | AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1, |
---|
| 187 | [Do we have MT-safe gethostbyaddr() ?]) |
---|
| 188 | |
---|
| 189 | elif test "`uname -s`" = "HP-UX" && \ |
---|
| 190 | test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then |
---|
| 191 | # Starting with HPUX 11.00 (we believe), gethostbyX |
---|
| 192 | # are actually MT-safe as they always return pointers |
---|
| 193 | # from TSD instead of static storage. |
---|
| 194 | AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1, |
---|
| 195 | [Do we have MT-safe gethostbyname() ?]) |
---|
| 196 | AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1, |
---|
| 197 | [Do we have MT-safe gethostbyaddr() ?]) |
---|
| 198 | |
---|
| 199 | else |
---|
| 200 | SC_TCL_GETHOSTBYNAME_R |
---|
| 201 | SC_TCL_GETHOSTBYADDR_R |
---|
| 202 | fi |
---|
| 203 | fi |
---|
| 204 | |
---|
| 205 | #--------------------------------------------------------------------------- |
---|
| 206 | # Determine which interface to use to talk to the serial port. |
---|
| 207 | # Note that #include lines must begin in leftmost column for |
---|
| 208 | # some compilers to recognize them as preprocessor directives. |
---|
| 209 | #--------------------------------------------------------------------------- |
---|
| 210 | |
---|
| 211 | SC_SERIAL_PORT |
---|
| 212 | |
---|
| 213 | #-------------------------------------------------------------------- |
---|
| 214 | # Include sys/select.h if it exists and if it supplies things |
---|
| 215 | # that appear to be useful and aren't already in sys/types.h. |
---|
| 216 | # This appears to be true only on the RS/6000 under AIX. Some |
---|
| 217 | # systems like OSF/1 have a sys/select.h that's of no use, and |
---|
| 218 | # other systems like SCO UNIX have a sys/select.h that's |
---|
| 219 | # pernicious. If "fd_set" isn't defined anywhere then set a |
---|
| 220 | # special flag. |
---|
| 221 | #-------------------------------------------------------------------- |
---|
| 222 | |
---|
| 223 | AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [ |
---|
| 224 | AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;], |
---|
| 225 | tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)]) |
---|
| 226 | tcl_ok=$tcl_cv_type_fd_set |
---|
| 227 | if test $tcl_ok = no; then |
---|
| 228 | AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [ |
---|
| 229 | AC_EGREP_HEADER(fd_mask, sys/select.h, |
---|
| 230 | tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)]) |
---|
| 231 | if test $tcl_cv_grep_fd_mask = present; then |
---|
| 232 | AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Should we include <sys/select.h>?]) |
---|
| 233 | tcl_ok=yes |
---|
| 234 | fi |
---|
| 235 | fi |
---|
| 236 | if test $tcl_ok = no; then |
---|
| 237 | AC_DEFINE(NO_FD_SET, 1, [Do we have fd_set?]) |
---|
| 238 | fi |
---|
| 239 | |
---|
| 240 | #------------------------------------------------------------------------------ |
---|
| 241 | # Find out all about time handling differences. |
---|
| 242 | #------------------------------------------------------------------------------ |
---|
| 243 | |
---|
| 244 | SC_TIME_HANDLER |
---|
| 245 | |
---|
| 246 | #-------------------------------------------------------------------- |
---|
| 247 | # Some systems (e.g., IRIX 4.0.5) lack the st_blksize field |
---|
| 248 | # in struct stat. But we might be able to use fstatfs instead. |
---|
| 249 | #-------------------------------------------------------------------- |
---|
| 250 | |
---|
| 251 | AC_STRUCT_ST_BLKSIZE |
---|
| 252 | AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS, 1, [Do we have fstatfs()?])]) |
---|
| 253 | |
---|
| 254 | #-------------------------------------------------------------------- |
---|
| 255 | # Some system have no memcmp or it does not work with 8 bit |
---|
| 256 | # data, this checks it and add memcmp.o to LIBOBJS if needed |
---|
| 257 | #-------------------------------------------------------------------- |
---|
| 258 | |
---|
| 259 | AC_FUNC_MEMCMP |
---|
| 260 | |
---|
| 261 | #-------------------------------------------------------------------- |
---|
| 262 | # Some system like SunOS 4 and other BSD like systems |
---|
| 263 | # have no memmove (we assume they have bcopy instead). |
---|
| 264 | # {The replacement define is in compat/string.h} |
---|
| 265 | #-------------------------------------------------------------------- |
---|
| 266 | |
---|
| 267 | AC_CHECK_FUNC(memmove, , [ |
---|
| 268 | AC_DEFINE(NO_MEMMOVE, 1, [Do we have memmove()?]) |
---|
| 269 | AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?]) ]) |
---|
| 270 | |
---|
| 271 | #-------------------------------------------------------------------- |
---|
| 272 | # On some systems strstr is broken: it returns a pointer even |
---|
| 273 | # even if the original string is empty. |
---|
| 274 | #-------------------------------------------------------------------- |
---|
| 275 | |
---|
| 276 | SC_TCL_CHECK_BROKEN_FUNC(strstr, [ |
---|
| 277 | extern int strstr(); |
---|
| 278 | exit(strstr("\0test", "test") ? 1 : 0); |
---|
| 279 | ]) |
---|
| 280 | |
---|
| 281 | #-------------------------------------------------------------------- |
---|
| 282 | # Check for strtoul function. This is tricky because under some |
---|
| 283 | # versions of AIX strtoul returns an incorrect terminator |
---|
| 284 | # pointer for the string "0". |
---|
| 285 | #-------------------------------------------------------------------- |
---|
| 286 | |
---|
| 287 | SC_TCL_CHECK_BROKEN_FUNC(strtoul, [ |
---|
| 288 | extern int strtoul(); |
---|
| 289 | char *term, *string = "0"; |
---|
| 290 | exit(strtoul(string,&term,0) != 0 || term != string+1); |
---|
| 291 | ]) |
---|
| 292 | |
---|
| 293 | #-------------------------------------------------------------------- |
---|
| 294 | # Check for the strtod function. This is tricky because in some |
---|
| 295 | # versions of Linux strtod mis-parses strings starting with "+". |
---|
| 296 | #-------------------------------------------------------------------- |
---|
| 297 | |
---|
| 298 | SC_TCL_CHECK_BROKEN_FUNC(strtod, [ |
---|
| 299 | extern double strtod(); |
---|
| 300 | char *term, *string = " +69"; |
---|
| 301 | exit(strtod(string,&term) != 69 || term != string+4); |
---|
| 302 | ]) |
---|
| 303 | |
---|
| 304 | #-------------------------------------------------------------------- |
---|
| 305 | # Under Solaris 2.4, strtod returns the wrong value for the |
---|
| 306 | # terminating character under some conditions. Check for this |
---|
| 307 | # and if the problem exists use a substitute procedure |
---|
| 308 | # "fixstrtod" that corrects the error. |
---|
| 309 | #-------------------------------------------------------------------- |
---|
| 310 | |
---|
| 311 | SC_BUGGY_STRTOD |
---|
| 312 | |
---|
| 313 | #-------------------------------------------------------------------- |
---|
| 314 | # Check for various typedefs and provide substitutes if |
---|
| 315 | # they don't exist. |
---|
| 316 | #-------------------------------------------------------------------- |
---|
| 317 | |
---|
| 318 | AC_TYPE_MODE_T |
---|
| 319 | AC_TYPE_PID_T |
---|
| 320 | AC_TYPE_SIZE_T |
---|
| 321 | AC_TYPE_UID_T |
---|
| 322 | |
---|
| 323 | AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [ |
---|
| 324 | AC_TRY_COMPILE([ |
---|
| 325 | #include <sys/types.h> |
---|
| 326 | #include <sys/socket.h> |
---|
| 327 | ],[ |
---|
| 328 | socklen_t foo; |
---|
| 329 | ],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])]) |
---|
| 330 | if test $tcl_cv_type_socklen_t = no; then |
---|
| 331 | AC_DEFINE(socklen_t, int, [Define as int if socklen_t is not available]) |
---|
| 332 | fi |
---|
| 333 | |
---|
| 334 | AC_CHECK_TYPE([intptr_t], [ |
---|
| 335 | AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [ |
---|
| 336 | AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [ |
---|
| 337 | for tcl_cv_intptr_t in "int" "long" "long long" none; do |
---|
| 338 | if test "$tcl_cv_intptr_t" != none; then |
---|
| 339 | AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], |
---|
| 340 | [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], |
---|
| 341 | [tcl_ok=yes], [tcl_ok=no]) |
---|
| 342 | test "$tcl_ok" = yes && break; fi |
---|
| 343 | done]) |
---|
| 344 | if test "$tcl_cv_intptr_t" != none; then |
---|
| 345 | AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer |
---|
| 346 | type wide enough to hold a pointer.]) |
---|
| 347 | fi |
---|
| 348 | ]) |
---|
| 349 | AC_CHECK_TYPE([uintptr_t], [ |
---|
| 350 | AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [ |
---|
| 351 | AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [ |
---|
| 352 | for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \ |
---|
| 353 | none; do |
---|
| 354 | if test "$tcl_cv_uintptr_t" != none; then |
---|
| 355 | AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], |
---|
| 356 | [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], |
---|
| 357 | [tcl_ok=yes], [tcl_ok=no]) |
---|
| 358 | test "$tcl_ok" = yes && break; fi |
---|
| 359 | done]) |
---|
| 360 | if test "$tcl_cv_uintptr_t" != none; then |
---|
| 361 | AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer |
---|
| 362 | type wide enough to hold a pointer.]) |
---|
| 363 | fi |
---|
| 364 | ]) |
---|
| 365 | |
---|
| 366 | #-------------------------------------------------------------------- |
---|
| 367 | # If a system doesn't have an opendir function (man, that's old!) |
---|
| 368 | # then we have to supply a different version of dirent.h which |
---|
| 369 | # is compatible with the substitute version of opendir that's |
---|
| 370 | # provided. This version only works with V7-style directories. |
---|
| 371 | #-------------------------------------------------------------------- |
---|
| 372 | |
---|
| 373 | AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H, 1, [May we include <dirent2.h>?])]) |
---|
| 374 | |
---|
| 375 | #-------------------------------------------------------------------- |
---|
| 376 | # The check below checks whether <sys/wait.h> defines the type |
---|
| 377 | # "union wait" correctly. It's needed because of weirdness in |
---|
| 378 | # HP-UX where "union wait" is defined in both the BSD and SYS-V |
---|
| 379 | # environments. Checking the usability of WIFEXITED seems to do |
---|
| 380 | # the trick. |
---|
| 381 | #-------------------------------------------------------------------- |
---|
| 382 | |
---|
| 383 | AC_CACHE_CHECK([union wait], tcl_cv_union_wait, [ |
---|
| 384 | AC_TRY_LINK([#include <sys/types.h> |
---|
| 385 | #include <sys/wait.h>], [ |
---|
| 386 | union wait x; |
---|
| 387 | WIFEXITED(x); /* Generates compiler error if WIFEXITED |
---|
| 388 | * uses an int. */ |
---|
| 389 | ], tcl_cv_union_wait=yes, tcl_cv_union_wait=no)]) |
---|
| 390 | if test $tcl_cv_union_wait = no; then |
---|
| 391 | AC_DEFINE(NO_UNION_WAIT, 1, [Do we have a usable 'union wait'?]) |
---|
| 392 | fi |
---|
| 393 | |
---|
| 394 | #-------------------------------------------------------------------- |
---|
| 395 | # Check whether there is an strncasecmp function on this system. |
---|
| 396 | # This is a bit tricky because under SCO it's in -lsocket and |
---|
| 397 | # under Sequent Dynix it's in -linet. |
---|
| 398 | #-------------------------------------------------------------------- |
---|
| 399 | |
---|
| 400 | AC_CHECK_FUNC(strncasecmp, tcl_ok=1, tcl_ok=0) |
---|
| 401 | if test "$tcl_ok" = 0; then |
---|
| 402 | AC_CHECK_LIB(socket, strncasecmp, tcl_ok=1, tcl_ok=0) |
---|
| 403 | fi |
---|
| 404 | if test "$tcl_ok" = 0; then |
---|
| 405 | AC_CHECK_LIB(inet, strncasecmp, tcl_ok=1, tcl_ok=0) |
---|
| 406 | fi |
---|
| 407 | if test "$tcl_ok" = 0; then |
---|
| 408 | AC_LIBOBJ([strncasecmp]) |
---|
| 409 | USE_COMPAT=1 |
---|
| 410 | fi |
---|
| 411 | |
---|
| 412 | #-------------------------------------------------------------------- |
---|
| 413 | # The code below deals with several issues related to gettimeofday: |
---|
| 414 | # 1. Some systems don't provide a gettimeofday function at all |
---|
| 415 | # (set NO_GETTOD if this is the case). |
---|
| 416 | # 2. SGI systems don't use the BSD form of the gettimeofday function, |
---|
| 417 | # but they have a BSDgettimeofday function that can be used instead. |
---|
| 418 | # 3. See if gettimeofday is declared in the <sys/time.h> header file. |
---|
| 419 | # if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can |
---|
| 420 | # declare it. |
---|
| 421 | #-------------------------------------------------------------------- |
---|
| 422 | |
---|
| 423 | AC_CHECK_FUNC(BSDgettimeofday, |
---|
| 424 | [AC_DEFINE(HAVE_BSDGETTIMEOFDAY, 1, [Do we have BSDgettimeofday()?])], [ |
---|
| 425 | AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?])]) |
---|
| 426 | ]) |
---|
| 427 | AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [ |
---|
| 428 | AC_EGREP_HEADER(gettimeofday, sys/time.h, |
---|
| 429 | tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)]) |
---|
| 430 | if test $tcl_cv_grep_gettimeofday = missing ; then |
---|
| 431 | AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in <sys/time.h>?]) |
---|
| 432 | fi |
---|
| 433 | |
---|
| 434 | #-------------------------------------------------------------------- |
---|
| 435 | # The following code checks to see whether it is possible to get |
---|
| 436 | # signed chars on this platform. This is needed in order to |
---|
| 437 | # properly generate sign-extended ints from character values. |
---|
| 438 | #-------------------------------------------------------------------- |
---|
| 439 | |
---|
| 440 | AC_C_CHAR_UNSIGNED |
---|
| 441 | AC_CACHE_CHECK([signed char declarations], tcl_cv_char_signed, [ |
---|
| 442 | AC_TRY_COMPILE(, [ |
---|
| 443 | signed char *p; |
---|
| 444 | p = 0; |
---|
| 445 | ], tcl_cv_char_signed=yes, tcl_cv_char_signed=no)]) |
---|
| 446 | if test $tcl_cv_char_signed = yes; then |
---|
| 447 | AC_DEFINE(HAVE_SIGNED_CHAR, 1, [Are characters signed?]) |
---|
| 448 | fi |
---|
| 449 | |
---|
| 450 | #-------------------------------------------------------------------- |
---|
| 451 | # Does putenv() copy or not? We need to know to avoid memory leaks. |
---|
| 452 | #-------------------------------------------------------------------- |
---|
| 453 | |
---|
| 454 | AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [ |
---|
| 455 | AC_TRY_RUN([ |
---|
| 456 | #include <stdlib.h> |
---|
| 457 | #define OURVAR "havecopy=yes" |
---|
| 458 | int main (int argc, char *argv[]) |
---|
| 459 | { |
---|
| 460 | char *foo, *bar; |
---|
| 461 | foo = (char *)strdup(OURVAR); |
---|
| 462 | putenv(foo); |
---|
| 463 | strcpy((char *)(strchr(foo, '=') + 1), "no"); |
---|
| 464 | bar = getenv("havecopy"); |
---|
| 465 | if (!strcmp(bar, "no")) { |
---|
| 466 | /* doesnt copy */ |
---|
| 467 | return 0; |
---|
| 468 | } else { |
---|
| 469 | /* does copy */ |
---|
| 470 | return 1; |
---|
| 471 | } |
---|
| 472 | } |
---|
| 473 | ], |
---|
| 474 | tcl_cv_putenv_copy=no, |
---|
| 475 | tcl_cv_putenv_copy=yes, |
---|
| 476 | tcl_cv_putenv_copy=no)]) |
---|
| 477 | if test $tcl_cv_putenv_copy = yes; then |
---|
| 478 | AC_DEFINE(HAVE_PUTENV_THAT_COPIES, 1, |
---|
| 479 | [Does putenv() copy strings or incorporate them by reference?]) |
---|
| 480 | fi |
---|
| 481 | |
---|
| 482 | #-------------------------------------------------------------------- |
---|
| 483 | # Check for support of nl_langinfo function |
---|
| 484 | #-------------------------------------------------------------------- |
---|
| 485 | |
---|
| 486 | SC_ENABLE_LANGINFO |
---|
| 487 | |
---|
| 488 | #-------------------------------------------------------------------- |
---|
| 489 | # Check for support of chflags function |
---|
| 490 | #-------------------------------------------------------------------- |
---|
| 491 | |
---|
| 492 | AC_CHECK_FUNCS(chflags) |
---|
| 493 | |
---|
| 494 | #-------------------------------------------------------------------- |
---|
| 495 | # Darwin specific API checks and defines |
---|
| 496 | #-------------------------------------------------------------------- |
---|
| 497 | |
---|
| 498 | if test "`uname -s`" = "Darwin" ; then |
---|
| 499 | AC_CHECK_FUNCS(getattrlist) |
---|
| 500 | AC_CHECK_HEADERS(copyfile.h) |
---|
| 501 | AC_CHECK_FUNCS(copyfile) |
---|
| 502 | if test $tcl_corefoundation = yes; then |
---|
| 503 | AC_CHECK_HEADERS(libkern/OSAtomic.h) |
---|
| 504 | AC_CHECK_FUNCS(OSSpinLockLock) |
---|
| 505 | AC_CHECK_FUNCS(pthread_atfork) |
---|
| 506 | fi |
---|
| 507 | AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?]) |
---|
| 508 | AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8", |
---|
| 509 | [Are we to override what our default encoding is?]) |
---|
| 510 | AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1, |
---|
| 511 | [Can this platform load code from memory?]) |
---|
| 512 | AC_DEFINE(TCL_WIDE_CLICKS, 1, |
---|
| 513 | [Does this platform have wide high-resolution clicks?]) |
---|
| 514 | AC_CHECK_HEADERS(AvailabilityMacros.h) |
---|
| 515 | if test "$ac_cv_header_AvailabilityMacros_h" = yes; then |
---|
| 516 | AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [ |
---|
| 517 | hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" |
---|
| 518 | AC_TRY_LINK([ |
---|
| 519 | #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ |
---|
| 520 | #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020 |
---|
| 521 | #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020 |
---|
| 522 | #endif |
---|
| 523 | #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1020 |
---|
| 524 | #error MAC_OS_X_VERSION_MIN_REQUIRED < 1020 |
---|
| 525 | #endif |
---|
| 526 | int rand(void) __attribute__((weak_import)); |
---|
| 527 | ], [rand();], |
---|
| 528 | tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no) |
---|
| 529 | CFLAGS=$hold_cflags]) |
---|
| 530 | if test $tcl_cv_cc_weak_import = yes; then |
---|
| 531 | AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?]) |
---|
| 532 | fi |
---|
| 533 | fi |
---|
| 534 | # Build .bundle dltest binaries in addition to .dylib |
---|
| 535 | DLTEST_LD='${CC} -bundle -Wl,-w ${CFLAGS} ${LDFLAGS}' |
---|
| 536 | DLTEST_SUFFIX=".bundle" |
---|
| 537 | else |
---|
| 538 | DLTEST_LD='${SHLIB_LD}' |
---|
| 539 | DLTEST_SUFFIX="" |
---|
| 540 | fi |
---|
| 541 | |
---|
| 542 | #-------------------------------------------------------------------- |
---|
| 543 | # Check for support of fts functions (readdir replacement) |
---|
| 544 | #-------------------------------------------------------------------- |
---|
| 545 | |
---|
| 546 | AC_CACHE_CHECK([for fts], tcl_cv_api_fts, [ |
---|
| 547 | AC_TRY_LINK([ |
---|
| 548 | #include <sys/param.h> |
---|
| 549 | #include <sys/stat.h> |
---|
| 550 | #include <fts.h> |
---|
| 551 | ], [ |
---|
| 552 | char*const p[2] = {"/", NULL}; |
---|
| 553 | FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL); |
---|
| 554 | FTSENT *e = fts_read(f); fts_close(f); |
---|
| 555 | ], tcl_cv_api_fts=yes, tcl_cv_api_fts=no)]) |
---|
| 556 | if test $tcl_cv_api_fts = yes; then |
---|
| 557 | AC_DEFINE(HAVE_FTS, 1, [Do we have fts functions?]) |
---|
| 558 | fi |
---|
| 559 | |
---|
| 560 | #-------------------------------------------------------------------- |
---|
| 561 | # The statements below check for systems where POSIX-style |
---|
| 562 | # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. |
---|
| 563 | # On these systems (mostly older ones), use the old BSD-style |
---|
| 564 | # FIONBIO approach instead. |
---|
| 565 | #-------------------------------------------------------------------- |
---|
| 566 | |
---|
| 567 | SC_BLOCKING_STYLE |
---|
| 568 | |
---|
| 569 | #------------------------------------------------------------------------ |
---|
| 570 | |
---|
| 571 | AC_MSG_CHECKING([whether to use dll unloading]) |
---|
| 572 | AC_ARG_ENABLE(dll-unloading, |
---|
| 573 | AC_HELP_STRING([--enable-dll-unloading], |
---|
| 574 | [enable the 'unload' command (default: on)]), |
---|
| 575 | [tcl_ok=$enableval], [tcl_ok=yes]) |
---|
| 576 | if test $tcl_ok = yes; then |
---|
| 577 | AC_DEFINE(TCL_UNLOAD_DLLS, 1, [Do we allow unloading of shared libraries?]) |
---|
| 578 | fi |
---|
| 579 | AC_MSG_RESULT([$tcl_ok]) |
---|
| 580 | |
---|
| 581 | #------------------------------------------------------------------------ |
---|
| 582 | # Check whether the timezone data is supplied by the OS or has |
---|
| 583 | # to be installed by Tcl. The default is autodetection, but can |
---|
| 584 | # be overriden on the configure command line either way. |
---|
| 585 | #------------------------------------------------------------------------ |
---|
| 586 | |
---|
| 587 | AC_MSG_CHECKING([for timezone data]) |
---|
| 588 | AC_ARG_WITH(tzdata, |
---|
| 589 | AC_HELP_STRING([--with-tzdata], |
---|
| 590 | [install timezone data (default: autodetect)]), |
---|
| 591 | [tcl_ok=$withval], [tcl_ok=auto]) |
---|
| 592 | # |
---|
| 593 | # Any directories that get added here must also be added to the |
---|
| 594 | # search path in ::tcl::clock::Initialize (library/clock.tcl). |
---|
| 595 | # |
---|
| 596 | case $tcl_ok in |
---|
| 597 | no) |
---|
| 598 | AC_MSG_RESULT([supplied by OS vendor]) |
---|
| 599 | ;; |
---|
| 600 | yes) |
---|
| 601 | # nothing to do here |
---|
| 602 | ;; |
---|
| 603 | auto*) |
---|
| 604 | AC_CACHE_VAL([tcl_cv_dir_zoneinfo], [ |
---|
| 605 | for dir in /usr/share/zoneinfo \ |
---|
| 606 | /usr/share/lib/zoneinfo \ |
---|
| 607 | /usr/lib/zoneinfo |
---|
| 608 | do |
---|
| 609 | if test -f $dir/UTC -o -f $dir/GMT |
---|
| 610 | then |
---|
| 611 | tcl_cv_dir_zoneinfo="$dir" |
---|
| 612 | break |
---|
| 613 | fi |
---|
| 614 | done]) |
---|
| 615 | if test -n "$tcl_cv_dir_zoneinfo"; then |
---|
| 616 | tcl_ok=no |
---|
| 617 | AC_MSG_RESULT([$dir]) |
---|
| 618 | else |
---|
| 619 | tcl_ok=yes |
---|
| 620 | fi |
---|
| 621 | ;; |
---|
| 622 | *) |
---|
| 623 | AC_MSG_ERROR([invalid argument: $tcl_ok]) |
---|
| 624 | ;; |
---|
| 625 | esac |
---|
| 626 | if test $tcl_ok = yes |
---|
| 627 | then |
---|
| 628 | AC_MSG_RESULT([supplied by Tcl]) |
---|
| 629 | INSTALL_TZDATA=install-tzdata |
---|
| 630 | fi |
---|
| 631 | |
---|
| 632 | #-------------------------------------------------------------------- |
---|
| 633 | # DTrace support |
---|
| 634 | #-------------------------------------------------------------------- |
---|
| 635 | |
---|
| 636 | AC_ARG_ENABLE(dtrace, |
---|
| 637 | AC_HELP_STRING([--enable-dtrace], |
---|
| 638 | [build with DTrace support (default: off)]), |
---|
| 639 | [tcl_ok=$enableval], [tcl_ok=no]) |
---|
| 640 | if test $tcl_ok = yes; then |
---|
| 641 | AC_CHECK_HEADER(sys/sdt.h, [tcl_ok=yes], [tcl_ok=no]) |
---|
| 642 | fi |
---|
| 643 | if test $tcl_ok = yes; then |
---|
| 644 | AC_PATH_PROG(DTRACE, dtrace,, [$PATH:/usr/sbin]) |
---|
| 645 | test -z "$ac_cv_path_DTRACE" && tcl_ok=no |
---|
| 646 | fi |
---|
| 647 | AC_MSG_CHECKING([whether to enable DTrace support]) |
---|
| 648 | if test $tcl_ok = yes; then |
---|
| 649 | AC_DEFINE(USE_DTRACE, 1, [Are we building with DTrace support?]) |
---|
| 650 | DTRACE_SRC="\${DTRACE_SRC}" |
---|
| 651 | DTRACE_HDR="\${DTRACE_HDR}" |
---|
| 652 | if test "`uname -s`" != "Darwin" ; then |
---|
| 653 | DTRACE_OBJ="\${DTRACE_OBJ}" |
---|
| 654 | fi |
---|
| 655 | fi |
---|
| 656 | AC_MSG_RESULT([$tcl_ok]) |
---|
| 657 | |
---|
| 658 | #-------------------------------------------------------------------- |
---|
| 659 | # Does the C stack grow upwards or downwards? Or cross-compiling? |
---|
| 660 | #-------------------------------------------------------------------- |
---|
| 661 | |
---|
| 662 | AC_CACHE_CHECK([if the C stack grows upwards in memory], tcl_cv_stack_grows_up, [ |
---|
| 663 | AC_TRY_RUN([ |
---|
| 664 | int StackGrowsUp(int *parent) { |
---|
| 665 | int here; |
---|
| 666 | return (&here < parent); |
---|
| 667 | } |
---|
| 668 | int main (int argc, char *argv[]) { |
---|
| 669 | int foo; |
---|
| 670 | return StackGrowsUp(&foo); |
---|
| 671 | } |
---|
| 672 | ], tcl_cv_stack_grows_up=yes, tcl_cv_stack_grows_up=no, |
---|
| 673 | tcl_cv_stack_grows_up=unknown)]) |
---|
| 674 | if test $tcl_cv_stack_grows_up = unknown; then |
---|
| 675 | AC_DEFINE(TCL_CROSS_COMPILE, 1, [Are we cross-compiling?]) |
---|
| 676 | elif test $tcl_cv_stack_grows_up = yes; then |
---|
| 677 | AC_DEFINE(TCL_STACK_GROWS_UP, 1, [The C stack grows upwards in memory.]) |
---|
| 678 | fi |
---|
| 679 | |
---|
| 680 | #-------------------------------------------------------------------- |
---|
| 681 | # The statements below define a collection of symbols related to |
---|
| 682 | # building libtcl as a shared library instead of a static library. |
---|
| 683 | #-------------------------------------------------------------------- |
---|
| 684 | |
---|
| 685 | TCL_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} |
---|
| 686 | TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX} |
---|
| 687 | eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}" |
---|
| 688 | |
---|
| 689 | # tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed |
---|
| 690 | # since on some platforms TCL_LIB_FILE contains shell escapes. |
---|
| 691 | # (See also: TCL_TRIM_DOTS). |
---|
| 692 | |
---|
| 693 | eval "TCL_LIB_FILE=${TCL_LIB_FILE}" |
---|
| 694 | |
---|
| 695 | TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)' |
---|
| 696 | PRIVATE_INCLUDE_DIR='$(includedir)' |
---|
| 697 | HTML_DIR='$(DISTDIR)/html' |
---|
| 698 | |
---|
| 699 | # Note: in the following variable, it's important to use the absolute |
---|
| 700 | # path name of the Tcl directory rather than "..": this is because |
---|
| 701 | # AIX remembers this path and will attempt to use it at run-time to look |
---|
| 702 | # up the Tcl library. |
---|
| 703 | |
---|
| 704 | if test "`uname -s`" = "Darwin" ; then |
---|
| 705 | SC_ENABLE_FRAMEWORK |
---|
| 706 | TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" |
---|
| 707 | TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' |
---|
| 708 | echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000' |
---|
| 709 | TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' |
---|
| 710 | EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' |
---|
| 711 | EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic' |
---|
| 712 | AC_CONFIG_FILES([Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in]) |
---|
| 713 | TCL_YEAR="`date +%Y`" |
---|
| 714 | fi |
---|
| 715 | |
---|
| 716 | if test "$FRAMEWORK_BUILD" = "1" ; then |
---|
| 717 | AC_DEFINE(TCL_FRAMEWORK, 1, [Is Tcl built as a framework?]) |
---|
| 718 | # Construct a fake local framework structure to make linking with |
---|
| 719 | # '-framework Tcl' and running of tcltest work |
---|
| 720 | AC_CONFIG_COMMANDS([Tcl.framework], [n=Tcl && |
---|
| 721 | f=$n.framework && v=Versions/$VERSION && |
---|
| 722 | rm -rf $f && mkdir -p $f/$v/Resources && |
---|
| 723 | ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && |
---|
| 724 | ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && |
---|
| 725 | unset n f v |
---|
| 726 | ], VERSION=${TCL_VERSION}) |
---|
| 727 | LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" |
---|
| 728 | if test "${libdir}" = '${exec_prefix}/lib'; then |
---|
| 729 | # override libdir default |
---|
| 730 | libdir="/Library/Frameworks" |
---|
| 731 | fi |
---|
| 732 | TCL_LIB_FILE="Tcl" |
---|
| 733 | TCL_LIB_FLAG="-framework Tcl" |
---|
| 734 | TCL_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tcl" |
---|
| 735 | TCL_LIB_SPEC="-F${libdir} -framework Tcl" |
---|
| 736 | libdir="${libdir}/Tcl.framework/Versions/\${VERSION}" |
---|
| 737 | TCL_LIBRARY="${libdir}/Resources/Scripts" |
---|
| 738 | includedir="${libdir}/Headers" |
---|
| 739 | PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" |
---|
| 740 | HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl" |
---|
| 741 | EXTRA_INSTALL="install-private-headers html-tcl" |
---|
| 742 | EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TclTOC.html' |
---|
| 743 | EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' |
---|
| 744 | EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' |
---|
| 745 | EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' |
---|
| 746 | # Don't use AC_DEFINE for the following as the framework version define |
---|
| 747 | # needs to go into the Makefile even when using autoheader, so that we |
---|
| 748 | # can pick up a potential make override of VERSION. Also, don't put this |
---|
| 749 | # into CFLAGS as it should not go into tclConfig.sh |
---|
| 750 | EXTRA_CC_SWITCHES='-DTCL_FRAMEWORK_VERSION=\"$(VERSION)\"' |
---|
| 751 | else |
---|
| 752 | # libdir must be a fully qualified path and not ${exec_prefix}/lib |
---|
| 753 | eval libdir="$libdir" |
---|
| 754 | if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then |
---|
| 755 | if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then |
---|
| 756 | TCL_LIB_FLAG="-ltcl${TCL_VERSION}" |
---|
| 757 | else |
---|
| 758 | TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" |
---|
| 759 | fi |
---|
| 760 | TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}" |
---|
| 761 | TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" |
---|
| 762 | else |
---|
| 763 | TCL_BUILD_EXP_FILE="lib.exp" |
---|
| 764 | eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}" |
---|
| 765 | |
---|
| 766 | if test "$GCC" = "yes" ; then |
---|
| 767 | TCL_BUILD_LIB_SPEC="-Wl,-bI:`pwd | sed -e 's/ /\\\\ /g'`/${TCL_BUILD_EXP_FILE} -L`pwd | sed -e 's/ /\\\\ /g'`" |
---|
| 768 | TCL_LIB_SPEC="-Wl,-bI:${libdir}/${TCL_EXP_FILE} -L${libdir}" |
---|
| 769 | else |
---|
| 770 | TCL_BUILD_LIB_SPEC="-bI:`pwd | sed -e 's/ /\\\\ /g'`/${TCL_BUILD_EXP_FILE}" |
---|
| 771 | TCL_LIB_SPEC="-bI:${libdir}/${TCL_EXP_FILE}" |
---|
| 772 | fi |
---|
| 773 | fi |
---|
| 774 | fi |
---|
| 775 | VERSION='${VERSION}' |
---|
| 776 | eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" |
---|
| 777 | eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" |
---|
| 778 | eval "CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}" |
---|
| 779 | VERSION=${TCL_VERSION} |
---|
| 780 | |
---|
| 781 | #-------------------------------------------------------------------- |
---|
| 782 | # The statements below define the symbol TCL_PACKAGE_PATH, which |
---|
| 783 | # gives a list of directories that may contain packages. The list |
---|
| 784 | # consists of one directory for machine-dependent binaries and |
---|
| 785 | # another for platform-independent scripts. |
---|
| 786 | #-------------------------------------------------------------------- |
---|
| 787 | |
---|
| 788 | if test "$FRAMEWORK_BUILD" = "1" ; then |
---|
| 789 | test -z "$TCL_PACKAGE_PATH" && \ |
---|
| 790 | TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks" |
---|
| 791 | test -z "$TCL_MODULE_PATH" && \ |
---|
| 792 | TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl" |
---|
| 793 | elif test "$prefix/lib" != "$libdir"; then |
---|
| 794 | TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}" |
---|
| 795 | else |
---|
| 796 | TCL_PACKAGE_PATH="${prefix}/lib ${TCL_PACKAGE_PATH}" |
---|
| 797 | fi |
---|
| 798 | |
---|
| 799 | #-------------------------------------------------------------------- |
---|
| 800 | # The statements below define various symbols relating to Tcl |
---|
| 801 | # stub support. |
---|
| 802 | #-------------------------------------------------------------------- |
---|
| 803 | |
---|
| 804 | # Replace ${VERSION} with contents of ${TCL_VERSION} |
---|
| 805 | # double-eval to account for TCL_TRIM_DOTS. |
---|
| 806 | # |
---|
| 807 | eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}" |
---|
| 808 | eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" |
---|
| 809 | eval "TCL_STUB_LIB_DIR=${libdir}" |
---|
| 810 | |
---|
| 811 | if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then |
---|
| 812 | TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}" |
---|
| 813 | else |
---|
| 814 | TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`" |
---|
| 815 | fi |
---|
| 816 | |
---|
| 817 | TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" |
---|
| 818 | TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}" |
---|
| 819 | TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" |
---|
| 820 | TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" |
---|
| 821 | |
---|
| 822 | # Install time header dir can be set via --includedir |
---|
| 823 | eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" |
---|
| 824 | |
---|
| 825 | #------------------------------------------------------------------------ |
---|
| 826 | # tclConfig.sh refers to this by a different name |
---|
| 827 | #------------------------------------------------------------------------ |
---|
| 828 | |
---|
| 829 | TCL_SHARED_BUILD=${SHARED_BUILD} |
---|
| 830 | |
---|
| 831 | AC_SUBST(TCL_VERSION) |
---|
| 832 | AC_SUBST(TCL_MAJOR_VERSION) |
---|
| 833 | AC_SUBST(TCL_MINOR_VERSION) |
---|
| 834 | AC_SUBST(TCL_PATCH_LEVEL) |
---|
| 835 | AC_SUBST(TCL_YEAR) |
---|
| 836 | |
---|
| 837 | AC_SUBST(TCL_LIB_FILE) |
---|
| 838 | AC_SUBST(TCL_LIB_FLAG) |
---|
| 839 | AC_SUBST(TCL_LIB_SPEC) |
---|
| 840 | AC_SUBST(TCL_STUB_LIB_FILE) |
---|
| 841 | AC_SUBST(TCL_STUB_LIB_FLAG) |
---|
| 842 | AC_SUBST(TCL_STUB_LIB_SPEC) |
---|
| 843 | AC_SUBST(TCL_STUB_LIB_PATH) |
---|
| 844 | AC_SUBST(TCL_INCLUDE_SPEC) |
---|
| 845 | AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) |
---|
| 846 | AC_SUBST(TCL_BUILD_STUB_LIB_PATH) |
---|
| 847 | |
---|
| 848 | AC_SUBST(TCL_SRC_DIR) |
---|
| 849 | AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX) |
---|
| 850 | AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX) |
---|
| 851 | AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX) |
---|
| 852 | |
---|
| 853 | AC_SUBST(TCL_SHARED_BUILD) |
---|
| 854 | AC_SUBST(LD_LIBRARY_PATH_VAR) |
---|
| 855 | |
---|
| 856 | AC_SUBST(TCL_BUILD_LIB_SPEC) |
---|
| 857 | AC_SUBST(TCL_NEEDS_EXP_FILE) |
---|
| 858 | AC_SUBST(TCL_BUILD_EXP_FILE) |
---|
| 859 | AC_SUBST(TCL_EXP_FILE) |
---|
| 860 | |
---|
| 861 | AC_SUBST(TCL_LIB_VERSIONS_OK) |
---|
| 862 | AC_SUBST(TCL_SHARED_LIB_SUFFIX) |
---|
| 863 | AC_SUBST(TCL_UNSHARED_LIB_SUFFIX) |
---|
| 864 | |
---|
| 865 | AC_SUBST(TCL_HAS_LONGLONG) |
---|
| 866 | |
---|
| 867 | AC_SUBST(INSTALL_TZDATA) |
---|
| 868 | |
---|
| 869 | AC_SUBST(DTRACE_SRC) |
---|
| 870 | AC_SUBST(DTRACE_HDR) |
---|
| 871 | AC_SUBST(DTRACE_OBJ) |
---|
| 872 | |
---|
| 873 | AC_SUBST(BUILD_DLTEST) |
---|
| 874 | AC_SUBST(TCL_PACKAGE_PATH) |
---|
| 875 | AC_SUBST(TCL_MODULE_PATH) |
---|
| 876 | |
---|
| 877 | AC_SUBST(TCL_LIBRARY) |
---|
| 878 | AC_SUBST(PRIVATE_INCLUDE_DIR) |
---|
| 879 | AC_SUBST(HTML_DIR) |
---|
| 880 | |
---|
| 881 | AC_SUBST(EXTRA_CC_SWITCHES) |
---|
| 882 | AC_SUBST(EXTRA_APP_CC_SWITCHES) |
---|
| 883 | AC_SUBST(EXTRA_INSTALL) |
---|
| 884 | AC_SUBST(EXTRA_INSTALL_BINARIES) |
---|
| 885 | AC_SUBST(EXTRA_BUILD_HTML) |
---|
| 886 | AC_SUBST(EXTRA_TCLSH_LIBS) |
---|
| 887 | |
---|
| 888 | AC_SUBST(DLTEST_LD) |
---|
| 889 | AC_SUBST(DLTEST_SUFFIX) |
---|
| 890 | |
---|
| 891 | dnl Disable the automake-friendly normalization of LIBOBJS |
---|
| 892 | dnl performed by autoconf 2.53 and later. It's not correct for us. |
---|
| 893 | define([_AC_LIBOBJS_NORMALIZE],[]) |
---|
| 894 | AC_CONFIG_FILES([ |
---|
| 895 | Makefile:../unix/Makefile.in |
---|
| 896 | dltest/Makefile:../unix/dltest/Makefile.in |
---|
| 897 | tclConfig.sh:../unix/tclConfig.sh.in |
---|
| 898 | ]) |
---|
| 899 | AC_OUTPUT |
---|