/ Hex Artifact Content
Login

Artifact 66ddf0a5d5e4b1d29bff472c0985fd7fa89d0fb5:


0000: 23 20 74 63 6c 2e 6d 34 20 2d 2d 0a 23 0a 23 09  # tcl.m4 --.#.#.
0010: 54 68 69 73 20 66 69 6c 65 20 70 72 6f 76 69 64  This file provid
0020: 65 73 20 61 20 73 65 74 20 6f 66 20 61 75 74 6f  es a set of auto
0030: 63 6f 6e 66 20 6d 61 63 72 6f 73 20 74 6f 20 68  conf macros to h
0040: 65 6c 70 20 54 45 41 2d 65 6e 61 62 6c 65 0a 23  elp TEA-enable.#
0050: 09 61 20 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e  .a Tcl extension
0060: 2e 0a 23 0a 23 20 43 6f 70 79 72 69 67 68 74 20  ..#.# Copyright 
0070: 28 63 29 20 31 39 39 39 2d 32 30 30 30 20 41 6a  (c) 1999-2000 Aj
0080: 75 62 61 20 53 6f 6c 75 74 69 6f 6e 73 2e 0a 23  uba Solutions..#
0090: 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32   Copyright (c) 2
00a0: 30 30 32 2d 32 30 30 35 20 41 63 74 69 76 65 53  002-2005 ActiveS
00b0: 74 61 74 65 20 43 6f 72 70 6f 72 61 74 69 6f 6e  tate Corporation
00c0: 2e 0a 23 0a 23 20 53 65 65 20 74 68 65 20 66 69  ..#.# See the fi
00d0: 6c 65 20 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d  le "license.term
00e0: 73 22 20 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69  s" for informati
00f0: 6f 6e 20 6f 6e 20 75 73 61 67 65 20 61 6e 64 20  on on usage and 
0100: 72 65 64 69 73 74 72 69 62 75 74 69 6f 6e 0a 23  redistribution.#
0110: 20 6f 66 20 74 68 69 73 20 66 69 6c 65 2c 20 61   of this file, a
0120: 6e 64 20 66 6f 72 20 61 20 44 49 53 43 4c 41 49  nd for a DISCLAI
0130: 4d 45 52 20 4f 46 20 41 4c 4c 20 57 41 52 52 41  MER OF ALL WARRA
0140: 4e 54 49 45 53 2e 0a 0a 41 43 5f 50 52 45 52 45  NTIES...AC_PRERE
0150: 51 28 32 2e 35 37 29 0a 0a 64 6e 6c 20 54 45 41  Q(2.57)..dnl TEA
0160: 20 65 78 74 65 6e 73 69 6f 6e 73 20 70 61 73 73   extensions pass
0170: 20 75 73 20 74 68 65 20 76 65 72 73 69 6f 6e 20   us the version 
0180: 6f 66 20 54 45 41 20 74 68 65 79 20 74 68 69 6e  of TEA they thin
0190: 6b 20 74 68 65 79 0a 64 6e 6c 20 61 72 65 20 63  k they.dnl are c
01a0: 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 68 20 28  ompatible with (
01b0: 6d 75 73 74 20 62 65 20 73 65 74 20 69 6e 20 54  must be set in T
01c0: 45 41 5f 49 4e 49 54 20 62 65 6c 6f 77 29 0a 64  EA_INIT below).d
01d0: 6e 6c 20 54 45 41 5f 56 45 52 53 49 4f 4e 3d 22  nl TEA_VERSION="
01e0: 33 2e 39 22 0a 0a 23 20 50 6f 73 73 69 62 6c 65  3.9"..# Possible
01f0: 20 76 61 6c 75 65 73 20 66 6f 72 20 6b 65 79 20   values for key 
0200: 76 61 72 69 61 62 6c 65 73 20 64 65 66 69 6e 65  variables define
0210: 64 3a 0a 23 0a 23 20 54 45 41 5f 57 49 4e 44 4f  d:.#.# TEA_WINDO
0220: 57 49 4e 47 53 59 53 54 45 4d 20 2d 20 77 69 6e  WINGSYSTEM - win
0230: 33 32 20 61 71 75 61 20 78 31 31 20 28 6d 69 72  32 aqua x11 (mir
0240: 72 6f 72 73 20 27 74 6b 20 77 69 6e 64 6f 77 69  rors 'tk windowi
0250: 6e 67 73 79 73 74 65 6d 27 29 0a 23 20 54 45 41  ngsystem').# TEA
0260: 5f 50 4c 41 54 46 4f 52 4d 20 20 20 20 20 20 20  _PLATFORM       
0270: 20 2d 20 77 69 6e 64 6f 77 73 20 75 6e 69 78 0a   - windows unix.
0280: 23 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #..#------------
0290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
02a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
02b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
02c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54  ------------.# T
02d0: 45 41 5f 50 41 54 48 5f 54 43 4c 43 4f 4e 46 49  EA_PATH_TCLCONFI
02e0: 47 20 2d 2d 0a 23 0a 23 09 4c 6f 63 61 74 65 20  G --.#.#.Locate 
02f0: 74 68 65 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68  the tclConfig.sh
0300: 20 66 69 6c 65 20 61 6e 64 20 70 65 72 66 6f 72   file and perfor
0310: 6d 20 61 20 73 61 6e 69 74 79 20 63 68 65 63 6b  m a sanity check
0320: 20 6f 6e 0a 23 09 74 68 65 20 54 63 6c 20 63 6f   on.#.the Tcl co
0330: 6d 70 69 6c 65 20 66 6c 61 67 73 0a 23 0a 23 20  mpile flags.#.# 
0340: 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e  Arguments:.#.non
0350: 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23  e.#.# Results:.#
0360: 0a 23 09 41 64 64 73 20 74 68 65 20 66 6f 6c 6c  .#.Adds the foll
0370: 6f 77 69 6e 67 20 61 72 67 75 6d 65 6e 74 73 20  owing arguments 
0380: 74 6f 20 63 6f 6e 66 69 67 75 72 65 3a 0a 23 09  to configure:.#.
0390: 09 2d 2d 77 69 74 68 2d 74 63 6c 3d 2e 2e 2e 0a  .--with-tcl=....
03a0: 23 0a 23 09 44 65 66 69 6e 65 73 20 74 68 65 20  #.#.Defines the 
03b0: 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a  following vars:.
03c0: 23 09 09 54 43 4c 5f 42 49 4e 5f 44 49 52 09 46  #..TCL_BIN_DIR.F
03d0: 75 6c 6c 20 70 61 74 68 20 74 6f 20 74 68 65 20  ull path to the 
03e0: 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69  directory contai
03f0: 6e 69 6e 67 0a 23 09 09 09 09 74 68 65 20 74 63  ning.#....the tc
0400: 6c 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c 65 0a  lConfig.sh file.
0410: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
0420: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0430: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0440: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0450: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
0460: 46 55 4e 28 5b 54 45 41 5f 50 41 54 48 5f 54 43  FUN([TEA_PATH_TC
0470: 4c 43 4f 4e 46 49 47 5d 2c 20 5b 0a 20 20 20 20  LCONFIG], [.    
0480: 64 6e 6c 20 54 45 41 20 73 70 65 63 69 66 69 63  dnl TEA specific
0490: 3a 20 4d 61 6b 65 20 73 75 72 65 20 77 65 20 61  : Make sure we a
04a0: 72 65 20 69 6e 69 74 69 61 6c 69 7a 65 64 0a 20  re initialized. 
04b0: 20 20 20 41 43 5f 52 45 51 55 49 52 45 28 5b 54     AC_REQUIRE([T
04c0: 45 41 5f 49 4e 49 54 5d 29 0a 20 20 20 20 23 0a  EA_INIT]).    #.
04d0: 20 20 20 20 23 20 4f 6b 2c 20 6c 65 74 73 20 66      # Ok, lets f
04e0: 69 6e 64 20 74 68 65 20 74 63 6c 20 63 6f 6e 66  ind the tcl conf
04f0: 69 67 75 72 61 74 69 6f 6e 0a 20 20 20 20 23 20  iguration.    # 
0500: 46 69 72 73 74 2c 20 6c 6f 6f 6b 20 66 6f 72 20  First, look for 
0510: 6f 6e 65 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e  one uninstalled.
0520: 0a 20 20 20 20 23 20 74 68 65 20 61 6c 74 65 72  .    # the alter
0530: 6e 61 74 69 76 65 20 73 65 61 72 63 68 20 64 69  native search di
0540: 72 65 63 74 6f 72 79 20 69 73 20 69 6e 76 6f 6b  rectory is invok
0550: 65 64 20 62 79 20 2d 2d 77 69 74 68 2d 74 63 6c  ed by --with-tcl
0560: 0a 20 20 20 20 23 0a 0a 20 20 20 20 69 66 20 74  .    #..    if t
0570: 65 73 74 20 78 22 24 7b 6e 6f 5f 74 63 6c 7d 22  est x"${no_tcl}"
0580: 20 3d 20 78 20 3b 20 74 68 65 6e 0a 09 23 20 77   = x ; then..# w
0590: 65 20 72 65 73 65 74 20 6e 6f 5f 74 63 6c 20 69  e reset no_tcl i
05a0: 6e 20 63 61 73 65 20 73 6f 6d 65 74 68 69 6e 67  n case something
05b0: 20 66 61 69 6c 73 20 68 65 72 65 0a 09 6e 6f 5f   fails here..no_
05c0: 74 63 6c 3d 74 72 75 65 0a 09 41 43 5f 41 52 47  tcl=true..AC_ARG
05d0: 5f 57 49 54 48 28 74 63 6c 2c 0a 09 20 20 20 20  _WITH(tcl,..    
05e0: 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b  AC_HELP_STRING([
05f0: 2d 2d 77 69 74 68 2d 74 63 6c 5d 2c 0a 09 09 5b  --with-tcl],...[
0600: 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69  directory contai
0610: 6e 69 6e 67 20 74 63 6c 20 63 6f 6e 66 69 67 75  ning tcl configu
0620: 72 61 74 69 6f 6e 20 28 74 63 6c 43 6f 6e 66 69  ration (tclConfi
0630: 67 2e 73 68 29 5d 29 2c 0a 09 20 20 20 20 77 69  g.sh)]),..    wi
0640: 74 68 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 24 7b  th_tclconfig="${
0650: 77 69 74 68 76 61 6c 7d 22 29 0a 09 41 43 5f 4d  withval}")..AC_M
0660: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72  SG_CHECKING([for
0670: 20 54 63 6c 20 63 6f 6e 66 69 67 75 72 61 74 69   Tcl configurati
0680: 6f 6e 5d 29 0a 09 41 43 5f 43 41 43 48 45 5f 56  on])..AC_CACHE_V
0690: 41 4c 28 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f  AL(ac_cv_c_tclco
06a0: 6e 66 69 67 2c 5b 0a 0a 09 20 20 20 20 23 20 46  nfig,[...    # F
06b0: 69 72 73 74 20 63 68 65 63 6b 20 74 6f 20 73 65  irst check to se
06c0: 65 20 69 66 20 2d 2d 77 69 74 68 2d 74 63 6c 20  e if --with-tcl 
06d0: 77 61 73 20 73 70 65 63 69 66 69 65 64 2e 0a 09  was specified...
06e0: 20 20 20 20 69 66 20 74 65 73 74 20 78 22 24 7b      if test x"${
06f0: 77 69 74 68 5f 74 63 6c 63 6f 6e 66 69 67 7d 22  with_tclconfig}"
0700: 20 21 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 63   != x ; then...c
0710: 61 73 65 20 22 24 7b 77 69 74 68 5f 74 63 6c 63  ase "${with_tclc
0720: 6f 6e 66 69 67 7d 22 20 69 6e 0a 09 09 20 20 20  onfig}" in...   
0730: 20 2a 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 20   */tclConfig.sh 
0740: 29 0a 09 09 09 69 66 20 74 65 73 74 20 2d 66 20  )....if test -f 
0750: 22 24 7b 77 69 74 68 5f 74 63 6c 63 6f 6e 66 69  "${with_tclconfi
0760: 67 7d 22 3b 20 74 68 65 6e 0a 09 09 09 20 20 20  g}"; then....   
0770: 20 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 2d 2d   AC_MSG_WARN([--
0780: 77 69 74 68 2d 74 63 6c 20 61 72 67 75 6d 65 6e  with-tcl argumen
0790: 74 20 73 68 6f 75 6c 64 20 72 65 66 65 72 20 74  t should refer t
07a0: 6f 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74  o directory cont
07b0: 61 69 6e 69 6e 67 20 74 63 6c 43 6f 6e 66 69 67  aining tclConfig
07c0: 2e 73 68 2c 20 6e 6f 74 20 74 6f 20 74 63 6c 43  .sh, not to tclC
07d0: 6f 6e 66 69 67 2e 73 68 20 69 74 73 65 6c 66 5d  onfig.sh itself]
07e0: 29 0a 09 09 09 20 20 20 20 77 69 74 68 5f 74 63  )....    with_tc
07f0: 6c 63 6f 6e 66 69 67 3d 22 60 65 63 68 6f 20 22  lconfig="`echo "
0800: 24 7b 77 69 74 68 5f 74 63 6c 63 6f 6e 66 69 67  ${with_tclconfig
0810: 7d 22 20 7c 20 73 65 64 20 27 73 21 2f 74 63 6c  }" | sed 's!/tcl
0820: 43 6f 6e 66 69 67 5c 2e 73 68 24 21 21 27 60 22  Config\.sh$!!'`"
0830: 0a 09 09 09 66 69 20 3b 3b 0a 09 09 65 73 61 63  ....fi ;;...esac
0840: 0a 09 09 69 66 20 74 65 73 74 20 2d 66 20 22 24  ...if test -f "$
0850: 7b 77 69 74 68 5f 74 63 6c 63 6f 6e 66 69 67 7d  {with_tclconfig}
0860: 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b  /tclConfig.sh" ;
0870: 20 74 68 65 6e 0a 09 09 20 20 20 20 61 63 5f 63   then...    ac_c
0880: 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 60  v_c_tclconfig="`
0890: 28 63 64 20 22 24 7b 77 69 74 68 5f 74 63 6c 63  (cd "${with_tclc
08a0: 6f 6e 66 69 67 7d 22 3b 20 70 77 64 29 60 22 0a  onfig}"; pwd)`".
08b0: 09 09 65 6c 73 65 0a 09 09 20 20 20 20 41 43 5f  ..else...    AC_
08c0: 4d 53 47 5f 45 52 52 4f 52 28 5b 24 7b 77 69 74  MSG_ERROR([${wit
08d0: 68 5f 74 63 6c 63 6f 6e 66 69 67 7d 20 64 69 72  h_tclconfig} dir
08e0: 65 63 74 6f 72 79 20 64 6f 65 73 6e 27 74 20 63  ectory doesn't c
08f0: 6f 6e 74 61 69 6e 20 74 63 6c 43 6f 6e 66 69 67  ontain tclConfig
0900: 2e 73 68 5d 29 0a 09 09 66 69 0a 09 20 20 20 20  .sh])...fi..    
0910: 66 69 0a 0a 09 20 20 20 20 23 20 74 68 65 6e 20  fi...    # then 
0920: 63 68 65 63 6b 20 66 6f 72 20 61 20 70 72 69 76  check for a priv
0930: 61 74 65 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61  ate Tcl installa
0940: 74 69 6f 6e 0a 09 20 20 20 20 69 66 20 74 65 73  tion..    if tes
0950: 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63  t x"${ac_cv_c_tc
0960: 6c 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20  lconfig}" = x ; 
0970: 74 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20  then...for i in 
0980: 5c 0a 09 09 09 2e 2e 2f 74 63 6c 20 5c 0a 09 09  \....../tcl \...
0990: 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 74 63 6c 5b  .`ls -dr ../tcl[
09a0: 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b  [8-9]].[[0-9]].[
09b0: 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e  [0-9]]* 2>/dev/n
09c0: 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64  ull` \....`ls -d
09d0: 72 20 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e  r ../tcl[[8-9]].
09e0: 5b 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e  [[0-9]] 2>/dev/n
09f0: 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64  ull` \....`ls -d
0a00: 72 20 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e  r ../tcl[[8-9]].
0a10: 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f  [[0-9]]* 2>/dev/
0a20: 6e 75 6c 6c 60 20 5c 0a 09 09 09 2e 2e 2f 2e 2e  null` \....../..
0a30: 2f 74 63 6c 20 5c 0a 09 09 09 60 6c 73 20 2d 64  /tcl \....`ls -d
0a40: 72 20 2e 2e 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39  r ../../tcl[[8-9
0a50: 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39  ]].[[0-9]].[[0-9
0a60: 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  ]]* 2>/dev/null`
0a70: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e   \....`ls -dr ..
0a80: 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b  /../tcl[[8-9]].[
0a90: 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75  [0-9]] 2>/dev/nu
0aa0: 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72  ll` \....`ls -dr
0ab0: 20 2e 2e 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d   ../../tcl[[8-9]
0ac0: 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65  ].[[0-9]]* 2>/de
0ad0: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 2e 2e 2f  v/null` \....../
0ae0: 2e 2e 2f 2e 2e 2f 74 63 6c 20 5c 0a 09 09 09 60  ../../tcl \....`
0af0: 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f  ls -dr ../../../
0b00: 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39  tcl[[8-9]].[[0-9
0b10: 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64  ]].[[0-9]]* 2>/d
0b20: 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c  ev/null` \....`l
0b30: 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 74  s -dr ../../../t
0b40: 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d  cl[[8-9]].[[0-9]
0b50: 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  ] 2>/dev/null` \
0b60: 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e  ....`ls -dr ../.
0b70: 2e 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e  ./../tcl[[8-9]].
0b80: 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f  [[0-9]]* 2>/dev/
0b90: 6e 75 6c 6c 60 20 3b 20 64 6f 0a 09 09 20 20 20  null` ; do...   
0ba0: 20 69 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f   if test "${TEA_
0bb0: 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69  PLATFORM}" = "wi
0bc0: 6e 64 6f 77 73 22 20 5c 0a 09 09 09 20 20 20 20  ndows" \....    
0bd0: 2d 61 20 2d 66 20 22 24 69 2f 77 69 6e 2f 74 63  -a -f "$i/win/tc
0be0: 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68  lConfig.sh" ; th
0bf0: 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f 74 63  en....ac_cv_c_tc
0c00: 6c 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 24 69  lconfig="`(cd $i
0c10: 2f 77 69 6e 3b 20 70 77 64 29 60 22 0a 09 09 09  /win; pwd)`"....
0c20: 62 72 65 61 6b 0a 09 09 20 20 20 20 66 69 0a 09  break...    fi..
0c30: 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20  .    if test -f 
0c40: 22 24 69 2f 75 6e 69 78 2f 74 63 6c 43 6f 6e 66  "$i/unix/tclConf
0c50: 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09  ig.sh" ; then...
0c60: 09 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66  .ac_cv_c_tclconf
0c70: 69 67 3d 22 60 28 63 64 20 24 69 2f 75 6e 69 78  ig="`(cd $i/unix
0c80: 3b 20 70 77 64 29 60 22 0a 09 09 09 62 72 65 61  ; pwd)`"....brea
0c90: 6b 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e  k...    fi...don
0ca0: 65 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20  e..    fi...    
0cb0: 23 20 6f 6e 20 44 61 72 77 69 6e 2c 20 63 68 65  # on Darwin, che
0cc0: 63 6b 20 69 6e 20 46 72 61 6d 65 77 6f 72 6b 20  ck in Framework 
0cd0: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 6c 6f 63  installation loc
0ce0: 61 74 69 6f 6e 73 0a 09 20 20 20 20 69 66 20 74  ations..    if t
0cf0: 65 73 74 20 22 60 75 6e 61 6d 65 20 2d 73 60 22  est "`uname -s`"
0d00: 20 3d 20 22 44 61 72 77 69 6e 22 20 2d 61 20 78   = "Darwin" -a x
0d10: 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f  "${ac_cv_c_tclco
0d20: 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65  nfig}" = x ; the
0d30: 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 60 6c 73  n...for i in `ls
0d40: 20 2d 64 20 7e 2f 4c 69 62 72 61 72 79 2f 46 72   -d ~/Library/Fr
0d50: 61 6d 65 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f  ameworks 2>/dev/
0d60: 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d  null` \....`ls -
0d70: 64 20 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65  d /Library/Frame
0d80: 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f 6e 75 6c  works 2>/dev/nul
0d90: 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f  l` \....`ls -d /
0da0: 4e 65 74 77 6f 72 6b 2f 4c 69 62 72 61 72 79 2f  Network/Library/
0db0: 46 72 61 6d 65 77 6f 72 6b 73 20 32 3e 2f 64 65  Frameworks 2>/de
0dc0: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73  v/null` \....`ls
0dd0: 20 2d 64 20 2f 53 79 73 74 65 6d 2f 4c 69 62 72   -d /System/Libr
0de0: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 20 32  ary/Frameworks 2
0df0: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
0e00: 09 3b 20 64 6f 0a 09 09 20 20 20 20 69 66 20 74  .; do...    if t
0e10: 65 73 74 20 2d 66 20 22 24 69 2f 54 63 6c 2e 66  est -f "$i/Tcl.f
0e20: 72 61 6d 65 77 6f 72 6b 2f 74 63 6c 43 6f 6e 66  ramework/tclConf
0e30: 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09  ig.sh" ; then...
0e40: 09 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66  .ac_cv_c_tclconf
0e50: 69 67 3d 22 60 28 63 64 20 24 69 2f 54 63 6c 2e  ig="`(cd $i/Tcl.
0e60: 66 72 61 6d 65 77 6f 72 6b 3b 20 70 77 64 29 60  framework; pwd)`
0e70: 22 0a 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20  "....break...   
0e80: 20 66 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20   fi...done..    
0e90: 66 69 0a 0a 09 20 20 20 20 23 20 54 45 41 20 73  fi...    # TEA s
0ea0: 70 65 63 69 66 69 63 3a 20 6f 6e 20 57 69 6e 64  pecific: on Wind
0eb0: 6f 77 73 2c 20 63 68 65 63 6b 20 69 6e 20 63 6f  ows, check in co
0ec0: 6d 6d 6f 6e 20 69 6e 73 74 61 6c 6c 61 74 69 6f  mmon installatio
0ed0: 6e 20 6c 6f 63 61 74 69 6f 6e 73 0a 09 20 20 20  n locations..   
0ee0: 20 69 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f   if test "${TEA_
0ef0: 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69  PLATFORM}" = "wi
0f00: 6e 64 6f 77 73 22 20 5c 0a 09 09 2d 61 20 78 22  ndows" \...-a x"
0f10: 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e  ${ac_cv_c_tclcon
0f20: 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e  fig}" = x ; then
0f30: 0a 09 09 66 6f 72 20 69 20 69 6e 20 60 6c 73 20  ...for i in `ls 
0f40: 2d 64 20 43 3a 2f 54 63 6c 2f 6c 69 62 20 32 3e  -d C:/Tcl/lib 2>
0f50: 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09  /dev/null` \....
0f60: 60 6c 73 20 2d 64 20 43 3a 2f 50 72 6f 67 72 61  `ls -d C:/Progra
0f70: 7e 31 2f 54 63 6c 2f 6c 69 62 20 32 3e 2f 64 65  ~1/Tcl/lib 2>/de
0f80: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 3b 20 64  v/null` \....; d
0f90: 6f 0a 09 09 20 20 20 20 69 66 20 74 65 73 74 20  o...    if test 
0fa0: 2d 66 20 22 24 69 2f 74 63 6c 43 6f 6e 66 69 67  -f "$i/tclConfig
0fb0: 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09 09 61  .sh" ; then....a
0fc0: 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67  c_cv_c_tclconfig
0fd0: 3d 22 60 28 63 64 20 24 69 3b 20 70 77 64 29 60  ="`(cd $i; pwd)`
0fe0: 22 0a 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20  "....break...   
0ff0: 20 66 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20   fi...done..    
1000: 66 69 0a 0a 09 20 20 20 20 23 20 63 68 65 63 6b  fi...    # check
1010: 20 69 6e 20 61 20 66 65 77 20 63 6f 6d 6d 6f 6e   in a few common
1020: 20 69 6e 73 74 61 6c 6c 20 6c 6f 63 61 74 69 6f   install locatio
1030: 6e 73 0a 09 20 20 20 20 69 66 20 74 65 73 74 20  ns..    if test 
1040: 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63  x"${ac_cv_c_tclc
1050: 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68  onfig}" = x ; th
1060: 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 60 6c  en...for i in `l
1070: 73 20 2d 64 20 24 7b 6c 69 62 64 69 72 7d 20 32  s -d ${libdir} 2
1080: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
1090: 09 60 6c 73 20 2d 64 20 24 7b 65 78 65 63 5f 70  .`ls -d ${exec_p
10a0: 72 65 66 69 78 7d 2f 6c 69 62 20 32 3e 2f 64 65  refix}/lib 2>/de
10b0: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73  v/null` \....`ls
10c0: 20 2d 64 20 24 7b 70 72 65 66 69 78 7d 2f 6c 69   -d ${prefix}/li
10d0: 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  b 2>/dev/null` \
10e0: 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72 2f  ....`ls -d /usr/
10f0: 6c 6f 63 61 6c 2f 6c 69 62 20 32 3e 2f 64 65 76  local/lib 2>/dev
1100: 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20  /null` \....`ls 
1110: 2d 64 20 2f 75 73 72 2f 63 6f 6e 74 72 69 62 2f  -d /usr/contrib/
1120: 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  lib 2>/dev/null`
1130: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73   \....`ls -d /us
1140: 72 2f 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c  r/lib 2>/dev/nul
1150: 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f  l` \....`ls -d /
1160: 75 73 72 2f 6c 69 62 36 34 20 32 3e 2f 64 65 76  usr/lib64 2>/dev
1170: 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20  /null` \....`ls 
1180: 2d 64 20 2f 75 73 72 2f 6c 69 62 2f 74 63 6c 38  -d /usr/lib/tcl8
1190: 2e 36 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  .6 2>/dev/null` 
11a0: 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72  \....`ls -d /usr
11b0: 2f 6c 69 62 2f 74 63 6c 38 2e 35 20 32 3e 2f 64  /lib/tcl8.5 2>/d
11c0: 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 3b 20  ev/null` \....; 
11d0: 64 6f 0a 09 09 20 20 20 20 69 66 20 74 65 73 74  do...    if test
11e0: 20 2d 66 20 22 24 69 2f 74 63 6c 43 6f 6e 66 69   -f "$i/tclConfi
11f0: 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09 09  g.sh" ; then....
1200: 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69  ac_cv_c_tclconfi
1210: 67 3d 22 60 28 63 64 20 24 69 3b 20 70 77 64 29  g="`(cd $i; pwd)
1220: 60 22 0a 09 09 09 62 72 65 61 6b 0a 09 09 20 20  `"....break...  
1230: 20 20 66 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20    fi...done..   
1240: 20 66 69 0a 0a 09 20 20 20 20 23 20 63 68 65 63   fi...    # chec
1250: 6b 20 69 6e 20 61 20 66 65 77 20 6f 74 68 65 72  k in a few other
1260: 20 70 72 69 76 61 74 65 20 6c 6f 63 61 74 69 6f   private locatio
1270: 6e 73 0a 09 20 20 20 20 69 66 20 74 65 73 74 20  ns..    if test 
1280: 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63  x"${ac_cv_c_tclc
1290: 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68  onfig}" = x ; th
12a0: 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 5c 0a  en...for i in \.
12b0: 09 09 09 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f  ...${srcdir}/../
12c0: 74 63 6c 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72  tcl \....`ls -dr
12d0: 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f 74 63   ${srcdir}/../tc
12e0: 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d  l[[8-9]].[[0-9]]
12f0: 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76  .[[0-9]]* 2>/dev
1300: 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20  /null` \....`ls 
1310: 2d 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e  -dr ${srcdir}/..
1320: 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d  /tcl[[8-9]].[[0-
1330: 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  9]] 2>/dev/null`
1340: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 24 7b   \....`ls -dr ${
1350: 73 72 63 64 69 72 7d 2f 2e 2e 2f 74 63 6c 5b 5b  srcdir}/../tcl[[
1360: 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32  8-9]].[[0-9]]* 2
1370: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 3b 20 64 6f  >/dev/null` ; do
1380: 0a 09 09 20 20 20 20 69 66 20 74 65 73 74 20 22  ...    if test "
1390: 24 7b 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22  ${TEA_PLATFORM}"
13a0: 20 3d 20 22 77 69 6e 64 6f 77 73 22 20 5c 0a 09   = "windows" \..
13b0: 09 09 20 20 20 20 2d 61 20 2d 66 20 22 24 69 2f  ..    -a -f "$i/
13c0: 77 69 6e 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68  win/tclConfig.sh
13d0: 22 20 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63  " ; then....ac_c
13e0: 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 60  v_c_tclconfig="`
13f0: 28 63 64 20 24 69 2f 77 69 6e 3b 20 70 77 64 29  (cd $i/win; pwd)
1400: 60 22 0a 09 09 09 62 72 65 61 6b 0a 09 09 20 20  `"....break...  
1410: 20 20 66 69 0a 09 09 20 20 20 20 69 66 20 74 65    fi...    if te
1420: 73 74 20 2d 66 20 22 24 69 2f 75 6e 69 78 2f 74  st -f "$i/unix/t
1430: 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74  clConfig.sh" ; t
1440: 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f 74  hen....ac_cv_c_t
1450: 63 6c 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 24  clconfig="`(cd $
1460: 69 2f 75 6e 69 78 3b 20 70 77 64 29 60 22 0a 09  i/unix; pwd)`"..
1470: 09 09 62 72 65 61 6b 0a 09 09 20 20 20 20 66 69  ..break...    fi
1480: 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20 66 69 0a  ...done..    fi.
1490: 09 5d 29 0a 0a 09 69 66 20 74 65 73 74 20 78 22  .])...if test x"
14a0: 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e  ${ac_cv_c_tclcon
14b0: 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e  fig}" = x ; then
14c0: 0a 09 20 20 20 20 54 43 4c 5f 42 49 4e 5f 44 49  ..    TCL_BIN_DI
14d0: 52 3d 22 23 20 6e 6f 20 54 63 6c 20 63 6f 6e 66  R="# no Tcl conf
14e0: 69 67 73 20 66 6f 75 6e 64 22 0a 09 20 20 20 20  igs found"..    
14f0: 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 43 61  AC_MSG_ERROR([Ca
1500: 6e 27 74 20 66 69 6e 64 20 54 63 6c 20 63 6f 6e  n't find Tcl con
1510: 66 69 67 75 72 61 74 69 6f 6e 20 64 65 66 69 6e  figuration defin
1520: 69 74 69 6f 6e 73 2e 20 55 73 65 20 2d 2d 77 69  itions. Use --wi
1530: 74 68 2d 74 63 6c 20 74 6f 20 73 70 65 63 69 66  th-tcl to specif
1540: 79 20 61 20 64 69 72 65 63 74 6f 72 79 20 63 6f  y a directory co
1550: 6e 74 61 69 6e 69 6e 67 20 74 63 6c 43 6f 6e 66  ntaining tclConf
1560: 69 67 2e 73 68 5d 29 0a 09 65 6c 73 65 0a 09 20  ig.sh])..else.. 
1570: 20 20 20 6e 6f 5f 74 63 6c 3d 0a 09 20 20 20 20     no_tcl=..    
1580: 54 43 4c 5f 42 49 4e 5f 44 49 52 3d 22 24 7b 61  TCL_BIN_DIR="${a
1590: 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67  c_cv_c_tclconfig
15a0: 7d 22 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52  }"..    AC_MSG_R
15b0: 45 53 55 4c 54 28 5b 66 6f 75 6e 64 20 24 7b 54  ESULT([found ${T
15c0: 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 74 63 6c 43  CL_BIN_DIR}/tclC
15d0: 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 66 69 0a 20  onfig.sh])..fi. 
15e0: 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d     fi.])..#-----
15f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1620: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1630: 2d 2d 2d 0a 23 20 54 45 41 5f 50 41 54 48 5f 54  ---.# TEA_PATH_T
1640: 4b 43 4f 4e 46 49 47 20 2d 2d 0a 23 0a 23 09 4c  KCONFIG --.#.#.L
1650: 6f 63 61 74 65 20 74 68 65 20 74 6b 43 6f 6e 66  ocate the tkConf
1660: 69 67 2e 73 68 20 66 69 6c 65 0a 23 0a 23 20 41  ig.sh file.#.# A
1670: 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65  rguments:.#.none
1680: 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a  .#.# Results:.#.
1690: 23 09 41 64 64 73 20 74 68 65 20 66 6f 6c 6c 6f  #.Adds the follo
16a0: 77 69 6e 67 20 61 72 67 75 6d 65 6e 74 73 20 74  wing arguments t
16b0: 6f 20 63 6f 6e 66 69 67 75 72 65 3a 0a 23 09 09  o configure:.#..
16c0: 2d 2d 77 69 74 68 2d 74 6b 3d 2e 2e 2e 0a 23 0a  --with-tk=....#.
16d0: 23 09 44 65 66 69 6e 65 73 20 74 68 65 20 66 6f  #.Defines the fo
16e0: 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09  llowing vars:.#.
16f0: 09 54 4b 5f 42 49 4e 5f 44 49 52 09 46 75 6c 6c  .TK_BIN_DIR.Full
1700: 20 70 61 74 68 20 74 6f 20 74 68 65 20 64 69 72   path to the dir
1710: 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e  ectory containin
1720: 67 0a 23 09 09 09 09 74 68 65 20 74 6b 43 6f 6e  g.#....the tkCon
1730: 66 69 67 2e 73 68 20 66 69 6c 65 0a 23 2d 2d 2d  fig.sh file.#---
1740: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1750: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1760: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1770: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1780: 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28  -----..AC_DEFUN(
1790: 5b 54 45 41 5f 50 41 54 48 5f 54 4b 43 4f 4e 46  [TEA_PATH_TKCONF
17a0: 49 47 5d 2c 20 5b 0a 20 20 20 20 23 0a 20 20 20  IG], [.    #.   
17b0: 20 23 20 4f 6b 2c 20 6c 65 74 73 20 66 69 6e 64   # Ok, lets find
17c0: 20 74 68 65 20 74 6b 20 63 6f 6e 66 69 67 75 72   the tk configur
17d0: 61 74 69 6f 6e 0a 20 20 20 20 23 20 46 69 72 73  ation.    # Firs
17e0: 74 2c 20 6c 6f 6f 6b 20 66 6f 72 20 6f 6e 65 20  t, look for one 
17f0: 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 0a 20 20 20  uninstalled..   
1800: 20 23 20 74 68 65 20 61 6c 74 65 72 6e 61 74 69   # the alternati
1810: 76 65 20 73 65 61 72 63 68 20 64 69 72 65 63 74  ve search direct
1820: 6f 72 79 20 69 73 20 69 6e 76 6f 6b 65 64 20 62  ory is invoked b
1830: 79 20 2d 2d 77 69 74 68 2d 74 6b 0a 20 20 20 20  y --with-tk.    
1840: 23 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20 78  #..    if test x
1850: 22 24 7b 6e 6f 5f 74 6b 7d 22 20 3d 20 78 20 3b  "${no_tk}" = x ;
1860: 20 74 68 65 6e 0a 09 23 20 77 65 20 72 65 73 65   then..# we rese
1870: 74 20 6e 6f 5f 74 6b 20 69 6e 20 63 61 73 65 20  t no_tk in case 
1880: 73 6f 6d 65 74 68 69 6e 67 20 66 61 69 6c 73 20  something fails 
1890: 68 65 72 65 0a 09 6e 6f 5f 74 6b 3d 74 72 75 65  here..no_tk=true
18a0: 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 74 6b  ..AC_ARG_WITH(tk
18b0: 2c 0a 09 20 20 20 20 41 43 5f 48 45 4c 50 5f 53  ,..    AC_HELP_S
18c0: 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 74 6b  TRING([--with-tk
18d0: 5d 2c 0a 09 09 5b 64 69 72 65 63 74 6f 72 79 20  ],...[directory 
18e0: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 6b 20 63 6f  containing tk co
18f0: 6e 66 69 67 75 72 61 74 69 6f 6e 20 28 74 6b 43  nfiguration (tkC
1900: 6f 6e 66 69 67 2e 73 68 29 5d 29 2c 0a 09 20 20  onfig.sh)]),..  
1910: 20 20 77 69 74 68 5f 74 6b 63 6f 6e 66 69 67 3d    with_tkconfig=
1920: 22 24 7b 77 69 74 68 76 61 6c 7d 22 29 0a 09 41  "${withval}")..A
1930: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
1940: 66 6f 72 20 54 6b 20 63 6f 6e 66 69 67 75 72 61  for Tk configura
1950: 74 69 6f 6e 5d 29 0a 09 41 43 5f 43 41 43 48 45  tion])..AC_CACHE
1960: 5f 56 41 4c 28 61 63 5f 63 76 5f 63 5f 74 6b 63  _VAL(ac_cv_c_tkc
1970: 6f 6e 66 69 67 2c 5b 0a 0a 09 20 20 20 20 23 20  onfig,[...    # 
1980: 46 69 72 73 74 20 63 68 65 63 6b 20 74 6f 20 73  First check to s
1990: 65 65 20 69 66 20 2d 2d 77 69 74 68 2d 74 6b 63  ee if --with-tkc
19a0: 6f 6e 66 69 67 20 77 61 73 20 73 70 65 63 69 66  onfig was specif
19b0: 69 65 64 2e 0a 09 20 20 20 20 69 66 20 74 65 73  ied...    if tes
19c0: 74 20 78 22 24 7b 77 69 74 68 5f 74 6b 63 6f 6e  t x"${with_tkcon
19d0: 66 69 67 7d 22 20 21 3d 20 78 20 3b 20 74 68 65  fig}" != x ; the
19e0: 6e 0a 09 09 63 61 73 65 20 22 24 7b 77 69 74 68  n...case "${with
19f0: 5f 74 6b 63 6f 6e 66 69 67 7d 22 20 69 6e 0a 09  _tkconfig}" in..
1a00: 09 20 20 20 20 2a 2f 74 6b 43 6f 6e 66 69 67 2e  .    */tkConfig.
1a10: 73 68 20 29 0a 09 09 09 69 66 20 74 65 73 74 20  sh )....if test 
1a20: 2d 66 20 22 24 7b 77 69 74 68 5f 74 6b 63 6f 6e  -f "${with_tkcon
1a30: 66 69 67 7d 22 3b 20 74 68 65 6e 0a 09 09 09 20  fig}"; then.... 
1a40: 20 20 20 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b     AC_MSG_WARN([
1a50: 2d 2d 77 69 74 68 2d 74 6b 20 61 72 67 75 6d 65  --with-tk argume
1a60: 6e 74 20 73 68 6f 75 6c 64 20 72 65 66 65 72 20  nt should refer 
1a70: 74 6f 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e  to directory con
1a80: 74 61 69 6e 69 6e 67 20 74 6b 43 6f 6e 66 69 67  taining tkConfig
1a90: 2e 73 68 2c 20 6e 6f 74 20 74 6f 20 74 6b 43 6f  .sh, not to tkCo
1aa0: 6e 66 69 67 2e 73 68 20 69 74 73 65 6c 66 5d 29  nfig.sh itself])
1ab0: 0a 09 09 09 20 20 20 20 77 69 74 68 5f 74 6b 63  ....    with_tkc
1ac0: 6f 6e 66 69 67 3d 22 60 65 63 68 6f 20 22 24 7b  onfig="`echo "${
1ad0: 77 69 74 68 5f 74 6b 63 6f 6e 66 69 67 7d 22 20  with_tkconfig}" 
1ae0: 7c 20 73 65 64 20 27 73 21 2f 74 6b 43 6f 6e 66  | sed 's!/tkConf
1af0: 69 67 5c 2e 73 68 24 21 21 27 60 22 0a 09 09 09  ig\.sh$!!'`"....
1b00: 66 69 20 3b 3b 0a 09 09 65 73 61 63 0a 09 09 69  fi ;;...esac...i
1b10: 66 20 74 65 73 74 20 2d 66 20 22 24 7b 77 69 74  f test -f "${wit
1b20: 68 5f 74 6b 63 6f 6e 66 69 67 7d 2f 74 6b 43 6f  h_tkconfig}/tkCo
1b30: 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a  nfig.sh" ; then.
1b40: 09 09 20 20 20 20 61 63 5f 63 76 5f 63 5f 74 6b  ..    ac_cv_c_tk
1b50: 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 22 24 7b  config="`(cd "${
1b60: 77 69 74 68 5f 74 6b 63 6f 6e 66 69 67 7d 22 3b  with_tkconfig}";
1b70: 20 70 77 64 29 60 22 0a 09 09 65 6c 73 65 0a 09   pwd)`"...else..
1b80: 09 20 20 20 20 41 43 5f 4d 53 47 5f 45 52 52 4f  .    AC_MSG_ERRO
1b90: 52 28 5b 24 7b 77 69 74 68 5f 74 6b 63 6f 6e 66  R([${with_tkconf
1ba0: 69 67 7d 20 64 69 72 65 63 74 6f 72 79 20 64 6f  ig} directory do
1bb0: 65 73 6e 27 74 20 63 6f 6e 74 61 69 6e 20 74 6b  esn't contain tk
1bc0: 43 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 09 66 69  Config.sh])...fi
1bd0: 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 23  ..    fi...    #
1be0: 20 74 68 65 6e 20 63 68 65 63 6b 20 66 6f 72 20   then check for 
1bf0: 61 20 70 72 69 76 61 74 65 20 54 6b 20 6c 69 62  a private Tk lib
1c00: 72 61 72 79 0a 09 20 20 20 20 69 66 20 74 65 73  rary..    if tes
1c10: 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 6b  t x"${ac_cv_c_tk
1c20: 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74  config}" = x ; t
1c30: 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 5c  hen...for i in \
1c40: 0a 09 09 09 2e 2e 2f 74 6b 20 5c 0a 09 09 09 60  ....../tk \....`
1c50: 6c 73 20 2d 64 72 20 2e 2e 2f 74 6b 5b 5b 38 2d  ls -dr ../tk[[8-
1c60: 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d  9]].[[0-9]].[[0-
1c70: 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  9]]* 2>/dev/null
1c80: 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e  ` \....`ls -dr .
1c90: 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d  ./tk[[8-9]].[[0-
1ca0: 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  9]] 2>/dev/null`
1cb0: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e   \....`ls -dr ..
1cc0: 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39  /tk[[8-9]].[[0-9
1cd0: 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  ]]* 2>/dev/null`
1ce0: 20 5c 0a 09 09 09 2e 2e 2f 2e 2e 2f 74 6b 20 5c   \....../../tk \
1cf0: 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e  ....`ls -dr ../.
1d00: 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d  ./tk[[8-9]].[[0-
1d10: 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f  9]].[[0-9]]* 2>/
1d20: 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60  dev/null` \....`
1d30: 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 74 6b 5b  ls -dr ../../tk[
1d40: 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 32  [8-9]].[[0-9]] 2
1d50: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
1d60: 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 74  .`ls -dr ../../t
1d70: 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d  k[[8-9]].[[0-9]]
1d80: 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  * 2>/dev/null` \
1d90: 0a 09 09 09 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 6b 20  ....../../../tk 
1da0: 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f  \....`ls -dr ../
1db0: 2e 2e 2f 2e 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e  ../../tk[[8-9]].
1dc0: 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a  [[0-9]].[[0-9]]*
1dd0: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a   2>/dev/null` \.
1de0: 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e  ...`ls -dr ../..
1df0: 2f 2e 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b  /../tk[[8-9]].[[
1e00: 30 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c  0-9]] 2>/dev/nul
1e10: 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20  l` \....`ls -dr 
1e20: 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 6b 5b 5b 38 2d 39  ../../../tk[[8-9
1e30: 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64  ]].[[0-9]]* 2>/d
1e40: 65 76 2f 6e 75 6c 6c 60 20 3b 20 64 6f 0a 09 09  ev/null` ; do...
1e50: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b 54      if test "${T
1e60: 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20  EA_PLATFORM}" = 
1e70: 22 77 69 6e 64 6f 77 73 22 20 5c 0a 09 09 09 20  "windows" \.... 
1e80: 20 20 20 2d 61 20 2d 66 20 22 24 69 2f 77 69 6e     -a -f "$i/win
1e90: 2f 74 6b 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20  /tkConfig.sh" ; 
1ea0: 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f  then....ac_cv_c_
1eb0: 74 6b 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 24  tkconfig="`(cd $
1ec0: 69 2f 77 69 6e 3b 20 70 77 64 29 60 22 0a 09 09  i/win; pwd)`"...
1ed0: 09 62 72 65 61 6b 0a 09 09 20 20 20 20 66 69 0a  .break...    fi.
1ee0: 09 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 66  ..    if test -f
1ef0: 20 22 24 69 2f 75 6e 69 78 2f 74 6b 43 6f 6e 66   "$i/unix/tkConf
1f00: 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09  ig.sh" ; then...
1f10: 09 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69  .ac_cv_c_tkconfi
1f20: 67 3d 22 60 28 63 64 20 24 69 2f 75 6e 69 78 3b  g="`(cd $i/unix;
1f30: 20 70 77 64 29 60 22 0a 09 09 09 62 72 65 61 6b   pwd)`"....break
1f40: 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e 65  ...    fi...done
1f50: 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 23  ..    fi...    #
1f60: 20 6f 6e 20 44 61 72 77 69 6e 2c 20 63 68 65 63   on Darwin, chec
1f70: 6b 20 69 6e 20 46 72 61 6d 65 77 6f 72 6b 20 69  k in Framework i
1f80: 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 6c 6f 63 61  nstallation loca
1f90: 74 69 6f 6e 73 0a 09 20 20 20 20 69 66 20 74 65  tions..    if te
1fa0: 73 74 20 22 60 75 6e 61 6d 65 20 2d 73 60 22 20  st "`uname -s`" 
1fb0: 3d 20 22 44 61 72 77 69 6e 22 20 2d 61 20 78 22  = "Darwin" -a x"
1fc0: 24 7b 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66  ${ac_cv_c_tkconf
1fd0: 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e 0a  ig}" = x ; then.
1fe0: 09 09 66 6f 72 20 69 20 69 6e 20 60 6c 73 20 2d  ..for i in `ls -
1ff0: 64 20 7e 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d  d ~/Library/Fram
2000: 65 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f 6e 75  eworks 2>/dev/nu
2010: 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20  ll` \....`ls -d 
2020: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f  /Library/Framewo
2030: 72 6b 73 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  rks 2>/dev/null`
2040: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 4e 65   \....`ls -d /Ne
2050: 74 77 6f 72 6b 2f 4c 69 62 72 61 72 79 2f 46 72  twork/Library/Fr
2060: 61 6d 65 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f  ameworks 2>/dev/
2070: 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d  null` \....`ls -
2080: 64 20 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72  d /System/Librar
2090: 79 2f 46 72 61 6d 65 77 6f 72 6b 73 20 32 3e 2f  y/Frameworks 2>/
20a0: 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 3b  dev/null` \....;
20b0: 20 64 6f 0a 09 09 20 20 20 20 69 66 20 74 65 73   do...    if tes
20c0: 74 20 2d 66 20 22 24 69 2f 54 6b 2e 66 72 61 6d  t -f "$i/Tk.fram
20d0: 65 77 6f 72 6b 2f 74 6b 43 6f 6e 66 69 67 2e 73  ework/tkConfig.s
20e0: 68 22 20 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f  h" ; then....ac_
20f0: 63 76 5f 63 5f 74 6b 63 6f 6e 66 69 67 3d 22 60  cv_c_tkconfig="`
2100: 28 63 64 20 24 69 2f 54 6b 2e 66 72 61 6d 65 77  (cd $i/Tk.framew
2110: 6f 72 6b 3b 20 70 77 64 29 60 22 0a 09 09 09 62  ork; pwd)`"....b
2120: 72 65 61 6b 0a 09 09 20 20 20 20 66 69 0a 09 09  reak...    fi...
2130: 64 6f 6e 65 0a 09 20 20 20 20 66 69 0a 0a 09 20  done..    fi... 
2140: 20 20 20 23 20 63 68 65 63 6b 20 69 6e 20 61 20     # check in a 
2150: 66 65 77 20 63 6f 6d 6d 6f 6e 20 69 6e 73 74 61  few common insta
2160: 6c 6c 20 6c 6f 63 61 74 69 6f 6e 73 0a 09 20 20  ll locations..  
2170: 20 20 69 66 20 74 65 73 74 20 78 22 24 7b 61 63    if test x"${ac
2180: 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69 67 7d 22  _cv_c_tkconfig}"
2190: 20 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 66 6f   = x ; then...fo
21a0: 72 20 69 20 69 6e 20 60 6c 73 20 2d 64 20 24 7b  r i in `ls -d ${
21b0: 6c 69 62 64 69 72 7d 20 32 3e 2f 64 65 76 2f 6e  libdir} 2>/dev/n
21c0: 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64  ull` \....`ls -d
21d0: 20 24 7b 65 78 65 63 5f 70 72 65 66 69 78 7d 2f   ${exec_prefix}/
21e0: 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  lib 2>/dev/null`
21f0: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 24 7b 70   \....`ls -d ${p
2200: 72 65 66 69 78 7d 2f 6c 69 62 20 32 3e 2f 64 65  refix}/lib 2>/de
2210: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73  v/null` \....`ls
2220: 20 2d 64 20 2f 75 73 72 2f 6c 6f 63 61 6c 2f 6c   -d /usr/local/l
2230: 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ib 2>/dev/null` 
2240: 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72  \....`ls -d /usr
2250: 2f 63 6f 6e 74 72 69 62 2f 6c 69 62 20 32 3e 2f  /contrib/lib 2>/
2260: 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60  dev/null` \....`
2270: 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62 20 32  ls -d /usr/lib 2
2280: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
2290: 09 60 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62  .`ls -d /usr/lib
22a0: 36 34 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  64 2>/dev/null` 
22b0: 5c 0a 09 09 09 3b 20 64 6f 0a 09 09 20 20 20 20  \....; do...    
22c0: 69 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 74  if test -f "$i/t
22d0: 6b 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68  kConfig.sh" ; th
22e0: 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f 74 6b  en....ac_cv_c_tk
22f0: 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 24 69 3b  config="`(cd $i;
2300: 20 70 77 64 29 60 22 0a 09 09 09 62 72 65 61 6b   pwd)`"....break
2310: 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e 65  ...    fi...done
2320: 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 23  ..    fi...    #
2330: 20 54 45 41 20 73 70 65 63 69 66 69 63 3a 20 6f   TEA specific: o
2340: 6e 20 57 69 6e 64 6f 77 73 2c 20 63 68 65 63 6b  n Windows, check
2350: 20 69 6e 20 63 6f 6d 6d 6f 6e 20 69 6e 73 74 61   in common insta
2360: 6c 6c 61 74 69 6f 6e 20 6c 6f 63 61 74 69 6f 6e  llation location
2370: 73 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 22  s..    if test "
2380: 24 7b 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22  ${TEA_PLATFORM}"
2390: 20 3d 20 22 77 69 6e 64 6f 77 73 22 20 5c 0a 09   = "windows" \..
23a0: 09 2d 61 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f  .-a x"${ac_cv_c_
23b0: 74 6b 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b  tkconfig}" = x ;
23c0: 20 74 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e   then...for i in
23d0: 20 60 6c 73 20 2d 64 20 43 3a 2f 54 63 6c 2f 6c   `ls -d C:/Tcl/l
23e0: 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ib 2>/dev/null` 
23f0: 5c 0a 09 09 09 60 6c 73 20 2d 64 20 43 3a 2f 50  \....`ls -d C:/P
2400: 72 6f 67 72 61 7e 31 2f 54 63 6c 2f 6c 69 62 20  rogra~1/Tcl/lib 
2410: 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09  2>/dev/null` \..
2420: 09 09 3b 20 64 6f 0a 09 09 20 20 20 20 69 66 20  ..; do...    if 
2430: 74 65 73 74 20 2d 66 20 22 24 69 2f 74 6b 43 6f  test -f "$i/tkCo
2440: 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a  nfig.sh" ; then.
2450: 09 09 09 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e  ...ac_cv_c_tkcon
2460: 66 69 67 3d 22 60 28 63 64 20 24 69 3b 20 70 77  fig="`(cd $i; pw
2470: 64 29 60 22 0a 09 09 09 62 72 65 61 6b 0a 09 09  d)`"....break...
2480: 20 20 20 20 66 69 0a 09 09 64 6f 6e 65 0a 09 20      fi...done.. 
2490: 20 20 20 66 69 0a 0a 09 20 20 20 20 23 20 63 68     fi...    # ch
24a0: 65 63 6b 20 69 6e 20 61 20 66 65 77 20 6f 74 68  eck in a few oth
24b0: 65 72 20 70 72 69 76 61 74 65 20 6c 6f 63 61 74  er private locat
24c0: 69 6f 6e 73 0a 09 20 20 20 20 69 66 20 74 65 73  ions..    if tes
24d0: 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 6b  t x"${ac_cv_c_tk
24e0: 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74  config}" = x ; t
24f0: 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 5c  hen...for i in \
2500: 0a 09 09 09 24 7b 73 72 63 64 69 72 7d 2f 2e 2e  ....${srcdir}/..
2510: 2f 74 6b 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72  /tk \....`ls -dr
2520: 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f 74 6b   ${srcdir}/../tk
2530: 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e  [[8-9]].[[0-9]].
2540: 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f  [[0-9]]* 2>/dev/
2550: 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d  null` \....`ls -
2560: 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f  dr ${srcdir}/../
2570: 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d  tk[[8-9]].[[0-9]
2580: 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  ] 2>/dev/null` \
2590: 0a 09 09 09 60 6c 73 20 2d 64 72 20 24 7b 73 72  ....`ls -dr ${sr
25a0: 63 64 69 72 7d 2f 2e 2e 2f 74 6b 5b 5b 38 2d 39  cdir}/../tk[[8-9
25b0: 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64  ]].[[0-9]]* 2>/d
25c0: 65 76 2f 6e 75 6c 6c 60 20 3b 20 64 6f 0a 09 09  ev/null` ; do...
25d0: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b 54      if test "${T
25e0: 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20  EA_PLATFORM}" = 
25f0: 22 77 69 6e 64 6f 77 73 22 20 5c 0a 09 09 09 20  "windows" \.... 
2600: 20 20 20 2d 61 20 2d 66 20 22 24 69 2f 77 69 6e     -a -f "$i/win
2610: 2f 74 6b 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20  /tkConfig.sh" ; 
2620: 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f  then....ac_cv_c_
2630: 74 6b 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 24  tkconfig="`(cd $
2640: 69 2f 77 69 6e 3b 20 70 77 64 29 60 22 0a 09 09  i/win; pwd)`"...
2650: 09 62 72 65 61 6b 0a 09 09 20 20 20 20 66 69 0a  .break...    fi.
2660: 09 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 66  ..    if test -f
2670: 20 22 24 69 2f 75 6e 69 78 2f 74 6b 43 6f 6e 66   "$i/unix/tkConf
2680: 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09  ig.sh" ; then...
2690: 09 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69  .ac_cv_c_tkconfi
26a0: 67 3d 22 60 28 63 64 20 24 69 2f 75 6e 69 78 3b  g="`(cd $i/unix;
26b0: 20 70 77 64 29 60 22 0a 09 09 09 62 72 65 61 6b   pwd)`"....break
26c0: 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e 65  ...    fi...done
26d0: 0a 09 20 20 20 20 66 69 0a 09 5d 29 0a 0a 09 69  ..    fi..])...i
26e0: 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f 63 76  f test x"${ac_cv
26f0: 5f 63 5f 74 6b 63 6f 6e 66 69 67 7d 22 20 3d 20  _c_tkconfig}" = 
2700: 78 20 3b 20 74 68 65 6e 0a 09 20 20 20 20 54 4b  x ; then..    TK
2710: 5f 42 49 4e 5f 44 49 52 3d 22 23 20 6e 6f 20 54  _BIN_DIR="# no T
2720: 6b 20 63 6f 6e 66 69 67 73 20 66 6f 75 6e 64 22  k configs found"
2730: 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 45 52 52  ..    AC_MSG_ERR
2740: 4f 52 28 5b 43 61 6e 27 74 20 66 69 6e 64 20 54  OR([Can't find T
2750: 6b 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20  k configuration 
2760: 64 65 66 69 6e 69 74 69 6f 6e 73 2e 20 55 73 65  definitions. Use
2770: 20 2d 2d 77 69 74 68 2d 74 6b 20 74 6f 20 73 70   --with-tk to sp
2780: 65 63 69 66 79 20 61 20 64 69 72 65 63 74 6f 72  ecify a director
2790: 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 6b 43  y containing tkC
27a0: 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 65 6c 73 65  onfig.sh])..else
27b0: 0a 09 20 20 20 20 6e 6f 5f 74 6b 3d 0a 09 20 20  ..    no_tk=..  
27c0: 20 20 54 4b 5f 42 49 4e 5f 44 49 52 3d 22 24 7b    TK_BIN_DIR="${
27d0: 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69 67  ac_cv_c_tkconfig
27e0: 7d 22 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52  }"..    AC_MSG_R
27f0: 45 53 55 4c 54 28 5b 66 6f 75 6e 64 20 24 7b 54  ESULT([found ${T
2800: 4b 5f 42 49 4e 5f 44 49 52 7d 2f 74 6b 43 6f 6e  K_BIN_DIR}/tkCon
2810: 66 69 67 2e 73 68 5d 29 0a 09 66 69 0a 20 20 20  fig.sh])..fi.   
2820: 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d   fi.])..#-------
2830: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2840: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2850: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2860: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2870: 2d 0a 23 20 54 45 41 5f 4c 4f 41 44 5f 54 43 4c  -.# TEA_LOAD_TCL
2880: 43 4f 4e 46 49 47 20 2d 2d 0a 23 0a 23 09 4c 6f  CONFIG --.#.#.Lo
2890: 61 64 20 74 68 65 20 74 63 6c 43 6f 6e 66 69 67  ad the tclConfig
28a0: 2e 73 68 20 66 69 6c 65 0a 23 0a 23 20 41 72 67  .sh file.#.# Arg
28b0: 75 6d 65 6e 74 73 3a 0a 23 0a 23 09 52 65 71 75  uments:.#.#.Requ
28c0: 69 72 65 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69  ires the followi
28d0: 6e 67 20 76 61 72 73 20 74 6f 20 62 65 20 73 65  ng vars to be se
28e0: 74 3a 0a 23 09 09 54 43 4c 5f 42 49 4e 5f 44 49  t:.#..TCL_BIN_DI
28f0: 52 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23  R.#.# Results:.#
2900: 0a 23 09 53 75 62 73 74 69 74 75 74 65 73 20 74  .#.Substitutes t
2910: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72  he following var
2920: 73 3a 0a 23 09 09 54 43 4c 5f 42 49 4e 5f 44 49  s:.#..TCL_BIN_DI
2930: 52 0a 23 09 09 54 43 4c 5f 53 52 43 5f 44 49 52  R.#..TCL_SRC_DIR
2940: 0a 23 09 09 54 43 4c 5f 4c 49 42 5f 46 49 4c 45  .#..TCL_LIB_FILE
2950: 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
2960: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2970: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2980: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2990: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44  ----------..AC_D
29a0: 45 46 55 4e 28 5b 54 45 41 5f 4c 4f 41 44 5f 54  EFUN([TEA_LOAD_T
29b0: 43 4c 43 4f 4e 46 49 47 5d 2c 20 5b 0a 20 20 20  CLCONFIG], [.   
29c0: 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47   AC_MSG_CHECKING
29d0: 28 5b 66 6f 72 20 65 78 69 73 74 65 6e 63 65 20  ([for existence 
29e0: 6f 66 20 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52  of ${TCL_BIN_DIR
29f0: 7d 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 5d 29  }/tclConfig.sh])
2a00: 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20 2d 66  ..    if test -f
2a10: 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d   "${TCL_BIN_DIR}
2a20: 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b  /tclConfig.sh" ;
2a30: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 41 43   then.        AC
2a40: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6c 6f 61  _MSG_RESULT([loa
2a50: 64 69 6e 67 5d 29 0a 09 2e 20 22 24 7b 54 43 4c  ding])... "${TCL
2a60: 5f 42 49 4e 5f 44 49 52 7d 2f 74 63 6c 43 6f 6e  _BIN_DIR}/tclCon
2a70: 66 69 67 2e 73 68 22 0a 20 20 20 20 65 6c 73 65  fig.sh".    else
2a80: 0a 20 20 20 20 20 20 20 20 41 43 5f 4d 53 47 5f  .        AC_MSG_
2a90: 52 45 53 55 4c 54 28 5b 63 6f 75 6c 64 20 6e 6f  RESULT([could no
2aa0: 74 20 66 69 6e 64 20 24 7b 54 43 4c 5f 42 49 4e  t find ${TCL_BIN
2ab0: 5f 44 49 52 7d 2f 74 63 6c 43 6f 6e 66 69 67 2e  _DIR}/tclConfig.
2ac0: 73 68 5d 29 0a 20 20 20 20 66 69 0a 0a 20 20 20  sh]).    fi..   
2ad0: 20 23 20 65 76 61 6c 20 69 73 20 72 65 71 75 69   # eval is requi
2ae0: 72 65 64 20 74 6f 20 64 6f 20 74 68 65 20 54 43  red to do the TC
2af0: 4c 5f 44 42 47 58 20 73 75 62 73 74 69 74 75 74  L_DBGX substitut
2b00: 69 6f 6e 0a 20 20 20 20 65 76 61 6c 20 22 54 43  ion.    eval "TC
2b10: 4c 5f 4c 49 42 5f 46 49 4c 45 3d 5c 22 24 7b 54  L_LIB_FILE=\"${T
2b20: 43 4c 5f 4c 49 42 5f 46 49 4c 45 7d 5c 22 22 0a  CL_LIB_FILE}\"".
2b30: 20 20 20 20 65 76 61 6c 20 22 54 43 4c 5f 53 54      eval "TCL_ST
2b40: 55 42 5f 4c 49 42 5f 46 49 4c 45 3d 5c 22 24 7b  UB_LIB_FILE=\"${
2b50: 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c  TCL_STUB_LIB_FIL
2b60: 45 7d 5c 22 22 0a 0a 20 20 20 20 23 20 49 66 20  E}\""..    # If 
2b70: 74 68 65 20 54 43 4c 5f 42 49 4e 5f 44 49 52 20  the TCL_BIN_DIR 
2b80: 69 73 20 74 68 65 20 62 75 69 6c 64 20 64 69 72  is the build dir
2b90: 65 63 74 6f 72 79 20 28 6e 6f 74 20 74 68 65 20  ectory (not the 
2ba0: 69 6e 73 74 61 6c 6c 20 64 69 72 65 63 74 6f 72  install director
2bb0: 79 29 2c 0a 20 20 20 20 23 20 74 68 65 6e 20 73  y),.    # then s
2bc0: 65 74 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 76 61  et the common va
2bd0: 72 69 61 62 6c 65 20 6e 61 6d 65 20 74 6f 20 74  riable name to t
2be0: 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20  he value of the 
2bf0: 62 75 69 6c 64 20 76 61 72 69 61 62 6c 65 73 2e  build variables.
2c00: 0a 20 20 20 20 23 20 46 6f 72 20 65 78 61 6d 70  .    # For examp
2c10: 6c 65 2c 20 74 68 65 20 76 61 72 69 61 62 6c 65  le, the variable
2c20: 20 54 43 4c 5f 4c 49 42 5f 53 50 45 43 20 77 69   TCL_LIB_SPEC wi
2c30: 6c 6c 20 62 65 20 73 65 74 20 74 6f 20 74 68 65  ll be set to the
2c40: 20 76 61 6c 75 65 0a 20 20 20 20 23 20 6f 66 20   value.    # of 
2c50: 54 43 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50  TCL_BUILD_LIB_SP
2c60: 45 43 2e 20 41 6e 20 65 78 74 65 6e 73 69 6f 6e  EC. An extension
2c70: 20 73 68 6f 75 6c 64 20 6d 61 6b 65 20 75 73 65   should make use
2c80: 20 6f 66 20 54 43 4c 5f 4c 49 42 5f 53 50 45 43   of TCL_LIB_SPEC
2c90: 0a 20 20 20 20 23 20 69 6e 73 74 65 61 64 20 6f  .    # instead o
2ca0: 66 20 54 43 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f  f TCL_BUILD_LIB_
2cb0: 53 50 45 43 20 73 69 6e 63 65 20 69 74 20 77 69  SPEC since it wi
2cc0: 6c 6c 20 77 6f 72 6b 20 77 69 74 68 20 62 6f 74  ll work with bot
2cd0: 68 20 61 6e 0a 20 20 20 20 23 20 69 6e 73 74 61  h an.    # insta
2ce0: 6c 6c 65 64 20 61 6e 64 20 75 6e 69 6e 73 74 61  lled and uninsta
2cf0: 6c 6c 65 64 20 76 65 72 73 69 6f 6e 20 6f 66 20  lled version of 
2d00: 54 63 6c 2e 0a 20 20 20 20 69 66 20 74 65 73 74  Tcl..    if test
2d10: 20 2d 66 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44   -f "${TCL_BIN_D
2d20: 49 52 7d 2f 4d 61 6b 65 66 69 6c 65 22 20 3b 20  IR}/Makefile" ; 
2d30: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 54 43 4c  then.        TCL
2d40: 5f 4c 49 42 5f 53 50 45 43 3d 22 24 7b 54 43 4c  _LIB_SPEC="${TCL
2d50: 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43 7d  _BUILD_LIB_SPEC}
2d60: 22 0a 20 20 20 20 20 20 20 20 54 43 4c 5f 53 54  ".        TCL_ST
2d70: 55 42 5f 4c 49 42 5f 53 50 45 43 3d 22 24 7b 54  UB_LIB_SPEC="${T
2d80: 43 4c 5f 42 55 49 4c 44 5f 53 54 55 42 5f 4c 49  CL_BUILD_STUB_LI
2d90: 42 5f 53 50 45 43 7d 22 0a 20 20 20 20 20 20 20  B_SPEC}".       
2da0: 20 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 50 41   TCL_STUB_LIB_PA
2db0: 54 48 3d 22 24 7b 54 43 4c 5f 42 55 49 4c 44 5f  TH="${TCL_BUILD_
2dc0: 53 54 55 42 5f 4c 49 42 5f 50 41 54 48 7d 22 0a  STUB_LIB_PATH}".
2dd0: 20 20 20 20 65 6c 69 66 20 74 65 73 74 20 22 60      elif test "`
2de0: 75 6e 61 6d 65 20 2d 73 60 22 20 3d 20 22 44 61  uname -s`" = "Da
2df0: 72 77 69 6e 22 3b 20 74 68 65 6e 0a 09 23 20 49  rwin"; then..# I
2e00: 66 20 54 63 6c 20 77 61 73 20 62 75 69 6c 74 20  f Tcl was built 
2e10: 61 73 20 61 20 66 72 61 6d 65 77 6f 72 6b 2c 20  as a framework, 
2e20: 61 74 74 65 6d 70 74 20 74 6f 20 75 73 65 20 74  attempt to use t
2e30: 68 65 20 6c 69 62 72 61 72 69 65 73 0a 09 23 20  he libraries..# 
2e40: 66 72 6f 6d 20 74 68 65 20 66 72 61 6d 65 77 6f  from the framewo
2e50: 72 6b 20 61 74 20 74 68 65 20 67 69 76 65 6e 20  rk at the given 
2e60: 6c 6f 63 61 74 69 6f 6e 20 73 6f 20 74 68 61 74  location so that
2e70: 20 6c 69 6e 6b 69 6e 67 20 77 6f 72 6b 73 0a 09   linking works..
2e80: 23 20 61 67 61 69 6e 73 74 20 54 63 6c 2e 66 72  # against Tcl.fr
2e90: 61 6d 65 77 6f 72 6b 20 69 6e 73 74 61 6c 6c 65  amework installe
2ea0: 64 20 69 6e 20 61 6e 20 61 72 62 69 74 72 61 72  d in an arbitrar
2eb0: 79 20 6c 6f 63 61 74 69 6f 6e 2e 0a 09 63 61 73  y location...cas
2ec0: 65 20 24 7b 54 43 4c 5f 44 45 46 53 7d 20 69 6e  e ${TCL_DEFS} in
2ed0: 0a 09 20 20 20 20 2a 54 43 4c 5f 46 52 41 4d 45  ..    *TCL_FRAME
2ee0: 57 4f 52 4b 2a 29 0a 09 09 69 66 20 74 65 73 74  WORK*)...if test
2ef0: 20 2d 66 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44   -f "${TCL_BIN_D
2f00: 49 52 7d 2f 24 7b 54 43 4c 5f 4c 49 42 5f 46 49  IR}/${TCL_LIB_FI
2f10: 4c 45 7d 22 3b 20 74 68 65 6e 0a 09 09 20 20 20  LE}"; then...   
2f20: 20 66 6f 72 20 69 20 69 6e 20 22 60 63 64 20 22   for i in "`cd "
2f30: 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 22 3b  ${TCL_BIN_DIR}";
2f40: 20 70 77 64 60 22 20 5c 0a 09 09 09 20 20 20 20   pwd`" \....    
2f50: 20 22 60 63 64 20 22 24 7b 54 43 4c 5f 42 49 4e   "`cd "${TCL_BIN
2f60: 5f 44 49 52 7d 22 2f 2e 2e 2f 2e 2e 3b 20 70 77  _DIR}"/../..; pw
2f70: 64 60 22 3b 20 64 6f 0a 09 09 09 69 66 20 74 65  d`"; do....if te
2f80: 73 74 20 22 60 62 61 73 65 6e 61 6d 65 20 22 24  st "`basename "$
2f90: 69 22 60 22 20 3d 20 22 24 7b 54 43 4c 5f 4c 49  i"`" = "${TCL_LI
2fa0: 42 5f 46 49 4c 45 7d 2e 66 72 61 6d 65 77 6f 72  B_FILE}.framewor
2fb0: 6b 22 3b 20 74 68 65 6e 0a 09 09 09 20 20 20 20  k"; then....    
2fc0: 54 43 4c 5f 4c 49 42 5f 53 50 45 43 3d 22 2d 46  TCL_LIB_SPEC="-F
2fd0: 60 64 69 72 6e 61 6d 65 20 22 24 69 22 20 7c 20  `dirname "$i" | 
2fe0: 73 65 64 20 2d 65 20 27 73 2f 20 2f 5c 5c 5c 5c  sed -e 's/ /\\\\
2ff0: 20 2f 67 27 60 20 2d 66 72 61 6d 65 77 6f 72 6b   /g'` -framework
3000: 20 24 7b 54 43 4c 5f 4c 49 42 5f 46 49 4c 45 7d   ${TCL_LIB_FILE}
3010: 22 0a 09 09 09 20 20 20 20 62 72 65 61 6b 0a 09  "....    break..
3020: 09 09 66 69 0a 09 09 20 20 20 20 64 6f 6e 65 0a  ..fi...    done.
3030: 09 09 66 69 0a 09 09 69 66 20 74 65 73 74 20 2d  ..fi...if test -
3040: 66 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52  f "${TCL_BIN_DIR
3050: 7d 2f 24 7b 54 43 4c 5f 53 54 55 42 5f 4c 49 42  }/${TCL_STUB_LIB
3060: 5f 46 49 4c 45 7d 22 3b 20 74 68 65 6e 0a 09 09  _FILE}"; then...
3070: 20 20 20 20 54 43 4c 5f 53 54 55 42 5f 4c 49 42      TCL_STUB_LIB
3080: 5f 53 50 45 43 3d 22 2d 4c 60 65 63 68 6f 20 22  _SPEC="-L`echo "
3090: 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 22 20  ${TCL_BIN_DIR}" 
30a0: 20 7c 20 73 65 64 20 2d 65 20 27 73 2f 20 2f 5c   | sed -e 's/ /\
30b0: 5c 5c 5c 20 2f 67 27 60 20 24 7b 54 43 4c 5f 53  \\\ /g'` ${TCL_S
30c0: 54 55 42 5f 4c 49 42 5f 46 4c 41 47 7d 22 0a 09  TUB_LIB_FLAG}"..
30d0: 09 20 20 20 20 54 43 4c 5f 53 54 55 42 5f 4c 49  .    TCL_STUB_LI
30e0: 42 5f 50 41 54 48 3d 22 24 7b 54 43 4c 5f 42 49  B_PATH="${TCL_BI
30f0: 4e 5f 44 49 52 7d 2f 24 7b 54 43 4c 5f 53 54 55  N_DIR}/${TCL_STU
3100: 42 5f 4c 49 42 5f 46 49 4c 45 7d 22 0a 09 09 66  B_LIB_FILE}"...f
3110: 69 0a 09 09 3b 3b 0a 09 65 73 61 63 0a 20 20 20  i...;;..esac.   
3120: 20 66 69 0a 0a 20 20 20 20 23 20 65 76 61 6c 20   fi..    # eval 
3130: 69 73 20 72 65 71 75 69 72 65 64 20 74 6f 20 64  is required to d
3140: 6f 20 74 68 65 20 54 43 4c 5f 44 42 47 58 20 73  o the TCL_DBGX s
3150: 75 62 73 74 69 74 75 74 69 6f 6e 0a 20 20 20 20  ubstitution.    
3160: 65 76 61 6c 20 22 54 43 4c 5f 4c 49 42 5f 46 4c  eval "TCL_LIB_FL
3170: 41 47 3d 5c 22 24 7b 54 43 4c 5f 4c 49 42 5f 46  AG=\"${TCL_LIB_F
3180: 4c 41 47 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c  LAG}\"".    eval
3190: 20 22 54 43 4c 5f 4c 49 42 5f 53 50 45 43 3d 5c   "TCL_LIB_SPEC=\
31a0: 22 24 7b 54 43 4c 5f 4c 49 42 5f 53 50 45 43 7d  "${TCL_LIB_SPEC}
31b0: 5c 22 22 0a 20 20 20 20 65 76 61 6c 20 22 54 43  \"".    eval "TC
31c0: 4c 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 3d  L_STUB_LIB_FLAG=
31d0: 5c 22 24 7b 54 43 4c 5f 53 54 55 42 5f 4c 49 42  \"${TCL_STUB_LIB
31e0: 5f 46 4c 41 47 7d 5c 22 22 0a 20 20 20 20 65 76  _FLAG}\"".    ev
31f0: 61 6c 20 22 54 43 4c 5f 53 54 55 42 5f 4c 49 42  al "TCL_STUB_LIB
3200: 5f 53 50 45 43 3d 5c 22 24 7b 54 43 4c 5f 53 54  _SPEC=\"${TCL_ST
3210: 55 42 5f 4c 49 42 5f 53 50 45 43 7d 5c 22 22 0a  UB_LIB_SPEC}\"".
3220: 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 43  .    AC_SUBST(TC
3230: 4c 5f 56 45 52 53 49 4f 4e 29 0a 20 20 20 20 41  L_VERSION).    A
3240: 43 5f 53 55 42 53 54 28 54 43 4c 5f 50 41 54 43  C_SUBST(TCL_PATC
3250: 48 5f 4c 45 56 45 4c 29 0a 20 20 20 20 41 43 5f  H_LEVEL).    AC_
3260: 53 55 42 53 54 28 54 43 4c 5f 42 49 4e 5f 44 49  SUBST(TCL_BIN_DI
3270: 52 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  R).    AC_SUBST(
3280: 54 43 4c 5f 53 52 43 5f 44 49 52 29 0a 0a 20 20  TCL_SRC_DIR)..  
3290: 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 4c    AC_SUBST(TCL_L
32a0: 49 42 5f 46 49 4c 45 29 0a 20 20 20 20 41 43 5f  IB_FILE).    AC_
32b0: 53 55 42 53 54 28 54 43 4c 5f 4c 49 42 5f 46 4c  SUBST(TCL_LIB_FL
32c0: 41 47 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54  AG).    AC_SUBST
32d0: 28 54 43 4c 5f 4c 49 42 5f 53 50 45 43 29 0a 0a  (TCL_LIB_SPEC)..
32e0: 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c      AC_SUBST(TCL
32f0: 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 29 0a  _STUB_LIB_FILE).
3300: 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c      AC_SUBST(TCL
3310: 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 29 0a  _STUB_LIB_FLAG).
3320: 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c      AC_SUBST(TCL
3330: 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 29 0a  _STUB_LIB_SPEC).
3340: 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43  .    AC_MSG_CHEC
3350: 4b 49 4e 47 28 5b 70 6c 61 74 66 6f 72 6d 5d 29  KING([platform])
3360: 0a 20 20 20 20 68 6f 6c 64 5f 63 63 3d 24 43 43  .    hold_cc=$CC
3370: 3b 20 43 43 3d 22 24 54 43 4c 5f 43 43 22 0a 20  ; CC="$TCL_CC". 
3380: 20 20 20 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c     AC_TRY_COMPIL
3390: 45 28 2c 5b 0a 09 20 20 20 20 23 69 66 64 65 66  E(,[..    #ifdef
33a0: 20 5f 57 49 4e 33 32 0a 09 09 23 65 72 72 6f 72   _WIN32...#error
33b0: 20 77 69 6e 33 32 0a 09 20 20 20 20 23 65 6e 64   win32..    #end
33c0: 69 66 0a 20 20 20 20 5d 2c 20 54 45 41 5f 50 4c  if.    ], TEA_PL
33d0: 41 54 46 4f 52 4d 3d 22 75 6e 69 78 22 2c 0a 09  ATFORM="unix",..
33e0: 20 20 20 20 54 45 41 5f 50 4c 41 54 46 4f 52 4d      TEA_PLATFORM
33f0: 3d 22 77 69 6e 64 6f 77 73 22 0a 20 20 20 20 29  ="windows".    )
3400: 0a 20 20 20 20 43 43 3d 24 68 6f 6c 64 5f 63 63  .    CC=$hold_cc
3410: 0a 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55  .    AC_MSG_RESU
3420: 4c 54 28 24 54 45 41 5f 50 4c 41 54 46 4f 52 4d  LT($TEA_PLATFORM
3430: 29 0a 0a 20 20 20 20 23 20 54 68 65 20 42 55 49  )..    # The BUI
3440: 4c 44 5f 24 70 6b 67 20 69 73 20 74 6f 20 64 65  LD_$pkg is to de
3450: 66 69 6e 65 20 74 68 65 20 63 6f 72 72 65 63 74  fine the correct
3460: 20 65 78 74 65 72 6e 20 73 74 6f 72 61 67 65 20   extern storage 
3470: 63 6c 61 73 73 0a 20 20 20 20 23 20 68 61 6e 64  class.    # hand
3480: 6c 69 6e 67 20 77 68 65 6e 20 6d 61 6b 69 6e 67  ling when making
3490: 20 74 68 69 73 20 70 61 63 6b 61 67 65 0a 20 20   this package.  
34a0: 20 20 41 43 5f 44 45 46 49 4e 45 5f 55 4e 51 55    AC_DEFINE_UNQU
34b0: 4f 54 45 44 28 42 55 49 4c 44 5f 24 7b 50 41 43  OTED(BUILD_${PAC
34c0: 4b 41 47 45 5f 4e 41 4d 45 7d 2c 20 5b 5d 2c 0a  KAGE_NAME}, [],.
34d0: 09 20 20 20 20 5b 42 75 69 6c 64 69 6e 67 20 65  .    [Building e
34e0: 78 74 65 6e 73 69 6f 6e 20 73 6f 75 72 63 65 3f  xtension source?
34f0: 5d 29 0a 20 20 20 20 23 20 44 6f 20 74 68 69 73  ]).    # Do this
3500: 20 68 65 72 65 20 61 73 20 77 65 20 68 61 76 65   here as we have
3510: 20 66 75 6c 6c 79 20 64 65 66 69 6e 65 64 20 54   fully defined T
3520: 45 41 5f 50 4c 41 54 46 4f 52 4d 20 6e 6f 77 0a  EA_PLATFORM now.
3530: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b 54      if test "${T
3540: 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20  EA_PLATFORM}" = 
3550: 22 77 69 6e 64 6f 77 73 22 20 3b 20 74 68 65 6e  "windows" ; then
3560: 0a 09 45 58 45 45 58 54 3d 22 2e 65 78 65 22 0a  ..EXEEXT=".exe".
3570: 09 43 4c 45 41 4e 46 49 4c 45 53 3d 22 24 43 4c  .CLEANFILES="$CL
3580: 45 41 4e 46 49 4c 45 53 20 2a 2e 6c 69 62 20 2a  EANFILES *.lib *
3590: 2e 64 6c 6c 20 2a 2e 70 64 62 20 2a 2e 65 78 70  .dll *.pdb *.exp
35a0: 22 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 23 20  ".    fi..    # 
35b0: 54 45 41 20 73 70 65 63 69 66 69 63 3a 0a 20 20  TEA specific:.  
35c0: 20 20 41 43 5f 53 55 42 53 54 28 43 4c 45 41 4e    AC_SUBST(CLEAN
35d0: 46 49 4c 45 53 29 0a 20 20 20 20 41 43 5f 53 55  FILES).    AC_SU
35e0: 42 53 54 28 54 43 4c 5f 4c 49 42 53 29 0a 20 20  BST(TCL_LIBS).  
35f0: 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 44    AC_SUBST(TCL_D
3600: 45 46 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53  EFS).    AC_SUBS
3610: 54 28 54 43 4c 5f 45 58 54 52 41 5f 43 46 4c 41  T(TCL_EXTRA_CFLA
3620: 47 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54  GS).    AC_SUBST
3630: 28 54 43 4c 5f 4c 44 5f 46 4c 41 47 53 29 0a 20  (TCL_LD_FLAGS). 
3640: 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f     AC_SUBST(TCL_
3650: 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53 29 0a 5d  SHLIB_LD_LIBS).]
3660: 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  )..#------------
3670: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3680: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3690: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
36a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54  ------------.# T
36b0: 45 41 5f 4c 4f 41 44 5f 54 4b 43 4f 4e 46 49 47  EA_LOAD_TKCONFIG
36c0: 20 2d 2d 0a 23 0a 23 09 4c 6f 61 64 20 74 68 65   --.#.#.Load the
36d0: 20 74 6b 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c   tkConfig.sh fil
36e0: 65 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a  e.#.# Arguments:
36f0: 0a 23 0a 23 09 52 65 71 75 69 72 65 73 20 74 68  .#.#.Requires th
3700: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
3710: 20 74 6f 20 62 65 20 73 65 74 3a 0a 23 09 09 54   to be set:.#..T
3720: 4b 5f 42 49 4e 5f 44 49 52 0a 23 0a 23 20 52 65  K_BIN_DIR.#.# Re
3730: 73 75 6c 74 73 3a 0a 23 0a 23 09 53 65 74 73 20  sults:.#.#.Sets 
3740: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
3750: 72 73 20 74 68 61 74 20 73 68 6f 75 6c 64 20 62  rs that should b
3760: 65 20 69 6e 20 74 6b 43 6f 6e 66 69 67 2e 73 68  e in tkConfig.sh
3770: 3a 0a 23 09 09 54 4b 5f 42 49 4e 5f 44 49 52 0a  :.#..TK_BIN_DIR.
3780: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
3790: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
37a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
37b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
37c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
37d0: 46 55 4e 28 5b 54 45 41 5f 4c 4f 41 44 5f 54 4b  FUN([TEA_LOAD_TK
37e0: 43 4f 4e 46 49 47 5d 2c 20 5b 0a 20 20 20 20 41  CONFIG], [.    A
37f0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
3800: 66 6f 72 20 65 78 69 73 74 65 6e 63 65 20 6f 66  for existence of
3810: 20 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 74   ${TK_BIN_DIR}/t
3820: 6b 43 6f 6e 66 69 67 2e 73 68 5d 29 0a 0a 20 20  kConfig.sh])..  
3830: 20 20 69 66 20 74 65 73 74 20 2d 66 20 22 24 7b    if test -f "${
3840: 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 74 6b 43 6f  TK_BIN_DIR}/tkCo
3850: 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a  nfig.sh" ; then.
3860: 20 20 20 20 20 20 20 20 41 43 5f 4d 53 47 5f 52          AC_MSG_R
3870: 45 53 55 4c 54 28 5b 6c 6f 61 64 69 6e 67 5d 29  ESULT([loading])
3880: 0a 09 2e 20 22 24 7b 54 4b 5f 42 49 4e 5f 44 49  ... "${TK_BIN_DI
3890: 52 7d 2f 74 6b 43 6f 6e 66 69 67 2e 73 68 22 0a  R}/tkConfig.sh".
38a0: 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20      else.       
38b0: 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b   AC_MSG_RESULT([
38c0: 63 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64 20 24  could not find $
38d0: 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 74 6b 43  {TK_BIN_DIR}/tkC
38e0: 6f 6e 66 69 67 2e 73 68 5d 29 0a 20 20 20 20 66  onfig.sh]).    f
38f0: 69 0a 0a 20 20 20 20 23 20 65 76 61 6c 20 69 73  i..    # eval is
3900: 20 72 65 71 75 69 72 65 64 20 74 6f 20 64 6f 20   required to do 
3910: 74 68 65 20 54 4b 5f 44 42 47 58 20 73 75 62 73  the TK_DBGX subs
3920: 74 69 74 75 74 69 6f 6e 0a 20 20 20 20 65 76 61  titution.    eva
3930: 6c 20 22 54 4b 5f 4c 49 42 5f 46 49 4c 45 3d 5c  l "TK_LIB_FILE=\
3940: 22 24 7b 54 4b 5f 4c 49 42 5f 46 49 4c 45 7d 5c  "${TK_LIB_FILE}\
3950: 22 22 0a 20 20 20 20 65 76 61 6c 20 22 54 4b 5f  "".    eval "TK_
3960: 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 3d 5c 22  STUB_LIB_FILE=\"
3970: 24 7b 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 49  ${TK_STUB_LIB_FI
3980: 4c 45 7d 5c 22 22 0a 0a 20 20 20 20 23 20 49 66  LE}\""..    # If
3990: 20 74 68 65 20 54 4b 5f 42 49 4e 5f 44 49 52 20   the TK_BIN_DIR 
39a0: 69 73 20 74 68 65 20 62 75 69 6c 64 20 64 69 72  is the build dir
39b0: 65 63 74 6f 72 79 20 28 6e 6f 74 20 74 68 65 20  ectory (not the 
39c0: 69 6e 73 74 61 6c 6c 20 64 69 72 65 63 74 6f 72  install director
39d0: 79 29 2c 0a 20 20 20 20 23 20 74 68 65 6e 20 73  y),.    # then s
39e0: 65 74 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 76 61  et the common va
39f0: 72 69 61 62 6c 65 20 6e 61 6d 65 20 74 6f 20 74  riable name to t
3a00: 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20  he value of the 
3a10: 62 75 69 6c 64 20 76 61 72 69 61 62 6c 65 73 2e  build variables.
3a20: 0a 20 20 20 20 23 20 46 6f 72 20 65 78 61 6d 70  .    # For examp
3a30: 6c 65 2c 20 74 68 65 20 76 61 72 69 61 62 6c 65  le, the variable
3a40: 20 54 4b 5f 4c 49 42 5f 53 50 45 43 20 77 69 6c   TK_LIB_SPEC wil
3a50: 6c 20 62 65 20 73 65 74 20 74 6f 20 74 68 65 20  l be set to the 
3a60: 76 61 6c 75 65 0a 20 20 20 20 23 20 6f 66 20 54  value.    # of T
3a70: 4b 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43  K_BUILD_LIB_SPEC
3a80: 2e 20 41 6e 20 65 78 74 65 6e 73 69 6f 6e 20 73  . An extension s
3a90: 68 6f 75 6c 64 20 6d 61 6b 65 20 75 73 65 20 6f  hould make use o
3aa0: 66 20 54 4b 5f 4c 49 42 5f 53 50 45 43 0a 20 20  f TK_LIB_SPEC.  
3ab0: 20 20 23 20 69 6e 73 74 65 61 64 20 6f 66 20 54    # instead of T
3ac0: 4b 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43  K_BUILD_LIB_SPEC
3ad0: 20 73 69 6e 63 65 20 69 74 20 77 69 6c 6c 20 77   since it will w
3ae0: 6f 72 6b 20 77 69 74 68 20 62 6f 74 68 20 61 6e  ork with both an
3af0: 0a 20 20 20 20 23 20 69 6e 73 74 61 6c 6c 65 64  .    # installed
3b00: 20 61 6e 64 20 75 6e 69 6e 73 74 61 6c 6c 65 64   and uninstalled
3b10: 20 76 65 72 73 69 6f 6e 20 6f 66 20 54 63 6c 2e   version of Tcl.
3b20: 0a 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20  .    if test -f 
3b30: 22 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 4d  "${TK_BIN_DIR}/M
3b40: 61 6b 65 66 69 6c 65 22 20 3b 20 74 68 65 6e 0a  akefile" ; then.
3b50: 20 20 20 20 20 20 20 20 54 4b 5f 4c 49 42 5f 53          TK_LIB_S
3b60: 50 45 43 3d 22 24 7b 54 4b 5f 42 55 49 4c 44 5f  PEC="${TK_BUILD_
3b70: 4c 49 42 5f 53 50 45 43 7d 22 0a 20 20 20 20 20  LIB_SPEC}".     
3b80: 20 20 20 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 53     TK_STUB_LIB_S
3b90: 50 45 43 3d 22 24 7b 54 4b 5f 42 55 49 4c 44 5f  PEC="${TK_BUILD_
3ba0: 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 7d 22 0a  STUB_LIB_SPEC}".
3bb0: 20 20 20 20 20 20 20 20 54 4b 5f 53 54 55 42 5f          TK_STUB_
3bc0: 4c 49 42 5f 50 41 54 48 3d 22 24 7b 54 4b 5f 42  LIB_PATH="${TK_B
3bd0: 55 49 4c 44 5f 53 54 55 42 5f 4c 49 42 5f 50 41  UILD_STUB_LIB_PA
3be0: 54 48 7d 22 0a 20 20 20 20 65 6c 69 66 20 74 65  TH}".    elif te
3bf0: 73 74 20 22 60 75 6e 61 6d 65 20 2d 73 60 22 20  st "`uname -s`" 
3c00: 3d 20 22 44 61 72 77 69 6e 22 3b 20 74 68 65 6e  = "Darwin"; then
3c10: 0a 09 23 20 49 66 20 54 6b 20 77 61 73 20 62 75  ..# If Tk was bu
3c20: 69 6c 74 20 61 73 20 61 20 66 72 61 6d 65 77 6f  ilt as a framewo
3c30: 72 6b 2c 20 61 74 74 65 6d 70 74 20 74 6f 20 75  rk, attempt to u
3c40: 73 65 20 74 68 65 20 6c 69 62 72 61 72 69 65 73  se the libraries
3c50: 0a 09 23 20 66 72 6f 6d 20 74 68 65 20 66 72 61  ..# from the fra
3c60: 6d 65 77 6f 72 6b 20 61 74 20 74 68 65 20 67 69  mework at the gi
3c70: 76 65 6e 20 6c 6f 63 61 74 69 6f 6e 20 73 6f 20  ven location so 
3c80: 74 68 61 74 20 6c 69 6e 6b 69 6e 67 20 77 6f 72  that linking wor
3c90: 6b 73 0a 09 23 20 61 67 61 69 6e 73 74 20 54 6b  ks..# against Tk
3ca0: 2e 66 72 61 6d 65 77 6f 72 6b 20 69 6e 73 74 61  .framework insta
3cb0: 6c 6c 65 64 20 69 6e 20 61 6e 20 61 72 62 69 74  lled in an arbit
3cc0: 72 61 72 79 20 6c 6f 63 61 74 69 6f 6e 2e 0a 09  rary location...
3cd0: 63 61 73 65 20 24 7b 54 4b 5f 44 45 46 53 7d 20  case ${TK_DEFS} 
3ce0: 69 6e 0a 09 20 20 20 20 2a 54 4b 5f 46 52 41 4d  in..    *TK_FRAM
3cf0: 45 57 4f 52 4b 2a 29 0a 09 09 69 66 20 74 65 73  EWORK*)...if tes
3d00: 74 20 2d 66 20 22 24 7b 54 4b 5f 42 49 4e 5f 44  t -f "${TK_BIN_D
3d10: 49 52 7d 2f 24 7b 54 4b 5f 4c 49 42 5f 46 49 4c  IR}/${TK_LIB_FIL
3d20: 45 7d 22 3b 20 74 68 65 6e 0a 09 09 20 20 20 20  E}"; then...    
3d30: 66 6f 72 20 69 20 69 6e 20 22 60 63 64 20 22 24  for i in "`cd "$
3d40: 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 22 3b 20 70  {TK_BIN_DIR}"; p
3d50: 77 64 60 22 20 5c 0a 09 09 09 20 20 20 20 20 22  wd`" \....     "
3d60: 60 63 64 20 22 24 7b 54 4b 5f 42 49 4e 5f 44 49  `cd "${TK_BIN_DI
3d70: 52 7d 22 2f 2e 2e 2f 2e 2e 3b 20 70 77 64 60 22  R}"/../..; pwd`"
3d80: 3b 20 64 6f 0a 09 09 09 69 66 20 74 65 73 74 20  ; do....if test 
3d90: 22 60 62 61 73 65 6e 61 6d 65 20 22 24 69 22 60  "`basename "$i"`
3da0: 22 20 3d 20 22 24 7b 54 4b 5f 4c 49 42 5f 46 49  " = "${TK_LIB_FI
3db0: 4c 45 7d 2e 66 72 61 6d 65 77 6f 72 6b 22 3b 20  LE}.framework"; 
3dc0: 74 68 65 6e 0a 09 09 09 20 20 20 20 54 4b 5f 4c  then....    TK_L
3dd0: 49 42 5f 53 50 45 43 3d 22 2d 46 60 64 69 72 6e  IB_SPEC="-F`dirn
3de0: 61 6d 65 20 22 24 69 22 20 7c 20 73 65 64 20 2d  ame "$i" | sed -
3df0: 65 20 27 73 2f 20 2f 5c 5c 5c 5c 20 2f 67 27 60  e 's/ /\\\\ /g'`
3e00: 20 2d 66 72 61 6d 65 77 6f 72 6b 20 24 7b 54 4b   -framework ${TK
3e10: 5f 4c 49 42 5f 46 49 4c 45 7d 22 0a 09 09 09 20  _LIB_FILE}".... 
3e20: 20 20 20 62 72 65 61 6b 0a 09 09 09 66 69 0a 09     break....fi..
3e30: 09 20 20 20 20 64 6f 6e 65 0a 09 09 66 69 0a 09  .    done...fi..
3e40: 09 69 66 20 74 65 73 74 20 2d 66 20 22 24 7b 54  .if test -f "${T
3e50: 4b 5f 42 49 4e 5f 44 49 52 7d 2f 24 7b 54 4b 5f  K_BIN_DIR}/${TK_
3e60: 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 7d 22 3b  STUB_LIB_FILE}";
3e70: 20 74 68 65 6e 0a 09 09 20 20 20 20 54 4b 5f 53   then...    TK_S
3e80: 54 55 42 5f 4c 49 42 5f 53 50 45 43 3d 22 2d 4c  TUB_LIB_SPEC="-L
3e90: 60 20 65 63 68 6f 20 22 24 7b 54 4b 5f 42 49 4e  ` echo "${TK_BIN
3ea0: 5f 44 49 52 7d 22 20 20 7c 20 73 65 64 20 2d 65  _DIR}"  | sed -e
3eb0: 20 27 73 2f 20 2f 5c 5c 5c 5c 20 2f 67 27 60 20   's/ /\\\\ /g'` 
3ec0: 24 7b 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 4c  ${TK_STUB_LIB_FL
3ed0: 41 47 7d 22 0a 09 09 20 20 20 20 54 4b 5f 53 54  AG}"...    TK_ST
3ee0: 55 42 5f 4c 49 42 5f 50 41 54 48 3d 22 24 7b 54  UB_LIB_PATH="${T
3ef0: 4b 5f 42 49 4e 5f 44 49 52 7d 2f 24 7b 54 4b 5f  K_BIN_DIR}/${TK_
3f00: 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 7d 22 0a  STUB_LIB_FILE}".
3f10: 09 09 66 69 0a 09 09 3b 3b 0a 09 65 73 61 63 0a  ..fi...;;..esac.
3f20: 20 20 20 20 66 69 0a 0a 20 20 20 20 23 20 65 76      fi..    # ev
3f30: 61 6c 20 69 73 20 72 65 71 75 69 72 65 64 20 74  al is required t
3f40: 6f 20 64 6f 20 74 68 65 20 54 4b 5f 44 42 47 58  o do the TK_DBGX
3f50: 20 73 75 62 73 74 69 74 75 74 69 6f 6e 0a 20 20   substitution.  
3f60: 20 20 65 76 61 6c 20 22 54 4b 5f 4c 49 42 5f 46    eval "TK_LIB_F
3f70: 4c 41 47 3d 5c 22 24 7b 54 4b 5f 4c 49 42 5f 46  LAG=\"${TK_LIB_F
3f80: 4c 41 47 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c  LAG}\"".    eval
3f90: 20 22 54 4b 5f 4c 49 42 5f 53 50 45 43 3d 5c 22   "TK_LIB_SPEC=\"
3fa0: 24 7b 54 4b 5f 4c 49 42 5f 53 50 45 43 7d 5c 22  ${TK_LIB_SPEC}\"
3fb0: 22 0a 20 20 20 20 65 76 61 6c 20 22 54 4b 5f 53  ".    eval "TK_S
3fc0: 54 55 42 5f 4c 49 42 5f 46 4c 41 47 3d 5c 22 24  TUB_LIB_FLAG=\"$
3fd0: 7b 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41  {TK_STUB_LIB_FLA
3fe0: 47 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c 20 22  G}\"".    eval "
3ff0: 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43  TK_STUB_LIB_SPEC
4000: 3d 5c 22 24 7b 54 4b 5f 53 54 55 42 5f 4c 49 42  =\"${TK_STUB_LIB
4010: 5f 53 50 45 43 7d 5c 22 22 0a 0a 20 20 20 20 23  _SPEC}\""..    #
4020: 20 54 45 41 20 73 70 65 63 69 66 69 63 3a 20 45   TEA specific: E
4030: 6e 73 75 72 65 20 77 69 6e 64 6f 77 69 6e 67 73  nsure windowings
4040: 79 73 74 65 6d 20 69 73 20 64 65 66 69 6e 65 64  ystem is defined
4050: 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b  .    if test "${
4060: 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d  TEA_PLATFORM}" =
4070: 20 22 75 6e 69 78 22 20 3b 20 74 68 65 6e 0a 09   "unix" ; then..
4080: 63 61 73 65 20 24 7b 54 4b 5f 44 45 46 53 7d 20  case ${TK_DEFS} 
4090: 69 6e 0a 09 20 20 20 20 2a 4d 41 43 5f 4f 53 58  in..    *MAC_OSX
40a0: 5f 54 4b 2a 29 0a 09 09 41 43 5f 44 45 46 49 4e  _TK*)...AC_DEFIN
40b0: 45 28 4d 41 43 5f 4f 53 58 5f 54 4b 2c 20 31 2c  E(MAC_OSX_TK, 1,
40c0: 20 5b 41 72 65 20 77 65 20 62 75 69 6c 64 69 6e   [Are we buildin
40d0: 67 20 61 67 61 69 6e 73 74 20 4d 61 63 20 4f 53  g against Mac OS
40e0: 20 58 20 54 6b 41 71 75 61 3f 5d 29 0a 09 09 54   X TkAqua?])...T
40f0: 45 41 5f 57 49 4e 44 4f 57 49 4e 47 53 59 53 54  EA_WINDOWINGSYST
4100: 45 4d 3d 22 61 71 75 61 22 0a 09 09 3b 3b 0a 09  EM="aqua"...;;..
4110: 20 20 20 20 2a 29 0a 09 09 54 45 41 5f 57 49 4e      *)...TEA_WIN
4120: 44 4f 57 49 4e 47 53 59 53 54 45 4d 3d 22 78 31  DOWINGSYSTEM="x1
4130: 31 22 0a 09 09 3b 3b 0a 09 65 73 61 63 0a 20 20  1"...;;..esac.  
4140: 20 20 65 6c 69 66 20 74 65 73 74 20 22 24 7b 54    elif test "${T
4150: 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20  EA_PLATFORM}" = 
4160: 22 77 69 6e 64 6f 77 73 22 20 3b 20 74 68 65 6e  "windows" ; then
4170: 0a 09 54 45 41 5f 57 49 4e 44 4f 57 49 4e 47 53  ..TEA_WINDOWINGS
4180: 59 53 54 45 4d 3d 22 77 69 6e 33 32 22 0a 20 20  YSTEM="win32".  
4190: 20 20 66 69 0a 0a 20 20 20 20 41 43 5f 53 55 42    fi..    AC_SUB
41a0: 53 54 28 54 4b 5f 56 45 52 53 49 4f 4e 29 0a 20  ST(TK_VERSION). 
41b0: 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b 5f 42     AC_SUBST(TK_B
41c0: 49 4e 5f 44 49 52 29 0a 20 20 20 20 41 43 5f 53  IN_DIR).    AC_S
41d0: 55 42 53 54 28 54 4b 5f 53 52 43 5f 44 49 52 29  UBST(TK_SRC_DIR)
41e0: 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54  ..    AC_SUBST(T
41f0: 4b 5f 4c 49 42 5f 46 49 4c 45 29 0a 20 20 20 20  K_LIB_FILE).    
4200: 41 43 5f 53 55 42 53 54 28 54 4b 5f 4c 49 42 5f  AC_SUBST(TK_LIB_
4210: 46 4c 41 47 29 0a 20 20 20 20 41 43 5f 53 55 42  FLAG).    AC_SUB
4220: 53 54 28 54 4b 5f 4c 49 42 5f 53 50 45 43 29 0a  ST(TK_LIB_SPEC).
4230: 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b  .    AC_SUBST(TK
4240: 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 29 0a  _STUB_LIB_FILE).
4250: 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b 5f      AC_SUBST(TK_
4260: 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 29 0a 20  STUB_LIB_FLAG). 
4270: 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b 5f 53     AC_SUBST(TK_S
4280: 54 55 42 5f 4c 49 42 5f 53 50 45 43 29 0a 0a 20  TUB_LIB_SPEC).. 
4290: 20 20 20 23 20 54 45 41 20 73 70 65 63 69 66 69     # TEA specifi
42a0: 63 3a 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  c:.    AC_SUBST(
42b0: 54 4b 5f 4c 49 42 53 29 0a 20 20 20 20 41 43 5f  TK_LIBS).    AC_
42c0: 53 55 42 53 54 28 54 4b 5f 58 49 4e 43 4c 55 44  SUBST(TK_XINCLUD
42d0: 45 53 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  ES).])..#-------
42e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
42f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4310: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4320: 2d 0a 23 20 54 45 41 5f 50 52 4f 47 5f 54 43 4c  -.# TEA_PROG_TCL
4330: 53 48 0a 23 09 44 65 74 65 72 6d 69 6e 65 20 74  SH.#.Determine t
4340: 68 65 20 66 75 6c 6c 79 20 71 75 61 6c 69 66 69  he fully qualifi
4350: 65 64 20 70 61 74 68 20 6e 61 6d 65 20 6f 66 20  ed path name of 
4360: 74 68 65 20 74 63 6c 73 68 20 65 78 65 63 75 74  the tclsh execut
4370: 61 62 6c 65 0a 23 09 69 6e 20 74 68 65 20 54 63  able.#.in the Tc
4380: 6c 20 62 75 69 6c 64 20 64 69 72 65 63 74 6f 72  l build director
4390: 79 20 6f 72 20 74 68 65 20 74 63 6c 73 68 20 69  y or the tclsh i
43a0: 6e 73 74 61 6c 6c 65 64 20 69 6e 20 61 20 62 69  nstalled in a bi
43b0: 6e 0a 23 09 64 69 72 65 63 74 6f 72 79 2e 20 54  n.#.directory. T
43c0: 68 69 73 20 6d 61 63 72 6f 20 77 69 6c 6c 20 63  his macro will c
43d0: 6f 72 72 65 63 74 6c 79 20 64 65 74 65 72 6d 69  orrectly determi
43e0: 6e 65 20 74 68 65 20 6e 61 6d 65 0a 23 09 6f 66  ne the name.#.of
43f0: 20 74 68 65 20 74 63 6c 73 68 20 65 78 65 63 75   the tclsh execu
4400: 74 61 62 6c 65 20 65 76 65 6e 20 69 66 20 74 63  table even if tc
4410: 6c 73 68 20 68 61 73 20 6e 6f 74 20 79 65 74 20  lsh has not yet 
4420: 62 65 65 6e 0a 23 09 62 75 69 6c 74 20 69 6e 20  been.#.built in 
4430: 74 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 74  the build direct
4440: 6f 72 79 2e 20 54 68 65 20 74 63 6c 73 68 20 66  ory. The tclsh f
4450: 6f 75 6e 64 20 69 73 20 61 6c 77 61 79 73 0a 23  ound is always.#
4460: 09 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68  .associated with
4470: 20 61 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68 20   a tclConfig.sh 
4480: 66 69 6c 65 2e 20 54 68 69 73 20 74 63 6c 73 68  file. This tclsh
4490: 20 73 68 6f 75 6c 64 20 62 65 20 75 73 65 64 0a   should be used.
44a0: 23 09 6f 6e 6c 79 20 66 6f 72 20 72 75 6e 6e 69  #.only for runni
44b0: 6e 67 20 65 78 74 65 6e 73 69 6f 6e 20 74 65 73  ng extension tes
44c0: 74 20 63 61 73 65 73 2e 20 49 74 20 73 68 6f 75  t cases. It shou
44d0: 6c 64 20 6e 65 76 65 72 20 62 65 0a 23 09 6f 72  ld never be.#.or
44e0: 20 67 65 6e 65 72 61 74 69 6f 6e 20 6f 66 20 66   generation of f
44f0: 69 6c 65 73 20 28 6c 69 6b 65 20 70 6b 67 49 6e  iles (like pkgIn
4500: 64 65 78 2e 74 63 6c 29 20 61 74 20 62 75 69 6c  dex.tcl) at buil
4510: 64 20 74 69 6d 65 2e 0a 23 0a 23 20 41 72 67 75  d time..#.# Argu
4520: 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a  ments:.#.none.#.
4530: 23 20 52 65 73 75 6c 74 73 3a 0a 23 09 53 75 62  # Results:.#.Sub
4540: 73 74 69 74 75 74 65 73 20 74 68 65 20 66 6f 6c  stitutes the fol
4550: 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
4560: 54 43 4c 53 48 5f 50 52 4f 47 0a 23 2d 2d 2d 2d  TCLSH_PROG.#----
4570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4590: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
45a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
45b0: 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b  ----..AC_DEFUN([
45c0: 54 45 41 5f 50 52 4f 47 5f 54 43 4c 53 48 5d 2c  TEA_PROG_TCLSH],
45d0: 20 5b 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43 48   [.    AC_MSG_CH
45e0: 45 43 4b 49 4e 47 28 5b 66 6f 72 20 74 63 6c 73  ECKING([for tcls
45f0: 68 5d 29 0a 20 20 20 20 69 66 20 74 65 73 74 20  h]).    if test 
4600: 2d 66 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49  -f "${TCL_BIN_DI
4610: 52 7d 2f 4d 61 6b 65 66 69 6c 65 22 20 3b 20 74  R}/Makefile" ; t
4620: 68 65 6e 0a 20 20 20 20 20 20 20 20 23 20 74 63  hen.        # tc
4630: 6c 43 6f 6e 66 69 67 2e 73 68 20 69 73 20 69 6e  lConfig.sh is in
4640: 20 54 63 6c 20 62 75 69 6c 64 20 64 69 72 65 63   Tcl build direc
4650: 74 6f 72 79 0a 20 20 20 20 20 20 20 20 69 66 20  tory.        if 
4660: 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54  test "${TEA_PLAT
4670: 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77  FORM}" = "window
4680: 73 22 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  s"; then.       
4690: 20 20 20 20 20 54 43 4c 53 48 5f 50 52 4f 47 3d       TCLSH_PROG=
46a0: 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f  "${TCL_BIN_DIR}/
46b0: 74 63 6c 73 68 24 7b 54 43 4c 5f 4d 41 4a 4f 52  tclsh${TCL_MAJOR
46c0: 5f 56 45 52 53 49 4f 4e 7d 24 7b 54 43 4c 5f 4d  _VERSION}${TCL_M
46d0: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 7d 24 7b 54  INOR_VERSION}${T
46e0: 43 4c 5f 44 42 47 58 7d 24 7b 45 58 45 45 58 54  CL_DBGX}${EXEEXT
46f0: 7d 22 0a 20 20 20 20 20 20 20 20 65 6c 73 65 0a  }".        else.
4700: 20 20 20 20 20 20 20 20 20 20 20 20 54 43 4c 53              TCLS
4710: 48 5f 50 52 4f 47 3d 22 24 7b 54 43 4c 5f 42 49  H_PROG="${TCL_BI
4720: 4e 5f 44 49 52 7d 2f 74 63 6c 73 68 22 0a 20 20  N_DIR}/tclsh".  
4730: 20 20 20 20 20 20 66 69 0a 20 20 20 20 65 6c 73        fi.    els
4740: 65 0a 20 20 20 20 20 20 20 20 23 20 74 63 6c 43  e.        # tclC
4750: 6f 6e 66 69 67 2e 73 68 20 69 73 20 69 6e 20 69  onfig.sh is in i
4760: 6e 73 74 61 6c 6c 20 6c 6f 63 61 74 69 6f 6e 0a  nstall location.
4770: 20 20 20 20 20 20 20 20 69 66 20 74 65 73 74 20          if test 
4780: 22 24 7b 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d  "${TEA_PLATFORM}
4790: 22 20 3d 20 22 77 69 6e 64 6f 77 73 22 3b 20 74  " = "windows"; t
47a0: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
47b0: 54 43 4c 53 48 5f 50 52 4f 47 3d 22 74 63 6c 73  TCLSH_PROG="tcls
47c0: 68 24 7b 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52  h${TCL_MAJOR_VER
47d0: 53 49 4f 4e 7d 24 7b 54 43 4c 5f 4d 49 4e 4f 52  SION}${TCL_MINOR
47e0: 5f 56 45 52 53 49 4f 4e 7d 24 7b 54 43 4c 5f 44  _VERSION}${TCL_D
47f0: 42 47 58 7d 24 7b 45 58 45 45 58 54 7d 22 0a 20  BGX}${EXEEXT}". 
4800: 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20         else.    
4810: 20 20 20 20 20 20 20 20 54 43 4c 53 48 5f 50 52          TCLSH_PR
4820: 4f 47 3d 22 74 63 6c 73 68 24 7b 54 43 4c 5f 4d  OG="tclsh${TCL_M
4830: 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 7d 2e 24 7b  AJOR_VERSION}.${
4840: 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f  TCL_MINOR_VERSIO
4850: 4e 7d 24 7b 54 43 4c 5f 44 42 47 58 7d 22 0a 20  N}${TCL_DBGX}". 
4860: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
4870: 20 20 6c 69 73 74 3d 22 60 6c 73 20 2d 64 20 24    list="`ls -d $
4880: 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 2e 2e  {TCL_BIN_DIR}/..
4890: 2f 62 69 6e 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  /bin 2>/dev/null
48a0: 60 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20  ` \.            
48b0: 20 20 60 6c 73 20 2d 64 20 24 7b 54 43 4c 5f 42    `ls -d ${TCL_B
48c0: 49 4e 5f 44 49 52 7d 2f 2e 2e 20 20 20 20 20 32  IN_DIR}/..     2
48d0: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 20 20  >/dev/null` \.  
48e0: 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 20              `ls 
48f0: 2d 64 20 24 7b 54 43 4c 5f 50 52 45 46 49 58 7d  -d ${TCL_PREFIX}
4900: 2f 62 69 6e 20 20 20 20 20 32 3e 2f 64 65 76 2f  /bin     2>/dev/
4910: 6e 75 6c 6c 60 22 0a 20 20 20 20 20 20 20 20 66  null`".        f
4920: 6f 72 20 69 20 69 6e 20 24 6c 69 73 74 20 3b 20  or i in $list ; 
4930: 64 6f 0a 20 20 20 20 20 20 20 20 20 20 20 20 69  do.            i
4940: 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 24 7b  f test -f "$i/${
4950: 54 43 4c 53 48 5f 50 52 4f 47 7d 22 20 3b 20 74  TCLSH_PROG}" ; t
4960: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
4970: 20 20 20 20 52 45 41 4c 5f 54 43 4c 5f 42 49 4e      REAL_TCL_BIN
4980: 5f 44 49 52 3d 22 60 63 64 20 22 24 69 22 3b 20  _DIR="`cd "$i"; 
4990: 70 77 64 60 2f 22 0a 20 20 20 20 20 20 20 20 20  pwd`/".         
49a0: 20 20 20 20 20 20 20 62 72 65 61 6b 0a 20 20 20         break.   
49b0: 20 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20           fi.    
49c0: 20 20 20 20 64 6f 6e 65 0a 20 20 20 20 20 20 20      done.       
49d0: 20 54 43 4c 53 48 5f 50 52 4f 47 3d 22 24 7b 52   TCLSH_PROG="${R
49e0: 45 41 4c 5f 54 43 4c 5f 42 49 4e 5f 44 49 52 7d  EAL_TCL_BIN_DIR}
49f0: 24 7b 54 43 4c 53 48 5f 50 52 4f 47 7d 22 0a 20  ${TCLSH_PROG}". 
4a00: 20 20 20 66 69 0a 20 20 20 20 41 43 5f 4d 53 47     fi.    AC_MSG
4a10: 5f 52 45 53 55 4c 54 28 5b 24 7b 54 43 4c 53 48  _RESULT([${TCLSH
4a20: 5f 50 52 4f 47 7d 5d 29 0a 20 20 20 20 41 43 5f  _PROG}]).    AC_
4a30: 53 55 42 53 54 28 54 43 4c 53 48 5f 50 52 4f 47  SUBST(TCLSH_PROG
4a40: 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ).])..#---------
4a50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4a60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4a70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4a80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
4a90: 23 20 54 45 41 5f 50 52 4f 47 5f 57 49 53 48 0a  # TEA_PROG_WISH.
4aa0: 23 09 44 65 74 65 72 6d 69 6e 65 20 74 68 65 20  #.Determine the 
4ab0: 66 75 6c 6c 79 20 71 75 61 6c 69 66 69 65 64 20  fully qualified 
4ac0: 70 61 74 68 20 6e 61 6d 65 20 6f 66 20 74 68 65  path name of the
4ad0: 20 77 69 73 68 20 65 78 65 63 75 74 61 62 6c 65   wish executable
4ae0: 0a 23 09 69 6e 20 74 68 65 20 54 6b 20 62 75 69  .#.in the Tk bui
4af0: 6c 64 20 64 69 72 65 63 74 6f 72 79 20 6f 72 20  ld directory or 
4b00: 74 68 65 20 77 69 73 68 20 69 6e 73 74 61 6c 6c  the wish install
4b10: 65 64 20 69 6e 20 61 20 62 69 6e 0a 23 09 64 69  ed in a bin.#.di
4b20: 72 65 63 74 6f 72 79 2e 20 54 68 69 73 20 6d 61  rectory. This ma
4b30: 63 72 6f 20 77 69 6c 6c 20 63 6f 72 72 65 63 74  cro will correct
4b40: 6c 79 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65  ly determine the
4b50: 20 6e 61 6d 65 0a 23 09 6f 66 20 74 68 65 20 77   name.#.of the w
4b60: 69 73 68 20 65 78 65 63 75 74 61 62 6c 65 20 65  ish executable e
4b70: 76 65 6e 20 69 66 20 77 69 73 68 20 68 61 73 20  ven if wish has 
4b80: 6e 6f 74 20 79 65 74 20 62 65 65 6e 0a 23 09 62  not yet been.#.b
4b90: 75 69 6c 74 20 69 6e 20 74 68 65 20 62 75 69 6c  uilt in the buil
4ba0: 64 20 64 69 72 65 63 74 6f 72 79 2e 20 54 68 65  d directory. The
4bb0: 20 77 69 73 68 20 66 6f 75 6e 64 20 69 73 20 61   wish found is a
4bc0: 6c 77 61 79 73 0a 23 09 61 73 73 6f 63 69 61 74  lways.#.associat
4bd0: 65 64 20 77 69 74 68 20 61 20 74 6b 43 6f 6e 66  ed with a tkConf
4be0: 69 67 2e 73 68 20 66 69 6c 65 2e 20 54 68 69 73  ig.sh file. This
4bf0: 20 77 69 73 68 20 73 68 6f 75 6c 64 20 62 65 20   wish should be 
4c00: 75 73 65 64 0a 23 09 6f 6e 6c 79 20 66 6f 72 20  used.#.only for 
4c10: 72 75 6e 6e 69 6e 67 20 65 78 74 65 6e 73 69 6f  running extensio
4c20: 6e 20 74 65 73 74 20 63 61 73 65 73 2e 20 49 74  n test cases. It
4c30: 20 73 68 6f 75 6c 64 20 6e 65 76 65 72 20 62 65   should never be
4c40: 0a 23 09 6f 72 20 67 65 6e 65 72 61 74 69 6f 6e  .#.or generation
4c50: 20 6f 66 20 66 69 6c 65 73 20 28 6c 69 6b 65 20   of files (like 
4c60: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 29 20 61 74  pkgIndex.tcl) at
4c70: 20 62 75 69 6c 64 20 74 69 6d 65 2e 0a 23 0a 23   build time..#.#
4c80: 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f   Arguments:.#.no
4c90: 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a  ne.#.# Results:.
4ca0: 23 09 53 75 62 73 74 69 74 75 74 65 73 20 74 68  #.Substitutes th
4cb0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
4cc0: 3a 0a 23 09 09 57 49 53 48 5f 50 52 4f 47 0a 23  :.#..WISH_PROG.#
4cd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4ce0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4cf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4d00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4d10: 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46  --------..AC_DEF
4d20: 55 4e 28 5b 54 45 41 5f 50 52 4f 47 5f 57 49 53  UN([TEA_PROG_WIS
4d30: 48 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d 53 47  H], [.    AC_MSG
4d40: 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 77  _CHECKING([for w
4d50: 69 73 68 5d 29 0a 20 20 20 20 69 66 20 74 65 73  ish]).    if tes
4d60: 74 20 2d 66 20 22 24 7b 54 4b 5f 42 49 4e 5f 44  t -f "${TK_BIN_D
4d70: 49 52 7d 2f 4d 61 6b 65 66 69 6c 65 22 20 3b 20  IR}/Makefile" ; 
4d80: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 23 20 74  then.        # t
4d90: 6b 43 6f 6e 66 69 67 2e 73 68 20 69 73 20 69 6e  kConfig.sh is in
4da0: 20 54 6b 20 62 75 69 6c 64 20 64 69 72 65 63 74   Tk build direct
4db0: 6f 72 79 0a 20 20 20 20 20 20 20 20 69 66 20 74  ory.        if t
4dc0: 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54 46  est "${TEA_PLATF
4dd0: 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77 73  ORM}" = "windows
4de0: 22 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  "; then.        
4df0: 20 20 20 20 57 49 53 48 5f 50 52 4f 47 3d 22 24      WISH_PROG="$
4e00: 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 77 69 73  {TK_BIN_DIR}/wis
4e10: 68 24 7b 54 4b 5f 4d 41 4a 4f 52 5f 56 45 52 53  h${TK_MAJOR_VERS
4e20: 49 4f 4e 7d 24 7b 54 4b 5f 4d 49 4e 4f 52 5f 56  ION}${TK_MINOR_V
4e30: 45 52 53 49 4f 4e 7d 24 7b 54 4b 5f 44 42 47 58  ERSION}${TK_DBGX
4e40: 7d 24 7b 45 58 45 45 58 54 7d 22 0a 20 20 20 20  }${EXEEXT}".    
4e50: 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20      else.       
4e60: 20 20 20 20 20 57 49 53 48 5f 50 52 4f 47 3d 22       WISH_PROG="
4e70: 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 77 69  ${TK_BIN_DIR}/wi
4e80: 73 68 22 0a 20 20 20 20 20 20 20 20 66 69 0a 20  sh".        fi. 
4e90: 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20     else.        
4ea0: 23 20 74 6b 43 6f 6e 66 69 67 2e 73 68 20 69 73  # tkConfig.sh is
4eb0: 20 69 6e 20 69 6e 73 74 61 6c 6c 20 6c 6f 63 61   in install loca
4ec0: 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 69 66 20  tion.        if 
4ed0: 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54  test "${TEA_PLAT
4ee0: 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77  FORM}" = "window
4ef0: 73 22 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  s"; then.       
4f00: 20 20 20 20 20 57 49 53 48 5f 50 52 4f 47 3d 22       WISH_PROG="
4f10: 77 69 73 68 24 7b 54 4b 5f 4d 41 4a 4f 52 5f 56  wish${TK_MAJOR_V
4f20: 45 52 53 49 4f 4e 7d 24 7b 54 4b 5f 4d 49 4e 4f  ERSION}${TK_MINO
4f30: 52 5f 56 45 52 53 49 4f 4e 7d 24 7b 54 4b 5f 44  R_VERSION}${TK_D
4f40: 42 47 58 7d 24 7b 45 58 45 45 58 54 7d 22 0a 20  BGX}${EXEEXT}". 
4f50: 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20         else.    
4f60: 20 20 20 20 20 20 20 20 57 49 53 48 5f 50 52 4f          WISH_PRO
4f70: 47 3d 22 77 69 73 68 24 7b 54 4b 5f 4d 41 4a 4f  G="wish${TK_MAJO
4f80: 52 5f 56 45 52 53 49 4f 4e 7d 2e 24 7b 54 4b 5f  R_VERSION}.${TK_
4f90: 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 7d 24 7b  MINOR_VERSION}${
4fa0: 54 4b 5f 44 42 47 58 7d 22 0a 20 20 20 20 20 20  TK_DBGX}".      
4fb0: 20 20 66 69 0a 20 20 20 20 20 20 20 20 6c 69 73    fi.        lis
4fc0: 74 3d 22 60 6c 73 20 2d 64 20 24 7b 54 4b 5f 42  t="`ls -d ${TK_B
4fd0: 49 4e 5f 44 49 52 7d 2f 2e 2e 2f 62 69 6e 20 32  IN_DIR}/../bin 2
4fe0: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 20 20  >/dev/null` \.  
4ff0: 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 20              `ls 
5000: 2d 64 20 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d  -d ${TK_BIN_DIR}
5010: 2f 2e 2e 20 20 20 20 20 32 3e 2f 64 65 76 2f 6e  /..     2>/dev/n
5020: 75 6c 6c 60 20 5c 0a 20 20 20 20 20 20 20 20 20  ull` \.         
5030: 20 20 20 20 20 60 6c 73 20 2d 64 20 24 7b 54 4b       `ls -d ${TK
5040: 5f 50 52 45 46 49 58 7d 2f 62 69 6e 20 20 20 20  _PREFIX}/bin    
5050: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20   2>/dev/null`". 
5060: 20 20 20 20 20 20 20 66 6f 72 20 69 20 69 6e 20         for i in 
5070: 24 6c 69 73 74 20 3b 20 64 6f 0a 20 20 20 20 20  $list ; do.     
5080: 20 20 20 20 20 20 20 69 66 20 74 65 73 74 20 2d         if test -
5090: 66 20 22 24 69 2f 24 7b 57 49 53 48 5f 50 52 4f  f "$i/${WISH_PRO
50a0: 47 7d 22 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  G}" ; then.     
50b0: 20 20 20 20 20 20 20 20 20 20 20 52 45 41 4c 5f             REAL_
50c0: 54 4b 5f 42 49 4e 5f 44 49 52 3d 22 60 63 64 20  TK_BIN_DIR="`cd 
50d0: 22 24 69 22 3b 20 70 77 64 60 2f 22 0a 20 20 20  "$i"; pwd`/".   
50e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65               bre
50f0: 61 6b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  ak.            f
5100: 69 0a 20 20 20 20 20 20 20 20 64 6f 6e 65 0a 20  i.        done. 
5110: 20 20 20 20 20 20 20 57 49 53 48 5f 50 52 4f 47         WISH_PROG
5120: 3d 22 24 7b 52 45 41 4c 5f 54 4b 5f 42 49 4e 5f  ="${REAL_TK_BIN_
5130: 44 49 52 7d 24 7b 57 49 53 48 5f 50 52 4f 47 7d  DIR}${WISH_PROG}
5140: 22 0a 20 20 20 20 66 69 0a 20 20 20 20 41 43 5f  ".    fi.    AC_
5150: 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 7b 57 49  MSG_RESULT([${WI
5160: 53 48 5f 50 52 4f 47 7d 5d 29 0a 20 20 20 20 41  SH_PROG}]).    A
5170: 43 5f 53 55 42 53 54 28 57 49 53 48 5f 50 52 4f  C_SUBST(WISH_PRO
5180: 47 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  G).])..#--------
5190: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
51a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
51b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
51c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
51d0: 0a 23 20 54 45 41 5f 45 4e 41 42 4c 45 5f 53 48  .# TEA_ENABLE_SH
51e0: 41 52 45 44 20 2d 2d 0a 23 0a 23 09 41 6c 6c 6f  ARED --.#.#.Allo
51f0: 77 73 20 74 68 65 20 62 75 69 6c 64 69 6e 67 20  ws the building 
5200: 6f 66 20 73 68 61 72 65 64 20 6c 69 62 72 61 72  of shared librar
5210: 69 65 73 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74  ies.#.# Argument
5220: 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65  s:.#.none.#.# Re
5230: 73 75 6c 74 73 3a 0a 23 0a 23 09 41 64 64 73 20  sults:.#.#.Adds 
5240: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72  the following ar
5250: 67 75 6d 65 6e 74 73 20 74 6f 20 63 6f 6e 66 69  guments to confi
5260: 67 75 72 65 3a 0a 23 09 09 2d 2d 65 6e 61 62 6c  gure:.#..--enabl
5270: 65 2d 73 68 61 72 65 64 3d 79 65 73 7c 6e 6f 0a  e-shared=yes|no.
5280: 23 0a 23 09 44 65 66 69 6e 65 73 20 74 68 65 20  #.#.Defines the 
5290: 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a  following vars:.
52a0: 23 09 09 53 54 41 54 49 43 5f 42 55 49 4c 44 09  #..STATIC_BUILD.
52b0: 55 73 65 64 20 66 6f 72 20 62 75 69 6c 64 69 6e  Used for buildin
52c0: 67 20 69 6d 70 6f 72 74 2f 65 78 70 6f 72 74 20  g import/export 
52d0: 6c 69 62 72 61 72 69 65 73 0a 23 09 09 09 09 6f  libraries.#....o
52e0: 6e 20 57 69 6e 64 6f 77 73 2e 0a 23 0a 23 09 53  n Windows..#.#.S
52f0: 65 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e  ets the followin
5300: 67 20 76 61 72 73 3a 0a 23 09 09 53 48 41 52 45  g vars:.#..SHARE
5310: 44 5f 42 55 49 4c 44 09 56 61 6c 75 65 20 6f 66  D_BUILD.Value of
5320: 20 31 20 6f 72 20 30 0a 23 2d 2d 2d 2d 2d 2d 2d   1 or 0.#-------
5330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5340: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5350: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5360: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5370: 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45 41  -..AC_DEFUN([TEA
5380: 5f 45 4e 41 42 4c 45 5f 53 48 41 52 45 44 5d 2c  _ENABLE_SHARED],
5390: 20 5b 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43 48   [.    AC_MSG_CH
53a0: 45 43 4b 49 4e 47 28 5b 68 6f 77 20 74 6f 20 62  ECKING([how to b
53b0: 75 69 6c 64 20 6c 69 62 72 61 72 69 65 73 5d 29  uild libraries])
53c0: 0a 20 20 20 20 41 43 5f 41 52 47 5f 45 4e 41 42  .    AC_ARG_ENAB
53d0: 4c 45 28 73 68 61 72 65 64 2c 0a 09 41 43 5f 48  LE(shared,..AC_H
53e0: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e  ELP_STRING([--en
53f0: 61 62 6c 65 2d 73 68 61 72 65 64 5d 2c 0a 09 20  able-shared],.. 
5400: 20 20 20 5b 62 75 69 6c 64 20 61 6e 64 20 6c 69     [build and li
5410: 6e 6b 20 77 69 74 68 20 73 68 61 72 65 64 20 6c  nk with shared l
5420: 69 62 72 61 72 69 65 73 20 28 64 65 66 61 75 6c  ibraries (defaul
5430: 74 3a 20 6f 6e 29 5d 29 2c 0a 09 5b 74 63 6c 5f  t: on)]),..[tcl_
5440: 6f 6b 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20  ok=$enableval], 
5450: 5b 74 63 6c 5f 6f 6b 3d 79 65 73 5d 29 0a 0a 20  [tcl_ok=yes]).. 
5460: 20 20 20 69 66 20 74 65 73 74 20 22 24 7b 65 6e     if test "${en
5470: 61 62 6c 65 5f 73 68 61 72 65 64 2b 73 65 74 7d  able_shared+set}
5480: 22 20 3d 20 73 65 74 3b 20 74 68 65 6e 0a 09 65  " = set; then..e
5490: 6e 61 62 6c 65 76 61 6c 3d 22 24 65 6e 61 62 6c  nableval="$enabl
54a0: 65 5f 73 68 61 72 65 64 22 0a 09 74 63 6c 5f 6f  e_shared"..tcl_o
54b0: 6b 3d 24 65 6e 61 62 6c 65 76 61 6c 0a 20 20 20  k=$enableval.   
54c0: 20 65 6c 73 65 0a 09 74 63 6c 5f 6f 6b 3d 79 65   else..tcl_ok=ye
54d0: 73 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 69 66  s.    fi..    if
54e0: 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20   test "$tcl_ok" 
54f0: 3d 20 22 79 65 73 22 20 3b 20 74 68 65 6e 0a 09  = "yes" ; then..
5500: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 73  AC_MSG_RESULT([s
5510: 68 61 72 65 64 5d 29 0a 09 53 48 41 52 45 44 5f  hared])..SHARED_
5520: 42 55 49 4c 44 3d 31 0a 20 20 20 20 65 6c 73 65  BUILD=1.    else
5530: 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28  ..AC_MSG_RESULT(
5540: 5b 73 74 61 74 69 63 5d 29 0a 09 53 48 41 52 45  [static])..SHARE
5550: 44 5f 42 55 49 4c 44 3d 30 0a 09 41 43 5f 44 45  D_BUILD=0..AC_DE
5560: 46 49 4e 45 28 53 54 41 54 49 43 5f 42 55 49 4c  FINE(STATIC_BUIL
5570: 44 2c 20 31 2c 20 5b 49 73 20 74 68 69 73 20 61  D, 1, [Is this a
5580: 20 73 74 61 74 69 63 20 62 75 69 6c 64 3f 5d 29   static build?])
5590: 0a 20 20 20 20 66 69 0a 20 20 20 20 41 43 5f 53  .    fi.    AC_S
55a0: 55 42 53 54 28 53 48 41 52 45 44 5f 42 55 49 4c  UBST(SHARED_BUIL
55b0: 44 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  D).])..#--------
55c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
55d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
55e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
55f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5600: 0a 23 20 54 45 41 5f 45 4e 41 42 4c 45 5f 54 48  .# TEA_ENABLE_TH
5610: 52 45 41 44 53 20 2d 2d 0a 23 0a 23 09 53 70 65  READS --.#.#.Spe
5620: 63 69 66 79 20 69 66 20 74 68 72 65 61 64 20 73  cify if thread s
5630: 75 70 70 6f 72 74 20 73 68 6f 75 6c 64 20 62 65  upport should be
5640: 20 65 6e 61 62 6c 65 64 2e 20 20 49 66 20 22 79   enabled.  If "y
5650: 65 73 22 20 69 73 20 73 70 65 63 69 66 69 65 64  es" is specified
5660: 0a 23 09 61 73 20 61 6e 20 61 72 67 20 28 6f 70  .#.as an arg (op
5670: 74 69 6f 6e 61 6c 29 2c 20 74 68 72 65 61 64 73  tional), threads
5680: 20 61 72 65 20 65 6e 61 62 6c 65 64 20 62 79 20   are enabled by 
5690: 64 65 66 61 75 6c 74 2c 20 22 6e 6f 22 20 6d 65  default, "no" me
56a0: 61 6e 73 0a 23 09 74 68 72 65 61 64 73 20 61 72  ans.#.threads ar
56b0: 65 20 64 69 73 61 62 6c 65 64 2e 20 20 22 79 65  e disabled.  "ye
56c0: 73 22 20 69 73 20 74 68 65 20 64 65 66 61 75 6c  s" is the defaul
56d0: 74 2e 0a 23 0a 23 09 54 43 4c 5f 54 48 52 45 41  t..#.#.TCL_THREA
56e0: 44 53 20 69 73 20 63 68 65 63 6b 65 64 20 73 6f  DS is checked so
56f0: 20 74 68 61 74 20 69 66 20 79 6f 75 20 61 72 65   that if you are
5700: 20 63 6f 6d 70 69 6c 69 6e 67 20 61 6e 20 65 78   compiling an ex
5710: 74 65 6e 73 69 6f 6e 0a 23 09 61 67 61 69 6e 73  tension.#.agains
5720: 74 20 61 20 74 68 72 65 61 64 65 64 20 63 6f 72  t a threaded cor
5730: 65 2c 20 79 6f 75 72 20 65 78 74 65 6e 73 69 6f  e, your extensio
5740: 6e 20 6d 75 73 74 20 62 65 20 63 6f 6d 70 69 6c  n must be compil
5750: 65 64 20 74 68 72 65 61 64 65 64 0a 23 09 61 73  ed threaded.#.as
5760: 20 77 65 6c 6c 2e 0a 23 0a 23 09 4e 6f 74 65 20   well..#.#.Note 
5770: 74 68 61 74 20 69 74 20 69 73 20 6c 65 67 61 6c  that it is legal
5780: 20 74 6f 20 68 61 76 65 20 61 20 74 68 72 65 61   to have a threa
5790: 64 20 65 6e 61 62 6c 65 64 20 65 78 74 65 6e 73  d enabled extens
57a0: 69 6f 6e 20 72 75 6e 20 69 6e 20 61 0a 23 09 74  ion run in a.#.t
57b0: 68 72 65 61 64 65 64 20 6f 72 20 6e 6f 6e 2d 74  hreaded or non-t
57c0: 68 72 65 61 64 65 64 20 54 63 6c 20 63 6f 72 65  hreaded Tcl core
57d0: 2c 20 62 75 74 20 61 20 6e 6f 6e 2d 74 68 72 65  , but a non-thre
57e0: 61 64 65 64 20 65 78 74 65 6e 73 69 6f 6e 20 6d  aded extension m
57f0: 61 79 0a 23 09 6f 6e 6c 79 20 72 75 6e 20 69 6e  ay.#.only run in
5800: 20 61 20 6e 6f 6e 2d 74 68 72 65 61 64 65 64 20   a non-threaded 
5810: 54 63 6c 20 63 6f 72 65 2e 0a 23 0a 23 20 41 72  Tcl core..#.# Ar
5820: 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a  guments:.#.none.
5830: 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23  #.# Results:.#.#
5840: 09 41 64 64 73 20 74 68 65 20 66 6f 6c 6c 6f 77  .Adds the follow
5850: 69 6e 67 20 61 72 67 75 6d 65 6e 74 73 20 74 6f  ing arguments to
5860: 20 63 6f 6e 66 69 67 75 72 65 3a 0a 23 09 09 2d   configure:.#..-
5870: 2d 65 6e 61 62 6c 65 2d 74 68 72 65 61 64 73 0a  -enable-threads.
5880: 23 0a 23 09 53 65 74 73 20 74 68 65 20 66 6f 6c  #.#.Sets the fol
5890: 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
58a0: 54 48 52 45 41 44 53 5f 4c 49 42 53 09 54 68 72  THREADS_LIBS.Thr
58b0: 65 61 64 20 6c 69 62 72 61 72 79 28 73 29 0a 23  ead library(s).#
58c0: 0a 23 09 44 65 66 69 6e 65 73 20 74 68 65 20 66  .#.Defines the f
58d0: 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23  ollowing vars:.#
58e0: 09 09 54 43 4c 5f 54 48 52 45 41 44 53 0a 23 09  ..TCL_THREADS.#.
58f0: 09 5f 52 45 45 4e 54 52 41 4e 54 0a 23 09 09 5f  ._REENTRANT.#.._
5900: 54 48 52 45 41 44 5f 53 41 46 45 0a 23 2d 2d 2d  THREAD_SAFE.#---
5910: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5920: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5930: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5940: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5950: 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28  -----..AC_DEFUN(
5960: 5b 54 45 41 5f 45 4e 41 42 4c 45 5f 54 48 52 45  [TEA_ENABLE_THRE
5970: 41 44 53 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 41  ADS], [.    AC_A
5980: 52 47 5f 45 4e 41 42 4c 45 28 74 68 72 65 61 64  RG_ENABLE(thread
5990: 73 2c 0a 09 41 43 5f 48 45 4c 50 5f 53 54 52 49  s,..AC_HELP_STRI
59a0: 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 74 68 72  NG([--enable-thr
59b0: 65 61 64 73 5d 2c 0a 09 20 20 20 20 5b 62 75 69  eads],..    [bui
59c0: 6c 64 20 77 69 74 68 20 74 68 72 65 61 64 73 5d  ld with threads]
59d0: 29 2c 0a 09 5b 74 63 6c 5f 6f 6b 3d 24 65 6e 61  ),..[tcl_ok=$ena
59e0: 62 6c 65 76 61 6c 5d 2c 20 5b 74 63 6c 5f 6f 6b  bleval], [tcl_ok
59f0: 3d 79 65 73 5d 29 0a 0a 20 20 20 20 69 66 20 74  =yes])..    if t
5a00: 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 5f 74 68  est "${enable_th
5a10: 72 65 61 64 73 2b 73 65 74 7d 22 20 3d 20 73 65  reads+set}" = se
5a20: 74 3b 20 74 68 65 6e 0a 09 65 6e 61 62 6c 65 76  t; then..enablev
5a30: 61 6c 3d 22 24 65 6e 61 62 6c 65 5f 74 68 72 65  al="$enable_thre
5a40: 61 64 73 22 0a 09 74 63 6c 5f 6f 6b 3d 24 65 6e  ads"..tcl_ok=$en
5a50: 61 62 6c 65 76 61 6c 0a 20 20 20 20 65 6c 73 65  ableval.    else
5a60: 0a 09 74 63 6c 5f 6f 6b 3d 79 65 73 0a 20 20 20  ..tcl_ok=yes.   
5a70: 20 66 69 0a 0a 20 20 20 20 69 66 20 74 65 73 74   fi..    if test
5a80: 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 22 79 65   "$tcl_ok" = "ye
5a90: 73 22 20 2d 6f 20 22 24 7b 54 43 4c 5f 54 48 52  s" -o "${TCL_THR
5aa0: 45 41 44 53 7d 22 20 3d 20 31 3b 20 74 68 65 6e  EADS}" = 1; then
5ab0: 0a 09 54 43 4c 5f 54 48 52 45 41 44 53 3d 31 0a  ..TCL_THREADS=1.
5ac0: 0a 09 69 66 20 74 65 73 74 20 22 24 7b 54 45 41  ..if test "${TEA
5ad0: 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 21 3d 20 22  _PLATFORM}" != "
5ae0: 77 69 6e 64 6f 77 73 22 20 3b 20 74 68 65 6e 0a  windows" ; then.
5af0: 09 20 20 20 20 23 20 57 65 20 61 72 65 20 61 6c  .    # We are al
5b00: 77 61 79 73 20 4f 4b 20 6f 6e 20 57 69 6e 64 6f  ways OK on Windo
5b10: 77 73 2c 20 73 6f 20 63 68 65 63 6b 20 77 68 61  ws, so check wha
5b20: 74 20 74 68 69 73 20 70 6c 61 74 66 6f 72 6d 20  t this platform 
5b30: 77 61 6e 74 73 3a 0a 0a 09 20 20 20 20 23 20 55  wants:...    # U
5b40: 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 20  SE_THREAD_ALLOC 
5b50: 74 65 6c 6c 73 20 75 73 20 74 6f 20 74 72 79 20  tells us to try 
5b60: 74 68 65 20 73 70 65 63 69 61 6c 20 74 68 72 65  the special thre
5b70: 61 64 2d 62 61 73 65 64 0a 09 20 20 20 20 23 20  ad-based..    # 
5b80: 61 6c 6c 6f 63 61 74 6f 72 20 74 68 61 74 20 73  allocator that s
5b90: 69 67 6e 69 66 69 63 61 6e 74 6c 79 20 72 65 64  ignificantly red
5ba0: 75 63 65 73 20 6c 6f 63 6b 20 63 6f 6e 74 65 6e  uces lock conten
5bb0: 74 69 6f 6e 0a 09 20 20 20 20 41 43 5f 44 45 46  tion..    AC_DEF
5bc0: 49 4e 45 28 55 53 45 5f 54 48 52 45 41 44 5f 41  INE(USE_THREAD_A
5bd0: 4c 4c 4f 43 2c 20 31 2c 0a 09 09 5b 44 6f 20 77  LLOC, 1,...[Do w
5be0: 65 20 77 61 6e 74 20 74 6f 20 75 73 65 20 74 68  e want to use th
5bf0: 65 20 74 68 72 65 61 64 65 64 20 6d 65 6d 6f 72  e threaded memor
5c00: 79 20 61 6c 6c 6f 63 61 74 6f 72 3f 5d 29 0a 09  y allocator?])..
5c10: 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28 5f 52      AC_DEFINE(_R
5c20: 45 45 4e 54 52 41 4e 54 2c 20 31 2c 20 5b 44 6f  EENTRANT, 1, [Do
5c30: 20 77 65 20 77 61 6e 74 20 74 68 65 20 72 65 65   we want the ree
5c40: 6e 74 72 61 6e 74 20 4f 53 20 41 50 49 3f 5d 29  ntrant OS API?])
5c50: 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 22 60  ..    if test "`
5c60: 75 6e 61 6d 65 20 2d 73 60 22 20 3d 20 22 53 75  uname -s`" = "Su
5c70: 6e 4f 53 22 20 3b 20 74 68 65 6e 0a 09 09 41 43  nOS" ; then...AC
5c80: 5f 44 45 46 49 4e 45 28 5f 50 4f 53 49 58 5f 50  _DEFINE(_POSIX_P
5c90: 54 48 52 45 41 44 5f 53 45 4d 41 4e 54 49 43 53  THREAD_SEMANTICS
5ca0: 2c 20 31 2c 0a 09 09 09 5b 44 6f 20 77 65 20 72  , 1,....[Do we r
5cb0: 65 61 6c 6c 79 20 77 61 6e 74 20 74 6f 20 66 6f  eally want to fo
5cc0: 6c 6c 6f 77 20 74 68 65 20 73 74 61 6e 64 61 72  llow the standar
5cd0: 64 3f 20 59 65 73 20 77 65 20 64 6f 21 5d 29 0a  d? Yes we do!]).
5ce0: 09 20 20 20 20 66 69 0a 09 20 20 20 20 41 43 5f  .    fi..    AC_
5cf0: 44 45 46 49 4e 45 28 5f 54 48 52 45 41 44 5f 53  DEFINE(_THREAD_S
5d00: 41 46 45 2c 20 31 2c 20 5b 44 6f 20 77 65 20 77  AFE, 1, [Do we w
5d10: 61 6e 74 20 74 68 65 20 74 68 72 65 61 64 2d 73  ant the thread-s
5d20: 61 66 65 20 4f 53 20 41 50 49 3f 5d 29 0a 09 20  afe OS API?]).. 
5d30: 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28     AC_CHECK_LIB(
5d40: 70 74 68 72 65 61 64 2c 70 74 68 72 65 61 64 5f  pthread,pthread_
5d50: 6d 75 74 65 78 5f 69 6e 69 74 2c 74 63 6c 5f 6f  mutex_init,tcl_o
5d60: 6b 3d 79 65 73 2c 74 63 6c 5f 6f 6b 3d 6e 6f 29  k=yes,tcl_ok=no)
5d70: 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 22 24  ..    if test "$
5d80: 74 63 6c 5f 6f 6b 22 20 3d 20 22 6e 6f 22 3b 20  tcl_ok" = "no"; 
5d90: 74 68 65 6e 0a 09 09 23 20 43 68 65 63 6b 20 61  then...# Check a
5da0: 20 6c 69 74 74 6c 65 20 68 61 72 64 65 72 20 66   little harder f
5db0: 6f 72 20 5f 5f 70 74 68 72 65 61 64 5f 6d 75 74  or __pthread_mut
5dc0: 65 78 5f 69 6e 69 74 20 69 6e 20 74 68 65 20 73  ex_init in the s
5dd0: 61 6d 65 0a 09 09 23 20 6c 69 62 72 61 72 79 2c  ame...# library,
5de0: 20 61 73 20 73 6f 6d 65 20 73 79 73 74 65 6d 73   as some systems
5df0: 20 68 69 64 65 20 69 74 20 74 68 65 72 65 20 75   hide it there u
5e00: 6e 74 69 6c 20 70 74 68 72 65 61 64 2e 68 20 69  ntil pthread.h i
5e10: 73 0a 09 09 23 20 64 65 66 69 6e 65 64 2e 20 20  s...# defined.  
5e20: 57 65 20 63 6f 75 6c 64 20 61 6c 74 65 72 6e 61  We could alterna
5e30: 74 69 76 65 6c 79 20 64 6f 20 61 6e 20 41 43 5f  tively do an AC_
5e40: 54 52 59 5f 43 4f 4d 50 49 4c 45 20 77 69 74 68  TRY_COMPILE with
5e50: 0a 09 09 23 20 70 74 68 72 65 61 64 2e 68 2c 20  ...# pthread.h, 
5e60: 62 75 74 20 74 68 61 74 20 77 69 6c 6c 20 77 6f  but that will wo
5e70: 72 6b 20 77 69 74 68 20 6c 69 62 70 74 68 72 65  rk with libpthre
5e80: 61 64 20 72 65 61 6c 6c 79 20 64 6f 65 73 6e 27  ad really doesn'
5e90: 74 0a 09 09 23 20 65 78 69 73 74 2c 20 6c 69 6b  t...# exist, lik
5ea0: 65 20 41 49 58 20 34 2e 32 2e 20 20 5b 42 75 67  e AIX 4.2.  [Bug
5eb0: 3a 20 34 33 35 39 5d 0a 09 09 41 43 5f 43 48 45  : 4359]...AC_CHE
5ec0: 43 4b 5f 4c 49 42 28 70 74 68 72 65 61 64 2c 20  CK_LIB(pthread, 
5ed0: 5f 5f 70 74 68 72 65 61 64 5f 6d 75 74 65 78 5f  __pthread_mutex_
5ee0: 69 6e 69 74 2c 0a 09 09 20 20 20 20 74 63 6c 5f  init,...    tcl_
5ef0: 6f 6b 3d 79 65 73 2c 20 74 63 6c 5f 6f 6b 3d 6e  ok=yes, tcl_ok=n
5f00: 6f 29 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20  o)..    fi...   
5f10: 20 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f   if test "$tcl_o
5f20: 6b 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e  k" = "yes"; then
5f30: 0a 09 09 23 20 54 68 65 20 73 70 61 63 65 20 69  ...# The space i
5f40: 73 20 6e 65 65 64 65 64 0a 09 09 54 48 52 45 41  s needed...THREA
5f50: 44 53 5f 4c 49 42 53 3d 22 20 2d 6c 70 74 68 72  DS_LIBS=" -lpthr
5f60: 65 61 64 22 0a 09 20 20 20 20 65 6c 73 65 0a 09  ead"..    else..
5f70: 09 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 70 74  .AC_CHECK_LIB(pt
5f80: 68 72 65 61 64 73 2c 20 70 74 68 72 65 61 64 5f  hreads, pthread_
5f90: 6d 75 74 65 78 5f 69 6e 69 74 2c 0a 09 09 20 20  mutex_init,...  
5fa0: 20 20 74 63 6c 5f 6f 6b 3d 79 65 73 2c 20 74 63    tcl_ok=yes, tc
5fb0: 6c 5f 6f 6b 3d 6e 6f 29 0a 09 09 69 66 20 74 65  l_ok=no)...if te
5fc0: 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 22  st "$tcl_ok" = "
5fd0: 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 20 20 20  yes"; then...   
5fe0: 20 23 20 54 68 65 20 73 70 61 63 65 20 69 73 20   # The space is 
5ff0: 6e 65 65 64 65 64 0a 09 09 20 20 20 20 54 48 52  needed...    THR
6000: 45 41 44 53 5f 4c 49 42 53 3d 22 20 2d 6c 70 74  EADS_LIBS=" -lpt
6010: 68 72 65 61 64 73 22 0a 09 09 65 6c 73 65 0a 09  hreads"...else..
6020: 09 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c 49  .    AC_CHECK_LI
6030: 42 28 63 2c 20 70 74 68 72 65 61 64 5f 6d 75 74  B(c, pthread_mut
6040: 65 78 5f 69 6e 69 74 2c 0a 09 09 09 74 63 6c 5f  ex_init,....tcl_
6050: 6f 6b 3d 79 65 73 2c 20 74 63 6c 5f 6f 6b 3d 6e  ok=yes, tcl_ok=n
6060: 6f 29 0a 09 09 20 20 20 20 69 66 20 74 65 73 74  o)...    if test
6070: 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 22 6e 6f   "$tcl_ok" = "no
6080: 22 3b 20 74 68 65 6e 0a 09 09 09 41 43 5f 43 48  "; then....AC_CH
6090: 45 43 4b 5f 4c 49 42 28 63 5f 72 2c 20 70 74 68  ECK_LIB(c_r, pth
60a0: 72 65 61 64 5f 6d 75 74 65 78 5f 69 6e 69 74 2c  read_mutex_init,
60b0: 0a 09 09 09 20 20 20 20 74 63 6c 5f 6f 6b 3d 79  ....    tcl_ok=y
60c0: 65 73 2c 20 74 63 6c 5f 6f 6b 3d 6e 6f 29 0a 09  es, tcl_ok=no)..
60d0: 09 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f  ..if test "$tcl_
60e0: 6f 6b 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65  ok" = "yes"; the
60f0: 6e 0a 09 09 09 20 20 20 20 23 20 54 68 65 20 73  n....    # The s
6100: 70 61 63 65 20 69 73 20 6e 65 65 64 65 64 0a 09  pace is needed..
6110: 09 09 20 20 20 20 54 48 52 45 41 44 53 5f 4c 49  ..    THREADS_LI
6120: 42 53 3d 22 20 2d 70 74 68 72 65 61 64 22 0a 09  BS=" -pthread"..
6130: 09 09 65 6c 73 65 0a 09 09 09 20 20 20 20 54 43  ..else....    TC
6140: 4c 5f 54 48 52 45 41 44 53 3d 30 0a 09 09 09 20  L_THREADS=0.... 
6150: 20 20 20 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b     AC_MSG_WARN([
6160: 44 6f 20 6e 6f 74 20 6b 6e 6f 77 20 68 6f 77 20  Do not know how 
6170: 74 6f 20 66 69 6e 64 20 70 74 68 72 65 61 64 20  to find pthread 
6180: 6c 69 62 20 6f 6e 20 79 6f 75 72 20 73 79 73 74  lib on your syst
6190: 65 6d 20 2d 20 74 68 72 65 61 64 20 73 75 70 70  em - thread supp
61a0: 6f 72 74 20 64 69 73 61 62 6c 65 64 5d 29 0a 09  ort disabled])..
61b0: 09 09 66 69 0a 09 09 20 20 20 20 66 69 0a 09 09  ..fi...    fi...
61c0: 66 69 0a 09 20 20 20 20 66 69 0a 09 66 69 0a 20  fi..    fi..fi. 
61d0: 20 20 20 65 6c 73 65 0a 09 54 43 4c 5f 54 48 52     else..TCL_THR
61e0: 45 41 44 53 3d 30 0a 20 20 20 20 66 69 0a 20 20  EADS=0.    fi.  
61f0: 20 20 23 20 44 6f 20 63 68 65 63 6b 69 6e 67 20    # Do checking 
6200: 6d 65 73 73 61 67 65 20 68 65 72 65 20 74 6f 20  message here to 
6210: 6e 6f 74 20 6d 65 73 73 20 75 70 20 69 6e 74 65  not mess up inte
6220: 72 6c 65 61 76 65 64 20 63 6f 6e 66 69 67 75 72  rleaved configur
6230: 65 20 6f 75 74 70 75 74 0a 20 20 20 20 41 43 5f  e output.    AC_
6240: 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f  MSG_CHECKING([fo
6250: 72 20 62 75 69 6c 64 69 6e 67 20 77 69 74 68 20  r building with 
6260: 74 68 72 65 61 64 73 5d 29 0a 20 20 20 20 69 66  threads]).    if
6270: 20 74 65 73 74 20 22 24 7b 54 43 4c 5f 54 48 52   test "${TCL_THR
6280: 45 41 44 53 7d 22 20 3d 20 31 3b 20 74 68 65 6e  EADS}" = 1; then
6290: 0a 09 41 43 5f 44 45 46 49 4e 45 28 54 43 4c 5f  ..AC_DEFINE(TCL_
62a0: 54 48 52 45 41 44 53 2c 20 31 2c 20 5b 41 72 65  THREADS, 1, [Are
62b0: 20 77 65 20 62 75 69 6c 64 69 6e 67 20 77 69 74   we building wit
62c0: 68 20 74 68 72 65 61 64 73 20 65 6e 61 62 6c 65  h threads enable
62d0: 64 3f 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53  d?])..AC_MSG_RES
62e0: 55 4c 54 28 5b 79 65 73 20 28 64 65 66 61 75 6c  ULT([yes (defaul
62f0: 74 29 5d 29 0a 20 20 20 20 65 6c 73 65 0a 09 41  t)]).    else..A
6300: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e 6f  C_MSG_RESULT([no
6310: 5d 29 0a 20 20 20 20 66 69 0a 20 20 20 20 23 20  ]).    fi.    # 
6320: 54 43 4c 5f 54 48 52 45 41 44 53 20 73 61 6e 69  TCL_THREADS sani
6330: 74 79 20 63 68 65 63 6b 69 6e 67 2e 20 20 53 65  ty checking.  Se
6340: 65 20 69 66 20 6f 75 72 20 72 65 71 75 65 73 74  e if our request
6350: 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 77 69   for building wi
6360: 74 68 0a 20 20 20 20 23 20 74 68 72 65 61 64 73  th.    # threads
6370: 20 69 73 20 74 68 65 20 73 61 6d 65 20 61 73 20   is the same as 
6380: 74 68 65 20 77 61 79 20 54 63 6c 20 77 61 73 20  the way Tcl was 
6390: 62 75 69 6c 74 2e 20 20 49 66 20 6e 6f 74 2c 20  built.  If not, 
63a0: 77 61 72 6e 20 74 68 65 20 75 73 65 72 2e 0a 20  warn the user.. 
63b0: 20 20 20 63 61 73 65 20 24 7b 54 43 4c 5f 44 45     case ${TCL_DE
63c0: 46 53 7d 20 69 6e 0a 09 2a 54 48 52 45 41 44 53  FS} in..*THREADS
63d0: 3d 31 2a 29 0a 09 20 20 20 20 69 66 20 74 65 73  =1*)..    if tes
63e0: 74 20 22 24 7b 54 43 4c 5f 54 48 52 45 41 44 53  t "${TCL_THREADS
63f0: 7d 22 20 3d 20 22 30 22 3b 20 74 68 65 6e 0a 09  }" = "0"; then..
6400: 09 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 0a 20  .AC_MSG_WARN([. 
6410: 20 20 20 42 75 69 6c 64 69 6e 67 20 24 7b 50 41     Building ${PA
6420: 43 4b 41 47 45 5f 4e 41 4d 45 7d 20 77 69 74 68  CKAGE_NAME} with
6430: 6f 75 74 20 74 68 72 65 61 64 73 20 65 6e 61 62  out threads enab
6440: 6c 65 64 2c 20 62 75 74 20 62 75 69 6c 64 69 6e  led, but buildin
6450: 67 20 61 67 61 69 6e 73 74 20 54 63 6c 0a 20 20  g against Tcl.  
6460: 20 20 74 68 61 74 20 49 53 20 74 68 72 65 61 64    that IS thread
6470: 2d 65 6e 61 62 6c 65 64 2e 20 20 49 74 20 69 73  -enabled.  It is
6480: 20 72 65 63 6f 6d 6d 65 6e 64 65 64 20 74 6f 20   recommended to 
6490: 75 73 65 20 2d 2d 65 6e 61 62 6c 65 2d 74 68 72  use --enable-thr
64a0: 65 61 64 73 2e 5d 29 0a 09 20 20 20 20 66 69 0a  eads.])..    fi.
64b0: 09 20 20 20 20 3b 3b 0a 09 2a 29 0a 09 20 20 20  .    ;;..*)..   
64c0: 20 69 66 20 74 65 73 74 20 22 24 7b 54 43 4c 5f   if test "${TCL_
64d0: 54 48 52 45 41 44 53 7d 22 20 3d 20 22 31 22 3b  THREADS}" = "1";
64e0: 20 74 68 65 6e 0a 09 09 41 43 5f 4d 53 47 5f 57   then...AC_MSG_W
64f0: 41 52 4e 28 5b 0a 20 20 20 20 2d 2d 65 6e 61 62  ARN([.    --enab
6500: 6c 65 2d 74 68 72 65 61 64 73 20 72 65 71 75 65  le-threads reque
6510: 73 74 65 64 2c 20 62 75 74 20 62 75 69 6c 64 69  sted, but buildi
6520: 6e 67 20 61 67 61 69 6e 73 74 20 61 20 54 63 6c  ng against a Tcl
6530: 20 74 68 61 74 20 69 73 20 4e 4f 54 0a 20 20 20   that is NOT.   
6540: 20 74 68 72 65 61 64 2d 65 6e 61 62 6c 65 64 2e   thread-enabled.
6550: 20 20 54 68 69 73 20 69 73 20 61 6e 20 4f 4b 20    This is an OK 
6560: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 74 68  configuration th
6570: 61 74 20 77 69 6c 6c 20 61 6c 73 6f 20 72 75 6e  at will also run
6580: 20 69 6e 0a 20 20 20 20 61 20 74 68 72 65 61 64   in.    a thread
6590: 2d 65 6e 61 62 6c 65 64 20 63 6f 72 65 2e 5d 29  -enabled core.])
65a0: 0a 09 20 20 20 20 66 69 0a 09 20 20 20 20 3b 3b  ..    fi..    ;;
65b0: 0a 20 20 20 20 65 73 61 63 0a 20 20 20 20 41 43  .    esac.    AC
65c0: 5f 53 55 42 53 54 28 54 43 4c 5f 54 48 52 45 41  _SUBST(TCL_THREA
65d0: 44 53 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  DS).])..#-------
65e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
65f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6620: 2d 0a 23 20 54 45 41 5f 45 4e 41 42 4c 45 5f 53  -.# TEA_ENABLE_S
6630: 59 4d 42 4f 4c 53 20 2d 2d 0a 23 0a 23 09 53 70  YMBOLS --.#.#.Sp
6640: 65 63 69 66 79 20 69 66 20 64 65 62 75 67 67 69  ecify if debuggi
6650: 6e 67 20 73 79 6d 62 6f 6c 73 20 73 68 6f 75 6c  ng symbols shoul
6660: 64 20 62 65 20 75 73 65 64 2e 0a 23 09 4d 65 6d  d be used..#.Mem
6670: 6f 72 79 20 28 54 43 4c 5f 4d 45 4d 5f 44 45 42  ory (TCL_MEM_DEB
6680: 55 47 29 20 64 65 62 75 67 67 69 6e 67 20 63 61  UG) debugging ca
6690: 6e 20 61 6c 73 6f 20 62 65 20 65 6e 61 62 6c 65  n also be enable
66a0: 64 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73  d..#.# Arguments
66b0: 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 09 54 45 41  :.#.none.#.#.TEA
66c0: 20 76 61 72 69 65 73 20 66 72 6f 6d 20 63 6f 72   varies from cor
66d0: 65 20 54 63 6c 20 69 6e 20 74 68 61 74 20 43 7c  e Tcl in that C|
66e0: 4c 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54 20  LDFLAGS_DEFAULT 
66f0: 72 65 63 65 69 76 65 73 0a 23 09 74 68 65 20 76  receives.#.the v
6700: 61 6c 75 65 20 6f 66 20 43 7c 4c 44 46 4c 41 47  alue of C|LDFLAG
6710: 53 5f 4f 50 54 49 4d 49 5a 45 7c 44 45 42 55 47  S_OPTIMIZE|DEBUG
6720: 20 61 6c 72 65 61 64 79 20 73 75 62 73 74 69 74   already substit
6730: 75 74 65 64 2e 0a 23 09 52 65 71 75 69 72 65 73  uted..#.Requires
6740: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76   the following v
6750: 61 72 73 20 74 6f 20 62 65 20 73 65 74 20 69 6e  ars to be set in
6760: 20 74 68 65 20 4d 61 6b 65 66 69 6c 65 3a 0a 23   the Makefile:.#
6770: 09 09 43 46 4c 41 47 53 5f 44 45 46 41 55 4c 54  ..CFLAGS_DEFAULT
6780: 0a 23 09 09 4c 44 46 4c 41 47 53 5f 44 45 46 41  .#..LDFLAGS_DEFA
6790: 55 4c 54 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a  ULT.#.# Results:
67a0: 0a 23 0a 23 09 41 64 64 73 20 74 68 65 20 66 6f  .#.#.Adds the fo
67b0: 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65 6e 74  llowing argument
67c0: 73 20 74 6f 20 63 6f 6e 66 69 67 75 72 65 3a 0a  s to configure:.
67d0: 23 09 09 2d 2d 65 6e 61 62 6c 65 2d 73 79 6d 62  #..--enable-symb
67e0: 6f 6c 73 0a 23 0a 23 09 44 65 66 69 6e 65 73 20  ols.#.#.Defines 
67f0: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
6800: 72 73 3a 0a 23 09 09 43 46 4c 41 47 53 5f 44 45  rs:.#..CFLAGS_DE
6810: 46 41 55 4c 54 09 53 65 74 73 20 74 6f 20 24 28  FAULT.Sets to $(
6820: 43 46 4c 41 47 53 5f 44 45 42 55 47 29 20 69 66  CFLAGS_DEBUG) if
6830: 20 74 72 75 65 0a 23 09 09 09 09 53 65 74 73 20   true.#....Sets 
6840: 74 6f 20 22 24 28 43 46 4c 41 47 53 5f 4f 50 54  to "$(CFLAGS_OPT
6850: 49 4d 49 5a 45 29 20 2d 44 4e 44 45 42 55 47 22  IMIZE) -DNDEBUG"
6860: 20 69 66 20 66 61 6c 73 65 0a 23 09 09 4c 44 46   if false.#..LDF
6870: 4c 41 47 53 5f 44 45 46 41 55 4c 54 09 53 65 74  LAGS_DEFAULT.Set
6880: 73 20 74 6f 20 24 28 4c 44 46 4c 41 47 53 5f 44  s to $(LDFLAGS_D
6890: 45 42 55 47 29 20 69 66 20 74 72 75 65 0a 23 09  EBUG) if true.#.
68a0: 09 09 09 53 65 74 73 20 74 6f 20 24 28 4c 44 46  ...Sets to $(LDF
68b0: 4c 41 47 53 5f 4f 50 54 49 4d 49 5a 45 29 20 69  LAGS_OPTIMIZE) i
68c0: 66 20 66 61 6c 73 65 0a 23 09 09 44 42 47 58 09  f false.#..DBGX.
68d0: 09 46 6f 72 6d 65 72 6c 79 20 75 73 65 64 20 61  .Formerly used a
68e0: 73 20 64 65 62 75 67 20 6c 69 62 72 61 72 79 20  s debug library 
68f0: 65 78 74 65 6e 73 69 6f 6e 3b 0a 23 09 09 09 09  extension;.#....
6900: 61 6c 77 61 79 73 20 62 6c 61 6e 6b 20 6e 6f 77  always blank now
6910: 2e 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
6920: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6930: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6940: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6950: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f  -----------..AC_
6960: 44 45 46 55 4e 28 5b 54 45 41 5f 45 4e 41 42 4c  DEFUN([TEA_ENABL
6970: 45 5f 53 59 4d 42 4f 4c 53 5d 2c 20 5b 0a 20 20  E_SYMBOLS], [.  
6980: 20 20 64 6e 6c 20 54 45 41 20 73 70 65 63 69 66    dnl TEA specif
6990: 69 63 3a 20 4d 61 6b 65 20 73 75 72 65 20 77 65  ic: Make sure we
69a0: 20 61 72 65 20 69 6e 69 74 69 61 6c 69 7a 65 64   are initialized
69b0: 0a 20 20 20 20 41 43 5f 52 45 51 55 49 52 45 28  .    AC_REQUIRE(
69c0: 5b 54 45 41 5f 43 4f 4e 46 49 47 5f 43 46 4c 41  [TEA_CONFIG_CFLA
69d0: 47 53 5d 29 0a 20 20 20 20 41 43 5f 4d 53 47 5f  GS]).    AC_MSG_
69e0: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 62 75  CHECKING([for bu
69f0: 69 6c 64 20 77 69 74 68 20 73 79 6d 62 6f 6c 73  ild with symbols
6a00: 5d 29 0a 20 20 20 20 41 43 5f 41 52 47 5f 45 4e  ]).    AC_ARG_EN
6a10: 41 42 4c 45 28 73 79 6d 62 6f 6c 73 2c 0a 09 41  ABLE(symbols,..A
6a20: 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d  C_HELP_STRING([-
6a30: 2d 65 6e 61 62 6c 65 2d 73 79 6d 62 6f 6c 73 5d  -enable-symbols]
6a40: 2c 0a 09 20 20 20 20 5b 62 75 69 6c 64 20 77 69  ,..    [build wi
6a50: 74 68 20 64 65 62 75 67 67 69 6e 67 20 73 79 6d  th debugging sym
6a60: 62 6f 6c 73 20 28 64 65 66 61 75 6c 74 3a 20 6f  bols (default: o
6a70: 66 66 29 5d 29 2c 0a 09 5b 74 63 6c 5f 6f 6b 3d  ff)]),..[tcl_ok=
6a80: 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20 5b 74 63  $enableval], [tc
6a90: 6c 5f 6f 6b 3d 6e 6f 5d 29 0a 20 20 20 20 44 42  l_ok=no]).    DB
6aa0: 47 58 3d 22 22 0a 20 20 20 20 69 66 20 74 65 73  GX="".    if tes
6ab0: 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 22 6e  t "$tcl_ok" = "n
6ac0: 6f 22 3b 20 74 68 65 6e 0a 09 43 46 4c 41 47 53  o"; then..CFLAGS
6ad0: 5f 44 45 46 41 55 4c 54 3d 22 24 7b 43 46 4c 41  _DEFAULT="${CFLA
6ae0: 47 53 5f 4f 50 54 49 4d 49 5a 45 7d 20 2d 44 4e  GS_OPTIMIZE} -DN
6af0: 44 45 42 55 47 22 0a 09 4c 44 46 4c 41 47 53 5f  DEBUG"..LDFLAGS_
6b00: 44 45 46 41 55 4c 54 3d 22 24 7b 4c 44 46 4c 41  DEFAULT="${LDFLA
6b10: 47 53 5f 4f 50 54 49 4d 49 5a 45 7d 22 0a 09 41  GS_OPTIMIZE}"..A
6b20: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e 6f  C_MSG_RESULT([no
6b30: 5d 29 0a 20 20 20 20 65 6c 73 65 0a 09 43 46 4c  ]).    else..CFL
6b40: 41 47 53 5f 44 45 46 41 55 4c 54 3d 22 24 7b 43  AGS_DEFAULT="${C
6b50: 46 4c 41 47 53 5f 44 45 42 55 47 7d 22 0a 09 4c  FLAGS_DEBUG}"..L
6b60: 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54 3d 22  DFLAGS_DEFAULT="
6b70: 24 7b 4c 44 46 4c 41 47 53 5f 44 45 42 55 47 7d  ${LDFLAGS_DEBUG}
6b80: 22 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c  "..if test "$tcl
6b90: 5f 6f 6b 22 20 3d 20 22 79 65 73 22 3b 20 74 68  _ok" = "yes"; th
6ba0: 65 6e 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52  en..    AC_MSG_R
6bb0: 45 53 55 4c 54 28 5b 79 65 73 20 28 73 74 61 6e  ESULT([yes (stan
6bc0: 64 61 72 64 20 64 65 62 75 67 67 69 6e 67 29 5d  dard debugging)]
6bd0: 29 0a 09 66 69 0a 20 20 20 20 66 69 0a 20 20 20  )..fi.    fi.   
6be0: 20 23 20 54 45 41 20 73 70 65 63 69 66 69 63 3a   # TEA specific:
6bf0: 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b  .    if test "${
6c00: 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 21  TEA_PLATFORM}" !
6c10: 3d 20 22 77 69 6e 64 6f 77 73 22 20 3b 20 74 68  = "windows" ; th
6c20: 65 6e 0a 09 4c 44 46 4c 41 47 53 5f 44 45 46 41  en..LDFLAGS_DEFA
6c30: 55 4c 54 3d 22 24 7b 4c 44 46 4c 41 47 53 7d 22  ULT="${LDFLAGS}"
6c40: 0a 20 20 20 20 66 69 0a 20 20 20 20 41 43 5f 53  .    fi.    AC_S
6c50: 55 42 53 54 28 43 46 4c 41 47 53 5f 44 45 46 41  UBST(CFLAGS_DEFA
6c60: 55 4c 54 29 0a 20 20 20 20 41 43 5f 53 55 42 53  ULT).    AC_SUBS
6c70: 54 28 4c 44 46 4c 41 47 53 5f 44 45 46 41 55 4c  T(LDFLAGS_DEFAUL
6c80: 54 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  T).    AC_SUBST(
6c90: 54 43 4c 5f 44 42 47 58 29 0a 0a 20 20 20 20 69  TCL_DBGX)..    i
6ca0: 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22  f test "$tcl_ok"
6cb0: 20 3d 20 22 6d 65 6d 22 20 2d 6f 20 22 24 74 63   = "mem" -o "$tc
6cc0: 6c 5f 6f 6b 22 20 3d 20 22 61 6c 6c 22 3b 20 74  l_ok" = "all"; t
6cd0: 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 54  hen..AC_DEFINE(T
6ce0: 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 2c 20 31 2c  CL_MEM_DEBUG, 1,
6cf0: 20 5b 49 73 20 6d 65 6d 6f 72 79 20 64 65 62 75   [Is memory debu
6d00: 67 67 69 6e 67 20 65 6e 61 62 6c 65 64 3f 5d 29  gging enabled?])
6d10: 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 69 66 20  .    fi..    if 
6d20: 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20 21  test "$tcl_ok" !
6d30: 3d 20 22 79 65 73 22 20 2d 61 20 22 24 74 63 6c  = "yes" -a "$tcl
6d40: 5f 6f 6b 22 20 21 3d 20 22 6e 6f 22 3b 20 74 68  _ok" != "no"; th
6d50: 65 6e 0a 09 69 66 20 74 65 73 74 20 22 24 74 63  en..if test "$tc
6d60: 6c 5f 6f 6b 22 20 3d 20 22 61 6c 6c 22 3b 20 74  l_ok" = "all"; t
6d70: 68 65 6e 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f  hen..    AC_MSG_
6d80: 52 45 53 55 4c 54 28 5b 65 6e 61 62 6c 65 64 20  RESULT([enabled 
6d90: 73 79 6d 62 6f 6c 73 20 6d 65 6d 20 64 65 62 75  symbols mem debu
6da0: 67 67 69 6e 67 5d 29 0a 09 65 6c 73 65 0a 09 20  gging])..else.. 
6db0: 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54     AC_MSG_RESULT
6dc0: 28 5b 65 6e 61 62 6c 65 64 20 24 74 63 6c 5f 6f  ([enabled $tcl_o
6dd0: 6b 20 64 65 62 75 67 67 69 6e 67 5d 29 0a 09 66  k debugging])..f
6de0: 69 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d  i.    fi.])..#--
6df0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6e00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6e10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6e20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6e30: 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f 45 4e 41  ------.# TEA_ENA
6e40: 42 4c 45 5f 4c 41 4e 47 49 4e 46 4f 20 2d 2d 0a  BLE_LANGINFO --.
6e50: 23 0a 23 09 41 6c 6c 6f 77 73 20 75 73 65 20 6f  #.#.Allows use o
6e60: 66 20 6d 6f 64 65 72 6e 20 6e 6c 5f 6c 61 6e 67  f modern nl_lang
6e70: 69 6e 66 6f 20 63 68 65 63 6b 20 66 6f 72 20 62  info check for b
6e80: 65 74 74 65 72 20 6c 31 30 6e 2e 0a 23 09 54 68  etter l10n..#.Th
6e90: 69 73 20 69 73 20 6f 6e 6c 79 20 72 65 6c 65 76  is is only relev
6ea0: 61 6e 74 20 66 6f 72 20 55 6e 69 78 2e 0a 23 0a  ant for Unix..#.
6eb0: 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e  # Arguments:.#.n
6ec0: 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a  one.#.# Results:
6ed0: 0a 23 0a 23 09 41 64 64 73 20 74 68 65 20 66 6f  .#.#.Adds the fo
6ee0: 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65 6e 74  llowing argument
6ef0: 73 20 74 6f 20 63 6f 6e 66 69 67 75 72 65 3a 0a  s to configure:.
6f00: 23 09 09 2d 2d 65 6e 61 62 6c 65 2d 6c 61 6e 67  #..--enable-lang
6f10: 69 6e 66 6f 3d 79 65 73 7c 6e 6f 20 28 64 65 66  info=yes|no (def
6f20: 61 75 6c 74 20 69 73 20 79 65 73 29 0a 23 0a 23  ault is yes).#.#
6f30: 09 44 65 66 69 6e 65 73 20 74 68 65 20 66 6f 6c  .Defines the fol
6f40: 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
6f50: 48 41 56 45 5f 4c 41 4e 47 49 4e 46 4f 09 54 72  HAVE_LANGINFO.Tr
6f60: 69 67 67 65 72 73 20 75 73 65 20 6f 66 20 6e 6c  iggers use of nl
6f70: 5f 6c 61 6e 67 69 6e 66 6f 20 69 66 20 64 65 66  _langinfo if def
6f80: 69 6e 65 64 2e 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ined..#---------
6f90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6fa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6fb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6fc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
6fd0: 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 45  .AC_DEFUN([TEA_E
6fe0: 4e 41 42 4c 45 5f 4c 41 4e 47 49 4e 46 4f 5d 2c  NABLE_LANGINFO],
6ff0: 20 5b 0a 20 20 20 20 41 43 5f 41 52 47 5f 45 4e   [.    AC_ARG_EN
7000: 41 42 4c 45 28 6c 61 6e 67 69 6e 66 6f 2c 0a 09  ABLE(langinfo,..
7010: 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b  AC_HELP_STRING([
7020: 2d 2d 65 6e 61 62 6c 65 2d 6c 61 6e 67 69 6e 66  --enable-langinf
7030: 6f 5d 2c 0a 09 20 20 20 20 5b 75 73 65 20 6e 6c  o],..    [use nl
7040: 5f 6c 61 6e 67 69 6e 66 6f 20 69 66 20 70 6f 73  _langinfo if pos
7050: 73 69 62 6c 65 20 74 6f 20 64 65 74 65 72 6d 69  sible to determi
7060: 6e 65 20 65 6e 63 6f 64 69 6e 67 20 61 74 20 73  ne encoding at s
7070: 74 61 72 74 75 70 2c 20 6f 74 68 65 72 77 69 73  tartup, otherwis
7080: 65 20 75 73 65 20 6f 6c 64 20 68 65 75 72 69 73  e use old heuris
7090: 74 69 63 20 28 64 65 66 61 75 6c 74 3a 20 6f 6e  tic (default: on
70a0: 29 5d 29 2c 0a 09 5b 6c 61 6e 67 69 6e 66 6f 5f  )]),..[langinfo_
70b0: 6f 6b 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20  ok=$enableval], 
70c0: 5b 6c 61 6e 67 69 6e 66 6f 5f 6f 6b 3d 79 65 73  [langinfo_ok=yes
70d0: 5d 29 0a 0a 20 20 20 20 48 41 56 45 5f 4c 41 4e  ])..    HAVE_LAN
70e0: 47 49 4e 46 4f 3d 30 0a 20 20 20 20 69 66 20 74  GINFO=0.    if t
70f0: 65 73 74 20 22 24 6c 61 6e 67 69 6e 66 6f 5f 6f  est "$langinfo_o
7100: 6b 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e  k" = "yes"; then
7110: 0a 09 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45  ..AC_CHECK_HEADE
7120: 52 28 6c 61 6e 67 69 6e 66 6f 2e 68 2c 5b 6c 61  R(langinfo.h,[la
7130: 6e 67 69 6e 66 6f 5f 6f 6b 3d 79 65 73 5d 2c 5b  nginfo_ok=yes],[
7140: 6c 61 6e 67 69 6e 66 6f 5f 6f 6b 3d 6e 6f 5d 29  langinfo_ok=no])
7150: 0a 20 20 20 20 66 69 0a 20 20 20 20 41 43 5f 4d  .    fi.    AC_M
7160: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 77 68 65  SG_CHECKING([whe
7170: 74 68 65 72 20 74 6f 20 75 73 65 20 6e 6c 5f 6c  ther to use nl_l
7180: 61 6e 67 69 6e 66 6f 5d 29 0a 20 20 20 20 69 66  anginfo]).    if
7190: 20 74 65 73 74 20 22 24 6c 61 6e 67 69 6e 66 6f   test "$langinfo
71a0: 5f 6f 6b 22 20 3d 20 22 79 65 73 22 3b 20 74 68  _ok" = "yes"; th
71b0: 65 6e 0a 09 41 43 5f 43 41 43 48 45 5f 56 41 4c  en..AC_CACHE_VAL
71c0: 28 74 63 6c 5f 63 76 5f 6c 61 6e 67 69 6e 66 6f  (tcl_cv_langinfo
71d0: 5f 68 2c 20 5b 0a 09 20 20 20 20 41 43 5f 54 52  _h, [..    AC_TR
71e0: 59 5f 43 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c  Y_COMPILE([#incl
71f0: 75 64 65 20 3c 6c 61 6e 67 69 6e 66 6f 2e 68 3e  ude <langinfo.h>
7200: 5d 2c 20 5b 6e 6c 5f 6c 61 6e 67 69 6e 66 6f 28  ], [nl_langinfo(
7210: 43 4f 44 45 53 45 54 29 3b 5d 2c 0a 09 09 20 20  CODESET);],...  
7220: 20 20 5b 74 63 6c 5f 63 76 5f 6c 61 6e 67 69 6e    [tcl_cv_langin
7230: 66 6f 5f 68 3d 79 65 73 5d 2c 5b 74 63 6c 5f 63  fo_h=yes],[tcl_c
7240: 76 5f 6c 61 6e 67 69 6e 66 6f 5f 68 3d 6e 6f 5d  v_langinfo_h=no]
7250: 29 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55  )])..AC_MSG_RESU
7260: 4c 54 28 5b 24 74 63 6c 5f 63 76 5f 6c 61 6e 67  LT([$tcl_cv_lang
7270: 69 6e 66 6f 5f 68 5d 29 0a 09 69 66 20 74 65 73  info_h])..if tes
7280: 74 20 24 74 63 6c 5f 63 76 5f 6c 61 6e 67 69 6e  t $tcl_cv_langin
7290: 66 6f 5f 68 20 3d 20 79 65 73 3b 20 74 68 65 6e  fo_h = yes; then
72a0: 0a 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28  ..    AC_DEFINE(
72b0: 48 41 56 45 5f 4c 41 4e 47 49 4e 46 4f 2c 20 31  HAVE_LANGINFO, 1
72c0: 2c 20 5b 44 6f 20 77 65 20 68 61 76 65 20 6e 6c  , [Do we have nl
72d0: 5f 6c 61 6e 67 69 6e 66 6f 28 29 3f 5d 29 0a 09  _langinfo()?])..
72e0: 66 69 0a 20 20 20 20 65 6c 73 65 0a 09 41 43 5f  fi.    else..AC_
72f0: 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 6c 61 6e  MSG_RESULT([$lan
7300: 67 69 6e 66 6f 5f 6f 6b 5d 29 0a 20 20 20 20 66  ginfo_ok]).    f
7310: 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  i.])..#---------
7320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7340: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7350: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45  -----------.# TE
7360: 41 5f 43 4f 4e 46 49 47 5f 53 59 53 54 45 4d 0a  A_CONFIG_SYSTEM.
7370: 23 0a 23 09 44 65 74 65 72 6d 69 6e 65 20 77 68  #.#.Determine wh
7380: 61 74 20 74 68 65 20 73 79 73 74 65 6d 20 69 73  at the system is
7390: 20 28 73 6f 6d 65 20 74 68 69 6e 67 73 20 63 61   (some things ca
73a0: 6e 6e 6f 74 20 62 65 20 65 61 73 69 6c 79 20 63  nnot be easily c
73b0: 68 65 63 6b 65 64 0a 23 09 6f 6e 20 61 20 66 65  hecked.#.on a fe
73c0: 61 74 75 72 65 2d 64 72 69 76 65 6e 20 62 61 73  ature-driven bas
73d0: 69 73 2c 20 61 6c 61 73 29 2e 20 54 68 69 73 20  is, alas). This 
73e0: 63 61 6e 20 75 73 75 61 6c 6c 79 20 62 65 20 64  can usually be d
73f0: 6f 6e 65 20 76 69 61 20 74 68 65 0a 23 09 22 75  one via the.#."u
7400: 6e 61 6d 65 22 20 63 6f 6d 6d 61 6e 64 2e 0a 23  name" command..#
7410: 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
7420: 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73  none.#.# Results
7430: 3a 0a 23 09 44 65 66 69 6e 65 73 20 74 68 65 20  :.#.Defines the 
7440: 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 3a 0a 23  following var:.#
7450: 0a 23 09 73 79 73 74 65 6d 20 2d 09 53 79 73 74  .#.system -.Syst
7460: 65 6d 2f 70 6c 61 74 66 6f 72 6d 2f 76 65 72 73  em/platform/vers
7470: 69 6f 6e 20 69 64 65 6e 74 69 66 69 63 61 74 69  ion identificati
7480: 6f 6e 20 63 6f 64 65 2e 0a 23 2d 2d 2d 2d 2d 2d  on code..#------
7490: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
74a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
74b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
74c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
74d0: 41 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 43 4f  AC_DEFUN([TEA_CO
74e0: 4e 46 49 47 5f 53 59 53 54 45 4d 5d 2c 20 5b 0a  NFIG_SYSTEM], [.
74f0: 20 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45      AC_CACHE_CHE
7500: 43 4b 28 5b 73 79 73 74 65 6d 20 76 65 72 73 69  CK([system versi
7510: 6f 6e 5d 2c 20 74 63 6c 5f 63 76 5f 73 79 73 5f  on], tcl_cv_sys_
7520: 76 65 72 73 69 6f 6e 2c 20 5b 0a 09 23 20 54 45  version, [..# TE
7530: 41 20 73 70 65 63 69 66 69 63 3a 0a 09 69 66 20  A specific:..if 
7540: 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54  test "${TEA_PLAT
7550: 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77  FORM}" = "window
7560: 73 22 20 3b 20 74 68 65 6e 0a 09 20 20 20 20 74  s" ; then..    t
7570: 63 6c 5f 63 76 5f 73 79 73 5f 76 65 72 73 69 6f  cl_cv_sys_versio
7580: 6e 3d 77 69 6e 64 6f 77 73 0a 09 65 6c 73 65 0a  n=windows..else.
7590: 09 20 20 20 20 74 63 6c 5f 63 76 5f 73 79 73 5f  .    tcl_cv_sys_
75a0: 76 65 72 73 69 6f 6e 3d 60 75 6e 61 6d 65 20 2d  version=`uname -
75b0: 73 60 2d 60 75 6e 61 6d 65 20 2d 72 60 0a 09 20  s`-`uname -r`.. 
75c0: 20 20 20 69 66 20 74 65 73 74 20 22 24 3f 22 20     if test "$?" 
75d0: 2d 6e 65 20 30 20 3b 20 74 68 65 6e 0a 09 09 41  -ne 0 ; then...A
75e0: 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 63 61 6e 27  C_MSG_WARN([can'
75f0: 74 20 66 69 6e 64 20 75 6e 61 6d 65 20 63 6f 6d  t find uname com
7600: 6d 61 6e 64 5d 29 0a 09 09 74 63 6c 5f 63 76 5f  mand])...tcl_cv_
7610: 73 79 73 5f 76 65 72 73 69 6f 6e 3d 75 6e 6b 6e  sys_version=unkn
7620: 6f 77 6e 0a 09 20 20 20 20 65 6c 73 65 0a 09 09  own..    else...
7630: 69 66 20 74 65 73 74 20 22 60 75 6e 61 6d 65 20  if test "`uname 
7640: 2d 73 60 22 20 3d 20 22 41 49 58 22 20 3b 20 74  -s`" = "AIX" ; t
7650: 68 65 6e 0a 09 09 20 20 20 20 74 63 6c 5f 63 76  hen...    tcl_cv
7660: 5f 73 79 73 5f 76 65 72 73 69 6f 6e 3d 41 49 58  _sys_version=AIX
7670: 2d 60 75 6e 61 6d 65 20 2d 76 60 2e 60 75 6e 61  -`uname -v`.`una
7680: 6d 65 20 2d 72 60 0a 09 09 66 69 0a 09 20 20 20  me -r`...fi..   
7690: 20 66 69 0a 09 66 69 0a 20 20 20 20 5d 29 0a 20   fi..fi.    ]). 
76a0: 20 20 20 73 79 73 74 65 6d 3d 24 74 63 6c 5f 63     system=$tcl_c
76b0: 76 5f 73 79 73 5f 76 65 72 73 69 6f 6e 0a 5d 29  v_sys_version.])
76c0: 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
76d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
76e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
76f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7700: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f 43 4f  -------.# TEA_CO
7710: 4e 46 49 47 5f 43 46 4c 41 47 53 0a 23 0a 23 09  NFIG_CFLAGS.#.#.
7720: 54 72 79 20 74 6f 20 64 65 74 65 72 6d 69 6e 65  Try to determine
7730: 20 74 68 65 20 70 72 6f 70 65 72 20 66 6c 61 67   the proper flag
7740: 73 20 74 6f 20 70 61 73 73 20 74 6f 20 74 68 65  s to pass to the
7750: 20 63 6f 6d 70 69 6c 65 72 0a 23 09 66 6f 72 20   compiler.#.for 
7760: 62 75 69 6c 64 69 6e 67 20 73 68 61 72 65 64 20  building shared 
7770: 6c 69 62 72 61 72 69 65 73 20 61 6e 64 20 6f 74  libraries and ot
7780: 68 65 72 20 73 75 63 68 20 6e 6f 6e 73 65 6e 73  her such nonsens
7790: 65 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73  e..#.# Arguments
77a0: 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73  :.#.none.#.# Res
77b0: 75 6c 74 73 3a 0a 23 0a 23 09 44 65 66 69 6e 65  ults:.#.#.Define
77c0: 73 20 61 6e 64 20 73 75 62 73 74 69 74 75 74 65  s and substitute
77d0: 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  s the following 
77e0: 76 61 72 73 3a 0a 23 0a 23 09 44 4c 5f 4f 42 4a  vars:.#.#.DL_OBJ
77f0: 53 2c 20 44 4c 5f 4c 49 42 53 20 2d 20 72 65 6d  S, DL_LIBS - rem
7800: 6f 76 65 64 20 66 6f 72 20 54 45 41 2c 20 6f 6e  oved for TEA, on
7810: 6c 79 20 6e 65 65 64 65 64 20 62 79 20 63 6f 72  ly needed by cor
7820: 65 2e 0a 23 20 20 20 20 20 20 20 4c 44 46 4c 41  e..#       LDFLA
7830: 47 53 20 2d 20 20 20 20 20 20 46 6c 61 67 73 20  GS -      Flags 
7840: 74 6f 20 70 61 73 73 20 74 6f 20 74 68 65 20 63  to pass to the c
7850: 6f 6d 70 69 6c 65 72 20 77 68 65 6e 20 6c 69 6e  ompiler when lin
7860: 6b 69 6e 67 20 6f 62 6a 65 63 74 0a 23 20 20 20  king object.#   
7870: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7880: 20 20 20 20 66 69 6c 65 73 20 69 6e 74 6f 20 61      files into a
7890: 6e 20 65 78 65 63 75 74 61 62 6c 65 20 61 70 70  n executable app
78a0: 6c 69 63 61 74 69 6f 6e 20 62 69 6e 61 72 79 20  lication binary 
78b0: 73 75 63 68 0a 23 20 20 20 20 20 20 20 20 20 20  such.#          
78c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 61 73 20               as 
78d0: 74 63 6c 73 68 2e 0a 23 20 20 20 20 20 20 20 4c  tclsh..#       L
78e0: 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 2d 46  D_SEARCH_FLAGS-F
78f0: 6c 61 67 73 20 74 6f 20 70 61 73 73 20 74 6f 20  lags to pass to 
7900: 6c 64 2c 20 73 75 63 68 20 61 73 20 22 2d 52 20  ld, such as "-R 
7910: 2f 75 73 72 2f 6c 6f 63 61 6c 2f 74 63 6c 2f 6c  /usr/local/tcl/l
7920: 69 62 22 2c 0a 23 20 20 20 20 20 20 20 20 20 20  ib",.#          
7930: 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 61               tha
7940: 74 20 74 65 6c 6c 20 74 68 65 20 72 75 6e 2d 74  t tell the run-t
7950: 69 6d 65 20 64 79 6e 61 6d 69 63 20 6c 69 6e 6b  ime dynamic link
7960: 65 72 20 77 68 65 72 65 20 74 6f 20 6c 6f 6f 6b  er where to look
7970: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
7980: 20 20 20 20 20 20 20 20 20 66 6f 72 20 73 68 61           for sha
7990: 72 65 64 20 6c 69 62 72 61 72 69 65 73 20 73 75  red libraries su
79a0: 63 68 20 61 73 20 6c 69 62 74 63 6c 2e 73 6f 2e  ch as libtcl.so.
79b0: 20 20 44 65 70 65 6e 64 73 20 6f 6e 0a 23 20 20    Depends on.#  
79c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
79d0: 20 20 20 20 20 74 68 65 20 76 61 72 69 61 62 6c       the variabl
79e0: 65 20 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49  e LIB_RUNTIME_DI
79f0: 52 20 69 6e 20 74 68 65 20 4d 61 6b 65 66 69 6c  R in the Makefil
7a00: 65 2e 20 43 6f 75 6c 64 0a 23 20 20 20 20 20 20  e. Could.#      
7a10: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7a20: 20 62 65 20 74 68 65 20 73 61 6d 65 20 61 73 20   be the same as 
7a30: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 20  CC_SEARCH_FLAGS 
7a40: 69 66 20 24 7b 43 43 7d 20 69 73 20 75 73 65 64  if ${CC} is used
7a50: 20 74 6f 20 6c 69 6e 6b 2e 0a 23 20 20 20 20 20   to link..#     
7a60: 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47    CC_SEARCH_FLAG
7a70: 53 2d 46 6c 61 67 73 20 74 6f 20 70 61 73 73 20  S-Flags to pass 
7a80: 74 6f 20 24 7b 43 43 7d 2c 20 73 75 63 68 20 61  to ${CC}, such a
7a90: 73 20 22 2d 57 6c 2c 2d 72 70 61 74 68 2c 2f 75  s "-Wl,-rpath,/u
7aa0: 73 72 2f 6c 6f 63 61 6c 2f 74 63 6c 2f 6c 69 62  sr/local/tcl/lib
7ab0: 22 2c 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  ",.#            
7ac0: 20 20 20 20 20 20 20 20 20 20 20 74 68 61 74 20             that 
7ad0: 74 65 6c 6c 20 74 68 65 20 72 75 6e 2d 74 69 6d  tell the run-tim
7ae0: 65 20 64 79 6e 61 6d 69 63 20 6c 69 6e 6b 65 72  e dynamic linker
7af0: 20 77 68 65 72 65 20 74 6f 20 6c 6f 6f 6b 0a 23   where to look.#
7b00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7b10: 20 20 20 20 20 20 20 66 6f 72 20 73 68 61 72 65         for share
7b20: 64 20 6c 69 62 72 61 72 69 65 73 20 73 75 63 68  d libraries such
7b30: 20 61 73 20 6c 69 62 74 63 6c 2e 73 6f 2e 20 20   as libtcl.so.  
7b40: 44 65 70 65 6e 64 73 20 6f 6e 0a 23 20 20 20 20  Depends on.#    
7b50: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7b60: 20 20 20 74 68 65 20 76 61 72 69 61 62 6c 65 20     the variable 
7b70: 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 20  LIB_RUNTIME_DIR 
7b80: 69 6e 20 74 68 65 20 4d 61 6b 65 66 69 6c 65 2e  in the Makefile.
7b90: 0a 23 20 20 20 20 20 20 20 53 48 4c 49 42 5f 43  .#       SHLIB_C
7ba0: 46 4c 41 47 53 20 2d 20 20 46 6c 61 67 73 20 74  FLAGS -  Flags t
7bb0: 6f 20 70 61 73 73 20 74 6f 20 63 63 20 77 68 65  o pass to cc whe
7bc0: 6e 20 63 6f 6d 70 69 6c 69 6e 67 20 74 68 65 20  n compiling the 
7bd0: 63 6f 6d 70 6f 6e 65 6e 74 73 0a 23 20 20 20 20  components.#    
7be0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7bf0: 20 20 20 6f 66 20 61 20 73 68 61 72 65 64 20 6c     of a shared l
7c00: 69 62 72 61 72 79 20 28 6d 61 79 20 72 65 71 75  ibrary (may requ
7c10: 65 73 74 20 70 6f 73 69 74 69 6f 6e 2d 69 6e 64  est position-ind
7c20: 65 70 65 6e 64 65 6e 74 0a 23 20 20 20 20 20 20  ependent.#      
7c30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7c40: 20 63 6f 64 65 2c 20 61 6d 6f 6e 67 20 6f 74 68   code, among oth
7c50: 65 72 20 74 68 69 6e 67 73 29 2e 0a 23 20 20 20  er things)..#   
7c60: 20 20 20 20 53 48 4c 49 42 5f 4c 44 20 2d 20 20      SHLIB_LD -  
7c70: 20 20 20 20 42 61 73 65 20 63 6f 6d 6d 61 6e 64      Base command
7c80: 20 74 6f 20 75 73 65 20 66 6f 72 20 63 6f 6d 62   to use for comb
7c90: 69 6e 69 6e 67 20 6f 62 6a 65 63 74 20 66 69 6c  ining object fil
7ca0: 65 73 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  es.#            
7cb0: 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 6f 20             into 
7cc0: 61 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 79  a shared library
7cd0: 2e 0a 23 20 20 20 20 20 20 20 53 48 4c 49 42 5f  ..#       SHLIB_
7ce0: 4c 44 5f 4c 49 42 53 20 2d 20 44 65 70 65 6e 64  LD_LIBS - Depend
7cf0: 65 6e 74 20 6c 69 62 72 61 72 69 65 73 20 66 6f  ent libraries fo
7d00: 72 20 74 68 65 20 6c 69 6e 6b 65 72 20 74 6f 20  r the linker to 
7d10: 73 63 61 6e 20 77 68 65 6e 0a 23 20 20 20 20 20  scan when.#     
7d20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7d30: 20 20 63 72 65 61 74 69 6e 67 20 73 68 61 72 65    creating share
7d40: 64 20 6c 69 62 72 61 72 69 65 73 2e 20 20 54 68  d libraries.  Th
7d50: 69 73 20 73 79 6d 62 6f 6c 20 74 79 70 69 63 61  is symbol typica
7d60: 6c 6c 79 0a 23 20 20 20 20 20 20 20 20 20 20 20  lly.#           
7d70: 20 20 20 20 20 20 20 20 20 20 20 20 67 6f 65 73              goes
7d80: 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 74   at the end of t
7d90: 68 65 20 22 6c 64 22 20 63 6f 6d 6d 61 6e 64 73  he "ld" commands
7da0: 20 74 68 61 74 20 62 75 69 6c 64 0a 23 20 20 20   that build.#   
7db0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7dc0: 20 20 20 20 73 68 61 72 65 64 20 6c 69 62 72 61      shared libra
7dd0: 72 69 65 73 2e 20 54 68 65 20 76 61 6c 75 65 20  ries. The value 
7de0: 6f 66 20 74 68 65 20 73 79 6d 62 6f 6c 20 64 65  of the symbol de
7df0: 66 61 75 6c 74 73 20 74 6f 0a 23 20 20 20 20 20  faults to.#     
7e00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7e10: 20 20 22 24 7b 4c 49 42 53 7d 22 20 69 66 20 61    "${LIBS}" if a
7e20: 6c 6c 20 6f 66 20 74 68 65 20 64 65 70 65 6e 64  ll of the depend
7e30: 65 6e 74 20 6c 69 62 72 61 72 69 65 73 20 73 68  ent libraries sh
7e40: 6f 75 6c 64 0a 23 20 20 20 20 20 20 20 20 20 20  ould.#          
7e50: 20 20 20 20 20 20 20 20 20 20 20 20 20 62 65 20               be 
7e60: 73 70 65 63 69 66 69 65 64 20 77 68 65 6e 20 63  specified when c
7e70: 72 65 61 74 69 6e 67 20 61 20 73 68 61 72 65 64  reating a shared
7e80: 20 6c 69 62 72 61 72 79 2e 20 20 49 66 0a 23 20   library.  If.# 
7e90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7ea0: 20 20 20 20 20 20 64 65 70 65 6e 64 65 6e 74 20        dependent 
7eb0: 6c 69 62 72 61 72 69 65 73 20 73 68 6f 75 6c 64  libraries should
7ec0: 20 6e 6f 74 20 62 65 20 73 70 65 63 69 66 69 65   not be specifie
7ed0: 64 20 28 61 73 20 6f 6e 0a 23 20 20 20 20 20 20  d (as on.#      
7ee0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7ef0: 20 53 75 6e 4f 53 20 34 2e 78 2c 20 77 68 65 72   SunOS 4.x, wher
7f00: 65 20 74 68 65 79 20 63 61 75 73 65 20 74 68 65  e they cause the
7f10: 20 6c 69 6e 6b 20 74 6f 20 66 61 69 6c 2c 20 6f   link to fail, o
7f20: 72 20 69 6e 0a 23 20 20 20 20 20 20 20 20 20 20  r in.#          
7f30: 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 6e               gen
7f40: 65 72 61 6c 20 69 66 20 54 63 6c 20 61 6e 64 20  eral if Tcl and 
7f50: 54 6b 20 61 72 65 6e 27 74 20 74 68 65 6d 73 65  Tk aren't themse
7f60: 6c 76 65 73 20 73 68 61 72 65 64 0a 23 20 20 20  lves shared.#   
7f70: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7f80: 20 20 20 20 6c 69 62 72 61 72 69 65 73 29 2c 20      libraries), 
7f90: 74 68 65 6e 20 74 68 69 73 20 73 79 6d 62 6f 6c  then this symbol
7fa0: 20 68 61 73 20 61 6e 20 65 6d 70 74 79 20 73 74   has an empty st
7fb0: 72 69 6e 67 0a 23 20 20 20 20 20 20 20 20 20 20  ring.#          
7fc0: 20 20 20 20 20 20 20 20 20 20 20 20 20 61 73 20               as 
7fd0: 69 74 73 20 76 61 6c 75 65 2e 0a 23 20 20 20 20  its value..#    
7fe0: 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 20     SHLIB_SUFFIX 
7ff0: 2d 20 20 53 75 66 66 69 78 20 74 6f 20 75 73 65  -  Suffix to use
8000: 20 66 6f 72 20 74 68 65 20 6e 61 6d 65 73 20 6f   for the names o
8010: 66 20 64 79 6e 61 6d 69 63 61 6c 6c 79 20 6c 6f  f dynamically lo
8020: 61 64 61 62 6c 65 0a 23 20 20 20 20 20 20 20 20  adable.#        
8030: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65                 e
8040: 78 74 65 6e 73 69 6f 6e 73 2e 20 20 41 6e 20 65  xtensions.  An e
8050: 6d 70 74 79 20 73 74 72 69 6e 67 20 6d 65 61 6e  mpty string mean
8060: 73 20 77 65 20 64 6f 6e 27 74 20 6b 6e 6f 77 20  s we don't know 
8070: 68 6f 77 0a 23 20 20 20 20 20 20 20 20 20 20 20  how.#           
8080: 20 20 20 20 20 20 20 20 20 20 20 20 74 6f 20 75              to u
8090: 73 65 20 73 68 61 72 65 64 20 6c 69 62 72 61 72  se shared librar
80a0: 69 65 73 20 6f 6e 20 74 68 69 73 20 70 6c 61 74  ies on this plat
80b0: 66 6f 72 6d 2e 0a 23 20 20 20 20 20 20 20 4c 49  form..#       LI
80c0: 42 5f 53 55 46 46 49 58 20 2d 20 20 20 20 53 70  B_SUFFIX -    Sp
80d0: 65 63 69 66 69 65 73 20 65 76 65 72 79 74 68 69  ecifies everythi
80e0: 6e 67 20 74 68 61 74 20 63 6f 6d 65 73 20 61 66  ng that comes af
80f0: 74 65 72 20 74 68 65 20 22 6c 69 62 66 6f 6f 22  ter the "libfoo"
8100: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
8110: 20 20 20 20 20 20 20 20 20 69 6e 20 61 20 73 74           in a st
8120: 61 74 69 63 20 6f 72 20 73 68 61 72 65 64 20 6c  atic or shared l
8130: 69 62 72 61 72 79 20 6e 61 6d 65 2c 20 75 73 69  ibrary name, usi
8140: 6e 67 20 74 68 65 20 24 50 41 43 4b 41 47 45 5f  ng the $PACKAGE_
8150: 56 45 52 53 49 4f 4e 20 76 61 72 69 61 62 6c 65  VERSION variable
8160: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
8170: 20 20 20 20 20 20 20 20 20 74 6f 20 70 75 74 20           to put 
8180: 74 68 65 20 76 65 72 73 69 6f 6e 20 69 6e 20 74  the version in t
8190: 68 65 20 72 69 67 68 74 20 70 6c 61 63 65 2e 20  he right place. 
81a0: 20 54 68 69 73 20 69 73 20 75 73 65 64 0a 23 20   This is used.# 
81b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
81c0: 20 20 20 20 20 20 62 79 20 70 6c 61 74 66 6f 72        by platfor
81d0: 6d 73 20 74 68 61 74 20 6e 65 65 64 20 6e 6f 6e  ms that need non
81e0: 2d 73 74 61 6e 64 61 72 64 20 6c 69 62 72 61 72  -standard librar
81f0: 79 20 6e 61 6d 65 73 2e 0a 23 20 20 20 20 20 20  y names..#      
8200: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8210: 20 45 78 61 6d 70 6c 65 73 3a 20 20 24 7b 50 41   Examples:  ${PA
8220: 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e 7d 2e 73  CKAGE_VERSION}.s
8230: 6f 2e 31 2e 31 20 6f 6e 20 4e 65 74 42 53 44 2c  o.1.1 on NetBSD,
8240: 20 73 69 6e 63 65 20 69 74 20 6e 65 65 64 73 0a   since it needs.
8250: 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  #               
8260: 20 20 20 20 20 20 20 20 74 6f 20 68 61 76 65 20          to have 
8270: 61 20 76 65 72 73 69 6f 6e 20 61 66 74 65 72 20  a version after 
8280: 74 68 65 20 2e 73 6f 2c 20 61 6e 64 20 24 7b 50  the .so, and ${P
8290: 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e 7d 2e  ACKAGE_VERSION}.
82a0: 61 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  a.#             
82b0: 20 20 20 20 20 20 20 20 20 20 6f 6e 20 41 49 58            on AIX
82c0: 2c 20 73 69 6e 63 65 20 61 20 73 68 61 72 65 64  , since a shared
82d0: 20 6c 69 62 72 61 72 79 20 6e 65 65 64 73 20 74   library needs t
82e0: 6f 20 68 61 76 65 0a 23 20 20 20 20 20 20 20 20  o have.#        
82f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61                 a
8300: 20 2e 61 20 65 78 74 65 6e 73 69 6f 6e 20 77 68   .a extension wh
8310: 65 72 65 61 73 20 73 68 61 72 65 64 20 6f 62 6a  ereas shared obj
8320: 65 63 74 73 20 66 6f 72 20 6c 6f 61 64 61 62 6c  ects for loadabl
8330: 65 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  e.#             
8340: 20 20 20 20 20 20 20 20 20 20 65 78 74 65 6e 73            extens
8350: 69 6f 6e 73 20 68 61 76 65 20 61 20 2e 73 6f 20  ions have a .so 
8360: 65 78 74 65 6e 73 69 6f 6e 2e 20 20 44 65 66 61  extension.  Defa
8370: 75 6c 74 73 20 74 6f 0a 23 20 20 20 20 20 20 20  ults to.#       
8380: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8390: 24 7b 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f  ${PACKAGE_VERSIO
83a0: 4e 7d 24 7b 53 48 4c 49 42 5f 53 55 46 46 49 58  N}${SHLIB_SUFFIX
83b0: 7d 2e 0a 23 09 43 46 4c 41 47 53 5f 44 45 42 55  }..#.CFLAGS_DEBU
83c0: 47 20 2d 0a 23 09 09 09 46 6c 61 67 73 20 75 73  G -.#...Flags us
83d0: 65 64 20 77 68 65 6e 20 72 75 6e 6e 69 6e 67 20  ed when running 
83e0: 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 69 6e 20  the compiler in 
83f0: 64 65 62 75 67 20 6d 6f 64 65 0a 23 09 43 46 4c  debug mode.#.CFL
8400: 41 47 53 5f 4f 50 54 49 4d 49 5a 45 20 2d 0a 23  AGS_OPTIMIZE -.#
8410: 09 09 09 46 6c 61 67 73 20 75 73 65 64 20 77 68  ...Flags used wh
8420: 65 6e 20 72 75 6e 6e 69 6e 67 20 74 68 65 20 63  en running the c
8430: 6f 6d 70 69 6c 65 72 20 69 6e 20 6f 70 74 69 6d  ompiler in optim
8440: 69 7a 65 20 6d 6f 64 65 0a 23 09 43 46 4c 41 47  ize mode.#.CFLAG
8450: 53 20 2d 09 41 64 64 69 74 69 6f 6e 61 6c 20 43  S -.Additional C
8460: 46 4c 41 47 53 20 61 64 64 65 64 20 61 73 20 6e  FLAGS added as n
8470: 65 63 65 73 73 61 72 79 20 28 75 73 75 61 6c 6c  ecessary (usuall
8480: 79 20 36 34 2d 62 69 74 29 0a 23 2d 2d 2d 2d 2d  y 64-bit).#-----
8490: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
84a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
84b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
84c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
84d0: 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 43  .AC_DEFUN([TEA_C
84e0: 4f 4e 46 49 47 5f 43 46 4c 41 47 53 5d 2c 20 5b  ONFIG_CFLAGS], [
84f0: 0a 20 20 20 20 64 6e 6c 20 54 45 41 20 73 70 65  .    dnl TEA spe
8500: 63 69 66 69 63 3a 20 4d 61 6b 65 20 73 75 72 65  cific: Make sure
8510: 20 77 65 20 61 72 65 20 69 6e 69 74 69 61 6c 69   we are initiali
8520: 7a 65 64 0a 20 20 20 20 41 43 5f 52 45 51 55 49  zed.    AC_REQUI
8530: 52 45 28 5b 54 45 41 5f 49 4e 49 54 5d 29 0a 0a  RE([TEA_INIT])..
8540: 20 20 20 20 23 20 53 74 65 70 20 30 2e 61 3a 20      # Step 0.a: 
8550: 45 6e 61 62 6c 65 20 36 34 20 62 69 74 20 73 75  Enable 64 bit su
8560: 70 70 6f 72 74 3f 0a 0a 20 20 20 20 41 43 5f 4d  pport?..    AC_M
8570: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 69 66 20  SG_CHECKING([if 
8580: 36 34 62 69 74 20 73 75 70 70 6f 72 74 20 69 73  64bit support is
8590: 20 72 65 71 75 65 73 74 65 64 5d 29 0a 20 20 20   requested]).   
85a0: 20 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 36   AC_ARG_ENABLE(6
85b0: 34 62 69 74 2c 0a 09 41 43 5f 48 45 4c 50 5f 53  4bit,..AC_HELP_S
85c0: 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d  TRING([--enable-
85d0: 36 34 62 69 74 5d 2c 0a 09 20 20 20 20 5b 65 6e  64bit],..    [en
85e0: 61 62 6c 65 20 36 34 62 69 74 20 73 75 70 70 6f  able 64bit suppo
85f0: 72 74 20 28 64 65 66 61 75 6c 74 3a 20 6f 66 66  rt (default: off
8600: 29 5d 29 2c 0a 09 5b 64 6f 36 34 62 69 74 3d 24  )]),..[do64bit=$
8610: 65 6e 61 62 6c 65 76 61 6c 5d 2c 20 5b 64 6f 36  enableval], [do6
8620: 34 62 69 74 3d 6e 6f 5d 29 0a 20 20 20 20 41 43  4bit=no]).    AC
8630: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 64 6f  _MSG_RESULT([$do
8640: 36 34 62 69 74 5d 29 0a 0a 20 20 20 20 23 20 53  64bit])..    # S
8650: 74 65 70 20 30 2e 62 3a 20 45 6e 61 62 6c 65 20  tep 0.b: Enable 
8660: 53 6f 6c 61 72 69 73 20 36 34 20 62 69 74 20 56  Solaris 64 bit V
8670: 49 53 20 73 75 70 70 6f 72 74 3f 0a 0a 20 20 20  IS support?..   
8680: 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47   AC_MSG_CHECKING
8690: 28 5b 69 66 20 36 34 62 69 74 20 53 70 61 72 63  ([if 64bit Sparc
86a0: 20 56 49 53 20 73 75 70 70 6f 72 74 20 69 73 20   VIS support is 
86b0: 72 65 71 75 65 73 74 65 64 5d 29 0a 20 20 20 20  requested]).    
86c0: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 36 34  AC_ARG_ENABLE(64
86d0: 62 69 74 2d 76 69 73 2c 0a 09 41 43 5f 48 45 4c  bit-vis,..AC_HEL
86e0: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62  P_STRING([--enab
86f0: 6c 65 2d 36 34 62 69 74 2d 76 69 73 5d 2c 0a 09  le-64bit-vis],..
8700: 20 20 20 20 5b 65 6e 61 62 6c 65 20 36 34 62 69      [enable 64bi
8710: 74 20 53 70 61 72 63 20 56 49 53 20 73 75 70 70  t Sparc VIS supp
8720: 6f 72 74 20 28 64 65 66 61 75 6c 74 3a 20 6f 66  ort (default: of
8730: 66 29 5d 29 2c 0a 09 5b 64 6f 36 34 62 69 74 56  f)]),..[do64bitV
8740: 49 53 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20  IS=$enableval], 
8750: 5b 64 6f 36 34 62 69 74 56 49 53 3d 6e 6f 5d 29  [do64bitVIS=no])
8760: 0a 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55  .    AC_MSG_RESU
8770: 4c 54 28 5b 24 64 6f 36 34 62 69 74 56 49 53 5d  LT([$do64bitVIS]
8780: 29 0a 20 20 20 20 23 20 46 6f 72 63 65 20 36 34  ).    # Force 64
8790: 62 69 74 20 6f 6e 20 77 69 74 68 20 56 49 53 0a  bit on with VIS.
87a0: 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
87b0: 22 24 64 6f 36 34 62 69 74 56 49 53 22 20 3d 20  "$do64bitVIS" = 
87c0: 22 79 65 73 22 5d 2c 20 5b 64 6f 36 34 62 69 74  "yes"], [do64bit
87d0: 3d 79 65 73 5d 29 0a 0a 20 20 20 20 23 20 53 74  =yes])..    # St
87e0: 65 70 20 30 2e 63 3a 20 43 68 65 63 6b 20 69 66  ep 0.c: Check if
87f0: 20 76 69 73 69 62 69 6c 69 74 79 20 73 75 70 70   visibility supp
8800: 6f 72 74 20 69 73 20 61 76 61 69 6c 61 62 6c 65  ort is available
8810: 2e 20 44 6f 20 74 68 69 73 20 68 65 72 65 20 73  . Do this here s
8820: 6f 0a 20 20 20 20 23 20 74 68 61 74 20 70 6c 61  o.    # that pla
8830: 74 66 6f 72 6d 20 73 70 65 63 69 66 69 63 20 61  tform specific a
8840: 6c 74 65 72 6e 61 74 69 76 65 73 20 63 61 6e 20  lternatives can 
8850: 62 65 20 75 73 65 64 20 62 65 6c 6f 77 20 69 66  be used below if
8860: 20 74 68 69 73 20 66 61 69 6c 73 2e 0a 0a 20 20   this fails...  
8870: 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b    AC_CACHE_CHECK
8880: 28 5b 69 66 20 63 6f 6d 70 69 6c 65 72 20 73 75  ([if compiler su
8890: 70 70 6f 72 74 73 20 76 69 73 69 62 69 6c 69 74  pports visibilit
88a0: 79 20 22 68 69 64 64 65 6e 22 5d 2c 0a 09 74 63  y "hidden"],..tc
88b0: 6c 5f 63 76 5f 63 63 5f 76 69 73 69 62 69 6c 69  l_cv_cc_visibili
88c0: 74 79 5f 68 69 64 64 65 6e 2c 20 5b 0a 09 68 6f  ty_hidden, [..ho
88d0: 6c 64 5f 63 66 6c 61 67 73 3d 24 43 46 4c 41 47  ld_cflags=$CFLAG
88e0: 53 3b 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41  S; CFLAGS="$CFLA
88f0: 47 53 20 2d 57 65 72 72 6f 72 22 0a 09 41 43 5f  GS -Werror"..AC_
8900: 54 52 59 5f 4c 49 4e 4b 28 5b 0a 09 20 20 20 20  TRY_LINK([..    
8910: 65 78 74 65 72 6e 20 5f 5f 61 74 74 72 69 62 75  extern __attribu
8920: 74 65 5f 5f 28 28 5f 5f 76 69 73 69 62 69 6c 69  te__((__visibili
8930: 74 79 5f 5f 28 22 68 69 64 64 65 6e 22 29 29 29  ty__("hidden")))
8940: 20 76 6f 69 64 20 66 28 76 6f 69 64 29 3b 0a 09   void f(void);..
8950: 20 20 20 20 76 6f 69 64 20 66 28 76 6f 69 64 29      void f(void)
8960: 20 7b 7d 5d 2c 20 5b 66 28 29 3b 5d 2c 20 74 63   {}], [f();], tc
8970: 6c 5f 63 76 5f 63 63 5f 76 69 73 69 62 69 6c 69  l_cv_cc_visibili
8980: 74 79 5f 68 69 64 64 65 6e 3d 79 65 73 2c 0a 09  ty_hidden=yes,..
8990: 20 20 20 20 74 63 6c 5f 63 76 5f 63 63 5f 76 69      tcl_cv_cc_vi
89a0: 73 69 62 69 6c 69 74 79 5f 68 69 64 64 65 6e 3d  sibility_hidden=
89b0: 6e 6f 29 0a 09 43 46 4c 41 47 53 3d 24 68 6f 6c  no)..CFLAGS=$hol
89c0: 64 5f 63 66 6c 61 67 73 5d 29 0a 20 20 20 20 41  d_cflags]).    A
89d0: 53 5f 49 46 28 5b 74 65 73 74 20 24 74 63 6c 5f  S_IF([test $tcl_
89e0: 63 76 5f 63 63 5f 76 69 73 69 62 69 6c 69 74 79  cv_cc_visibility
89f0: 5f 68 69 64 64 65 6e 20 3d 20 79 65 73 5d 2c 20  _hidden = yes], 
8a00: 5b 0a 09 41 43 5f 44 45 46 49 4e 45 28 4d 4f 44  [..AC_DEFINE(MOD
8a10: 55 4c 45 5f 53 43 4f 50 45 2c 0a 09 20 20 20 20  ULE_SCOPE,..    
8a20: 5b 65 78 74 65 72 6e 20 5f 5f 61 74 74 72 69 62  [extern __attrib
8a30: 75 74 65 5f 5f 28 28 5f 5f 76 69 73 69 62 69 6c  ute__((__visibil
8a40: 69 74 79 5f 5f 28 22 68 69 64 64 65 6e 22 29 29  ity__("hidden"))
8a50: 29 5d 2c 0a 09 20 20 20 20 5b 43 6f 6d 70 69 6c  )],..    [Compil
8a60: 65 72 20 73 75 70 70 6f 72 74 20 66 6f 72 20 6d  er support for m
8a70: 6f 64 75 6c 65 20 73 63 6f 70 65 20 73 79 6d 62  odule scope symb
8a80: 6f 6c 73 5d 29 0a 09 41 43 5f 44 45 46 49 4e 45  ols])..AC_DEFINE
8a90: 28 48 41 56 45 5f 48 49 44 44 45 4e 2c 20 5b 31  (HAVE_HIDDEN, [1
8aa0: 5d 2c 20 5b 43 6f 6d 70 69 6c 65 72 20 73 75 70  ], [Compiler sup
8ab0: 70 6f 72 74 20 66 6f 72 20 6d 6f 64 75 6c 65 20  port for module 
8ac0: 73 63 6f 70 65 20 73 79 6d 62 6f 6c 73 5d 29 0a  scope symbols]).
8ad0: 20 20 20 20 5d 29 0a 0a 20 20 20 20 23 20 53 74      ])..    # St
8ae0: 65 70 20 30 2e 64 3a 20 44 69 73 61 62 6c 65 20  ep 0.d: Disable 
8af0: 2d 72 70 61 74 68 20 73 75 70 70 6f 72 74 3f 0a  -rpath support?.
8b00: 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43  .    AC_MSG_CHEC
8b10: 4b 49 4e 47 28 5b 69 66 20 72 70 61 74 68 20 73  KING([if rpath s
8b20: 75 70 70 6f 72 74 20 69 73 20 72 65 71 75 65 73  upport is reques
8b30: 74 65 64 5d 29 0a 20 20 20 20 41 43 5f 41 52 47  ted]).    AC_ARG
8b40: 5f 45 4e 41 42 4c 45 28 72 70 61 74 68 2c 0a 09  _ENABLE(rpath,..
8b50: 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b  AC_HELP_STRING([
8b60: 2d 2d 64 69 73 61 62 6c 65 2d 72 70 61 74 68 5d  --disable-rpath]
8b70: 2c 0a 09 20 20 20 20 5b 64 69 73 61 62 6c 65 20  ,..    [disable 
8b80: 72 70 61 74 68 20 73 75 70 70 6f 72 74 20 28 64  rpath support (d
8b90: 65 66 61 75 6c 74 3a 20 6f 6e 29 5d 29 2c 0a 09  efault: on)]),..
8ba0: 5b 64 6f 52 70 61 74 68 3d 24 65 6e 61 62 6c 65  [doRpath=$enable
8bb0: 76 61 6c 5d 2c 20 5b 64 6f 52 70 61 74 68 3d 79  val], [doRpath=y
8bc0: 65 73 5d 29 0a 20 20 20 20 41 43 5f 4d 53 47 5f  es]).    AC_MSG_
8bd0: 52 45 53 55 4c 54 28 5b 24 64 6f 52 70 61 74 68  RESULT([$doRpath
8be0: 5d 29 0a 0a 20 20 20 20 23 20 54 45 41 20 73 70  ])..    # TEA sp
8bf0: 65 63 69 66 69 63 3a 20 43 72 6f 73 73 2d 63 6f  ecific: Cross-co
8c00: 6d 70 69 6c 69 6e 67 20 6f 70 74 69 6f 6e 73 20  mpiling options 
8c10: 66 6f 72 20 57 69 6e 64 6f 77 73 2f 43 45 20 62  for Windows/CE b
8c20: 75 69 6c 64 73 3f 0a 0a 20 20 20 20 41 53 5f 49  uilds?..    AS_I
8c30: 46 28 5b 74 65 73 74 20 22 24 7b 54 45 41 5f 50  F([test "${TEA_P
8c40: 4c 41 54 46 4f 52 4d 7d 22 20 3d 20 77 69 6e 64  LATFORM}" = wind
8c50: 6f 77 73 5d 2c 20 5b 0a 09 41 43 5f 4d 53 47 5f  ows], [..AC_MSG_
8c60: 43 48 45 43 4b 49 4e 47 28 5b 69 66 20 57 69 6e  CHECKING([if Win
8c70: 64 6f 77 73 2f 43 45 20 62 75 69 6c 64 20 69 73  dows/CE build is
8c80: 20 72 65 71 75 65 73 74 65 64 5d 29 0a 09 41 43   requested])..AC
8c90: 5f 41 52 47 5f 45 4e 41 42 4c 45 28 77 69 6e 63  _ARG_ENABLE(winc
8ca0: 65 2c 0a 09 20 20 20 20 41 43 5f 48 45 4c 50 5f  e,..    AC_HELP_
8cb0: 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65  STRING([--enable
8cc0: 2d 77 69 6e 63 65 5d 2c 0a 09 09 5b 65 6e 61 62  -wince],...[enab
8cd0: 6c 65 20 57 69 6e 2f 43 45 20 73 75 70 70 6f 72  le Win/CE suppor
8ce0: 74 20 28 77 68 65 72 65 20 61 70 70 6c 69 63 61  t (where applica
8cf0: 62 6c 65 29 5d 29 2c 0a 09 20 20 20 20 5b 64 6f  ble)]),..    [do
8d00: 57 69 6e 63 65 3d 24 65 6e 61 62 6c 65 76 61 6c  Wince=$enableval
8d10: 5d 2c 20 5b 64 6f 57 69 6e 63 65 3d 6e 6f 5d 29  ], [doWince=no])
8d20: 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28  ..AC_MSG_RESULT(
8d30: 5b 24 64 6f 57 69 6e 63 65 5d 29 0a 20 20 20 20  [$doWince]).    
8d40: 5d 29 0a 0a 20 20 20 20 23 20 53 65 74 20 74 68  ])..    # Set th
8d50: 65 20 76 61 72 69 61 62 6c 65 20 22 73 79 73 74  e variable "syst
8d60: 65 6d 22 20 74 6f 20 68 6f 6c 64 20 74 68 65 20  em" to hold the 
8d70: 6e 61 6d 65 20 61 6e 64 20 76 65 72 73 69 6f 6e  name and version
8d80: 20 6e 75 6d 62 65 72 0a 20 20 20 20 23 20 66 6f   number.    # fo
8d90: 72 20 74 68 65 20 73 79 73 74 65 6d 2e 0a 0a 20  r the system... 
8da0: 20 20 20 54 45 41 5f 43 4f 4e 46 49 47 5f 53 59     TEA_CONFIG_SY
8db0: 53 54 45 4d 0a 0a 20 20 20 20 23 20 52 65 71 75  STEM..    # Requ
8dc0: 69 72 65 20 72 61 6e 6c 69 62 20 65 61 72 6c 79  ire ranlib early
8dd0: 20 73 6f 20 77 65 20 63 61 6e 20 6f 76 65 72 72   so we can overr
8de0: 69 64 65 20 69 74 20 69 6e 20 73 70 65 63 69 61  ide it in specia
8df0: 6c 20 63 61 73 65 73 20 62 65 6c 6f 77 2e 0a 0a  l cases below...
8e00: 20 20 20 20 41 43 5f 52 45 51 55 49 52 45 28 5b      AC_REQUIRE([
8e10: 41 43 5f 50 52 4f 47 5f 52 41 4e 4c 49 42 5d 29  AC_PROG_RANLIB])
8e20: 0a 0a 20 20 20 20 23 20 53 65 74 20 63 6f 6e 66  ..    # Set conf
8e30: 69 67 75 72 61 74 69 6f 6e 20 6f 70 74 69 6f 6e  iguration option
8e40: 73 20 62 61 73 65 64 20 6f 6e 20 73 79 73 74 65  s based on syste
8e50: 6d 20 6e 61 6d 65 20 61 6e 64 20 76 65 72 73 69  m name and versi
8e60: 6f 6e 2e 0a 20 20 20 20 23 20 54 68 69 73 20 69  on..    # This i
8e70: 73 20 73 69 6d 69 6c 61 72 20 74 6f 20 54 63 6c  s similar to Tcl
8e80: 27 73 20 75 6e 69 78 2f 74 63 6c 2e 6d 34 20 65  's unix/tcl.m4 e
8e90: 78 63 65 70 74 20 74 68 61 74 20 77 65 27 76 65  xcept that we've
8ea0: 20 61 64 64 65 64 20 61 0a 20 20 20 20 23 20 22   added a.    # "
8eb0: 77 69 6e 64 6f 77 73 22 20 63 61 73 65 20 61 6e  windows" case an
8ec0: 64 20 72 65 6d 6f 76 65 64 20 73 6f 6d 65 20 63  d removed some c
8ed0: 6f 72 65 2d 6f 6e 6c 79 20 76 61 72 73 2e 0a 0a  ore-only vars...
8ee0: 20 20 20 20 64 6f 36 34 62 69 74 5f 6f 6b 3d 6e      do64bit_ok=n
8ef0: 6f 0a 20 20 20 20 23 20 64 65 66 61 75 6c 74 20  o.    # default 
8f00: 74 6f 20 27 7b 24 4c 49 42 53 7d 27 20 61 6e 64  to '{$LIBS}' and
8f10: 20 73 65 74 20 74 6f 20 22 22 20 6f 6e 20 70 65   set to "" on pe
8f20: 72 2d 70 6c 61 74 66 6f 72 6d 20 6e 65 63 65 73  r-platform neces
8f30: 73 61 72 79 20 62 61 73 69 73 0a 20 20 20 20 53  sary basis.    S
8f40: 48 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d 27 24 7b  HLIB_LD_LIBS='${
8f50: 4c 49 42 53 7d 27 0a 20 20 20 20 23 20 57 68 65  LIBS}'.    # Whe
8f60: 6e 20 6c 64 20 6e 65 65 64 73 20 6f 70 74 69 6f  n ld needs optio
8f70: 6e 73 20 74 6f 20 77 6f 72 6b 20 69 6e 20 36 34  ns to work in 64
8f80: 2d 62 69 74 20 6d 6f 64 65 2c 20 70 75 74 20 74  -bit mode, put t
8f90: 68 65 6d 20 69 6e 0a 20 20 20 20 23 20 4c 44 46  hem in.    # LDF
8fa0: 4c 41 47 53 5f 41 52 43 48 20 73 6f 20 74 68 65  LAGS_ARCH so the
8fb0: 79 20 65 76 65 6e 74 75 61 6c 6c 79 20 65 6e 64  y eventually end
8fc0: 20 75 70 20 69 6e 20 4c 44 46 4c 41 47 53 20 65   up in LDFLAGS e
8fd0: 76 65 6e 20 69 66 20 5b 6c 6f 61 64 5d 0a 20 20  ven if [load].  
8fe0: 20 20 23 20 69 73 20 64 69 73 61 62 6c 65 64 20    # is disabled 
8ff0: 62 79 20 74 68 65 20 75 73 65 72 2e 20 5b 42 75  by the user. [Bu
9000: 67 20 31 30 31 36 37 39 36 5d 0a 20 20 20 20 4c  g 1016796].    L
9010: 44 46 4c 41 47 53 5f 41 52 43 48 3d 22 22 0a 20  DFLAGS_ARCH="". 
9020: 20 20 20 55 4e 53 48 41 52 45 44 5f 4c 49 42 5f     UNSHARED_LIB_
9030: 53 55 46 46 49 58 3d 22 22 0a 20 20 20 20 23 20  SUFFIX="".    # 
9040: 54 45 41 20 73 70 65 63 69 66 69 63 3a 20 75 73  TEA specific: us
9050: 65 20 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f  e PACKAGE_VERSIO
9060: 4e 20 69 6e 73 74 65 61 64 20 6f 66 20 56 45 52  N instead of VER
9070: 53 49 4f 4e 0a 20 20 20 20 54 43 4c 5f 54 52 49  SION.    TCL_TRI
9080: 4d 5f 44 4f 54 53 3d 27 60 65 63 68 6f 20 24 7b  M_DOTS='`echo ${
9090: 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e 7d  PACKAGE_VERSION}
90a0: 20 7c 20 74 72 20 2d 64 20 2e 60 27 0a 20 20 20   | tr -d .`'.   
90b0: 20 45 43 48 4f 5f 56 45 52 53 49 4f 4e 3d 27 60   ECHO_VERSION='`
90c0: 65 63 68 6f 20 24 7b 50 41 43 4b 41 47 45 5f 56  echo ${PACKAGE_V
90d0: 45 52 53 49 4f 4e 7d 60 27 0a 20 20 20 20 54 43  ERSION}`'.    TC
90e0: 4c 5f 4c 49 42 5f 56 45 52 53 49 4f 4e 53 5f 4f  L_LIB_VERSIONS_O
90f0: 4b 3d 6f 6b 0a 20 20 20 20 43 46 4c 41 47 53 5f  K=ok.    CFLAGS_
9100: 44 45 42 55 47 3d 2d 67 0a 20 20 20 20 41 53 5f  DEBUG=-g.    AS_
9110: 49 46 28 5b 74 65 73 74 20 22 24 47 43 43 22 20  IF([test "$GCC" 
9120: 3d 20 79 65 73 5d 2c 20 5b 0a 09 43 46 4c 41 47  = yes], [..CFLAG
9130: 53 5f 4f 50 54 49 4d 49 5a 45 3d 2d 4f 32 0a 09  S_OPTIMIZE=-O2..
9140: 43 46 4c 41 47 53 5f 57 41 52 4e 49 4e 47 3d 22  CFLAGS_WARNING="
9150: 2d 57 61 6c 6c 22 0a 20 20 20 20 5d 2c 20 5b 0a  -Wall".    ], [.
9160: 09 43 46 4c 41 47 53 5f 4f 50 54 49 4d 49 5a 45  .CFLAGS_OPTIMIZE
9170: 3d 2d 4f 0a 09 43 46 4c 41 47 53 5f 57 41 52 4e  =-O..CFLAGS_WARN
9180: 49 4e 47 3d 22 22 0a 20 20 20 20 5d 29 0a 20 20  ING="".    ]).  
9190: 20 20 41 43 5f 43 48 45 43 4b 5f 54 4f 4f 4c 28    AC_CHECK_TOOL(
91a0: 41 52 2c 20 61 72 29 0a 20 20 20 20 53 54 4c 49  AR, ar).    STLI
91b0: 42 5f 4c 44 3d 27 24 7b 41 52 7d 20 63 72 27 0a  B_LD='${AR} cr'.
91c0: 20 20 20 20 4c 44 5f 4c 49 42 52 41 52 59 5f 50      LD_LIBRARY_P
91d0: 41 54 48 5f 56 41 52 3d 22 4c 44 5f 4c 49 42 52  ATH_VAR="LD_LIBR
91e0: 41 52 59 5f 50 41 54 48 22 0a 20 20 20 20 41 53  ARY_PATH".    AS
91f0: 5f 49 46 28 5b 74 65 73 74 20 22 78 24 53 48 4c  _IF([test "x$SHL
9200: 49 42 5f 56 45 52 53 49 4f 4e 22 20 3d 20 78 5d  IB_VERSION" = x]
9210: 2c 5b 53 48 4c 49 42 5f 56 45 52 53 49 4f 4e 3d  ,[SHLIB_VERSION=
9220: 22 31 2e 30 22 5d 29 0a 20 20 20 20 63 61 73 65  "1.0"]).    case
9230: 20 24 73 79 73 74 65 6d 20 69 6e 0a 09 23 20 54   $system in..# T
9240: 45 41 20 73 70 65 63 69 66 69 63 3a 0a 09 77 69  EA specific:..wi
9250: 6e 64 6f 77 73 29 0a 09 20 20 20 20 23 20 54 68  ndows)..    # Th
9260: 69 73 20 69 73 20 61 20 32 2d 73 74 61 67 65 20  is is a 2-stage 
9270: 63 68 65 63 6b 20 74 6f 20 6d 61 6b 65 20 73 75  check to make su
9280: 72 65 20 77 65 20 68 61 76 65 20 74 68 65 20 36  re we have the 6
9290: 34 2d 62 69 74 20 53 44 4b 0a 09 20 20 20 20 23  4-bit SDK..    #
92a0: 20 57 65 20 68 61 76 65 20 74 6f 20 6b 6e 6f 77   We have to know
92b0: 20 77 68 65 72 65 20 74 68 65 20 53 44 4b 20 69   where the SDK i
92c0: 73 20 69 6e 73 74 61 6c 6c 65 64 2e 0a 09 20 20  s installed...  
92d0: 20 20 23 20 54 68 69 73 20 6d 61 67 69 63 20 69    # This magic i
92e0: 73 20 62 61 73 65 64 20 6f 6e 20 4d 53 20 50 6c  s based on MS Pl
92f0: 61 74 66 6f 72 6d 20 53 44 4b 20 66 6f 72 20 57  atform SDK for W
9300: 69 6e 32 30 30 33 20 53 50 31 20 2d 20 68 6f 62  in2003 SP1 - hob
9310: 62 73 0a 09 20 20 20 20 23 20 4d 41 43 48 49 4e  bs..    # MACHIN
9320: 45 20 69 73 20 49 58 38 36 20 66 6f 72 20 4c 49  E is IX86 for LI
9330: 4e 4b 2c 20 62 75 74 20 74 68 69 73 20 69 73 20  NK, but this is 
9340: 75 73 65 64 20 62 79 20 74 68 65 20 6d 61 6e 69  used by the mani
9350: 66 65 73 74 2c 0a 09 20 20 20 20 23 20 77 68 69  fest,..    # whi
9360: 63 68 20 72 65 71 75 69 72 65 73 20 78 38 36 7c  ch requires x86|
9370: 61 6d 64 36 34 7c 69 61 36 34 2e 0a 09 20 20 20  amd64|ia64...   
9380: 20 4d 41 43 48 49 4e 45 3d 22 58 38 36 22 0a 09   MACHINE="X86"..
9390: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 64 6f      if test "$do
93a0: 36 34 62 69 74 22 20 21 3d 20 22 6e 6f 22 20 3b  64bit" != "no" ;
93b0: 20 74 68 65 6e 0a 09 09 69 66 20 74 65 73 74 20   then...if test 
93c0: 22 78 24 7b 4d 53 53 44 4b 7d 78 22 20 3d 20 22  "x${MSSDK}x" = "
93d0: 78 78 22 20 3b 20 74 68 65 6e 0a 09 09 20 20 20  xx" ; then...   
93e0: 20 4d 53 53 44 4b 3d 22 43 3a 2f 50 72 6f 67 72   MSSDK="C:/Progr
93f0: 61 7e 31 2f 4d 69 63 72 6f 73 6f 66 74 20 50 6c  a~1/Microsoft Pl
9400: 61 74 66 6f 72 6d 20 53 44 4b 22 0a 09 09 66 69  atform SDK"...fi
9410: 0a 09 09 4d 53 53 44 4b 3d 60 65 63 68 6f 20 22  ...MSSDK=`echo "
9420: 24 4d 53 53 44 4b 22 20 7c 20 73 65 64 20 2d 65  $MSSDK" | sed -e
9430: 20 20 27 73 21 5c 5c 5c 21 2f 21 67 27 60 0a 09    's!\\\!/!g'`..
9440: 09 50 41 54 48 36 34 3d 22 22 0a 09 09 63 61 73  .PATH64=""...cas
9450: 65 20 22 24 64 6f 36 34 62 69 74 22 20 69 6e 0a  e "$do64bit" in.
9460: 09 09 20 20 20 20 61 6d 64 36 34 7c 78 36 34 7c  ..    amd64|x64|
9470: 79 65 73 29 0a 09 09 09 4d 41 43 48 49 4e 45 3d  yes)....MACHINE=
9480: 22 41 4d 44 36 34 22 20 3b 20 23 20 64 65 66 61  "AMD64" ; # defa
9490: 75 6c 74 20 74 6f 20 41 4d 44 36 34 20 36 34 2d  ult to AMD64 64-
94a0: 62 69 74 20 62 75 69 6c 64 0a 09 09 09 50 41 54  bit build....PAT
94b0: 48 36 34 3d 22 24 7b 4d 53 53 44 4b 7d 2f 42 69  H64="${MSSDK}/Bi
94c0: 6e 2f 57 69 6e 36 34 2f 78 38 36 2f 41 4d 44 36  n/Win64/x86/AMD6
94d0: 34 22 0a 09 09 09 3b 3b 0a 09 09 20 20 20 20 69  4"....;;...    i
94e0: 61 36 34 29 0a 09 09 09 4d 41 43 48 49 4e 45 3d  a64)....MACHINE=
94f0: 22 49 41 36 34 22 0a 09 09 09 50 41 54 48 36 34  "IA64"....PATH64
9500: 3d 22 24 7b 4d 53 53 44 4b 7d 2f 42 69 6e 2f 57  ="${MSSDK}/Bin/W
9510: 69 6e 36 34 22 0a 09 09 09 3b 3b 0a 09 09 65 73  in64"....;;...es
9520: 61 63 0a 09 09 69 66 20 74 65 73 74 20 22 24 47  ac...if test "$G
9530: 43 43 22 20 21 3d 20 22 79 65 73 22 20 2d 61 20  CC" != "yes" -a 
9540: 21 20 2d 64 20 22 24 7b 50 41 54 48 36 34 7d 22  ! -d "${PATH64}"
9550: 20 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 41 43   ; then...    AC
9560: 5f 4d 53 47 5f 57 41 52 4e 28 5b 43 6f 75 6c 64  _MSG_WARN([Could
9570: 20 6e 6f 74 20 66 69 6e 64 20 36 34 2d 62 69 74   not find 64-bit
9580: 20 24 4d 41 43 48 49 4e 45 20 53 44 4b 20 74 6f   $MACHINE SDK to
9590: 20 65 6e 61 62 6c 65 20 36 34 62 69 74 20 6d 6f   enable 64bit mo
95a0: 64 65 5d 29 0a 09 09 20 20 20 20 41 43 5f 4d 53  de])...    AC_MS
95b0: 47 5f 57 41 52 4e 28 5b 45 6e 73 75 72 65 20 6c  G_WARN([Ensure l
95c0: 61 74 65 73 74 20 50 6c 61 74 66 6f 72 6d 20 53  atest Platform S
95d0: 44 4b 20 69 73 20 69 6e 73 74 61 6c 6c 65 64 5d  DK is installed]
95e0: 29 0a 09 09 20 20 20 20 64 6f 36 34 62 69 74 3d  )...    do64bit=
95f0: 22 6e 6f 22 0a 09 09 65 6c 73 65 0a 09 09 20 20  "no"...else...  
9600: 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28    AC_MSG_RESULT(
9610: 5b 20 20 20 55 73 69 6e 67 20 36 34 2d 62 69 74  [   Using 64-bit
9620: 20 24 4d 41 43 48 49 4e 45 20 6d 6f 64 65 5d 29   $MACHINE mode])
9630: 0a 09 09 20 20 20 20 64 6f 36 34 62 69 74 5f 6f  ...    do64bit_o
9640: 6b 3d 22 79 65 73 22 0a 09 09 66 69 0a 09 20 20  k="yes"...fi..  
9650: 20 20 66 69 0a 0a 09 20 20 20 20 69 66 20 74 65    fi...    if te
9660: 73 74 20 22 24 64 6f 57 69 6e 63 65 22 20 21 3d  st "$doWince" !=
9670: 20 22 6e 6f 22 20 3b 20 74 68 65 6e 0a 09 09 69   "no" ; then...i
9680: 66 20 74 65 73 74 20 22 24 64 6f 36 34 62 69 74  f test "$do64bit
9690: 22 20 21 3d 20 22 6e 6f 22 20 3b 20 74 68 65 6e  " != "no" ; then
96a0: 0a 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 45 52  ...    AC_MSG_ER
96b0: 52 4f 52 28 5b 57 69 6e 64 6f 77 73 2f 43 45 20  ROR([Windows/CE 
96c0: 61 6e 64 20 36 34 2d 62 69 74 20 62 75 69 6c 64  and 64-bit build
96d0: 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 5d 29  s incompatible])
96e0: 0a 09 09 66 69 0a 09 09 69 66 20 74 65 73 74 20  ...fi...if test 
96f0: 22 24 47 43 43 22 20 3d 20 22 79 65 73 22 20 3b  "$GCC" = "yes" ;
9700: 20 74 68 65 6e 0a 09 09 20 20 20 20 41 43 5f 4d   then...    AC_M
9710: 53 47 5f 45 52 52 4f 52 28 5b 57 69 6e 64 6f 77  SG_ERROR([Window
9720: 73 2f 43 45 20 61 6e 64 20 47 43 43 20 62 75 69  s/CE and GCC bui
9730: 6c 64 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65  lds incompatible
9740: 5d 29 0a 09 09 66 69 0a 09 09 54 45 41 5f 50 41  ])...fi...TEA_PA
9750: 54 48 5f 43 45 4c 49 42 0a 09 09 23 20 53 65 74  TH_CELIB...# Set
9760: 20 64 65 66 61 75 6c 74 73 20 66 6f 72 20 63 6f   defaults for co
9770: 6d 6d 6f 6e 20 65 76 63 34 2f 50 50 43 32 30 30  mmon evc4/PPC200
9780: 33 20 73 65 74 75 70 0a 09 09 23 20 43 75 72 72  3 setup...# Curr
9790: 65 6e 74 6c 79 20 54 63 6c 20 72 65 71 75 69 72  ently Tcl requir
97a0: 65 73 20 33 30 30 2b 2c 20 70 6f 73 73 69 62 6c  es 300+, possibl
97b0: 79 20 34 32 30 2b 20 66 6f 72 20 73 6f 63 6b 65  y 420+ for socke
97c0: 74 73 0a 09 09 43 45 56 45 52 53 49 4f 4e 3d 34  ts...CEVERSION=4
97d0: 32 30 3b 20 09 09 23 20 63 6f 75 6c 64 20 62 65  20; ..# could be
97e0: 20 32 31 31 20 33 30 30 20 33 30 31 20 34 30 30   211 300 301 400
97f0: 20 34 32 30 20 2e 2e 2e 0a 09 09 54 41 52 47 45   420 ......TARGE
9800: 54 43 50 55 3d 41 52 4d 56 34 3b 09 23 20 63 6f  TCPU=ARMV4;.# co
9810: 75 6c 64 20 62 65 20 41 52 4d 56 34 20 41 52 4d  uld be ARMV4 ARM
9820: 20 4d 49 50 53 20 53 48 33 20 58 38 36 20 2e 2e   MIPS SH3 X86 ..
9830: 2e 0a 09 09 41 52 43 48 3d 41 52 4d 3b 09 09 23  ....ARCH=ARM;..#
9840: 20 63 6f 75 6c 64 20 62 65 20 41 52 4d 20 4d 49   could be ARM MI
9850: 50 53 20 58 38 36 45 4d 20 2e 2e 2e 0a 09 09 50  PS X86EM ......P
9860: 4c 41 54 46 4f 52 4d 3d 22 50 6f 63 6b 65 74 20  LATFORM="Pocket 
9870: 50 43 20 32 30 30 33 22 3b 20 23 20 6f 72 20 22  PC 2003"; # or "
9880: 50 6f 63 6b 65 74 20 50 43 20 32 30 30 32 22 0a  Pocket PC 2002".
9890: 09 09 69 66 20 74 65 73 74 20 22 24 64 6f 57 69  ..if test "$doWi
98a0: 6e 63 65 22 20 21 3d 20 22 79 65 73 22 3b 20 74  nce" != "yes"; t
98b0: 68 65 6e 0a 09 09 20 20 20 20 23 20 49 66 20 21  hen...    # If !
98c0: 79 65 73 20 74 68 65 6e 20 74 68 65 20 75 73 65  yes then the use
98d0: 72 20 73 70 65 63 69 66 69 65 64 20 73 6f 6d 65  r specified some
98e0: 74 68 69 6e 67 0a 09 09 20 20 20 20 23 20 52 65  thing...    # Re
98f0: 73 65 74 20 41 52 43 48 20 74 6f 20 61 6c 6c 6f  set ARCH to allo
9900: 77 20 75 73 65 72 20 74 6f 20 73 6b 69 70 20 73  w user to skip s
9910: 70 65 63 69 66 79 69 6e 67 20 69 74 0a 09 09 20  pecifying it... 
9920: 20 20 20 41 52 43 48 3d 0a 09 09 20 20 20 20 65     ARCH=...    e
9930: 76 61 6c 20 60 65 63 68 6f 20 24 64 6f 57 69 6e  val `echo $doWin
9940: 63 65 20 7c 20 61 77 6b 20 2d 46 2c 20 27 7b 20  ce | awk -F, '{ 
9950: 5c 0a 09 20 20 20 20 69 66 20 28 6c 65 6e 67 74  \..    if (lengt
9960: 68 28 5b 24 5d 31 29 29 20 7b 20 70 72 69 6e 74  h([$]1)) { print
9970: 66 20 22 43 45 56 45 52 53 49 4f 4e 3d 5c 22 25  f "CEVERSION=\"%
9980: 73 5c 22 5c 6e 22 2c 20 5b 24 5d 31 3b 20 5c 0a  s\"\n", [$]1; \.
9990: 09 20 20 20 20 69 66 20 28 5b 24 5d 31 20 3c 20  .    if ([$]1 < 
99a0: 34 30 30 29 20 20 20 7b 20 70 72 69 6e 74 66 20  400)   { printf 
99b0: 22 50 4c 41 54 46 4f 52 4d 3d 5c 22 50 6f 63 6b  "PLATFORM=\"Pock
99c0: 65 74 20 50 43 20 32 30 30 32 5c 22 5c 6e 22 20  et PC 2002\"\n" 
99d0: 7d 20 7d 3b 20 5c 0a 09 20 20 20 20 69 66 20 28  } }; \..    if (
99e0: 6c 65 6e 67 74 68 28 5b 24 5d 32 29 29 20 7b 20  length([$]2)) { 
99f0: 70 72 69 6e 74 66 20 22 54 41 52 47 45 54 43 50  printf "TARGETCP
9a00: 55 3d 5c 22 25 73 5c 22 5c 6e 22 2c 20 74 6f 75  U=\"%s\"\n", tou
9a10: 70 70 65 72 28 5b 24 5d 32 29 20 7d 3b 20 5c 0a  pper([$]2) }; \.
9a20: 09 20 20 20 20 69 66 20 28 6c 65 6e 67 74 68 28  .    if (length(
9a30: 5b 24 5d 33 29 29 20 7b 20 70 72 69 6e 74 66 20  [$]3)) { printf 
9a40: 22 41 52 43 48 3d 5c 22 25 73 5c 22 5c 6e 22 2c  "ARCH=\"%s\"\n",
9a50: 20 74 6f 75 70 70 65 72 28 5b 24 5d 33 29 20 7d   toupper([$]3) }
9a60: 3b 20 5c 0a 09 20 20 20 20 69 66 20 28 6c 65 6e  ; \..    if (len
9a70: 67 74 68 28 5b 24 5d 34 29 29 20 7b 20 70 72 69  gth([$]4)) { pri
9a80: 6e 74 66 20 22 50 4c 41 54 46 4f 52 4d 3d 5c 22  ntf "PLATFORM=\"
9a90: 25 73 5c 22 5c 6e 22 2c 20 5b 24 5d 34 20 7d 3b  %s\"\n", [$]4 };
9aa0: 20 5c 0a 09 09 20 20 20 20 7d 27 60 0a 09 09 20   \...    }'`... 
9ab0: 20 20 20 69 66 20 74 65 73 74 20 22 78 24 7b 41     if test "x${A
9ac0: 52 43 48 7d 22 20 3d 20 22 78 22 20 3b 20 74 68  RCH}" = "x" ; th
9ad0: 65 6e 0a 09 09 09 41 52 43 48 3d 24 54 41 52 47  en....ARCH=$TARG
9ae0: 45 54 43 50 55 3b 0a 09 09 20 20 20 20 66 69 0a  ETCPU;...    fi.
9af0: 09 09 66 69 0a 09 09 4f 53 56 45 52 53 49 4f 4e  ..fi...OSVERSION
9b00: 3d 57 43 45 24 43 45 56 45 52 53 49 4f 4e 3b 0a  =WCE$CEVERSION;.
9b10: 09 20 20 20 20 09 69 66 20 74 65 73 74 20 22 78  .    .if test "x
9b20: 24 7b 57 43 45 52 4f 4f 54 7d 22 20 3d 20 22 78  ${WCEROOT}" = "x
9b30: 22 20 3b 20 74 68 65 6e 0a 09 09 09 57 43 45 52  " ; then....WCER
9b40: 4f 4f 54 3d 22 43 3a 2f 50 72 6f 67 72 61 6d 20  OOT="C:/Program 
9b50: 46 69 6c 65 73 2f 4d 69 63 72 6f 73 6f 66 74 20  Files/Microsoft 
9b60: 65 4d 62 65 64 64 65 64 20 43 2b 2b 20 34 2e 30  eMbedded C++ 4.0
9b70: 22 0a 09 09 20 20 20 20 69 66 20 74 65 73 74 20  "...    if test 
9b80: 21 20 2d 64 20 22 24 7b 57 43 45 52 4f 4f 54 7d  ! -d "${WCEROOT}
9b90: 22 20 3b 20 74 68 65 6e 0a 09 09 09 57 43 45 52  " ; then....WCER
9ba0: 4f 4f 54 3d 22 43 3a 2f 50 72 6f 67 72 61 6d 20  OOT="C:/Program 
9bb0: 46 69 6c 65 73 2f 4d 69 63 72 6f 73 6f 66 74 20  Files/Microsoft 
9bc0: 65 4d 62 65 64 64 65 64 20 54 6f 6f 6c 73 22 0a  eMbedded Tools".
9bd0: 09 09 20 20 20 20 66 69 0a 09 09 66 69 0a 09 09  ..    fi...fi...
9be0: 69 66 20 74 65 73 74 20 22 78 24 7b 53 44 4b 52  if test "x${SDKR
9bf0: 4f 4f 54 7d 22 20 3d 20 22 78 22 20 3b 20 74 68  OOT}" = "x" ; th
9c00: 65 6e 0a 09 09 20 20 20 20 53 44 4b 52 4f 4f 54  en...    SDKROOT
9c10: 3d 22 43 3a 2f 50 72 6f 67 72 61 6d 20 46 69 6c  ="C:/Program Fil
9c20: 65 73 2f 57 69 6e 64 6f 77 73 20 43 45 20 54 6f  es/Windows CE To
9c30: 6f 6c 73 22 0a 09 09 20 20 20 20 69 66 20 74 65  ols"...    if te
9c40: 73 74 20 21 20 2d 64 20 22 24 7b 53 44 4b 52 4f  st ! -d "${SDKRO
9c50: 4f 54 7d 22 20 3b 20 74 68 65 6e 0a 09 09 09 53  OT}" ; then....S
9c60: 44 4b 52 4f 4f 54 3d 22 43 3a 2f 57 69 6e 64 6f  DKROOT="C:/Windo
9c70: 77 73 20 43 45 20 54 6f 6f 6c 73 22 0a 09 09 20  ws CE Tools"... 
9c80: 20 20 20 66 69 0a 09 09 66 69 0a 09 09 57 43 45     fi...fi...WCE
9c90: 52 4f 4f 54 3d 60 65 63 68 6f 20 22 24 57 43 45  ROOT=`echo "$WCE
9ca0: 52 4f 4f 54 22 20 7c 20 73 65 64 20 2d 65 20 27  ROOT" | sed -e '
9cb0: 73 21 5c 5c 5c 21 2f 21 67 27 60 0a 09 09 53 44  s!\\\!/!g'`...SD
9cc0: 4b 52 4f 4f 54 3d 60 65 63 68 6f 20 22 24 53 44  KROOT=`echo "$SD
9cd0: 4b 52 4f 4f 54 22 20 7c 20 73 65 64 20 2d 65 20  KROOT" | sed -e 
9ce0: 27 73 21 5c 5c 5c 21 2f 21 67 27 60 0a 09 09 69  's!\\\!/!g'`...i
9cf0: 66 20 74 65 73 74 20 21 20 2d 64 20 22 24 7b 53  f test ! -d "${S
9d00: 44 4b 52 4f 4f 54 7d 2f 24 7b 4f 53 56 45 52 53  DKROOT}/${OSVERS
9d10: 49 4f 4e 7d 2f 24 7b 50 4c 41 54 46 4f 52 4d 7d  ION}/${PLATFORM}
9d20: 2f 4c 69 62 2f 24 7b 54 41 52 47 45 54 43 50 55  /Lib/${TARGETCPU
9d30: 7d 22 20 5c 0a 09 09 20 20 20 20 2d 6f 20 21 20  }" \...    -o ! 
9d40: 2d 64 20 22 24 7b 57 43 45 52 4f 4f 54 7d 2f 45  -d "${WCEROOT}/E
9d50: 56 43 2f 24 7b 4f 53 56 45 52 53 49 4f 4e 7d 2f  VC/${OSVERSION}/
9d60: 62 69 6e 22 3b 20 74 68 65 6e 0a 09 09 20 20 20  bin"; then...   
9d70: 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 63   AC_MSG_ERROR([c
9d80: 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64 20 50 6f  ould not find Po
9d90: 63 6b 65 74 50 43 20 53 44 4b 20 6f 72 20 74 61  cketPC SDK or ta
9da0: 72 67 65 74 20 63 6f 6d 70 69 6c 65 72 20 74 6f  rget compiler to
9db0: 20 65 6e 61 62 6c 65 20 57 69 6e 43 45 20 6d 6f   enable WinCE mo
9dc0: 64 65 20 5b 24 43 45 56 45 52 53 49 4f 4e 2c 24  de [$CEVERSION,$
9dd0: 54 41 52 47 45 54 43 50 55 2c 24 41 52 43 48 2c  TARGETCPU,$ARCH,
9de0: 24 50 4c 41 54 46 4f 52 4d 5d 5d 29 0a 09 09 20  $PLATFORM]])... 
9df0: 20 20 20 64 6f 57 69 6e 63 65 3d 22 6e 6f 22 0a     doWince="no".
9e00: 09 09 65 6c 73 65 0a 09 09 20 20 20 20 23 20 57  ..else...    # W
9e10: 65 20 63 6f 75 6c 64 20 50 41 54 48 5f 4e 4f 53  e could PATH_NOS
9e20: 50 41 43 45 20 74 68 65 73 65 2c 20 62 75 74 20  PACE these, but 
9e30: 74 68 61 74 27 73 20 6e 6f 74 20 69 6d 70 6f 72  that's not impor
9e40: 74 61 6e 74 2c 0a 09 09 20 20 20 20 23 20 61 73  tant,...    # as
9e50: 20 6c 6f 6e 67 20 61 73 20 77 65 20 71 75 6f 74   long as we quot
9e60: 65 20 74 68 65 6d 20 77 68 65 6e 20 75 73 65 64  e them when used
9e70: 2e 0a 09 09 20 20 20 20 43 45 49 4e 43 4c 55 44  ....    CEINCLUD
9e80: 45 3d 22 24 7b 53 44 4b 52 4f 4f 54 7d 2f 24 7b  E="${SDKROOT}/${
9e90: 4f 53 56 45 52 53 49 4f 4e 7d 2f 24 7b 50 4c 41  OSVERSION}/${PLA
9ea0: 54 46 4f 52 4d 7d 2f 69 6e 63 6c 75 64 65 22 0a  TFORM}/include".
9eb0: 09 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 64  ..    if test -d
9ec0: 20 22 24 7b 43 45 49 4e 43 4c 55 44 45 7d 2f 24   "${CEINCLUDE}/$
9ed0: 7b 54 41 52 47 45 54 43 50 55 7d 22 20 3b 20 74  {TARGETCPU}" ; t
9ee0: 68 65 6e 0a 09 09 09 43 45 49 4e 43 4c 55 44 45  hen....CEINCLUDE
9ef0: 3d 22 24 7b 43 45 49 4e 43 4c 55 44 45 7d 2f 24  ="${CEINCLUDE}/$
9f00: 7b 54 41 52 47 45 54 43 50 55 7d 22 0a 09 09 20  {TARGETCPU}"... 
9f10: 20 20 20 66 69 0a 09 09 20 20 20 20 43 45 4c 49     fi...    CELI
9f20: 42 50 41 54 48 3d 22 24 7b 53 44 4b 52 4f 4f 54  BPATH="${SDKROOT
9f30: 7d 2f 24 7b 4f 53 56 45 52 53 49 4f 4e 7d 2f 24  }/${OSVERSION}/$
9f40: 7b 50 4c 41 54 46 4f 52 4d 7d 2f 4c 69 62 2f 24  {PLATFORM}/Lib/$
9f50: 7b 54 41 52 47 45 54 43 50 55 7d 22 0a 20 20 20  {TARGETCPU}".   
9f60: 20 09 09 66 69 0a 09 20 20 20 20 66 69 0a 0a 09   ..fi..    fi...
9f70: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 47 43      if test "$GC
9f80: 43 22 20 21 3d 20 22 79 65 73 22 20 3b 20 74 68  C" != "yes" ; th
9f90: 65 6e 0a 09 20 20 20 20 20 20 20 20 69 66 20 74  en..        if t
9fa0: 65 73 74 20 22 24 7b 53 48 41 52 45 44 5f 42 55  est "${SHARED_BU
9fb0: 49 4c 44 7d 22 20 3d 20 22 30 22 20 3b 20 74 68  ILD}" = "0" ; th
9fc0: 65 6e 0a 09 09 20 20 20 20 72 75 6e 74 69 6d 65  en...    runtime
9fd0: 3d 2d 4d 54 0a 09 20 20 20 20 20 20 20 20 65 6c  =-MT..        el
9fe0: 73 65 0a 09 09 20 20 20 20 72 75 6e 74 69 6d 65  se...    runtime
9ff0: 3d 2d 4d 44 0a 09 20 20 20 20 20 20 20 20 66 69  =-MD..        fi
a000: 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ..              
a010: 20 20 69 66 20 74 65 73 74 20 22 24 64 6f 36 34    if test "$do64
a020: 62 69 74 22 20 21 3d 20 22 6e 6f 22 20 3b 20 74  bit" != "no" ; t
a030: 68 65 6e 0a 09 09 20 20 20 20 23 20 41 6c 6c 20  hen...    # All 
a040: 74 68 69 73 20 6d 61 67 69 63 20 69 73 20 6e 65  this magic is ne
a050: 63 65 73 73 61 72 79 20 66 6f 72 20 74 68 65 20  cessary for the 
a060: 57 69 6e 36 34 20 53 44 4b 20 52 43 31 20 2d 20  Win64 SDK RC1 - 
a070: 68 6f 62 62 73 0a 09 09 20 20 20 20 43 43 3d 22  hobbs...    CC="
a080: 5c 22 24 7b 50 41 54 48 36 34 7d 2f 63 6c 2e 65  \"${PATH64}/cl.e
a090: 78 65 5c 22 22 0a 09 09 20 20 20 20 43 46 4c 41  xe\""...    CFLA
a0a0: 47 53 3d 22 24 7b 43 46 4c 41 47 53 7d 20 2d 49  GS="${CFLAGS} -I
a0b0: 5c 22 24 7b 4d 53 53 44 4b 7d 2f 49 6e 63 6c 75  \"${MSSDK}/Inclu
a0c0: 64 65 5c 22 20 2d 49 5c 22 24 7b 4d 53 53 44 4b  de\" -I\"${MSSDK
a0d0: 7d 2f 49 6e 63 6c 75 64 65 2f 63 72 74 5c 22 20  }/Include/crt\" 
a0e0: 2d 49 5c 22 24 7b 4d 53 53 44 4b 7d 2f 49 6e 63  -I\"${MSSDK}/Inc
a0f0: 6c 75 64 65 2f 63 72 74 2f 73 79 73 5c 22 22 0a  lude/crt/sys\"".
a100: 09 09 20 20 20 20 52 43 3d 22 5c 22 24 7b 4d 53  ..    RC="\"${MS
a110: 53 44 4b 7d 2f 62 69 6e 2f 72 63 2e 65 78 65 5c  SDK}/bin/rc.exe\
a120: 22 22 0a 09 09 20 20 20 20 6c 66 6c 61 67 73 3d  ""...    lflags=
a130: 22 2d 6e 6f 6c 6f 67 6f 20 2d 4d 41 43 48 49 4e  "-nologo -MACHIN
a140: 45 3a 24 7b 4d 41 43 48 49 4e 45 7d 20 2d 4c 49  E:${MACHINE} -LI
a150: 42 50 41 54 48 3a 5c 22 24 7b 4d 53 53 44 4b 7d  BPATH:\"${MSSDK}
a160: 2f 4c 69 62 2f 24 7b 4d 41 43 48 49 4e 45 7d 5c  /Lib/${MACHINE}\
a170: 22 22 0a 09 09 20 20 20 20 4c 49 4e 4b 42 49 4e  ""...    LINKBIN
a180: 3d 22 5c 22 24 7b 50 41 54 48 36 34 7d 2f 6c 69  ="\"${PATH64}/li
a190: 6e 6b 2e 65 78 65 5c 22 22 0a 09 09 20 20 20 20  nk.exe\""...    
a1a0: 43 46 4c 41 47 53 5f 44 45 42 55 47 3d 22 2d 6e  CFLAGS_DEBUG="-n
a1b0: 6f 6c 6f 67 6f 20 2d 5a 69 20 2d 4f 64 20 2d 57  ologo -Zi -Od -W
a1c0: 33 20 24 7b 72 75 6e 74 69 6d 65 7d 64 22 0a 09  3 ${runtime}d"..
a1d0: 09 20 20 20 20 43 46 4c 41 47 53 5f 4f 50 54 49  .    CFLAGS_OPTI
a1e0: 4d 49 5a 45 3d 22 2d 6e 6f 6c 6f 67 6f 20 2d 4f  MIZE="-nologo -O
a1f0: 32 20 2d 57 32 20 24 7b 72 75 6e 74 69 6d 65 7d  2 -W2 ${runtime}
a200: 22 0a 09 09 20 20 20 20 23 20 41 76 6f 69 64 20  "...    # Avoid 
a210: 27 75 6e 72 65 73 6f 6c 76 65 64 20 65 78 74 65  'unresolved exte
a220: 72 6e 61 6c 20 73 79 6d 62 6f 6c 20 5f 5f 73 65  rnal symbol __se
a230: 63 75 72 69 74 79 5f 63 6f 6f 6b 69 65 27 0a 09  curity_cookie'..
a240: 09 20 20 20 20 23 20 65 72 72 6f 72 73 2c 20 63  .    # errors, c
a250: 2e 66 2e 20 68 74 74 70 3a 2f 2f 73 75 70 70 6f  .f. http://suppo
a260: 72 74 2e 6d 69 63 72 6f 73 6f 66 74 2e 63 6f 6d  rt.microsoft.com
a270: 2f 3f 69 64 3d 38 39 34 35 37 33 0a 09 09 20 20  /?id=894573...  
a280: 20 20 54 45 41 5f 41 44 44 5f 4c 49 42 53 28 5b    TEA_ADD_LIBS([
a290: 62 75 66 66 65 72 6f 76 65 72 66 6c 6f 77 55 2e  bufferoverflowU.
a2a0: 6c 69 62 5d 29 0a 09 09 65 6c 69 66 20 74 65 73  lib])...elif tes
a2b0: 74 20 22 24 64 6f 57 69 6e 63 65 22 20 21 3d 20  t "$doWince" != 
a2c0: 22 6e 6f 22 20 3b 20 74 68 65 6e 0a 09 09 20 20  "no" ; then...  
a2d0: 20 20 43 45 42 49 4e 52 4f 4f 54 3d 22 24 7b 57    CEBINROOT="${W
a2e0: 43 45 52 4f 4f 54 7d 2f 45 56 43 2f 24 7b 4f 53  CEROOT}/EVC/${OS
a2f0: 56 45 52 53 49 4f 4e 7d 2f 62 69 6e 22 0a 09 09  VERSION}/bin"...
a300: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b 54      if test "${T
a310: 41 52 47 45 54 43 50 55 7d 22 20 3d 20 22 58 38  ARGETCPU}" = "X8
a320: 36 22 3b 20 74 68 65 6e 0a 09 09 09 43 43 3d 22  6"; then....CC="
a330: 5c 22 24 7b 43 45 42 49 4e 52 4f 4f 54 7d 2f 63  \"${CEBINROOT}/c
a340: 6c 2e 65 78 65 5c 22 22 0a 09 09 20 20 20 20 65  l.exe\""...    e
a350: 6c 73 65 0a 09 09 09 43 43 3d 22 5c 22 24 7b 43  lse....CC="\"${C
a360: 45 42 49 4e 52 4f 4f 54 7d 2f 63 6c 24 7b 41 52  EBINROOT}/cl${AR
a370: 43 48 7d 2e 65 78 65 5c 22 22 0a 09 09 20 20 20  CH}.exe\""...   
a380: 20 66 69 0a 09 09 20 20 20 20 43 46 4c 41 47 53   fi...    CFLAGS
a390: 3d 22 24 43 46 4c 41 47 53 20 2d 49 5c 22 24 7b  ="$CFLAGS -I\"${
a3a0: 43 45 4c 49 42 5f 44 49 52 7d 2f 69 6e 63 5c 22  CELIB_DIR}/inc\"
a3b0: 20 2d 49 5c 22 24 7b 43 45 49 4e 43 4c 55 44 45   -I\"${CEINCLUDE
a3c0: 7d 5c 22 22 0a 09 09 20 20 20 20 52 43 3d 22 5c  }\""...    RC="\
a3d0: 22 24 7b 57 43 45 52 4f 4f 54 7d 2f 43 6f 6d 6d  "${WCEROOT}/Comm
a3e0: 6f 6e 2f 45 56 43 2f 62 69 6e 2f 72 63 2e 65 78  on/EVC/bin/rc.ex
a3f0: 65 5c 22 22 0a 09 09 20 20 20 20 61 72 63 68 3d  e\""...    arch=
a400: 60 65 63 68 6f 20 24 7b 41 52 43 48 7d 20 7c 20  `echo ${ARCH} | 
a410: 61 77 6b 20 27 7b 70 72 69 6e 74 20 74 6f 6c 6f  awk '{print tolo
a420: 77 65 72 28 5b 24 5d 30 29 7d 27 60 0a 09 09 20  wer([$]0)}'`... 
a430: 20 20 20 64 65 66 73 3d 22 24 7b 41 52 43 48 7d     defs="${ARCH}
a440: 20 5f 24 7b 41 52 43 48 7d 5f 20 24 7b 61 72 63   _${ARCH}_ ${arc
a450: 68 7d 20 50 41 4c 4d 5f 53 49 5a 45 20 5f 4d 54  h} PALM_SIZE _MT
a460: 20 5f 57 49 4e 44 4f 57 53 22 0a 09 09 20 20 20   _WINDOWS"...   
a470: 20 69 66 20 74 65 73 74 20 22 24 7b 53 48 41 52   if test "${SHAR
a480: 45 44 5f 42 55 49 4c 44 7d 22 20 3d 20 22 31 22  ED_BUILD}" = "1"
a490: 20 3b 20 74 68 65 6e 0a 09 09 09 23 20 53 74 61   ; then....# Sta
a4a0: 74 69 63 20 43 45 20 62 75 69 6c 64 73 20 72 65  tic CE builds re
a4b0: 71 75 69 72 65 20 73 74 61 74 69 63 20 63 65 6c  quire static cel
a4c0: 69 62 20 61 73 20 77 65 6c 6c 0a 09 09 20 20 20  ib as well...   
a4d0: 20 09 64 65 66 73 3d 22 24 7b 64 65 66 73 7d 20   .defs="${defs} 
a4e0: 5f 44 4c 4c 22 0a 09 09 20 20 20 20 66 69 0a 09  _DLL"...    fi..
a4f0: 09 20 20 20 20 66 6f 72 20 69 20 69 6e 20 24 64  .    for i in $d
a500: 65 66 73 20 3b 20 64 6f 0a 09 09 09 41 43 5f 44  efs ; do....AC_D
a510: 45 46 49 4e 45 5f 55 4e 51 55 4f 54 45 44 28 24  EFINE_UNQUOTED($
a520: 69 2c 20 31 2c 20 5b 57 69 6e 43 45 20 64 65 66  i, 1, [WinCE def
a530: 20 5d 24 69 29 0a 09 09 20 20 20 20 64 6f 6e 65   ]$i)...    done
a540: 0a 09 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45  ...    AC_DEFINE
a550: 5f 55 4e 51 55 4f 54 45 44 28 5f 57 49 4e 33 32  _UNQUOTED(_WIN32
a560: 5f 57 43 45 2c 20 24 43 45 56 45 52 53 49 4f 4e  _WCE, $CEVERSION
a570: 2c 20 5b 5f 57 49 4e 33 32 5f 57 43 45 20 76 65  , [_WIN32_WCE ve
a580: 72 73 69 6f 6e 5d 29 0a 09 09 20 20 20 20 41 43  rsion])...    AC
a590: 5f 44 45 46 49 4e 45 5f 55 4e 51 55 4f 54 45 44  _DEFINE_UNQUOTED
a5a0: 28 55 4e 44 45 52 5f 43 45 2c 20 24 43 45 56 45  (UNDER_CE, $CEVE
a5b0: 52 53 49 4f 4e 2c 20 5b 55 4e 44 45 52 5f 43 45  RSION, [UNDER_CE
a5c0: 20 76 65 72 73 69 6f 6e 5d 29 0a 09 09 20 20 20   version])...   
a5d0: 20 43 46 4c 41 47 53 5f 44 45 42 55 47 3d 22 2d   CFLAGS_DEBUG="-
a5e0: 6e 6f 6c 6f 67 6f 20 2d 5a 69 20 2d 4f 64 22 0a  nologo -Zi -Od".
a5f0: 09 09 20 20 20 20 43 46 4c 41 47 53 5f 4f 50 54  ..    CFLAGS_OPT
a600: 49 4d 49 5a 45 3d 22 2d 6e 6f 6c 6f 67 6f 20 2d  IMIZE="-nologo -
a610: 4f 78 22 0a 09 09 20 20 20 20 6c 76 65 72 73 69  Ox"...    lversi
a620: 6f 6e 3d 60 65 63 68 6f 20 24 7b 43 45 56 45 52  on=`echo ${CEVER
a630: 53 49 4f 4e 7d 20 7c 20 73 65 64 20 2d 65 20 27  SION} | sed -e '
a640: 73 2f 5c 28 2e 5c 29 5c 28 2e 2e 5c 29 2f 5c 31  s/\(.\)\(..\)/\1
a650: 5c 2e 5c 32 2f 27 60 0a 09 09 20 20 20 20 6c 66  \.\2/'`...    lf
a660: 6c 61 67 73 3d 22 2d 4d 41 43 48 49 4e 45 3a 24  lags="-MACHINE:$
a670: 7b 41 52 43 48 7d 20 2d 4c 49 42 50 41 54 48 3a  {ARCH} -LIBPATH:
a680: 5c 22 24 7b 43 45 4c 49 42 50 41 54 48 7d 5c 22  \"${CELIBPATH}\"
a690: 20 2d 73 75 62 73 79 73 74 65 6d 3a 77 69 6e 64   -subsystem:wind
a6a0: 6f 77 73 63 65 2c 24 7b 6c 76 65 72 73 69 6f 6e  owsce,${lversion
a6b0: 7d 20 2d 6e 6f 6c 6f 67 6f 22 0a 09 09 20 20 20  } -nologo"...   
a6c0: 20 4c 49 4e 4b 42 49 4e 3d 22 5c 22 24 7b 43 45   LINKBIN="\"${CE
a6d0: 42 49 4e 52 4f 4f 54 7d 2f 6c 69 6e 6b 2e 65 78  BINROOT}/link.ex
a6e0: 65 5c 22 22 0a 09 09 20 20 20 20 41 43 5f 53 55  e\""...    AC_SU
a6f0: 42 53 54 28 43 45 4c 49 42 5f 44 49 52 29 0a 09  BST(CELIB_DIR)..
a700: 09 65 6c 73 65 0a 09 09 20 20 20 20 52 43 3d 22  .else...    RC="
a710: 72 63 22 0a 09 09 20 20 20 20 6c 66 6c 61 67 73  rc"...    lflags
a720: 3d 22 2d 6e 6f 6c 6f 67 6f 22 0a 09 09 20 20 20  ="-nologo"...   
a730: 20 4c 49 4e 4b 42 49 4e 3d 22 6c 69 6e 6b 22 0a   LINKBIN="link".
a740: 09 09 20 20 20 20 43 46 4c 41 47 53 5f 44 45 42  ..    CFLAGS_DEB
a750: 55 47 3d 22 2d 6e 6f 6c 6f 67 6f 20 2d 5a 37 20  UG="-nologo -Z7 
a760: 2d 4f 64 20 2d 57 33 20 2d 57 58 20 24 7b 72 75  -Od -W3 -WX ${ru
a770: 6e 74 69 6d 65 7d 64 22 0a 09 09 20 20 20 20 43  ntime}d"...    C
a780: 46 4c 41 47 53 5f 4f 50 54 49 4d 49 5a 45 3d 22  FLAGS_OPTIMIZE="
a790: 2d 6e 6f 6c 6f 67 6f 20 2d 4f 32 20 2d 57 32 20  -nologo -O2 -W2 
a7a0: 24 7b 72 75 6e 74 69 6d 65 7d 22 0a 09 09 66 69  ${runtime}"...fi
a7b0: 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 69  ..    fi...    i
a7c0: 66 20 74 65 73 74 20 22 24 47 43 43 22 20 3d 20  f test "$GCC" = 
a7d0: 22 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 23 20  "yes"; then...# 
a7e0: 6d 69 6e 67 77 20 67 63 63 20 6d 6f 64 65 0a 09  mingw gcc mode..
a7f0: 09 41 43 5f 43 48 45 43 4b 5f 54 4f 4f 4c 28 52  .AC_CHECK_TOOL(R
a800: 43 2c 20 77 69 6e 64 72 65 73 29 0a 09 09 43 46  C, windres)...CF
a810: 4c 41 47 53 5f 44 45 42 55 47 3d 22 2d 67 22 0a  LAGS_DEBUG="-g".
a820: 09 09 43 46 4c 41 47 53 5f 4f 50 54 49 4d 49 5a  ..CFLAGS_OPTIMIZ
a830: 45 3d 22 2d 4f 32 20 2d 66 6f 6d 69 74 2d 66 72  E="-O2 -fomit-fr
a840: 61 6d 65 2d 70 6f 69 6e 74 65 72 22 0a 09 09 53  ame-pointer"...S
a850: 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d  HLIB_LD='${CC} -
a860: 73 68 61 72 65 64 27 0a 09 09 55 4e 53 48 41 52  shared'...UNSHAR
a870: 45 44 5f 4c 49 42 5f 53 55 46 46 49 58 3d 27 24  ED_LIB_SUFFIX='$
a880: 7b 54 43 4c 5f 54 52 49 4d 5f 44 4f 54 53 7d 2e  {TCL_TRIM_DOTS}.
a890: 61 27 0a 09 09 4c 44 46 4c 41 47 53 5f 43 4f 4e  a'...LDFLAGS_CON
a8a0: 53 4f 4c 45 3d 22 2d 77 6c 2c 2d 2d 73 75 62 73  SOLE="-wl,--subs
a8b0: 79 73 74 65 6d 2c 63 6f 6e 73 6f 6c 65 20 24 7b  ystem,console ${
a8c0: 6c 66 6c 61 67 73 7d 22 0a 09 09 4c 44 46 4c 41  lflags}"...LDFLA
a8d0: 47 53 5f 57 49 4e 44 4f 57 3d 22 2d 77 6c 2c 2d  GS_WINDOW="-wl,-
a8e0: 2d 73 75 62 73 79 73 74 65 6d 2c 77 69 6e 64 6f  -subsystem,windo
a8f0: 77 73 20 24 7b 6c 66 6c 61 67 73 7d 22 0a 0a 09  ws ${lflags}"...
a900: 09 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28  .AC_CACHE_CHECK(
a910: 66 6f 72 20 63 72 6f 73 73 2d 63 6f 6d 70 69 6c  for cross-compil
a920: 65 20 76 65 72 73 69 6f 6e 20 6f 66 20 67 63 63  e version of gcc
a930: 2c 0a 09 09 09 61 63 5f 63 76 5f 63 72 6f 73 73  ,....ac_cv_cross
a940: 2c 0a 09 09 09 41 43 5f 54 52 59 5f 43 4f 4d 50  ,....AC_TRY_COMP
a950: 49 4c 45 28 5b 0a 09 09 09 20 20 20 20 23 69 66  ILE([....    #if
a960: 64 65 66 20 5f 57 49 4e 33 32 0a 09 09 09 09 23  def _WIN32.....#
a970: 65 72 72 6f 72 20 63 72 6f 73 73 2d 63 6f 6d 70  error cross-comp
a980: 69 6c 65 72 0a 09 09 09 20 20 20 20 23 65 6e 64  iler....    #end
a990: 69 66 0a 09 09 09 5d 2c 20 5b 5d 2c 0a 09 09 09  if....], [],....
a9a0: 61 63 5f 63 76 5f 63 72 6f 73 73 3d 79 65 73 2c  ac_cv_cross=yes,
a9b0: 0a 09 09 09 61 63 5f 63 76 5f 63 72 6f 73 73 3d  ....ac_cv_cross=
a9c0: 6e 6f 29 0a 09 09 20 20 20 20 20 20 29 0a 09 09  no)...      )...
a9d0: 20 20 20 20 20 20 69 66 20 74 65 73 74 20 22 24        if test "$
a9e0: 61 63 5f 63 76 5f 63 72 6f 73 73 22 20 3d 20 22  ac_cv_cross" = "
a9f0: 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 09 63 61  yes"; then....ca
aa00: 73 65 20 22 24 64 6f 36 34 62 69 74 22 20 69 6e  se "$do64bit" in
aa10: 0a 09 09 09 20 20 20 20 61 6d 64 36 34 7c 78 36  ....    amd64|x6
aa20: 34 7c 79 65 73 29 0a 09 09 09 09 43 43 3d 22 78  4|yes).....CC="x
aa30: 38 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33  86_64-w64-mingw3
aa40: 32 2d 67 63 63 22 0a 09 09 09 09 4c 44 3d 22 78  2-gcc".....LD="x
aa50: 38 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33  86_64-w64-mingw3
aa60: 32 2d 6c 64 22 0a 09 09 09 09 41 52 3d 22 78 38  2-ld".....AR="x8
aa70: 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33 32  6_64-w64-mingw32
aa80: 2d 61 72 22 0a 09 09 09 09 52 41 4e 4c 49 42 3d  -ar".....RANLIB=
aa90: 22 78 38 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67  "x86_64-w64-ming
aaa0: 77 33 32 2d 72 61 6e 6c 69 62 22 0a 09 09 09 09  w32-ranlib".....
aab0: 52 43 3d 22 78 38 36 5f 36 34 2d 77 36 34 2d 6d  RC="x86_64-w64-m
aac0: 69 6e 67 77 33 32 2d 77 69 6e 64 72 65 73 22 0a  ingw32-windres".
aad0: 09 09 09 20 20 20 20 3b 3b 0a 09 09 09 20 20 20  ...    ;;....   
aae0: 20 2a 29 0a 09 09 09 09 43 43 3d 22 69 36 38 36   *).....CC="i686
aaf0: 2d 77 36 34 2d 6d 69 6e 67 77 33 32 2d 67 63 63  -w64-mingw32-gcc
ab00: 22 0a 09 09 09 09 4c 44 3d 22 69 36 38 36 2d 77  ".....LD="i686-w
ab10: 36 34 2d 6d 69 6e 67 77 33 32 2d 6c 64 22 0a 09  64-mingw32-ld"..
ab20: 09 09 09 41 52 3d 22 69 36 38 36 2d 77 36 34 2d  ...AR="i686-w64-
ab30: 6d 69 6e 67 77 33 32 2d 61 72 22 0a 09 09 09 09  mingw32-ar".....
ab40: 52 41 4e 4c 49 42 3d 22 69 36 38 36 2d 77 36 34  RANLIB="i686-w64
ab50: 2d 6d 69 6e 67 77 33 32 2d 72 61 6e 6c 69 62 22  -mingw32-ranlib"
ab60: 0a 09 09 09 09 52 43 3d 22 69 36 38 36 2d 77 36  .....RC="i686-w6
ab70: 34 2d 6d 69 6e 67 77 33 32 2d 77 69 6e 64 72 65  4-mingw32-windre
ab80: 73 22 0a 09 09 09 20 20 20 20 3b 3b 0a 09 09 09  s"....    ;;....
ab90: 65 73 61 63 0a 09 09 66 69 0a 0a 09 20 20 20 20  esac...fi...    
aba0: 65 6c 73 65 0a 09 09 53 48 4c 49 42 5f 4c 44 3d  else...SHLIB_LD=
abb0: 22 24 7b 4c 49 4e 4b 42 49 4e 7d 20 2d 64 6c 6c  "${LINKBIN} -dll
abc0: 20 24 7b 6c 66 6c 61 67 73 7d 22 0a 09 09 23 20   ${lflags}"...# 
abd0: 6c 69 6e 6b 20 2d 6c 69 62 20 6f 6e 6c 79 20 77  link -lib only w
abe0: 6f 72 6b 73 20 77 68 65 6e 20 2d 6c 69 62 20 69  orks when -lib i
abf0: 73 20 74 68 65 20 66 69 72 73 74 20 61 72 67 0a  s the first arg.
ac00: 09 09 53 54 4c 49 42 5f 4c 44 3d 22 24 7b 4c 49  ..STLIB_LD="${LI
ac10: 4e 4b 42 49 4e 7d 20 2d 6c 69 62 20 24 7b 6c 66  NKBIN} -lib ${lf
ac20: 6c 61 67 73 7d 22 0a 09 09 55 4e 53 48 41 52 45  lags}"...UNSHARE
ac30: 44 5f 4c 49 42 5f 53 55 46 46 49 58 3d 27 24 7b  D_LIB_SUFFIX='${
ac40: 54 43 4c 5f 54 52 49 4d 5f 44 4f 54 53 7d 2e 6c  TCL_TRIM_DOTS}.l
ac50: 69 62 27 0a 09 09 50 41 54 48 54 59 50 45 3d 2d  ib'...PATHTYPE=-
ac60: 77 0a 09 09 23 20 46 6f 72 20 69 6e 66 6f 72 6d  w...# For inform
ac70: 61 74 69 6f 6e 20 6f 6e 20 77 68 61 74 20 64 65  ation on what de
ac80: 62 75 67 74 79 70 65 20 69 73 20 6d 6f 73 74 20  bugtype is most 
ac90: 75 73 65 66 75 6c 2c 20 73 65 65 3a 0a 09 09 23  useful, see:...#
aca0: 20 68 74 74 70 3a 2f 2f 6d 73 64 6e 2e 6d 69 63   http://msdn.mic
acb0: 72 6f 73 6f 66 74 2e 63 6f 6d 2f 6c 69 62 72 61  rosoft.com/libra
acc0: 72 79 2f 65 6e 2d 75 73 2f 64 6e 76 63 36 30 2f  ry/en-us/dnvc60/
acd0: 68 74 6d 6c 2f 67 65 6e 64 65 70 64 65 62 75 67  html/gendepdebug
ace0: 2e 61 73 70 0a 09 09 23 20 61 6e 64 20 61 6c 73  .asp...# and als
acf0: 6f 0a 09 09 23 20 68 74 74 70 3a 2f 2f 6d 73 64  o...# http://msd
ad00: 6e 32 2e 6d 69 63 72 6f 73 6f 66 74 2e 63 6f 6d  n2.microsoft.com
ad10: 2f 65 6e 2d 75 73 2f 6c 69 62 72 61 72 79 2f 79  /en-us/library/y
ad20: 30 7a 7a 62 79 74 34 25 32 38 56 53 2e 38 30 25  0zzbyt4%28VS.80%
ad30: 32 39 2e 61 73 70 78 0a 09 09 23 20 54 68 69 73  29.aspx...# This
ad40: 20 65 73 73 65 6e 74 69 61 6c 6c 79 20 74 75 72   essentially tur
ad50: 6e 73 20 69 74 20 61 6c 6c 20 6f 6e 2e 0a 09 09  ns it all on....
ad60: 4c 44 46 4c 41 47 53 5f 44 45 42 55 47 3d 22 2d  LDFLAGS_DEBUG="-
ad70: 64 65 62 75 67 20 2d 64 65 62 75 67 74 79 70 65  debug -debugtype
ad80: 3a 63 76 22 0a 09 09 4c 44 46 4c 41 47 53 5f 4f  :cv"...LDFLAGS_O
ad90: 50 54 49 4d 49 5a 45 3d 22 2d 72 65 6c 65 61 73  PTIMIZE="-releas
ada0: 65 22 0a 09 09 69 66 20 74 65 73 74 20 22 24 64  e"...if test "$d
adb0: 6f 57 69 6e 63 65 22 20 21 3d 20 22 6e 6f 22 20  oWince" != "no" 
adc0: 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 4c 44 46  ; then...    LDF
add0: 4c 41 47 53 5f 43 4f 4e 53 4f 4c 45 3d 22 2d 6c  LAGS_CONSOLE="-l
ade0: 69 6e 6b 20 24 7b 6c 66 6c 61 67 73 7d 22 0a 09  ink ${lflags}"..
adf0: 09 20 20 20 20 4c 44 46 4c 41 47 53 5f 57 49 4e  .    LDFLAGS_WIN
ae00: 44 4f 57 3d 24 7b 4c 44 46 4c 41 47 53 5f 43 4f  DOW=${LDFLAGS_CO
ae10: 4e 53 4f 4c 45 7d 0a 09 09 65 6c 73 65 0a 09 09  NSOLE}...else...
ae20: 20 20 20 20 4c 44 46 4c 41 47 53 5f 43 4f 4e 53      LDFLAGS_CONS
ae30: 4f 4c 45 3d 22 2d 6c 69 6e 6b 20 2d 73 75 62 73  OLE="-link -subs
ae40: 79 73 74 65 6d 3a 63 6f 6e 73 6f 6c 65 20 24 7b  ystem:console ${
ae50: 6c 66 6c 61 67 73 7d 22 0a 09 09 20 20 20 20 4c  lflags}"...    L
ae60: 44 46 4c 41 47 53 5f 57 49 4e 44 4f 57 3d 22 2d  DFLAGS_WINDOW="-
ae70: 6c 69 6e 6b 20 2d 73 75 62 73 79 73 74 65 6d 3a  link -subsystem:
ae80: 77 69 6e 64 6f 77 73 20 24 7b 6c 66 6c 61 67 73  windows ${lflags
ae90: 7d 22 0a 09 09 66 69 0a 09 20 20 20 20 66 69 0a  }"...fi..    fi.
aea0: 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46 46  ..    SHLIB_SUFF
aeb0: 49 58 3d 22 2e 64 6c 6c 22 0a 09 20 20 20 20 53  IX=".dll"..    S
aec0: 48 41 52 45 44 5f 4c 49 42 5f 53 55 46 46 49 58  HARED_LIB_SUFFIX
aed0: 3d 27 24 7b 54 43 4c 5f 54 52 49 4d 5f 44 4f 54  ='${TCL_TRIM_DOT
aee0: 53 7d 2e 64 6c 6c 27 0a 0a 09 20 20 20 20 54 43  S}.dll'...    TC
aef0: 4c 5f 4c 49 42 5f 56 45 52 53 49 4f 4e 53 5f 4f  L_LIB_VERSIONS_O
af00: 4b 3d 6e 6f 64 6f 74 73 0a 20 20 20 20 09 20 20  K=nodots.    .  
af10: 20 20 3b 3b 0a 09 41 49 58 2d 2a 29 0a 09 20 20    ;;..AIX-*)..  
af20: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24    AS_IF([test "$
af30: 7b 54 43 4c 5f 54 48 52 45 41 44 53 7d 22 20 3d  {TCL_THREADS}" =
af40: 20 22 31 22 20 2d 61 20 22 24 47 43 43 22 20 21   "1" -a "$GCC" !
af50: 3d 20 22 79 65 73 22 5d 2c 20 5b 0a 09 09 23 20  = "yes"], [...# 
af60: 41 49 58 20 72 65 71 75 69 72 65 73 20 74 68 65  AIX requires the
af70: 20 5f 72 20 63 6f 6d 70 69 6c 65 72 20 77 68 65   _r compiler whe
af80: 6e 20 67 63 63 20 69 73 6e 27 74 20 62 65 69 6e  n gcc isn't bein
af90: 67 20 75 73 65 64 0a 09 09 63 61 73 65 20 22 24  g used...case "$
afa0: 7b 43 43 7d 22 20 69 6e 0a 09 09 20 20 20 20 2a  {CC}" in...    *
afb0: 5f 72 7c 2a 5f 72 5c 20 2a 29 0a 09 09 09 23 20  _r|*_r\ *)....# 
afc0: 6f 6b 20 2e 2e 2e 0a 09 09 09 3b 3b 0a 09 09 20  ok .......;;... 
afd0: 20 20 20 2a 29 0a 09 09 09 23 20 4d 61 6b 65 20     *)....# Make 
afe0: 73 75 72 65 20 6f 6e 6c 79 20 66 69 72 73 74 20  sure only first 
aff0: 61 72 67 20 67 65 74 73 20 5f 72 0a 09 09 20 20  arg gets _r...  
b000: 20 20 09 43 43 3d 60 65 63 68 6f 20 22 24 43 43    .CC=`echo "$CC
b010: 22 20 7c 20 73 65 64 20 2d 65 20 27 73 2f 5e 5c  " | sed -e 's/^\
b020: 28 5b 5b 5e 20 5d 5d 2a 5c 29 2f 5c 31 5f 72 2f  ([[^ ]]*\)/\1_r/
b030: 27 60 0a 09 09 09 3b 3b 0a 09 09 65 73 61 63 0a  '`....;;...esac.
b040: 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28  ..AC_MSG_RESULT(
b050: 5b 55 73 69 6e 67 20 24 43 43 20 66 6f 72 20 63  [Using $CC for c
b060: 6f 6d 70 69 6c 69 6e 67 20 77 69 74 68 20 74 68  ompiling with th
b070: 72 65 61 64 73 5d 29 0a 09 20 20 20 20 5d 29 0a  reads])..    ]).
b080: 09 20 20 20 20 4c 49 42 53 3d 22 24 4c 49 42 53  .    LIBS="$LIBS
b090: 20 2d 6c 63 22 0a 09 20 20 20 20 53 48 4c 49 42   -lc"..    SHLIB
b0a0: 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20  _CFLAGS=""..    
b0b0: 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73  SHLIB_SUFFIX=".s
b0c0: 6f 22 0a 0a 09 20 20 20 20 4c 44 5f 4c 49 42 52  o"...    LD_LIBR
b0d0: 41 52 59 5f 50 41 54 48 5f 56 41 52 3d 22 4c 49  ARY_PATH_VAR="LI
b0e0: 42 50 41 54 48 22 0a 0a 09 20 20 20 20 23 20 43  BPATH"...    # C
b0f0: 68 65 63 6b 20 74 6f 20 65 6e 61 62 6c 65 20 36  heck to enable 6
b100: 34 2d 62 69 74 20 66 6c 61 67 73 20 66 6f 72 20  4-bit flags for 
b110: 63 6f 6d 70 69 6c 65 72 2f 6c 69 6e 6b 65 72 0a  compiler/linker.
b120: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
b130: 20 22 24 64 6f 36 34 62 69 74 22 20 3d 20 79 65   "$do64bit" = ye
b140: 73 5d 2c 20 5b 0a 09 09 41 53 5f 49 46 28 5b 74  s], [...AS_IF([t
b150: 65 73 74 20 22 24 47 43 43 22 20 3d 20 79 65 73  est "$GCC" = yes
b160: 5d 2c 20 5b 0a 09 09 20 20 20 20 41 43 5f 4d 53  ], [...    AC_MS
b170: 47 5f 57 41 52 4e 28 5b 36 34 62 69 74 20 6d 6f  G_WARN([64bit mo
b180: 64 65 20 6e 6f 74 20 73 75 70 70 6f 72 74 65 64  de not supported
b190: 20 77 69 74 68 20 47 43 43 20 6f 6e 20 24 73 79   with GCC on $sy
b1a0: 73 74 65 6d 5d 29 0a 09 09 5d 2c 20 5b 0a 09 09  stem])...], [...
b1b0: 20 20 20 20 64 6f 36 34 62 69 74 5f 6f 6b 3d 79      do64bit_ok=y
b1c0: 65 73 0a 09 09 20 20 20 20 43 46 4c 41 47 53 3d  es...    CFLAGS=
b1d0: 22 24 43 46 4c 41 47 53 20 2d 71 36 34 22 0a 09  "$CFLAGS -q64"..
b1e0: 09 20 20 20 20 4c 44 46 4c 41 47 53 5f 41 52 43  .    LDFLAGS_ARC
b1f0: 48 3d 22 2d 71 36 34 22 0a 09 09 20 20 20 20 52  H="-q64"...    R
b200: 41 4e 4c 49 42 3d 22 24 7b 52 41 4e 4c 49 42 7d  ANLIB="${RANLIB}
b210: 20 2d 58 36 34 22 0a 09 09 20 20 20 20 41 52 3d   -X64"...    AR=
b220: 22 24 7b 41 52 7d 20 2d 58 36 34 22 0a 09 09 20  "${AR} -X64"... 
b230: 20 20 20 53 48 4c 49 42 5f 4c 44 5f 46 4c 41 47     SHLIB_LD_FLAG
b240: 53 3d 22 2d 62 36 34 22 0a 09 09 5d 29 0a 09 20  S="-b64"...]).. 
b250: 20 20 20 5d 29 0a 0a 09 20 20 20 20 41 53 5f 49     ])...    AS_I
b260: 46 28 5b 74 65 73 74 20 22 60 75 6e 61 6d 65 20  F([test "`uname 
b270: 2d 6d 60 22 20 3d 20 69 61 36 34 5d 2c 20 5b 0a  -m`" = ia64], [.
b280: 09 09 23 20 41 49 58 2d 35 20 75 73 65 73 20 45  ..# AIX-5 uses E
b290: 4c 46 20 73 74 79 6c 65 20 64 79 6e 61 6d 69 63  LF style dynamic
b2a0: 20 6c 69 62 72 61 72 69 65 73 20 6f 6e 20 49 41   libraries on IA
b2b0: 2d 36 34 2c 20 62 75 74 20 6e 6f 74 20 50 50 43  -64, but not PPC
b2c0: 0a 09 09 53 48 4c 49 42 5f 4c 44 3d 22 2f 75 73  ...SHLIB_LD="/us
b2d0: 72 2f 63 63 73 2f 62 69 6e 2f 6c 64 20 2d 47 20  r/ccs/bin/ld -G 
b2e0: 2d 7a 20 74 65 78 74 22 0a 09 09 41 53 5f 49 46  -z text"...AS_IF
b2f0: 28 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d 20  ([test "$GCC" = 
b300: 79 65 73 5d 2c 20 5b 0a 09 09 20 20 20 20 43 43  yes], [...    CC
b310: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d  _SEARCH_FLAGS='-
b320: 57 6c 2c 2d 52 2c 24 7b 4c 49 42 5f 52 55 4e 54  Wl,-R,${LIB_RUNT
b330: 49 4d 45 5f 44 49 52 7d 27 0a 09 09 5d 2c 20 5b  IME_DIR}'...], [
b340: 0a 09 09 20 20 20 20 43 43 5f 53 45 41 52 43 48  ...    CC_SEARCH
b350: 5f 46 4c 41 47 53 3d 27 2d 52 24 7b 4c 49 42 5f  _FLAGS='-R${LIB_
b360: 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09 09  RUNTIME_DIR}'...
b370: 5d 29 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46  ])...LD_SEARCH_F
b380: 4c 41 47 53 3d 27 2d 52 20 24 7b 4c 49 42 5f 52  LAGS='-R ${LIB_R
b390: 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09 20 20  UNTIME_DIR}'..  
b3a0: 20 20 5d 2c 20 5b 0a 09 09 41 53 5f 49 46 28 5b    ], [...AS_IF([
b3b0: 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 79 65  test "$GCC" = ye
b3c0: 73 5d 2c 20 5b 0a 09 09 20 20 20 20 53 48 4c 49  s], [...    SHLI
b3d0: 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 73 68 61  B_LD='${CC} -sha
b3e0: 72 65 64 20 2d 57 6c 2c 2d 62 65 78 70 61 6c 6c  red -Wl,-bexpall
b3f0: 27 0a 09 09 5d 2c 20 5b 0a 09 09 20 20 20 20 53  '...], [...    S
b400: 48 4c 49 42 5f 4c 44 3d 22 2f 62 69 6e 2f 6c 64  HLIB_LD="/bin/ld
b410: 20 2d 62 68 61 6c 74 3a 34 20 2d 62 4d 3a 53 52   -bhalt:4 -bM:SR
b420: 45 20 2d 62 65 78 70 61 6c 6c 20 2d 48 35 31 32  E -bexpall -H512
b430: 20 2d 54 35 31 32 20 2d 62 6e 6f 65 6e 74 72 79   -T512 -bnoentry
b440: 22 0a 09 09 20 20 20 20 4c 44 46 4c 41 47 53 3d  "...    LDFLAGS=
b450: 22 24 4c 44 46 4c 41 47 53 20 2d 62 72 74 6c 22  "$LDFLAGS -brtl"
b460: 0a 09 09 5d 29 0a 09 09 53 48 4c 49 42 5f 4c 44  ...])...SHLIB_LD
b470: 3d 22 24 7b 53 48 4c 49 42 5f 4c 44 7d 20 24 7b  ="${SHLIB_LD} ${
b480: 53 48 4c 49 42 5f 4c 44 5f 46 4c 41 47 53 7d 22  SHLIB_LD_FLAGS}"
b490: 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  ...CC_SEARCH_FLA
b4a0: 47 53 3d 27 2d 4c 24 7b 4c 49 42 5f 52 55 4e 54  GS='-L${LIB_RUNT
b4b0: 49 4d 45 5f 44 49 52 7d 27 0a 09 09 4c 44 5f 53  IME_DIR}'...LD_S
b4c0: 45 41 52 43 48 5f 46 4c 41 47 53 3d 24 7b 43 43  EARCH_FLAGS=${CC
b4d0: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 7d 0a 09  _SEARCH_FLAGS}..
b4e0: 20 20 20 20 5d 29 0a 09 20 20 20 20 3b 3b 0a 09      ])..    ;;..
b4f0: 42 65 4f 53 2a 29 0a 09 20 20 20 20 53 48 4c 49  BeOS*)..    SHLI
b500: 42 5f 43 46 4c 41 47 53 3d 22 2d 66 50 49 43 22  B_CFLAGS="-fPIC"
b510: 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27  ..    SHLIB_LD='
b520: 24 7b 43 43 7d 20 2d 6e 6f 73 74 61 72 74 27 0a  ${CC} -nostart'.
b530: 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49  .    SHLIB_SUFFI
b540: 58 3d 22 2e 73 6f 22 0a 0a 09 20 20 20 20 23 2d  X=".so"...    #-
b550: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 09 20 20 20 20  ----------..    
b590: 23 20 43 68 65 63 6b 20 66 6f 72 20 69 6e 65 74  # Check for inet
b5a0: 5f 6e 74 6f 61 20 69 6e 20 2d 6c 62 69 6e 64 2c  _ntoa in -lbind,
b5b0: 20 66 6f 72 20 42 65 4f 53 20 28 77 68 69 63 68   for BeOS (which
b5c0: 20 61 6c 73 6f 20 6e 65 65 64 73 0a 09 20 20 20   also needs..   
b5d0: 20 23 20 2d 6c 73 6f 63 6b 65 74 2c 20 65 76 65   # -lsocket, eve
b5e0: 6e 20 69 66 20 74 68 65 20 6e 65 74 77 6f 72 6b  n if the network
b5f0: 20 66 75 6e 63 74 69 6f 6e 73 20 61 72 65 20 69   functions are i
b600: 6e 20 2d 6c 6e 65 74 20 77 68 69 63 68 0a 09 20  n -lnet which.. 
b610: 20 20 20 23 20 69 73 20 61 6c 77 61 79 73 20 6c     # is always l
b620: 69 6e 6b 65 64 20 74 6f 2c 20 66 6f 72 20 63 6f  inked to, for co
b630: 6d 70 61 74 69 62 69 6c 69 74 79 2e 0a 09 20 20  mpatibility...  
b640: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
b650: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b660: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
b670: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 09  --------------..
b680: 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c 49 42      AC_CHECK_LIB
b690: 28 62 69 6e 64 2c 20 69 6e 65 74 5f 6e 74 6f 61  (bind, inet_ntoa
b6a0: 2c 20 5b 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d  , [LIBS="$LIBS -
b6b0: 6c 62 69 6e 64 20 2d 6c 73 6f 63 6b 65 74 22 5d  lbind -lsocket"]
b6c0: 29 0a 09 20 20 20 20 3b 3b 0a 09 42 53 44 2f 4f  )..    ;;..BSD/O
b6d0: 53 2d 34 2e 2a 29 0a 09 20 20 20 20 53 48 4c 49  S-4.*)..    SHLI
b6e0: 42 5f 43 46 4c 41 47 53 3d 22 2d 65 78 70 6f 72  B_CFLAGS="-expor
b6f0: 74 2d 64 79 6e 61 6d 69 63 20 2d 66 50 49 43 22  t-dynamic -fPIC"
b700: 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27  ..    SHLIB_LD='
b710: 24 7b 43 43 7d 20 2d 73 68 61 72 65 64 27 0a 09  ${CC} -shared'..
b720: 20 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58      SHLIB_SUFFIX
b730: 3d 22 2e 73 6f 22 0a 09 20 20 20 20 4c 44 46 4c  =".so"..    LDFL
b740: 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 65  AGS="$LDFLAGS -e
b750: 78 70 6f 72 74 2d 64 79 6e 61 6d 69 63 22 0a 09  xport-dynamic"..
b760: 20 20 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c      CC_SEARCH_FL
b770: 41 47 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f 53  AGS=""..    LD_S
b780: 45 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09  EARCH_FLAGS=""..
b790: 20 20 20 20 3b 3b 0a 09 43 59 47 57 49 4e 5f 2a      ;;..CYGWIN_*
b7a0: 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46 4c  )..    SHLIB_CFL
b7b0: 41 47 53 3d 22 22 0a 09 20 20 20 20 53 48 4c 49  AGS=""..    SHLI
b7c0: 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 73 68 61  B_LD='${CC} -sha
b7d0: 72 65 64 27 0a 09 20 20 20 20 53 48 4c 49 42 5f  red'..    SHLIB_
b7e0: 53 55 46 46 49 58 3d 22 2e 64 6c 6c 22 0a 09 20  SUFFIX=".dll".. 
b7f0: 20 20 20 45 58 45 45 58 54 3d 22 2e 65 78 65 22     EXEEXT=".exe"
b800: 0a 09 20 20 20 20 64 6f 36 34 62 69 74 5f 6f 6b  ..    do64bit_ok
b810: 3d 79 65 73 0a 09 20 20 20 20 43 43 5f 53 45 41  =yes..    CC_SEA
b820: 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20  RCH_FLAGS=""..  
b830: 20 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47    LD_SEARCH_FLAG
b840: 53 3d 22 22 0a 09 20 20 20 20 3b 3b 0a 09 48 61  S=""..    ;;..Ha
b850: 69 6b 75 2a 29 0a 09 20 20 20 20 4c 44 46 4c 41  iku*)..    LDFLA
b860: 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 57 6c  GS="$LDFLAGS -Wl
b870: 2c 2d 2d 65 78 70 6f 72 74 2d 64 79 6e 61 6d 69  ,--export-dynami
b880: 63 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  c"..    SHLIB_CF
b890: 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a 09 20 20  LAGS="-fPIC"..  
b8a0: 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22    SHLIB_SUFFIX="
b8b0: 2e 73 6f 22 0a 09 20 20 20 20 53 48 4c 49 42 5f  .so"..    SHLIB_
b8c0: 4c 44 3d 27 24 7b 43 43 7d 20 2d 73 68 61 72 65  LD='${CC} -share
b8d0: 64 20 24 7b 43 46 4c 41 47 53 7d 20 24 7b 4c 44  d ${CFLAGS} ${LD
b8e0: 46 4c 41 47 53 7d 27 0a 09 20 20 20 20 41 43 5f  FLAGS}'..    AC_
b8f0: 43 48 45 43 4b 5f 4c 49 42 28 6e 65 74 77 6f 72  CHECK_LIB(networ
b900: 6b 2c 20 69 6e 65 74 5f 6e 74 6f 61 2c 20 5b 4c  k, inet_ntoa, [L
b910: 49 42 53 3d 22 24 4c 49 42 53 20 2d 6c 6e 65 74  IBS="$LIBS -lnet
b920: 77 6f 72 6b 22 5d 29 0a 09 20 20 20 20 3b 3b 0a  work"])..    ;;.
b930: 09 48 50 2d 55 58 2d 2a 2e 31 31 2e 2a 29 0a 09  .HP-UX-*.11.*)..
b940: 20 20 20 20 23 20 55 73 65 20 75 70 64 61 74 65      # Use update
b950: 64 20 68 65 61 64 65 72 20 64 65 66 69 6e 69 74  d header definit
b960: 69 6f 6e 73 20 77 68 65 72 65 20 70 6f 73 73 69  ions where possi
b970: 62 6c 65 0a 09 20 20 20 20 41 43 5f 44 45 46 49  ble..    AC_DEFI
b980: 4e 45 28 5f 58 4f 50 45 4e 5f 53 4f 55 52 43 45  NE(_XOPEN_SOURCE
b990: 5f 45 58 54 45 4e 44 45 44 2c 20 31 2c 20 5b 44  _EXTENDED, 1, [D
b9a0: 6f 20 77 65 20 77 61 6e 74 20 74 6f 20 75 73 65  o we want to use
b9b0: 20 74 68 65 20 58 4f 50 45 4e 20 6e 65 74 77 6f   the XOPEN netwo
b9c0: 72 6b 20 6c 69 62 72 61 72 79 3f 5d 29 0a 09 20  rk library?]).. 
b9d0: 20 20 20 23 20 54 45 41 20 73 70 65 63 69 66 69     # TEA specifi
b9e0: 63 3a 20 4e 65 65 64 65 64 20 62 79 20 54 63 6c  c: Needed by Tcl
b9f0: 2c 20 62 75 74 20 6e 6f 74 20 6d 6f 73 74 20 65  , but not most e
ba00: 78 74 65 6e 73 69 6f 6e 73 0a 09 20 20 20 20 23  xtensions..    #
ba10: 41 43 5f 44 45 46 49 4e 45 28 5f 58 4f 50 45 4e  AC_DEFINE(_XOPEN
ba20: 5f 53 4f 55 52 43 45 2c 20 31 2c 20 5b 44 6f 20  _SOURCE, 1, [Do 
ba30: 77 65 20 77 61 6e 74 20 74 6f 20 75 73 65 20 74  we want to use t
ba40: 68 65 20 58 4f 50 45 4e 20 6e 65 74 77 6f 72 6b  he XOPEN network
ba50: 20 6c 69 62 72 61 72 79 3f 5d 29 0a 09 20 20 20   library?])..   
ba60: 20 23 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d 6c   #LIBS="$LIBS -l
ba70: 78 6e 65 74 22 20 20 20 20 20 20 20 20 20 20 20  xnet"           
ba80: 20 20 20 20 23 20 55 73 65 20 74 68 65 20 58 4f      # Use the XO
ba90: 50 45 4e 20 6e 65 74 77 6f 72 6b 20 6c 69 62 72  PEN network libr
baa0: 61 72 79 0a 0a 09 20 20 20 20 41 53 5f 49 46 28  ary...    AS_IF(
bab0: 5b 74 65 73 74 20 22 60 75 6e 61 6d 65 20 2d 6d  [test "`uname -m
bac0: 60 22 20 3d 20 69 61 36 34 5d 2c 20 5b 0a 09 09  `" = ia64], [...
bad0: 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73  SHLIB_SUFFIX=".s
bae0: 6f 22 0a 09 09 23 20 55 73 65 20 6e 65 77 65 72  o"...# Use newer
baf0: 20 43 2b 2b 20 6c 69 62 72 61 72 79 20 66 6f 72   C++ library for
bb00: 20 43 2b 2b 20 65 78 74 65 6e 73 69 6f 6e 73 0a   C++ extensions.
bb10: 09 09 23 69 66 20 74 65 73 74 20 22 24 47 43 43  ..#if test "$GCC
bb20: 22 20 21 3d 20 22 79 65 73 22 20 3b 20 74 68 65  " != "yes" ; the
bb30: 6e 0a 09 09 23 20 20 20 43 50 50 46 4c 41 47 53  n...#   CPPFLAGS
bb40: 3d 22 2d 41 41 22 0a 09 09 23 66 69 0a 09 20 20  ="-AA"...#fi..  
bb50: 20 20 5d 2c 20 5b 0a 09 09 53 48 4c 49 42 5f 53    ], [...SHLIB_S
bb60: 55 46 46 49 58 3d 22 2e 73 6c 22 0a 09 20 20 20  UFFIX=".sl"..   
bb70: 20 5d 29 0a 09 20 20 20 20 41 43 5f 43 48 45 43   ])..    AC_CHEC
bb80: 4b 5f 4c 49 42 28 64 6c 64 2c 20 73 68 6c 5f 6c  K_LIB(dld, shl_l
bb90: 6f 61 64 2c 20 74 63 6c 5f 6f 6b 3d 79 65 73 2c  oad, tcl_ok=yes,
bba0: 20 74 63 6c 5f 6f 6b 3d 6e 6f 29 0a 09 20 20 20   tcl_ok=no)..   
bbb0: 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 74   AS_IF([test "$t
bbc0: 63 6c 5f 6f 6b 22 20 3d 20 79 65 73 5d 2c 20 5b  cl_ok" = yes], [
bbd0: 0a 09 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46  ...LDFLAGS="$LDF
bbe0: 4c 41 47 53 20 2d 57 6c 2c 2d 45 22 0a 09 09 43  LAGS -Wl,-E"...C
bbf0: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27  C_SEARCH_FLAGS='
bc00: 2d 57 6c 2c 2b 73 2c 2b 62 2c 24 7b 4c 49 42 5f  -Wl,+s,+b,${LIB_
bc10: 52 55 4e 54 49 4d 45 5f 44 49 52 7d 3a 2e 27 0a  RUNTIME_DIR}:.'.
bc20: 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..LD_SEARCH_FLAG
bc30: 53 3d 27 2b 73 20 2b 62 20 24 7b 4c 49 42 5f 52  S='+s +b ${LIB_R
bc40: 55 4e 54 49 4d 45 5f 44 49 52 7d 3a 2e 27 0a 09  UNTIME_DIR}:.'..
bc50: 09 4c 44 5f 4c 49 42 52 41 52 59 5f 50 41 54 48  .LD_LIBRARY_PATH
bc60: 5f 56 41 52 3d 22 53 48 4c 49 42 5f 50 41 54 48  _VAR="SHLIB_PATH
bc70: 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 41  "..    ])..    A
bc80: 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43 43  S_IF([test "$GCC
bc90: 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 53 48  " = yes], [...SH
bca0: 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 73  LIB_LD='${CC} -s
bcb0: 68 61 72 65 64 27 0a 09 09 4c 44 5f 53 45 41 52  hared'...LD_SEAR
bcc0: 43 48 5f 46 4c 41 47 53 3d 24 7b 43 43 5f 53 45  CH_FLAGS=${CC_SE
bcd0: 41 52 43 48 5f 46 4c 41 47 53 7d 0a 09 20 20 20  ARCH_FLAGS}..   
bce0: 20 5d 2c 20 5b 0a 09 09 43 46 4c 41 47 53 3d 22   ], [...CFLAGS="
bcf0: 24 43 46 4c 41 47 53 20 2d 7a 22 0a 09 09 23 20  $CFLAGS -z"...# 
bd00: 55 73 65 72 73 20 6d 61 79 20 77 61 6e 74 20 50  Users may want P
bd10: 41 2d 52 49 53 43 20 31 2e 31 2f 32 2e 30 20 70  A-RISC 1.1/2.0 p
bd20: 6f 72 74 61 62 6c 65 20 63 6f 64 65 20 2d 20 6e  ortable code - n
bd30: 65 65 64 73 20 48 50 20 63 63 0a 09 09 23 43 46  eeds HP cc...#CF
bd40: 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2b 44  LAGS="$CFLAGS +D
bd50: 41 70 6f 72 74 61 62 6c 65 22 0a 09 09 53 48 4c  Aportable"...SHL
bd60: 49 42 5f 43 46 4c 41 47 53 3d 22 2b 7a 22 0a 09  IB_CFLAGS="+z"..
bd70: 09 53 48 4c 49 42 5f 4c 44 3d 22 6c 64 20 2d 62  .SHLIB_LD="ld -b
bd80: 22 0a 09 20 20 20 20 5d 29 0a 0a 09 20 20 20 20  "..    ])...    
bd90: 23 20 43 68 65 63 6b 20 74 6f 20 65 6e 61 62 6c  # Check to enabl
bda0: 65 20 36 34 2d 62 69 74 20 66 6c 61 67 73 20 66  e 64-bit flags f
bdb0: 6f 72 20 63 6f 6d 70 69 6c 65 72 2f 6c 69 6e 6b  or compiler/link
bdc0: 65 72 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74  er..    AS_IF([t
bdd0: 65 73 74 20 22 24 64 6f 36 34 62 69 74 22 20 3d  est "$do64bit" =
bde0: 20 22 79 65 73 22 5d 2c 20 5b 0a 09 09 41 53 5f   "yes"], [...AS_
bdf0: 49 46 28 5b 74 65 73 74 20 22 24 47 43 43 22 20  IF([test "$GCC" 
be00: 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20 20 20 20  = yes], [...    
be10: 63 61 73 65 20 60 24 7b 43 43 7d 20 2d 64 75 6d  case `${CC} -dum
be20: 70 6d 61 63 68 69 6e 65 60 20 69 6e 0a 09 09 09  pmachine` in....
be30: 68 70 70 61 36 34 2a 29 0a 09 09 09 20 20 20 20  hppa64*)....    
be40: 23 20 36 34 2d 62 69 74 20 67 63 63 20 69 6e 20  # 64-bit gcc in 
be50: 75 73 65 2e 20 20 46 69 78 20 66 6c 61 67 73 20  use.  Fix flags 
be60: 66 6f 72 20 47 4e 55 20 6c 64 2e 0a 09 09 09 20  for GNU ld..... 
be70: 20 20 20 64 6f 36 34 62 69 74 5f 6f 6b 3d 79 65     do64bit_ok=ye
be80: 73 0a 09 09 09 20 20 20 20 53 48 4c 49 42 5f 4c  s....    SHLIB_L
be90: 44 3d 27 24 7b 43 43 7d 20 2d 73 68 61 72 65 64  D='${CC} -shared
bea0: 27 0a 09 09 09 20 20 20 20 41 53 5f 49 46 28 5b  '....    AS_IF([
beb0: 74 65 73 74 20 24 64 6f 52 70 61 74 68 20 3d 20  test $doRpath = 
bec0: 79 65 73 5d 2c 20 5b 0a 09 09 09 09 43 43 5f 53  yes], [.....CC_S
bed0: 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c  EARCH_FLAGS='-Wl
bee0: 2c 2d 72 70 61 74 68 2c 24 7b 4c 49 42 5f 52 55  ,-rpath,${LIB_RU
bef0: 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29 0a 09 09  NTIME_DIR}'])...
bf00: 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48 5f 46  .    LD_SEARCH_F
bf10: 4c 41 47 53 3d 24 7b 43 43 5f 53 45 41 52 43 48  LAGS=${CC_SEARCH
bf20: 5f 46 4c 41 47 53 7d 0a 09 09 09 20 20 20 20 3b  _FLAGS}....    ;
bf30: 3b 0a 09 09 09 2a 29 0a 09 09 09 20 20 20 20 41  ;....*)....    A
bf40: 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 36 34 62 69  C_MSG_WARN([64bi
bf50: 74 20 6d 6f 64 65 20 6e 6f 74 20 73 75 70 70 6f  t mode not suppo
bf60: 72 74 65 64 20 77 69 74 68 20 47 43 43 20 6f 6e  rted with GCC on
bf70: 20 24 73 79 73 74 65 6d 5d 29 0a 09 09 09 20 20   $system])....  
bf80: 20 20 3b 3b 0a 09 09 20 20 20 20 65 73 61 63 0a    ;;...    esac.
bf90: 09 09 5d 2c 20 5b 0a 09 09 20 20 20 20 64 6f 36  ..], [...    do6
bfa0: 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09 20 20  4bit_ok=yes...  
bfb0: 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47    CFLAGS="$CFLAG
bfc0: 53 20 2b 44 44 36 34 22 0a 09 09 20 20 20 20 4c  S +DD64"...    L
bfd0: 44 46 4c 41 47 53 5f 41 52 43 48 3d 22 2b 44 44  DFLAGS_ARCH="+DD
bfe0: 36 34 22 0a 09 09 5d 29 0a 09 20 20 20 20 5d 29  64"...])..    ])
bff0: 20 3b 3b 0a 09 49 52 49 58 2d 36 2e 2a 29 0a 09   ;;..IRIX-6.*)..
c000: 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53      SHLIB_CFLAGS
c010: 3d 22 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c  =""..    SHLIB_L
c020: 44 3d 22 6c 64 20 2d 6e 33 32 20 2d 73 68 61 72  D="ld -n32 -shar
c030: 65 64 20 2d 72 64 61 74 61 5f 73 68 61 72 65 64  ed -rdata_shared
c040: 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46  "..    SHLIB_SUF
c050: 46 49 58 3d 22 2e 73 6f 22 0a 09 20 20 20 20 41  FIX=".so"..    A
c060: 53 5f 49 46 28 5b 74 65 73 74 20 24 64 6f 52 70  S_IF([test $doRp
c070: 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09  ath = yes], [...
c080: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d  CC_SEARCH_FLAGS=
c090: 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b 4c 49  '-Wl,-rpath,${LI
c0a0: 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a  B_RUNTIME_DIR}'.
c0b0: 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..LD_SEARCH_FLAG
c0c0: 53 3d 27 2d 72 70 61 74 68 20 24 7b 4c 49 42 5f  S='-rpath ${LIB_
c0d0: 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29 0a  RUNTIME_DIR}']).
c0e0: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
c0f0: 20 22 24 47 43 43 22 20 3d 20 79 65 73 5d 2c 20   "$GCC" = yes], 
c100: 5b 0a 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c  [...CFLAGS="$CFL
c110: 41 47 53 20 2d 6d 61 62 69 3d 6e 33 32 22 0a 09  AGS -mabi=n32"..
c120: 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41  .LDFLAGS="$LDFLA
c130: 47 53 20 2d 6d 61 62 69 3d 6e 33 32 22 0a 09 20  GS -mabi=n32".. 
c140: 20 20 20 5d 2c 20 5b 0a 09 09 63 61 73 65 20 24     ], [...case $
c150: 73 79 73 74 65 6d 20 69 6e 0a 09 09 20 20 20 20  system in...    
c160: 49 52 49 58 2d 36 2e 33 29 0a 09 09 09 23 20 55  IRIX-6.3)....# U
c170: 73 65 20 74 6f 20 62 75 69 6c 64 20 36 2e 32 20  se to build 6.2 
c180: 63 6f 6d 70 61 74 69 62 6c 65 20 62 69 6e 61 72  compatible binar
c190: 69 65 73 20 6f 6e 20 36 2e 33 2e 0a 09 09 09 43  ies on 6.3.....C
c1a0: 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d  FLAGS="$CFLAGS -
c1b0: 6e 33 32 20 2d 44 5f 4f 4c 44 5f 54 45 52 4d 49  n32 -D_OLD_TERMI
c1c0: 4f 53 22 0a 09 09 09 3b 3b 0a 09 09 20 20 20 20  OS"....;;...    
c1d0: 2a 29 0a 09 09 09 43 46 4c 41 47 53 3d 22 24 43  *)....CFLAGS="$C
c1e0: 46 4c 41 47 53 20 2d 6e 33 32 22 0a 09 09 09 3b  FLAGS -n32"....;
c1f0: 3b 0a 09 09 65 73 61 63 0a 09 09 4c 44 46 4c 41  ;...esac...LDFLA
c200: 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 6e 33  GS="$LDFLAGS -n3
c210: 32 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20  2"..    ])..    
c220: 3b 3b 0a 09 49 52 49 58 36 34 2d 36 2e 2a 29 0a  ;;..IRIX64-6.*).
c230: 09 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47  .    SHLIB_CFLAG
c240: 53 3d 22 22 0a 09 20 20 20 20 53 48 4c 49 42 5f  S=""..    SHLIB_
c250: 4c 44 3d 22 6c 64 20 2d 6e 33 32 20 2d 73 68 61  LD="ld -n32 -sha
c260: 72 65 64 20 2d 72 64 61 74 61 5f 73 68 61 72 65  red -rdata_share
c270: 64 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55  d"..    SHLIB_SU
c280: 46 46 49 58 3d 22 2e 73 6f 22 0a 09 20 20 20 20  FFIX=".so"..    
c290: 41 53 5f 49 46 28 5b 74 65 73 74 20 24 64 6f 52  AS_IF([test $doR
c2a0: 70 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a 09  path = yes], [..
c2b0: 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53  .CC_SEARCH_FLAGS
c2c0: 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b 4c  ='-Wl,-rpath,${L
c2d0: 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27  IB_RUNTIME_DIR}'
c2e0: 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41  ...LD_SEARCH_FLA
c2f0: 47 53 3d 27 2d 72 70 61 74 68 20 24 7b 4c 49 42  GS='-rpath ${LIB
c300: 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29  _RUNTIME_DIR}'])
c310: 0a 0a 09 20 20 20 20 23 20 43 68 65 63 6b 20 74  ...    # Check t
c320: 6f 20 65 6e 61 62 6c 65 20 36 34 2d 62 69 74 20  o enable 64-bit 
c330: 66 6c 61 67 73 20 66 6f 72 20 63 6f 6d 70 69 6c  flags for compil
c340: 65 72 2f 6c 69 6e 6b 65 72 0a 0a 09 20 20 20 20  er/linker...    
c350: 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 64 6f  AS_IF([test "$do
c360: 36 34 62 69 74 22 20 3d 20 79 65 73 5d 2c 20 5b  64bit" = yes], [
c370: 0a 09 20 20 20 20 20 20 20 20 41 53 5f 49 46 28  ..        AS_IF(
c380: 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 79  [test "$GCC" = y
c390: 65 73 5d 2c 20 5b 0a 09 20 20 20 20 20 20 20 20  es], [..        
c3a0: 20 20 20 20 41 43 5f 4d 53 47 5f 57 41 52 4e 28      AC_MSG_WARN(
c3b0: 5b 36 34 62 69 74 20 6d 6f 64 65 20 6e 6f 74 20  [64bit mode not 
c3c0: 73 75 70 70 6f 72 74 65 64 20 62 79 20 67 63 63  supported by gcc
c3d0: 5d 29 0a 09 20 20 20 20 20 20 20 20 5d 2c 20 5b  ])..        ], [
c3e0: 0a 09 20 20 20 20 20 20 20 20 20 20 20 20 64 6f  ..            do
c3f0: 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 20 20  64bit_ok=yes..  
c400: 20 20 20 20 20 20 20 20 20 20 53 48 4c 49 42 5f            SHLIB_
c410: 4c 44 3d 22 6c 64 20 2d 36 34 20 2d 73 68 61 72  LD="ld -64 -shar
c420: 65 64 20 2d 72 64 61 74 61 5f 73 68 61 72 65 64  ed -rdata_shared
c430: 22 0a 09 20 20 20 20 20 20 20 20 20 20 20 20 43  "..            C
c440: 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d  FLAGS="$CFLAGS -
c450: 36 34 22 0a 09 20 20 20 20 20 20 20 20 20 20 20  64"..           
c460: 20 4c 44 46 4c 41 47 53 5f 41 52 43 48 3d 22 2d   LDFLAGS_ARCH="-
c470: 36 34 22 0a 09 20 20 20 20 20 20 20 20 5d 29 0a  64"..        ]).
c480: 09 20 20 20 20 5d 29 0a 09 20 20 20 20 3b 3b 0a  .    ])..    ;;.
c490: 09 4c 69 6e 75 78 2a 7c 47 4e 55 2a 7c 4e 65 74  .Linux*|GNU*|Net
c4a0: 42 53 44 2d 44 65 62 69 61 6e 29 0a 09 20 20 20  BSD-Debian)..   
c4b0: 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d   SHLIB_CFLAGS="-
c4c0: 66 50 49 43 22 0a 09 20 20 20 20 53 48 4c 49 42  fPIC"..    SHLIB
c4d0: 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 0a 09  _SUFFIX=".so"...
c4e0: 20 20 20 20 23 20 54 45 41 20 73 70 65 63 69 66      # TEA specif
c4f0: 69 63 3a 0a 09 20 20 20 20 43 46 4c 41 47 53 5f  ic:..    CFLAGS_
c500: 4f 50 54 49 4d 49 5a 45 3d 22 2d 4f 32 20 2d 66  OPTIMIZE="-O2 -f
c510: 6f 6d 69 74 2d 66 72 61 6d 65 2d 70 6f 69 6e 74  omit-frame-point
c520: 65 72 22 0a 0a 09 20 20 20 20 23 20 54 45 41 20  er"...    # TEA 
c530: 73 70 65 63 69 66 69 63 3a 20 75 73 65 20 4c 44  specific: use LD
c540: 46 4c 41 47 53 5f 44 45 46 41 55 4c 54 20 69 6e  FLAGS_DEFAULT in
c550: 73 74 65 61 64 20 6f 66 20 4c 44 46 4c 41 47 53  stead of LDFLAGS
c560: 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27  ..    SHLIB_LD='
c570: 24 7b 43 43 7d 20 2d 73 68 61 72 65 64 20 24 7b  ${CC} -shared ${
c580: 43 46 4c 41 47 53 7d 20 24 7b 4c 44 46 4c 41 47  CFLAGS} ${LDFLAG
c590: 53 5f 44 45 46 41 55 4c 54 7d 27 0a 09 20 20 20  S_DEFAULT}'..   
c5a0: 20 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41   LDFLAGS="$LDFLA
c5b0: 47 53 20 2d 57 6c 2c 2d 2d 65 78 70 6f 72 74 2d  GS -Wl,--export-
c5c0: 64 79 6e 61 6d 69 63 22 0a 09 20 20 20 20 41 53  dynamic"..    AS
c5d0: 5f 49 46 28 5b 74 65 73 74 20 24 64 6f 52 70 61  _IF([test $doRpa
c5e0: 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 43  th = yes], [...C
c5f0: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27  C_SEARCH_FLAGS='
c600: 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b 4c 49 42  -Wl,-rpath,${LIB
c610: 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29  _RUNTIME_DIR}'])
c620: 0a 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48 5f  ..    LD_SEARCH_
c630: 46 4c 41 47 53 3d 24 7b 43 43 5f 53 45 41 52 43  FLAGS=${CC_SEARC
c640: 48 5f 46 4c 41 47 53 7d 0a 09 20 20 20 20 41 53  H_FLAGS}..    AS
c650: 5f 49 46 28 5b 74 65 73 74 20 22 60 75 6e 61 6d  _IF([test "`unam
c660: 65 20 2d 6d 60 22 20 3d 20 22 61 6c 70 68 61 22  e -m`" = "alpha"
c670: 5d 2c 20 5b 43 46 4c 41 47 53 3d 22 24 43 46 4c  ], [CFLAGS="$CFL
c680: 41 47 53 20 2d 6d 69 65 65 65 22 5d 29 0a 09 20  AGS -mieee"]).. 
c690: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24     AS_IF([test $
c6a0: 64 6f 36 34 62 69 74 20 3d 20 79 65 73 5d 2c 20  do64bit = yes], 
c6b0: 5b 0a 09 09 41 43 5f 43 41 43 48 45 5f 43 48 45  [...AC_CACHE_CHE
c6c0: 43 4b 28 5b 69 66 20 63 6f 6d 70 69 6c 65 72 20  CK([if compiler 
c6d0: 61 63 63 65 70 74 73 20 2d 6d 36 34 20 66 6c 61  accepts -m64 fla
c6e0: 67 5d 2c 20 74 63 6c 5f 63 76 5f 63 63 5f 6d 36  g], tcl_cv_cc_m6
c6f0: 34 2c 20 5b 0a 09 09 20 20 20 20 68 6f 6c 64 5f  4, [...    hold_
c700: 63 66 6c 61 67 73 3d 24 43 46 4c 41 47 53 0a 09  cflags=$CFLAGS..
c710: 09 20 20 20 20 43 46 4c 41 47 53 3d 22 24 43 46  .    CFLAGS="$CF
c720: 4c 41 47 53 20 2d 6d 36 34 22 0a 09 09 20 20 20  LAGS -m64"...   
c730: 20 41 43 5f 54 52 59 5f 4c 49 4e 4b 28 2c 2c 20   AC_TRY_LINK(,, 
c740: 74 63 6c 5f 63 76 5f 63 63 5f 6d 36 34 3d 79 65  tcl_cv_cc_m64=ye
c750: 73 2c 20 74 63 6c 5f 63 76 5f 63 63 5f 6d 36 34  s, tcl_cv_cc_m64
c760: 3d 6e 6f 29 0a 09 09 20 20 20 20 43 46 4c 41 47  =no)...    CFLAG
c770: 53 3d 24 68 6f 6c 64 5f 63 66 6c 61 67 73 5d 29  S=$hold_cflags])
c780: 0a 09 09 41 53 5f 49 46 28 5b 74 65 73 74 20 24  ...AS_IF([test $
c790: 74 63 6c 5f 63 76 5f 63 63 5f 6d 36 34 20 3d 20  tcl_cv_cc_m64 = 
c7a0: 79 65 73 5d 2c 20 5b 0a 09 09 20 20 20 20 43 46  yes], [...    CF
c7b0: 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 6d  LAGS="$CFLAGS -m
c7c0: 36 34 22 0a 09 09 20 20 20 20 64 6f 36 34 62 69  64"...    do64bi
c7d0: 74 5f 6f 6b 3d 79 65 73 0a 09 09 5d 29 0a 09 20  t_ok=yes...]).. 
c7e0: 20 20 5d 29 0a 0a 09 20 20 20 20 23 20 54 68 65    ])...    # The
c7f0: 20 63 6f 6d 62 6f 20 6f 66 20 67 63 63 20 2b 20   combo of gcc + 
c800: 67 6c 69 62 63 20 68 61 73 20 61 20 62 75 67 20  glibc has a bug 
c810: 72 65 6c 61 74 65 64 20 74 6f 20 69 6e 6c 69 6e  related to inlin
c820: 69 6e 67 20 6f 66 0a 09 20 20 20 20 23 20 66 75  ing of..    # fu
c830: 6e 63 74 69 6f 6e 73 20 6c 69 6b 65 20 73 74 72  nctions like str
c840: 74 6f 64 28 29 2e 20 54 68 65 20 2d 66 6e 6f 2d  tod(). The -fno-
c850: 62 75 69 6c 74 69 6e 20 66 6c 61 67 20 73 68 6f  builtin flag sho
c860: 75 6c 64 20 61 64 64 72 65 73 73 0a 09 20 20 20  uld address..   
c870: 20 23 20 74 68 69 73 20 70 72 6f 62 6c 65 6d 20   # this problem 
c880: 62 75 74 20 69 74 20 64 6f 65 73 20 6e 6f 74 20  but it does not 
c890: 77 6f 72 6b 2e 20 54 68 65 20 2d 66 6e 6f 2d 69  work. The -fno-i
c8a0: 6e 6c 69 6e 65 20 66 6c 61 67 20 69 73 20 6b 69  nline flag is ki
c8b0: 6e 64 0a 09 20 20 20 20 23 20 6f 66 20 6f 76 65  nd..    # of ove
c8c0: 72 6b 69 6c 6c 20 62 75 74 20 69 74 20 77 6f 72  rkill but it wor
c8d0: 6b 73 2e 20 44 69 73 61 62 6c 65 20 69 6e 6c 69  ks. Disable inli
c8e0: 6e 69 6e 67 20 6f 6e 6c 79 20 77 68 65 6e 20 6f  ning only when o
c8f0: 6e 65 20 6f 66 20 74 68 65 0a 09 20 20 20 20 23  ne of the..    #
c900: 20 66 69 6c 65 73 20 69 6e 20 63 6f 6d 70 61 74   files in compat
c910: 2f 2a 2e 63 20 69 73 20 62 65 69 6e 67 20 6c 69  /*.c is being li
c920: 6e 6b 65 64 20 69 6e 2e 0a 0a 09 20 20 20 20 41  nked in....    A
c930: 53 5f 49 46 28 5b 74 65 73 74 20 78 22 24 7b 55  S_IF([test x"${U
c940: 53 45 5f 43 4f 4d 50 41 54 7d 22 20 21 3d 20 78  SE_COMPAT}" != x
c950: 5d 2c 5b 43 46 4c 41 47 53 3d 22 24 43 46 4c 41  ],[CFLAGS="$CFLA
c960: 47 53 20 2d 66 6e 6f 2d 69 6e 6c 69 6e 65 22 5d  GS -fno-inline"]
c970: 29 0a 09 20 20 20 20 3b 3b 0a 09 4c 79 6e 78 2a  )..    ;;..Lynx*
c980: 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46 4c  )..    SHLIB_CFL
c990: 41 47 53 3d 22 2d 66 50 49 43 22 0a 09 20 20 20  AGS="-fPIC"..   
c9a0: 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e   SHLIB_SUFFIX=".
c9b0: 73 6f 22 0a 09 20 20 20 20 43 46 4c 41 47 53 5f  so"..    CFLAGS_
c9c0: 4f 50 54 49 4d 49 5a 45 3d 2d 30 32 0a 09 20 20  OPTIMIZE=-02..  
c9d0: 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43    SHLIB_LD='${CC
c9e0: 7d 20 2d 73 68 61 72 65 64 27 0a 09 20 20 20 20  } -shared'..    
c9f0: 4c 44 5f 46 4c 41 47 53 3d 22 2d 57 6c 2c 2d 2d  LD_FLAGS="-Wl,--
ca00: 65 78 70 6f 72 74 2d 64 79 6e 61 6d 69 63 22 0a  export-dynamic".
ca10: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
ca20: 20 24 64 6f 52 70 61 74 68 20 3d 20 79 65 73 5d   $doRpath = yes]
ca30: 2c 20 5b 0a 09 09 43 43 5f 53 45 41 52 43 48 5f  , [...CC_SEARCH_
ca40: 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d 72 70 61 74  FLAGS='-Wl,-rpat
ca50: 68 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f  h,${LIB_RUNTIME_
ca60: 44 49 52 7d 27 0a 09 09 4c 44 5f 53 45 41 52 43  DIR}'...LD_SEARC
ca70: 48 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d 72 70  H_FLAGS='-Wl,-rp
ca80: 61 74 68 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d  ath,${LIB_RUNTIM
ca90: 45 5f 44 49 52 7d 27 5d 29 0a 09 20 20 20 20 3b  E_DIR}'])..    ;
caa0: 3b 0a 09 4f 70 65 6e 42 53 44 2d 2a 29 0a 09 20  ;..OpenBSD-*).. 
cab0: 20 20 20 61 72 63 68 3d 60 61 72 63 68 20 2d 73     arch=`arch -s
cac0: 60 0a 09 20 20 20 20 63 61 73 65 20 22 24 61 72  `..    case "$ar
cad0: 63 68 22 20 69 6e 0a 09 20 20 20 20 76 61 78 29  ch" in..    vax)
cae0: 0a 09 09 53 48 4c 49 42 5f 53 55 46 46 49 58 3d  ...SHLIB_SUFFIX=
caf0: 22 22 0a 09 09 53 48 41 52 45 44 5f 4c 49 42 5f  ""...SHARED_LIB_
cb00: 53 55 46 46 49 58 3d 22 22 0a 09 09 4c 44 46 4c  SUFFIX=""...LDFL
cb10: 41 47 53 3d 22 22 0a 09 09 3b 3b 0a 09 20 20 20  AGS=""...;;..   
cb20: 20 2a 29 0a 09 09 53 48 4c 49 42 5f 43 46 4c 41   *)...SHLIB_CFLA
cb30: 47 53 3d 22 2d 66 50 49 43 22 0a 09 09 53 48 4c  GS="-fPIC"...SHL
cb40: 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 73 68  IB_LD='${CC} -sh
cb50: 61 72 65 64 20 24 7b 53 48 4c 49 42 5f 43 46 4c  ared ${SHLIB_CFL
cb60: 41 47 53 7d 27 0a 09 09 53 48 4c 49 42 5f 53 55  AGS}'...SHLIB_SU
cb70: 46 46 49 58 3d 22 2e 73 6f 22 0a 09 09 41 53 5f  FFIX=".so"...AS_
cb80: 49 46 28 5b 74 65 73 74 20 24 64 6f 52 70 61 74  IF([test $doRpat
cb90: 68 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20 20  h = yes], [...  
cba0: 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47    CC_SEARCH_FLAG
cbb0: 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b  S='-Wl,-rpath,${
cbc0: 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d  LIB_RUNTIME_DIR}
cbd0: 27 5d 29 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f  '])...LD_SEARCH_
cbe0: 46 4c 41 47 53 3d 24 7b 43 43 5f 53 45 41 52 43  FLAGS=${CC_SEARC
cbf0: 48 5f 46 4c 41 47 53 7d 0a 09 09 53 48 41 52 45  H_FLAGS}...SHARE
cc00: 44 5f 4c 49 42 5f 53 55 46 46 49 58 3d 27 24 7b  D_LIB_SUFFIX='${
cc10: 54 43 4c 5f 54 52 49 4d 5f 44 4f 54 53 7d 2e 73  TCL_TRIM_DOTS}.s
cc20: 6f 2e 24 7b 53 48 4c 49 42 5f 56 45 52 53 49 4f  o.${SHLIB_VERSIO
cc30: 4e 7d 27 0a 09 09 4c 44 46 4c 41 47 53 3d 22 2d  N}'...LDFLAGS="-
cc40: 57 6c 2c 2d 65 78 70 6f 72 74 2d 64 79 6e 61 6d  Wl,-export-dynam
cc50: 69 63 22 0a 09 09 3b 3b 0a 09 20 20 20 20 65 73  ic"...;;..    es
cc60: 61 63 0a 09 20 20 20 20 63 61 73 65 20 22 24 61  ac..    case "$a
cc70: 72 63 68 22 20 69 6e 0a 09 20 20 20 20 76 61 78  rch" in..    vax
cc80: 29 0a 09 09 43 46 4c 41 47 53 5f 4f 50 54 49 4d  )...CFLAGS_OPTIM
cc90: 49 5a 45 3d 22 2d 4f 31 22 0a 09 09 3b 3b 0a 09  IZE="-O1"...;;..
cca0: 20 20 20 20 2a 29 0a 09 09 43 46 4c 41 47 53 5f      *)...CFLAGS_
ccb0: 4f 50 54 49 4d 49 5a 45 3d 22 2d 4f 32 22 0a 09  OPTIMIZE="-O2"..
ccc0: 09 3b 3b 0a 09 20 20 20 20 65 73 61 63 0a 09 20  .;;..    esac.. 
ccd0: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
cce0: 24 7b 54 43 4c 5f 54 48 52 45 41 44 53 7d 22 20  ${TCL_THREADS}" 
ccf0: 3d 20 22 31 22 5d 2c 20 5b 0a 09 09 23 20 4f 6e  = "1"], [...# On
cd00: 20 4f 70 65 6e 42 53 44 3a 09 43 6f 6d 70 69 6c   OpenBSD:.Compil
cd10: 65 20 77 69 74 68 20 2d 70 74 68 72 65 61 64 0a  e with -pthread.
cd20: 09 09 23 09 09 44 6f 6e 27 74 20 6c 69 6e 6b 20  ..#..Don't link 
cd30: 77 69 74 68 20 2d 6c 70 74 68 72 65 61 64 0a 09  with -lpthread..
cd40: 09 4c 49 42 53 3d 60 65 63 68 6f 20 24 4c 49 42  .LIBS=`echo $LIB
cd50: 53 20 7c 20 73 65 64 20 73 2f 2d 6c 70 74 68 72  S | sed s/-lpthr
cd60: 65 61 64 2f 2f 60 0a 09 09 43 46 4c 41 47 53 3d  ead//`...CFLAGS=
cd70: 22 24 43 46 4c 41 47 53 20 2d 70 74 68 72 65 61  "$CFLAGS -pthrea
cd80: 64 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20  d"..    ])..    
cd90: 23 20 4f 70 65 6e 42 53 44 20 64 6f 65 73 6e 27  # OpenBSD doesn'
cda0: 74 20 64 6f 20 76 65 72 73 69 6f 6e 20 6e 75 6d  t do version num
cdb0: 62 65 72 73 20 77 69 74 68 20 64 6f 74 73 2e 0a  bers with dots..
cdc0: 09 20 20 20 20 55 4e 53 48 41 52 45 44 5f 4c 49  .    UNSHARED_LI
cdd0: 42 5f 53 55 46 46 49 58 3d 27 24 7b 54 43 4c 5f  B_SUFFIX='${TCL_
cde0: 54 52 49 4d 5f 44 4f 54 53 7d 2e 61 27 0a 09 20  TRIM_DOTS}.a'.. 
cdf0: 20 20 20 54 43 4c 5f 4c 49 42 5f 56 45 52 53 49     TCL_LIB_VERSI
ce00: 4f 4e 53 5f 4f 4b 3d 6e 6f 64 6f 74 73 0a 09 20  ONS_OK=nodots.. 
ce10: 20 20 20 3b 3b 0a 09 4e 65 74 42 53 44 2d 2a 29     ;;..NetBSD-*)
ce20: 0a 09 20 20 20 20 23 20 4e 65 74 42 53 44 20 68  ..    # NetBSD h
ce30: 61 73 20 45 4c 46 20 61 6e 64 20 63 61 6e 20 75  as ELF and can u
ce40: 73 65 20 27 63 63 20 2d 73 68 61 72 65 64 27 20  se 'cc -shared' 
ce50: 74 6f 20 62 75 69 6c 64 20 73 68 61 72 65 64 20  to build shared 
ce60: 6c 69 62 73 0a 09 20 20 20 20 53 48 4c 49 42 5f  libs..    SHLIB_
ce70: 43 46 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a 09  CFLAGS="-fPIC"..
ce80: 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b      SHLIB_LD='${
ce90: 43 43 7d 20 2d 73 68 61 72 65 64 20 24 7b 53 48  CC} -shared ${SH
cea0: 4c 49 42 5f 43 46 4c 41 47 53 7d 27 0a 09 20 20  LIB_CFLAGS}'..  
ceb0: 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22    SHLIB_SUFFIX="
cec0: 2e 73 6f 22 0a 09 20 20 20 20 4c 44 46 4c 41 47  .so"..    LDFLAG
ced0: 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 65 78 70  S="$LDFLAGS -exp
cee0: 6f 72 74 2d 64 79 6e 61 6d 69 63 22 0a 09 20 20  ort-dynamic"..  
cef0: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24 64    AS_IF([test $d
cf00: 6f 52 70 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b  oRpath = yes], [
cf10: 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  ...CC_SEARCH_FLA
cf20: 47 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24  GS='-Wl,-rpath,$
cf30: 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52  {LIB_RUNTIME_DIR
cf40: 7d 27 5d 29 0a 09 20 20 20 20 4c 44 5f 53 45 41  }'])..    LD_SEA
cf50: 52 43 48 5f 46 4c 41 47 53 3d 24 7b 43 43 5f 53  RCH_FLAGS=${CC_S
cf60: 45 41 52 43 48 5f 46 4c 41 47 53 7d 0a 09 20 20  EARCH_FLAGS}..  
cf70: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24    AS_IF([test "$
cf80: 7b 54 43 4c 5f 54 48 52 45 41 44 53 7d 22 20 3d  {TCL_THREADS}" =
cf90: 20 22 31 22 5d 2c 20 5b 0a 09 09 23 20 54 68 65   "1"], [...# The
cfa0: 20 2d 70 74 68 72 65 61 64 20 6e 65 65 64 73 20   -pthread needs 
cfb0: 74 6f 20 67 6f 20 69 6e 20 74 68 65 20 43 46 4c  to go in the CFL
cfc0: 41 47 53 2c 20 6e 6f 74 20 4c 49 42 53 0a 09 09  AGS, not LIBS...
cfd0: 4c 49 42 53 3d 60 65 63 68 6f 20 24 4c 49 42 53  LIBS=`echo $LIBS
cfe0: 20 7c 20 73 65 64 20 73 2f 2d 70 74 68 72 65 61   | sed s/-pthrea
cff0: 64 2f 2f 60 0a 09 09 43 46 4c 41 47 53 3d 22 24  d//`...CFLAGS="$
d000: 43 46 4c 41 47 53 20 2d 70 74 68 72 65 61 64 22  CFLAGS -pthread"
d010: 0a 09 20 20 20 20 09 4c 44 46 4c 41 47 53 3d 22  ..    .LDFLAGS="
d020: 24 4c 44 46 4c 41 47 53 20 2d 70 74 68 72 65 61  $LDFLAGS -pthrea
d030: 64 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20  d"..    ])..    
d040: 3b 3b 0a 09 46 72 65 65 42 53 44 2d 2a 29 0a 09  ;;..FreeBSD-*)..
d050: 20 20 20 20 23 20 54 68 69 73 20 63 6f 6e 66 69      # This confi
d060: 67 75 72 61 74 69 6f 6e 20 66 72 6f 6d 20 46 72  guration from Fr
d070: 65 65 42 53 44 20 50 6f 72 74 73 2e 0a 09 20 20  eeBSD Ports...  
d080: 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22    SHLIB_CFLAGS="
d090: 2d 66 50 49 43 22 0a 09 20 20 20 20 53 48 4c 49  -fPIC"..    SHLI
d0a0: 42 5f 4c 44 3d 22 24 7b 43 43 7d 20 2d 73 68 61  B_LD="${CC} -sha
d0b0: 72 65 64 22 0a 09 20 20 20 20 54 43 4c 5f 53 48  red"..    TCL_SH
d0c0: 4c 49 42 5f 4c 44 5f 45 58 54 52 41 53 3d 22 2d  LIB_LD_EXTRAS="-
d0d0: 57 6c 2c 2d 73 6f 6e 61 6d 65 3d 5c 24 5b 40 5d  Wl,-soname=\$[@]
d0e0: 22 0a 09 20 20 20 20 54 4b 5f 53 48 4c 49 42 5f  "..    TK_SHLIB_
d0f0: 4c 44 5f 45 58 54 52 41 53 3d 22 2d 57 6c 2c 2d  LD_EXTRAS="-Wl,-
d100: 73 6f 6e 61 6d 65 2c 5c 24 5b 40 5d 22 0a 09 20  soname,\$[@]".. 
d110: 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d     SHLIB_SUFFIX=
d120: 22 2e 73 6f 22 0a 09 20 20 20 20 4c 44 46 4c 41  ".so"..    LDFLA
d130: 47 53 3d 22 22 0a 09 20 20 20 20 41 53 5f 49 46  GS=""..    AS_IF
d140: 28 5b 74 65 73 74 20 24 64 6f 52 70 61 74 68 20  ([test $doRpath 
d150: 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 43 43 5f 53  = yes], [...CC_S
d160: 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c  EARCH_FLAGS='-Wl
d170: 2c 2d 72 70 61 74 68 2c 24 7b 4c 49 42 5f 52 55  ,-rpath,${LIB_RU
d180: 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09 09 4c 44  NTIME_DIR}'...LD
d190: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d  _SEARCH_FLAGS='-
d1a0: 57 6c 2c 2d 72 70 61 74 68 2c 24 7b 4c 49 42 5f  Wl,-rpath,${LIB_
d1b0: 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29 0a  RUNTIME_DIR}']).
d1c0: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
d1d0: 20 22 24 7b 54 43 4c 5f 54 48 52 45 41 44 53 7d   "${TCL_THREADS}
d1e0: 22 20 3d 20 22 31 22 5d 2c 20 5b 0a 09 09 23 20  " = "1"], [...# 
d1f0: 54 68 65 20 2d 70 74 68 72 65 61 64 20 6e 65 65  The -pthread nee
d200: 64 73 20 74 6f 20 67 6f 20 69 6e 20 74 68 65 20  ds to go in the 
d210: 4c 44 46 4c 41 47 53 2c 20 6e 6f 74 20 4c 49 42  LDFLAGS, not LIB
d220: 53 0a 09 09 4c 49 42 53 3d 60 65 63 68 6f 20 24  S...LIBS=`echo $
d230: 4c 49 42 53 20 7c 20 73 65 64 20 73 2f 2d 70 74  LIBS | sed s/-pt
d240: 68 72 65 61 64 2f 2f 60 0a 09 09 43 46 4c 41 47  hread//`...CFLAG
d250: 53 3d 22 24 43 46 4c 41 47 53 20 24 50 54 48 52  S="$CFLAGS $PTHR
d260: 45 41 44 5f 43 46 4c 41 47 53 22 0a 09 09 4c 44  EAD_CFLAGS"...LD
d270: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20  FLAGS="$LDFLAGS 
d280: 24 50 54 48 52 45 41 44 5f 4c 49 42 53 22 5d 29  $PTHREAD_LIBS"])
d290: 0a 09 20 20 20 20 63 61 73 65 20 24 73 79 73 74  ..    case $syst
d2a0: 65 6d 20 69 6e 0a 09 20 20 20 20 46 72 65 65 42  em in..    FreeB
d2b0: 53 44 2d 33 2e 2a 29 0a 09 09 23 20 56 65 72 73  SD-3.*)...# Vers
d2c0: 69 6f 6e 20 6e 75 6d 62 65 72 73 20 61 72 65 20  ion numbers are 
d2d0: 64 6f 74 2d 73 74 72 69 70 70 65 64 20 62 79 20  dot-stripped by 
d2e0: 73 79 73 74 65 6d 20 70 6f 6c 69 63 79 2e 0a 09  system policy...
d2f0: 09 54 43 4c 5f 54 52 49 4d 5f 44 4f 54 53 3d 60  .TCL_TRIM_DOTS=`
d300: 65 63 68 6f 20 24 7b 56 45 52 53 49 4f 4e 7d 20  echo ${VERSION} 
d310: 7c 20 74 72 20 2d 64 20 2e 60 0a 09 09 55 4e 53  | tr -d .`...UNS
d320: 48 41 52 45 44 5f 4c 49 42 5f 53 55 46 46 49 58  HARED_LIB_SUFFIX
d330: 3d 27 24 7b 54 43 4c 5f 54 52 49 4d 5f 44 4f 54  ='${TCL_TRIM_DOT
d340: 53 7d 2e 61 27 0a 09 09 53 48 41 52 45 44 5f 4c  S}.a'...SHARED_L
d350: 49 42 5f 53 55 46 46 49 58 3d 27 24 7b 54 43 4c  IB_SUFFIX='${TCL
d360: 5f 54 52 49 4d 5f 44 4f 54 53 7d 2e 73 6f 27 0a  _TRIM_DOTS}.so'.
d370: 09 09 54 43 4c 5f 4c 49 42 5f 56 45 52 53 49 4f  ..TCL_LIB_VERSIO
d380: 4e 53 5f 4f 4b 3d 6e 6f 64 6f 74 73 0a 09 09 3b  NS_OK=nodots...;
d390: 3b 0a 09 20 20 20 20 65 73 61 63 0a 09 20 20 20  ;..    esac..   
d3a0: 20 3b 3b 0a 09 44 61 72 77 69 6e 2d 2a 29 0a 09   ;;..Darwin-*)..
d3b0: 20 20 20 20 43 46 4c 41 47 53 5f 4f 50 54 49 4d      CFLAGS_OPTIM
d3c0: 49 5a 45 3d 22 2d 4f 73 22 0a 09 20 20 20 20 53  IZE="-Os"..    S
d3d0: 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d 66 6e  HLIB_CFLAGS="-fn
d3e0: 6f 2d 63 6f 6d 6d 6f 6e 22 0a 09 20 20 20 20 23  o-common"..    #
d3f0: 20 54 6f 20 61 76 6f 69 64 20 64 69 73 63 72 65   To avoid discre
d400: 70 61 6e 63 69 65 73 20 62 65 74 77 65 65 6e 20  pancies between 
d410: 77 68 61 74 20 68 65 61 64 65 72 73 20 63 6f 6e  what headers con
d420: 66 69 67 75 72 65 20 73 65 65 73 20 64 75 72 69  figure sees duri
d430: 6e 67 0a 09 20 20 20 20 23 20 70 72 65 70 72 6f  ng..    # prepro
d440: 63 65 73 73 69 6e 67 20 74 65 73 74 73 20 61 6e  cessing tests an
d450: 64 20 63 6f 6d 70 69 6c 69 6e 67 20 74 65 73 74  d compiling test
d460: 73 2c 20 6d 6f 76 65 20 61 6e 79 20 2d 69 73 79  s, move any -isy
d470: 73 72 6f 6f 74 20 61 6e 64 0a 09 20 20 20 20 23  sroot and..    #
d480: 20 2d 6d 6d 61 63 6f 73 78 2d 76 65 72 73 69 6f   -mmacosx-versio
d490: 6e 2d 6d 69 6e 20 66 6c 61 67 73 20 66 72 6f 6d  n-min flags from
d4a0: 20 43 46 4c 41 47 53 20 74 6f 20 43 50 50 46 4c   CFLAGS to CPPFL
d4b0: 41 47 53 3a 0a 09 20 20 20 20 43 50 50 46 4c 41  AGS:..    CPPFLA
d4c0: 47 53 3d 22 24 7b 43 50 50 46 4c 41 47 53 7d 20  GS="${CPPFLAGS} 
d4d0: 60 65 63 68 6f 20 22 20 24 7b 43 46 4c 41 47 53  `echo " ${CFLAGS
d4e0: 7d 22 20 7c 20 5c 0a 09 09 61 77 6b 20 27 42 45  }" | \...awk 'BE
d4f0: 47 49 4e 20 7b 46 53 3d 22 20 2b 2d 22 3b 4f 52  GIN {FS=" +-";OR
d500: 53 3d 22 20 22 7d 3b 20 7b 66 6f 72 20 28 69 3d  S=" "}; {for (i=
d510: 32 3b 69 3c 3d 4e 46 3b 69 2b 2b 29 20 5c 0a 09  2;i<=NF;i++) \..
d520: 09 69 66 20 28 5b 24 5d 69 7e 2f 5e 28 69 73 79  .if ([$]i~/^(isy
d530: 73 72 6f 6f 74 7c 6d 6d 61 63 6f 73 78 2d 76 65  sroot|mmacosx-ve
d540: 72 73 69 6f 6e 2d 6d 69 6e 29 2f 29 20 70 72 69  rsion-min)/) pri
d550: 6e 74 20 22 2d 22 5b 24 5d 69 7d 27 60 22 0a 09  nt "-"[$]i}'`"..
d560: 20 20 20 20 43 46 4c 41 47 53 3d 22 60 65 63 68      CFLAGS="`ech
d570: 6f 20 22 20 24 7b 43 46 4c 41 47 53 7d 22 20 7c  o " ${CFLAGS}" |
d580: 20 5c 0a 09 09 61 77 6b 20 27 42 45 47 49 4e 20   \...awk 'BEGIN 
d590: 7b 46 53 3d 22 20 2b 2d 22 3b 4f 52 53 3d 22 20  {FS=" +-";ORS=" 
d5a0: 22 7d 3b 20 7b 66 6f 72 20 28 69 3d 32 3b 69 3c  "}; {for (i=2;i<
d5b0: 3d 4e 46 3b 69 2b 2b 29 20 5c 0a 09 09 69 66 20  =NF;i++) \...if 
d5c0: 28 21 28 5b 24 5d 69 7e 2f 5e 28 69 73 79 73 72  (!([$]i~/^(isysr
d5d0: 6f 6f 74 7c 6d 6d 61 63 6f 73 78 2d 76 65 72 73  oot|mmacosx-vers
d5e0: 69 6f 6e 2d 6d 69 6e 29 2f 29 29 20 70 72 69 6e  ion-min)/)) prin
d5f0: 74 20 22 2d 22 5b 24 5d 69 7d 27 60 22 0a 09 20  t "-"[$]i}'`".. 
d600: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24     AS_IF([test $
d610: 64 6f 36 34 62 69 74 20 3d 20 79 65 73 5d 2c 20  do64bit = yes], 
d620: 5b 0a 09 09 63 61 73 65 20 60 61 72 63 68 60 20  [...case `arch` 
d630: 69 6e 0a 09 09 20 20 20 20 70 70 63 29 0a 09 09  in...    ppc)...
d640: 09 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28  .AC_CACHE_CHECK(
d650: 5b 69 66 20 63 6f 6d 70 69 6c 65 72 20 61 63 63  [if compiler acc
d660: 65 70 74 73 20 2d 61 72 63 68 20 70 70 63 36 34  epts -arch ppc64
d670: 20 66 6c 61 67 5d 2c 0a 09 09 09 09 74 63 6c 5f   flag],.....tcl_
d680: 63 76 5f 63 63 5f 61 72 63 68 5f 70 70 63 36 34  cv_cc_arch_ppc64
d690: 2c 20 5b 0a 09 09 09 20 20 20 20 68 6f 6c 64 5f  , [....    hold_
d6a0: 63 66 6c 61 67 73 3d 24 43 46 4c 41 47 53 0a 09  cflags=$CFLAGS..
d6b0: 09 09 20 20 20 20 43 46 4c 41 47 53 3d 22 24 43  ..    CFLAGS="$C
d6c0: 46 4c 41 47 53 20 2d 61 72 63 68 20 70 70 63 36  FLAGS -arch ppc6
d6d0: 34 20 2d 6d 70 6f 77 65 72 70 63 36 34 20 2d 6d  4 -mpowerpc64 -m
d6e0: 63 70 75 3d 47 35 22 0a 09 09 09 20 20 20 20 41  cpu=G5"....    A
d6f0: 43 5f 54 52 59 5f 4c 49 4e 4b 28 2c 2c 20 74 63  C_TRY_LINK(,, tc
d700: 6c 5f 63 76 5f 63 63 5f 61 72 63 68 5f 70 70 63  l_cv_cc_arch_ppc
d710: 36 34 3d 79 65 73 2c 0a 09 09 09 09 20 20 20 20  64=yes,.....    
d720: 74 63 6c 5f 63 76 5f 63 63 5f 61 72 63 68 5f 70  tcl_cv_cc_arch_p
d730: 70 63 36 34 3d 6e 6f 29 0a 09 09 09 20 20 20 20  pc64=no)....    
d740: 43 46 4c 41 47 53 3d 24 68 6f 6c 64 5f 63 66 6c  CFLAGS=$hold_cfl
d750: 61 67 73 5d 29 0a 09 09 09 41 53 5f 49 46 28 5b  ags])....AS_IF([
d760: 74 65 73 74 20 24 74 63 6c 5f 63 76 5f 63 63 5f  test $tcl_cv_cc_
d770: 61 72 63 68 5f 70 70 63 36 34 20 3d 20 79 65 73  arch_ppc64 = yes
d780: 5d 2c 20 5b 0a 09 09 09 20 20 20 20 43 46 4c 41  ], [....    CFLA
d790: 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 61 72 63  GS="$CFLAGS -arc
d7a0: 68 20 70 70 63 36 34 20 2d 6d 70 6f 77 65 72 70  h ppc64 -mpowerp
d7b0: 63 36 34 20 2d 6d 63 70 75 3d 47 35 22 0a 09 09  c64 -mcpu=G5"...
d7c0: 09 20 20 20 20 64 6f 36 34 62 69 74 5f 6f 6b 3d  .    do64bit_ok=
d7d0: 79 65 73 0a 09 09 09 5d 29 3b 3b 0a 09 09 20 20  yes....]);;...  
d7e0: 20 20 69 33 38 36 29 0a 09 09 09 41 43 5f 43 41    i386)....AC_CA
d7f0: 43 48 45 5f 43 48 45 43 4b 28 5b 69 66 20 63 6f  CHE_CHECK([if co
d800: 6d 70 69 6c 65 72 20 61 63 63 65 70 74 73 20 2d  mpiler accepts -
d810: 61 72 63 68 20 78 38 36 5f 36 34 20 66 6c 61 67  arch x86_64 flag
d820: 5d 2c 0a 09 09 09 09 74 63 6c 5f 63 76 5f 63 63  ],.....tcl_cv_cc
d830: 5f 61 72 63 68 5f 78 38 36 5f 36 34 2c 20 5b 0a  _arch_x86_64, [.
d840: 09 09 09 20 20 20 20 68 6f 6c 64 5f 63 66 6c 61  ...    hold_cfla
d850: 67 73 3d 24 43 46 4c 41 47 53 0a 09 09 09 20 20  gs=$CFLAGS....  
d860: 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47    CFLAGS="$CFLAG
d870: 53 20 2d 61 72 63 68 20 78 38 36 5f 36 34 22 0a  S -arch x86_64".
d880: 09 09 09 20 20 20 20 41 43 5f 54 52 59 5f 4c 49  ...    AC_TRY_LI
d890: 4e 4b 28 2c 2c 20 74 63 6c 5f 63 76 5f 63 63 5f  NK(,, tcl_cv_cc_
d8a0: 61 72 63 68 5f 78 38 36 5f 36 34 3d 79 65 73 2c  arch_x86_64=yes,
d8b0: 0a 09 09 09 09 20 20 20 20 74 63 6c 5f 63 76 5f  .....    tcl_cv_
d8c0: 63 63 5f 61 72 63 68 5f 78 38 36 5f 36 34 3d 6e  cc_arch_x86_64=n
d8d0: 6f 29 0a 09 09 09 20 20 20 20 43 46 4c 41 47 53  o)....    CFLAGS
d8e0: 3d 24 68 6f 6c 64 5f 63 66 6c 61 67 73 5d 29 0a  =$hold_cflags]).
d8f0: 09 09 09 41 53 5f 49 46 28 5b 74 65 73 74 20 24  ...AS_IF([test $
d900: 74 63 6c 5f 63 76 5f 63 63 5f 61 72 63 68 5f 78  tcl_cv_cc_arch_x
d910: 38 36 5f 36 34 20 3d 20 79 65 73 5d 2c 20 5b 0a  86_64 = yes], [.
d920: 09 09 09 20 20 20 20 43 46 4c 41 47 53 3d 22 24  ...    CFLAGS="$
d930: 43 46 4c 41 47 53 20 2d 61 72 63 68 20 78 38 36  CFLAGS -arch x86
d940: 5f 36 34 22 0a 09 09 09 20 20 20 20 64 6f 36 34  _64"....    do64
d950: 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09 09 5d 29  bit_ok=yes....])
d960: 3b 3b 0a 09 09 20 20 20 20 2a 29 0a 09 09 09 41  ;;...    *)....A
d970: 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 44 6f 6e 27  C_MSG_WARN([Don'
d980: 74 20 6b 6e 6f 77 20 68 6f 77 20 65 6e 61 62 6c  t know how enabl
d990: 65 20 36 34 2d 62 69 74 20 6f 6e 20 61 72 63 68  e 64-bit on arch
d9a0: 69 74 65 63 74 75 72 65 20 60 61 72 63 68 60 5d  itecture `arch`]
d9b0: 29 3b 3b 0a 09 09 65 73 61 63 0a 09 20 20 20 20  );;...esac..    
d9c0: 5d 2c 20 5b 0a 09 09 23 20 43 68 65 63 6b 20 66  ], [...# Check f
d9d0: 6f 72 20 63 6f 6d 62 69 6e 65 64 20 33 32 2d 62  or combined 32-b
d9e0: 69 74 20 61 6e 64 20 36 34 2d 62 69 74 20 66 61  it and 64-bit fa
d9f0: 74 20 62 75 69 6c 64 0a 09 09 41 53 5f 49 46 28  t build...AS_IF(
da00: 5b 65 63 68 6f 20 22 24 43 46 4c 41 47 53 20 22  [echo "$CFLAGS "
da10: 20 7c 67 72 65 70 20 2d 45 20 2d 71 20 2d 2d 20   |grep -E -q -- 
da20: 27 2d 61 72 63 68 20 28 70 70 63 36 34 7c 78 38  '-arch (ppc64|x8
da30: 36 5f 36 34 29 20 27 20 5c 0a 09 09 20 20 20 20  6_64) ' \...    
da40: 26 26 20 65 63 68 6f 20 22 24 43 46 4c 41 47 53  && echo "$CFLAGS
da50: 20 22 20 7c 67 72 65 70 20 2d 45 20 2d 71 20 2d   " |grep -E -q -
da60: 2d 20 27 2d 61 72 63 68 20 28 70 70 63 7c 69 33  - '-arch (ppc|i3
da70: 38 36 29 20 27 5d 2c 20 5b 0a 09 09 20 20 20 20  86) '], [...    
da80: 66 61 74 5f 33 32 5f 36 34 3d 79 65 73 5d 29 0a  fat_32_64=yes]).
da90: 09 20 20 20 20 5d 29 0a 09 20 20 20 20 23 20 54  .    ])..    # T
daa0: 45 41 20 73 70 65 63 69 66 69 63 3a 20 75 73 65  EA specific: use
dab0: 20 4c 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54   LDFLAGS_DEFAULT
dac0: 20 69 6e 73 74 65 61 64 20 6f 66 20 4c 44 46 4c   instead of LDFL
dad0: 41 47 53 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c  AGS..    SHLIB_L
dae0: 44 3d 27 24 7b 43 43 7d 20 2d 64 79 6e 61 6d 69  D='${CC} -dynami
daf0: 63 6c 69 62 20 24 7b 43 46 4c 41 47 53 7d 20 24  clib ${CFLAGS} $
db00: 7b 4c 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54  {LDFLAGS_DEFAULT
db10: 7d 27 0a 09 20 20 20 20 41 43 5f 43 41 43 48 45  }'..    AC_CACHE
db20: 5f 43 48 45 43 4b 28 5b 69 66 20 6c 64 20 61 63  _CHECK([if ld ac
db30: 63 65 70 74 73 20 2d 73 69 6e 67 6c 65 5f 6d 6f  cepts -single_mo
db40: 64 75 6c 65 20 66 6c 61 67 5d 2c 20 74 63 6c 5f  dule flag], tcl_
db50: 63 76 5f 6c 64 5f 73 69 6e 67 6c 65 5f 6d 6f 64  cv_ld_single_mod
db60: 75 6c 65 2c 20 5b 0a 09 09 68 6f 6c 64 5f 6c 64  ule, [...hold_ld
db70: 66 6c 61 67 73 3d 24 4c 44 46 4c 41 47 53 0a 09  flags=$LDFLAGS..
db80: 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41  .LDFLAGS="$LDFLA
db90: 47 53 20 2d 64 79 6e 61 6d 69 63 6c 69 62 20 2d  GS -dynamiclib -
dba0: 57 6c 2c 2d 73 69 6e 67 6c 65 5f 6d 6f 64 75 6c  Wl,-single_modul
dbb0: 65 22 0a 09 09 41 43 5f 54 52 59 5f 4c 49 4e 4b  e"...AC_TRY_LINK
dbc0: 28 2c 20 5b 69 6e 74 20 69 3b 5d 2c 20 74 63 6c  (, [int i;], tcl
dbd0: 5f 63 76 5f 6c 64 5f 73 69 6e 67 6c 65 5f 6d 6f  _cv_ld_single_mo
dbe0: 64 75 6c 65 3d 79 65 73 2c 20 74 63 6c 5f 63 76  dule=yes, tcl_cv
dbf0: 5f 6c 64 5f 73 69 6e 67 6c 65 5f 6d 6f 64 75 6c  _ld_single_modul
dc00: 65 3d 6e 6f 29 0a 09 09 4c 44 46 4c 41 47 53 3d  e=no)...LDFLAGS=
dc10: 24 68 6f 6c 64 5f 6c 64 66 6c 61 67 73 5d 29 0a  $hold_ldflags]).
dc20: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
dc30: 20 24 74 63 6c 5f 63 76 5f 6c 64 5f 73 69 6e 67   $tcl_cv_ld_sing
dc40: 6c 65 5f 6d 6f 64 75 6c 65 20 3d 20 79 65 73 5d  le_module = yes]
dc50: 2c 20 5b 0a 09 09 53 48 4c 49 42 5f 4c 44 3d 22  , [...SHLIB_LD="
dc60: 24 7b 53 48 4c 49 42 5f 4c 44 7d 20 2d 57 6c 2c  ${SHLIB_LD} -Wl,
dc70: 2d 73 69 6e 67 6c 65 5f 6d 6f 64 75 6c 65 22 0a  -single_module".
dc80: 09 20 20 20 20 5d 29 0a 09 20 20 20 20 23 20 54  .    ])..    # T
dc90: 45 41 20 73 70 65 63 69 66 69 63 3a 20 6c 69 6e  EA specific: lin
dca0: 6b 20 73 68 6c 69 62 20 77 69 74 68 20 63 75 72  k shlib with cur
dcb0: 72 65 6e 74 20 61 6e 64 20 63 6f 6d 70 61 74 69  rent and compati
dcc0: 62 69 6c 69 74 79 20 76 65 72 73 69 6f 6e 20 66  bility version f
dcd0: 6c 61 67 73 0a 09 20 20 20 20 76 65 72 73 3d 60  lags..    vers=`
dce0: 65 63 68 6f 20 24 7b 50 41 43 4b 41 47 45 5f 56  echo ${PACKAGE_V
dcf0: 45 52 53 49 4f 4e 7d 20 7c 20 73 65 64 20 2d 65  ERSION} | sed -e
dd00: 20 27 73 2f 5e 5c 28 5b 5b 30 2d 39 5d 5d 5c 7b   's/^\([[0-9]]\{
dd10: 31 2c 35 5c 7d 5c 29 5c 28 5c 28 5c 2e 5b 5b 30  1,5\}\)\(\(\.[[0
dd20: 2d 39 5d 5d 5c 7b 31 2c 33 5c 7d 5c 29 5c 7b 30  -9]]\{1,3\}\)\{0
dd30: 2c 32 5c 7d 5c 29 2e 2a 24 2f 5c 31 5c 32 2f 70  ,2\}\).*$/\1\2/p
dd40: 27 20 2d 65 20 64 60 0a 09 20 20 20 20 53 48 4c  ' -e d`..    SHL
dd50: 49 42 5f 4c 44 3d 22 24 7b 53 48 4c 49 42 5f 4c  IB_LD="${SHLIB_L
dd60: 44 7d 20 2d 63 75 72 72 65 6e 74 5f 76 65 72 73  D} -current_vers
dd70: 69 6f 6e 20 24 7b 76 65 72 73 3a 2d 30 7d 20 2d  ion ${vers:-0} -
dd80: 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 5f 76 65  compatibility_ve
dd90: 72 73 69 6f 6e 20 24 7b 76 65 72 73 3a 2d 30 7d  rsion ${vers:-0}
dda0: 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46  "..    SHLIB_SUF
ddb0: 46 49 58 3d 22 2e 64 79 6c 69 62 22 0a 09 20 20  FIX=".dylib"..  
ddc0: 20 20 23 20 44 6f 6e 27 74 20 75 73 65 20 2d 70    # Don't use -p
ddd0: 72 65 62 69 6e 64 20 77 68 65 6e 20 62 75 69 6c  rebind when buil
dde0: 64 69 6e 67 20 66 6f 72 20 4d 61 63 20 4f 53 20  ding for Mac OS 
ddf0: 58 20 31 30 2e 34 20 6f 72 20 6c 61 74 65 72 20  X 10.4 or later 
de00: 6f 6e 6c 79 3a 0a 09 20 20 20 20 41 53 5f 49 46  only:..    AS_IF
de10: 28 5b 74 65 73 74 20 22 60 65 63 68 6f 20 22 24  ([test "`echo "$
de20: 7b 4d 41 43 4f 53 58 5f 44 45 50 4c 4f 59 4d 45  {MACOSX_DEPLOYME
de30: 4e 54 5f 54 41 52 47 45 54 7d 22 20 7c 20 61 77  NT_TARGET}" | aw
de40: 6b 20 2d 46 20 27 31 30 5c 5c 2e 27 20 27 7b 70  k -F '10\\.' '{p
de50: 72 69 6e 74 20 69 6e 74 28 5b 24 5d 32 29 7d 27  rint int([$]2)}'
de60: 60 22 20 2d 6c 74 20 34 20 2d 61 20 5c 0a 09 09  `" -lt 4 -a \...
de70: 22 60 65 63 68 6f 20 22 24 7b 43 50 50 46 4c 41  "`echo "${CPPFLA
de80: 47 53 7d 22 20 7c 20 61 77 6b 20 2d 46 20 27 2d  GS}" | awk -F '-
de90: 6d 6d 61 63 6f 73 78 2d 76 65 72 73 69 6f 6e 2d  mmacosx-version-
dea0: 6d 69 6e 3d 31 30 5c 5c 2e 27 20 27 7b 70 72 69  min=10\\.' '{pri
deb0: 6e 74 20 69 6e 74 28 5b 24 5d 32 29 7d 27 60 22  nt int([$]2)}'`"
dec0: 20 2d 6c 74 20 34 5d 2c 20 5b 0a 09 09 4c 44 46   -lt 4], [...LDF
ded0: 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d  LAGS="$LDFLAGS -
dee0: 70 72 65 62 69 6e 64 22 5d 29 0a 09 20 20 20 20  prebind"])..    
def0: 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47  LDFLAGS="$LDFLAG
df00: 53 20 2d 68 65 61 64 65 72 70 61 64 5f 6d 61 78  S -headerpad_max
df10: 5f 69 6e 73 74 61 6c 6c 5f 6e 61 6d 65 73 22 0a  _install_names".
df20: 09 20 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48  .    AC_CACHE_CH
df30: 45 43 4b 28 5b 69 66 20 6c 64 20 61 63 63 65 70  ECK([if ld accep
df40: 74 73 20 2d 73 65 61 72 63 68 5f 70 61 74 68 73  ts -search_paths
df50: 5f 66 69 72 73 74 20 66 6c 61 67 5d 2c 0a 09 09  _first flag],...
df60: 20 20 20 20 74 63 6c 5f 63 76 5f 6c 64 5f 73 65      tcl_cv_ld_se
df70: 61 72 63 68 5f 70 61 74 68 73 5f 66 69 72 73 74  arch_paths_first
df80: 2c 20 5b 0a 09 09 68 6f 6c 64 5f 6c 64 66 6c 61  , [...hold_ldfla
df90: 67 73 3d 24 4c 44 46 4c 41 47 53 0a 09 09 4c 44  gs=$LDFLAGS...LD
dfa0: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20  FLAGS="$LDFLAGS 
dfb0: 2d 57 6c 2c 2d 73 65 61 72 63 68 5f 70 61 74 68  -Wl,-search_path
dfc0: 73 5f 66 69 72 73 74 22 0a 09 09 41 43 5f 54 52  s_first"...AC_TR
dfd0: 59 5f 4c 49 4e 4b 28 2c 20 5b 69 6e 74 20 69 3b  Y_LINK(, [int i;
dfe0: 5d 2c 20 74 63 6c 5f 63 76 5f 6c 64 5f 73 65 61  ], tcl_cv_ld_sea
dff0: 72 63 68 5f 70 61 74 68 73 5f 66 69 72 73 74 3d  rch_paths_first=
e000: 79 65 73 2c 0a 09 09 09 74 63 6c 5f 63 76 5f 6c  yes,....tcl_cv_l
e010: 64 5f 73 65 61 72 63 68 5f 70 61 74 68 73 5f 66  d_search_paths_f
e020: 69 72 73 74 3d 6e 6f 29 0a 09 09 4c 44 46 4c 41  irst=no)...LDFLA
e030: 47 53 3d 24 68 6f 6c 64 5f 6c 64 66 6c 61 67 73  GS=$hold_ldflags
e040: 5d 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74  ])..    AS_IF([t
e050: 65 73 74 20 24 74 63 6c 5f 63 76 5f 6c 64 5f 73  est $tcl_cv_ld_s
e060: 65 61 72 63 68 5f 70 61 74 68 73 5f 66 69 72 73  earch_paths_firs
e070: 74 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 4c 44  t = yes], [...LD
e080: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20  FLAGS="$LDFLAGS 
e090: 2d 57 6c 2c 2d 73 65 61 72 63 68 5f 70 61 74 68  -Wl,-search_path
e0a0: 73 5f 66 69 72 73 74 22 0a 09 20 20 20 20 5d 29  s_first"..    ])
e0b0: 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
e0c0: 74 20 22 24 74 63 6c 5f 63 76 5f 63 63 5f 76 69  t "$tcl_cv_cc_vi
e0d0: 73 69 62 69 6c 69 74 79 5f 68 69 64 64 65 6e 22  sibility_hidden"
e0e0: 20 21 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 41 43   != yes], [...AC
e0f0: 5f 44 45 46 49 4e 45 28 4d 4f 44 55 4c 45 5f 53  _DEFINE(MODULE_S
e100: 43 4f 50 45 2c 20 5b 5f 5f 70 72 69 76 61 74 65  COPE, [__private
e110: 5f 65 78 74 65 72 6e 5f 5f 5d 2c 0a 09 09 20 20  _extern__],...  
e120: 20 20 5b 43 6f 6d 70 69 6c 65 72 20 73 75 70 70    [Compiler supp
e130: 6f 72 74 20 66 6f 72 20 6d 6f 64 75 6c 65 20 73  ort for module s
e140: 63 6f 70 65 20 73 79 6d 62 6f 6c 73 5d 29 0a 09  cope symbols])..
e150: 09 74 63 6c 5f 63 76 5f 63 63 5f 76 69 73 69 62  .tcl_cv_cc_visib
e160: 69 6c 69 74 79 5f 68 69 64 64 65 6e 3d 79 65 73  ility_hidden=yes
e170: 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 43 43  ..    ])..    CC
e180: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22 22  _SEARCH_FLAGS=""
e190: 0a 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48 5f  ..    LD_SEARCH_
e1a0: 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 4c 44  FLAGS=""..    LD
e1b0: 5f 4c 49 42 52 41 52 59 5f 50 41 54 48 5f 56 41  _LIBRARY_PATH_VA
e1c0: 52 3d 22 44 59 4c 44 5f 4c 49 42 52 41 52 59 5f  R="DYLD_LIBRARY_
e1d0: 50 41 54 48 22 0a 09 20 20 20 20 23 20 54 45 41  PATH"..    # TEA
e1e0: 20 73 70 65 63 69 66 69 63 3a 20 66 6f 72 20 63   specific: for c
e1f0: 6f 6d 62 69 6e 65 64 20 33 32 20 26 20 36 34 20  ombined 32 & 64 
e200: 62 69 74 20 66 61 74 20 62 75 69 6c 64 73 20 6f  bit fat builds o
e210: 66 20 54 6b 0a 09 20 20 20 20 23 20 65 78 74 65  f Tk..    # exte
e220: 6e 73 69 6f 6e 73 2c 20 76 65 72 69 66 79 20 74  nsions, verify t
e230: 68 61 74 20 36 34 2d 62 69 74 20 62 75 69 6c 64  hat 64-bit build
e240: 20 69 73 20 70 6f 73 73 69 62 6c 65 2e 0a 09 20   is possible... 
e250: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
e260: 24 66 61 74 5f 33 32 5f 36 34 22 20 3d 20 79 65  $fat_32_64" = ye
e270: 73 20 26 26 20 74 65 73 74 20 2d 6e 20 22 24 7b  s && test -n "${
e280: 54 4b 5f 42 49 4e 5f 44 49 52 7d 22 5d 2c 20 5b  TK_BIN_DIR}"], [
e290: 0a 09 09 41 53 5f 49 46 28 5b 74 65 73 74 20 22  ...AS_IF([test "
e2a0: 24 7b 54 45 41 5f 57 49 4e 44 4f 57 49 4e 47 53  ${TEA_WINDOWINGS
e2b0: 59 53 54 45 4d 7d 22 20 3d 20 78 31 31 5d 2c 20  YSTEM}" = x11], 
e2c0: 5b 0a 09 09 20 20 20 20 41 43 5f 43 41 43 48 45  [...    AC_CACHE
e2d0: 5f 43 48 45 43 4b 28 5b 66 6f 72 20 36 34 2d 62  _CHECK([for 64-b
e2e0: 69 74 20 58 31 31 5d 2c 20 74 63 6c 5f 63 76 5f  it X11], tcl_cv_
e2f0: 6c 69 62 5f 78 31 31 5f 36 34 2c 20 5b 0a 09 09  lib_x11_64, [...
e300: 09 66 6f 72 20 76 20 69 6e 20 43 46 4c 41 47 53  .for v in CFLAGS
e310: 20 43 50 50 46 4c 41 47 53 20 4c 44 46 4c 41 47   CPPFLAGS LDFLAG
e320: 53 3b 20 64 6f 0a 09 09 09 20 20 20 20 65 76 61  S; do....    eva
e330: 6c 20 27 68 6f 6c 64 5f 27 24 76 27 3d 22 24 27  l 'hold_'$v'="$'
e340: 24 76 27 22 3b 27 24 76 27 3d 22 60 65 63 68 6f  $v'";'$v'="`echo
e350: 20 22 24 27 24 76 27 20 22 7c 73 65 64 20 2d 65   "$'$v' "|sed -e
e360: 20 22 73 2f 2d 61 72 63 68 20 70 70 63 20 2f 20   "s/-arch ppc / 
e370: 2f 67 22 20 2d 65 20 22 73 2f 2d 61 72 63 68 20  /g" -e "s/-arch 
e380: 69 33 38 36 20 2f 20 2f 67 22 60 22 27 0a 09 09  i386 / /g"`"'...
e390: 09 64 6f 6e 65 0a 09 09 09 43 50 50 46 4c 41 47  .done....CPPFLAG
e3a0: 53 3d 22 24 43 50 50 46 4c 41 47 53 20 2d 49 2f  S="$CPPFLAGS -I/
e3b0: 75 73 72 2f 58 31 31 52 36 2f 69 6e 63 6c 75 64  usr/X11R6/includ
e3c0: 65 22 0a 09 09 09 4c 44 46 4c 41 47 53 3d 22 24  e"....LDFLAGS="$
e3d0: 4c 44 46 4c 41 47 53 20 2d 4c 2f 75 73 72 2f 58  LDFLAGS -L/usr/X
e3e0: 31 31 52 36 2f 6c 69 62 20 2d 6c 58 31 31 22 0a  11R6/lib -lX11".
e3f0: 09 09 09 41 43 5f 54 52 59 5f 4c 49 4e 4b 28 5b  ...AC_TRY_LINK([
e400: 23 69 6e 63 6c 75 64 65 20 3c 58 31 31 2f 58 6c  #include <X11/Xl
e410: 69 62 2e 68 3e 5d 2c 20 5b 58 72 6d 49 6e 69 74  ib.h>], [XrmInit
e420: 69 61 6c 69 7a 65 28 29 3b 5d 2c 0a 09 09 09 20  ialize();],.... 
e430: 20 20 20 74 63 6c 5f 63 76 5f 6c 69 62 5f 78 31     tcl_cv_lib_x1
e440: 31 5f 36 34 3d 79 65 73 2c 20 74 63 6c 5f 63 76  1_64=yes, tcl_cv
e450: 5f 6c 69 62 5f 78 31 31 5f 36 34 3d 6e 6f 29 0a  _lib_x11_64=no).
e460: 09 09 09 66 6f 72 20 76 20 69 6e 20 43 46 4c 41  ...for v in CFLA
e470: 47 53 20 43 50 50 46 4c 41 47 53 20 4c 44 46 4c  GS CPPFLAGS LDFL
e480: 41 47 53 3b 20 64 6f 0a 09 09 09 20 20 20 20 65  AGS; do....    e
e490: 76 61 6c 20 24 76 27 3d 22 24 68 6f 6c 64 5f 27  val $v'="$hold_'
e4a0: 24 76 27 22 27 0a 09 09 09 64 6f 6e 65 5d 29 0a  $v'"'....done]).
e4b0: 09 09 5d 29 0a 09 09 41 53 5f 49 46 28 5b 74 65  ..])...AS_IF([te
e4c0: 73 74 20 22 24 7b 54 45 41 5f 57 49 4e 44 4f 57  st "${TEA_WINDOW
e4d0: 49 4e 47 53 59 53 54 45 4d 7d 22 20 3d 20 61 71  INGSYSTEM}" = aq
e4e0: 75 61 5d 2c 20 5b 0a 09 09 20 20 20 20 41 43 5f  ua], [...    AC_
e4f0: 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f 72  CACHE_CHECK([for
e500: 20 36 34 2d 62 69 74 20 54 6b 5d 2c 20 74 63 6c   64-bit Tk], tcl
e510: 5f 63 76 5f 6c 69 62 5f 74 6b 5f 36 34 2c 20 5b  _cv_lib_tk_64, [
e520: 0a 09 09 09 66 6f 72 20 76 20 69 6e 20 43 46 4c  ....for v in CFL
e530: 41 47 53 20 43 50 50 46 4c 41 47 53 20 4c 44 46  AGS CPPFLAGS LDF
e540: 4c 41 47 53 3b 20 64 6f 0a 09 09 09 20 20 20 20  LAGS; do....    
e550: 65 76 61 6c 20 27 68 6f 6c 64 5f 27 24 76 27 3d  eval 'hold_'$v'=
e560: 22 24 27 24 76 27 22 3b 27 24 76 27 3d 22 60 65  "$'$v'";'$v'="`e
e570: 63 68 6f 20 22 24 27 24 76 27 20 22 7c 73 65 64  cho "$'$v' "|sed
e580: 20 2d 65 20 22 73 2f 2d 61 72 63 68 20 70 70 63   -e "s/-arch ppc
e590: 20 2f 20 2f 67 22 20 2d 65 20 22 73 2f 2d 61 72   / /g" -e "s/-ar
e5a0: 63 68 20 69 33 38 36 20 2f 20 2f 67 22 60 22 27  ch i386 / /g"`"'
e5b0: 0a 09 09 09 64 6f 6e 65 0a 09 09 09 43 50 50 46  ....done....CPPF
e5c0: 4c 41 47 53 3d 22 24 43 50 50 46 4c 41 47 53 20  LAGS="$CPPFLAGS 
e5d0: 2d 44 55 53 45 5f 54 43 4c 5f 53 54 55 42 53 3d  -DUSE_TCL_STUBS=
e5e0: 31 20 2d 44 55 53 45 5f 54 4b 5f 53 54 55 42 53  1 -DUSE_TK_STUBS
e5f0: 3d 31 20 24 7b 54 43 4c 5f 49 4e 43 4c 55 44 45  =1 ${TCL_INCLUDE
e600: 53 7d 20 24 7b 54 4b 5f 49 4e 43 4c 55 44 45 53  S} ${TK_INCLUDES
e610: 7d 22 0a 09 09 09 4c 44 46 4c 41 47 53 3d 22 24  }"....LDFLAGS="$
e620: 4c 44 46 4c 41 47 53 20 24 7b 54 43 4c 5f 53 54  LDFLAGS ${TCL_ST
e630: 55 42 5f 4c 49 42 5f 53 50 45 43 7d 20 24 7b 54  UB_LIB_SPEC} ${T
e640: 4b 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 7d  K_STUB_LIB_SPEC}
e650: 22 0a 09 09 09 41 43 5f 54 52 59 5f 4c 49 4e 4b  "....AC_TRY_LINK
e660: 28 5b 23 69 6e 63 6c 75 64 65 20 3c 74 6b 2e 68  ([#include <tk.h
e670: 3e 5d 2c 20 5b 54 6b 5f 49 6e 69 74 53 74 75 62  >], [Tk_InitStub
e680: 73 28 4e 55 4c 4c 2c 20 22 22 2c 20 30 29 3b 5d  s(NULL, "", 0);]
e690: 2c 0a 09 09 09 20 20 20 20 74 63 6c 5f 63 76 5f  ,....    tcl_cv_
e6a0: 6c 69 62 5f 74 6b 5f 36 34 3d 79 65 73 2c 20 74  lib_tk_64=yes, t
e6b0: 63 6c 5f 63 76 5f 6c 69 62 5f 74 6b 5f 36 34 3d  cl_cv_lib_tk_64=
e6c0: 6e 6f 29 0a 09 09 09 66 6f 72 20 76 20 69 6e 20  no)....for v in 
e6d0: 43 46 4c 41 47 53 20 43 50 50 46 4c 41 47 53 20  CFLAGS CPPFLAGS 
e6e0: 4c 44 46 4c 41 47 53 3b 20 64 6f 0a 09 09 09 20  LDFLAGS; do.... 
e6f0: 20 20 20 65 76 61 6c 20 24 76 27 3d 22 24 68 6f     eval $v'="$ho
e700: 6c 64 5f 27 24 76 27 22 27 0a 09 09 09 64 6f 6e  ld_'$v'"'....don
e710: 65 5d 29 0a 09 09 5d 29 0a 09 09 23 20 72 65 6d  e])...])...# rem
e720: 6f 76 65 20 36 34 2d 62 69 74 20 61 72 63 68 20  ove 64-bit arch 
e730: 66 6c 61 67 73 20 66 72 6f 6d 20 43 46 4c 41 47  flags from CFLAG
e740: 53 20 65 74 20 61 6c 2e 20 69 66 20 63 6f 6e 66  S et al. if conf
e750: 69 67 75 72 61 74 69 6f 6e 0a 09 09 23 20 64 6f  iguration...# do
e760: 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 36  es not support 6
e770: 34 2d 62 69 74 2e 0a 09 09 41 53 5f 49 46 28 5b  4-bit....AS_IF([
e780: 74 65 73 74 20 22 24 74 63 6c 5f 63 76 5f 6c 69  test "$tcl_cv_li
e790: 62 5f 74 6b 5f 36 34 22 20 3d 20 6e 6f 20 2d 6f  b_tk_64" = no -o
e7a0: 20 22 24 74 63 6c 5f 63 76 5f 6c 69 62 5f 78 31   "$tcl_cv_lib_x1
e7b0: 31 5f 36 34 22 20 3d 20 6e 6f 5d 2c 20 5b 0a 09  1_64" = no], [..
e7c0: 09 20 20 20 20 41 43 5f 4d 53 47 5f 4e 4f 54 49  .    AC_MSG_NOTI
e7d0: 43 45 28 5b 52 65 6d 6f 76 69 6e 67 20 36 34 2d  CE([Removing 64-
e7e0: 62 69 74 20 61 72 63 68 69 74 65 63 74 75 72 65  bit architecture
e7f0: 73 20 66 72 6f 6d 20 63 6f 6d 70 69 6c 65 72 20  s from compiler 
e800: 26 20 6c 69 6e 6b 65 72 20 66 6c 61 67 73 5d 29  & linker flags])
e810: 0a 09 09 20 20 20 20 66 6f 72 20 76 20 69 6e 20  ...    for v in 
e820: 43 46 4c 41 47 53 20 43 50 50 46 4c 41 47 53 20  CFLAGS CPPFLAGS 
e830: 4c 44 46 4c 41 47 53 3b 20 64 6f 0a 09 09 09 65  LDFLAGS; do....e
e840: 76 61 6c 20 24 76 27 3d 22 60 65 63 68 6f 20 22  val $v'="`echo "
e850: 24 27 24 76 27 20 22 7c 73 65 64 20 2d 65 20 22  $'$v' "|sed -e "
e860: 73 2f 2d 61 72 63 68 20 70 70 63 36 34 20 2f 20  s/-arch ppc64 / 
e870: 2f 67 22 20 2d 65 20 22 73 2f 2d 61 72 63 68 20  /g" -e "s/-arch 
e880: 78 38 36 5f 36 34 20 2f 20 2f 67 22 60 22 27 0a  x86_64 / /g"`"'.
e890: 09 09 20 20 20 20 64 6f 6e 65 5d 29 0a 09 20 20  ..    done])..  
e8a0: 20 20 5d 29 0a 09 20 20 20 20 3b 3b 0a 09 4f 53    ])..    ;;..OS
e8b0: 2f 33 39 30 2d 2a 29 0a 09 20 20 20 20 43 46 4c  /390-*)..    CFL
e8c0: 41 47 53 5f 4f 50 54 49 4d 49 5a 45 3d 22 22 09  AGS_OPTIMIZE="".
e8d0: 09 23 20 4f 70 74 69 6d 69 7a 65 72 20 69 73 20  .# Optimizer is 
e8e0: 62 75 67 67 79 0a 09 20 20 20 20 41 43 5f 44 45  buggy..    AC_DE
e8f0: 46 49 4e 45 28 5f 4f 45 5f 53 4f 43 4b 45 54 53  FINE(_OE_SOCKETS
e900: 2c 20 31 2c 09 23 20 6e 65 65 64 65 64 20 69 6e  , 1,.# needed in
e910: 20 73 79 73 2f 73 6f 63 6b 65 74 2e 68 0a 09 09   sys/socket.h...
e920: 5b 53 68 6f 75 6c 64 20 4f 53 2f 33 39 30 20 64  [Should OS/390 d
e930: 6f 20 74 68 65 20 72 69 67 68 74 20 74 68 69 6e  o the right thin
e940: 67 20 77 69 74 68 20 73 6f 63 6b 65 74 73 3f 5d  g with sockets?]
e950: 29 0a 09 20 20 20 20 3b 3b 0a 09 4f 53 46 31 2d  )..    ;;..OSF1-
e960: 56 2a 29 0a 09 20 20 20 20 23 20 44 69 67 69 74  V*)..    # Digit
e970: 61 6c 20 4f 53 46 2f 31 0a 09 20 20 20 20 53 48  al OSF/1..    SH
e980: 4c 49 42 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20  LIB_CFLAGS="".. 
e990: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
e9a0: 24 53 48 41 52 45 44 5f 42 55 49 4c 44 22 20 3d  $SHARED_BUILD" =
e9b0: 20 31 5d 2c 20 5b 0a 09 20 20 20 20 20 20 20 20   1], [..        
e9c0: 53 48 4c 49 42 5f 4c 44 3d 27 6c 64 20 2d 73 68  SHLIB_LD='ld -sh
e9d0: 61 72 65 64 20 2d 65 78 70 65 63 74 5f 75 6e 72  ared -expect_unr
e9e0: 65 73 6f 6c 76 65 64 20 22 2a 22 27 0a 09 20 20  esolved "*"'..  
e9f0: 20 20 5d 2c 20 5b 0a 09 20 20 20 20 20 20 20 20    ], [..        
ea00: 53 48 4c 49 42 5f 4c 44 3d 27 6c 64 20 2d 6e 6f  SHLIB_LD='ld -no
ea10: 6e 5f 73 68 61 72 65 64 20 2d 65 78 70 65 63 74  n_shared -expect
ea20: 5f 75 6e 72 65 73 6f 6c 76 65 64 20 22 2a 22 27  _unresolved "*"'
ea30: 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 53 48  ..    ])..    SH
ea40: 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22  LIB_SUFFIX=".so"
ea50: 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
ea60: 74 20 24 64 6f 52 70 61 74 68 20 3d 20 79 65 73  t $doRpath = yes
ea70: 5d 2c 20 5b 0a 09 09 43 43 5f 53 45 41 52 43 48  ], [...CC_SEARCH
ea80: 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d 72 70 61  _FLAGS='-Wl,-rpa
ea90: 74 68 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45  th,${LIB_RUNTIME
eaa0: 5f 44 49 52 7d 27 0a 09 09 4c 44 5f 53 45 41 52  _DIR}'...LD_SEAR
eab0: 43 48 5f 46 4c 41 47 53 3d 27 2d 72 70 61 74 68  CH_FLAGS='-rpath
eac0: 20 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44   ${LIB_RUNTIME_D
ead0: 49 52 7d 27 5d 29 0a 09 20 20 20 20 41 53 5f 49  IR}'])..    AS_I
eae0: 46 28 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d  F([test "$GCC" =
eaf0: 20 79 65 73 5d 2c 20 5b 43 46 4c 41 47 53 3d 22   yes], [CFLAGS="
eb00: 24 43 46 4c 41 47 53 20 2d 6d 69 65 65 65 22 5d  $CFLAGS -mieee"]
eb10: 2c 20 5b 0a 09 09 43 46 4c 41 47 53 3d 22 24 43  , [...CFLAGS="$C
eb20: 46 4c 41 47 53 20 2d 44 48 41 56 45 5f 54 5a 53  FLAGS -DHAVE_TZS
eb30: 45 54 20 2d 73 74 64 31 20 2d 69 65 65 65 22 5d  ET -std1 -ieee"]
eb40: 29 0a 09 20 20 20 20 23 20 73 65 65 20 70 74 68  )..    # see pth
eb50: 72 65 61 64 5f 69 6e 74 72 6f 28 33 29 20 66 6f  read_intro(3) fo
eb60: 72 20 70 74 68 72 65 61 64 20 73 75 70 70 6f 72  r pthread suppor
eb70: 74 20 6f 6e 20 6f 73 66 31 2c 20 6b 2e 66 75 72  t on osf1, k.fur
eb80: 75 6b 61 77 61 0a 09 20 20 20 20 41 53 5f 49 46  ukawa..    AS_IF
eb90: 28 5b 74 65 73 74 20 22 24 7b 54 43 4c 5f 54 48  ([test "${TCL_TH
eba0: 52 45 41 44 53 7d 22 20 3d 20 31 5d 2c 20 5b 0a  READS}" = 1], [.
ebb0: 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47  ..CFLAGS="$CFLAG
ebc0: 53 20 2d 44 48 41 56 45 5f 50 54 48 52 45 41 44  S -DHAVE_PTHREAD
ebd0: 5f 41 54 54 52 5f 53 45 54 53 54 41 43 4b 53 49  _ATTR_SETSTACKSI
ebe0: 5a 45 22 0a 09 09 43 46 4c 41 47 53 3d 22 24 43  ZE"...CFLAGS="$C
ebf0: 46 4c 41 47 53 20 2d 44 54 43 4c 5f 54 48 52 45  FLAGS -DTCL_THRE
ec00: 41 44 5f 53 54 41 43 4b 5f 4d 49 4e 3d 50 54 48  AD_STACK_MIN=PTH
ec10: 52 45 41 44 5f 53 54 41 43 4b 5f 4d 49 4e 2a 36  READ_STACK_MIN*6
ec20: 34 22 0a 09 09 4c 49 42 53 3d 60 65 63 68 6f 20  4"...LIBS=`echo 
ec30: 24 4c 49 42 53 20 7c 20 73 65 64 20 73 2f 2d 6c  $LIBS | sed s/-l
ec40: 70 74 68 72 65 61 64 73 2f 2f 60 0a 09 09 41 53  pthreads//`...AS
ec50: 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43 43 22  _IF([test "$GCC"
ec60: 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20 20 20   = yes], [...   
ec70: 20 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d 6c 70   LIBS="$LIBS -lp
ec80: 74 68 72 65 61 64 20 2d 6c 6d 61 63 68 20 2d 6c  thread -lmach -l
ec90: 65 78 63 22 0a 09 09 5d 2c 20 5b 0a 09 09 20 20  exc"...], [...  
eca0: 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47    CFLAGS="$CFLAG
ecb0: 53 20 2d 70 74 68 72 65 61 64 22 0a 09 09 20 20  S -pthread"...  
ecc0: 20 20 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c    LDFLAGS="$LDFL
ecd0: 41 47 53 20 2d 70 74 68 72 65 61 64 22 0a 09 09  AGS -pthread"...
ece0: 5d 29 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20  ])..    ])..    
ecf0: 3b 3b 0a 09 51 4e 58 2d 36 2a 29 0a 09 20 20 20  ;;..QNX-6*)..   
ed00: 20 23 20 51 4e 58 20 52 54 50 0a 09 20 20 20 20   # QNX RTP..    
ed10: 23 20 54 68 69 73 20 6d 61 79 20 77 6f 72 6b 20  # This may work 
ed20: 66 6f 72 20 61 6c 6c 20 51 4e 58 2c 20 62 75 74  for all QNX, but
ed30: 20 69 74 20 77 61 73 20 6f 6e 6c 79 20 72 65 70   it was only rep
ed40: 6f 72 74 65 64 20 66 6f 72 20 76 36 2e 0a 09 20  orted for v6... 
ed50: 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d     SHLIB_CFLAGS=
ed60: 22 2d 66 50 49 43 22 0a 09 20 20 20 20 53 48 4c  "-fPIC"..    SHL
ed70: 49 42 5f 4c 44 3d 22 6c 64 20 2d 42 73 68 61 72  IB_LD="ld -Bshar
ed80: 65 61 62 6c 65 20 2d 78 22 0a 09 20 20 20 20 53  eable -x"..    S
ed90: 48 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a  HLIB_LD_LIBS="".
eda0: 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49  .    SHLIB_SUFFI
edb0: 58 3d 22 2e 73 6f 22 0a 09 20 20 20 20 43 43 5f  X=".so"..    CC_
edc0: 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a  SEARCH_FLAGS="".
edd0: 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48 5f 46  .    LD_SEARCH_F
ede0: 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 3b 3b 0a  LAGS=""..    ;;.
edf0: 09 53 43 4f 5f 53 56 2d 33 2e 32 2a 29 0a 09 20  .SCO_SV-3.2*).. 
ee00: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
ee10: 24 47 43 43 22 20 3d 20 79 65 73 5d 2c 20 5b 0a  $GCC" = yes], [.
ee20: 09 09 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22  ..SHLIB_CFLAGS="
ee30: 2d 66 50 49 43 20 2d 6d 65 6c 66 22 0a 09 09 4c  -fPIC -melf"...L
ee40: 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53  DFLAGS="$LDFLAGS
ee50: 20 2d 6d 65 6c 66 20 2d 57 6c 2c 2d 42 65 78 70   -melf -Wl,-Bexp
ee60: 6f 72 74 22 0a 09 20 20 20 20 5d 2c 20 5b 0a 09  ort"..    ], [..
ee70: 09 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d  .SHLIB_CFLAGS="-
ee80: 4b 70 69 63 20 2d 62 65 6c 66 22 0a 09 09 4c 44  Kpic -belf"...LD
ee90: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20  FLAGS="$LDFLAGS 
eea0: 2d 62 65 6c 66 20 2d 57 6c 2c 2d 42 65 78 70 6f  -belf -Wl,-Bexpo
eeb0: 72 74 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20  rt"..    ])..   
eec0: 20 53 48 4c 49 42 5f 4c 44 3d 22 6c 64 20 2d 47   SHLIB_LD="ld -G
eed0: 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 5f  "..    SHLIB_LD_
eee0: 4c 49 42 53 3d 22 22 0a 09 20 20 20 20 53 48 4c  LIBS=""..    SHL
eef0: 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a  IB_SUFFIX=".so".
ef00: 09 20 20 20 20 43 43 5f 53 45 41 52 43 48 5f 46  .    CC_SEARCH_F
ef10: 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f  LAGS=""..    LD_
ef20: 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a  SEARCH_FLAGS="".
ef30: 09 20 20 20 20 3b 3b 0a 09 53 75 6e 4f 53 2d 35  .    ;;..SunOS-5
ef40: 2e 5b 5b 30 2d 36 5d 5d 29 0a 09 20 20 20 20 23  .[[0-6]])..    #
ef50: 20 43 61 72 65 66 75 6c 20 74 6f 20 6e 6f 74 20   Careful to not 
ef60: 6c 65 74 20 35 2e 31 30 2b 20 66 61 6c 6c 20 69  let 5.10+ fall i
ef70: 6e 74 6f 20 74 68 69 73 20 63 61 73 65 0a 0a 09  nto this case...
ef80: 20 20 20 20 23 20 4e 6f 74 65 3a 20 49 66 20 5f      # Note: If _
ef90: 52 45 45 4e 54 52 41 4e 54 20 69 73 6e 27 74 20  REENTRANT isn't 
efa0: 64 65 66 69 6e 65 64 2c 20 74 68 65 6e 20 53 6f  defined, then So
efb0: 6c 61 72 69 73 0a 09 20 20 20 20 23 20 77 6f 6e  laris..    # won
efc0: 27 74 20 64 65 66 69 6e 65 20 74 68 72 65 61 64  't define thread
efd0: 2d 73 61 66 65 20 6c 69 62 72 61 72 79 20 72 6f  -safe library ro
efe0: 75 74 69 6e 65 73 2e 0a 0a 09 20 20 20 20 41 43  utines....    AC
eff0: 5f 44 45 46 49 4e 45 28 5f 52 45 45 4e 54 52 41  _DEFINE(_REENTRA
f000: 4e 54 2c 20 31 2c 20 5b 44 6f 20 77 65 20 77 61  NT, 1, [Do we wa
f010: 6e 74 20 74 68 65 20 72 65 65 6e 74 72 61 6e 74  nt the reentrant
f020: 20 4f 53 20 41 50 49 3f 5d 29 0a 09 20 20 20 20   OS API?])..    
f030: 41 43 5f 44 45 46 49 4e 45 28 5f 50 4f 53 49 58  AC_DEFINE(_POSIX
f040: 5f 50 54 48 52 45 41 44 5f 53 45 4d 41 4e 54 49  _PTHREAD_SEMANTI
f050: 43 53 2c 20 31 2c 0a 09 09 5b 44 6f 20 77 65 20  CS, 1,...[Do we 
f060: 72 65 61 6c 6c 79 20 77 61 6e 74 20 74 6f 20 66  really want to f
f070: 6f 6c 6c 6f 77 20 74 68 65 20 73 74 61 6e 64 61  ollow the standa
f080: 72 64 3f 20 59 65 73 20 77 65 20 64 6f 21 5d 29  rd? Yes we do!])
f090: 0a 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46 4c  ...    SHLIB_CFL
f0a0: 41 47 53 3d 22 2d 4b 50 49 43 22 0a 09 20 20 20  AGS="-KPIC"..   
f0b0: 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e   SHLIB_SUFFIX=".
f0c0: 73 6f 22 0a 09 20 20 20 20 41 53 5f 49 46 28 5b  so"..    AS_IF([
f0d0: 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 79 65  test "$GCC" = ye
f0e0: 73 5d 2c 20 5b 0a 09 09 53 48 4c 49 42 5f 4c 44  s], [...SHLIB_LD
f0f0: 3d 27 24 7b 43 43 7d 20 2d 73 68 61 72 65 64 27  ='${CC} -shared'
f100: 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  ...CC_SEARCH_FLA
f110: 47 53 3d 27 2d 57 6c 2c 2d 52 2c 24 7b 4c 49 42  GS='-Wl,-R,${LIB
f120: 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09  _RUNTIME_DIR}'..
f130: 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53  .LD_SEARCH_FLAGS
f140: 3d 24 7b 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  =${CC_SEARCH_FLA
f150: 47 53 7d 0a 09 20 20 20 20 5d 2c 20 5b 0a 09 09  GS}..    ], [...
f160: 53 48 4c 49 42 5f 4c 44 3d 22 2f 75 73 72 2f 63  SHLIB_LD="/usr/c
f170: 63 73 2f 62 69 6e 2f 6c 64 20 2d 47 20 2d 7a 20  cs/bin/ld -G -z 
f180: 74 65 78 74 22 0a 09 09 43 43 5f 53 45 41 52 43  text"...CC_SEARC
f190: 48 5f 46 4c 41 47 53 3d 27 2d 52 20 24 7b 4c 49  H_FLAGS='-R ${LI
f1a0: 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a  B_RUNTIME_DIR}'.
f1b0: 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..LD_SEARCH_FLAG
f1c0: 53 3d 24 7b 43 43 5f 53 45 41 52 43 48 5f 46 4c  S=${CC_SEARCH_FL
f1d0: 41 47 53 7d 0a 09 20 20 20 20 5d 29 0a 09 20 20  AGS}..    ])..  
f1e0: 20 20 3b 3b 0a 09 53 75 6e 4f 53 2d 35 2a 29 0a    ;;..SunOS-5*).
f1f0: 09 20 20 20 20 23 20 4e 6f 74 65 3a 20 49 66 20  .    # Note: If 
f200: 5f 52 45 45 4e 54 52 41 4e 54 20 69 73 6e 27 74  _REENTRANT isn't
f210: 20 64 65 66 69 6e 65 64 2c 20 74 68 65 6e 20 53   defined, then S
f220: 6f 6c 61 72 69 73 0a 09 20 20 20 20 23 20 77 6f  olaris..    # wo
f230: 6e 27 74 20 64 65 66 69 6e 65 20 74 68 72 65 61  n't define threa
f240: 64 2d 73 61 66 65 20 6c 69 62 72 61 72 79 20 72  d-safe library r
f250: 6f 75 74 69 6e 65 73 2e 0a 0a 09 20 20 20 20 41  outines....    A
f260: 43 5f 44 45 46 49 4e 45 28 5f 52 45 45 4e 54 52  C_DEFINE(_REENTR
f270: 41 4e 54 2c 20 31 2c 20 5b 44 6f 20 77 65 20 77  ANT, 1, [Do we w
f280: 61 6e 74 20 74 68 65 20 72 65 65 6e 74 72 61 6e  ant the reentran
f290: 74 20 4f 53 20 41 50 49 3f 5d 29 0a 09 20 20 20  t OS API?])..   
f2a0: 20 41 43 5f 44 45 46 49 4e 45 28 5f 50 4f 53 49   AC_DEFINE(_POSI
f2b0: 58 5f 50 54 48 52 45 41 44 5f 53 45 4d 41 4e 54  X_PTHREAD_SEMANT
f2c0: 49 43 53 2c 20 31 2c 0a 09 09 5b 44 6f 20 77 65  ICS, 1,...[Do we
f2d0: 20 72 65 61 6c 6c 79 20 77 61 6e 74 20 74 6f 20   really want to 
f2e0: 66 6f 6c 6c 6f 77 20 74 68 65 20 73 74 61 6e 64  follow the stand
f2f0: 61 72 64 3f 20 59 65 73 20 77 65 20 64 6f 21 5d  ard? Yes we do!]
f300: 29 0a 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  )...    SHLIB_CF
f310: 4c 41 47 53 3d 22 2d 4b 50 49 43 22 0a 0a 09 20  LAGS="-KPIC"... 
f320: 20 20 20 23 20 43 68 65 63 6b 20 74 6f 20 65 6e     # Check to en
f330: 61 62 6c 65 20 36 34 2d 62 69 74 20 66 6c 61 67  able 64-bit flag
f340: 73 20 66 6f 72 20 63 6f 6d 70 69 6c 65 72 2f 6c  s for compiler/l
f350: 69 6e 6b 65 72 0a 09 20 20 20 20 41 53 5f 49 46  inker..    AS_IF
f360: 28 5b 74 65 73 74 20 22 24 64 6f 36 34 62 69 74  ([test "$do64bit
f370: 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 61 72  " = yes], [...ar
f380: 63 68 3d 60 69 73 61 69 6e 66 6f 60 0a 09 09 41  ch=`isainfo`...A
f390: 53 5f 49 46 28 5b 74 65 73 74 20 22 24 61 72 63  S_IF([test "$arc
f3a0: 68 22 20 3d 20 22 73 70 61 72 63 76 39 20 73 70  h" = "sparcv9 sp
f3b0: 61 72 63 22 5d 2c 20 5b 0a 09 09 20 20 20 20 41  arc"], [...    A
f3c0: 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43 43  S_IF([test "$GCC
f3d0: 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 09 41  " = yes], [....A
f3e0: 53 5f 49 46 28 5b 74 65 73 74 20 22 60 24 7b 43  S_IF([test "`${C
f3f0: 43 7d 20 2d 64 75 6d 70 76 65 72 73 69 6f 6e 20  C} -dumpversion 
f400: 7c 20 61 77 6b 20 2d 46 2e 20 27 7b 70 72 69 6e  | awk -F. '{prin
f410: 74 20 5b 24 5d 31 7d 27 60 22 20 2d 6c 74 20 33  t [$]1}'`" -lt 3
f420: 5d 2c 20 5b 0a 09 09 09 20 20 20 20 41 43 5f 4d  ], [....    AC_M
f430: 53 47 5f 57 41 52 4e 28 5b 36 34 62 69 74 20 6d  SG_WARN([64bit m
f440: 6f 64 65 20 6e 6f 74 20 73 75 70 70 6f 72 74 65  ode not supporte
f450: 64 20 77 69 74 68 20 47 43 43 20 3c 20 33 2e 32  d with GCC < 3.2
f460: 20 6f 6e 20 24 73 79 73 74 65 6d 5d 29 0a 09 09   on $system])...
f470: 09 5d 2c 20 5b 0a 09 09 09 20 20 20 20 64 6f 36  .], [....    do6
f480: 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09 09 20  4bit_ok=yes.... 
f490: 20 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41     CFLAGS="$CFLA
f4a0: 47 53 20 2d 6d 36 34 20 2d 6d 63 70 75 3d 76 39  GS -m64 -mcpu=v9
f4b0: 22 0a 09 09 09 20 20 20 20 4c 44 46 4c 41 47 53  "....    LDFLAGS
f4c0: 3d 22 24 4c 44 46 4c 41 47 53 20 2d 6d 36 34 20  ="$LDFLAGS -m64 
f4d0: 2d 6d 63 70 75 3d 76 39 22 0a 09 09 09 20 20 20  -mcpu=v9"....   
f4e0: 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d   SHLIB_CFLAGS="-
f4f0: 66 50 49 43 22 0a 09 09 09 5d 29 0a 09 09 20 20  fPIC"....])...  
f500: 20 20 5d 2c 20 5b 0a 09 09 09 64 6f 36 34 62 69    ], [....do64bi
f510: 74 5f 6f 6b 3d 79 65 73 0a 09 09 09 41 53 5f 49  t_ok=yes....AS_I
f520: 46 28 5b 74 65 73 74 20 22 24 64 6f 36 34 62 69  F([test "$do64bi
f530: 74 56 49 53 22 20 3d 20 79 65 73 5d 2c 20 5b 0a  tVIS" = yes], [.
f540: 09 09 09 20 20 20 20 43 46 4c 41 47 53 3d 22 24  ...    CFLAGS="$
f550: 43 46 4c 41 47 53 20 2d 78 61 72 63 68 3d 76 39  CFLAGS -xarch=v9
f560: 61 22 0a 09 09 09 20 20 20 20 4c 44 46 4c 41 47  a"....    LDFLAG
f570: 53 5f 41 52 43 48 3d 22 2d 78 61 72 63 68 3d 76  S_ARCH="-xarch=v
f580: 39 61 22 0a 09 09 09 5d 2c 20 5b 0a 09 09 09 20  9a"....], [.... 
f590: 20 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41     CFLAGS="$CFLA
f5a0: 47 53 20 2d 78 61 72 63 68 3d 76 39 22 0a 09 09  GS -xarch=v9"...
f5b0: 09 20 20 20 20 4c 44 46 4c 41 47 53 5f 41 52 43  .    LDFLAGS_ARC
f5c0: 48 3d 22 2d 78 61 72 63 68 3d 76 39 22 0a 09 09  H="-xarch=v9"...
f5d0: 09 5d 29 0a 09 09 09 23 20 53 6f 6c 61 72 69 73  .])....# Solaris
f5e0: 20 36 34 20 75 73 65 73 20 74 68 69 73 20 61 73   64 uses this as
f5f0: 20 77 65 6c 6c 0a 09 09 09 23 4c 44 5f 4c 49 42   well....#LD_LIB
f600: 52 41 52 59 5f 50 41 54 48 5f 56 41 52 3d 22 4c  RARY_PATH_VAR="L
f610: 44 5f 4c 49 42 52 41 52 59 5f 50 41 54 48 5f 36  D_LIBRARY_PATH_6
f620: 34 22 0a 09 09 20 20 20 20 5d 29 0a 09 09 5d 2c  4"...    ])...],
f630: 20 5b 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24   [AS_IF([test "$
f640: 61 72 63 68 22 20 3d 20 22 61 6d 64 36 34 20 69  arch" = "amd64 i
f650: 33 38 36 22 5d 2c 20 5b 0a 09 09 20 20 20 20 41  386"], [...    A
f660: 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43 43  S_IF([test "$GCC
f670: 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 09 63  " = yes], [....c
f680: 61 73 65 20 24 73 79 73 74 65 6d 20 69 6e 0a 09  ase $system in..
f690: 09 09 20 20 20 20 53 75 6e 4f 53 2d 35 2e 31 5b  ..    SunOS-5.1[
f6a0: 5b 31 2d 39 5d 5d 2a 7c 53 75 6e 4f 53 2d 35 2e  [1-9]]*|SunOS-5.
f6b0: 5b 5b 32 2d 39 5d 5d 5b 5b 30 2d 39 5d 5d 2a 29  [[2-9]][[0-9]]*)
f6c0: 0a 09 09 09 09 64 6f 36 34 62 69 74 5f 6f 6b 3d  .....do64bit_ok=
f6d0: 79 65 73 0a 09 09 09 09 43 46 4c 41 47 53 3d 22  yes.....CFLAGS="
f6e0: 24 43 46 4c 41 47 53 20 2d 6d 36 34 22 0a 09 09  $CFLAGS -m64"...
f6f0: 09 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c  ..LDFLAGS="$LDFL
f700: 41 47 53 20 2d 6d 36 34 22 3b 3b 0a 09 09 09 20  AGS -m64";;.... 
f710: 20 20 20 2a 29 0a 09 09 09 09 41 43 5f 4d 53 47     *).....AC_MSG
f720: 5f 57 41 52 4e 28 5b 36 34 62 69 74 20 6d 6f 64  _WARN([64bit mod
f730: 65 20 6e 6f 74 20 73 75 70 70 6f 72 74 65 64 20  e not supported 
f740: 77 69 74 68 20 47 43 43 20 6f 6e 20 24 73 79 73  with GCC on $sys
f750: 74 65 6d 5d 29 3b 3b 0a 09 09 09 65 73 61 63 0a  tem]);;....esac.
f760: 09 09 20 20 20 20 5d 2c 20 5b 0a 09 09 09 64 6f  ..    ], [....do
f770: 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09 09  64bit_ok=yes....
f780: 63 61 73 65 20 24 73 79 73 74 65 6d 20 69 6e 0a  case $system in.
f790: 09 09 09 20 20 20 20 53 75 6e 4f 53 2d 35 2e 31  ...    SunOS-5.1
f7a0: 5b 5b 31 2d 39 5d 5d 2a 7c 53 75 6e 4f 53 2d 35  [[1-9]]*|SunOS-5
f7b0: 2e 5b 5b 32 2d 39 5d 5d 5b 5b 30 2d 39 5d 5d 2a  .[[2-9]][[0-9]]*
f7c0: 29 0a 09 09 09 09 43 46 4c 41 47 53 3d 22 24 43  ).....CFLAGS="$C
f7d0: 46 4c 41 47 53 20 2d 6d 36 34 22 0a 09 09 09 09  FLAGS -m64".....
f7e0: 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47  LDFLAGS="$LDFLAG
f7f0: 53 20 2d 6d 36 34 22 3b 3b 0a 09 09 09 20 20 20  S -m64";;....   
f800: 20 2a 29 0a 09 09 09 09 43 46 4c 41 47 53 3d 22   *).....CFLAGS="
f810: 24 43 46 4c 41 47 53 20 2d 78 61 72 63 68 3d 61  $CFLAGS -xarch=a
f820: 6d 64 36 34 22 0a 09 09 09 09 4c 44 46 4c 41 47  md64".....LDFLAG
f830: 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 78 61 72  S="$LDFLAGS -xar
f840: 63 68 3d 61 6d 64 36 34 22 3b 3b 0a 09 09 09 65  ch=amd64";;....e
f850: 73 61 63 0a 09 09 20 20 20 20 5d 29 0a 09 09 5d  sac...    ])...]
f860: 2c 20 5b 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b  , [AC_MSG_WARN([
f870: 36 34 62 69 74 20 6d 6f 64 65 20 6e 6f 74 20 73  64bit mode not s
f880: 75 70 70 6f 72 74 65 64 20 66 6f 72 20 24 61 72  upported for $ar
f890: 63 68 5d 29 5d 29 5d 29 0a 09 20 20 20 20 5d 29  ch])])])..    ])
f8a0: 0a 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46  ...    SHLIB_SUF
f8b0: 46 49 58 3d 22 2e 73 6f 22 0a 09 20 20 20 20 41  FIX=".so"..    A
f8c0: 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43 43  S_IF([test "$GCC
f8d0: 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 53 48  " = yes], [...SH
f8e0: 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 73  LIB_LD='${CC} -s
f8f0: 68 61 72 65 64 27 0a 09 09 43 43 5f 53 45 41 52  hared'...CC_SEAR
f900: 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d 52  CH_FLAGS='-Wl,-R
f910: 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44  ,${LIB_RUNTIME_D
f920: 49 52 7d 27 0a 09 09 4c 44 5f 53 45 41 52 43 48  IR}'...LD_SEARCH
f930: 5f 46 4c 41 47 53 3d 24 7b 43 43 5f 53 45 41 52  _FLAGS=${CC_SEAR
f940: 43 48 5f 46 4c 41 47 53 7d 0a 09 09 41 53 5f 49  CH_FLAGS}...AS_I
f950: 46 28 5b 74 65 73 74 20 22 24 64 6f 36 34 62 69  F([test "$do64bi
f960: 74 5f 6f 6b 22 20 3d 20 79 65 73 5d 2c 20 5b 0a  t_ok" = yes], [.
f970: 09 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
f980: 74 20 22 24 61 72 63 68 22 20 3d 20 22 73 70 61  t "$arch" = "spa
f990: 72 63 76 39 20 73 70 61 72 63 22 5d 2c 20 5b 0a  rcv9 sparc"], [.
f9a0: 09 09 09 23 20 57 65 20 6e 65 65 64 20 74 6f 20  ...# We need to 
f9b0: 73 70 65 63 69 66 79 20 2d 73 74 61 74 69 63 2d  specify -static-
f9c0: 6c 69 62 67 63 63 20 6f 72 20 77 65 20 6e 65 65  libgcc or we nee
f9d0: 64 20 74 6f 0a 09 09 09 23 20 61 64 64 20 74 68  d to....# add th
f9e0: 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 73 70  e path to the sp
f9f0: 61 72 76 39 20 6c 69 62 67 63 63 2e 0a 09 09 09  arv9 libgcc.....
fa00: 23 20 4a 48 3a 20 73 74 61 74 69 63 2d 6c 69 62  # JH: static-lib
fa10: 67 63 63 20 69 73 20 6e 65 63 65 73 73 61 72 79  gcc is necessary
fa20: 20 66 6f 72 20 63 6f 72 65 20 54 63 6c 2c 20 62   for core Tcl, b
fa30: 75 74 20 6d 61 79 0a 09 09 09 23 20 6e 6f 74 20  ut may....# not 
fa40: 62 65 20 6e 65 63 65 73 73 61 72 79 20 66 6f 72  be necessary for
fa50: 20 65 78 74 65 6e 73 69 6f 6e 73 2e 0a 09 09 09   extensions.....
fa60: 53 48 4c 49 42 5f 4c 44 3d 22 24 53 48 4c 49 42  SHLIB_LD="$SHLIB
fa70: 5f 4c 44 20 2d 6d 36 34 20 2d 6d 63 70 75 3d 76  _LD -m64 -mcpu=v
fa80: 39 20 2d 73 74 61 74 69 63 2d 6c 69 62 67 63 63  9 -static-libgcc
fa90: 22 0a 09 09 09 23 20 66 6f 72 20 66 69 6e 64 69  "....# for findi
faa0: 6e 67 20 73 70 61 72 63 76 39 20 6c 69 62 67 63  ng sparcv9 libgc
fab0: 63 2c 20 67 65 74 20 74 68 65 20 72 65 67 75 6c  c, get the regul
fac0: 61 72 20 6c 69 62 67 63 63 0a 09 09 09 23 20 70  ar libgcc....# p
fad0: 61 74 68 2c 20 72 65 6d 6f 76 65 20 73 6f 20 6e  ath, remove so n
fae0: 61 6d 65 20 61 6e 64 20 61 70 70 65 6e 64 20 27  ame and append '
faf0: 73 70 61 72 63 76 39 27 0a 09 09 09 23 76 39 67  sparcv9'....#v9g
fb00: 63 63 6c 69 62 64 69 72 3d 22 60 67 63 63 20 2d  cclibdir="`gcc -
fb10: 70 72 69 6e 74 2d 66 69 6c 65 2d 6e 61 6d 65 3d  print-file-name=
fb20: 6c 69 62 67 63 63 5f 73 2e 73 6f 60 20 7c 20 2e  libgcc_s.so` | .
fb30: 2e 2e 22 0a 09 09 09 23 43 43 5f 53 45 41 52 43  .."....#CC_SEARC
fb40: 48 5f 46 4c 41 47 53 3d 22 24 7b 43 43 5f 53 45  H_FLAGS="${CC_SE
fb50: 41 52 43 48 5f 46 4c 41 47 53 7d 2c 2d 52 2c 24  ARCH_FLAGS},-R,$
fb60: 76 39 67 63 63 6c 69 62 64 69 72 22 0a 09 09 20  v9gcclibdir"... 
fb70: 20 20 20 5d 2c 20 5b 41 53 5f 49 46 28 5b 74 65     ], [AS_IF([te
fb80: 73 74 20 22 24 61 72 63 68 22 20 3d 20 22 61 6d  st "$arch" = "am
fb90: 64 36 34 20 69 33 38 36 22 5d 2c 20 5b 0a 09 09  d64 i386"], [...
fba0: 09 23 20 4a 48 3a 20 73 74 61 74 69 63 2d 6c 69  .# JH: static-li
fbb0: 62 67 63 63 20 69 73 20 6e 65 63 65 73 73 61 72  bgcc is necessar
fbc0: 79 20 66 6f 72 20 63 6f 72 65 20 54 63 6c 2c 20  y for core Tcl, 
fbd0: 62 75 74 20 6d 61 79 0a 09 09 09 23 20 6e 6f 74  but may....# not
fbe0: 20 62 65 20 6e 65 63 65 73 73 61 72 79 20 66 6f   be necessary fo
fbf0: 72 20 65 78 74 65 6e 73 69 6f 6e 73 2e 0a 09 09  r extensions....
fc00: 09 53 48 4c 49 42 5f 4c 44 3d 22 24 53 48 4c 49  .SHLIB_LD="$SHLI
fc10: 42 5f 4c 44 20 2d 6d 36 34 20 2d 73 74 61 74 69  B_LD -m64 -stati
fc20: 63 2d 6c 69 62 67 63 63 22 0a 09 09 20 20 20 20  c-libgcc"...    
fc30: 5d 29 5d 29 0a 09 09 5d 29 0a 09 20 20 20 20 5d  ])])...])..    ]
fc40: 2c 20 5b 0a 09 09 63 61 73 65 20 24 73 79 73 74  , [...case $syst
fc50: 65 6d 20 69 6e 0a 09 09 20 20 20 20 53 75 6e 4f  em in...    SunO
fc60: 53 2d 35 2e 5b 5b 31 2d 39 5d 5d 5b 5b 30 2d 39  S-5.[[1-9]][[0-9
fc70: 5d 5d 2a 29 0a 09 09 09 23 20 54 45 41 20 73 70  ]]*)....# TEA sp
fc80: 65 63 69 66 69 63 3a 20 75 73 65 20 4c 44 46 4c  ecific: use LDFL
fc90: 41 47 53 5f 44 45 46 41 55 4c 54 20 69 6e 73 74  AGS_DEFAULT inst
fca0: 65 61 64 20 6f 66 20 4c 44 46 4c 41 47 53 0a 09  ead of LDFLAGS..
fcb0: 09 09 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43  ..SHLIB_LD='${CC
fcc0: 7d 20 2d 47 20 2d 7a 20 74 65 78 74 20 24 7b 4c  } -G -z text ${L
fcd0: 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54 7d 27  DFLAGS_DEFAULT}'
fce0: 3b 3b 0a 09 09 20 20 20 20 2a 29 0a 09 09 09 53  ;;...    *)....S
fcf0: 48 4c 49 42 5f 4c 44 3d 27 2f 75 73 72 2f 63 63  HLIB_LD='/usr/cc
fd00: 73 2f 62 69 6e 2f 6c 64 20 2d 47 20 2d 7a 20 74  s/bin/ld -G -z t
fd10: 65 78 74 27 3b 3b 0a 09 09 65 73 61 63 0a 09 09  ext';;...esac...
fd20: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d  CC_SEARCH_FLAGS=
fd30: 27 2d 57 6c 2c 2d 52 2c 24 7b 4c 49 42 5f 52 55  '-Wl,-R,${LIB_RU
fd40: 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09 09 4c 44  NTIME_DIR}'...LD
fd50: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d  _SEARCH_FLAGS='-
fd60: 52 20 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f  R ${LIB_RUNTIME_
fd70: 44 49 52 7d 27 0a 09 20 20 20 20 5d 29 0a 09 20  DIR}'..    ]).. 
fd80: 20 20 20 3b 3b 0a 09 55 4e 49 58 5f 53 56 2a 20     ;;..UNIX_SV* 
fd90: 7c 20 55 6e 69 78 57 61 72 65 2d 35 2a 29 0a 09  | UnixWare-5*)..
fda0: 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53      SHLIB_CFLAGS
fdb0: 3d 22 2d 4b 50 49 43 22 0a 09 20 20 20 20 53 48  ="-KPIC"..    SH
fdc0: 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 47  LIB_LD='${CC} -G
fdd0: 27 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 5f  '..    SHLIB_LD_
fde0: 4c 49 42 53 3d 22 22 0a 09 20 20 20 20 53 48 4c  LIBS=""..    SHL
fdf0: 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a  IB_SUFFIX=".so".
fe00: 09 20 20 20 20 23 20 53 6f 6d 65 20 55 4e 49 58  .    # Some UNIX
fe10: 5f 53 56 2a 20 73 79 73 74 65 6d 73 20 28 75 6e  _SV* systems (un
fe20: 69 78 77 61 72 65 20 31 2e 31 2e 32 20 66 6f 72  ixware 1.1.2 for
fe30: 20 65 78 61 6d 70 6c 65 29 20 68 61 76 65 20 6c   example) have l
fe40: 69 6e 6b 65 72 73 0a 09 20 20 20 20 23 20 74 68  inkers..    # th
fe50: 61 74 20 64 6f 6e 27 74 20 67 72 6f 6b 20 74 68  at don't grok th
fe60: 65 20 2d 42 65 78 70 6f 72 74 20 6f 70 74 69 6f  e -Bexport optio
fe70: 6e 2e 20 20 54 65 73 74 20 74 68 61 74 20 69 74  n.  Test that it
fe80: 20 64 6f 65 73 2e 0a 09 20 20 20 20 41 43 5f 43   does...    AC_C
fe90: 41 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20  ACHE_CHECK([for 
fea0: 6c 64 20 61 63 63 65 70 74 73 20 2d 42 65 78 70  ld accepts -Bexp
feb0: 6f 72 74 20 66 6c 61 67 5d 2c 20 74 63 6c 5f 63  ort flag], tcl_c
fec0: 76 5f 6c 64 5f 42 65 78 70 6f 72 74 2c 20 5b 0a  v_ld_Bexport, [.
fed0: 09 09 68 6f 6c 64 5f 6c 64 66 6c 61 67 73 3d 24  ..hold_ldflags=$
fee0: 4c 44 46 4c 41 47 53 0a 09 09 4c 44 46 4c 41 47  LDFLAGS...LDFLAG
fef0: 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 57 6c 2c  S="$LDFLAGS -Wl,
ff00: 2d 42 65 78 70 6f 72 74 22 0a 09 09 41 43 5f 54  -Bexport"...AC_T
ff10: 52 59 5f 4c 49 4e 4b 28 2c 20 5b 69 6e 74 20 69  RY_LINK(, [int i
ff20: 3b 5d 2c 20 74 63 6c 5f 63 76 5f 6c 64 5f 42 65  ;], tcl_cv_ld_Be
ff30: 78 70 6f 72 74 3d 79 65 73 2c 20 74 63 6c 5f 63  xport=yes, tcl_c
ff40: 76 5f 6c 64 5f 42 65 78 70 6f 72 74 3d 6e 6f 29  v_ld_Bexport=no)
ff50: 0a 09 20 20 20 20 20 20 20 20 4c 44 46 4c 41 47  ..        LDFLAG
ff60: 53 3d 24 68 6f 6c 64 5f 6c 64 66 6c 61 67 73 5d  S=$hold_ldflags]
ff70: 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  )..    AS_IF([te
ff80: 73 74 20 24 74 63 6c 5f 63 76 5f 6c 64 5f 42 65  st $tcl_cv_ld_Be
ff90: 78 70 6f 72 74 20 3d 20 79 65 73 5d 2c 20 5b 0a  xport = yes], [.
ffa0: 09 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c  ..LDFLAGS="$LDFL
ffb0: 41 47 53 20 2d 57 6c 2c 2d 42 65 78 70 6f 72 74  AGS -Wl,-Bexport
ffc0: 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 43  "..    ])..    C
ffd0: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22  C_SEARCH_FLAGS="
ffe0: 22 0a 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48  "..    LD_SEARCH
fff0: 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 3b  _FLAGS=""..    ;
10000 3b 0a 20 20 20 20 65 73 61 63 0a 0a 20 20 20 20  ;.    esac..    
10010 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 64 6f  AS_IF([test "$do
10020 36 34 62 69 74 22 20 3d 20 79 65 73 20 2d 61 20  64bit" = yes -a 
10030 22 24 64 6f 36 34 62 69 74 5f 6f 6b 22 20 3d 20  "$do64bit_ok" = 
10040 6e 6f 5d 2c 20 5b 0a 09 41 43 5f 4d 53 47 5f 57  no], [..AC_MSG_W
10050 41 52 4e 28 5b 36 34 62 69 74 20 73 75 70 70 6f  ARN([64bit suppo
10060 72 74 20 62 65 69 6e 67 20 64 69 73 61 62 6c 65  rt being disable
10070 64 20 2d 2d 20 64 6f 6e 27 74 20 6b 6e 6f 77 20  d -- don't know 
10080 6d 61 67 69 63 20 66 6f 72 20 74 68 69 73 20 70  magic for this p
10090 6c 61 74 66 6f 72 6d 5d 29 0a 20 20 20 20 5d 29  latform]).    ])
100a0 0a 0a 64 6e 6c 20 23 20 41 64 64 20 61 6e 79 20  ..dnl # Add any 
100b0 43 50 50 46 4c 41 47 53 20 73 65 74 20 69 6e 20  CPPFLAGS set in 
100c0 74 68 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20  the environment 
100d0 74 6f 20 6f 75 72 20 43 46 4c 41 47 53 2c 20 62  to our CFLAGS, b
100e0 75 74 20 64 65 6c 61 79 20 64 6f 69 6e 67 20 73  ut delay doing s
100f0 6f 0a 64 6e 6c 20 23 20 75 6e 74 69 6c 20 74 68  o.dnl # until th
10100 65 20 65 6e 64 20 6f 66 20 63 6f 6e 66 69 67 75  e end of configu
10110 72 65 2c 20 61 73 20 63 6f 6e 66 69 67 75 72 65  re, as configure
10120 27 73 20 63 6f 6d 70 69 6c 65 20 61 6e 64 20 6c  's compile and l
10130 69 6e 6b 20 74 65 73 74 73 20 75 73 65 0a 64 6e  ink tests use.dn
10140 6c 20 23 20 62 6f 74 68 20 43 50 50 46 4c 41 47  l # both CPPFLAG
10150 53 20 61 6e 64 20 43 46 4c 41 47 53 20 28 75 6e  S and CFLAGS (un
10160 6c 69 6b 65 20 6f 75 72 20 63 6f 6d 70 69 6c 65  like our compile
10170 20 61 6e 64 20 6c 69 6e 6b 29 20 62 75 74 20 63   and link) but c
10180 6f 6e 66 69 67 75 72 65 27 73 0a 64 6e 6c 20 23  onfigure's.dnl #
10190 20 70 72 65 70 72 6f 63 65 73 73 69 6e 67 20 74   preprocessing t
101a0 65 73 74 73 20 75 73 65 20 6f 6e 6c 79 20 43 50  ests use only CP
101b0 50 46 4c 41 47 53 2e 0a 20 20 20 20 41 43 5f 43  PFLAGS..    AC_C
101c0 4f 4e 46 49 47 5f 43 4f 4d 4d 41 4e 44 53 5f 50  ONFIG_COMMANDS_P
101d0 52 45 28 5b 43 46 4c 41 47 53 3d 22 24 7b 43 46  RE([CFLAGS="${CF
101e0 4c 41 47 53 7d 20 24 7b 43 50 50 46 4c 41 47 53  LAGS} ${CPPFLAGS
101f0 7d 22 3b 20 43 50 50 46 4c 41 47 53 3d 22 22 5d  }"; CPPFLAGS=""]
10200 29 0a 0a 20 20 20 20 23 20 41 64 64 20 69 6e 20  )..    # Add in 
10210 74 68 65 20 61 72 63 68 20 66 6c 61 67 73 20 6c  the arch flags l
10220 61 74 65 20 74 6f 20 65 6e 73 75 72 65 20 69 74  ate to ensure it
10230 20 77 61 73 6e 27 74 20 72 65 6d 6f 76 65 64 2e   wasn't removed.
10240 0a 20 20 20 20 23 20 4e 6f 74 20 6e 65 63 65 73  .    # Not neces
10250 73 61 72 79 20 69 6e 20 54 45 41 2c 20 62 75 74  sary in TEA, but
10260 20 74 68 69 73 20 69 73 20 61 6c 69 67 6e 65 64   this is aligned
10270 20 77 69 74 68 20 63 6f 72 65 0a 20 20 20 20 4c   with core.    L
10280 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53  DFLAGS="$LDFLAGS
10290 20 24 4c 44 46 4c 41 47 53 5f 41 52 43 48 22 0a   $LDFLAGS_ARCH".
102a0 0a 20 20 20 20 23 20 49 66 20 77 65 27 72 65 20  .    # If we're 
102b0 72 75 6e 6e 69 6e 67 20 67 63 63 2c 20 74 68 65  running gcc, the
102c0 6e 20 63 68 61 6e 67 65 20 74 68 65 20 43 20 66  n change the C f
102d0 6c 61 67 73 20 66 6f 72 20 63 6f 6d 70 69 6c 69  lags for compili
102e0 6e 67 20 73 68 61 72 65 64 0a 20 20 20 20 23 20  ng shared.    # 
102f0 6c 69 62 72 61 72 69 65 73 20 74 6f 20 74 68 65  libraries to the
10300 20 72 69 67 68 74 20 66 6c 61 67 73 20 66 6f 72   right flags for
10310 20 67 63 63 2c 20 69 6e 73 74 65 61 64 20 6f 66   gcc, instead of
10320 20 74 68 6f 73 65 20 66 6f 72 20 74 68 65 0a 20   those for the. 
10330 20 20 20 23 20 73 74 61 6e 64 61 72 64 20 6d 61     # standard ma
10340 6e 75 66 61 63 74 75 72 65 72 20 63 6f 6d 70 69  nufacturer compi
10350 6c 65 72 2e 0a 0a 20 20 20 20 41 53 5f 49 46 28  ler...    AS_IF(
10360 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 79  [test "$GCC" = y
10370 65 73 5d 2c 20 5b 0a 09 63 61 73 65 20 24 73 79  es], [..case $sy
10380 73 74 65 6d 20 69 6e 0a 09 20 20 20 20 41 49 58  stem in..    AIX
10390 2d 2a 29 20 3b 3b 0a 09 20 20 20 20 42 53 44 2f  -*) ;;..    BSD/
103a0 4f 53 2a 29 20 3b 3b 0a 09 20 20 20 20 43 59 47  OS*) ;;..    CYG
103b0 57 49 4e 5f 2a 7c 4d 49 4e 47 57 33 32 5f 2a 29  WIN_*|MINGW32_*)
103c0 20 3b 3b 0a 09 20 20 20 20 49 52 49 58 2a 29 20   ;;..    IRIX*) 
103d0 3b 3b 0a 09 20 20 20 20 4e 65 74 42 53 44 2d 2a  ;;..    NetBSD-*
103e0 7c 46 72 65 65 42 53 44 2d 2a 7c 4f 70 65 6e 42  |FreeBSD-*|OpenB
103f0 53 44 2d 2a 29 20 3b 3b 0a 09 20 20 20 20 44 61  SD-*) ;;..    Da
10400 72 77 69 6e 2d 2a 29 20 3b 3b 0a 09 20 20 20 20  rwin-*) ;;..    
10410 53 43 4f 5f 53 56 2d 33 2e 32 2a 29 20 3b 3b 0a  SCO_SV-3.2*) ;;.
10420 09 20 20 20 20 77 69 6e 64 6f 77 73 29 20 3b 3b  .    windows) ;;
10430 0a 09 20 20 20 20 2a 29 20 53 48 4c 49 42 5f 43  ..    *) SHLIB_C
10440 46 4c 41 47 53 3d 22 2d 66 50 49 43 22 20 3b 3b  FLAGS="-fPIC" ;;
10450 0a 09 65 73 61 63 5d 29 0a 0a 20 20 20 20 41 53  ..esac])..    AS
10460 5f 49 46 28 5b 74 65 73 74 20 22 24 74 63 6c 5f  _IF([test "$tcl_
10470 63 76 5f 63 63 5f 76 69 73 69 62 69 6c 69 74 79  cv_cc_visibility
10480 5f 68 69 64 64 65 6e 22 20 21 3d 20 79 65 73 5d  _hidden" != yes]
10490 2c 20 5b 0a 09 41 43 5f 44 45 46 49 4e 45 28 4d  , [..AC_DEFINE(M
104a0 4f 44 55 4c 45 5f 53 43 4f 50 45 2c 20 5b 65 78  ODULE_SCOPE, [ex
104b0 74 65 72 6e 5d 2c 0a 09 20 20 20 20 5b 4e 6f 20  tern],..    [No 
104c0 43 6f 6d 70 69 6c 65 72 20 73 75 70 70 6f 72 74  Compiler support
104d0 20 66 6f 72 20 6d 6f 64 75 6c 65 20 73 63 6f 70   for module scop
104e0 65 20 73 79 6d 62 6f 6c 73 5d 29 0a 20 20 20 20  e symbols]).    
104f0 5d 29 0a 0a 20 20 20 20 41 53 5f 49 46 28 5b 74  ])..    AS_IF([t
10500 65 73 74 20 22 24 53 48 41 52 45 44 5f 4c 49 42  est "$SHARED_LIB
10510 5f 53 55 46 46 49 58 22 20 3d 20 22 22 5d 2c 20  _SUFFIX" = ""], 
10520 5b 0a 20 20 20 20 23 20 54 45 41 20 73 70 65 63  [.    # TEA spec
10530 69 66 69 63 3a 20 75 73 65 20 50 41 43 4b 41 47  ific: use PACKAG
10540 45 5f 56 45 52 53 49 4f 4e 20 69 6e 73 74 65 61  E_VERSION instea
10550 64 20 6f 66 20 56 45 52 53 49 4f 4e 0a 20 20 20  d of VERSION.   
10560 20 53 48 41 52 45 44 5f 4c 49 42 5f 53 55 46 46   SHARED_LIB_SUFF
10570 49 58 3d 27 24 7b 50 41 43 4b 41 47 45 5f 56 45  IX='${PACKAGE_VE
10580 52 53 49 4f 4e 7d 24 7b 53 48 4c 49 42 5f 53 55  RSION}${SHLIB_SU
10590 46 46 49 58 7d 27 5d 29 0a 20 20 20 20 41 53 5f  FFIX}']).    AS_
105a0 49 46 28 5b 74 65 73 74 20 22 24 55 4e 53 48 41  IF([test "$UNSHA
105b0 52 45 44 5f 4c 49 42 5f 53 55 46 46 49 58 22 20  RED_LIB_SUFFIX" 
105c0 3d 20 22 22 5d 2c 20 5b 0a 20 20 20 20 23 20 54  = ""], [.    # T
105d0 45 41 20 73 70 65 63 69 66 69 63 3a 20 75 73 65  EA specific: use
105e0 20 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e   PACKAGE_VERSION
105f0 20 69 6e 73 74 65 61 64 20 6f 66 20 56 45 52 53   instead of VERS
10600 49 4f 4e 0a 20 20 20 20 55 4e 53 48 41 52 45 44  ION.    UNSHARED
10610 5f 4c 49 42 5f 53 55 46 46 49 58 3d 27 24 7b 50  _LIB_SUFFIX='${P
10620 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e 7d 2e  ACKAGE_VERSION}.
10630 61 27 5d 29 0a 0a 20 20 20 20 69 66 20 74 65 73  a'])..    if tes
10640 74 20 22 24 7b 47 43 43 7d 22 20 3d 20 22 79 65  t "${GCC}" = "ye
10650 73 22 20 2d 61 20 24 7b 53 48 4c 49 42 5f 53 55  s" -a ${SHLIB_SU
10660 46 46 49 58 7d 20 3d 20 22 2e 64 6c 6c 22 3b 20  FFIX} = ".dll"; 
10670 74 68 65 6e 0a 09 41 43 5f 43 41 43 48 45 5f 43  then..AC_CACHE_C
10680 48 45 43 4b 28 66 6f 72 20 53 45 48 20 73 75 70  HECK(for SEH sup
10690 70 6f 72 74 20 69 6e 20 63 6f 6d 70 69 6c 65 72  port in compiler
106a0 2c 0a 09 20 20 20 20 74 63 6c 5f 63 76 5f 73 65  ,..    tcl_cv_se
106b0 68 2c 0a 09 41 43 5f 54 52 59 5f 52 55 4e 28 5b  h,..AC_TRY_RUN([
106c0 0a 23 64 65 66 69 6e 65 20 57 49 4e 33 32 5f 4c  .#define WIN32_L
106d0 45 41 4e 5f 41 4e 44 5f 4d 45 41 4e 0a 23 69 6e  EAN_AND_MEAN.#in
106e0 63 6c 75 64 65 20 3c 77 69 6e 64 6f 77 73 2e 68  clude <windows.h
106f0 3e 0a 23 75 6e 64 65 66 20 57 49 4e 33 32 5f 4c  >.#undef WIN32_L
10700 45 41 4e 5f 41 4e 44 5f 4d 45 41 4e 0a 0a 09 20  EAN_AND_MEAN... 
10710 20 20 20 69 6e 74 20 6d 61 69 6e 28 69 6e 74 20     int main(int 
10720 61 72 67 63 2c 20 63 68 61 72 2a 2a 20 61 72 67  argc, char** arg
10730 76 29 20 7b 0a 09 09 69 6e 74 20 61 2c 20 62 20  v) {...int a, b 
10740 3d 20 30 3b 0a 09 09 5f 5f 74 72 79 20 7b 0a 09  = 0;...__try {..
10750 09 20 20 20 20 61 20 3d 20 36 36 36 20 2f 20 62  .    a = 666 / b
10760 3b 0a 09 09 7d 0a 09 09 5f 5f 65 78 63 65 70 74  ;...}...__except
10770 20 28 45 58 43 45 50 54 49 4f 4e 5f 45 58 45 43   (EXCEPTION_EXEC
10780 55 54 45 5f 48 41 4e 44 4c 45 52 29 20 7b 0a 09  UTE_HANDLER) {..
10790 09 20 20 20 20 72 65 74 75 72 6e 20 30 3b 0a 09  .    return 0;..
107a0 09 7d 0a 09 09 72 65 74 75 72 6e 20 31 3b 0a 09  .}...return 1;..
107b0 20 20 20 20 7d 0a 09 5d 2c 0a 09 20 20 20 20 74      }..],..    t
107c0 63 6c 5f 63 76 5f 73 65 68 3d 79 65 73 2c 0a 09  cl_cv_seh=yes,..
107d0 20 20 20 20 74 63 6c 5f 63 76 5f 73 65 68 3d 6e      tcl_cv_seh=n
107e0 6f 2c 0a 09 20 20 20 20 74 63 6c 5f 63 76 5f 73  o,..    tcl_cv_s
107f0 65 68 3d 6e 6f 29 0a 09 29 0a 09 69 66 20 74 65  eh=no)..)..if te
10800 73 74 20 22 24 74 63 6c 5f 63 76 5f 73 65 68 22  st "$tcl_cv_seh"
10810 20 3d 20 22 6e 6f 22 20 3b 20 74 68 65 6e 0a 09   = "no" ; then..
10820 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28 48 41      AC_DEFINE(HA
10830 56 45 5f 4e 4f 5f 53 45 48 2c 20 31 2c 0a 09 09  VE_NO_SEH, 1,...
10840 20 20 20 20 5b 44 65 66 69 6e 65 64 20 77 68 65      [Defined whe
10850 6e 20 6d 69 6e 67 77 20 64 6f 65 73 20 6e 6f 74  n mingw does not
10860 20 73 75 70 70 6f 72 74 20 53 45 48 5d 29 0a 09   support SEH])..
10870 66 69 0a 0a 09 23 0a 09 23 20 43 68 65 63 6b 20  fi...#..# Check 
10880 74 6f 20 73 65 65 20 69 66 20 74 68 65 20 65 78  to see if the ex
10890 63 70 74 2e 68 20 69 6e 63 6c 75 64 65 20 66 69  cpt.h include fi
108a0 6c 65 20 70 72 6f 76 69 64 65 64 20 63 6f 6e 74  le provided cont
108b0 61 69 6e 73 20 74 68 65 0a 09 23 20 64 65 66 69  ains the..# defi
108c0 6e 69 74 69 6f 6e 20 66 6f 72 20 45 58 43 45 50  nition for EXCEP
108d0 54 49 4f 4e 5f 44 49 53 50 4f 53 49 54 49 4f 4e  TION_DISPOSITION
108e0 3b 20 69 66 20 6e 6f 74 2c 20 77 68 69 63 68 20  ; if not, which 
108f0 69 73 20 74 68 65 20 63 61 73 65 0a 09 23 20 77  is the case..# w
10900 69 74 68 20 43 79 67 77 69 6e 27 73 20 76 65 72  ith Cygwin's ver
10910 73 69 6f 6e 20 61 73 20 6f 66 20 32 30 30 32 2d  sion as of 2002-
10920 30 34 2d 31 30 2c 20 64 65 66 69 6e 65 20 69 74  04-10, define it
10930 20 74 6f 20 62 65 20 69 6e 74 2c 0a 09 23 20 73   to be int,..# s
10940 75 66 66 69 63 69 65 6e 74 20 66 6f 72 20 67 65  ufficient for ge
10950 74 74 69 6e 67 20 74 68 65 20 63 75 72 72 65 6e  tting the curren
10960 74 20 63 6f 64 65 20 74 6f 20 77 6f 72 6b 2e 0a  t code to work..
10970 09 23 0a 09 41 43 5f 43 41 43 48 45 5f 43 48 45  .#..AC_CACHE_CHE
10980 43 4b 28 66 6f 72 20 45 58 43 45 50 54 49 4f 4e  CK(for EXCEPTION
10990 5f 44 49 53 50 4f 53 49 54 49 4f 4e 20 73 75 70  _DISPOSITION sup
109a0 70 6f 72 74 20 69 6e 20 69 6e 63 6c 75 64 65 20  port in include 
109b0 66 69 6c 65 73 2c 0a 09 20 20 20 20 74 63 6c 5f  files,..    tcl_
109c0 63 76 5f 65 68 5f 64 69 73 70 6f 73 69 74 69 6f  cv_eh_dispositio
109d0 6e 2c 0a 09 20 20 20 20 41 43 5f 54 52 59 5f 43  n,..    AC_TRY_C
109e0 4f 4d 50 49 4c 45 28 5b 0a 23 09 20 20 20 20 64  OMPILE([.#.    d
109f0 65 66 69 6e 65 20 57 49 4e 33 32 5f 4c 45 41 4e  efine WIN32_LEAN
10a00 5f 41 4e 44 5f 4d 45 41 4e 0a 23 09 20 20 20 20  _AND_MEAN.#.    
10a10 69 6e 63 6c 75 64 65 20 3c 77 69 6e 64 6f 77 73  include <windows
10a20 2e 68 3e 0a 23 09 20 20 20 20 75 6e 64 65 66 20  .h>.#.    undef 
10a30 57 49 4e 33 32 5f 4c 45 41 4e 5f 41 4e 44 5f 4d  WIN32_LEAN_AND_M
10a40 45 41 4e 0a 09 20 20 20 20 5d 2c 5b 0a 09 09 45  EAN..    ],[...E
10a50 58 43 45 50 54 49 4f 4e 5f 44 49 53 50 4f 53 49  XCEPTION_DISPOSI
10a60 54 49 4f 4e 20 78 3b 0a 09 20 20 20 20 5d 2c 0a  TION x;..    ],.
10a70 09 09 74 63 6c 5f 63 76 5f 65 68 5f 64 69 73 70  ..tcl_cv_eh_disp
10a80 6f 73 69 74 69 6f 6e 3d 79 65 73 2c 0a 09 09 74  osition=yes,...t
10a90 63 6c 5f 63 76 5f 65 68 5f 64 69 73 70 6f 73 69  cl_cv_eh_disposi
10aa0 74 69 6f 6e 3d 6e 6f 29 0a 09 29 0a 09 69 66 20  tion=no)..)..if 
10ab0 74 65 73 74 20 22 24 74 63 6c 5f 63 76 5f 65 68  test "$tcl_cv_eh
10ac0 5f 64 69 73 70 6f 73 69 74 69 6f 6e 22 20 3d 20  _disposition" = 
10ad0 22 6e 6f 22 20 3b 20 74 68 65 6e 0a 09 41 43 5f  "no" ; then..AC_
10ae0 44 45 46 49 4e 45 28 45 58 43 45 50 54 49 4f 4e  DEFINE(EXCEPTION
10af0 5f 44 49 53 50 4f 53 49 54 49 4f 4e 2c 20 69 6e  _DISPOSITION, in
10b00 74 2c 0a 09 09 5b 44 65 66 69 6e 65 64 20 77 68  t,...[Defined wh
10b10 65 6e 20 63 79 67 77 69 6e 2f 6d 69 6e 67 77 20  en cygwin/mingw 
10b20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74  does not support
10b30 20 45 58 43 45 50 54 49 4f 4e 20 44 49 53 50 4f   EXCEPTION DISPO
10b40 53 49 54 49 4f 4e 5d 29 0a 09 66 69 0a 0a 09 23  SITION])..fi...#
10b50 20 43 68 65 63 6b 20 74 6f 20 73 65 65 20 69 66   Check to see if
10b60 20 77 69 6e 6e 74 2e 68 20 64 65 66 69 6e 65 73   winnt.h defines
10b70 20 43 48 41 52 2c 20 53 48 4f 52 54 2c 20 61 6e   CHAR, SHORT, an
10b80 64 20 4c 4f 4e 47 0a 09 23 20 65 76 65 6e 20 69  d LONG..# even i
10b90 66 20 56 4f 49 44 20 68 61 73 20 61 6c 72 65 61  f VOID has alrea
10ba0 64 79 20 62 65 65 6e 20 23 64 65 66 69 6e 65 64  dy been #defined
10bb0 2e 20 54 68 65 20 77 69 6e 33 32 61 70 69 0a 09  . The win32api..
10bc0 23 20 75 73 65 64 20 62 79 20 6d 69 6e 67 77 20  # used by mingw 
10bd0 61 6e 64 20 63 79 67 77 69 6e 20 69 73 20 6b 6e  and cygwin is kn
10be0 6f 77 6e 20 74 6f 20 64 6f 20 74 68 69 73 2e 0a  own to do this..
10bf0 0a 09 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b  ..AC_CACHE_CHECK
10c00 28 66 6f 72 20 77 69 6e 6e 74 2e 68 20 74 68 61  (for winnt.h tha
10c10 74 20 69 67 6e 6f 72 65 73 20 56 4f 49 44 20 64  t ignores VOID d
10c20 65 66 69 6e 65 2c 0a 09 20 20 20 20 74 63 6c 5f  efine,..    tcl_
10c30 63 76 5f 77 69 6e 6e 74 5f 69 67 6e 6f 72 65 5f  cv_winnt_ignore_
10c40 76 6f 69 64 2c 0a 09 20 20 20 20 41 43 5f 54 52  void,..    AC_TR
10c50 59 5f 43 4f 4d 50 49 4c 45 28 5b 0a 23 64 65 66  Y_COMPILE([.#def
10c60 69 6e 65 20 56 4f 49 44 20 76 6f 69 64 0a 23 64  ine VOID void.#d
10c70 65 66 69 6e 65 20 57 49 4e 33 32 5f 4c 45 41 4e  efine WIN32_LEAN
10c80 5f 41 4e 44 5f 4d 45 41 4e 0a 23 69 6e 63 6c 75  _AND_MEAN.#inclu
10c90 64 65 20 3c 77 69 6e 64 6f 77 73 2e 68 3e 0a 23  de <windows.h>.#
10ca0 75 6e 64 65 66 20 57 49 4e 33 32 5f 4c 45 41 4e  undef WIN32_LEAN
10cb0 5f 41 4e 44 5f 4d 45 41 4e 0a 09 20 20 20 20 5d  _AND_MEAN..    ]
10cc0 2c 20 5b 0a 09 09 43 48 41 52 20 63 3b 0a 09 09  , [...CHAR c;...
10cd0 53 48 4f 52 54 20 73 3b 0a 09 09 4c 4f 4e 47 20  SHORT s;...LONG 
10ce0 6c 3b 0a 09 20 20 20 20 5d 2c 0a 20 20 20 20 20  l;..    ],.     
10cf0 20 20 20 74 63 6c 5f 63 76 5f 77 69 6e 6e 74 5f     tcl_cv_winnt_
10d00 69 67 6e 6f 72 65 5f 76 6f 69 64 3d 79 65 73 2c  ignore_void=yes,
10d10 0a 20 20 20 20 20 20 20 20 74 63 6c 5f 63 76 5f  .        tcl_cv_
10d20 77 69 6e 6e 74 5f 69 67 6e 6f 72 65 5f 76 6f 69  winnt_ignore_voi
10d30 64 3d 6e 6f 29 0a 09 29 0a 09 69 66 20 74 65 73  d=no)..)..if tes
10d40 74 20 22 24 74 63 6c 5f 63 76 5f 77 69 6e 6e 74  t "$tcl_cv_winnt
10d50 5f 69 67 6e 6f 72 65 5f 76 6f 69 64 22 20 3d 20  _ignore_void" = 
10d60 22 79 65 73 22 20 3b 20 74 68 65 6e 0a 09 20 20  "yes" ; then..  
10d70 20 20 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45    AC_DEFINE(HAVE
10d80 5f 57 49 4e 4e 54 5f 49 47 4e 4f 52 45 5f 56 4f  _WINNT_IGNORE_VO
10d90 49 44 2c 20 31 2c 0a 09 09 20 20 20 20 5b 44 65  ID, 1,...    [De
10da0 66 69 6e 65 64 20 77 68 65 6e 20 63 79 67 77 69  fined when cygwi
10db0 6e 2f 6d 69 6e 67 77 20 69 67 6e 6f 72 65 73 20  n/mingw ignores 
10dc0 56 4f 49 44 20 64 65 66 69 6e 65 20 69 6e 20 77  VOID define in w
10dd0 69 6e 6e 74 2e 68 5d 29 0a 09 66 69 0a 20 20 20  innt.h])..fi.   
10de0 20 66 69 0a 0a 09 23 20 53 65 65 20 69 66 20 74   fi...# See if t
10df0 68 65 20 63 6f 6d 70 69 6c 65 72 20 73 75 70 70  he compiler supp
10e00 6f 72 74 73 20 63 61 73 74 69 6e 67 20 74 6f 20  orts casting to 
10e10 61 20 75 6e 69 6f 6e 20 74 79 70 65 2e 0a 09 23  a union type...#
10e20 20 54 68 69 73 20 69 73 20 75 73 65 64 20 74 6f   This is used to
10e30 20 73 74 6f 70 20 67 63 63 20 66 72 6f 6d 20 70   stop gcc from p
10e40 72 69 6e 74 69 6e 67 20 61 20 63 6f 6d 70 69 6c  rinting a compil
10e50 65 72 0a 09 23 20 77 61 72 6e 69 6e 67 20 77 68  er..# warning wh
10e60 65 6e 20 69 6e 69 74 69 61 6c 69 7a 69 6e 67 20  en initializing 
10e70 61 20 75 6e 69 6f 6e 20 6d 65 6d 62 65 72 2e 0a  a union member..
10e80 0a 09 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b  ..AC_CACHE_CHECK
10e90 28 66 6f 72 20 63 61 73 74 20 74 6f 20 75 6e 69  (for cast to uni
10ea0 6f 6e 20 73 75 70 70 6f 72 74 2c 0a 09 20 20 20  on support,..   
10eb0 20 74 63 6c 5f 63 76 5f 63 61 73 74 5f 74 6f 5f   tcl_cv_cast_to_
10ec0 75 6e 69 6f 6e 2c 0a 09 20 20 20 20 41 43 5f 54  union,..    AC_T
10ed0 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 5d 2c 0a 09  RY_COMPILE([],..
10ee0 20 20 20 20 5b 0a 09 09 20 20 75 6e 69 6f 6e 20      [...  union 
10ef0 66 6f 6f 20 7b 20 69 6e 74 20 69 3b 20 64 6f 75  foo { int i; dou
10f00 62 6c 65 20 64 3b 20 7d 3b 0a 09 09 20 20 75 6e  ble d; };...  un
10f10 69 6f 6e 20 66 6f 6f 20 66 20 3d 20 28 75 6e 69  ion foo f = (uni
10f20 6f 6e 20 66 6f 6f 29 20 28 69 6e 74 29 20 30 3b  on foo) (int) 0;
10f30 0a 09 20 20 20 20 5d 2c 0a 09 20 20 20 20 74 63  ..    ],..    tc
10f40 6c 5f 63 76 5f 63 61 73 74 5f 74 6f 5f 75 6e 69  l_cv_cast_to_uni
10f50 6f 6e 3d 79 65 73 2c 0a 09 20 20 20 20 74 63 6c  on=yes,..    tcl
10f60 5f 63 76 5f 63 61 73 74 5f 74 6f 5f 75 6e 69 6f  _cv_cast_to_unio
10f70 6e 3d 6e 6f 29 0a 09 29 0a 09 69 66 20 74 65 73  n=no)..)..if tes
10f80 74 20 22 24 74 63 6c 5f 63 76 5f 63 61 73 74 5f  t "$tcl_cv_cast_
10f90 74 6f 5f 75 6e 69 6f 6e 22 20 3d 20 22 79 65 73  to_union" = "yes
10fa0 22 3b 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f  "; then..    AC_
10fb0 44 45 46 49 4e 45 28 48 41 56 45 5f 43 41 53 54  DEFINE(HAVE_CAST
10fc0 5f 54 4f 5f 55 4e 49 4f 4e 2c 20 31 2c 0a 09 09  _TO_UNION, 1,...
10fd0 20 20 20 20 5b 44 65 66 69 6e 65 64 20 77 68 65      [Defined whe
10fe0 6e 20 63 6f 6d 70 69 6c 65 72 20 73 75 70 70 6f  n compiler suppo
10ff0 72 74 73 20 63 61 73 74 69 6e 67 20 74 6f 20 75  rts casting to u
11000 6e 69 6f 6e 20 74 79 70 65 2e 5d 29 0a 09 66 69  nion type.])..fi
11010 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 43  ..    AC_SUBST(C
11020 46 4c 41 47 53 5f 44 45 42 55 47 29 0a 20 20 20  FLAGS_DEBUG).   
11030 20 41 43 5f 53 55 42 53 54 28 43 46 4c 41 47 53   AC_SUBST(CFLAGS
11040 5f 4f 50 54 49 4d 49 5a 45 29 0a 20 20 20 20 41  _OPTIMIZE).    A
11050 43 5f 53 55 42 53 54 28 43 46 4c 41 47 53 5f 57  C_SUBST(CFLAGS_W
11060 41 52 4e 49 4e 47 29 0a 0a 20 20 20 20 41 43 5f  ARNING)..    AC_
11070 53 55 42 53 54 28 53 54 4c 49 42 5f 4c 44 29 0a  SUBST(STLIB_LD).
11080 20 20 20 20 41 43 5f 53 55 42 53 54 28 53 48 4c      AC_SUBST(SHL
11090 49 42 5f 4c 44 29 0a 0a 20 20 20 20 41 43 5f 53  IB_LD)..    AC_S
110a0 55 42 53 54 28 53 48 4c 49 42 5f 4c 44 5f 4c 49  UBST(SHLIB_LD_LI
110b0 42 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54  BS).    AC_SUBST
110c0 28 53 48 4c 49 42 5f 43 46 4c 41 47 53 29 0a 0a  (SHLIB_CFLAGS)..
110d0 20 20 20 20 41 43 5f 53 55 42 53 54 28 4c 44 5f      AC_SUBST(LD_
110e0 4c 49 42 52 41 52 59 5f 50 41 54 48 5f 56 41 52  LIBRARY_PATH_VAR
110f0 29 0a 0a 20 20 20 20 23 20 54 68 65 73 65 20 6d  )..    # These m
11100 75 73 74 20 62 65 20 63 61 6c 6c 65 64 20 61 66  ust be called af
11110 74 65 72 20 77 65 20 64 6f 20 74 68 65 20 62 61  ter we do the ba
11120 73 69 63 20 43 46 4c 41 47 53 20 63 68 65 63 6b  sic CFLAGS check
11130 73 20 61 6e 64 0a 20 20 20 20 23 20 76 65 72 69  s and.    # veri
11140 66 79 20 61 6e 79 20 70 6f 73 73 69 62 6c 65 20  fy any possible 
11150 36 34 2d 62 69 74 20 6f 72 20 73 69 6d 69 6c 61  64-bit or simila
11160 72 20 73 77 69 74 63 68 65 73 20 61 72 65 20 6e  r switches are n
11170 65 63 65 73 73 61 72 79 0a 20 20 20 20 54 45 41  ecessary.    TEA
11180 5f 54 43 4c 5f 45 41 52 4c 59 5f 46 4c 41 47 53  _TCL_EARLY_FLAGS
11190 0a 20 20 20 20 54 45 41 5f 54 43 4c 5f 36 34 42  .    TEA_TCL_64B
111a0 49 54 5f 46 4c 41 47 53 0a 5d 29 0a 0a 23 2d 2d  IT_FLAGS.])..#--
111b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
111f0 2d 2d 0a 23 20 54 45 41 5f 53 45 52 49 41 4c 5f  --.# TEA_SERIAL_
11200 50 4f 52 54 0a 23 0a 23 09 44 65 74 65 72 6d 69  PORT.#.#.Determi
11210 6e 65 20 77 68 69 63 68 20 69 6e 74 65 72 66 61  ne which interfa
11220 63 65 20 74 6f 20 75 73 65 20 74 6f 20 74 61 6c  ce to use to tal
11230 6b 20 74 6f 20 74 68 65 20 73 65 72 69 61 6c 20  k to the serial 
11240 70 6f 72 74 2e 0a 23 09 4e 6f 74 65 20 74 68 61  port..#.Note tha
11250 74 20 23 69 6e 63 6c 75 64 65 20 6c 69 6e 65 73  t #include lines
11260 20 6d 75 73 74 20 62 65 67 69 6e 20 69 6e 20 6c   must begin in l
11270 65 66 74 6d 6f 73 74 20 63 6f 6c 75 6d 6e 20 66  eftmost column f
11280 6f 72 0a 23 09 73 6f 6d 65 20 63 6f 6d 70 69 6c  or.#.some compil
11290 65 72 73 20 74 6f 20 72 65 63 6f 67 6e 69 7a 65  ers to recognize
112a0 20 74 68 65 6d 20 61 73 20 70 72 65 70 72 6f 63   them as preproc
112b0 65 73 73 6f 72 20 64 69 72 65 63 74 69 76 65 73  essor directives
112c0 2c 0a 23 09 61 6e 64 20 73 6f 6d 65 20 62 75 69  ,.#.and some bui
112d0 6c 64 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 73 20  ld environments 
112e0 68 61 76 65 20 73 74 64 69 6e 20 6e 6f 74 20 70  have stdin not p
112f0 6f 69 6e 74 69 6e 67 20 61 74 20 61 0a 23 09 70  ointing at a.#.p
11300 73 65 75 64 6f 2d 74 65 72 6d 69 6e 61 6c 20 28  seudo-terminal (
11310 75 73 75 61 6c 6c 79 20 2f 64 65 76 2f 6e 75 6c  usually /dev/nul
11320 6c 20 69 6e 73 74 65 61 64 2e 29 0a 23 0a 23 20  l instead.).#.# 
11330 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e  Arguments:.#.non
11340 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23  e.#.# Results:.#
11350 0a 23 09 44 65 66 69 6e 65 73 20 6f 6e 6c 79 20  .#.Defines only 
11360 6f 6e 65 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f  one of the follo
11370 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 48 41  wing vars:.#..HA
11380 56 45 5f 53 59 53 5f 4d 4f 44 45 4d 5f 48 0a 23  VE_SYS_MODEM_H.#
11390 09 09 55 53 45 5f 54 45 52 4d 49 4f 53 0a 23 09  ..USE_TERMIOS.#.
113a0 09 55 53 45 5f 54 45 52 4d 49 4f 0a 23 09 09 55  .USE_TERMIO.#..U
113b0 53 45 5f 53 47 54 54 59 0a 23 2d 2d 2d 2d 2d 2d  SE_SGTTY.#------
113c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
113d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
113e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
113f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
11400 41 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 53 45  AC_DEFUN([TEA_SE
11410 52 49 41 4c 5f 50 4f 52 54 5d 2c 20 5b 0a 20 20  RIAL_PORT], [.  
11420 20 20 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45    AC_CHECK_HEADE
11430 52 53 28 73 79 73 2f 6d 6f 64 65 6d 2e 68 29 0a  RS(sys/modem.h).
11440 20 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45      AC_CACHE_CHE
11450 43 4b 28 5b 74 65 72 6d 69 6f 73 20 76 73 2e 20  CK([termios vs. 
11460 74 65 72 6d 69 6f 20 76 73 2e 20 73 67 74 74 79  termio vs. sgtty
11470 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 73 65  ], tcl_cv_api_se
11480 72 69 61 6c 2c 20 5b 0a 20 20 20 20 41 43 5f 54  rial, [.    AC_T
11490 52 59 5f 52 55 4e 28 5b 0a 23 69 6e 63 6c 75 64  RY_RUN([.#includ
114a0 65 20 3c 74 65 72 6d 69 6f 73 2e 68 3e 0a 0a 69  e <termios.h>..i
114b0 6e 74 20 6d 61 69 6e 28 29 20 7b 0a 20 20 20 20  nt main() {.    
114c0 73 74 72 75 63 74 20 74 65 72 6d 69 6f 73 20 74  struct termios t
114d0 3b 0a 20 20 20 20 69 66 20 28 74 63 67 65 74 61  ;.    if (tcgeta
114e0 74 74 72 28 30 2c 20 26 74 29 20 3d 3d 20 30 29  ttr(0, &t) == 0)
114f0 20 7b 0a 09 63 66 73 65 74 6f 73 70 65 65 64 28   {..cfsetospeed(
11500 26 74 2c 20 30 29 3b 0a 09 74 2e 63 5f 63 66 6c  &t, 0);..t.c_cfl
11510 61 67 20 7c 3d 20 50 41 52 45 4e 42 20 7c 20 50  ag |= PARENB | P
11520 41 52 4f 44 44 20 7c 20 43 53 49 5a 45 20 7c 20  ARODD | CSIZE | 
11530 43 53 54 4f 50 42 3b 0a 09 72 65 74 75 72 6e 20  CSTOPB;..return 
11540 30 3b 0a 20 20 20 20 7d 0a 20 20 20 20 72 65 74  0;.    }.    ret
11550 75 72 6e 20 31 3b 0a 7d 5d 2c 20 74 63 6c 5f 63  urn 1;.}], tcl_c
11560 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 74 65 72  v_api_serial=ter
11570 6d 69 6f 73 2c 20 74 63 6c 5f 63 76 5f 61 70 69  mios, tcl_cv_api
11580 5f 73 65 72 69 61 6c 3d 6e 6f 2c 20 74 63 6c 5f  _serial=no, tcl_
11590 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 6e 6f  cv_api_serial=no
115a0 29 0a 20 20 20 20 69 66 20 74 65 73 74 20 24 74  ).    if test $t
115b0 63 6c 5f 63 76 5f 61 70 69 5f 73 65 72 69 61 6c  cl_cv_api_serial
115c0 20 3d 20 6e 6f 20 3b 20 74 68 65 6e 0a 09 41 43   = no ; then..AC
115d0 5f 54 52 59 5f 52 55 4e 28 5b 0a 23 69 6e 63 6c  _TRY_RUN([.#incl
115e0 75 64 65 20 3c 74 65 72 6d 69 6f 2e 68 3e 0a 0a  ude <termio.h>..
115f0 69 6e 74 20 6d 61 69 6e 28 29 20 7b 0a 20 20 20  int main() {.   
11600 20 73 74 72 75 63 74 20 74 65 72 6d 69 6f 20 74   struct termio t
11610 3b 0a 20 20 20 20 69 66 20 28 69 6f 63 74 6c 28  ;.    if (ioctl(
11620 30 2c 20 54 43 47 45 54 41 2c 20 26 74 29 20 3d  0, TCGETA, &t) =
11630 3d 20 30 29 20 7b 0a 09 74 2e 63 5f 63 66 6c 61  = 0) {..t.c_cfla
11640 67 20 7c 3d 20 43 42 41 55 44 20 7c 20 50 41 52  g |= CBAUD | PAR
11650 45 4e 42 20 7c 20 50 41 52 4f 44 44 20 7c 20 43  ENB | PARODD | C
11660 53 49 5a 45 20 7c 20 43 53 54 4f 50 42 3b 0a 09  SIZE | CSTOPB;..
11670 72 65 74 75 72 6e 20 30 3b 0a 20 20 20 20 7d 0a  return 0;.    }.
11680 20 20 20 20 72 65 74 75 72 6e 20 31 3b 0a 7d 5d      return 1;.}]
11690 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 73 65 72  , tcl_cv_api_ser
116a0 69 61 6c 3d 74 65 72 6d 69 6f 2c 20 74 63 6c 5f  ial=termio, tcl_
116b0 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 6e 6f  cv_api_serial=no
116c0 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 73 65 72  , tcl_cv_api_ser
116d0 69 61 6c 3d 6e 6f 29 0a 20 20 20 20 66 69 0a 20  ial=no).    fi. 
116e0 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f     if test $tcl_
116f0 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 20 3d 20  cv_api_serial = 
11700 6e 6f 20 3b 20 74 68 65 6e 0a 09 41 43 5f 54 52  no ; then..AC_TR
11710 59 5f 52 55 4e 28 5b 0a 23 69 6e 63 6c 75 64 65  Y_RUN([.#include
11720 20 3c 73 67 74 74 79 2e 68 3e 0a 0a 69 6e 74 20   <sgtty.h>..int 
11730 6d 61 69 6e 28 29 20 7b 0a 20 20 20 20 73 74 72  main() {.    str
11740 75 63 74 20 73 67 74 74 79 62 20 74 3b 0a 20 20  uct sgttyb t;.  
11750 20 20 69 66 20 28 69 6f 63 74 6c 28 30 2c 20 54    if (ioctl(0, T
11760 49 4f 43 47 45 54 50 2c 20 26 74 29 20 3d 3d 20  IOCGETP, &t) == 
11770 30 29 20 7b 0a 09 74 2e 73 67 5f 6f 73 70 65 65  0) {..t.sg_ospee
11780 64 20 3d 20 30 3b 0a 09 74 2e 73 67 5f 66 6c 61  d = 0;..t.sg_fla
11790 67 73 20 7c 3d 20 4f 44 44 50 20 7c 20 45 56 45  gs |= ODDP | EVE
117a0 4e 50 20 7c 20 52 41 57 3b 0a 09 72 65 74 75 72  NP | RAW;..retur
117b0 6e 20 30 3b 0a 20 20 20 20 7d 0a 20 20 20 20 72  n 0;.    }.    r
117c0 65 74 75 72 6e 20 31 3b 0a 7d 5d 2c 20 74 63 6c  eturn 1;.}], tcl
117d0 5f 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 73  _cv_api_serial=s
117e0 67 74 74 79 2c 20 74 63 6c 5f 63 76 5f 61 70 69  gtty, tcl_cv_api
117f0 5f 73 65 72 69 61 6c 3d 6e 6f 2c 20 74 63 6c 5f  _serial=no, tcl_
11800 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 6e 6f  cv_api_serial=no
11810 29 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  ).    fi.    if 
11820 74 65 73 74 20 24 74 63 6c 5f 63 76 5f 61 70 69  test $tcl_cv_api
11830 5f 73 65 72 69 61 6c 20 3d 20 6e 6f 20 3b 20 74  _serial = no ; t
11840 68 65 6e 0a 09 41 43 5f 54 52 59 5f 52 55 4e 28  hen..AC_TRY_RUN(
11850 5b 0a 23 69 6e 63 6c 75 64 65 20 3c 74 65 72 6d  [.#include <term
11860 69 6f 73 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20  ios.h>.#include 
11870 3c 65 72 72 6e 6f 2e 68 3e 0a 0a 69 6e 74 20 6d  <errno.h>..int m
11880 61 69 6e 28 29 20 7b 0a 20 20 20 20 73 74 72 75  ain() {.    stru
11890 63 74 20 74 65 72 6d 69 6f 73 20 74 3b 0a 20 20  ct termios t;.  
118a0 20 20 69 66 20 28 74 63 67 65 74 61 74 74 72 28    if (tcgetattr(
118b0 30 2c 20 26 74 29 20 3d 3d 20 30 0a 09 7c 7c 20  0, &t) == 0..|| 
118c0 65 72 72 6e 6f 20 3d 3d 20 45 4e 4f 54 54 59 20  errno == ENOTTY 
118d0 7c 7c 20 65 72 72 6e 6f 20 3d 3d 20 45 4e 58 49  || errno == ENXI
118e0 4f 20 7c 7c 20 65 72 72 6e 6f 20 3d 3d 20 45 49  O || errno == EI
118f0 4e 56 41 4c 29 20 7b 0a 09 63 66 73 65 74 6f 73  NVAL) {..cfsetos
11900 70 65 65 64 28 26 74 2c 20 30 29 3b 0a 09 74 2e  peed(&t, 0);..t.
11910 63 5f 63 66 6c 61 67 20 7c 3d 20 50 41 52 45 4e  c_cflag |= PAREN
11920 42 20 7c 20 50 41 52 4f 44 44 20 7c 20 43 53 49  B | PARODD | CSI
11930 5a 45 20 7c 20 43 53 54 4f 50 42 3b 0a 09 72 65  ZE | CSTOPB;..re
11940 74 75 72 6e 20 30 3b 0a 20 20 20 20 7d 0a 20 20  turn 0;.    }.  
11950 20 20 72 65 74 75 72 6e 20 31 3b 0a 7d 5d 2c 20    return 1;.}], 
11960 74 63 6c 5f 63 76 5f 61 70 69 5f 73 65 72 69 61  tcl_cv_api_seria
11970 6c 3d 74 65 72 6d 69 6f 73 2c 20 74 63 6c 5f 63  l=termios, tcl_c
11980 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 6e 6f 2c  v_api_serial=no,
11990 20 74 63 6c 5f 63 76 5f 61 70 69 5f 73 65 72 69   tcl_cv_api_seri
119a0 61 6c 3d 6e 6f 29 0a 20 20 20 20 66 69 0a 20 20  al=no).    fi.  
119b0 20 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f 63    if test $tcl_c
119c0 76 5f 61 70 69 5f 73 65 72 69 61 6c 20 3d 20 6e  v_api_serial = n
119d0 6f 3b 20 74 68 65 6e 0a 09 41 43 5f 54 52 59 5f  o; then..AC_TRY_
119e0 52 55 4e 28 5b 0a 23 69 6e 63 6c 75 64 65 20 3c  RUN([.#include <
119f0 74 65 72 6d 69 6f 2e 68 3e 0a 23 69 6e 63 6c 75  termio.h>.#inclu
11a00 64 65 20 3c 65 72 72 6e 6f 2e 68 3e 0a 0a 69 6e  de <errno.h>..in
11a10 74 20 6d 61 69 6e 28 29 20 7b 0a 20 20 20 20 73  t main() {.    s
11a20 74 72 75 63 74 20 74 65 72 6d 69 6f 20 74 3b 0a  truct termio t;.
11a30 20 20 20 20 69 66 20 28 69 6f 63 74 6c 28 30 2c      if (ioctl(0,
11a40 20 54 43 47 45 54 41 2c 20 26 74 29 20 3d 3d 20   TCGETA, &t) == 
11a50 30 0a 09 7c 7c 20 65 72 72 6e 6f 20 3d 3d 20 45  0..|| errno == E
11a60 4e 4f 54 54 59 20 7c 7c 20 65 72 72 6e 6f 20 3d  NOTTY || errno =
11a70 3d 20 45 4e 58 49 4f 20 7c 7c 20 65 72 72 6e 6f  = ENXIO || errno
11a80 20 3d 3d 20 45 49 4e 56 41 4c 29 20 7b 0a 09 74   == EINVAL) {..t
11a90 2e 63 5f 63 66 6c 61 67 20 7c 3d 20 43 42 41 55  .c_cflag |= CBAU
11aa0 44 20 7c 20 50 41 52 45 4e 42 20 7c 20 50 41 52  D | PARENB | PAR
11ab0 4f 44 44 20 7c 20 43 53 49 5a 45 20 7c 20 43 53  ODD | CSIZE | CS
11ac0 54 4f 50 42 3b 0a 09 72 65 74 75 72 6e 20 30 3b  TOPB;..return 0;
11ad0 0a 20 20 20 20 7d 0a 20 20 20 20 72 65 74 75 72  .    }.    retur
11ae0 6e 20 31 3b 0a 20 20 20 20 7d 5d 2c 20 74 63 6c  n 1;.    }], tcl
11af0 5f 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 74  _cv_api_serial=t
11b00 65 72 6d 69 6f 2c 20 74 63 6c 5f 63 76 5f 61 70  ermio, tcl_cv_ap
11b10 69 5f 73 65 72 69 61 6c 3d 6e 6f 2c 20 74 63 6c  i_serial=no, tcl
11b20 5f 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 6e  _cv_api_serial=n
11b30 6f 29 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  o).    fi.    if
11b40 20 74 65 73 74 20 24 74 63 6c 5f 63 76 5f 61 70   test $tcl_cv_ap
11b50 69 5f 73 65 72 69 61 6c 20 3d 20 6e 6f 3b 20 74  i_serial = no; t
11b60 68 65 6e 0a 09 41 43 5f 54 52 59 5f 52 55 4e 28  hen..AC_TRY_RUN(
11b70 5b 0a 23 69 6e 63 6c 75 64 65 20 3c 73 67 74 74  [.#include <sgtt
11b80 79 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c 65  y.h>.#include <e
11b90 72 72 6e 6f 2e 68 3e 0a 0a 69 6e 74 20 6d 61 69  rrno.h>..int mai
11ba0 6e 28 29 20 7b 0a 20 20 20 20 73 74 72 75 63 74  n() {.    struct
11bb0 20 73 67 74 74 79 62 20 74 3b 0a 20 20 20 20 69   sgttyb t;.    i
11bc0 66 20 28 69 6f 63 74 6c 28 30 2c 20 54 49 4f 43  f (ioctl(0, TIOC
11bd0 47 45 54 50 2c 20 26 74 29 20 3d 3d 20 30 0a 09  GETP, &t) == 0..
11be0 7c 7c 20 65 72 72 6e 6f 20 3d 3d 20 45 4e 4f 54  || errno == ENOT
11bf0 54 59 20 7c 7c 20 65 72 72 6e 6f 20 3d 3d 20 45  TY || errno == E
11c00 4e 58 49 4f 20 7c 7c 20 65 72 72 6e 6f 20 3d 3d  NXIO || errno ==
11c10 20 45 49 4e 56 41 4c 29 20 7b 0a 09 74 2e 73 67   EINVAL) {..t.sg
11c20 5f 6f 73 70 65 65 64 20 3d 20 30 3b 0a 09 74 2e  _ospeed = 0;..t.
11c30 73 67 5f 66 6c 61 67 73 20 7c 3d 20 4f 44 44 50  sg_flags |= ODDP
11c40 20 7c 20 45 56 45 4e 50 20 7c 20 52 41 57 3b 0a   | EVENP | RAW;.
11c50 09 72 65 74 75 72 6e 20 30 3b 0a 20 20 20 20 7d  .return 0;.    }
11c60 0a 20 20 20 20 72 65 74 75 72 6e 20 31 3b 0a 7d  .    return 1;.}
11c70 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 73 65  ], tcl_cv_api_se
11c80 72 69 61 6c 3d 73 67 74 74 79 2c 20 74 63 6c 5f  rial=sgtty, tcl_
11c90 63 76 5f 61 70 69 5f 73 65 72 69 61 6c 3d 6e 6f  cv_api_serial=no
11ca0 6e 65 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 73  ne, tcl_cv_api_s
11cb0 65 72 69 61 6c 3d 6e 6f 6e 65 29 0a 20 20 20 20  erial=none).    
11cc0 66 69 5d 29 0a 20 20 20 20 63 61 73 65 20 24 74  fi]).    case $t
11cd0 63 6c 5f 63 76 5f 61 70 69 5f 73 65 72 69 61 6c  cl_cv_api_serial
11ce0 20 69 6e 0a 09 74 65 72 6d 69 6f 73 29 20 41 43   in..termios) AC
11cf0 5f 44 45 46 49 4e 45 28 55 53 45 5f 54 45 52 4d  _DEFINE(USE_TERM
11d00 49 4f 53 2c 20 31 2c 20 5b 55 73 65 20 74 68 65  IOS, 1, [Use the
11d10 20 74 65 72 6d 69 6f 73 20 41 50 49 20 66 6f 72   termios API for
11d20 20 73 65 72 69 61 6c 20 6c 69 6e 65 73 5d 29 3b   serial lines]);
11d30 3b 0a 09 74 65 72 6d 69 6f 29 20 20 41 43 5f 44  ;..termio)  AC_D
11d40 45 46 49 4e 45 28 55 53 45 5f 54 45 52 4d 49 4f  EFINE(USE_TERMIO
11d50 2c 20 31 2c 20 5b 55 73 65 20 74 68 65 20 74 65  , 1, [Use the te
11d60 72 6d 69 6f 20 41 50 49 20 66 6f 72 20 73 65 72  rmio API for ser
11d70 69 61 6c 20 6c 69 6e 65 73 5d 29 3b 3b 0a 09 73  ial lines]);;..s
11d80 67 74 74 79 29 20 20 20 41 43 5f 44 45 46 49 4e  gtty)   AC_DEFIN
11d90 45 28 55 53 45 5f 53 47 54 54 59 2c 20 31 2c 20  E(USE_SGTTY, 1, 
11da0 5b 55 73 65 20 74 68 65 20 73 67 74 74 79 20 41  [Use the sgtty A
11db0 50 49 20 66 6f 72 20 73 65 72 69 61 6c 20 6c 69  PI for serial li
11dc0 6e 65 73 5d 29 3b 3b 0a 20 20 20 20 65 73 61 63  nes]);;.    esac
11dd0 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .])..#----------
11de0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11df0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11e00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11e10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41  ----------.# TEA
11e20 5f 4d 49 53 53 49 4e 47 5f 50 4f 53 49 58 5f 48  _MISSING_POSIX_H
11e30 45 41 44 45 52 53 0a 23 0a 23 09 53 75 70 70 6c  EADERS.#.#.Suppl
11e40 79 20 73 75 62 73 74 69 74 75 74 65 73 20 66 6f  y substitutes fo
11e50 72 20 6d 69 73 73 69 6e 67 20 50 4f 53 49 58 20  r missing POSIX 
11e60 68 65 61 64 65 72 20 66 69 6c 65 73 2e 20 20 53  header files.  S
11e70 70 65 63 69 61 6c 0a 23 09 6e 6f 74 65 73 3a 0a  pecial.#.notes:.
11e80 23 09 20 20 20 20 2d 20 73 74 64 6c 69 62 2e 68  #.    - stdlib.h
11e90 20 64 6f 65 73 6e 27 74 20 64 65 66 69 6e 65 20   doesn't define 
11ea0 73 74 72 74 6f 6c 2c 20 73 74 72 74 6f 75 6c 2c  strtol, strtoul,
11eb0 20 6f 72 0a 23 09 20 20 20 20 20 20 73 74 72 74   or.#.      strt
11ec0 6f 64 20 69 6e 20 73 6f 6d 65 20 76 65 72 73 69  od in some versi
11ed0 6f 6e 73 20 6f 66 20 53 75 6e 4f 53 0a 23 09 20  ons of SunOS.#. 
11ee0 20 20 20 2d 20 73 6f 6d 65 20 76 65 72 73 69 6f     - some versio
11ef0 6e 73 20 6f 66 20 73 74 72 69 6e 67 2e 68 20 64  ns of string.h d
11f00 6f 6e 27 74 20 64 65 63 6c 61 72 65 20 70 72 6f  on't declare pro
11f10 63 65 64 75 72 65 73 20 73 75 63 68 0a 23 09 20  cedures such.#. 
11f20 20 20 20 20 20 61 73 20 73 74 72 73 74 72 0a 23       as strstr.#
11f30 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
11f40 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73  none.#.# Results
11f50 3a 0a 23 0a 23 09 44 65 66 69 6e 65 73 20 73 6f  :.#.#.Defines so
11f60 6d 65 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77  me of the follow
11f70 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 4e 4f 5f  ing vars:.#..NO_
11f80 44 49 52 45 4e 54 5f 48 0a 23 09 09 4e 4f 5f 45  DIRENT_H.#..NO_E
11f90 52 52 4e 4f 5f 48 0a 23 09 09 4e 4f 5f 56 41 4c  RRNO_H.#..NO_VAL
11fa0 55 45 53 5f 48 0a 23 09 09 48 41 56 45 5f 4c 49  UES_H.#..HAVE_LI
11fb0 4d 49 54 53 5f 48 20 6f 72 20 4e 4f 5f 4c 49 4d  MITS_H or NO_LIM
11fc0 49 54 53 5f 48 0a 23 09 09 4e 4f 5f 53 54 44 4c  ITS_H.#..NO_STDL
11fd0 49 42 5f 48 0a 23 09 09 4e 4f 5f 53 54 52 49 4e  IB_H.#..NO_STRIN
11fe0 47 5f 48 0a 23 09 09 4e 4f 5f 53 59 53 5f 57 41  G_H.#..NO_SYS_WA
11ff0 49 54 5f 48 0a 23 09 09 4e 4f 5f 44 4c 46 43 4e  IT_H.#..NO_DLFCN
12000 5f 48 0a 23 09 09 48 41 56 45 5f 53 59 53 5f 50  _H.#..HAVE_SYS_P
12010 41 52 41 4d 5f 48 0a 23 0a 23 09 09 48 41 56 45  ARAM_H.#.#..HAVE
12020 5f 53 54 52 49 4e 47 5f 48 20 3f 0a 23 0a 23 20  _STRING_H ?.#.# 
12030 74 6b 55 6e 69 78 50 6f 72 74 2e 68 20 63 68 65  tkUnixPort.h che
12040 63 6b 73 20 66 6f 72 20 48 41 56 45 5f 4c 49 4d  cks for HAVE_LIM
12050 49 54 53 5f 48 2c 20 73 6f 20 64 6f 20 62 6f 74  ITS_H, so do bot
12060 68 20 48 41 56 45 20 61 6e 64 0a 23 20 43 48 45  h HAVE and.# CHE
12070 43 4b 20 6f 6e 20 6c 69 6d 69 74 73 2e 68 0a 23  CK on limits.h.#
12080 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12090 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
120a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
120b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
120c0 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b  ----..AC_DEFUN([
120d0 54 45 41 5f 4d 49 53 53 49 4e 47 5f 50 4f 53 49  TEA_MISSING_POSI
120e0 58 5f 48 45 41 44 45 52 53 5d 2c 20 5b 0a 20 20  X_HEADERS], [.  
120f0 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b    AC_CACHE_CHECK
12100 28 5b 64 69 72 65 6e 74 2e 68 5d 2c 20 74 63 6c  ([dirent.h], tcl
12110 5f 63 76 5f 64 69 72 65 6e 74 5f 68 2c 20 5b 0a  _cv_dirent_h, [.
12120 20 20 20 20 41 43 5f 54 52 59 5f 4c 49 4e 4b 28      AC_TRY_LINK(
12130 5b 23 69 6e 63 6c 75 64 65 20 3c 73 79 73 2f 74  [#include <sys/t
12140 79 70 65 73 2e 68 3e 0a 23 69 6e 63 6c 75 64 65  ypes.h>.#include
12150 20 3c 64 69 72 65 6e 74 2e 68 3e 5d 2c 20 5b 0a   <dirent.h>], [.
12160 23 69 66 6e 64 65 66 20 5f 50 4f 53 49 58 5f 53  #ifndef _POSIX_S
12170 4f 55 52 43 45 0a 23 20 20 20 69 66 64 65 66 20  OURCE.#   ifdef 
12180 5f 5f 4c 79 6e 78 5f 5f 0a 09 2f 2a 0a 09 20 2a  __Lynx__../*.. *
12190 20 47 65 6e 65 72 61 74 65 20 63 6f 6d 70 69 6c   Generate compil
121a0 61 74 69 6f 6e 20 65 72 72 6f 72 20 74 6f 20 6d  ation error to m
121b0 61 6b 65 20 74 68 65 20 74 65 73 74 20 66 61 69  ake the test fai
121c0 6c 3a 20 20 4c 79 6e 78 20 68 65 61 64 65 72 73  l:  Lynx headers
121d0 0a 09 20 2a 20 61 72 65 20 6f 6e 6c 79 20 76 61  .. * are only va
121e0 6c 69 64 20 69 66 20 72 65 61 6c 6c 79 20 69 6e  lid if really in
121f0 20 74 68 65 20 50 4f 53 49 58 20 65 6e 76 69 72   the POSIX envir
12200 6f 6e 6d 65 6e 74 2e 0a 09 20 2a 2f 0a 0a 09 6d  onment... */...m
12210 69 73 73 69 6e 67 5f 70 72 6f 63 65 64 75 72 65  issing_procedure
12220 28 29 3b 0a 23 20 20 20 65 6e 64 69 66 0a 23 65  ();.#   endif.#e
12230 6e 64 69 66 0a 44 49 52 20 2a 64 3b 0a 73 74 72  ndif.DIR *d;.str
12240 75 63 74 20 64 69 72 65 6e 74 20 2a 65 6e 74 72  uct dirent *entr
12250 79 50 74 72 3b 0a 63 68 61 72 20 2a 70 3b 0a 64  yPtr;.char *p;.d
12260 20 3d 20 6f 70 65 6e 64 69 72 28 22 66 6f 6f 62   = opendir("foob
12270 61 72 22 29 3b 0a 65 6e 74 72 79 50 74 72 20 3d  ar");.entryPtr =
12280 20 72 65 61 64 64 69 72 28 64 29 3b 0a 70 20 3d   readdir(d);.p =
12290 20 65 6e 74 72 79 50 74 72 2d 3e 64 5f 6e 61 6d   entryPtr->d_nam
122a0 65 3b 0a 63 6c 6f 73 65 64 69 72 28 64 29 3b 0a  e;.closedir(d);.
122b0 5d 2c 20 74 63 6c 5f 63 76 5f 64 69 72 65 6e 74  ], tcl_cv_dirent
122c0 5f 68 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f 64  _h=yes, tcl_cv_d
122d0 69 72 65 6e 74 5f 68 3d 6e 6f 29 5d 29 0a 0a 20  irent_h=no)]).. 
122e0 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f     if test $tcl_
122f0 63 76 5f 64 69 72 65 6e 74 5f 68 20 3d 20 6e 6f  cv_dirent_h = no
12300 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e  ; then..AC_DEFIN
12310 45 28 4e 4f 5f 44 49 52 45 4e 54 5f 48 2c 20 31  E(NO_DIRENT_H, 1
12320 2c 20 5b 44 6f 20 77 65 20 68 61 76 65 20 3c 64  , [Do we have <d
12330 69 72 65 6e 74 2e 68 3e 3f 5d 29 0a 20 20 20 20  irent.h>?]).    
12340 66 69 0a 0a 20 20 20 20 23 20 54 45 41 20 73 70  fi..    # TEA sp
12350 65 63 69 66 69 63 3a 0a 20 20 20 20 41 43 5f 43  ecific:.    AC_C
12360 48 45 43 4b 5f 48 45 41 44 45 52 28 65 72 72 6e  HECK_HEADER(errn
12370 6f 2e 68 2c 20 2c 20 5b 41 43 5f 44 45 46 49 4e  o.h, , [AC_DEFIN
12380 45 28 4e 4f 5f 45 52 52 4e 4f 5f 48 2c 20 31 2c  E(NO_ERRNO_H, 1,
12390 20 5b 44 6f 20 77 65 20 68 61 76 65 20 3c 65 72   [Do we have <er
123a0 72 6e 6f 2e 68 3e 3f 5d 29 5d 29 0a 20 20 20 20  rno.h>?])]).    
123b0 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 28  AC_CHECK_HEADER(
123c0 66 6c 6f 61 74 2e 68 2c 20 2c 20 5b 41 43 5f 44  float.h, , [AC_D
123d0 45 46 49 4e 45 28 4e 4f 5f 46 4c 4f 41 54 5f 48  EFINE(NO_FLOAT_H
123e0 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68 61 76 65  , 1, [Do we have
123f0 20 3c 66 6c 6f 61 74 2e 68 3e 3f 5d 29 5d 29 0a   <float.h>?])]).
12400 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 48 45 41      AC_CHECK_HEA
12410 44 45 52 28 76 61 6c 75 65 73 2e 68 2c 20 2c 20  DER(values.h, , 
12420 5b 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 56 41  [AC_DEFINE(NO_VA
12430 4c 55 45 53 5f 48 2c 20 31 2c 20 5b 44 6f 20 77  LUES_H, 1, [Do w
12440 65 20 68 61 76 65 20 3c 76 61 6c 75 65 73 2e 68  e have <values.h
12450 3e 3f 5d 29 5d 29 0a 20 20 20 20 41 43 5f 43 48  >?])]).    AC_CH
12460 45 43 4b 5f 48 45 41 44 45 52 28 6c 69 6d 69 74  ECK_HEADER(limit
12470 73 2e 68 2c 0a 09 5b 41 43 5f 44 45 46 49 4e 45  s.h,..[AC_DEFINE
12480 28 48 41 56 45 5f 4c 49 4d 49 54 53 5f 48 2c 20  (HAVE_LIMITS_H, 
12490 31 2c 20 5b 44 6f 20 77 65 20 68 61 76 65 20 3c  1, [Do we have <
124a0 6c 69 6d 69 74 73 2e 68 3e 3f 5d 29 5d 2c 0a 09  limits.h>?])],..
124b0 5b 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 4c 49  [AC_DEFINE(NO_LI
124c0 4d 49 54 53 5f 48 2c 20 31 2c 20 5b 44 6f 20 77  MITS_H, 1, [Do w
124d0 65 20 68 61 76 65 20 3c 6c 69 6d 69 74 73 2e 68  e have <limits.h
124e0 3e 3f 5d 29 5d 29 0a 20 20 20 20 41 43 5f 43 48  >?])]).    AC_CH
124f0 45 43 4b 5f 48 45 41 44 45 52 28 73 74 64 6c 69  ECK_HEADER(stdli
12500 62 2e 68 2c 20 74 63 6c 5f 6f 6b 3d 31 2c 20 74  b.h, tcl_ok=1, t
12510 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 41 43 5f  cl_ok=0).    AC_
12520 45 47 52 45 50 5f 48 45 41 44 45 52 28 73 74 72  EGREP_HEADER(str
12530 74 6f 6c 2c 20 73 74 64 6c 69 62 2e 68 2c 20 2c  tol, stdlib.h, ,
12540 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 41   tcl_ok=0).    A
12550 43 5f 45 47 52 45 50 5f 48 45 41 44 45 52 28 73  C_EGREP_HEADER(s
12560 74 72 74 6f 75 6c 2c 20 73 74 64 6c 69 62 2e 68  trtoul, stdlib.h
12570 2c 20 2c 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20  , , tcl_ok=0).  
12580 20 20 41 43 5f 45 47 52 45 50 5f 48 45 41 44 45    AC_EGREP_HEADE
12590 52 28 73 74 72 74 6f 64 2c 20 73 74 64 6c 69 62  R(strtod, stdlib
125a0 2e 68 2c 20 2c 20 74 63 6c 5f 6f 6b 3d 30 29 0a  .h, , tcl_ok=0).
125b0 20 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c      if test $tcl
125c0 5f 6f 6b 20 3d 20 30 3b 20 74 68 65 6e 0a 09 41  _ok = 0; then..A
125d0 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 53 54 44 4c  C_DEFINE(NO_STDL
125e0 49 42 5f 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20  IB_H, 1, [Do we 
125f0 68 61 76 65 20 3c 73 74 64 6c 69 62 2e 68 3e 3f  have <stdlib.h>?
12600 5d 29 0a 20 20 20 20 66 69 0a 20 20 20 20 41 43  ]).    fi.    AC
12610 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 28 73 74  _CHECK_HEADER(st
12620 72 69 6e 67 2e 68 2c 20 74 63 6c 5f 6f 6b 3d 31  ring.h, tcl_ok=1
12630 2c 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20  , tcl_ok=0).    
12640 41 43 5f 45 47 52 45 50 5f 48 45 41 44 45 52 28  AC_EGREP_HEADER(
12650 73 74 72 73 74 72 2c 20 73 74 72 69 6e 67 2e 68  strstr, string.h
12660 2c 20 2c 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20  , , tcl_ok=0).  
12670 20 20 41 43 5f 45 47 52 45 50 5f 48 45 41 44 45    AC_EGREP_HEADE
12680 52 28 73 74 72 65 72 72 6f 72 2c 20 73 74 72 69  R(strerror, stri
12690 6e 67 2e 68 2c 20 2c 20 74 63 6c 5f 6f 6b 3d 30  ng.h, , tcl_ok=0
126a0 29 0a 0a 20 20 20 20 23 20 53 65 65 20 61 6c 73  )..    # See als
126b0 6f 20 6d 65 6d 6d 6f 76 65 20 63 68 65 63 6b 20  o memmove check 
126c0 62 65 6c 6f 77 20 66 6f 72 20 61 20 70 6c 61 63  below for a plac
126d0 65 20 77 68 65 72 65 20 4e 4f 5f 53 54 52 49 4e  e where NO_STRIN
126e0 47 5f 48 20 63 61 6e 20 62 65 0a 20 20 20 20 23  G_H can be.    #
126f0 20 73 65 74 20 61 6e 64 20 77 68 79 2e 0a 0a 20   set and why... 
12700 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f     if test $tcl_
12710 6f 6b 20 3d 20 30 3b 20 74 68 65 6e 0a 09 41 43  ok = 0; then..AC
12720 5f 44 45 46 49 4e 45 28 4e 4f 5f 53 54 52 49 4e  _DEFINE(NO_STRIN
12730 47 5f 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68  G_H, 1, [Do we h
12740 61 76 65 20 3c 73 74 72 69 6e 67 2e 68 3e 3f 5d  ave <string.h>?]
12750 29 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 41 43  ).    fi..    AC
12760 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 28 73 79  _CHECK_HEADER(sy
12770 73 2f 77 61 69 74 2e 68 2c 20 2c 20 5b 41 43 5f  s/wait.h, , [AC_
12780 44 45 46 49 4e 45 28 4e 4f 5f 53 59 53 5f 57 41  DEFINE(NO_SYS_WA
12790 49 54 5f 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20  IT_H, 1, [Do we 
127a0 68 61 76 65 20 3c 73 79 73 2f 77 61 69 74 2e 68  have <sys/wait.h
127b0 3e 3f 5d 29 5d 29 0a 20 20 20 20 41 43 5f 43 48  >?])]).    AC_CH
127c0 45 43 4b 5f 48 45 41 44 45 52 28 64 6c 66 63 6e  ECK_HEADER(dlfcn
127d0 2e 68 2c 20 2c 20 5b 41 43 5f 44 45 46 49 4e 45  .h, , [AC_DEFINE
127e0 28 4e 4f 5f 44 4c 46 43 4e 5f 48 2c 20 31 2c 20  (NO_DLFCN_H, 1, 
127f0 5b 44 6f 20 77 65 20 68 61 76 65 20 3c 64 6c 66  [Do we have <dlf
12800 63 6e 2e 68 3e 3f 5d 29 5d 29 0a 0a 20 20 20 20  cn.h>?])])..    
12810 23 20 4f 53 2f 33 39 30 20 6c 61 63 6b 73 20 73  # OS/390 lacks s
12820 79 73 2f 70 61 72 61 6d 2e 68 20 28 61 6e 64 20  ys/param.h (and 
12830 64 6f 65 73 6e 27 74 20 6e 65 65 64 20 69 74 2c  doesn't need it,
12840 20 62 79 20 63 68 61 6e 63 65 29 2e 0a 20 20 20   by chance)..   
12850 20 41 43 5f 48 41 56 45 5f 48 45 41 44 45 52 53   AC_HAVE_HEADERS
12860 28 73 79 73 2f 70 61 72 61 6d 2e 68 29 0a 5d 29  (sys/param.h).])
12870 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
12880 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
128a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
128b0 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f 50 41  -------.# TEA_PA
128c0 54 48 5f 58 0a 23 0a 23 09 4c 6f 63 61 74 65 20  TH_X.#.#.Locate 
128d0 74 68 65 20 58 31 31 20 68 65 61 64 65 72 20 66  the X11 header f
128e0 69 6c 65 73 20 61 6e 64 20 74 68 65 20 58 31 31  iles and the X11
128f0 20 6c 69 62 72 61 72 79 20 61 72 63 68 69 76 65   library archive
12900 2e 20 20 54 72 79 0a 23 09 74 68 65 20 61 63 5f  .  Try.#.the ac_
12910 70 61 74 68 5f 78 20 6d 61 63 72 6f 20 66 69 72  path_x macro fir
12920 73 74 2c 20 62 75 74 20 69 66 20 69 74 20 64 6f  st, but if it do
12930 65 73 6e 27 74 20 66 69 6e 64 20 74 68 65 20 58  esn't find the X
12940 20 73 74 75 66 66 0a 23 09 28 65 2e 67 2e 20 62   stuff.#.(e.g. b
12950 65 63 61 75 73 65 20 74 68 65 72 65 27 73 20 6e  ecause there's n
12960 6f 20 78 6d 6b 6d 66 20 70 72 6f 67 72 61 6d 29  o xmkmf program)
12970 20 74 68 65 6e 20 63 68 65 63 6b 20 74 68 72 6f   then check thro
12980 75 67 68 0a 23 09 61 20 6c 69 73 74 20 6f 66 20  ugh.#.a list of 
12990 70 6f 73 73 69 62 6c 65 20 64 69 72 65 63 74 6f  possible directo
129a0 72 69 65 73 2e 20 20 55 6e 64 65 72 20 73 6f 6d  ries.  Under som
129b0 65 20 63 6f 6e 64 69 74 69 6f 6e 73 20 74 68 65  e conditions the
129c0 0a 23 09 61 75 74 6f 63 6f 6e 66 20 6d 61 63 72  .#.autoconf macr
129d0 6f 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 6e  o will return an
129e0 20 69 6e 63 6c 75 64 65 20 64 69 72 65 63 74 6f   include directo
129f0 72 79 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 73  ry that contains
12a00 0a 23 09 6e 6f 20 69 6e 63 6c 75 64 65 20 66 69  .#.no include fi
12a10 6c 65 73 2c 20 73 6f 20 64 6f 75 62 6c 65 2d 63  les, so double-c
12a20 68 65 63 6b 20 69 74 73 20 72 65 73 75 6c 74 20  heck its result 
12a30 6a 75 73 74 20 74 6f 20 62 65 20 73 61 66 65 2e  just to be safe.
12a40 0a 23 0a 23 09 54 68 69 73 20 73 68 6f 75 6c 64  .#.#.This should
12a50 20 62 65 20 63 61 6c 6c 65 64 20 61 66 74 65 72   be called after
12a60 20 54 45 41 5f 43 4f 4e 46 49 47 5f 43 46 4c 41   TEA_CONFIG_CFLA
12a70 47 53 20 61 73 20 73 65 74 74 69 6e 67 20 74 68  GS as setting th
12a80 65 0a 23 09 4c 49 42 53 20 6c 69 6e 65 20 63 61  e.#.LIBS line ca
12a90 6e 20 63 6f 6e 66 75 73 65 20 73 6f 6d 65 20 63  n confuse some c
12aa0 6f 6e 66 69 67 75 72 65 20 6d 61 63 72 6f 20 6d  onfigure macro m
12ab0 61 67 69 63 2e 0a 23 0a 23 20 41 72 67 75 6d 65  agic..#.# Argume
12ac0 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20  nts:.#.none.#.# 
12ad0 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 53 65 74  Results:.#.#.Set
12ae0 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  s the following 
12af0 76 61 72 73 3a 0a 23 09 09 58 49 4e 43 4c 55 44  vars:.#..XINCLUD
12b00 45 53 0a 23 09 09 58 4c 49 42 53 57 0a 23 09 09  ES.#..XLIBSW.#..
12b10 50 4b 47 5f 4c 49 42 53 20 28 61 70 70 65 6e 64  PKG_LIBS (append
12b20 73 20 74 6f 29 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  s to).#---------
12b30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12b40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12b50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12b60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f  -----------..AC_
12b70 44 45 46 55 4e 28 5b 54 45 41 5f 50 41 54 48 5f  DEFUN([TEA_PATH_
12b80 58 5d 2c 20 5b 0a 20 20 20 20 69 66 20 74 65 73  X], [.    if tes
12b90 74 20 22 24 7b 54 45 41 5f 57 49 4e 44 4f 57 49  t "${TEA_WINDOWI
12ba0 4e 47 53 59 53 54 45 4d 7d 22 20 3d 20 22 78 31  NGSYSTEM}" = "x1
12bb0 31 22 20 3b 20 74 68 65 6e 0a 09 54 45 41 5f 50  1" ; then..TEA_P
12bc0 41 54 48 5f 55 4e 49 58 5f 58 0a 20 20 20 20 66  ATH_UNIX_X.    f
12bd0 69 0a 5d 29 0a 0a 41 43 5f 44 45 46 55 4e 28 5b  i.])..AC_DEFUN([
12be0 54 45 41 5f 50 41 54 48 5f 55 4e 49 58 5f 58 5d  TEA_PATH_UNIX_X]
12bf0 2c 20 5b 0a 20 20 20 20 41 43 5f 50 41 54 48 5f  , [.    AC_PATH_
12c00 58 0a 20 20 20 20 6e 6f 74 5f 72 65 61 6c 6c 79  X.    not_really
12c10 5f 74 68 65 72 65 3d 22 22 0a 20 20 20 20 69 66  _there="".    if
12c20 20 74 65 73 74 20 22 24 6e 6f 5f 78 22 20 3d 20   test "$no_x" = 
12c30 22 22 3b 20 74 68 65 6e 0a 09 69 66 20 74 65 73  ""; then..if tes
12c40 74 20 22 24 78 5f 69 6e 63 6c 75 64 65 73 22 20  t "$x_includes" 
12c50 3d 20 22 22 3b 20 74 68 65 6e 0a 09 20 20 20 20  = ""; then..    
12c60 41 43 5f 54 52 59 5f 43 50 50 28 5b 23 69 6e 63  AC_TRY_CPP([#inc
12c70 6c 75 64 65 20 3c 58 31 31 2f 58 6c 69 62 2e 68  lude <X11/Xlib.h
12c80 3e 5d 2c 20 2c 20 6e 6f 74 5f 72 65 61 6c 6c 79  >], , not_really
12c90 5f 74 68 65 72 65 3d 22 79 65 73 22 29 0a 09 65  _there="yes")..e
12ca0 6c 73 65 0a 09 20 20 20 20 69 66 20 74 65 73 74  lse..    if test
12cb0 20 21 20 2d 72 20 24 78 5f 69 6e 63 6c 75 64 65   ! -r $x_include
12cc0 73 2f 58 31 31 2f 58 6c 69 62 2e 68 3b 20 74 68  s/X11/Xlib.h; th
12cd0 65 6e 0a 09 09 6e 6f 74 5f 72 65 61 6c 6c 79 5f  en...not_really_
12ce0 74 68 65 72 65 3d 22 79 65 73 22 0a 09 20 20 20  there="yes"..   
12cf0 20 66 69 0a 09 66 69 0a 20 20 20 20 66 69 0a 20   fi..fi.    fi. 
12d00 20 20 20 69 66 20 74 65 73 74 20 22 24 6e 6f 5f     if test "$no_
12d10 78 22 20 3d 20 22 79 65 73 22 20 2d 6f 20 22 24  x" = "yes" -o "$
12d20 6e 6f 74 5f 72 65 61 6c 6c 79 5f 74 68 65 72 65  not_really_there
12d30 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e 0a  " = "yes"; then.
12d40 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47  .AC_MSG_CHECKING
12d50 28 5b 66 6f 72 20 58 31 31 20 68 65 61 64 65 72  ([for X11 header
12d60 20 66 69 6c 65 73 5d 29 0a 09 66 6f 75 6e 64 5f   files])..found_
12d70 78 69 6e 63 6c 75 64 65 73 3d 22 6e 6f 22 0a 09  xincludes="no"..
12d80 41 43 5f 54 52 59 5f 43 50 50 28 5b 23 69 6e 63  AC_TRY_CPP([#inc
12d90 6c 75 64 65 20 3c 58 31 31 2f 58 6c 69 62 2e 68  lude <X11/Xlib.h
12da0 3e 5d 2c 20 66 6f 75 6e 64 5f 78 69 6e 63 6c 75  >], found_xinclu
12db0 64 65 73 3d 22 79 65 73 22 2c 20 66 6f 75 6e 64  des="yes", found
12dc0 5f 78 69 6e 63 6c 75 64 65 73 3d 22 6e 6f 22 29  _xincludes="no")
12dd0 0a 09 69 66 20 74 65 73 74 20 22 24 66 6f 75 6e  ..if test "$foun
12de0 64 5f 78 69 6e 63 6c 75 64 65 73 22 20 3d 20 22  d_xincludes" = "
12df0 6e 6f 22 3b 20 74 68 65 6e 0a 09 20 20 20 20 64  no"; then..    d
12e00 69 72 73 3d 22 2f 75 73 72 2f 75 6e 73 75 70 70  irs="/usr/unsupp
12e10 6f 72 74 65 64 2f 69 6e 63 6c 75 64 65 20 2f 75  orted/include /u
12e20 73 72 2f 6c 6f 63 61 6c 2f 69 6e 63 6c 75 64 65  sr/local/include
12e30 20 2f 75 73 72 2f 58 33 38 36 2f 69 6e 63 6c 75   /usr/X386/inclu
12e40 64 65 20 2f 75 73 72 2f 58 31 31 52 36 2f 69 6e  de /usr/X11R6/in
12e50 63 6c 75 64 65 20 2f 75 73 72 2f 58 31 31 52 35  clude /usr/X11R5
12e60 2f 69 6e 63 6c 75 64 65 20 2f 75 73 72 2f 69 6e  /include /usr/in
12e70 63 6c 75 64 65 2f 58 31 31 52 35 20 2f 75 73 72  clude/X11R5 /usr
12e80 2f 69 6e 63 6c 75 64 65 2f 58 31 31 52 34 20 2f  /include/X11R4 /
12e90 75 73 72 2f 6f 70 65 6e 77 69 6e 2f 69 6e 63 6c  usr/openwin/incl
12ea0 75 64 65 20 2f 75 73 72 2f 58 31 31 2f 69 6e 63  ude /usr/X11/inc
12eb0 6c 75 64 65 20 2f 75 73 72 2f 73 77 77 2f 69 6e  lude /usr/sww/in
12ec0 63 6c 75 64 65 22 0a 09 20 20 20 20 66 6f 72 20  clude"..    for 
12ed0 69 20 69 6e 20 24 64 69 72 73 20 3b 20 64 6f 0a  i in $dirs ; do.
12ee0 09 09 69 66 20 74 65 73 74 20 2d 72 20 24 69 2f  ..if test -r $i/
12ef0 58 31 31 2f 58 6c 69 62 2e 68 3b 20 74 68 65 6e  X11/Xlib.h; then
12f00 0a 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 52 45  ...    AC_MSG_RE
12f10 53 55 4c 54 28 5b 24 69 5d 29 0a 09 09 20 20 20  SULT([$i])...   
12f20 20 58 49 4e 43 4c 55 44 45 53 3d 22 20 2d 49 24   XINCLUDES=" -I$
12f30 69 22 0a 09 09 20 20 20 20 66 6f 75 6e 64 5f 78  i"...    found_x
12f40 69 6e 63 6c 75 64 65 73 3d 22 79 65 73 22 0a 09  includes="yes"..
12f50 09 20 20 20 20 62 72 65 61 6b 0a 09 09 66 69 0a  .    break...fi.
12f60 09 20 20 20 20 64 6f 6e 65 0a 09 66 69 0a 20 20  .    done..fi.  
12f70 20 20 65 6c 73 65 0a 09 69 66 20 74 65 73 74 20    else..if test 
12f80 22 24 78 5f 69 6e 63 6c 75 64 65 73 22 20 21 3d  "$x_includes" !=
12f90 20 22 22 3b 20 74 68 65 6e 0a 09 20 20 20 20 58   ""; then..    X
12fa0 49 4e 43 4c 55 44 45 53 3d 22 2d 49 24 78 5f 69  INCLUDES="-I$x_i
12fb0 6e 63 6c 75 64 65 73 22 0a 09 20 20 20 20 66 6f  ncludes"..    fo
12fc0 75 6e 64 5f 78 69 6e 63 6c 75 64 65 73 3d 22 79  und_xincludes="y
12fd0 65 73 22 0a 09 66 69 0a 20 20 20 20 66 69 0a 20  es"..fi.    fi. 
12fe0 20 20 20 69 66 20 74 65 73 74 20 22 24 66 6f 75     if test "$fou
12ff0 6e 64 5f 78 69 6e 63 6c 75 64 65 73 22 20 3d 20  nd_xincludes" = 
13000 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 41 43 5f 4d  "no"; then..AC_M
13010 53 47 5f 52 45 53 55 4c 54 28 5b 63 6f 75 6c 64  SG_RESULT([could
13020 6e 27 74 20 66 69 6e 64 20 61 6e 79 21 5d 29 0a  n't find any!]).
13030 20 20 20 20 66 69 0a 0a 20 20 20 20 69 66 20 74      fi..    if t
13040 65 73 74 20 22 24 6e 6f 5f 78 22 20 3d 20 79 65  est "$no_x" = ye
13050 73 3b 20 74 68 65 6e 0a 09 41 43 5f 4d 53 47 5f  s; then..AC_MSG_
13060 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 58 31  CHECKING([for X1
13070 31 20 6c 69 62 72 61 72 69 65 73 5d 29 0a 09 58  1 libraries])..X
13080 4c 49 42 53 57 3d 6e 6f 70 65 0a 09 64 69 72 73  LIBSW=nope..dirs
13090 3d 22 2f 75 73 72 2f 75 6e 73 75 70 70 6f 72 74  ="/usr/unsupport
130a0 65 64 2f 6c 69 62 20 2f 75 73 72 2f 6c 6f 63 61  ed/lib /usr/loca
130b0 6c 2f 6c 69 62 20 2f 75 73 72 2f 58 33 38 36 2f  l/lib /usr/X386/
130c0 6c 69 62 20 2f 75 73 72 2f 58 31 31 52 36 2f 6c  lib /usr/X11R6/l
130d0 69 62 20 2f 75 73 72 2f 58 31 31 52 35 2f 6c 69  ib /usr/X11R5/li
130e0 62 20 2f 75 73 72 2f 6c 69 62 2f 58 31 31 52 35  b /usr/lib/X11R5
130f0 20 2f 75 73 72 2f 6c 69 62 2f 58 31 31 52 34 20   /usr/lib/X11R4 
13100 2f 75 73 72 2f 6f 70 65 6e 77 69 6e 2f 6c 69 62  /usr/openwin/lib
13110 20 2f 75 73 72 2f 58 31 31 2f 6c 69 62 20 2f 75   /usr/X11/lib /u
13120 73 72 2f 73 77 77 2f 58 31 31 2f 6c 69 62 22 0a  sr/sww/X11/lib".
13130 09 66 6f 72 20 69 20 69 6e 20 24 64 69 72 73 20  .for i in $dirs 
13140 3b 20 64 6f 0a 09 20 20 20 20 69 66 20 74 65 73  ; do..    if tes
13150 74 20 2d 72 20 24 69 2f 6c 69 62 58 31 31 2e 61  t -r $i/libX11.a
13160 20 2d 6f 20 2d 72 20 24 69 2f 6c 69 62 58 31 31   -o -r $i/libX11
13170 2e 73 6f 20 2d 6f 20 2d 72 20 24 69 2f 6c 69 62  .so -o -r $i/lib
13180 58 31 31 2e 73 6c 20 2d 6f 20 2d 72 20 24 69 2f  X11.sl -o -r $i/
13190 6c 69 62 58 31 31 2e 64 79 6c 69 62 3b 20 74 68  libX11.dylib; th
131a0 65 6e 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55  en...AC_MSG_RESU
131b0 4c 54 28 5b 24 69 5d 29 0a 09 09 58 4c 49 42 53  LT([$i])...XLIBS
131c0 57 3d 22 2d 4c 24 69 20 2d 6c 58 31 31 22 0a 09  W="-L$i -lX11"..
131d0 09 78 5f 6c 69 62 72 61 72 69 65 73 3d 22 24 69  .x_libraries="$i
131e0 22 0a 09 09 62 72 65 61 6b 0a 09 20 20 20 20 66  "...break..    f
131f0 69 0a 09 64 6f 6e 65 0a 20 20 20 20 65 6c 73 65  i..done.    else
13200 0a 09 69 66 20 74 65 73 74 20 22 24 78 5f 6c 69  ..if test "$x_li
13210 62 72 61 72 69 65 73 22 20 3d 20 22 22 3b 20 74  braries" = ""; t
13220 68 65 6e 0a 09 20 20 20 20 58 4c 49 42 53 57 3d  hen..    XLIBSW=
13230 2d 6c 58 31 31 0a 09 65 6c 73 65 0a 09 20 20 20  -lX11..else..   
13240 20 58 4c 49 42 53 57 3d 22 2d 4c 24 78 5f 6c 69   XLIBSW="-L$x_li
13250 62 72 61 72 69 65 73 20 2d 6c 58 31 31 22 0a 09  braries -lX11"..
13260 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  fi.    fi.    if
13270 20 74 65 73 74 20 22 24 58 4c 49 42 53 57 22 20   test "$XLIBSW" 
13280 3d 20 6e 6f 70 65 20 3b 20 74 68 65 6e 0a 09 41  = nope ; then..A
13290 43 5f 43 48 45 43 4b 5f 4c 49 42 28 58 77 69 6e  C_CHECK_LIB(Xwin
132a0 64 6f 77 2c 20 58 43 72 65 61 74 65 57 69 6e 64  dow, XCreateWind
132b0 6f 77 2c 20 58 4c 49 42 53 57 3d 2d 6c 58 77 69  ow, XLIBSW=-lXwi
132c0 6e 64 6f 77 29 0a 20 20 20 20 66 69 0a 20 20 20  ndow).    fi.   
132d0 20 69 66 20 74 65 73 74 20 22 24 58 4c 49 42 53   if test "$XLIBS
132e0 57 22 20 3d 20 6e 6f 70 65 20 3b 20 74 68 65 6e  W" = nope ; then
132f0 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28  ..AC_MSG_RESULT(
13300 5b 63 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64 20  [could not find 
13310 61 6e 79 21 20 20 55 73 69 6e 67 20 2d 6c 58 31  any!  Using -lX1
13320 31 2e 5d 29 0a 09 58 4c 49 42 53 57 3d 2d 6c 58  1.])..XLIBSW=-lX
13330 31 31 0a 20 20 20 20 66 69 0a 20 20 20 20 23 20  11.    fi.    # 
13340 54 45 41 20 73 70 65 63 69 66 69 63 3a 0a 20 20  TEA specific:.  
13350 20 20 69 66 20 74 65 73 74 20 78 22 24 7b 58 4c    if test x"${XL
13360 49 42 53 57 7d 22 20 21 3d 20 78 20 3b 20 74 68  IBSW}" != x ; th
13370 65 6e 0a 09 50 4b 47 5f 4c 49 42 53 3d 22 24 7b  en..PKG_LIBS="${
13380 50 4b 47 5f 4c 49 42 53 7d 20 24 7b 58 4c 49 42  PKG_LIBS} ${XLIB
13390 53 57 7d 22 0a 20 20 20 20 66 69 0a 5d 29 0a 0a  SW}".    fi.])..
133a0 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
133b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
133c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
133d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
133e0 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f 42 4c 4f 43  -----.# TEA_BLOC
133f0 4b 49 4e 47 5f 53 54 59 4c 45 0a 23 0a 23 09 54  KING_STYLE.#.#.T
13400 68 65 20 73 74 61 74 65 6d 65 6e 74 73 20 62 65  he statements be
13410 6c 6f 77 20 63 68 65 63 6b 20 66 6f 72 20 73 79  low check for sy
13420 73 74 65 6d 73 20 77 68 65 72 65 20 50 4f 53 49  stems where POSI
13430 58 2d 73 74 79 6c 65 0a 23 09 6e 6f 6e 2d 62 6c  X-style.#.non-bl
13440 6f 63 6b 69 6e 67 20 49 2f 4f 20 28 4f 5f 4e 4f  ocking I/O (O_NO
13450 4e 42 4c 4f 43 4b 29 20 64 6f 65 73 6e 27 74 20  NBLOCK) doesn't 
13460 77 6f 72 6b 20 6f 72 20 69 73 20 75 6e 69 6d 70  work or is unimp
13470 6c 65 6d 65 6e 74 65 64 2e 0a 23 09 4f 6e 20 74  lemented..#.On t
13480 68 65 73 65 20 73 79 73 74 65 6d 73 20 28 6d 6f  hese systems (mo
13490 73 74 6c 79 20 6f 6c 64 65 72 20 6f 6e 65 73 29  stly older ones)
134a0 2c 20 75 73 65 20 74 68 65 20 6f 6c 64 20 42 53  , use the old BS
134b0 44 2d 73 74 79 6c 65 0a 23 09 46 49 4f 4e 42 49  D-style.#.FIONBI
134c0 4f 20 61 70 70 72 6f 61 63 68 20 69 6e 73 74 65  O approach inste
134d0 61 64 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74  ad..#.# Argument
134e0 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65  s:.#.none.#.# Re
134f0 73 75 6c 74 73 3a 0a 23 0a 23 09 44 65 66 69 6e  sults:.#.#.Defin
13500 65 73 20 73 6f 6d 65 20 6f 66 20 74 68 65 20 66  es some of the f
13510 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23  ollowing vars:.#
13520 09 09 48 41 56 45 5f 53 59 53 5f 49 4f 43 54 4c  ..HAVE_SYS_IOCTL
13530 5f 48 0a 23 09 09 48 41 56 45 5f 53 59 53 5f 46  _H.#..HAVE_SYS_F
13540 49 4c 49 4f 5f 48 0a 23 09 09 55 53 45 5f 46 49  ILIO_H.#..USE_FI
13550 4f 4e 42 49 4f 0a 23 09 09 4f 5f 4e 4f 4e 42 4c  ONBIO.#..O_NONBL
13560 4f 43 4b 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  OCK.#-----------
13570 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13580 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13590 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
135a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
135b0 46 55 4e 28 5b 54 45 41 5f 42 4c 4f 43 4b 49 4e  FUN([TEA_BLOCKIN
135c0 47 5f 53 54 59 4c 45 5d 2c 20 5b 0a 20 20 20 20  G_STYLE], [.    
135d0 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 53  AC_CHECK_HEADERS
135e0 28 73 79 73 2f 69 6f 63 74 6c 2e 68 29 0a 20 20  (sys/ioctl.h).  
135f0 20 20 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45    AC_CHECK_HEADE
13600 52 53 28 73 79 73 2f 66 69 6c 69 6f 2e 68 29 0a  RS(sys/filio.h).
13610 20 20 20 20 54 45 41 5f 43 4f 4e 46 49 47 5f 53      TEA_CONFIG_S
13620 59 53 54 45 4d 0a 20 20 20 20 41 43 5f 4d 53 47  YSTEM.    AC_MSG
13630 5f 43 48 45 43 4b 49 4e 47 28 5b 46 49 4f 4e 42  _CHECKING([FIONB
13640 49 4f 20 76 73 2e 20 4f 5f 4e 4f 4e 42 4c 4f 43  IO vs. O_NONBLOC
13650 4b 20 66 6f 72 20 6e 6f 6e 62 6c 6f 63 6b 69 6e  K for nonblockin
13660 67 20 49 2f 4f 5d 29 0a 20 20 20 20 63 61 73 65  g I/O]).    case
13670 20 24 73 79 73 74 65 6d 20 69 6e 0a 09 4f 53 46   $system in..OSF
13680 2a 29 0a 09 20 20 20 20 41 43 5f 44 45 46 49 4e  *)..    AC_DEFIN
13690 45 28 55 53 45 5f 46 49 4f 4e 42 49 4f 2c 20 31  E(USE_FIONBIO, 1
136a0 2c 20 5b 53 68 6f 75 6c 64 20 77 65 20 75 73 65  , [Should we use
136b0 20 46 49 4f 4e 42 49 4f 3f 5d 29 0a 09 20 20 20   FIONBIO?])..   
136c0 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b   AC_MSG_RESULT([
136d0 46 49 4f 4e 42 49 4f 5d 29 0a 09 20 20 20 20 3b  FIONBIO])..    ;
136e0 3b 0a 09 2a 29 0a 09 20 20 20 20 41 43 5f 4d 53  ;..*)..    AC_MS
136f0 47 5f 52 45 53 55 4c 54 28 5b 4f 5f 4e 4f 4e 42  G_RESULT([O_NONB
13700 4c 4f 43 4b 5d 29 0a 09 20 20 20 20 3b 3b 0a 20  LOCK])..    ;;. 
13710 20 20 20 65 73 61 63 0a 5d 29 0a 0a 23 2d 2d 2d     esac.])..#---
13720 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13730 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13740 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13750 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13760 2d 0a 23 20 54 45 41 5f 54 49 4d 45 5f 48 41 4e  -.# TEA_TIME_HAN
13770 44 4c 45 52 0a 23 0a 23 09 43 68 65 63 6b 73 20  DLER.#.#.Checks 
13780 68 6f 77 20 74 68 65 20 73 79 73 74 65 6d 20 64  how the system d
13790 65 61 6c 73 20 77 69 74 68 20 74 69 6d 65 2e 68  eals with time.h
137a0 2c 20 77 68 61 74 20 74 69 6d 65 20 73 74 72 75  , what time stru
137b0 63 74 75 72 65 73 0a 23 09 61 72 65 20 75 73 65  ctures.#.are use
137c0 64 20 6f 6e 20 74 68 65 20 73 79 73 74 65 6d 2c  d on the system,
137d0 20 61 6e 64 20 77 68 61 74 20 66 69 65 6c 64 73   and what fields
137e0 20 74 68 65 20 73 74 72 75 63 74 75 72 65 73 20   the structures 
137f0 68 61 76 65 2e 0a 23 0a 23 20 41 72 67 75 6d 65  have..#.# Argume
13800 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20  nts:.#.none.#.# 
13810 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 44 65 66  Results:.#.#.Def
13820 69 6e 65 73 20 73 6f 6d 65 20 6f 66 20 74 68 65  ines some of the
13830 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a   following vars:
13840 0a 23 09 09 55 53 45 5f 44 45 4c 54 41 5f 46 4f  .#..USE_DELTA_FO
13850 52 5f 54 5a 0a 23 09 09 48 41 56 45 5f 54 4d 5f  R_TZ.#..HAVE_TM_
13860 47 4d 54 4f 46 46 0a 23 09 09 48 41 56 45 5f 54  GMTOFF.#..HAVE_T
13870 4d 5f 54 5a 41 44 4a 0a 23 09 09 48 41 56 45 5f  M_TZADJ.#..HAVE_
13880 54 49 4d 45 5a 4f 4e 45 5f 56 41 52 0a 23 2d 2d  TIMEZONE_VAR.#--
13890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
138a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
138b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
138c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
138d0 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45  --..AC_DEFUN([TE
138e0 41 5f 54 49 4d 45 5f 48 41 4e 44 4c 45 52 5d 2c  A_TIME_HANDLER],
138f0 20 5b 0a 20 20 20 20 41 43 5f 43 48 45 43 4b 5f   [.    AC_CHECK_
13900 48 45 41 44 45 52 53 28 73 79 73 2f 74 69 6d 65  HEADERS(sys/time
13910 2e 68 29 0a 20 20 20 20 41 43 5f 48 45 41 44 45  .h).    AC_HEADE
13920 52 5f 54 49 4d 45 0a 20 20 20 20 41 43 5f 53 54  R_TIME.    AC_ST
13930 52 55 43 54 5f 54 49 4d 45 5a 4f 4e 45 0a 0a 20  RUCT_TIMEZONE.. 
13940 20 20 20 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43     AC_CHECK_FUNC
13950 53 28 67 6d 74 69 6d 65 5f 72 20 6c 6f 63 61 6c  S(gmtime_r local
13960 74 69 6d 65 5f 72 29 0a 0a 20 20 20 20 41 43 5f  time_r)..    AC_
13970 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 74 6d 5f  CACHE_CHECK([tm_
13980 74 7a 61 64 6a 20 69 6e 20 73 74 72 75 63 74 20  tzadj in struct 
13990 74 6d 5d 2c 20 74 63 6c 5f 63 76 5f 6d 65 6d 62  tm], tcl_cv_memb
139a0 65 72 5f 74 6d 5f 74 7a 61 64 6a 2c 20 5b 0a 09  er_tm_tzadj, [..
139b0 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b  AC_TRY_COMPILE([
139c0 23 69 6e 63 6c 75 64 65 20 3c 74 69 6d 65 2e 68  #include <time.h
139d0 3e 5d 2c 20 5b 73 74 72 75 63 74 20 74 6d 20 74  >], [struct tm t
139e0 6d 3b 20 74 6d 2e 74 6d 5f 74 7a 61 64 6a 3b 5d  m; tm.tm_tzadj;]
139f0 2c 0a 09 20 20 20 20 74 63 6c 5f 63 76 5f 6d 65  ,..    tcl_cv_me
13a00 6d 62 65 72 5f 74 6d 5f 74 7a 61 64 6a 3d 79 65  mber_tm_tzadj=ye
13a10 73 2c 20 74 63 6c 5f 63 76 5f 6d 65 6d 62 65 72  s, tcl_cv_member
13a20 5f 74 6d 5f 74 7a 61 64 6a 3d 6e 6f 29 5d 29 0a  _tm_tzadj=no)]).
13a30 20 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c      if test $tcl
13a40 5f 63 76 5f 6d 65 6d 62 65 72 5f 74 6d 5f 74 7a  _cv_member_tm_tz
13a50 61 64 6a 20 3d 20 79 65 73 20 3b 20 74 68 65 6e  adj = yes ; then
13a60 0a 09 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45  ..AC_DEFINE(HAVE
13a70 5f 54 4d 5f 54 5a 41 44 4a 2c 20 31 2c 20 5b 53  _TM_TZADJ, 1, [S
13a80 68 6f 75 6c 64 20 77 65 20 75 73 65 20 74 68 65  hould we use the
13a90 20 74 6d 5f 74 7a 61 64 6a 20 66 69 65 6c 64 20   tm_tzadj field 
13aa0 6f 66 20 73 74 72 75 63 74 20 74 6d 3f 5d 29 0a  of struct tm?]).
13ab0 20 20 20 20 66 69 0a 0a 20 20 20 20 41 43 5f 43      fi..    AC_C
13ac0 41 43 48 45 5f 43 48 45 43 4b 28 5b 74 6d 5f 67  ACHE_CHECK([tm_g
13ad0 6d 74 6f 66 66 20 69 6e 20 73 74 72 75 63 74 20  mtoff in struct 
13ae0 74 6d 5d 2c 20 74 63 6c 5f 63 76 5f 6d 65 6d 62  tm], tcl_cv_memb
13af0 65 72 5f 74 6d 5f 67 6d 74 6f 66 66 2c 20 5b 0a  er_tm_gmtoff, [.
13b00 09 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28  .AC_TRY_COMPILE(
13b10 5b 23 69 6e 63 6c 75 64 65 20 3c 74 69 6d 65 2e  [#include <time.
13b20 68 3e 5d 2c 20 5b 73 74 72 75 63 74 20 74 6d 20  h>], [struct tm 
13b30 74 6d 3b 20 74 6d 2e 74 6d 5f 67 6d 74 6f 66 66  tm; tm.tm_gmtoff
13b40 3b 5d 2c 0a 09 20 20 20 20 74 63 6c 5f 63 76 5f  ;],..    tcl_cv_
13b50 6d 65 6d 62 65 72 5f 74 6d 5f 67 6d 74 6f 66 66  member_tm_gmtoff
13b60 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f 6d 65 6d  =yes, tcl_cv_mem
13b70 62 65 72 5f 74 6d 5f 67 6d 74 6f 66 66 3d 6e 6f  ber_tm_gmtoff=no
13b80 29 5d 29 0a 20 20 20 20 69 66 20 74 65 73 74 20  )]).    if test 
13b90 24 74 63 6c 5f 63 76 5f 6d 65 6d 62 65 72 5f 74  $tcl_cv_member_t
13ba0 6d 5f 67 6d 74 6f 66 66 20 3d 20 79 65 73 20 3b  m_gmtoff = yes ;
13bb0 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45   then..AC_DEFINE
13bc0 28 48 41 56 45 5f 54 4d 5f 47 4d 54 4f 46 46 2c  (HAVE_TM_GMTOFF,
13bd0 20 31 2c 20 5b 53 68 6f 75 6c 64 20 77 65 20 75   1, [Should we u
13be0 73 65 20 74 68 65 20 74 6d 5f 67 6d 74 6f 66 66  se the tm_gmtoff
13bf0 20 66 69 65 6c 64 20 6f 66 20 73 74 72 75 63 74   field of struct
13c00 20 74 6d 3f 5d 29 0a 20 20 20 20 66 69 0a 0a 20   tm?]).    fi.. 
13c10 20 20 20 23 0a 20 20 20 20 23 20 49 74 73 20 69     #.    # Its i
13c20 6d 70 6f 72 74 61 6e 74 20 74 6f 20 69 6e 63 6c  mportant to incl
13c30 75 64 65 20 74 69 6d 65 2e 68 20 69 6e 20 74 68  ude time.h in th
13c40 69 73 20 63 68 65 63 6b 2c 20 61 73 20 73 6f 6d  is check, as som
13c50 65 20 73 79 73 74 65 6d 73 0a 20 20 20 20 23 20  e systems.    # 
13c60 28 6c 69 6b 65 20 63 6f 6e 76 65 78 29 20 68 61  (like convex) ha
13c70 76 65 20 74 69 6d 65 7a 6f 6e 65 20 66 75 6e 63  ve timezone func
13c80 74 69 6f 6e 73 2c 20 65 74 63 2e 0a 20 20 20 20  tions, etc..    
13c90 23 0a 20 20 20 20 41 43 5f 43 41 43 48 45 5f 43  #.    AC_CACHE_C
13ca0 48 45 43 4b 28 5b 6c 6f 6e 67 20 74 69 6d 65 7a  HECK([long timez
13cb0 6f 6e 65 20 76 61 72 69 61 62 6c 65 5d 2c 20 74  one variable], t
13cc0 63 6c 5f 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f 6c  cl_cv_timezone_l
13cd0 6f 6e 67 2c 20 5b 0a 09 41 43 5f 54 52 59 5f 43  ong, [..AC_TRY_C
13ce0 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c 75 64 65  OMPILE([#include
13cf0 20 3c 74 69 6d 65 2e 68 3e 5d 2c 0a 09 20 20 20   <time.h>],..   
13d00 20 5b 65 78 74 65 72 6e 20 6c 6f 6e 67 20 74 69   [extern long ti
13d10 6d 65 7a 6f 6e 65 3b 0a 09 20 20 20 20 74 69 6d  mezone;..    tim
13d20 65 7a 6f 6e 65 20 2b 3d 20 31 3b 0a 09 20 20 20  ezone += 1;..   
13d30 20 65 78 69 74 20 28 30 29 3b 5d 2c 0a 09 20 20   exit (0);],..  
13d40 20 20 74 63 6c 5f 63 76 5f 74 69 6d 65 7a 6f 6e    tcl_cv_timezon
13d50 65 5f 6c 6f 6e 67 3d 79 65 73 2c 20 74 63 6c 5f  e_long=yes, tcl_
13d60 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f 6c 6f 6e 67  cv_timezone_long
13d70 3d 6e 6f 29 5d 29 0a 20 20 20 20 69 66 20 74 65  =no)]).    if te
13d80 73 74 20 24 74 63 6c 5f 63 76 5f 74 69 6d 65 7a  st $tcl_cv_timez
13d90 6f 6e 65 5f 6c 6f 6e 67 20 3d 20 79 65 73 20 3b  one_long = yes ;
13da0 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45   then..AC_DEFINE
13db0 28 48 41 56 45 5f 54 49 4d 45 5a 4f 4e 45 5f 56  (HAVE_TIMEZONE_V
13dc0 41 52 2c 20 31 2c 20 5b 53 68 6f 75 6c 64 20 77  AR, 1, [Should w
13dd0 65 20 75 73 65 20 74 68 65 20 67 6c 6f 62 61 6c  e use the global
13de0 20 74 69 6d 65 7a 6f 6e 65 20 76 61 72 69 61 62   timezone variab
13df0 6c 65 3f 5d 29 0a 20 20 20 20 65 6c 73 65 0a 09  le?]).    else..
13e00 23 0a 09 23 20 4f 6e 20 73 6f 6d 65 20 73 79 73  #..# On some sys
13e10 74 65 6d 73 20 28 65 67 20 49 52 49 58 20 36 2e  tems (eg IRIX 6.
13e20 32 29 2c 20 74 69 6d 65 7a 6f 6e 65 20 69 73 20  2), timezone is 
13e30 61 20 74 69 6d 65 5f 74 20 61 6e 64 20 6e 6f 74  a time_t and not
13e40 20 61 20 6c 6f 6e 67 2e 0a 09 23 0a 09 41 43 5f   a long...#..AC_
13e50 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 74 69 6d  CACHE_CHECK([tim
13e60 65 5f 74 20 74 69 6d 65 7a 6f 6e 65 20 76 61 72  e_t timezone var
13e70 69 61 62 6c 65 5d 2c 20 74 63 6c 5f 63 76 5f 74  iable], tcl_cv_t
13e80 69 6d 65 7a 6f 6e 65 5f 74 69 6d 65 2c 20 5b 0a  imezone_time, [.
13e90 09 20 20 20 20 41 43 5f 54 52 59 5f 43 4f 4d 50  .    AC_TRY_COMP
13ea0 49 4c 45 28 5b 23 69 6e 63 6c 75 64 65 20 3c 74  ILE([#include <t
13eb0 69 6d 65 2e 68 3e 5d 2c 0a 09 09 5b 65 78 74 65  ime.h>],...[exte
13ec0 72 6e 20 74 69 6d 65 5f 74 20 74 69 6d 65 7a 6f  rn time_t timezo
13ed0 6e 65 3b 0a 09 09 74 69 6d 65 7a 6f 6e 65 20 2b  ne;...timezone +
13ee0 3d 20 31 3b 0a 09 09 65 78 69 74 20 28 30 29 3b  = 1;...exit (0);
13ef0 5d 2c 0a 09 09 74 63 6c 5f 63 76 5f 74 69 6d 65  ],...tcl_cv_time
13f00 7a 6f 6e 65 5f 74 69 6d 65 3d 79 65 73 2c 20 74  zone_time=yes, t
13f10 63 6c 5f 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f 74  cl_cv_timezone_t
13f20 69 6d 65 3d 6e 6f 29 5d 29 0a 09 69 66 20 74 65  ime=no)])..if te
13f30 73 74 20 24 74 63 6c 5f 63 76 5f 74 69 6d 65 7a  st $tcl_cv_timez
13f40 6f 6e 65 5f 74 69 6d 65 20 3d 20 79 65 73 20 3b  one_time = yes ;
13f50 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 44 45   then..    AC_DE
13f60 46 49 4e 45 28 48 41 56 45 5f 54 49 4d 45 5a 4f  FINE(HAVE_TIMEZO
13f70 4e 45 5f 56 41 52 2c 20 31 2c 20 5b 53 68 6f 75  NE_VAR, 1, [Shou
13f80 6c 64 20 77 65 20 75 73 65 20 74 68 65 20 67 6c  ld we use the gl
13f90 6f 62 61 6c 20 74 69 6d 65 7a 6f 6e 65 20 76 61  obal timezone va
13fa0 72 69 61 62 6c 65 3f 5d 29 0a 09 66 69 0a 20 20  riable?])..fi.  
13fb0 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d    fi.])..#------
13fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13fd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13fe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13ff0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
14000 20 54 45 41 5f 42 55 47 47 59 5f 53 54 52 54 4f   TEA_BUGGY_STRTO
14010 44 0a 23 0a 23 09 55 6e 64 65 72 20 53 6f 6c 61  D.#.#.Under Sola
14020 72 69 73 20 32 2e 34 2c 20 73 74 72 74 6f 64 20  ris 2.4, strtod 
14030 72 65 74 75 72 6e 73 20 74 68 65 20 77 72 6f 6e  returns the wron
14040 67 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 0a  g value for the.
14050 23 09 74 65 72 6d 69 6e 61 74 69 6e 67 20 63 68  #.terminating ch
14060 61 72 61 63 74 65 72 20 75 6e 64 65 72 20 73 6f  aracter under so
14070 6d 65 20 63 6f 6e 64 69 74 69 6f 6e 73 2e 20 20  me conditions.  
14080 43 68 65 63 6b 20 66 6f 72 20 74 68 69 73 0a 23  Check for this.#
14090 09 61 6e 64 20 69 66 20 74 68 65 20 70 72 6f 62  .and if the prob
140a0 6c 65 6d 20 65 78 69 73 74 73 20 75 73 65 20 61  lem exists use a
140b0 20 73 75 62 73 74 69 74 75 74 65 20 70 72 6f 63   substitute proc
140c0 65 64 75 72 65 0a 23 09 22 66 69 78 73 74 72 74  edure.#."fixstrt
140d0 6f 64 22 20 28 70 72 6f 76 69 64 65 64 20 62 79  od" (provided by
140e0 20 54 63 6c 29 20 74 68 61 74 20 63 6f 72 72 65   Tcl) that corre
140f0 63 74 73 20 74 68 65 20 65 72 72 6f 72 2e 0a 23  cts the error..#
14100 09 41 6c 73 6f 2c 20 6f 6e 20 43 6f 6d 70 61 71  .Also, on Compaq
14110 27 73 20 54 72 75 36 34 20 55 6e 69 78 20 35 2e  's Tru64 Unix 5.
14120 30 2c 0a 23 09 73 74 72 74 6f 64 28 22 20 22 29  0,.#.strtod(" ")
14130 20 72 65 74 75 72 6e 73 20 30 2e 30 20 69 6e 73   returns 0.0 ins
14140 74 65 61 64 20 6f 66 20 61 20 66 61 69 6c 75 72  tead of a failur
14150 65 20 74 6f 20 63 6f 6e 76 65 72 74 2e 0a 23 0a  e to convert..#.
14160 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e  # Arguments:.#.n
14170 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a  one.#.# Results:
14180 0a 23 0a 23 09 4d 69 67 68 74 20 64 65 66 69 6e  .#.#.Might defin
14190 65 73 20 73 6f 6d 65 20 6f 66 20 74 68 65 20 66  es some of the f
141a0 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23  ollowing vars:.#
141b0 09 09 73 74 72 74 6f 64 20 28 3d 66 69 78 73 74  ..strtod (=fixst
141c0 72 74 6f 64 29 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  rtod).#---------
141d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
141e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
141f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14200 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f  -----------..AC_
14210 44 45 46 55 4e 28 5b 54 45 41 5f 42 55 47 47 59  DEFUN([TEA_BUGGY
14220 5f 53 54 52 54 4f 44 5d 2c 20 5b 0a 20 20 20 20  _STRTOD], [.    
14230 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 73 74  AC_CHECK_FUNC(st
14240 72 74 6f 64 2c 20 74 63 6c 5f 73 74 72 74 6f 64  rtod, tcl_strtod
14250 3d 31 2c 20 74 63 6c 5f 73 74 72 74 6f 64 3d 30  =1, tcl_strtod=0
14260 29 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24  ).    if test "$
14270 74 63 6c 5f 73 74 72 74 6f 64 22 20 3d 20 31 3b  tcl_strtod" = 1;
14280 20 74 68 65 6e 0a 09 41 43 5f 43 41 43 48 45 5f   then..AC_CACHE_
14290 43 48 45 43 4b 28 5b 66 6f 72 20 53 6f 6c 61 72  CHECK([for Solar
142a0 69 73 32 2e 34 2f 54 72 75 36 34 20 73 74 72 74  is2.4/Tru64 strt
142b0 6f 64 20 62 75 67 73 5d 2c 20 74 63 6c 5f 63 76  od bugs], tcl_cv
142c0 5f 73 74 72 74 6f 64 5f 62 75 67 67 79 2c 5b 0a  _strtod_buggy,[.
142d0 09 20 20 20 20 41 43 5f 54 52 59 5f 52 55 4e 28  .    AC_TRY_RUN(
142e0 5b 0a 09 09 65 78 74 65 72 6e 20 64 6f 75 62 6c  [...extern doubl
142f0 65 20 73 74 72 74 6f 64 28 29 3b 0a 09 09 69 6e  e strtod();...in
14300 74 20 6d 61 69 6e 28 29 20 7b 0a 09 09 20 20 20  t main() {...   
14310 20 63 68 61 72 20 2a 69 6e 66 53 74 72 69 6e 67   char *infString
14320 3d 22 49 6e 66 22 2c 20 2a 6e 61 6e 53 74 72 69  ="Inf", *nanStri
14330 6e 67 3d 22 4e 61 4e 22 2c 20 2a 73 70 61 63 65  ng="NaN", *space
14340 53 74 72 69 6e 67 3d 22 20 22 3b 0a 09 09 20 20  String=" ";...  
14350 20 20 63 68 61 72 20 2a 74 65 72 6d 3b 0a 09 09    char *term;...
14360 20 20 20 20 64 6f 75 62 6c 65 20 76 61 6c 75 65      double value
14370 3b 0a 09 09 20 20 20 20 76 61 6c 75 65 20 3d 20  ;...    value = 
14380 73 74 72 74 6f 64 28 69 6e 66 53 74 72 69 6e 67  strtod(infString
14390 2c 20 26 74 65 72 6d 29 3b 0a 09 09 20 20 20 20  , &term);...    
143a0 69 66 20 28 28 74 65 72 6d 20 21 3d 20 69 6e 66  if ((term != inf
143b0 53 74 72 69 6e 67 29 20 26 26 20 28 74 65 72 6d  String) && (term
143c0 5b 2d 31 5d 20 3d 3d 20 30 29 29 20 7b 0a 09 09  [-1] == 0)) {...
143d0 09 65 78 69 74 28 31 29 3b 0a 09 09 20 20 20 20  .exit(1);...    
143e0 7d 0a 09 09 20 20 20 20 76 61 6c 75 65 20 3d 20  }...    value = 
143f0 73 74 72 74 6f 64 28 6e 61 6e 53 74 72 69 6e 67  strtod(nanString
14400 2c 20 26 74 65 72 6d 29 3b 0a 09 09 20 20 20 20  , &term);...    
14410 69 66 20 28 28 74 65 72 6d 20 21 3d 20 6e 61 6e  if ((term != nan
14420 53 74 72 69 6e 67 29 20 26 26 20 28 74 65 72 6d  String) && (term
14430 5b 2d 31 5d 20 3d 3d 20 30 29 29 20 7b 0a 09 09  [-1] == 0)) {...
14440 09 65 78 69 74 28 31 29 3b 0a 09 09 20 20 20 20  .exit(1);...    
14450 7d 0a 09 09 20 20 20 20 76 61 6c 75 65 20 3d 20  }...    value = 
14460 73 74 72 74 6f 64 28 73 70 61 63 65 53 74 72 69  strtod(spaceStri
14470 6e 67 2c 20 26 74 65 72 6d 29 3b 0a 09 09 20 20  ng, &term);...  
14480 20 20 69 66 20 28 74 65 72 6d 20 3d 3d 20 28 73    if (term == (s
14490 70 61 63 65 53 74 72 69 6e 67 2b 31 29 29 20 7b  paceString+1)) {
144a0 0a 09 09 09 65 78 69 74 28 31 29 3b 0a 09 09 20  ....exit(1);... 
144b0 20 20 20 7d 0a 09 09 20 20 20 20 65 78 69 74 28     }...    exit(
144c0 30 29 3b 0a 09 09 7d 5d 2c 20 74 63 6c 5f 63 76  0);...}], tcl_cv
144d0 5f 73 74 72 74 6f 64 5f 62 75 67 67 79 3d 6f 6b  _strtod_buggy=ok
144e0 2c 20 74 63 6c 5f 63 76 5f 73 74 72 74 6f 64 5f  , tcl_cv_strtod_
144f0 62 75 67 67 79 3d 62 75 67 67 79 2c 0a 09 09 20  buggy=buggy,... 
14500 20 20 20 74 63 6c 5f 63 76 5f 73 74 72 74 6f 64     tcl_cv_strtod
14510 5f 62 75 67 67 79 3d 62 75 67 67 79 29 5d 29 0a  _buggy=buggy)]).
14520 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f 63  .if test "$tcl_c
14530 76 5f 73 74 72 74 6f 64 5f 62 75 67 67 79 22 20  v_strtod_buggy" 
14540 3d 20 62 75 67 67 79 3b 20 74 68 65 6e 0a 09 20  = buggy; then.. 
14550 20 20 20 41 43 5f 4c 49 42 4f 42 4a 28 5b 66 69     AC_LIBOBJ([fi
14560 78 73 74 72 74 6f 64 5d 29 0a 09 20 20 20 20 55  xstrtod])..    U
14570 53 45 5f 43 4f 4d 50 41 54 3d 31 0a 09 20 20 20  SE_COMPAT=1..   
14580 20 41 43 5f 44 45 46 49 4e 45 28 73 74 72 74 6f   AC_DEFINE(strto
14590 64 2c 20 66 69 78 73 74 72 74 6f 64 2c 20 5b 44  d, fixstrtod, [D
145a0 6f 20 77 65 20 77 61 6e 74 20 74 6f 20 75 73 65  o we want to use
145b0 20 74 68 65 20 73 74 72 74 6f 64 28 29 20 69 6e   the strtod() in
145c0 20 63 6f 6d 70 61 74 3f 5d 29 0a 09 66 69 0a 20   compat?])..fi. 
145d0 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d     fi.])..#-----
145e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
145f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14610 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
14620 23 20 54 45 41 5f 54 43 4c 5f 4c 49 4e 4b 5f 4c  # TEA_TCL_LINK_L
14630 49 42 53 0a 23 0a 23 09 53 65 61 72 63 68 20 66  IBS.#.#.Search f
14640 6f 72 20 74 68 65 20 6c 69 62 72 61 72 69 65 73  or the libraries
14650 20 6e 65 65 64 65 64 20 74 6f 20 6c 69 6e 6b 20   needed to link 
14660 74 68 65 20 54 63 6c 20 73 68 65 6c 6c 2e 0a 23  the Tcl shell..#
14670 09 54 68 69 6e 67 73 20 6c 69 6b 65 20 74 68 65  .Things like the
14680 20 6d 61 74 68 20 6c 69 62 72 61 72 79 20 28 2d   math library (-
14690 6c 6d 29 20 61 6e 64 20 73 6f 63 6b 65 74 20 73  lm) and socket s
146a0 74 75 66 66 20 28 2d 6c 73 6f 63 6b 65 74 20 76  tuff (-lsocket v
146b0 73 2e 0a 23 09 2d 6c 6e 73 6c 29 20 61 72 65 20  s..#.-lnsl) are 
146c0 64 65 61 6c 74 20 77 69 74 68 20 68 65 72 65 2e  dealt with here.
146d0 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a  .#.# Arguments:.
146e0 23 09 52 65 71 75 69 72 65 73 20 74 68 65 20 66  #.Requires the f
146f0 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 20 74 6f  ollowing vars to
14700 20 62 65 20 73 65 74 20 69 6e 20 74 68 65 20 4d   be set in the M
14710 61 6b 65 66 69 6c 65 3a 0a 23 09 09 44 4c 5f 4c  akefile:.#..DL_L
14720 49 42 53 20 28 6e 6f 74 20 69 6e 20 54 45 41 2c  IBS (not in TEA,
14730 20 6f 6e 6c 79 20 6e 65 65 64 65 64 20 69 6e 20   only needed in 
14740 63 6f 72 65 29 0a 23 09 09 4c 49 42 53 0a 23 09  core).#..LIBS.#.
14750 09 4d 41 54 48 5f 4c 49 42 53 0a 23 0a 23 20 52  .MATH_LIBS.#.# R
14760 65 73 75 6c 74 73 3a 0a 23 0a 23 09 53 75 62 73  esults:.#.#.Subs
14770 74 69 74 75 74 65 73 20 74 68 65 20 66 6f 6c 6c  titutes the foll
14780 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 54  owing vars:.#..T
14790 43 4c 5f 4c 49 42 53 0a 23 09 09 4d 41 54 48 5f  CL_LIBS.#..MATH_
147a0 4c 49 42 53 0a 23 0a 23 09 4d 69 67 68 74 20 61  LIBS.#.#.Might a
147b0 70 70 65 6e 64 20 74 6f 20 74 68 65 20 66 6f 6c  ppend to the fol
147c0 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
147d0 4c 49 42 53 0a 23 0a 23 09 4d 69 67 68 74 20 64  LIBS.#.#.Might d
147e0 65 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77  efine the follow
147f0 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 48 41 56  ing vars:.#..HAV
14800 45 5f 4e 45 54 5f 45 52 52 4e 4f 5f 48 0a 23 2d  E_NET_ERRNO_H.#-
14810 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14820 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14840 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14850 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54  ---..AC_DEFUN([T
14860 45 41 5f 54 43 4c 5f 4c 49 4e 4b 5f 4c 49 42 53  EA_TCL_LINK_LIBS
14870 5d 2c 20 5b 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  ], [.    #------
14880 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
148a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
148b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
148c0 20 20 20 23 20 4f 6e 20 61 20 66 65 77 20 76 65     # On a few ve
148d0 72 79 20 72 61 72 65 20 73 79 73 74 65 6d 73 2c  ry rare systems,
148e0 20 61 6c 6c 20 6f 66 20 74 68 65 20 6c 69 62 6d   all of the libm
148f0 2e 61 20 73 74 75 66 66 20 69 73 0a 20 20 20 20  .a stuff is.    
14900 23 20 61 6c 72 65 61 64 79 20 69 6e 20 6c 69 62  # already in lib
14910 63 2e 61 2e 20 20 53 65 74 20 63 6f 6d 70 69 6c  c.a.  Set compil
14920 65 72 20 66 6c 61 67 73 20 61 63 63 6f 72 64 69  er flags accordi
14930 6e 67 6c 79 2e 0a 20 20 20 20 23 20 41 6c 73 6f  ngly..    # Also
14940 2c 20 4c 69 6e 75 78 20 72 65 71 75 69 72 65 73  , Linux requires
14950 20 74 68 65 20 22 69 65 65 65 22 20 6c 69 62 72   the "ieee" libr
14960 61 72 79 20 66 6f 72 20 6d 61 74 68 20 74 6f 20  ary for math to 
14970 77 6f 72 6b 0a 20 20 20 20 23 20 72 69 67 68 74  work.    # right
14980 20 28 61 6e 64 20 69 74 20 6d 75 73 74 20 61 70   (and it must ap
14990 70 65 61 72 20 62 65 66 6f 72 65 20 22 2d 6c 6d  pear before "-lm
149a0 22 29 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  ")..    #-------
149b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
149c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
149d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
149e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20  -------------.. 
149f0 20 20 20 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43     AC_CHECK_FUNC
14a00 28 73 69 6e 2c 20 4d 41 54 48 5f 4c 49 42 53 3d  (sin, MATH_LIBS=
14a10 22 22 2c 20 4d 41 54 48 5f 4c 49 42 53 3d 22 2d  "", MATH_LIBS="-
14a20 6c 6d 22 29 0a 20 20 20 20 41 43 5f 43 48 45 43  lm").    AC_CHEC
14a30 4b 5f 4c 49 42 28 69 65 65 65 2c 20 6d 61 69 6e  K_LIB(ieee, main
14a40 2c 20 5b 4d 41 54 48 5f 4c 49 42 53 3d 22 2d 6c  , [MATH_LIBS="-l
14a50 69 65 65 65 20 24 4d 41 54 48 5f 4c 49 42 53 22  ieee $MATH_LIBS"
14a60 5d 29 0a 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  ])..    #-------
14a70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14a80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14a90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14aa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
14ab0 20 20 23 20 49 6e 74 65 72 61 63 74 69 76 65 20    # Interactive 
14ac0 55 4e 49 58 20 72 65 71 75 69 72 65 73 20 2d 6c  UNIX requires -l
14ad0 69 6e 65 74 20 69 6e 73 74 65 61 64 20 6f 66 20  inet instead of 
14ae0 2d 6c 73 6f 63 6b 65 74 2c 20 70 6c 75 73 20 69  -lsocket, plus i
14af0 74 0a 20 20 20 20 23 20 6e 65 65 64 73 20 6e 65  t.    # needs ne
14b00 74 2f 65 72 72 6e 6f 2e 68 20 74 6f 20 64 65 66  t/errno.h to def
14b10 69 6e 65 20 74 68 65 20 73 6f 63 6b 65 74 2d 72  ine the socket-r
14b20 65 6c 61 74 65 64 20 65 72 72 6f 72 20 63 6f 64  elated error cod
14b30 65 73 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  es..    #-------
14b40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14b50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14b60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14b70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20  -------------.. 
14b80 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28     AC_CHECK_LIB(
14b90 69 6e 65 74 2c 20 6d 61 69 6e 2c 20 5b 4c 49 42  inet, main, [LIB
14ba0 53 3d 22 24 4c 49 42 53 20 2d 6c 69 6e 65 74 22  S="$LIBS -linet"
14bb0 5d 29 0a 20 20 20 20 41 43 5f 43 48 45 43 4b 5f  ]).    AC_CHECK_
14bc0 48 45 41 44 45 52 28 6e 65 74 2f 65 72 72 6e 6f  HEADER(net/errno
14bd0 2e 68 2c 20 5b 0a 09 41 43 5f 44 45 46 49 4e 45  .h, [..AC_DEFINE
14be0 28 48 41 56 45 5f 4e 45 54 5f 45 52 52 4e 4f 5f  (HAVE_NET_ERRNO_
14bf0 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68 61 76  H, 1, [Do we hav
14c00 65 20 3c 6e 65 74 2f 65 72 72 6e 6f 2e 68 3e 3f  e <net/errno.h>?
14c10 5d 29 5d 29 0a 0a 20 20 20 20 23 2d 2d 2d 2d 2d  ])])..    #-----
14c20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
14c60 20 20 20 20 23 09 43 68 65 63 6b 20 66 6f 72 20      #.Check for 
14c70 74 68 65 20 65 78 69 73 74 65 6e 63 65 20 6f 66  the existence of
14c80 20 74 68 65 20 2d 6c 73 6f 63 6b 65 74 20 61 6e   the -lsocket an
14c90 64 20 2d 6c 6e 73 6c 20 6c 69 62 72 61 72 69 65  d -lnsl librarie
14ca0 73 2e 0a 20 20 20 20 23 09 54 68 65 20 6f 72 64  s..    #.The ord
14cb0 65 72 20 68 65 72 65 20 69 73 20 69 6d 70 6f 72  er here is impor
14cc0 74 61 6e 74 2c 20 73 6f 20 74 68 61 74 20 74 68  tant, so that th
14cd0 65 79 20 65 6e 64 20 75 70 20 69 6e 20 74 68 65  ey end up in the
14ce0 20 72 69 67 68 74 0a 20 20 20 20 23 09 6f 72 64   right.    #.ord
14cf0 65 72 20 69 6e 20 74 68 65 20 63 6f 6d 6d 61 6e  er in the comman
14d00 64 20 6c 69 6e 65 20 67 65 6e 65 72 61 74 65 64  d line generated
14d10 20 62 79 20 6d 61 6b 65 2e 20 20 48 65 72 65 20   by make.  Here 
14d20 61 72 65 20 73 6f 6d 65 0a 20 20 20 20 23 09 73  are some.    #.s
14d30 70 65 63 69 61 6c 20 63 6f 6e 73 69 64 65 72 61  pecial considera
14d40 74 69 6f 6e 73 3a 0a 20 20 20 20 23 09 31 2e 20  tions:.    #.1. 
14d50 55 73 65 20 22 63 6f 6e 6e 65 63 74 22 20 61 6e  Use "connect" an
14d60 64 20 22 61 63 63 65 70 74 22 20 74 6f 20 63 68  d "accept" to ch
14d70 65 63 6b 20 66 6f 72 20 2d 6c 73 6f 63 6b 65 74  eck for -lsocket
14d80 2c 20 61 6e 64 0a 20 20 20 20 23 09 20 20 20 22  , and.    #.   "
14d90 67 65 74 68 6f 73 74 62 79 6e 61 6d 65 22 20 74  gethostbyname" t
14da0 6f 20 63 68 65 63 6b 20 66 6f 72 20 2d 6c 6e 73  o check for -lns
14db0 6c 2e 0a 20 20 20 20 23 09 32 2e 20 55 73 65 20  l..    #.2. Use 
14dc0 65 61 63 68 20 66 75 6e 63 74 69 6f 6e 20 6e 61  each function na
14dd0 6d 65 20 6f 6e 6c 79 20 6f 6e 63 65 3a 20 20 63  me only once:  c
14de0 61 6e 27 74 20 72 65 64 6f 20 61 20 63 68 65 63  an't redo a chec
14df0 6b 20 62 65 63 61 75 73 65 0a 20 20 20 20 23 09  k because.    #.
14e00 20 20 20 61 75 74 6f 63 6f 6e 66 20 63 61 63 68     autoconf cach
14e10 65 73 20 74 68 65 20 72 65 73 75 6c 74 73 20 6f  es the results o
14e20 66 20 74 68 65 20 6c 61 73 74 20 63 68 65 63 6b  f the last check
14e30 20 61 6e 64 20 77 6f 6e 27 74 20 72 65 64 6f 20   and won't redo 
14e40 69 74 2e 0a 20 20 20 20 23 09 33 2e 20 55 73 65  it..    #.3. Use
14e50 20 2d 6c 6e 73 6c 20 61 6e 64 20 2d 6c 73 6f 63   -lnsl and -lsoc
14e60 6b 65 74 20 6f 6e 6c 79 20 69 66 20 74 68 65 79  ket only if they
14e70 20 73 75 70 70 6c 79 20 70 72 6f 63 65 64 75 72   supply procedur
14e80 65 73 20 74 68 61 74 0a 20 20 20 20 23 09 20 20  es that.    #.  
14e90 20 61 72 65 6e 27 74 20 61 6c 72 65 61 64 79 20   aren't already 
14ea0 70 72 65 73 65 6e 74 20 69 6e 20 74 68 65 20 6e  present in the n
14eb0 6f 72 6d 61 6c 20 6c 69 62 72 61 72 69 65 73 2e  ormal libraries.
14ec0 20 20 54 68 69 73 20 69 73 20 62 65 63 61 75 73    This is becaus
14ed0 65 0a 20 20 20 20 23 09 20 20 20 49 52 49 58 20  e.    #.   IRIX 
14ee0 35 2e 32 20 68 61 73 20 6c 69 62 72 61 72 69 65  5.2 has librarie
14ef0 73 2c 20 62 75 74 20 74 68 65 79 20 61 72 65 6e  s, but they aren
14f00 27 74 20 6e 65 65 64 65 64 20 61 6e 64 20 74 68  't needed and th
14f10 65 79 27 72 65 0a 20 20 20 20 23 09 20 20 20 62  ey're.    #.   b
14f20 6f 67 75 73 3a 20 20 74 68 65 79 20 67 6f 6f 66  ogus:  they goof
14f30 20 75 70 20 6e 61 6d 65 20 72 65 73 6f 6c 75 74   up name resolut
14f40 69 6f 6e 20 69 66 20 75 73 65 64 2e 0a 20 20 20  ion if used..   
14f50 20 23 09 34 2e 20 4f 6e 20 73 6f 6d 65 20 53 56   #.4. On some SV
14f60 52 34 20 73 79 73 74 65 6d 73 2c 20 63 61 6e 27  R4 systems, can'
14f70 74 20 75 73 65 20 2d 6c 73 6f 63 6b 65 74 20 77  t use -lsocket w
14f80 69 74 68 6f 75 74 20 2d 6c 6e 73 6c 20 74 6f 6f  ithout -lnsl too
14f90 2e 0a 20 20 20 20 23 09 20 20 20 54 6f 20 67 65  ..    #.   To ge
14fa0 74 20 61 72 6f 75 6e 64 20 74 68 69 73 20 70 72  t around this pr
14fb0 6f 62 6c 65 6d 2c 20 63 68 65 63 6b 20 66 6f 72  oblem, check for
14fc0 20 62 6f 74 68 20 6c 69 62 72 61 72 69 65 73 20   both libraries 
14fd0 74 6f 67 65 74 68 65 72 0a 20 20 20 20 23 09 20  together.    #. 
14fe0 20 20 69 66 20 2d 6c 73 6f 63 6b 65 74 20 64 6f    if -lsocket do
14ff0 65 73 6e 27 74 20 77 6f 72 6b 20 62 79 20 69 74  esn't work by it
15000 73 65 6c 66 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d  self..    #-----
15010 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15020 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15030 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
15050 0a 20 20 20 20 74 63 6c 5f 63 68 65 63 6b 42 6f  .    tcl_checkBo
15060 74 68 3d 30 0a 20 20 20 20 41 43 5f 43 48 45 43  th=0.    AC_CHEC
15070 4b 5f 46 55 4e 43 28 63 6f 6e 6e 65 63 74 2c 20  K_FUNC(connect, 
15080 74 63 6c 5f 63 68 65 63 6b 53 6f 63 6b 65 74 3d  tcl_checkSocket=
15090 30 2c 20 74 63 6c 5f 63 68 65 63 6b 53 6f 63 6b  0, tcl_checkSock
150a0 65 74 3d 31 29 0a 20 20 20 20 69 66 20 74 65 73  et=1).    if tes
150b0 74 20 22 24 74 63 6c 5f 63 68 65 63 6b 53 6f 63  t "$tcl_checkSoc
150c0 6b 65 74 22 20 3d 20 31 3b 20 74 68 65 6e 0a 09  ket" = 1; then..
150d0 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 73 65  AC_CHECK_FUNC(se
150e0 74 73 6f 63 6b 6f 70 74 2c 20 2c 20 5b 41 43 5f  tsockopt, , [AC_
150f0 43 48 45 43 4b 5f 4c 49 42 28 73 6f 63 6b 65 74  CHECK_LIB(socket
15100 2c 20 73 65 74 73 6f 63 6b 6f 70 74 2c 0a 09 20  , setsockopt,.. 
15110 20 20 20 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d     LIBS="$LIBS -
15120 6c 73 6f 63 6b 65 74 22 2c 20 74 63 6c 5f 63 68  lsocket", tcl_ch
15130 65 63 6b 42 6f 74 68 3d 31 29 5d 29 0a 20 20 20  eckBoth=1)]).   
15140 20 66 69 0a 20 20 20 20 69 66 20 74 65 73 74 20   fi.    if test 
15150 22 24 74 63 6c 5f 63 68 65 63 6b 42 6f 74 68 22  "$tcl_checkBoth"
15160 20 3d 20 31 3b 20 74 68 65 6e 0a 09 74 6b 5f 6f   = 1; then..tk_o
15170 6c 64 4c 69 62 73 3d 24 4c 49 42 53 0a 09 4c 49  ldLibs=$LIBS..LI
15180 42 53 3d 22 24 4c 49 42 53 20 2d 6c 73 6f 63 6b  BS="$LIBS -lsock
15190 65 74 20 2d 6c 6e 73 6c 22 0a 09 41 43 5f 43 48  et -lnsl"..AC_CH
151a0 45 43 4b 5f 46 55 4e 43 28 61 63 63 65 70 74 2c  ECK_FUNC(accept,
151b0 20 74 63 6c 5f 63 68 65 63 6b 4e 73 6c 3d 30 2c   tcl_checkNsl=0,
151c0 20 5b 4c 49 42 53 3d 24 74 6b 5f 6f 6c 64 4c 69   [LIBS=$tk_oldLi
151d0 62 73 5d 29 0a 20 20 20 20 66 69 0a 20 20 20 20  bs]).    fi.    
151e0 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 67 65  AC_CHECK_FUNC(ge
151f0 74 68 6f 73 74 62 79 6e 61 6d 65 2c 20 2c 20 5b  thostbyname, , [
15200 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 6e 73 6c  AC_CHECK_LIB(nsl
15210 2c 20 67 65 74 68 6f 73 74 62 79 6e 61 6d 65 2c  , gethostbyname,
15220 0a 09 20 20 20 20 5b 4c 49 42 53 3d 22 24 4c 49  ..    [LIBS="$LI
15230 42 53 20 2d 6c 6e 73 6c 22 5d 29 5d 29 0a 0a 20  BS -lnsl"])]).. 
15240 20 20 20 23 20 54 45 41 20 73 70 65 63 69 66 69     # TEA specifi
15250 63 3a 20 44 6f 6e 27 74 20 70 65 72 66 6f 72 6d  c: Don't perform
15260 20 74 68 65 20 65 76 61 6c 20 6f 66 20 74 68 65   the eval of the
15270 20 6c 69 62 72 61 72 69 65 73 20 68 65 72 65 20   libraries here 
15280 62 65 63 61 75 73 65 0a 20 20 20 20 23 20 44 4c  because.    # DL
15290 5f 4c 49 42 53 20 77 6f 6e 27 74 20 62 65 20 73  _LIBS won't be s
152a0 65 74 20 75 6e 74 69 6c 20 77 65 20 63 61 6c 6c  et until we call
152b0 20 54 45 41 5f 43 4f 4e 46 49 47 5f 43 46 4c 41   TEA_CONFIG_CFLA
152c0 47 53 0a 0a 20 20 20 20 54 43 4c 5f 4c 49 42 53  GS..    TCL_LIBS
152d0 3d 27 24 7b 44 4c 5f 4c 49 42 53 7d 20 24 7b 4c  ='${DL_LIBS} ${L
152e0 49 42 53 7d 20 24 7b 4d 41 54 48 5f 4c 49 42 53  IBS} ${MATH_LIBS
152f0 7d 27 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  }'.    AC_SUBST(
15300 54 43 4c 5f 4c 49 42 53 29 0a 20 20 20 20 41 43  TCL_LIBS).    AC
15310 5f 53 55 42 53 54 28 4d 41 54 48 5f 4c 49 42 53  _SUBST(MATH_LIBS
15320 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ).])..#---------
15330 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15340 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15350 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45  -----------.# TE
15370 41 5f 54 43 4c 5f 45 41 52 4c 59 5f 46 4c 41 47  A_TCL_EARLY_FLAG
15380 53 0a 23 0a 23 09 43 68 65 63 6b 20 66 6f 72 20  S.#.#.Check for 
15390 77 68 61 74 20 66 6c 61 67 73 20 61 72 65 20 6e  what flags are n
153a0 65 65 64 65 64 20 74 6f 20 62 65 20 70 61 73 73  eeded to be pass
153b0 65 64 20 73 6f 20 74 68 65 20 63 6f 72 72 65 63  ed so the correc
153c0 74 20 4f 53 0a 23 09 66 65 61 74 75 72 65 73 20  t OS.#.features 
153d0 61 72 65 20 61 76 61 69 6c 61 62 6c 65 2e 0a 23  are available..#
153e0 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
153f0 4e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73  None.#.# Results
15400 3a 0a 23 0a 23 09 4d 69 67 68 74 20 64 65 66 69  :.#.#.Might defi
15410 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ne the following
15420 20 76 61 72 73 3a 0a 23 09 09 5f 49 53 4f 43 39   vars:.#.._ISOC9
15430 39 5f 53 4f 55 52 43 45 0a 23 09 09 5f 4c 41 52  9_SOURCE.#.._LAR
15440 47 45 46 49 4c 45 36 34 5f 53 4f 55 52 43 45 0a  GEFILE64_SOURCE.
15450 23 09 09 5f 4c 41 52 47 45 46 49 4c 45 5f 53 4f  #.._LARGEFILE_SO
15460 55 52 43 45 36 34 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  URCE64.#--------
15470 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15480 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15490 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
154a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43  ------------..AC
154b0 5f 44 45 46 55 4e 28 5b 54 45 41 5f 54 43 4c 5f  _DEFUN([TEA_TCL_
154c0 45 41 52 4c 59 5f 46 4c 41 47 5d 2c 5b 0a 20 20  EARLY_FLAG],[.  
154d0 20 20 41 43 5f 43 41 43 48 45 5f 56 41 4c 28 5b    AC_CACHE_VAL([
154e0 74 63 6c 5f 63 76 5f 66 6c 61 67 5f 5d 74 72 61  tcl_cv_flag_]tra
154f0 6e 73 6c 69 74 28 24 31 2c 5b 41 2d 5a 5d 2c 5b  nslit($1,[A-Z],[
15500 61 2d 7a 5d 29 2c 0a 09 41 43 5f 54 52 59 5f 43  a-z]),..AC_TRY_C
15510 4f 4d 50 49 4c 45 28 5b 24 32 5d 2c 20 24 33 2c  OMPILE([$2], $3,
15520 20 5b 74 63 6c 5f 63 76 5f 66 6c 61 67 5f 5d 74   [tcl_cv_flag_]t
15530 72 61 6e 73 6c 69 74 28 24 31 2c 5b 41 2d 5a 5d  ranslit($1,[A-Z]
15540 2c 5b 61 2d 7a 5d 29 3d 6e 6f 2c 0a 09 20 20 20  ,[a-z])=no,..   
15550 20 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28   AC_TRY_COMPILE(
15560 5b 5b 23 64 65 66 69 6e 65 20 5d 24 31 5b 20 31  [[#define ]$1[ 1
15570 0a 5d 24 32 5d 2c 20 24 33 2c 0a 09 09 5b 74 63  .]$2], $3,...[tc
15580 6c 5f 63 76 5f 66 6c 61 67 5f 5d 74 72 61 6e 73  l_cv_flag_]trans
15590 6c 69 74 28 24 31 2c 5b 41 2d 5a 5d 2c 5b 61 2d  lit($1,[A-Z],[a-
155a0 7a 5d 29 3d 79 65 73 2c 0a 09 09 5b 74 63 6c 5f  z])=yes,...[tcl_
155b0 63 76 5f 66 6c 61 67 5f 5d 74 72 61 6e 73 6c 69  cv_flag_]transli
155c0 74 28 24 31 2c 5b 41 2d 5a 5d 2c 5b 61 2d 7a 5d  t($1,[A-Z],[a-z]
155d0 29 3d 6e 6f 29 29 29 0a 20 20 20 20 69 66 20 74  )=no))).    if t
155e0 65 73 74 20 5b 22 78 24 7b 74 63 6c 5f 63 76 5f  est ["x${tcl_cv_
155f0 66 6c 61 67 5f 5d 74 72 61 6e 73 6c 69 74 28 24  flag_]translit($
15600 31 2c 5b 41 2d 5a 5d 2c 5b 61 2d 7a 5d 29 5b 7d  1,[A-Z],[a-z])[}
15610 22 20 3d 20 22 78 79 65 73 22 5d 20 3b 20 74 68  " = "xyes"] ; th
15620 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 24 31  en..AC_DEFINE($1
15630 2c 20 31 2c 20 5b 41 64 64 20 74 68 65 20 5d 24  , 1, [Add the ]$
15640 31 5b 20 66 6c 61 67 20 77 68 65 6e 20 62 75 69  1[ flag when bui
15650 6c 64 69 6e 67 5d 29 0a 09 74 63 6c 5f 66 6c 61  lding])..tcl_fla
15660 67 73 3d 22 24 74 63 6c 5f 66 6c 61 67 73 20 24  gs="$tcl_flags $
15670 31 22 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 41 43  1".    fi.])..AC
15680 5f 44 45 46 55 4e 28 5b 54 45 41 5f 54 43 4c 5f  _DEFUN([TEA_TCL_
15690 45 41 52 4c 59 5f 46 4c 41 47 53 5d 2c 5b 0a 20  EARLY_FLAGS],[. 
156a0 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49     AC_MSG_CHECKI
156b0 4e 47 28 5b 66 6f 72 20 72 65 71 75 69 72 65 64  NG([for required
156c0 20 65 61 72 6c 79 20 63 6f 6d 70 69 6c 65 72 20   early compiler 
156d0 66 6c 61 67 73 5d 29 0a 20 20 20 20 74 63 6c 5f  flags]).    tcl_
156e0 66 6c 61 67 73 3d 22 22 0a 20 20 20 20 54 45 41  flags="".    TEA
156f0 5f 54 43 4c 5f 45 41 52 4c 59 5f 46 4c 41 47 28  _TCL_EARLY_FLAG(
15700 5f 49 53 4f 43 39 39 5f 53 4f 55 52 43 45 2c 5b  _ISOC99_SOURCE,[
15710 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 6c 69 62  #include <stdlib
15720 2e 68 3e 5d 2c 0a 09 5b 63 68 61 72 20 2a 70 20  .h>],..[char *p 
15730 3d 20 28 63 68 61 72 20 2a 29 73 74 72 74 6f 6c  = (char *)strtol
15740 6c 3b 20 63 68 61 72 20 2a 71 20 3d 20 28 63 68  l; char *q = (ch
15750 61 72 20 2a 29 73 74 72 74 6f 75 6c 6c 3b 5d 29  ar *)strtoull;])
15760 0a 20 20 20 20 54 45 41 5f 54 43 4c 5f 45 41 52  .    TEA_TCL_EAR
15770 4c 59 5f 46 4c 41 47 28 5f 4c 41 52 47 45 46 49  LY_FLAG(_LARGEFI
15780 4c 45 36 34 5f 53 4f 55 52 43 45 2c 5b 23 69 6e  LE64_SOURCE,[#in
15790 63 6c 75 64 65 20 3c 73 79 73 2f 73 74 61 74 2e  clude <sys/stat.
157a0 68 3e 5d 2c 0a 09 5b 73 74 72 75 63 74 20 73 74  h>],..[struct st
157b0 61 74 36 34 20 62 75 66 3b 20 69 6e 74 20 69 20  at64 buf; int i 
157c0 3d 20 73 74 61 74 36 34 28 22 2f 22 2c 20 26 62  = stat64("/", &b
157d0 75 66 29 3b 5d 29 0a 20 20 20 20 54 45 41 5f 54  uf);]).    TEA_T
157e0 43 4c 5f 45 41 52 4c 59 5f 46 4c 41 47 28 5f 4c  CL_EARLY_FLAG(_L
157f0 41 52 47 45 46 49 4c 45 5f 53 4f 55 52 43 45 36  ARGEFILE_SOURCE6
15800 34 2c 5b 23 69 6e 63 6c 75 64 65 20 3c 73 79 73  4,[#include <sys
15810 2f 73 74 61 74 2e 68 3e 5d 2c 0a 09 5b 63 68 61  /stat.h>],..[cha
15820 72 20 2a 70 20 3d 20 28 63 68 61 72 20 2a 29 6f  r *p = (char *)o
15830 70 65 6e 36 34 3b 5d 29 0a 20 20 20 20 69 66 20  pen64;]).    if 
15840 74 65 73 74 20 22 78 24 7b 74 63 6c 5f 66 6c 61  test "x${tcl_fla
15850 67 73 7d 22 20 3d 20 22 78 22 20 3b 20 74 68 65  gs}" = "x" ; the
15860 6e 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  n..AC_MSG_RESULT
15870 28 5b 6e 6f 6e 65 5d 29 0a 20 20 20 20 65 6c 73  ([none]).    els
15880 65 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  e..AC_MSG_RESULT
15890 28 5b 24 7b 74 63 6c 5f 66 6c 61 67 73 7d 5d 29  ([${tcl_flags}])
158a0 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d  .    fi.])..#---
158b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
158c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
158d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
158e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
158f0 2d 0a 23 20 54 45 41 5f 54 43 4c 5f 36 34 42 49  -.# TEA_TCL_64BI
15900 54 5f 46 4c 41 47 53 0a 23 0a 23 09 43 68 65 63  T_FLAGS.#.#.Chec
15910 6b 20 66 6f 72 20 77 68 61 74 20 69 73 20 64 65  k for what is de
15920 66 69 6e 65 64 20 69 6e 20 74 68 65 20 77 61 79  fined in the way
15930 20 6f 66 20 36 34 2d 62 69 74 20 66 65 61 74 75   of 64-bit featu
15940 72 65 73 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e  res..#.# Argumen
15950 74 73 3a 0a 23 09 4e 6f 6e 65 0a 23 0a 23 20 52  ts:.#.None.#.# R
15960 65 73 75 6c 74 73 3a 0a 23 0a 23 09 4d 69 67 68  esults:.#.#.Migh
15970 74 20 64 65 66 69 6e 65 20 74 68 65 20 66 6f 6c  t define the fol
15980 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
15990 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 49 53 5f  TCL_WIDE_INT_IS_
159a0 4c 4f 4e 47 0a 23 09 09 54 43 4c 5f 57 49 44 45  LONG.#..TCL_WIDE
159b0 5f 49 4e 54 5f 54 59 50 45 0a 23 09 09 48 41 56  _INT_TYPE.#..HAV
159c0 45 5f 53 54 52 55 43 54 5f 44 49 52 45 4e 54 36  E_STRUCT_DIRENT6
159d0 34 0a 23 09 09 48 41 56 45 5f 53 54 52 55 43 54  4.#..HAVE_STRUCT
159e0 5f 53 54 41 54 36 34 0a 23 09 09 48 41 56 45 5f  _STAT64.#..HAVE_
159f0 54 59 50 45 5f 4f 46 46 36 34 5f 54 0a 23 2d 2d  TYPE_OFF64_T.#--
15a00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15a10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15a20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15a30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15a40 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45  --..AC_DEFUN([TE
15a50 41 5f 54 43 4c 5f 36 34 42 49 54 5f 46 4c 41 47  A_TCL_64BIT_FLAG
15a60 53 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d 53 47  S], [.    AC_MSG
15a70 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 36  _CHECKING([for 6
15a80 34 2d 62 69 74 20 69 6e 74 65 67 65 72 20 74 79  4-bit integer ty
15a90 70 65 5d 29 0a 20 20 20 20 41 43 5f 43 41 43 48  pe]).    AC_CACH
15aa0 45 5f 56 41 4c 28 74 63 6c 5f 63 76 5f 74 79 70  E_VAL(tcl_cv_typ
15ab0 65 5f 36 34 62 69 74 2c 5b 0a 09 74 63 6c 5f 63  e_64bit,[..tcl_c
15ac0 76 5f 74 79 70 65 5f 36 34 62 69 74 3d 6e 6f 6e  v_type_64bit=non
15ad0 65 0a 09 23 20 53 65 65 20 69 66 20 74 68 65 20  e..# See if the 
15ae0 63 6f 6d 70 69 6c 65 72 20 6b 6e 6f 77 73 20 6e  compiler knows n
15af0 61 74 69 76 65 6c 79 20 61 62 6f 75 74 20 5f 5f  atively about __
15b00 69 6e 74 36 34 0a 09 41 43 5f 54 52 59 5f 43 4f  int64..AC_TRY_CO
15b10 4d 50 49 4c 45 28 2c 5b 5f 5f 69 6e 74 36 34 20  MPILE(,[__int64 
15b20 76 61 6c 75 65 20 3d 20 28 5f 5f 69 6e 74 36 34  value = (__int64
15b30 29 20 30 3b 5d 2c 0a 09 20 20 20 20 74 63 6c 5f  ) 0;],..    tcl_
15b40 74 79 70 65 5f 36 34 62 69 74 3d 5f 5f 69 6e 74  type_64bit=__int
15b50 36 34 2c 20 74 63 6c 5f 74 79 70 65 5f 36 34 62  64, tcl_type_64b
15b60 69 74 3d 22 6c 6f 6e 67 20 6c 6f 6e 67 22 29 0a  it="long long").
15b70 09 23 20 53 65 65 20 69 66 20 77 65 20 73 68 6f  .# See if we sho
15b80 75 6c 64 20 75 73 65 20 6c 6f 6e 67 20 61 6e 79  uld use long any
15b90 77 61 79 20 20 4e 6f 74 65 20 74 68 61 74 20 77  way  Note that w
15ba0 65 20 73 75 62 73 74 69 74 75 74 65 20 69 6e 20  e substitute in 
15bb0 74 68 65 0a 09 23 20 74 79 70 65 20 74 68 61 74  the..# type that
15bc0 20 69 73 20 6f 75 72 20 63 75 72 72 65 6e 74 20   is our current 
15bd0 67 75 65 73 73 20 66 6f 72 20 61 20 36 34 2d 62  guess for a 64-b
15be0 69 74 20 74 79 70 65 20 69 6e 73 69 64 65 20 74  it type inside t
15bf0 68 69 73 20 63 68 65 63 6b 0a 09 23 20 70 72 6f  his check..# pro
15c00 67 72 61 6d 2c 20 73 6f 20 69 74 20 73 68 6f 75  gram, so it shou
15c10 6c 64 20 62 65 20 6d 6f 64 69 66 69 65 64 20 6f  ld be modified o
15c20 6e 6c 79 20 63 61 72 65 66 75 6c 6c 79 2e 2e 2e  nly carefully...
15c30 0a 20 20 20 20 20 20 20 20 41 43 5f 54 52 59 5f  .        AC_TRY_
15c40 43 4f 4d 50 49 4c 45 28 2c 5b 73 77 69 74 63 68  COMPILE(,[switch
15c50 20 28 30 29 20 7b 0a 20 20 20 20 20 20 20 20 20   (0) {.         
15c60 20 20 20 63 61 73 65 20 31 3a 20 63 61 73 65 20     case 1: case 
15c70 28 73 69 7a 65 6f 66 28 5d 24 7b 74 63 6c 5f 74  (sizeof(]${tcl_t
15c80 79 70 65 5f 36 34 62 69 74 7d 5b 29 3d 3d 73 69  ype_64bit}[)==si
15c90 7a 65 6f 66 28 6c 6f 6e 67 29 29 3a 20 3b 0a 20  zeof(long)): ;. 
15ca0 20 20 20 20 20 20 20 7d 5d 2c 74 63 6c 5f 63 76         }],tcl_cv
15cb0 5f 74 79 70 65 5f 36 34 62 69 74 3d 24 7b 74 63  _type_64bit=${tc
15cc0 6c 5f 74 79 70 65 5f 36 34 62 69 74 7d 29 5d 29  l_type_64bit})])
15cd0 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b  .    if test "${
15ce0 74 63 6c 5f 63 76 5f 74 79 70 65 5f 36 34 62 69  tcl_cv_type_64bi
15cf0 74 7d 22 20 3d 20 6e 6f 6e 65 20 3b 20 74 68 65  t}" = none ; the
15d00 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 54 43 4c  n..AC_DEFINE(TCL
15d10 5f 57 49 44 45 5f 49 4e 54 5f 49 53 5f 4c 4f 4e  _WIDE_INT_IS_LON
15d20 47 2c 20 31 2c 20 5b 41 72 65 20 77 69 64 65 20  G, 1, [Are wide 
15d30 69 6e 74 65 67 65 72 73 20 74 6f 20 62 65 20 69  integers to be i
15d40 6d 70 6c 65 6d 65 6e 74 65 64 20 77 69 74 68 20  mplemented with 
15d50 43 20 27 6c 6f 6e 67 27 73 3f 5d 29 0a 09 41 43  C 'long's?])..AC
15d60 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 75 73 69  _MSG_RESULT([usi
15d70 6e 67 20 6c 6f 6e 67 5d 29 0a 20 20 20 20 65 6c  ng long]).    el
15d80 69 66 20 74 65 73 74 20 22 24 7b 74 63 6c 5f 63  if test "${tcl_c
15d90 76 5f 74 79 70 65 5f 36 34 62 69 74 7d 22 20 3d  v_type_64bit}" =
15da0 20 22 5f 5f 69 6e 74 36 34 22 20 5c 0a 09 09 2d   "__int64" \...-
15db0 61 20 22 24 7b 54 45 41 5f 50 4c 41 54 46 4f 52  a "${TEA_PLATFOR
15dc0 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77 73 22 20  M}" = "windows" 
15dd0 3b 20 74 68 65 6e 0a 09 23 20 54 45 41 20 73 70  ; then..# TEA sp
15de0 65 63 69 66 69 63 3a 20 57 65 20 61 63 74 75 61  ecific: We actua
15df0 6c 6c 79 20 77 61 6e 74 20 74 6f 20 75 73 65 20  lly want to use 
15e00 74 68 65 20 64 65 66 61 75 6c 74 20 74 63 6c 2e  the default tcl.
15e10 68 20 63 68 65 63 6b 73 20 69 6e 0a 09 23 20 74  h checks in..# t
15e20 68 69 73 20 63 61 73 65 20 74 6f 20 68 61 6e 64  his case to hand
15e30 6c 65 20 62 6f 74 68 20 54 43 4c 5f 57 49 44 45  le both TCL_WIDE
15e40 5f 49 4e 54 5f 54 59 50 45 20 61 6e 64 20 54 43  _INT_TYPE and TC
15e50 4c 5f 4c 4c 5f 4d 4f 44 49 46 49 45 52 2a 0a 09  L_LL_MODIFIER*..
15e60 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 75  AC_MSG_RESULT([u
15e70 73 69 6e 67 20 54 63 6c 20 68 65 61 64 65 72 20  sing Tcl header 
15e80 64 65 66 61 75 6c 74 73 5d 29 0a 20 20 20 20 65  defaults]).    e
15e90 6c 73 65 0a 09 41 43 5f 44 45 46 49 4e 45 5f 55  lse..AC_DEFINE_U
15ea0 4e 51 55 4f 54 45 44 28 54 43 4c 5f 57 49 44 45  NQUOTED(TCL_WIDE
15eb0 5f 49 4e 54 5f 54 59 50 45 2c 24 7b 74 63 6c 5f  _INT_TYPE,${tcl_
15ec0 63 76 5f 74 79 70 65 5f 36 34 62 69 74 7d 2c 0a  cv_type_64bit},.
15ed0 09 20 20 20 20 5b 57 68 61 74 20 74 79 70 65 20  .    [What type 
15ee0 73 68 6f 75 6c 64 20 62 65 20 75 73 65 64 20 74  should be used t
15ef0 6f 20 64 65 66 69 6e 65 20 77 69 64 65 20 69 6e  o define wide in
15f00 74 65 67 65 72 73 3f 5d 29 0a 09 41 43 5f 4d 53  tegers?])..AC_MS
15f10 47 5f 52 45 53 55 4c 54 28 5b 24 7b 74 63 6c 5f  G_RESULT([${tcl_
15f20 63 76 5f 74 79 70 65 5f 36 34 62 69 74 7d 5d 29  cv_type_64bit}])
15f30 0a 0a 09 23 20 4e 6f 77 20 63 68 65 63 6b 20 66  ...# Now check f
15f40 6f 72 20 61 75 78 69 6c 69 61 72 79 20 64 65 63  or auxiliary dec
15f50 6c 61 72 61 74 69 6f 6e 73 0a 09 41 43 5f 43 41  larations..AC_CA
15f60 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20 73  CHE_CHECK([for s
15f70 74 72 75 63 74 20 64 69 72 65 6e 74 36 34 5d 2c  truct dirent64],
15f80 20 74 63 6c 5f 63 76 5f 73 74 72 75 63 74 5f 64   tcl_cv_struct_d
15f90 69 72 65 6e 74 36 34 2c 5b 0a 09 20 20 20 20 41  irent64,[..    A
15fa0 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 23  C_TRY_COMPILE([#
15fb0 69 6e 63 6c 75 64 65 20 3c 73 79 73 2f 74 79 70  include <sys/typ
15fc0 65 73 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c  es.h>.#include <
15fd0 64 69 72 65 6e 74 2e 68 3e 5d 2c 5b 73 74 72 75  dirent.h>],[stru
15fe0 63 74 20 64 69 72 65 6e 74 36 34 20 70 3b 5d 2c  ct dirent64 p;],
15ff0 0a 09 09 74 63 6c 5f 63 76 5f 73 74 72 75 63 74  ...tcl_cv_struct
16000 5f 64 69 72 65 6e 74 36 34 3d 79 65 73 2c 74 63  _dirent64=yes,tc
16010 6c 5f 63 76 5f 73 74 72 75 63 74 5f 64 69 72 65  l_cv_struct_dire
16020 6e 74 36 34 3d 6e 6f 29 5d 29 0a 09 69 66 20 74  nt64=no)])..if t
16030 65 73 74 20 22 78 24 7b 74 63 6c 5f 63 76 5f 73  est "x${tcl_cv_s
16040 74 72 75 63 74 5f 64 69 72 65 6e 74 36 34 7d 22  truct_dirent64}"
16050 20 3d 20 22 78 79 65 73 22 20 3b 20 74 68 65 6e   = "xyes" ; then
16060 0a 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28  ..    AC_DEFINE(
16070 48 41 56 45 5f 53 54 52 55 43 54 5f 44 49 52 45  HAVE_STRUCT_DIRE
16080 4e 54 36 34 2c 20 31 2c 20 5b 49 73 20 27 73 74  NT64, 1, [Is 'st
16090 72 75 63 74 20 64 69 72 65 6e 74 36 34 27 20 69  ruct dirent64' i
160a0 6e 20 3c 73 79 73 2f 74 79 70 65 73 2e 68 3e 3f  n <sys/types.h>?
160b0 5d 29 0a 09 66 69 0a 0a 09 41 43 5f 43 41 43 48  ])..fi...AC_CACH
160c0 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20 73 74 72  E_CHECK([for str
160d0 75 63 74 20 73 74 61 74 36 34 5d 2c 20 74 63 6c  uct stat64], tcl
160e0 5f 63 76 5f 73 74 72 75 63 74 5f 73 74 61 74 36  _cv_struct_stat6
160f0 34 2c 5b 0a 09 20 20 20 20 41 43 5f 54 52 59 5f  4,[..    AC_TRY_
16100 43 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c 75 64  COMPILE([#includ
16110 65 20 3c 73 79 73 2f 73 74 61 74 2e 68 3e 5d 2c  e <sys/stat.h>],
16120 5b 73 74 72 75 63 74 20 73 74 61 74 36 34 20 70  [struct stat64 p
16130 3b 0a 5d 2c 0a 09 09 74 63 6c 5f 63 76 5f 73 74  ;.],...tcl_cv_st
16140 72 75 63 74 5f 73 74 61 74 36 34 3d 79 65 73 2c  ruct_stat64=yes,
16150 74 63 6c 5f 63 76 5f 73 74 72 75 63 74 5f 73 74  tcl_cv_struct_st
16160 61 74 36 34 3d 6e 6f 29 5d 29 0a 09 69 66 20 74  at64=no)])..if t
16170 65 73 74 20 22 78 24 7b 74 63 6c 5f 63 76 5f 73  est "x${tcl_cv_s
16180 74 72 75 63 74 5f 73 74 61 74 36 34 7d 22 20 3d  truct_stat64}" =
16190 20 22 78 79 65 73 22 20 3b 20 74 68 65 6e 0a 09   "xyes" ; then..
161a0 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28 48 41      AC_DEFINE(HA
161b0 56 45 5f 53 54 52 55 43 54 5f 53 54 41 54 36 34  VE_STRUCT_STAT64
161c0 2c 20 31 2c 20 5b 49 73 20 27 73 74 72 75 63 74  , 1, [Is 'struct
161d0 20 73 74 61 74 36 34 27 20 69 6e 20 3c 73 79 73   stat64' in <sys
161e0 2f 73 74 61 74 2e 68 3e 3f 5d 29 0a 09 66 69 0a  /stat.h>?])..fi.
161f0 0a 09 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43 53  ..AC_CHECK_FUNCS
16200 28 6f 70 65 6e 36 34 20 6c 73 65 65 6b 36 34 29  (open64 lseek64)
16210 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e  ..AC_MSG_CHECKIN
16220 47 28 5b 66 6f 72 20 6f 66 66 36 34 5f 74 5d 29  G([for off64_t])
16230 0a 09 41 43 5f 43 41 43 48 45 5f 56 41 4c 28 74  ..AC_CACHE_VAL(t
16240 63 6c 5f 63 76 5f 74 79 70 65 5f 6f 66 66 36 34  cl_cv_type_off64
16250 5f 74 2c 5b 0a 09 20 20 20 20 41 43 5f 54 52 59  _t,[..    AC_TRY
16260 5f 43 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c 75  _COMPILE([#inclu
16270 64 65 20 3c 73 79 73 2f 74 79 70 65 73 2e 68 3e  de <sys/types.h>
16280 5d 2c 5b 6f 66 66 36 34 5f 74 20 6f 66 66 73 65  ],[off64_t offse
16290 74 3b 0a 5d 2c 0a 09 09 74 63 6c 5f 63 76 5f 74  t;.],...tcl_cv_t
162a0 79 70 65 5f 6f 66 66 36 34 5f 74 3d 79 65 73 2c  ype_off64_t=yes,
162b0 74 63 6c 5f 63 76 5f 74 79 70 65 5f 6f 66 66 36  tcl_cv_type_off6
162c0 34 5f 74 3d 6e 6f 29 5d 29 0a 09 64 6e 6c 20 44  4_t=no)])..dnl D
162d0 65 66 69 6e 65 20 48 41 56 45 5f 54 59 50 45 5f  efine HAVE_TYPE_
162e0 4f 46 46 36 34 5f 54 20 6f 6e 6c 79 20 77 68 65  OFF64_T only whe
162f0 6e 20 74 68 65 20 6f 66 66 36 34 5f 74 20 74 79  n the off64_t ty
16300 70 65 20 61 6e 64 20 74 68 65 0a 09 64 6e 6c 20  pe and the..dnl 
16310 66 75 6e 63 74 69 6f 6e 73 20 6c 73 65 65 6b 36  functions lseek6
16320 34 20 61 6e 64 20 6f 70 65 6e 36 34 20 61 72 65  4 and open64 are
16330 20 64 65 66 69 6e 65 64 2e 0a 09 69 66 20 74 65   defined...if te
16340 73 74 20 22 78 24 7b 74 63 6c 5f 63 76 5f 74 79  st "x${tcl_cv_ty
16350 70 65 5f 6f 66 66 36 34 5f 74 7d 22 20 3d 20 22  pe_off64_t}" = "
16360 78 79 65 73 22 20 26 26 20 5c 0a 09 20 20 20 20  xyes" && \..    
16370 20 20 20 20 74 65 73 74 20 22 78 24 7b 61 63 5f      test "x${ac_
16380 63 76 5f 66 75 6e 63 5f 6c 73 65 65 6b 36 34 7d  cv_func_lseek64}
16390 22 20 3d 20 22 78 79 65 73 22 20 26 26 20 5c 0a  " = "xyes" && \.
163a0 09 20 20 20 20 20 20 20 20 74 65 73 74 20 22 78  .        test "x
163b0 24 7b 61 63 5f 63 76 5f 66 75 6e 63 5f 6f 70 65  ${ac_cv_func_ope
163c0 6e 36 34 7d 22 20 3d 20 22 78 79 65 73 22 20 3b  n64}" = "xyes" ;
163d0 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 44 45   then..    AC_DE
163e0 46 49 4e 45 28 48 41 56 45 5f 54 59 50 45 5f 4f  FINE(HAVE_TYPE_O
163f0 46 46 36 34 5f 54 2c 20 31 2c 20 5b 49 73 20 6f  FF64_T, 1, [Is o
16400 66 66 36 34 5f 74 20 69 6e 20 3c 73 79 73 2f 74  ff64_t in <sys/t
16410 79 70 65 73 2e 68 3e 3f 5d 29 0a 09 20 20 20 20  ypes.h>?])..    
16420 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 79  AC_MSG_RESULT([y
16430 65 73 5d 29 0a 09 65 6c 73 65 0a 09 20 20 20 20  es])..else..    
16440 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e  AC_MSG_RESULT([n
16450 6f 5d 29 0a 09 66 69 0a 20 20 20 20 66 69 0a 5d  o])..fi.    fi.]
16460 29 0a 0a 23 23 0a 23 23 20 48 65 72 65 20 65 6e  )..##.## Here en
16470 64 73 20 74 68 65 20 73 74 61 6e 64 61 72 64 20  ds the standard 
16480 54 63 6c 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  Tcl configuratio
16490 6e 20 62 69 74 73 20 61 6e 64 20 73 74 61 72 74  n bits and start
164a0 73 20 74 68 65 0a 23 23 20 54 45 41 20 73 70 65  s the.## TEA spe
164b0 63 69 66 69 63 20 66 75 6e 63 74 69 6f 6e 73 0a  cific functions.
164c0 23 23 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ##..#-----------
164d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
164e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
164f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16500 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
16510 54 45 41 5f 49 4e 49 54 20 2d 2d 0a 23 0a 23 09  TEA_INIT --.#.#.
16520 49 6e 69 74 20 76 61 72 69 6f 75 73 20 54 63 6c  Init various Tcl
16530 20 45 78 74 65 6e 73 69 6f 6e 20 41 72 63 68 69   Extension Archi
16540 74 65 63 74 75 72 65 20 28 54 45 41 29 20 76 61  tecture (TEA) va
16550 72 69 61 62 6c 65 73 2e 0a 23 09 54 68 69 73 20  riables..#.This 
16560 73 68 6f 75 6c 64 20 62 65 20 74 68 65 20 66 69  should be the fi
16570 72 73 74 20 63 61 6c 6c 65 64 20 54 45 41 5f 2a  rst called TEA_*
16580 20 6d 61 63 72 6f 2e 0a 23 0a 23 20 41 72 67 75   macro..#.# Argu
16590 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a  ments:.#.none.#.
165a0 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 44  # Results:.#.#.D
165b0 65 66 69 6e 65 73 20 61 6e 64 20 73 75 62 73 74  efines and subst
165c0 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  s the following 
165d0 76 61 72 73 3a 0a 23 09 09 43 59 47 50 41 54 48  vars:.#..CYGPATH
165e0 0a 23 09 09 45 58 45 45 58 54 0a 23 09 44 65 66  .#..EXEEXT.#.Def
165f0 69 6e 65 73 20 6f 6e 6c 79 3a 0a 23 09 09 54 45  ines only:.#..TE
16600 41 5f 56 45 52 53 49 4f 4e 0a 23 09 09 54 45 41  A_VERSION.#..TEA
16610 5f 49 4e 49 54 45 44 0a 23 09 09 54 45 41 5f 50  _INITED.#..TEA_P
16620 4c 41 54 46 4f 52 4d 20 28 77 69 6e 64 6f 77 73  LATFORM (windows
16630 20 6f 72 20 75 6e 69 78 29 0a 23 0a 23 20 22 63   or unix).#.# "c
16640 79 67 70 61 74 68 22 20 69 73 20 75 73 65 64 20  ygpath" is used 
16650 6f 6e 20 77 69 6e 64 6f 77 73 20 74 6f 20 67 65  on windows to ge
16660 6e 65 72 61 74 65 20 6e 61 74 69 76 65 20 70 61  nerate native pa
16670 74 68 20 6e 61 6d 65 73 20 66 6f 72 20 69 6e 63  th names for inc
16680 6c 75 64 65 0a 23 20 66 69 6c 65 73 2e 20 54 68  lude.# files. Th
16690 65 73 65 20 76 61 72 69 61 62 6c 65 73 20 73 68  ese variables sh
166a0 6f 75 6c 64 20 6f 6e 6c 79 20 62 65 20 75 73 65  ould only be use
166b0 64 20 77 69 74 68 20 74 68 65 20 63 6f 6d 70 69  d with the compi
166c0 6c 65 72 20 61 6e 64 20 6c 69 6e 6b 65 72 0a 23  ler and linker.#
166d0 20 73 69 6e 63 65 20 74 68 65 79 20 67 65 6e 65   since they gene
166e0 72 61 74 65 20 6e 61 74 69 76 65 20 70 61 74 68  rate native path
166f0 20 6e 61 6d 65 73 2e 0a 23 0a 23 20 45 58 45 45   names..#.# EXEE
16700 58 54 0a 23 09 53 65 6c 65 63 74 20 74 68 65 20  XT.#.Select the 
16710 65 78 65 63 75 74 61 62 6c 65 20 65 78 74 65 6e  executable exten
16720 73 69 6f 6e 20 62 61 73 65 64 20 6f 6e 20 74 68  sion based on th
16730 65 20 68 6f 73 74 20 74 79 70 65 2e 20 20 54 68  e host type.  Th
16740 69 73 0a 23 09 69 73 20 61 20 6c 69 67 68 74 77  is.#.is a lightw
16750 65 69 67 68 74 20 72 65 70 6c 61 63 65 6d 65 6e  eight replacemen
16760 74 20 66 6f 72 20 41 43 5f 45 58 45 45 58 54 20  t for AC_EXEEXT 
16770 74 68 61 74 20 64 6f 65 73 6e 27 74 20 72 65 71  that doesn't req
16780 75 69 72 65 0a 23 09 61 20 63 6f 6d 70 69 6c 65  uire.#.a compile
16790 72 2e 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  r..#------------
167a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
167b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
167c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
167d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43  ------------..AC
167e0 5f 44 45 46 55 4e 28 5b 54 45 41 5f 49 4e 49 54  _DEFUN([TEA_INIT
167f0 5d 2c 20 5b 0a 20 20 20 20 23 20 54 45 41 20 65  ], [.    # TEA e
16800 78 74 65 6e 73 69 6f 6e 73 20 70 61 73 73 20 74  xtensions pass t
16810 68 69 73 20 75 73 20 74 68 65 20 76 65 72 73 69  his us the versi
16820 6f 6e 20 6f 66 20 54 45 41 20 74 68 65 79 20 74  on of TEA they t
16830 68 69 6e 6b 20 74 68 65 79 0a 20 20 20 20 23 20  hink they.    # 
16840 61 72 65 20 63 6f 6d 70 61 74 69 62 6c 65 20 77  are compatible w
16850 69 74 68 2e 0a 20 20 20 20 54 45 41 5f 56 45 52  ith..    TEA_VER
16860 53 49 4f 4e 3d 22 33 2e 39 22 0a 0a 20 20 20 20  SION="3.9"..    
16870 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28  AC_MSG_CHECKING(
16880 5b 66 6f 72 20 63 6f 72 72 65 63 74 20 54 45 41  [for correct TEA
16890 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29   configuration])
168a0 0a 20 20 20 20 69 66 20 74 65 73 74 20 78 22 24  .    if test x"$
168b0 7b 50 41 43 4b 41 47 45 5f 4e 41 4d 45 7d 22 20  {PACKAGE_NAME}" 
168c0 3d 20 78 20 3b 20 74 68 65 6e 0a 09 41 43 5f 4d  = x ; then..AC_M
168d0 53 47 5f 45 52 52 4f 52 28 5b 0a 54 68 65 20 50  SG_ERROR([.The P
168e0 41 43 4b 41 47 45 5f 4e 41 4d 45 20 76 61 72 69  ACKAGE_NAME vari
168f0 61 62 6c 65 20 6d 75 73 74 20 62 65 20 64 65 66  able must be def
16900 69 6e 65 64 20 62 79 20 79 6f 75 72 20 54 45 41  ined by your TEA
16910 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 5d 29 0a   configure.in]).
16920 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 74 65      fi.    if te
16930 73 74 20 78 22 24 31 22 20 3d 20 78 20 3b 20 74  st x"$1" = x ; t
16940 68 65 6e 0a 09 41 43 5f 4d 53 47 5f 45 52 52 4f  hen..AC_MSG_ERRO
16950 52 28 5b 0a 54 45 41 20 76 65 72 73 69 6f 6e 20  R([.TEA version 
16960 6e 6f 74 20 73 70 65 63 69 66 69 65 64 2e 5d 29  not specified.])
16970 0a 20 20 20 20 65 6c 69 66 20 74 65 73 74 20 22  .    elif test "
16980 24 31 22 20 21 3d 20 22 24 7b 54 45 41 5f 56 45  $1" != "${TEA_VE
16990 52 53 49 4f 4e 7d 22 20 3b 20 74 68 65 6e 0a 09  RSION}" ; then..
169a0 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 77  AC_MSG_RESULT([w
169b0 61 72 6e 69 6e 67 3a 20 72 65 71 75 65 73 74 65  arning: requeste
169c0 64 20 54 45 41 20 76 65 72 73 69 6f 6e 20 22 24  d TEA version "$
169d0 31 22 2c 20 68 61 76 65 20 22 24 7b 54 45 41 5f  1", have "${TEA_
169e0 56 45 52 53 49 4f 4e 7d 22 5d 29 0a 20 20 20 20  VERSION}"]).    
169f0 65 6c 73 65 0a 09 41 43 5f 4d 53 47 5f 52 45 53  else..AC_MSG_RES
16a00 55 4c 54 28 5b 6f 6b 20 28 54 45 41 20 24 7b 54  ULT([ok (TEA ${T
16a10 45 41 5f 56 45 52 53 49 4f 4e 7d 29 5d 29 0a 20  EA_VERSION})]). 
16a20 20 20 20 66 69 0a 0a 20 20 20 20 23 20 49 66 20     fi..    # If 
16a30 74 68 65 20 75 73 65 72 20 64 69 64 20 6e 6f 74  the user did not
16a40 20 73 65 74 20 43 46 4c 41 47 53 2c 20 73 65 74   set CFLAGS, set
16a50 20 69 74 20 6e 6f 77 20 74 6f 20 6b 65 65 70 20   it now to keep 
16a60 6d 61 63 72 6f 73 0a 20 20 20 20 23 20 6c 69 6b  macros.    # lik
16a70 65 20 41 43 5f 50 52 4f 47 5f 43 43 20 61 6e 64  e AC_PROG_CC and
16a80 20 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 20   AC_TRY_COMPILE 
16a90 66 72 6f 6d 20 61 64 64 69 6e 67 20 22 2d 67 20  from adding "-g 
16aa0 2d 4f 32 22 2e 0a 20 20 20 20 69 66 20 74 65 73  -O2"..    if tes
16ab0 74 20 22 24 7b 43 46 4c 41 47 53 2b 73 65 74 7d  t "${CFLAGS+set}
16ac0 22 20 21 3d 20 22 73 65 74 22 20 3b 20 74 68 65  " != "set" ; the
16ad0 6e 0a 09 43 46 4c 41 47 53 3d 22 22 0a 20 20 20  n..CFLAGS="".   
16ae0 20 66 69 0a 0a 20 20 20 20 63 61 73 65 20 22 60   fi..    case "`
16af0 75 6e 61 6d 65 20 2d 73 60 22 20 69 6e 0a 09 2a  uname -s`" in..*
16b00 77 69 6e 33 32 2a 7c 2a 57 49 4e 33 32 2a 7c 2a  win32*|*WIN32*|*
16b10 4d 49 4e 47 57 33 32 5f 2a 29 0a 09 20 20 20 20  MINGW32_*)..    
16b20 41 43 5f 43 48 45 43 4b 5f 50 52 4f 47 28 43 59  AC_CHECK_PROG(CY
16b30 47 50 41 54 48 2c 20 63 79 67 70 61 74 68 2c 20  GPATH, cygpath, 
16b40 63 79 67 70 61 74 68 20 2d 77 2c 20 65 63 68 6f  cygpath -w, echo
16b50 29 0a 09 20 20 20 20 45 58 45 45 58 54 3d 22 2e  )..    EXEEXT=".
16b60 65 78 65 22 0a 09 20 20 20 20 54 45 41 5f 50 4c  exe"..    TEA_PL
16b70 41 54 46 4f 52 4d 3d 22 77 69 6e 64 6f 77 73 22  ATFORM="windows"
16b80 0a 09 20 20 20 20 3b 3b 0a 09 2a 43 59 47 57 49  ..    ;;..*CYGWI
16b90 4e 5f 2a 29 0a 09 20 20 20 20 43 59 47 50 41 54  N_*)..    CYGPAT
16ba0 48 3d 65 63 68 6f 0a 09 20 20 20 20 45 58 45 45  H=echo..    EXEE
16bb0 58 54 3d 22 2e 65 78 65 22 0a 09 20 20 20 20 23  XT=".exe"..    #
16bc0 20 54 45 41 5f 50 4c 41 54 46 4f 52 4d 20 69 73   TEA_PLATFORM is
16bd0 20 64 65 74 65 72 6d 69 6e 65 64 20 6c 61 74 65   determined late
16be0 72 20 69 6e 20 4c 4f 41 44 5f 54 43 4c 43 4f 4e  r in LOAD_TCLCON
16bf0 46 49 47 0a 09 20 20 20 20 3b 3b 0a 09 2a 29 0a  FIG..    ;;..*).
16c00 09 20 20 20 20 43 59 47 50 41 54 48 3d 65 63 68  .    CYGPATH=ech
16c10 6f 0a 09 20 20 20 20 23 20 4d 61 79 62 65 20 77  o..    # Maybe w
16c20 65 20 61 72 65 20 63 72 6f 73 73 2d 63 6f 6d 70  e are cross-comp
16c30 69 6c 69 6e 67 2e 2e 2e 2e 0a 09 20 20 20 20 63  iling......    c
16c40 61 73 65 20 24 7b 68 6f 73 74 5f 61 6c 69 61 73  ase ${host_alias
16c50 7d 20 69 6e 0a 09 09 2a 6d 69 6e 67 77 33 32 2a  } in...*mingw32*
16c60 29 0a 09 09 45 58 45 45 58 54 3d 22 2e 65 78 65  )...EXEEXT=".exe
16c70 22 0a 09 09 54 45 41 5f 50 4c 41 54 46 4f 52 4d  "...TEA_PLATFORM
16c80 3d 22 77 69 6e 64 6f 77 73 22 0a 09 09 3b 3b 0a  ="windows"...;;.
16c90 09 20 20 20 20 2a 29 0a 09 09 45 58 45 45 58 54  .    *)...EXEEXT
16ca0 3d 22 22 0a 09 09 54 45 41 5f 50 4c 41 54 46 4f  =""...TEA_PLATFO
16cb0 52 4d 3d 22 75 6e 69 78 22 0a 09 09 3b 3b 0a 09  RM="unix"...;;..
16cc0 20 20 20 20 65 73 61 63 0a 09 20 20 20 20 3b 3b      esac..    ;;
16cd0 0a 20 20 20 20 65 73 61 63 0a 0a 20 20 20 20 23  .    esac..    #
16ce0 20 43 68 65 63 6b 20 69 66 20 65 78 65 63 5f 70   Check if exec_p
16cf0 72 65 66 69 78 20 69 73 20 73 65 74 2e 20 49 66  refix is set. If
16d00 20 6e 6f 74 20 75 73 65 20 66 61 6c 6c 20 62 61   not use fall ba
16d10 63 6b 20 74 6f 20 70 72 65 66 69 78 2e 0a 20 20  ck to prefix..  
16d20 20 20 23 20 4e 6f 74 65 20 77 68 65 6e 20 61 64    # Note when ad
16d30 6a 75 73 74 65 64 2c 20 73 6f 20 74 68 61 74 20  justed, so that 
16d40 54 45 41 5f 50 52 45 46 49 58 20 63 61 6e 20 63  TEA_PREFIX can c
16d50 6f 72 72 65 63 74 20 66 6f 72 20 74 68 69 73 2e  orrect for this.
16d60 0a 20 20 20 20 23 20 54 68 69 73 20 69 73 20 6e  .    # This is n
16d70 65 65 64 65 64 20 66 6f 72 20 72 65 63 75 72 73  eeded for recurs
16d80 69 76 65 20 63 6f 6e 66 69 67 75 72 65 73 2c 20  ive configures, 
16d90 73 69 6e 63 65 20 61 75 74 6f 63 6f 6e 66 20 70  since autoconf p
16da0 72 6f 70 61 67 61 74 65 73 0a 20 20 20 20 23 20  ropagates.    # 
16db0 24 70 72 65 66 69 78 2c 20 62 75 74 20 6e 6f 74  $prefix, but not
16dc0 20 24 65 78 65 63 5f 70 72 65 66 69 78 20 28 64   $exec_prefix (d
16dd0 6f 68 21 29 2e 0a 20 20 20 20 69 66 20 74 65 73  oh!)..    if tes
16de0 74 20 78 24 65 78 65 63 5f 70 72 65 66 69 78 20  t x$exec_prefix 
16df0 3d 20 78 4e 4f 4e 45 20 3b 20 74 68 65 6e 0a 09  = xNONE ; then..
16e00 65 78 65 63 5f 70 72 65 66 69 78 5f 64 65 66 61  exec_prefix_defa
16e10 75 6c 74 3d 79 65 73 0a 09 65 78 65 63 5f 70 72  ult=yes..exec_pr
16e20 65 66 69 78 3d 24 70 72 65 66 69 78 0a 20 20 20  efix=$prefix.   
16e30 20 66 69 0a 0a 20 20 20 20 41 43 5f 4d 53 47 5f   fi..    AC_MSG_
16e40 4e 4f 54 49 43 45 28 5b 63 6f 6e 66 69 67 75 72  NOTICE([configur
16e50 69 6e 67 20 24 7b 50 41 43 4b 41 47 45 5f 4e 41  ing ${PACKAGE_NA
16e60 4d 45 7d 20 24 7b 50 41 43 4b 41 47 45 5f 56 45  ME} ${PACKAGE_VE
16e70 52 53 49 4f 4e 7d 5d 29 0a 0a 20 20 20 20 41 43  RSION}])..    AC
16e80 5f 53 55 42 53 54 28 45 58 45 45 58 54 29 0a 20  _SUBST(EXEEXT). 
16e90 20 20 20 41 43 5f 53 55 42 53 54 28 43 59 47 50     AC_SUBST(CYGP
16ea0 41 54 48 29 0a 0a 20 20 20 20 23 20 54 68 69 73  ATH)..    # This
16eb0 20 70 61 63 6b 61 67 65 20 6e 61 6d 65 20 6d 75   package name mu
16ec0 73 74 20 62 65 20 72 65 70 6c 61 63 65 64 20 73  st be replaced s
16ed0 74 61 74 69 63 61 6c 6c 79 20 66 6f 72 20 41 43  tatically for AC
16ee0 5f 53 55 42 53 54 20 74 6f 20 77 6f 72 6b 0a 20  _SUBST to work. 
16ef0 20 20 20 41 43 5f 53 55 42 53 54 28 50 4b 47 5f     AC_SUBST(PKG_
16f00 4c 49 42 5f 46 49 4c 45 29 0a 20 20 20 20 23 20  LIB_FILE).    # 
16f10 53 75 62 73 74 69 74 75 74 65 20 53 54 55 42 5f  Substitute STUB_
16f20 4c 49 42 5f 46 49 4c 45 20 69 6e 20 63 61 73 65  LIB_FILE in case
16f30 20 70 61 63 6b 61 67 65 20 63 72 65 61 74 65 73   package creates
16f40 20 61 20 73 74 75 62 20 6c 69 62 72 61 72 79 20   a stub library 
16f50 74 6f 6f 2e 0a 20 20 20 20 41 43 5f 53 55 42 53  too..    AC_SUBS
16f60 54 28 50 4b 47 5f 53 54 55 42 5f 4c 49 42 5f 46  T(PKG_STUB_LIB_F
16f70 49 4c 45 29 0a 0a 20 20 20 20 23 20 57 65 20 41  ILE)..    # We A
16f80 43 5f 53 55 42 53 54 20 74 68 65 73 65 20 68 65  C_SUBST these he
16f90 72 65 20 74 6f 20 65 6e 73 75 72 65 20 74 68 65  re to ensure the
16fa0 79 20 61 72 65 20 73 75 62 73 74 27 65 64 2c 0a  y are subst'ed,.
16fb0 20 20 20 20 23 20 69 6e 20 63 61 73 65 20 74 68      # in case th
16fc0 65 20 75 73 65 72 20 64 6f 65 73 6e 27 74 20 63  e user doesn't c
16fd0 61 6c 6c 20 54 45 41 5f 41 44 44 5f 2e 2e 2e 0a  all TEA_ADD_....
16fe0 20 20 20 20 41 43 5f 53 55 42 53 54 28 50 4b 47      AC_SUBST(PKG
16ff0 5f 53 54 55 42 5f 53 4f 55 52 43 45 53 29 0a 20  _STUB_SOURCES). 
17000 20 20 20 41 43 5f 53 55 42 53 54 28 50 4b 47 5f     AC_SUBST(PKG_
17010 53 54 55 42 5f 4f 42 4a 45 43 54 53 29 0a 20 20  STUB_OBJECTS).  
17020 20 20 41 43 5f 53 55 42 53 54 28 50 4b 47 5f 54    AC_SUBST(PKG_T
17030 43 4c 5f 53 4f 55 52 43 45 53 29 0a 20 20 20 20  CL_SOURCES).    
17040 41 43 5f 53 55 42 53 54 28 50 4b 47 5f 48 45 41  AC_SUBST(PKG_HEA
17050 44 45 52 53 29 0a 20 20 20 20 41 43 5f 53 55 42  DERS).    AC_SUB
17060 53 54 28 50 4b 47 5f 49 4e 43 4c 55 44 45 53 29  ST(PKG_INCLUDES)
17070 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 50 4b  .    AC_SUBST(PK
17080 47 5f 4c 49 42 53 29 0a 20 20 20 20 41 43 5f 53  G_LIBS).    AC_S
17090 55 42 53 54 28 50 4b 47 5f 43 46 4c 41 47 53 29  UBST(PKG_CFLAGS)
170a0 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .])..#----------
170b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
170c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
170d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
170e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
170f0 20 54 45 41 5f 41 44 44 5f 53 4f 55 52 43 45 53   TEA_ADD_SOURCES
17100 20 2d 2d 0a 23 0a 23 09 53 70 65 63 69 66 79 20   --.#.#.Specify 
17110 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 73 6f 75 72  one or more sour
17120 63 65 20 66 69 6c 65 73 2e 20 20 55 73 65 72 73  ce files.  Users
17130 20 73 68 6f 75 6c 64 20 63 68 65 63 6b 20 66 6f   should check fo
17140 72 0a 23 09 74 68 65 20 72 69 67 68 74 20 70 6c  r.#.the right pl
17150 61 74 66 6f 72 6d 20 62 65 66 6f 72 65 20 61 64  atform before ad
17160 64 69 6e 67 20 74 6f 20 74 68 65 69 72 20 6c 69  ding to their li
17170 73 74 2e 0a 23 09 49 74 20 69 73 20 6e 6f 74 20  st..#.It is not 
17180 69 6d 70 6f 72 74 61 6e 74 20 74 6f 20 73 70 65  important to spe
17190 63 69 66 79 20 74 68 65 20 64 69 72 65 63 74 6f  cify the directo
171a0 72 79 2c 20 61 73 20 6c 6f 6e 67 20 61 73 20 69  ry, as long as i
171b0 74 20 69 73 0a 23 09 69 6e 20 74 68 65 20 67 65  t is.#.in the ge
171c0 6e 65 72 69 63 2c 20 77 69 6e 20 6f 72 20 75 6e  neric, win or un
171d0 69 78 20 73 75 62 64 69 72 65 63 74 6f 72 79 20  ix subdirectory 
171e0 6f 66 20 24 28 73 72 63 64 69 72 29 2e 0a 23 0a  of $(srcdir)..#.
171f0 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6f  # Arguments:.#.o
17200 6e 65 20 6f 72 20 6d 6f 72 65 20 66 69 6c 65 20  ne or more file 
17210 6e 61 6d 65 73 0a 23 0a 23 20 52 65 73 75 6c 74  names.#.# Result
17220 73 3a 0a 23 0a 23 09 44 65 66 69 6e 65 73 20 61  s:.#.#.Defines a
17230 6e 64 20 73 75 62 73 74 73 20 74 68 65 20 66 6f  nd substs the fo
17240 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09  llowing vars:.#.
17250 09 50 4b 47 5f 53 4f 55 52 43 45 53 0a 23 09 09  .PKG_SOURCES.#..
17260 50 4b 47 5f 4f 42 4a 45 43 54 53 0a 23 2d 2d 2d  PKG_OBJECTS.#---
17270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
172a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
172b0 2d 2d 2d 2d 2d 0a 41 43 5f 44 45 46 55 4e 28 5b  -----.AC_DEFUN([
172c0 54 45 41 5f 41 44 44 5f 53 4f 55 52 43 45 53 5d  TEA_ADD_SOURCES]
172d0 2c 20 5b 0a 20 20 20 20 76 61 72 73 3d 22 24 40  , [.    vars="$@
172e0 22 0a 20 20 20 20 66 6f 72 20 69 20 69 6e 20 24  ".    for i in $
172f0 76 61 72 73 3b 20 64 6f 0a 09 63 61 73 65 20 24  vars; do..case $
17300 69 20 69 6e 0a 09 20 20 20 20 5b 5c 24 5d 2a 29  i in..    [\$]*)
17310 0a 09 09 23 20 61 6c 6c 6f 77 20 24 2d 76 61 72  ...# allow $-var
17320 20 6e 61 6d 65 73 0a 09 09 50 4b 47 5f 53 4f 55   names...PKG_SOU
17330 52 43 45 53 3d 22 24 50 4b 47 5f 53 4f 55 52 43  RCES="$PKG_SOURC
17340 45 53 20 24 69 22 0a 09 09 50 4b 47 5f 4f 42 4a  ES $i"...PKG_OBJ
17350 45 43 54 53 3d 22 24 50 4b 47 5f 4f 42 4a 45 43  ECTS="$PKG_OBJEC
17360 54 53 20 24 69 22 0a 09 09 3b 3b 0a 09 20 20 20  TS $i"...;;..   
17370 20 2a 29 0a 09 09 23 20 63 68 65 63 6b 20 66 6f   *)...# check fo
17380 72 20 65 78 69 73 74 65 6e 63 65 20 2d 20 61 6c  r existence - al
17390 6c 6f 77 73 20 66 6f 72 20 67 65 6e 65 72 69 63  lows for generic
173a0 2f 77 69 6e 2f 75 6e 69 78 20 56 50 41 54 48 0a  /win/unix VPATH.
173b0 09 09 23 20 54 6f 20 61 64 64 20 6d 6f 72 65 20  ..# To add more 
173c0 64 69 72 73 20 68 65 72 65 20 28 6c 69 6b 65 20  dirs here (like 
173d0 27 73 72 63 27 29 2c 20 79 6f 75 20 68 61 76 65  'src'), you have
173e0 20 74 6f 20 75 70 64 61 74 65 20 56 50 41 54 48   to update VPATH
173f0 0a 09 09 23 20 69 6e 20 4d 61 6b 65 66 69 6c 65  ...# in Makefile
17400 2e 69 6e 20 61 73 20 77 65 6c 6c 0a 09 09 69 66  .in as well...if
17410 20 74 65 73 74 20 21 20 2d 66 20 22 24 7b 73 72   test ! -f "${sr
17420 63 64 69 72 7d 2f 24 69 22 20 2d 61 20 21 20 2d  cdir}/$i" -a ! -
17430 66 20 22 24 7b 73 72 63 64 69 72 7d 2f 67 65 6e  f "${srcdir}/gen
17440 65 72 69 63 2f 24 69 22 20 5c 0a 09 09 20 20 20  eric/$i" \...   
17450 20 2d 61 20 21 20 2d 66 20 22 24 7b 73 72 63 64   -a ! -f "${srcd
17460 69 72 7d 2f 77 69 6e 2f 24 69 22 20 2d 61 20 21  ir}/win/$i" -a !
17470 20 2d 66 20 22 24 7b 73 72 63 64 69 72 7d 2f 75   -f "${srcdir}/u
17480 6e 69 78 2f 24 69 22 20 5c 0a 09 09 20 20 20 20  nix/$i" \...    
17490 2d 61 20 21 20 2d 66 20 22 24 7b 73 72 63 64 69  -a ! -f "${srcdi
174a0 72 7d 2f 6d 61 63 6f 73 78 2f 24 69 22 20 5c 0a  r}/macosx/$i" \.
174b0 09 09 20 20 20 20 3b 20 74 68 65 6e 0a 09 09 20  ..    ; then... 
174c0 20 20 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28     AC_MSG_ERROR(
174d0 5b 63 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64 20  [could not find 
174e0 73 6f 75 72 63 65 20 66 69 6c 65 20 27 24 69 27  source file '$i'
174f0 5d 29 0a 09 09 66 69 0a 09 09 50 4b 47 5f 53 4f  ])...fi...PKG_SO
17500 55 52 43 45 53 3d 22 24 50 4b 47 5f 53 4f 55 52  URCES="$PKG_SOUR
17510 43 45 53 20 24 69 22 0a 09 09 23 20 74 68 69 73  CES $i"...# this
17520 20 61 73 73 75 6d 65 73 20 69 74 20 69 73 20 69   assumes it is i
17530 6e 20 61 20 56 50 41 54 48 20 64 69 72 0a 09 09  n a VPATH dir...
17540 69 3d 60 62 61 73 65 6e 61 6d 65 20 24 69 60 0a  i=`basename $i`.
17550 09 09 23 20 68 61 6e 64 6c 65 20 75 73 65 72 20  ..# handle user 
17560 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 62 65 66  calling this bef
17570 6f 72 65 20 6f 72 20 61 66 74 65 72 20 54 45 41  ore or after TEA
17580 5f 53 45 54 55 50 5f 43 4f 4d 50 49 4c 45 52 0a  _SETUP_COMPILER.
17590 09 09 69 66 20 74 65 73 74 20 78 22 24 7b 4f 42  ..if test x"${OB
175a0 4a 45 58 54 7d 22 20 21 3d 20 78 20 3b 20 74 68  JEXT}" != x ; th
175b0 65 6e 0a 09 09 20 20 20 20 6a 3d 22 60 65 63 68  en...    j="`ech
175c0 6f 20 24 69 20 7c 20 73 65 64 20 2d 65 20 27 73  o $i | sed -e 's
175d0 2f 5c 2e 5b 5b 5e 2e 5d 5d 2a 24 2f 2f 27 60 2e  /\.[[^.]]*$//'`.
175e0 24 7b 4f 42 4a 45 58 54 7d 22 0a 09 09 65 6c 73  ${OBJEXT}"...els
175f0 65 0a 09 09 20 20 20 20 6a 3d 22 60 65 63 68 6f  e...    j="`echo
17600 20 24 69 20 7c 20 73 65 64 20 2d 65 20 27 73 2f   $i | sed -e 's/
17610 5c 2e 5b 5b 5e 2e 5d 5d 2a 24 2f 2f 27 60 2e 5c  \.[[^.]]*$//'`.\
17620 24 7b 4f 42 4a 45 58 54 7d 22 0a 09 09 66 69 0a  ${OBJEXT}"...fi.
17630 09 09 50 4b 47 5f 4f 42 4a 45 43 54 53 3d 22 24  ..PKG_OBJECTS="$
17640 50 4b 47 5f 4f 42 4a 45 43 54 53 20 24 6a 22 0a  PKG_OBJECTS $j".
17650 09 09 3b 3b 0a 09 65 73 61 63 0a 20 20 20 20 64  ..;;..esac.    d
17660 6f 6e 65 0a 20 20 20 20 41 43 5f 53 55 42 53 54  one.    AC_SUBST
17670 28 50 4b 47 5f 53 4f 55 52 43 45 53 29 0a 20 20  (PKG_SOURCES).  
17680 20 20 41 43 5f 53 55 42 53 54 28 50 4b 47 5f 4f    AC_SUBST(PKG_O
17690 42 4a 45 43 54 53 29 0a 5d 29 0a 0a 23 2d 2d 2d  BJECTS).])..#---
176a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
176b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
176c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
176d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
176e0 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f 41 44 44 5f  -----.# TEA_ADD_
176f0 53 54 55 42 5f 53 4f 55 52 43 45 53 20 2d 2d 0a  STUB_SOURCES --.
17700 23 0a 23 09 53 70 65 63 69 66 79 20 6f 6e 65 20  #.#.Specify one 
17710 6f 72 20 6d 6f 72 65 20 73 6f 75 72 63 65 20 66  or more source f
17720 69 6c 65 73 2e 20 20 55 73 65 72 73 20 73 68 6f  iles.  Users sho
17730 75 6c 64 20 63 68 65 63 6b 20 66 6f 72 0a 23 09  uld check for.#.
17740 74 68 65 20 72 69 67 68 74 20 70 6c 61 74 66 6f  the right platfo
17750 72 6d 20 62 65 66 6f 72 65 20 61 64 64 69 6e 67  rm before adding
17760 20 74 6f 20 74 68 65 69 72 20 6c 69 73 74 2e 0a   to their list..
17770 23 09 49 74 20 69 73 20 6e 6f 74 20 69 6d 70 6f  #.It is not impo
17780 72 74 61 6e 74 20 74 6f 20 73 70 65 63 69 66 79  rtant to specify
17790 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 2c 20   the directory, 
177a0 61 73 20 6c 6f 6e 67 20 61 73 20 69 74 20 69 73  as long as it is
177b0 0a 23 09 69 6e 20 74 68 65 20 67 65 6e 65 72 69  .#.in the generi
177c0 63 2c 20 77 69 6e 20 6f 72 20 75 6e 69 78 20 73  c, win or unix s
177d0 75 62 64 69 72 65 63 74 6f 72 79 20 6f 66 20 24  ubdirectory of $
177e0 28 73 72 63 64 69 72 29 2e 0a 23 0a 23 20 41 72  (srcdir)..#.# Ar
177f0 67 75 6d 65 6e 74 73 3a 0a 23 09 6f 6e 65 20 6f  guments:.#.one o
17800 72 20 6d 6f 72 65 20 66 69 6c 65 20 6e 61 6d 65  r more file name
17810 73 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23  s.#.# Results:.#
17820 0a 23 09 44 65 66 69 6e 65 73 20 61 6e 64 20 73  .#.Defines and s
17830 75 62 73 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77  ubsts the follow
17840 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 50 4b 47  ing vars:.#..PKG
17850 5f 53 54 55 42 5f 53 4f 55 52 43 45 53 0a 23 09  _STUB_SOURCES.#.
17860 09 50 4b 47 5f 53 54 55 42 5f 4f 42 4a 45 43 54  .PKG_STUB_OBJECT
17870 53 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  S.#-------------
17880 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
178a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
178b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 43 5f 44  -----------.AC_D
178c0 45 46 55 4e 28 5b 54 45 41 5f 41 44 44 5f 53 54  EFUN([TEA_ADD_ST
178d0 55 42 5f 53 4f 55 52 43 45 53 5d 2c 20 5b 0a 20  UB_SOURCES], [. 
178e0 20 20 20 76 61 72 73 3d 22 24 40 22 0a 20 20 20     vars="$@".   
178f0 20 66 6f 72 20 69 20 69 6e 20 24 76 61 72 73 3b   for i in $vars;
17900 20 64 6f 0a 09 23 20 63 68 65 63 6b 20 66 6f 72   do..# check for
17910 20 65 78 69 73 74 65 6e 63 65 20 2d 20 61 6c 6c   existence - all
17920 6f 77 73 20 66 6f 72 20 67 65 6e 65 72 69 63 2f  ows for generic/
17930 77 69 6e 2f 75 6e 69 78 20 56 50 41 54 48 0a 09  win/unix VPATH..
17940 69 66 20 74 65 73 74 20 21 20 2d 66 20 22 24 7b  if test ! -f "${
17950 73 72 63 64 69 72 7d 2f 24 69 22 20 2d 61 20 21  srcdir}/$i" -a !
17960 20 2d 66 20 22 24 7b 73 72 63 64 69 72 7d 2f 67   -f "${srcdir}/g
17970 65 6e 65 72 69 63 2f 24 69 22 20 5c 0a 09 20 20  eneric/$i" \..  
17980 20 20 2d 61 20 21 20 2d 66 20 22 24 7b 73 72 63    -a ! -f "${src
17990 64 69 72 7d 2f 77 69 6e 2f 24 69 22 20 2d 61 20  dir}/win/$i" -a 
179a0 21 20 2d 66 20 22 24 7b 73 72 63 64 69 72 7d 2f  ! -f "${srcdir}/
179b0 75 6e 69 78 2f 24 69 22 20 5c 0a 09 20 20 20 20  unix/$i" \..    
179c0 2d 61 20 21 20 2d 66 20 22 24 7b 73 72 63 64 69  -a ! -f "${srcdi
179d0 72 7d 2f 6d 61 63 6f 73 78 2f 24 69 22 20 5c 0a  r}/macosx/$i" \.
179e0 09 20 20 20 20 3b 20 74 68 65 6e 0a 09 20 20 20  .    ; then..   
179f0 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 63   AC_MSG_ERROR([c
17a00 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64 20 73 74  ould not find st
17a10 75 62 20 73 6f 75 72 63 65 20 66 69 6c 65 20 27  ub source file '
17a20 24 69 27 5d 29 0a 09 66 69 0a 09 50 4b 47 5f 53  $i'])..fi..PKG_S
17a30 54 55 42 5f 53 4f 55 52 43 45 53 3d 22 24 50 4b  TUB_SOURCES="$PK
17a40 47 5f 53 54 55 42 5f 53 4f 55 52 43 45 53 20 24  G_STUB_SOURCES $
17a50 69 22 0a 09 23 20 74 68 69 73 20 61 73 73 75 6d  i"..# this assum
17a60 65 73 20 69 74 20 69 73 20 69 6e 20 61 20 56 50  es it is in a VP
17a70 41 54 48 20 64 69 72 0a 09 69 3d 60 62 61 73 65  ATH dir..i=`base
17a80 6e 61 6d 65 20 24 69 60 0a 09 23 20 68 61 6e 64  name $i`..# hand
17a90 6c 65 20 75 73 65 72 20 63 61 6c 6c 69 6e 67 20  le user calling 
17aa0 74 68 69 73 20 62 65 66 6f 72 65 20 6f 72 20 61  this before or a
17ab0 66 74 65 72 20 54 45 41 5f 53 45 54 55 50 5f 43  fter TEA_SETUP_C
17ac0 4f 4d 50 49 4c 45 52 0a 09 69 66 20 74 65 73 74  OMPILER..if test
17ad0 20 78 22 24 7b 4f 42 4a 45 58 54 7d 22 20 21 3d   x"${OBJEXT}" !=
17ae0 20 78 20 3b 20 74 68 65 6e 0a 09 20 20 20 20 6a   x ; then..    j
17af0 3d 22 60 65 63 68 6f 20 24 69 20 7c 20 73 65 64  ="`echo $i | sed
17b00 20 2d 65 20 27 73 2f 5c 2e 5b 5b 5e 2e 5d 5d 2a   -e 's/\.[[^.]]*
17b10 24 2f 2f 27 60 2e 24 7b 4f 42 4a 45 58 54 7d 22  $//'`.${OBJEXT}"
17b20 0a 09 65 6c 73 65 0a 09 20 20 20 20 6a 3d 22 60  ..else..    j="`
17b30 65 63 68 6f 20 24 69 20 7c 20 73 65 64 20 2d 65  echo $i | sed -e
17b40 20 27 73 2f 5c 2e 5b 5b 5e 2e 5d 5d 2a 24 2f 2f   's/\.[[^.]]*$//
17b50 27 60 2e 5c 24 7b 4f 42 4a 45 58 54 7d 22 0a 09  '`.\${OBJEXT}"..
17b60 66 69 0a 09 50 4b 47 5f 53 54 55 42 5f 4f 42 4a  fi..PKG_STUB_OBJ
17b70 45 43 54 53 3d 22 24 50 4b 47 5f 53 54 55 42 5f  ECTS="$PKG_STUB_
17b80 4f 42 4a 45 43 54 53 20 24 6a 22 0a 20 20 20 20  OBJECTS $j".    
17b90 64 6f 6e 65 0a 20 20 20 20 41 43 5f 53 55 42 53  done.    AC_SUBS
17ba0 54 28 50 4b 47 5f 53 54 55 42 5f 53 4f 55 52 43  T(PKG_STUB_SOURC
17bb0 45 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54  ES).    AC_SUBST
17bc0 28 50 4b 47 5f 53 54 55 42 5f 4f 42 4a 45 43 54  (PKG_STUB_OBJECT
17bd0 53 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  S).])..#--------
17be0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17bf0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17c00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17c10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17c20 0a 23 20 54 45 41 5f 41 44 44 5f 54 43 4c 5f 53  .# TEA_ADD_TCL_S
17c30 4f 55 52 43 45 53 20 2d 2d 0a 23 0a 23 09 53 70  OURCES --.#.#.Sp
17c40 65 63 69 66 79 20 6f 6e 65 20 6f 72 20 6d 6f 72  ecify one or mor
17c50 65 20 54 63 6c 20 73 6f 75 72 63 65 20 66 69 6c  e Tcl source fil
17c60 65 73 2e 20 20 54 68 65 73 65 20 73 68 6f 75 6c  es.  These shoul
17c70 64 20 62 65 20 70 6c 61 74 66 6f 72 6d 0a 23 09  d be platform.#.
17c80 69 6e 64 65 70 65 6e 64 65 6e 74 20 72 75 6e 74  independent runt
17c90 69 6d 65 20 66 69 6c 65 73 2e 0a 23 0a 23 20 41  ime files..#.# A
17ca0 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6f 6e 65 20  rguments:.#.one 
17cb0 6f 72 20 6d 6f 72 65 20 66 69 6c 65 20 6e 61 6d  or more file nam
17cc0 65 73 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a  es.#.# Results:.
17cd0 23 0a 23 09 44 65 66 69 6e 65 73 20 61 6e 64 20  #.#.Defines and 
17ce0 73 75 62 73 74 73 20 74 68 65 20 66 6f 6c 6c 6f  substs the follo
17cf0 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 50 4b  wing vars:.#..PK
17d00 47 5f 54 43 4c 5f 53 4f 55 52 43 45 53 0a 23 2d  G_TCL_SOURCES.#-
17d10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17d20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17d30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17d40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17d50 2d 2d 2d 2d 2d 2d 2d 0a 41 43 5f 44 45 46 55 4e  -------.AC_DEFUN
17d60 28 5b 54 45 41 5f 41 44 44 5f 54 43 4c 5f 53 4f  ([TEA_ADD_TCL_SO
17d70 55 52 43 45 53 5d 2c 20 5b 0a 20 20 20 20 76 61  URCES], [.    va
17d80 72 73 3d 22 24 40 22 0a 20 20 20 20 66 6f 72 20  rs="$@".    for 
17d90 69 20 69 6e 20 24 76 61 72 73 3b 20 64 6f 0a 09  i in $vars; do..
17da0 23 20 63 68 65 63 6b 20 66 6f 72 20 65 78 69 73  # check for exis
17db0 74 65 6e 63 65 2c 20 62 65 20 73 74 72 69 63 74  tence, be strict
17dc0 20 62 65 63 61 75 73 65 20 69 74 20 69 73 20 69   because it is i
17dd0 6e 73 74 61 6c 6c 65 64 0a 09 69 66 20 74 65 73  nstalled..if tes
17de0 74 20 21 20 2d 66 20 22 24 7b 73 72 63 64 69 72  t ! -f "${srcdir
17df0 7d 2f 24 69 22 20 3b 20 74 68 65 6e 0a 09 20 20  }/$i" ; then..  
17e00 20 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b    AC_MSG_ERROR([
17e10 63 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64 20 74  could not find t
17e20 63 6c 20 73 6f 75 72 63 65 20 66 69 6c 65 20 27  cl source file '
17e30 24 7b 73 72 63 64 69 72 7d 2f 24 69 27 5d 29 0a  ${srcdir}/$i']).
17e40 09 66 69 0a 09 50 4b 47 5f 54 43 4c 5f 53 4f 55  .fi..PKG_TCL_SOU
17e50 52 43 45 53 3d 22 24 50 4b 47 5f 54 43 4c 5f 53  RCES="$PKG_TCL_S
17e60 4f 55 52 43 45 53 20 24 69 22 0a 20 20 20 20 64  OURCES $i".    d
17e70 6f 6e 65 0a 20 20 20 20 41 43 5f 53 55 42 53 54  one.    AC_SUBST
17e80 28 50 4b 47 5f 54 43 4c 5f 53 4f 55 52 43 45 53  (PKG_TCL_SOURCES
17e90 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ).])..#---------
17ea0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17eb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17ec0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17ed0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
17ee0 23 20 54 45 41 5f 41 44 44 5f 48 45 41 44 45 52  # TEA_ADD_HEADER
17ef0 53 20 2d 2d 0a 23 0a 23 09 53 70 65 63 69 66 79  S --.#.#.Specify
17f00 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 73 6f 75   one or more sou
17f10 72 63 65 20 68 65 61 64 65 72 73 2e 20 20 55 73  rce headers.  Us
17f20 65 72 73 20 73 68 6f 75 6c 64 20 63 68 65 63 6b  ers should check
17f30 20 66 6f 72 0a 23 09 74 68 65 20 72 69 67 68 74   for.#.the right
17f40 20 70 6c 61 74 66 6f 72 6d 20 62 65 66 6f 72 65   platform before
17f50 20 61 64 64 69 6e 67 20 74 6f 20 74 68 65 69 72   adding to their
17f60 20 6c 69 73 74 2e 0a 23 0a 23 20 41 72 67 75 6d   list..#.# Argum
17f70 65 6e 74 73 3a 0a 23 09 6f 6e 65 20 6f 72 20 6d  ents:.#.one or m
17f80 6f 72 65 20 66 69 6c 65 20 6e 61 6d 65 73 0a 23  ore file names.#
17f90 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09  .# Results:.#.#.
17fa0 44 65 66 69 6e 65 73 20 61 6e 64 20 73 75 62 73  Defines and subs
17fb0 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ts the following
17fc0 20 76 61 72 73 3a 0a 23 09 09 50 4b 47 5f 48 45   vars:.#..PKG_HE
17fd0 41 44 45 52 53 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ADERS.#---------
17fe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17ff0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18000 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18010 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
18020 41 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 41 44  AC_DEFUN([TEA_AD
18030 44 5f 48 45 41 44 45 52 53 5d 2c 20 5b 0a 20 20  D_HEADERS], [.  
18040 20 20 76 61 72 73 3d 22 24 40 22 0a 20 20 20 20    vars="$@".    
18050 66 6f 72 20 69 20 69 6e 20 24 76 61 72 73 3b 20  for i in $vars; 
18060 64 6f 0a 09 23 20 63 68 65 63 6b 20 66 6f 72 20  do..# check for 
18070 65 78 69 73 74 65 6e 63 65 2c 20 62 65 20 73 74  existence, be st
18080 72 69 63 74 20 62 65 63 61 75 73 65 20 69 74 20  rict because it 
18090 69 73 20 69 6e 73 74 61 6c 6c 65 64 0a 09 69 66  is installed..if
180a0 20 74 65 73 74 20 21 20 2d 66 20 22 24 7b 73 72   test ! -f "${sr
180b0 63 64 69 72 7d 2f 24 69 22 20 3b 20 74 68 65 6e  cdir}/$i" ; then
180c0 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 45 52 52  ..    AC_MSG_ERR
180d0 4f 52 28 5b 63 6f 75 6c 64 20 6e 6f 74 20 66 69  OR([could not fi
180e0 6e 64 20 68 65 61 64 65 72 20 66 69 6c 65 20 27  nd header file '
180f0 24 7b 73 72 63 64 69 72 7d 2f 24 69 27 5d 29 0a  ${srcdir}/$i']).
18100 09 66 69 0a 09 50 4b 47 5f 48 45 41 44 45 52 53  .fi..PKG_HEADERS
18110 3d 22 24 50 4b 47 5f 48 45 41 44 45 52 53 20 24  ="$PKG_HEADERS $
18120 69 22 0a 20 20 20 20 64 6f 6e 65 0a 20 20 20 20  i".    done.    
18130 41 43 5f 53 55 42 53 54 28 50 4b 47 5f 48 45 41  AC_SUBST(PKG_HEA
18140 44 45 52 53 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d  DERS).])..#-----
18150 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18160 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18170 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18180 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18190 2d 2d 2d 0a 23 20 54 45 41 5f 41 44 44 5f 49 4e  ---.# TEA_ADD_IN
181a0 43 4c 55 44 45 53 20 2d 2d 0a 23 0a 23 09 53 70  CLUDES --.#.#.Sp
181b0 65 63 69 66 79 20 6f 6e 65 20 6f 72 20 6d 6f 72  ecify one or mor
181c0 65 20 69 6e 63 6c 75 64 65 20 64 69 72 73 2e 20  e include dirs. 
181d0 20 55 73 65 72 73 20 73 68 6f 75 6c 64 20 63 68   Users should ch
181e0 65 63 6b 20 66 6f 72 0a 23 09 74 68 65 20 72 69  eck for.#.the ri
181f0 67 68 74 20 70 6c 61 74 66 6f 72 6d 20 62 65 66  ght platform bef
18200 6f 72 65 20 61 64 64 69 6e 67 20 74 6f 20 74 68  ore adding to th
18210 65 69 72 20 6c 69 73 74 2e 0a 23 0a 23 20 41 72  eir list..#.# Ar
18220 67 75 6d 65 6e 74 73 3a 0a 23 09 6f 6e 65 20 6f  guments:.#.one o
18230 72 20 6d 6f 72 65 20 66 69 6c 65 20 6e 61 6d 65  r more file name
18240 73 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23  s.#.# Results:.#
18250 0a 23 09 44 65 66 69 6e 65 73 20 61 6e 64 20 73  .#.Defines and s
18260 75 62 73 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77  ubsts the follow
18270 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 50 4b 47  ing vars:.#..PKG
18280 5f 49 4e 43 4c 55 44 45 53 0a 23 2d 2d 2d 2d 2d  _INCLUDES.#-----
18290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
182d0 2d 2d 2d 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45  ---.AC_DEFUN([TE
182e0 41 5f 41 44 44 5f 49 4e 43 4c 55 44 45 53 5d 2c  A_ADD_INCLUDES],
182f0 20 5b 0a 20 20 20 20 76 61 72 73 3d 22 24 40 22   [.    vars="$@"
18300 0a 20 20 20 20 66 6f 72 20 69 20 69 6e 20 24 76  .    for i in $v
18310 61 72 73 3b 20 64 6f 0a 09 50 4b 47 5f 49 4e 43  ars; do..PKG_INC
18320 4c 55 44 45 53 3d 22 24 50 4b 47 5f 49 4e 43 4c  LUDES="$PKG_INCL
18330 55 44 45 53 20 24 69 22 0a 20 20 20 20 64 6f 6e  UDES $i".    don
18340 65 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 50  e.    AC_SUBST(P
18350 4b 47 5f 49 4e 43 4c 55 44 45 53 29 0a 5d 29 0a  KG_INCLUDES).]).
18360 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
18370 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18380 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18390 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
183a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41  ----------.# TEA
183b0 5f 41 44 44 5f 4c 49 42 53 20 2d 2d 0a 23 0a 23  _ADD_LIBS --.#.#
183c0 09 53 70 65 63 69 66 79 20 6f 6e 65 20 6f 72 20  .Specify one or 
183d0 6d 6f 72 65 20 6c 69 62 72 61 72 69 65 73 2e 20  more libraries. 
183e0 20 55 73 65 72 73 20 73 68 6f 75 6c 64 20 63 68   Users should ch
183f0 65 63 6b 20 66 6f 72 0a 23 09 74 68 65 20 72 69  eck for.#.the ri
18400 67 68 74 20 70 6c 61 74 66 6f 72 6d 20 62 65 66  ght platform bef
18410 6f 72 65 20 61 64 64 69 6e 67 20 74 6f 20 74 68  ore adding to th
18420 65 69 72 20 6c 69 73 74 2e 20 20 46 6f 72 20 57  eir list.  For W
18430 69 6e 64 6f 77 73 2c 0a 23 09 6c 69 62 72 61 72  indows,.#.librar
18440 69 65 73 20 70 72 6f 76 69 64 65 64 20 69 6e 20  ies provided in 
18450 22 66 6f 6f 2e 6c 69 62 22 20 66 6f 72 6d 61 74  "foo.lib" format
18460 20 77 69 6c 6c 20 62 65 20 63 6f 6e 76 65 72 74   will be convert
18470 65 64 20 74 6f 0a 23 09 22 2d 6c 66 6f 6f 22 20  ed to.#."-lfoo" 
18480 77 68 65 6e 20 75 73 69 6e 67 20 47 43 43 20 28  when using GCC (
18490 6d 69 6e 67 77 29 2e 0a 23 0a 23 20 41 72 67 75  mingw)..#.# Argu
184a0 6d 65 6e 74 73 3a 0a 23 09 6f 6e 65 20 6f 72 20  ments:.#.one or 
184b0 6d 6f 72 65 20 66 69 6c 65 20 6e 61 6d 65 73 0a  more file names.
184c0 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23  #.# Results:.#.#
184d0 09 44 65 66 69 6e 65 73 20 61 6e 64 20 73 75 62  .Defines and sub
184e0 73 74 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e  sts the followin
184f0 67 20 76 61 72 73 3a 0a 23 09 09 50 4b 47 5f 4c  g vars:.#..PKG_L
18500 49 42 53 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  IBS.#-----------
18510 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18520 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18530 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18540 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 43  -------------.AC
18550 5f 44 45 46 55 4e 28 5b 54 45 41 5f 41 44 44 5f  _DEFUN([TEA_ADD_
18560 4c 49 42 53 5d 2c 20 5b 0a 20 20 20 20 76 61 72  LIBS], [.    var
18570 73 3d 22 24 40 22 0a 20 20 20 20 66 6f 72 20 69  s="$@".    for i
18580 20 69 6e 20 24 76 61 72 73 3b 20 64 6f 0a 09 69   in $vars; do..i
18590 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c  f test "${TEA_PL
185a0 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64  ATFORM}" = "wind
185b0 6f 77 73 22 20 2d 61 20 22 24 47 43 43 22 20 3d  ows" -a "$GCC" =
185c0 20 22 79 65 73 22 20 3b 20 74 68 65 6e 0a 09 20   "yes" ; then.. 
185d0 20 20 20 23 20 43 6f 6e 76 65 72 74 20 66 6f 6f     # Convert foo
185e0 2e 6c 69 62 20 74 6f 20 2d 6c 66 6f 6f 20 66 6f  .lib to -lfoo fo
185f0 72 20 47 43 43 2e 20 20 4e 6f 2d 6f 70 20 69 66  r GCC.  No-op if
18600 20 6e 6f 74 20 2a 2e 6c 69 62 0a 09 20 20 20 20   not *.lib..    
18610 69 3d 60 65 63 68 6f 20 22 24 69 22 20 7c 20 73  i=`echo "$i" | s
18620 65 64 20 2d 65 20 27 73 2f 5e 5c 28 5b 5b 5e 2d  ed -e 's/^\([[^-
18630 5d 5d 2e 2a 5c 29 5c 2e 6c 69 62 5b 24 5d 2f 2d  ]].*\)\.lib[$]/-
18640 6c 5c 31 2f 69 27 60 0a 09 66 69 0a 09 50 4b 47  l\1/i'`..fi..PKG
18650 5f 4c 49 42 53 3d 22 24 50 4b 47 5f 4c 49 42 53  _LIBS="$PKG_LIBS
18660 20 24 69 22 0a 20 20 20 20 64 6f 6e 65 0a 20 20   $i".    done.  
18670 20 20 41 43 5f 53 55 42 53 54 28 50 4b 47 5f 4c    AC_SUBST(PKG_L
18680 49 42 53 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d  IBS).])..#------
18690 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
186a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
186b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
186c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
186d0 2d 2d 0a 23 20 54 45 41 5f 41 44 44 5f 43 46 4c  --.# TEA_ADD_CFL
186e0 41 47 53 20 2d 2d 0a 23 0a 23 09 53 70 65 63 69  AGS --.#.#.Speci
186f0 66 79 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 43  fy one or more C
18700 46 4c 41 47 53 2e 20 20 55 73 65 72 73 20 73 68  FLAGS.  Users sh
18710 6f 75 6c 64 20 63 68 65 63 6b 20 66 6f 72 0a 23  ould check for.#
18720 09 74 68 65 20 72 69 67 68 74 20 70 6c 61 74 66  .the right platf
18730 6f 72 6d 20 62 65 66 6f 72 65 20 61 64 64 69 6e  orm before addin
18740 67 20 74 6f 20 74 68 65 69 72 20 6c 69 73 74 2e  g to their list.
18750 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a  .#.# Arguments:.
18760 23 09 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 66 69  #.one or more fi
18770 6c 65 20 6e 61 6d 65 73 0a 23 0a 23 20 52 65 73  le names.#.# Res
18780 75 6c 74 73 3a 0a 23 0a 23 09 44 65 66 69 6e 65  ults:.#.#.Define
18790 73 20 61 6e 64 20 73 75 62 73 74 73 20 74 68 65  s and substs the
187a0 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a   following vars:
187b0 0a 23 09 09 50 4b 47 5f 43 46 4c 41 47 53 0a 23  .#..PKG_CFLAGS.#
187c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
187d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
187e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
187f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18800 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 43 5f 44 45 46 55  --------.AC_DEFU
18810 4e 28 5b 54 45 41 5f 41 44 44 5f 43 46 4c 41 47  N([TEA_ADD_CFLAG
18820 53 5d 2c 20 5b 0a 20 20 20 20 50 4b 47 5f 43 46  S], [.    PKG_CF
18830 4c 41 47 53 3d 22 24 50 4b 47 5f 43 46 4c 41 47  LAGS="$PKG_CFLAG
18840 53 20 24 40 22 0a 20 20 20 20 41 43 5f 53 55 42  S $@".    AC_SUB
18850 53 54 28 50 4b 47 5f 43 46 4c 41 47 53 29 0a 5d  ST(PKG_CFLAGS).]
18860 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  )..#------------
18870 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18880 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
188a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54  ------------.# T
188b0 45 41 5f 41 44 44 5f 43 4c 45 41 4e 46 49 4c 45  EA_ADD_CLEANFILE
188c0 53 20 2d 2d 0a 23 0a 23 09 53 70 65 63 69 66 79  S --.#.#.Specify
188d0 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 43 4c 45   one or more CLE
188e0 41 4e 46 49 4c 45 53 2e 0a 23 0a 23 20 41 72 67  ANFILES..#.# Arg
188f0 75 6d 65 6e 74 73 3a 0a 23 09 6f 6e 65 20 6f 72  uments:.#.one or
18900 20 6d 6f 72 65 20 66 69 6c 65 20 6e 61 6d 65 73   more file names
18910 20 74 6f 20 63 6c 65 61 6e 20 74 61 72 67 65 74   to clean target
18920 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a  .#.# Results:.#.
18930 23 09 41 70 70 65 6e 64 73 20 74 6f 20 43 4c 45  #.Appends to CLE
18940 41 4e 46 49 4c 45 53 2c 20 61 6c 72 65 61 64 79  ANFILES, already
18950 20 64 65 66 69 6e 65 64 20 66 6f 72 20 73 75 62   defined for sub
18960 73 74 20 69 6e 20 4c 4f 41 44 5f 54 43 4c 43 4f  st in LOAD_TCLCO
18970 4e 46 49 47 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  NFIG.#----------
18980 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18990 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
189a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
189b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 41  --------------.A
189c0 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 41 44 44  C_DEFUN([TEA_ADD
189d0 5f 43 4c 45 41 4e 46 49 4c 45 53 5d 2c 20 5b 0a  _CLEANFILES], [.
189e0 20 20 20 20 43 4c 45 41 4e 46 49 4c 45 53 3d 22      CLEANFILES="
189f0 24 43 4c 45 41 4e 46 49 4c 45 53 20 24 40 22 0a  $CLEANFILES $@".
18a00 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ])..#-----------
18a10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18a20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18a30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18a40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
18a50 54 45 41 5f 50 52 45 46 49 58 20 2d 2d 0a 23 0a  TEA_PREFIX --.#.
18a60 23 09 48 61 6e 64 6c 65 20 74 68 65 20 2d 2d 70  #.Handle the --p
18a70 72 65 66 69 78 3d 2e 2e 2e 20 6f 70 74 69 6f 6e  refix=... option
18a80 20 62 79 20 64 65 66 61 75 6c 74 69 6e 67 20 74   by defaulting t
18a90 6f 20 77 68 61 74 20 54 63 6c 20 67 61 76 65 0a  o what Tcl gave.
18aa0 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23  #.# Arguments:.#
18ab0 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74  .none.#.# Result
18ac0 73 3a 0a 23 0a 23 09 49 66 20 2d 2d 70 72 65 66  s:.#.#.If --pref
18ad0 69 78 20 6f 72 20 2d 2d 65 78 65 63 2d 70 72 65  ix or --exec-pre
18ae0 66 69 78 20 77 61 73 20 6e 6f 74 20 73 70 65 63  fix was not spec
18af0 69 66 69 65 64 2c 20 24 70 72 65 66 69 78 20 61  ified, $prefix a
18b00 6e 64 0a 23 09 24 65 78 65 63 5f 70 72 65 66 69  nd.#.$exec_prefi
18b10 78 20 77 69 6c 6c 20 62 65 20 73 65 74 20 74 6f  x will be set to
18b20 20 74 68 65 20 76 61 6c 75 65 73 20 67 69 76 65   the values give
18b30 6e 20 74 6f 20 54 63 6c 20 77 68 65 6e 20 69 74  n to Tcl when it
18b40 20 77 61 73 0a 23 09 63 6f 6e 66 69 67 75 72 65   was.#.configure
18b50 64 2e 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  d..#------------
18b60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18b70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18b80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18b90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 43 5f  ------------.AC_
18ba0 44 45 46 55 4e 28 5b 54 45 41 5f 50 52 45 46 49  DEFUN([TEA_PREFI
18bb0 58 5d 2c 20 5b 0a 20 20 20 20 69 66 20 74 65 73  X], [.    if tes
18bc0 74 20 22 24 7b 70 72 65 66 69 78 7d 22 20 3d 20  t "${prefix}" = 
18bd0 22 4e 4f 4e 45 22 3b 20 74 68 65 6e 0a 09 70 72  "NONE"; then..pr
18be0 65 66 69 78 5f 64 65 66 61 75 6c 74 3d 79 65 73  efix_default=yes
18bf0 0a 09 69 66 20 74 65 73 74 20 78 22 24 7b 54 43  ..if test x"${TC
18c00 4c 5f 50 52 45 46 49 58 7d 22 20 21 3d 20 78 3b  L_PREFIX}" != x;
18c10 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 4d 53   then..    AC_MS
18c20 47 5f 4e 4f 54 49 43 45 28 5b 2d 2d 70 72 65 66  G_NOTICE([--pref
18c30 69 78 20 64 65 66 61 75 6c 74 69 6e 67 20 74 6f  ix defaulting to
18c40 20 54 43 4c 5f 50 52 45 46 49 58 20 24 7b 54 43   TCL_PREFIX ${TC
18c50 4c 5f 50 52 45 46 49 58 7d 5d 29 0a 09 20 20 20  L_PREFIX}])..   
18c60 20 70 72 65 66 69 78 3d 24 7b 54 43 4c 5f 50 52   prefix=${TCL_PR
18c70 45 46 49 58 7d 0a 09 65 6c 73 65 0a 09 20 20 20  EFIX}..else..   
18c80 20 41 43 5f 4d 53 47 5f 4e 4f 54 49 43 45 28 5b   AC_MSG_NOTICE([
18c90 2d 2d 70 72 65 66 69 78 20 64 65 66 61 75 6c 74  --prefix default
18ca0 69 6e 67 20 74 6f 20 2f 75 73 72 2f 6c 6f 63 61  ing to /usr/loca
18cb0 6c 5d 29 0a 09 20 20 20 20 70 72 65 66 69 78 3d  l])..    prefix=
18cc0 2f 75 73 72 2f 6c 6f 63 61 6c 0a 09 66 69 0a 20  /usr/local..fi. 
18cd0 20 20 20 66 69 0a 20 20 20 20 69 66 20 74 65 73     fi.    if tes
18ce0 74 20 22 24 7b 65 78 65 63 5f 70 72 65 66 69 78  t "${exec_prefix
18cf0 7d 22 20 3d 20 22 4e 4f 4e 45 22 20 2d 61 20 78  }" = "NONE" -a x
18d00 22 24 7b 70 72 65 66 69 78 5f 64 65 66 61 75 6c  "${prefix_defaul
18d10 74 7d 22 20 3d 20 78 22 79 65 73 22 20 5c 0a 09  t}" = x"yes" \..
18d20 2d 6f 20 78 22 24 7b 65 78 65 63 5f 70 72 65 66  -o x"${exec_pref
18d30 69 78 5f 64 65 66 61 75 6c 74 7d 22 20 3d 20 78  ix_default}" = x
18d40 22 79 65 73 22 20 3b 20 74 68 65 6e 0a 09 69 66  "yes" ; then..if
18d50 20 74 65 73 74 20 78 22 24 7b 54 43 4c 5f 45 58   test x"${TCL_EX
18d60 45 43 5f 50 52 45 46 49 58 7d 22 20 21 3d 20 78  EC_PREFIX}" != x
18d70 3b 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 4d  ; then..    AC_M
18d80 53 47 5f 4e 4f 54 49 43 45 28 5b 2d 2d 65 78 65  SG_NOTICE([--exe
18d90 63 2d 70 72 65 66 69 78 20 64 65 66 61 75 6c 74  c-prefix default
18da0 69 6e 67 20 74 6f 20 54 43 4c 5f 45 58 45 43 5f  ing to TCL_EXEC_
18db0 50 52 45 46 49 58 20 24 7b 54 43 4c 5f 45 58 45  PREFIX ${TCL_EXE
18dc0 43 5f 50 52 45 46 49 58 7d 5d 29 0a 09 20 20 20  C_PREFIX}])..   
18dd0 20 65 78 65 63 5f 70 72 65 66 69 78 3d 24 7b 54   exec_prefix=${T
18de0 43 4c 5f 45 58 45 43 5f 50 52 45 46 49 58 7d 0a  CL_EXEC_PREFIX}.
18df0 09 65 6c 73 65 0a 09 20 20 20 20 41 43 5f 4d 53  .else..    AC_MS
18e00 47 5f 4e 4f 54 49 43 45 28 5b 2d 2d 65 78 65 63  G_NOTICE([--exec
18e10 2d 70 72 65 66 69 78 20 64 65 66 61 75 6c 74 69  -prefix defaulti
18e20 6e 67 20 74 6f 20 24 7b 70 72 65 66 69 78 7d 5d  ng to ${prefix}]
18e30 29 0a 09 20 20 20 20 65 78 65 63 5f 70 72 65 66  )..    exec_pref
18e40 69 78 3d 24 70 72 65 66 69 78 0a 09 66 69 0a 20  ix=$prefix..fi. 
18e50 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d     fi.])..#-----
18e60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18e70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18e80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18e90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18ea0 2d 2d 2d 0a 23 20 54 45 41 5f 53 45 54 55 50 5f  ---.# TEA_SETUP_
18eb0 43 4f 4d 50 49 4c 45 52 5f 43 43 20 2d 2d 0a 23  COMPILER_CC --.#
18ec0 0a 23 09 44 6f 20 63 6f 6d 70 69 6c 65 72 20 63  .#.Do compiler c
18ed0 68 65 63 6b 73 20 74 68 65 20 77 61 79 20 77 65  hecks the way we
18ee0 20 77 61 6e 74 2e 20 20 54 68 69 73 20 69 73 20   want.  This is 
18ef0 6a 75 73 74 20 61 20 72 65 70 6c 61 63 65 6d 65  just a replaceme
18f00 6e 74 0a 23 09 66 6f 72 20 41 43 5f 50 52 4f 47  nt.#.for AC_PROG
18f10 5f 43 43 20 69 6e 20 54 45 41 20 63 6f 6e 66 69  _CC in TEA confi
18f20 67 75 72 65 2e 69 6e 20 66 69 6c 65 73 20 74 6f  gure.in files to
18f30 20 6d 61 6b 65 20 74 68 65 6d 20 63 6c 65 61 6e   make them clean
18f40 65 72 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74  er..#.# Argument
18f50 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65  s:.#.none.#.# Re
18f60 73 75 6c 74 73 3a 0a 23 0a 23 09 53 65 74 73 20  sults:.#.#.Sets 
18f70 75 70 20 43 43 20 76 61 72 20 61 6e 64 20 6f 74  up CC var and ot
18f80 68 65 72 20 73 74 61 6e 64 61 72 64 20 62 69 74  her standard bit
18f90 73 20 77 65 20 6e 65 65 64 20 74 6f 20 6d 61 6b  s we need to mak
18fa0 65 20 65 78 65 63 75 74 61 62 6c 65 73 2e 0a 23  e executables..#
18fb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18fd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18fe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18ff0 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 43 5f 44 45 46 55  --------.AC_DEFU
19000 4e 28 5b 54 45 41 5f 53 45 54 55 50 5f 43 4f 4d  N([TEA_SETUP_COM
19010 50 49 4c 45 52 5f 43 43 5d 2c 20 5b 0a 20 20 20  PILER_CC], [.   
19020 20 23 20 44 6f 6e 27 74 20 70 75 74 20 61 6e 79   # Don't put any
19030 20 6d 61 63 72 6f 73 20 74 68 61 74 20 75 73 65   macros that use
19040 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 28 65   the compiler (e
19050 2e 67 2e 20 41 43 5f 54 52 59 5f 43 4f 4d 50 49  .g. AC_TRY_COMPI
19060 4c 45 29 0a 20 20 20 20 23 20 69 6e 20 74 68 69  LE).    # in thi
19070 73 20 6d 61 63 72 6f 2c 20 74 68 65 79 20 6e 65  s macro, they ne
19080 65 64 20 74 6f 20 67 6f 20 69 6e 74 6f 20 54 45  ed to go into TE
19090 41 5f 53 45 54 55 50 5f 43 4f 4d 50 49 4c 45 52  A_SETUP_COMPILER
190a0 20 69 6e 73 74 65 61 64 2e 0a 0a 20 20 20 20 41   instead...    A
190b0 43 5f 50 52 4f 47 5f 43 43 0a 20 20 20 20 41 43  C_PROG_CC.    AC
190c0 5f 50 52 4f 47 5f 43 50 50 0a 0a 20 20 20 20 49  _PROG_CPP..    I
190d0 4e 53 54 41 4c 4c 3d 22 5c 24 28 53 48 45 4c 4c  NSTALL="\$(SHELL
190e0 29 20 5c 24 28 73 72 63 64 69 72 29 2f 74 63 6c  ) \$(srcdir)/tcl
190f0 63 6f 6e 66 69 67 2f 69 6e 73 74 61 6c 6c 2d 73  config/install-s
19100 68 20 2d 63 22 0a 20 20 20 20 41 43 5f 53 55 42  h -c".    AC_SUB
19110 53 54 28 49 4e 53 54 41 4c 4c 29 0a 20 20 20 20  ST(INSTALL).    
19120 49 4e 53 54 41 4c 4c 5f 44 41 54 41 3d 22 5c 24  INSTALL_DATA="\$
19130 7b 49 4e 53 54 41 4c 4c 7d 20 2d 6d 20 36 34 34  {INSTALL} -m 644
19140 22 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 49  ".    AC_SUBST(I
19150 4e 53 54 41 4c 4c 5f 44 41 54 41 29 0a 20 20 20  NSTALL_DATA).   
19160 20 49 4e 53 54 41 4c 4c 5f 50 52 4f 47 52 41 4d   INSTALL_PROGRAM
19170 3d 22 5c 24 7b 49 4e 53 54 41 4c 4c 7d 22 0a 20  ="\${INSTALL}". 
19180 20 20 20 41 43 5f 53 55 42 53 54 28 49 4e 53 54     AC_SUBST(INST
19190 41 4c 4c 5f 50 52 4f 47 52 41 4d 29 0a 20 20 20  ALL_PROGRAM).   
191a0 20 49 4e 53 54 41 4c 4c 5f 53 43 52 49 50 54 3d   INSTALL_SCRIPT=
191b0 22 5c 24 7b 49 4e 53 54 41 4c 4c 7d 22 0a 20 20  "\${INSTALL}".  
191c0 20 20 41 43 5f 53 55 42 53 54 28 49 4e 53 54 41    AC_SUBST(INSTA
191d0 4c 4c 5f 53 43 52 49 50 54 29 0a 0a 20 20 20 20  LL_SCRIPT)..    
191e0 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
191f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19200 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19210 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19220 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 43 68 65 63  -----.    # Chec
19230 6b 73 20 74 6f 20 73 65 65 20 69 66 20 74 68 65  ks to see if the
19240 20 6d 61 6b 65 20 70 72 6f 67 72 61 6d 20 73 65   make program se
19250 74 73 20 74 68 65 20 24 4d 41 4b 45 20 76 61 72  ts the $MAKE var
19260 69 61 62 6c 65 2e 0a 20 20 20 20 23 2d 2d 2d 2d  iable..    #----
19270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
192a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
192b0 0a 0a 20 20 20 20 41 43 5f 50 52 4f 47 5f 4d 41  ..    AC_PROG_MA
192c0 4b 45 5f 53 45 54 0a 0a 20 20 20 20 23 2d 2d 2d  KE_SET..    #---
192d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
192e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
192f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19300 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19310 2d 0a 20 20 20 20 23 20 46 69 6e 64 20 72 61 6e  -.    # Find ran
19320 6c 69 62 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  lib.    #-------
19330 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19340 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19350 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20  -------------.. 
19370 20 20 20 41 43 5f 43 48 45 43 4b 5f 54 4f 4f 4c     AC_CHECK_TOOL
19380 28 52 41 4e 4c 49 42 2c 20 72 61 6e 6c 69 62 29  (RANLIB, ranlib)
19390 0a 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..    #---------
193a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
193b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
193c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
193d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20  -----------.    
193e0 23 20 44 65 74 65 72 6d 69 6e 65 73 20 74 68 65  # Determines the
193f0 20 63 6f 72 72 65 63 74 20 62 69 6e 61 72 79 20   correct binary 
19400 66 69 6c 65 20 65 78 74 65 6e 73 69 6f 6e 20 28  file extension (
19410 2e 6f 2c 20 2e 6f 62 6a 2c 20 2e 65 78 65 20 65  .o, .obj, .exe e
19420 74 63 2e 29 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  tc.).    #------
19430 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19440 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19450 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19460 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
19470 20 20 20 20 41 43 5f 4f 42 4a 45 58 54 0a 20 20      AC_OBJEXT.  
19480 20 20 41 43 5f 45 58 45 45 58 54 0a 5d 29 0a 0a    AC_EXEEXT.])..
19490 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
194a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
194b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
194c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
194d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f  ---------.# TEA_
194e0 53 45 54 55 50 5f 43 4f 4d 50 49 4c 45 52 20 2d  SETUP_COMPILER -
194f0 2d 0a 23 0a 23 09 44 6f 20 63 6f 6d 70 69 6c 65  -.#.#.Do compile
19500 72 20 63 68 65 63 6b 73 20 74 68 61 74 20 75 73  r checks that us
19510 65 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 2e 20  e the compiler. 
19520 20 54 68 69 73 20 6d 75 73 74 20 67 6f 20 61 66   This must go af
19530 74 65 72 0a 23 09 54 45 41 5f 53 45 54 55 50 5f  ter.#.TEA_SETUP_
19540 43 4f 4d 50 49 4c 45 52 5f 43 43 2c 20 77 68 69  COMPILER_CC, whi
19550 63 68 20 64 6f 65 73 20 74 68 65 20 61 63 74 75  ch does the actu
19560 61 6c 20 63 6f 6d 70 69 6c 65 72 20 63 68 65 63  al compiler chec
19570 6b 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73  k..#.# Arguments
19580 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73  :.#.none.#.# Res
19590 75 6c 74 73 3a 0a 23 0a 23 09 53 65 74 73 20 75  ults:.#.#.Sets u
195a0 70 20 43 43 20 76 61 72 20 61 6e 64 20 6f 74 68  p CC var and oth
195b0 65 72 20 73 74 61 6e 64 61 72 64 20 62 69 74 73  er standard bits
195c0 20 77 65 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65   we need to make
195d0 20 65 78 65 63 75 74 61 62 6c 65 73 2e 0a 23 2d   executables..#-
195e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
195f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19610 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19620 2d 2d 2d 2d 2d 2d 2d 0a 41 43 5f 44 45 46 55 4e  -------.AC_DEFUN
19630 28 5b 54 45 41 5f 53 45 54 55 50 5f 43 4f 4d 50  ([TEA_SETUP_COMP
19640 49 4c 45 52 5d 2c 20 5b 0a 20 20 20 20 23 20 41  ILER], [.    # A
19650 6e 79 20 6d 61 63 72 6f 73 20 74 68 61 74 20 75  ny macros that u
19660 73 65 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 20  se the compiler 
19670 28 65 2e 67 2e 20 41 43 5f 54 52 59 5f 43 4f 4d  (e.g. AC_TRY_COM
19680 50 49 4c 45 29 20 68 61 76 65 20 74 6f 20 67 6f  PILE) have to go
19690 20 68 65 72 65 2e 0a 20 20 20 20 41 43 5f 52 45   here..    AC_RE
196a0 51 55 49 52 45 28 5b 54 45 41 5f 53 45 54 55 50  QUIRE([TEA_SETUP
196b0 5f 43 4f 4d 50 49 4c 45 52 5f 43 43 5d 29 0a 0a  _COMPILER_CC])..
196c0 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
196d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
196e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
196f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19700 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
19710 20 20 23 20 49 66 20 77 65 27 72 65 20 75 73 69    # If we're usi
19720 6e 67 20 47 43 43 2c 20 73 65 65 20 69 66 20 74  ng GCC, see if t
19730 68 65 20 63 6f 6d 70 69 6c 65 72 20 75 6e 64 65  he compiler unde
19740 72 73 74 61 6e 64 73 20 2d 70 69 70 65 2e 20 49  rstands -pipe. I
19750 66 20 73 6f 2c 20 75 73 65 20 69 74 2e 0a 20 20  f so, use it..  
19760 20 20 23 20 49 74 20 6d 61 6b 65 73 20 63 6f 6d    # It makes com
19770 70 69 6c 69 6e 67 20 67 6f 20 66 61 73 74 65 72  piling go faster
19780 2e 20 20 28 54 68 69 73 20 69 73 20 6f 6e 6c 79  .  (This is only
19790 20 61 20 70 65 72 66 6f 72 6d 61 6e 63 65 20 66   a performance f
197a0 65 61 74 75 72 65 2e 29 0a 20 20 20 20 23 2d 2d  eature.).    #--
197b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
197c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
197d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
197e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
197f0 2d 2d 2d 2d 2d 2d 0a 0a 20 20 20 20 69 66 20 74  ------..    if t
19800 65 73 74 20 2d 7a 20 22 24 6e 6f 5f 70 69 70 65  est -z "$no_pipe
19810 22 20 2d 61 20 2d 6e 20 22 24 47 43 43 22 3b 20  " -a -n "$GCC"; 
19820 74 68 65 6e 0a 09 41 43 5f 43 41 43 48 45 5f 43  then..AC_CACHE_C
19830 48 45 43 4b 28 5b 69 66 20 74 68 65 20 63 6f 6d  HECK([if the com
19840 70 69 6c 65 72 20 75 6e 64 65 72 73 74 61 6e 64  piler understand
19850 73 20 2d 70 69 70 65 5d 2c 0a 09 20 20 20 20 74  s -pipe],..    t
19860 63 6c 5f 63 76 5f 63 63 5f 70 69 70 65 2c 20 5b  cl_cv_cc_pipe, [
19870 0a 09 20 20 20 20 68 6f 6c 64 5f 63 66 6c 61 67  ..    hold_cflag
19880 73 3d 24 43 46 4c 41 47 53 3b 20 43 46 4c 41 47  s=$CFLAGS; CFLAG
19890 53 3d 22 24 43 46 4c 41 47 53 20 2d 70 69 70 65  S="$CFLAGS -pipe
198a0 22 0a 09 20 20 20 20 41 43 5f 54 52 59 5f 43 4f  "..    AC_TRY_CO
198b0 4d 50 49 4c 45 28 2c 2c 20 74 63 6c 5f 63 76 5f  MPILE(,, tcl_cv_
198c0 63 63 5f 70 69 70 65 3d 79 65 73 2c 20 74 63 6c  cc_pipe=yes, tcl
198d0 5f 63 76 5f 63 63 5f 70 69 70 65 3d 6e 6f 29 0a  _cv_cc_pipe=no).
198e0 09 20 20 20 20 43 46 4c 41 47 53 3d 24 68 6f 6c  .    CFLAGS=$hol
198f0 64 5f 63 66 6c 61 67 73 5d 29 0a 09 69 66 20 74  d_cflags])..if t
19900 65 73 74 20 24 74 63 6c 5f 63 76 5f 63 63 5f 70  est $tcl_cv_cc_p
19910 69 70 65 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a  ipe = yes; then.
19920 09 20 20 20 20 43 46 4c 41 47 53 3d 22 24 43 46  .    CFLAGS="$CF
19930 4c 41 47 53 20 2d 70 69 70 65 22 0a 09 66 69 0a  LAGS -pipe"..fi.
19940 20 20 20 20 66 69 0a 0a 20 20 20 20 23 2d 2d 2d      fi..    #---
19950 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19960 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19970 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19980 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19990 2d 0a 20 20 20 20 23 20 43 6f 6d 6d 6f 6e 20 63  -.    # Common c
199a0 6f 6d 70 69 6c 65 72 20 66 6c 61 67 20 73 65 74  ompiler flag set
199b0 75 70 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  up.    #--------
199c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
199d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
199e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
199f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20 20  ------------..  
19a00 20 20 41 43 5f 43 5f 42 49 47 45 4e 44 49 41 4e    AC_C_BIGENDIAN
19a10 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b  .    if test "${
19a20 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d  TEA_PLATFORM}" =
19a30 20 22 75 6e 69 78 22 20 3b 20 74 68 65 6e 0a 09   "unix" ; then..
19a40 54 45 41 5f 54 43 4c 5f 4c 49 4e 4b 5f 4c 49 42  TEA_TCL_LINK_LIB
19a50 53 0a 09 54 45 41 5f 4d 49 53 53 49 4e 47 5f 50  S..TEA_MISSING_P
19a60 4f 53 49 58 5f 48 45 41 44 45 52 53 0a 09 23 20  OSIX_HEADERS..# 
19a70 4c 65 74 20 74 68 65 20 75 73 65 72 20 63 61 6c  Let the user cal
19a80 6c 20 74 68 69 73 2c 20 62 65 63 61 75 73 65 20  l this, because 
19a90 69 66 20 69 74 20 74 72 69 67 67 65 72 73 2c 20  if it triggers, 
19aa0 74 68 65 79 20 77 69 6c 6c 0a 09 23 20 6e 65 65  they will..# nee
19ab0 64 20 61 20 63 6f 6d 70 61 74 2f 73 74 72 74 6f  d a compat/strto
19ac0 64 2e 63 20 74 68 61 74 20 69 73 20 63 6f 72 72  d.c that is corr
19ad0 65 63 74 2e 20 20 55 73 65 72 73 20 63 61 6e 20  ect.  Users can 
19ae0 61 6c 73 6f 0a 09 23 20 75 73 65 20 54 63 6c 5f  also..# use Tcl_
19af0 47 65 74 44 6f 75 62 6c 65 28 46 72 6f 6d 4f 62  GetDouble(FromOb
19b00 6a 29 20 69 6e 73 74 65 61 64 2e 0a 09 23 54 45  j) instead...#TE
19b10 41 5f 42 55 47 47 59 5f 53 54 52 54 4f 44 0a 20  A_BUGGY_STRTOD. 
19b20 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d     fi.])..#-----
19b30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19b40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19b50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19b60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19b70 2d 2d 2d 0a 23 20 54 45 41 5f 4d 41 4b 45 5f 4c  ---.# TEA_MAKE_L
19b80 49 42 20 2d 2d 0a 23 0a 23 09 47 65 6e 65 72 61  IB --.#.#.Genera
19b90 74 65 20 61 20 6c 69 6e 65 20 74 68 61 74 20 63  te a line that c
19ba0 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 62 75  an be used to bu
19bb0 69 6c 64 20 61 20 73 68 61 72 65 64 2f 75 6e 73  ild a shared/uns
19bc0 68 61 72 65 64 20 6c 69 62 72 61 72 79 0a 23 09  hared library.#.
19bd0 69 6e 20 61 20 70 6c 61 74 66 6f 72 6d 20 69 6e  in a platform in
19be0 64 65 70 65 6e 64 65 6e 74 20 6d 61 6e 6e 65 72  dependent manner
19bf0 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a  ..#.# Arguments:
19c00 0a 23 09 6e 6f 6e 65 0a 23 0a 23 09 52 65 71 75  .#.none.#.#.Requ
19c10 69 72 65 73 3a 0a 23 0a 23 20 52 65 73 75 6c 74  ires:.#.# Result
19c20 73 3a 0a 23 0a 23 09 44 65 66 69 6e 65 73 20 74  s:.#.#.Defines t
19c30 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72  he following var
19c40 73 3a 0a 23 09 43 46 4c 41 47 53 20 2d 09 44 6f  s:.#.CFLAGS -.Do
19c50 6e 65 20 6c 61 74 65 20 68 65 72 65 20 74 6f 20  ne late here to 
19c60 6e 6f 74 65 20 64 69 73 74 75 72 62 20 6f 74 68  note disturb oth
19c70 65 72 20 41 43 20 6d 61 63 72 6f 73 0a 23 20 20  er AC macros.#  
19c80 20 20 20 20 20 4d 41 4b 45 5f 4c 49 42 20 2d 20       MAKE_LIB - 
19c90 20 20 20 20 20 43 6f 6d 6d 61 6e 64 20 74 6f 20       Command to 
19ca0 65 78 65 63 75 74 65 20 74 6f 20 62 75 69 6c 64  execute to build
19cb0 20 74 68 65 20 54 63 6c 20 6c 69 62 72 61 72 79   the Tcl library
19cc0 3b 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  ;.#             
19cd0 20 20 20 20 20 20 20 20 20 20 64 69 66 66 65 72            differ
19ce0 73 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 77  s depending on w
19cf0 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 54 63  hether or not Tc
19d00 6c 20 69 73 20 62 65 69 6e 67 0a 23 20 20 20 20  l is being.#    
19d10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19d20 20 20 20 63 6f 6d 70 69 6c 65 64 20 61 73 20 61     compiled as a
19d30 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 79 2e   shared library.
19d40 0a 23 09 4d 41 4b 45 5f 53 48 41 52 45 44 5f 4c  .#.MAKE_SHARED_L
19d50 49 42 09 4d 61 6b 65 66 69 6c 65 20 72 75 6c 65  IB.Makefile rule
19d60 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 61 20   for building a 
19d70 73 68 61 72 65 64 20 6c 69 62 72 61 72 79 0a 23  shared library.#
19d80 09 4d 41 4b 45 5f 53 54 41 54 49 43 5f 4c 49 42  .MAKE_STATIC_LIB
19d90 09 4d 61 6b 65 66 69 6c 65 20 72 75 6c 65 20 66  .Makefile rule f
19da0 6f 72 20 62 75 69 6c 64 69 6e 67 20 61 20 73 74  or building a st
19db0 61 74 69 63 20 6c 69 62 72 61 72 79 0a 23 09 4d  atic library.#.M
19dc0 41 4b 45 5f 53 54 55 42 5f 4c 49 42 09 4d 61 6b  AKE_STUB_LIB.Mak
19dd0 65 66 69 6c 65 20 72 75 6c 65 20 66 6f 72 20 62  efile rule for b
19de0 75 69 6c 64 69 6e 67 20 61 20 73 74 75 62 20 6c  uilding a stub l
19df0 69 62 72 61 72 79 0a 23 09 56 43 5f 4d 41 4e 49  ibrary.#.VC_MANI
19e00 46 45 53 54 5f 45 4d 42 45 44 5f 44 4c 4c 20 4d  FEST_EMBED_DLL M
19e10 61 6b 65 66 69 6c 65 20 72 75 6c 65 20 66 6f 72  akefile rule for
19e20 20 65 6d 62 65 64 64 65 64 20 56 43 20 6d 61 6e   embedded VC man
19e30 69 66 65 73 74 20 69 6e 20 44 4c 4c 0a 23 09 56  ifest in DLL.#.V
19e40 43 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44  C_MANIFEST_EMBED
19e50 5f 45 58 45 20 4d 61 6b 65 66 69 6c 65 20 72 75  _EXE Makefile ru
19e60 6c 65 20 66 6f 72 20 65 6d 62 65 64 64 65 64 20  le for embedded 
19e70 56 43 20 6d 61 6e 69 66 65 73 74 20 69 6e 20 45  VC manifest in E
19e80 58 45 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  XE.#------------
19e90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19ea0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19eb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
19ec0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43  ------------..AC
19ed0 5f 44 45 46 55 4e 28 5b 54 45 41 5f 4d 41 4b 45  _DEFUN([TEA_MAKE
19ee0 5f 4c 49 42 5d 2c 20 5b 0a 20 20 20 20 69 66 20  _LIB], [.    if 
19ef0 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54  test "${TEA_PLAT
19f00 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77  FORM}" = "window
19f10 73 22 20 2d 61 20 22 24 47 43 43 22 20 21 3d 20  s" -a "$GCC" != 
19f20 22 79 65 73 22 3b 20 74 68 65 6e 0a 09 4d 41 4b  "yes"; then..MAK
19f30 45 5f 53 54 41 54 49 43 5f 4c 49 42 3d 22 5c 24  E_STATIC_LIB="\$
19f40 7b 53 54 4c 49 42 5f 4c 44 7d 20 2d 6f 75 74 3a  {STLIB_LD} -out:
19f50 5c 5b 24 5d 40 20 5c 24 28 50 4b 47 5f 4f 42 4a  \[$]@ \$(PKG_OBJ
19f60 45 43 54 53 29 22 0a 09 4d 41 4b 45 5f 53 48 41  ECTS)"..MAKE_SHA
19f70 52 45 44 5f 4c 49 42 3d 22 5c 24 7b 53 48 4c 49  RED_LIB="\${SHLI
19f80 42 5f 4c 44 7d 20 5c 24 7b 53 48 4c 49 42 5f 4c  B_LD} \${SHLIB_L
19f90 44 5f 4c 49 42 53 7d 20 5c 24 7b 4c 44 46 4c 41  D_LIBS} \${LDFLA
19fa0 47 53 5f 44 45 46 41 55 4c 54 7d 20 2d 6f 75 74  GS_DEFAULT} -out
19fb0 3a 5c 5b 24 5d 40 20 5c 24 28 50 4b 47 5f 4f 42  :\[$]@ \$(PKG_OB
19fc0 4a 45 43 54 53 29 22 0a 09 41 43 5f 45 47 52 45  JECTS)"..AC_EGRE
19fd0 50 5f 43 50 50 28 5b 6d 61 6e 69 66 65 73 74 20  P_CPP([manifest 
19fe0 6e 65 65 64 65 64 5d 2c 20 5b 0a 23 69 66 20 64  needed], [.#if d
19ff0 65 66 69 6e 65 64 28 5f 4d 53 43 5f 56 45 52 29  efined(_MSC_VER)
1a000 20 26 26 20 5f 4d 53 43 5f 56 45 52 20 3e 3d 20   && _MSC_VER >= 
1a010 31 34 30 30 0a 70 72 69 6e 74 28 22 6d 61 6e 69  1400.print("mani
1a020 66 65 73 74 20 6e 65 65 64 65 64 22 29 0a 23 65  fest needed").#e
1a030 6e 64 69 66 0a 09 5d 2c 20 5b 0a 09 23 20 43 6f  ndif..], [..# Co
1a040 75 6c 64 20 64 6f 20 61 20 43 48 45 43 4b 5f 50  uld do a CHECK_P
1a050 52 4f 47 20 66 6f 72 20 6d 74 2c 20 62 75 74 20  ROG for mt, but 
1a060 73 68 6f 75 6c 64 20 61 6c 77 61 79 73 20 62 65  should always be
1a070 20 77 69 74 68 20 4d 53 56 43 38 2b 0a 09 56 43   with MSVC8+..VC
1a080 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44 5f  _MANIFEST_EMBED_
1a090 44 4c 4c 3d 22 69 66 20 74 65 73 74 20 2d 66 20  DLL="if test -f 
1a0a0 5c 5b 24 5d 40 2e 6d 61 6e 69 66 65 73 74 20 3b  \[$]@.manifest ;
1a0b0 20 74 68 65 6e 20 6d 74 2e 65 78 65 20 2d 6e 6f   then mt.exe -no
1a0c0 6c 6f 67 6f 20 2d 6d 61 6e 69 66 65 73 74 20 5c  logo -manifest \
1a0d0 5b 24 5d 40 2e 6d 61 6e 69 66 65 73 74 20 2d 6f  [$]@.manifest -o
1a0e0 75 74 70 75 74 72 65 73 6f 75 72 63 65 3a 5c 5b  utputresource:\[
1a0f0 24 5d 40 5c 3b 32 20 3b 20 66 69 22 0a 09 56 43  $]@\;2 ; fi"..VC
1a100 5f 4d 41 4e 49 46 45 53 54 5f 45 4d 42 45 44 5f  _MANIFEST_EMBED_
1a110 45 58 45 3d 22 69 66 20 74 65 73 74 20 2d 66 20  EXE="if test -f 
1a120 5c 5b 24 5d 40 2e 6d 61 6e 69 66 65 73 74 20 3b  \[$]@.manifest ;
1a130 20 74 68 65 6e 20 6d 74 2e 65 78 65 20 2d 6e 6f   then mt.exe -no
1a140 6c 6f 67 6f 20 2d 6d 61 6e 69 66 65 73 74 20 5c  logo -manifest \
1a150 5b 24 5d 40 2e 6d 61 6e 69 66 65 73 74 20 2d 6f  [$]@.manifest -o
1a160 75 74 70 75 74 72 65 73 6f 75 72 63 65 3a 5c 5b  utputresource:\[
1a170 24 5d 40 5c 3b 31 20 3b 20 66 69 22 0a 09 4d 41  $]@\;1 ; fi"..MA
1a180 4b 45 5f 53 48 41 52 45 44 5f 4c 49 42 3d 22 24  KE_SHARED_LIB="$
1a190 7b 4d 41 4b 45 5f 53 48 41 52 45 44 5f 4c 49 42  {MAKE_SHARED_LIB
1a1a0 7d 20 3b 20 24 7b 56 43 5f 4d 41 4e 49 46 45 53  } ; ${VC_MANIFES
1a1b0 54 5f 45 4d 42 45 44 5f 44 4c 4c 7d 22 0a 09 54  T_EMBED_DLL}"..T
1a1c0 45 41 5f 41 44 44 5f 43 4c 45 41 4e 46 49 4c 45  EA_ADD_CLEANFILE
1a1d0 53 28 5b 2a 2e 6d 61 6e 69 66 65 73 74 5d 29 0a  S([*.manifest]).
1a1e0 09 5d 29 0a 09 4d 41 4b 45 5f 53 54 55 42 5f 4c  .])..MAKE_STUB_L
1a1f0 49 42 3d 22 5c 24 7b 53 54 4c 49 42 5f 4c 44 7d  IB="\${STLIB_LD}
1a200 20 2d 6e 6f 64 65 66 61 75 6c 74 6c 69 62 20 2d   -nodefaultlib -
1a210 6f 75 74 3a 5c 5b 24 5d 40 20 5c 24 28 50 4b 47  out:\[$]@ \$(PKG
1a220 5f 53 54 55 42 5f 4f 42 4a 45 43 54 53 29 22 0a  _STUB_OBJECTS)".
1a230 20 20 20 20 65 6c 73 65 0a 09 4d 41 4b 45 5f 53      else..MAKE_S
1a240 54 41 54 49 43 5f 4c 49 42 3d 22 5c 24 7b 53 54  TATIC_LIB="\${ST
1a250 4c 49 42 5f 4c 44 7d 20 5c 5b 24 5d 40 20 5c 24  LIB_LD} \[$]@ \$
1a260 28 50 4b 47 5f 4f 42 4a 45 43 54 53 29 22 0a 09  (PKG_OBJECTS)"..
1a270 4d 41 4b 45 5f 53 48 41 52 45 44 5f 4c 49 42 3d  MAKE_SHARED_LIB=
1a280 22 5c 24 7b 53 48 4c 49 42 5f 4c 44 7d 20 2d 6f  "\${SHLIB_LD} -o
1a290 20 5c 5b 24 5d 40 20 5c 24 28 50 4b 47 5f 4f 42   \[$]@ \$(PKG_OB
1a2a0 4a 45 43 54 53 29 20 5c 24 7b 53 48 4c 49 42 5f  JECTS) \${SHLIB_
1a2b0 4c 44 5f 4c 49 42 53 7d 22 0a 09 4d 41 4b 45 5f  LD_LIBS}"..MAKE_
1a2c0 53 54 55 42 5f 4c 49 42 3d 22 5c 24 7b 53 54 4c  STUB_LIB="\${STL
1a2d0 49 42 5f 4c 44 7d 20 5c 5b 24 5d 40 20 5c 24 28  IB_LD} \[$]@ \$(
1a2e0 50 4b 47 5f 53 54 55 42 5f 4f 42 4a 45 43 54 53  PKG_STUB_OBJECTS
1a2f0 29 22 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 69  )".    fi..    i
1a300 66 20 74 65 73 74 20 22 24 7b 53 48 41 52 45 44  f test "${SHARED
1a310 5f 42 55 49 4c 44 7d 22 20 3d 20 22 31 22 20 3b  _BUILD}" = "1" ;
1a320 20 74 68 65 6e 0a 09 4d 41 4b 45 5f 4c 49 42 3d   then..MAKE_LIB=
1a330 22 24 7b 4d 41 4b 45 5f 53 48 41 52 45 44 5f 4c  "${MAKE_SHARED_L
1a340 49 42 7d 20 22 0a 20 20 20 20 65 6c 73 65 0a 09  IB} ".    else..
1a350 4d 41 4b 45 5f 4c 49 42 3d 22 24 7b 4d 41 4b 45  MAKE_LIB="${MAKE
1a360 5f 53 54 41 54 49 43 5f 4c 49 42 7d 20 22 0a 20  _STATIC_LIB} ". 
1a370 20 20 20 66 69 0a 0a 20 20 20 20 23 2d 2d 2d 2d     fi..    #----
1a380 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a390 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a3a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a3b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a3c0 0a 20 20 20 20 23 20 53 68 61 72 65 64 20 6c 69  .    # Shared li
1a3d0 62 72 61 72 69 65 73 20 61 6e 64 20 73 74 61 74  braries and stat
1a3e0 69 63 20 6c 69 62 72 61 72 69 65 73 20 68 61 76  ic libraries hav
1a3f0 65 20 64 69 66 66 65 72 65 6e 74 20 6e 61 6d 65  e different name
1a400 73 2e 0a 20 20 20 20 23 20 55 73 65 20 74 68 65  s..    # Use the
1a410 20 64 6f 75 62 6c 65 20 65 76 61 6c 20 74 6f 20   double eval to 
1a420 6d 61 6b 65 20 73 75 72 65 20 61 6e 79 20 76 61  make sure any va
1a430 72 69 61 62 6c 65 73 20 69 6e 20 74 68 65 20 73  riables in the s
1a440 75 66 66 69 78 20 69 73 0a 20 20 20 20 23 20 73  uffix is.    # s
1a450 75 62 73 74 69 74 75 74 65 64 2e 20 28 40 40 40  ubstituted. (@@@
1a460 20 4d 69 67 68 74 20 6e 6f 74 20 62 65 20 6e 65   Might not be ne
1a470 63 65 73 73 61 72 79 20 61 6e 79 6d 6f 72 65 29  cessary anymore)
1a480 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
1a490 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a4a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a4b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a4c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20 20 20 20  ----------..    
1a4d0 69 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f 50  if test "${TEA_P
1a4e0 4c 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e  LATFORM}" = "win
1a4f0 64 6f 77 73 22 20 3b 20 74 68 65 6e 0a 09 69 66  dows" ; then..if
1a500 20 74 65 73 74 20 22 24 7b 53 48 41 52 45 44 5f   test "${SHARED_
1a510 42 55 49 4c 44 7d 22 20 3d 20 22 31 22 20 3b 20  BUILD}" = "1" ; 
1a520 74 68 65 6e 0a 09 20 20 20 20 23 20 57 65 20 66  then..    # We f
1a530 6f 72 63 65 20 74 68 65 20 75 6e 72 65 73 6f 6c  orce the unresol
1a540 76 65 64 20 6c 69 6e 6b 69 6e 67 20 6f 66 20 73  ved linking of s
1a550 79 6d 62 6f 6c 73 20 74 68 61 74 20 61 72 65 20  ymbols that are 
1a560 72 65 61 6c 6c 79 20 69 6e 0a 09 20 20 20 20 23  really in..    #
1a570 20 74 68 65 20 70 72 69 76 61 74 65 20 6c 69 62   the private lib
1a580 72 61 72 69 65 73 20 6f 66 20 54 63 6c 20 61 6e  raries of Tcl an
1a590 64 20 54 6b 2e 0a 09 20 20 20 20 69 66 20 74 65  d Tk...    if te
1a5a0 73 74 20 78 22 24 7b 54 4b 5f 42 49 4e 5f 44 49  st x"${TK_BIN_DI
1a5b0 52 7d 22 20 21 3d 20 78 20 3b 20 74 68 65 6e 0a  R}" != x ; then.
1a5c0 09 09 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d  ..SHLIB_LD_LIBS=
1a5d0 22 24 7b 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53  "${SHLIB_LD_LIBS
1a5e0 7d 20 5c 22 60 24 7b 43 59 47 50 41 54 48 7d 20  } \"`${CYGPATH} 
1a5f0 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 24 7b  ${TK_BIN_DIR}/${
1a600 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45  TK_STUB_LIB_FILE
1a610 7d 60 5c 22 22 0a 09 20 20 20 20 66 69 0a 09 20  }`\""..    fi.. 
1a620 20 20 20 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53     SHLIB_LD_LIBS
1a630 3d 22 24 7b 53 48 4c 49 42 5f 4c 44 5f 4c 49 42  ="${SHLIB_LD_LIB
1a640 53 7d 20 5c 22 60 24 7b 43 59 47 50 41 54 48 7d  S} \"`${CYGPATH}
1a650 20 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f   ${TCL_BIN_DIR}/
1a660 24 7b 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46  ${TCL_STUB_LIB_F
1a670 49 4c 45 7d 60 5c 22 22 0a 09 20 20 20 20 69 66  ILE}`\""..    if
1a680 20 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 22   test "$GCC" = "
1a690 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 53 48 4c  yes"; then...SHL
1a6a0 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 24 7b 53 48  IB_LD_LIBS="${SH
1a6b0 4c 49 42 5f 4c 44 5f 4c 49 42 53 7d 20 2d 73 74  LIB_LD_LIBS} -st
1a6c0 61 74 69 63 2d 6c 69 62 67 63 63 22 0a 09 20 20  atic-libgcc"..  
1a6d0 20 20 66 69 0a 09 20 20 20 20 65 76 61 6c 20 65    fi..    eval e
1a6e0 76 61 6c 20 22 50 4b 47 5f 4c 49 42 5f 46 49 4c  val "PKG_LIB_FIL
1a6f0 45 3d 24 7b 50 41 43 4b 41 47 45 5f 4e 41 4d 45  E=${PACKAGE_NAME
1a700 7d 24 7b 53 48 41 52 45 44 5f 4c 49 42 5f 53 55  }${SHARED_LIB_SU
1a710 46 46 49 58 7d 22 0a 09 65 6c 73 65 0a 09 20 20  FFIX}"..else..  
1a720 20 20 65 76 61 6c 20 65 76 61 6c 20 22 50 4b 47    eval eval "PKG
1a730 5f 4c 49 42 5f 46 49 4c 45 3d 24 7b 50 41 43 4b  _LIB_FILE=${PACK
1a740 41 47 45 5f 4e 41 4d 45 7d 24 7b 55 4e 53 48 41  AGE_NAME}${UNSHA
1a750 52 45 44 5f 4c 49 42 5f 53 55 46 46 49 58 7d 22  RED_LIB_SUFFIX}"
1a760 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 22 24  ..    if test "$
1a770 47 43 43 22 20 3d 20 22 79 65 73 22 3b 20 74 68  GCC" = "yes"; th
1a780 65 6e 0a 09 09 50 4b 47 5f 4c 49 42 5f 46 49 4c  en...PKG_LIB_FIL
1a790 45 3d 6c 69 62 24 7b 50 4b 47 5f 4c 49 42 5f 46  E=lib${PKG_LIB_F
1a7a0 49 4c 45 7d 0a 09 20 20 20 20 66 69 0a 09 66 69  ILE}..    fi..fi
1a7b0 0a 09 23 20 53 6f 6d 65 20 70 61 63 6b 61 67 65  ..# Some package
1a7c0 73 20 62 75 69 6c 64 20 74 68 65 69 72 20 6f 77  s build their ow
1a7d0 6e 20 73 74 75 62 73 20 6c 69 62 72 61 72 69 65  n stubs librarie
1a7e0 73 0a 09 65 76 61 6c 20 65 76 61 6c 20 22 50 4b  s..eval eval "PK
1a7f0 47 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 3d  G_STUB_LIB_FILE=
1a800 24 7b 50 41 43 4b 41 47 45 5f 4e 41 4d 45 7d 73  ${PACKAGE_NAME}s
1a810 74 75 62 24 7b 55 4e 53 48 41 52 45 44 5f 4c 49  tub${UNSHARED_LI
1a820 42 5f 53 55 46 46 49 58 7d 22 0a 09 69 66 20 74  B_SUFFIX}"..if t
1a830 65 73 74 20 22 24 47 43 43 22 20 3d 20 22 79 65  est "$GCC" = "ye
1a840 73 22 3b 20 74 68 65 6e 0a 09 20 20 20 20 50 4b  s"; then..    PK
1a850 47 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 3d  G_STUB_LIB_FILE=
1a860 6c 69 62 24 7b 50 4b 47 5f 53 54 55 42 5f 4c 49  lib${PKG_STUB_LI
1a870 42 5f 46 49 4c 45 7d 0a 09 66 69 0a 09 23 20 54  B_FILE}..fi..# T
1a880 68 65 73 65 20 61 72 65 6e 27 74 20 6e 65 65 64  hese aren't need
1a890 65 64 20 6f 6e 20 57 69 6e 64 6f 77 73 20 28 65  ed on Windows (e
1a8a0 69 74 68 65 72 20 4d 53 56 43 20 6f 72 20 67 63  ither MSVC or gc
1a8b0 63 29 0a 09 52 41 4e 4c 49 42 3d 3a 0a 09 52 41  c)..RANLIB=:..RA
1a8c0 4e 4c 49 42 5f 53 54 55 42 3d 3a 0a 20 20 20 20  NLIB_STUB=:.    
1a8d0 65 6c 73 65 0a 09 52 41 4e 4c 49 42 5f 53 54 55  else..RANLIB_STU
1a8e0 42 3d 22 24 7b 52 41 4e 4c 49 42 7d 22 0a 09 69  B="${RANLIB}"..i
1a8f0 66 20 74 65 73 74 20 22 24 7b 53 48 41 52 45 44  f test "${SHARED
1a900 5f 42 55 49 4c 44 7d 22 20 3d 20 22 31 22 20 3b  _BUILD}" = "1" ;
1a910 20 74 68 65 6e 0a 09 20 20 20 20 53 48 4c 49 42   then..    SHLIB
1a920 5f 4c 44 5f 4c 49 42 53 3d 22 24 7b 53 48 4c 49  _LD_LIBS="${SHLI
1a930 42 5f 4c 44 5f 4c 49 42 53 7d 20 24 7b 54 43 4c  B_LD_LIBS} ${TCL
1a940 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 7d 22  _STUB_LIB_SPEC}"
1a950 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 78 22  ..    if test x"
1a960 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 22 20 21  ${TK_BIN_DIR}" !
1a970 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 53 48 4c  = x ; then...SHL
1a980 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 24 7b 53 48  IB_LD_LIBS="${SH
1a990 4c 49 42 5f 4c 44 5f 4c 49 42 53 7d 20 24 7b 54  LIB_LD_LIBS} ${T
1a9a0 4b 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 7d  K_STUB_LIB_SPEC}
1a9b0 22 0a 09 20 20 20 20 66 69 0a 09 20 20 20 20 65  "..    fi..    e
1a9c0 76 61 6c 20 65 76 61 6c 20 22 50 4b 47 5f 4c 49  val eval "PKG_LI
1a9d0 42 5f 46 49 4c 45 3d 6c 69 62 24 7b 50 41 43 4b  B_FILE=lib${PACK
1a9e0 41 47 45 5f 4e 41 4d 45 7d 24 7b 53 48 41 52 45  AGE_NAME}${SHARE
1a9f0 44 5f 4c 49 42 5f 53 55 46 46 49 58 7d 22 0a 09  D_LIB_SUFFIX}"..
1aa00 20 20 20 20 52 41 4e 4c 49 42 3d 3a 0a 09 65 6c      RANLIB=:..el
1aa10 73 65 0a 09 20 20 20 20 65 76 61 6c 20 65 76 61  se..    eval eva
1aa20 6c 20 22 50 4b 47 5f 4c 49 42 5f 46 49 4c 45 3d  l "PKG_LIB_FILE=
1aa30 6c 69 62 24 7b 50 41 43 4b 41 47 45 5f 4e 41 4d  lib${PACKAGE_NAM
1aa40 45 7d 24 7b 55 4e 53 48 41 52 45 44 5f 4c 49 42  E}${UNSHARED_LIB
1aa50 5f 53 55 46 46 49 58 7d 22 0a 09 66 69 0a 09 23  _SUFFIX}"..fi..#
1aa60 20 53 6f 6d 65 20 70 61 63 6b 61 67 65 73 20 62   Some packages b
1aa70 75 69 6c 64 20 74 68 65 69 72 20 6f 77 6e 20 73  uild their own s
1aa80 74 75 62 73 20 6c 69 62 72 61 72 69 65 73 0a 09  tubs libraries..
1aa90 65 76 61 6c 20 65 76 61 6c 20 22 50 4b 47 5f 53  eval eval "PKG_S
1aaa0 54 55 42 5f 4c 49 42 5f 46 49 4c 45 3d 6c 69 62  TUB_LIB_FILE=lib
1aab0 24 7b 50 41 43 4b 41 47 45 5f 4e 41 4d 45 7d 73  ${PACKAGE_NAME}s
1aac0 74 75 62 24 7b 55 4e 53 48 41 52 45 44 5f 4c 49  tub${UNSHARED_LI
1aad0 42 5f 53 55 46 46 49 58 7d 22 0a 20 20 20 20 66  B_SUFFIX}".    f
1aae0 69 0a 0a 20 20 20 20 23 20 54 68 65 73 65 20 61  i..    # These a
1aaf0 72 65 20 65 73 63 61 70 65 64 20 73 6f 20 74 68  re escaped so th
1ab00 61 74 20 6f 6e 6c 79 20 43 46 4c 41 47 53 20 69  at only CFLAGS i
1ab10 73 20 70 69 63 6b 65 64 20 75 70 20 61 74 20 63  s picked up at c
1ab20 6f 6e 66 69 67 75 72 65 20 74 69 6d 65 2e 0a 20  onfigure time.. 
1ab30 20 20 20 23 20 54 68 65 20 6f 74 68 65 72 20 76     # The other v
1ab40 61 6c 75 65 73 20 77 69 6c 6c 20 62 65 20 73 75  alues will be su
1ab50 62 73 74 69 74 75 74 65 64 20 61 74 20 6d 61 6b  bstituted at mak
1ab60 65 20 74 69 6d 65 2e 0a 20 20 20 20 43 46 4c 41  e time..    CFLA
1ab70 47 53 3d 22 24 7b 43 46 4c 41 47 53 7d 20 5c 24  GS="${CFLAGS} \$
1ab80 7b 43 46 4c 41 47 53 5f 44 45 46 41 55 4c 54 7d  {CFLAGS_DEFAULT}
1ab90 20 5c 24 7b 43 46 4c 41 47 53 5f 57 41 52 4e 49   \${CFLAGS_WARNI
1aba0 4e 47 7d 22 0a 20 20 20 20 69 66 20 74 65 73 74  NG}".    if test
1abb0 20 22 24 7b 53 48 41 52 45 44 5f 42 55 49 4c 44   "${SHARED_BUILD
1abc0 7d 22 20 3d 20 22 31 22 20 3b 20 74 68 65 6e 0a  }" = "1" ; then.
1abd0 09 43 46 4c 41 47 53 3d 22 24 7b 43 46 4c 41 47  .CFLAGS="${CFLAG
1abe0 53 7d 20 5c 24 7b 53 48 4c 49 42 5f 43 46 4c 41  S} \${SHLIB_CFLA
1abf0 47 53 7d 22 0a 20 20 20 20 66 69 0a 0a 20 20 20  GS}".    fi..   
1ac00 20 41 43 5f 53 55 42 53 54 28 4d 41 4b 45 5f 4c   AC_SUBST(MAKE_L
1ac10 49 42 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54  IB).    AC_SUBST
1ac20 28 4d 41 4b 45 5f 53 48 41 52 45 44 5f 4c 49 42  (MAKE_SHARED_LIB
1ac30 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 4d  ).    AC_SUBST(M
1ac40 41 4b 45 5f 53 54 41 54 49 43 5f 4c 49 42 29 0a  AKE_STATIC_LIB).
1ac50 20 20 20 20 41 43 5f 53 55 42 53 54 28 4d 41 4b      AC_SUBST(MAK
1ac60 45 5f 53 54 55 42 5f 4c 49 42 29 0a 20 20 20 20  E_STUB_LIB).    
1ac70 41 43 5f 53 55 42 53 54 28 52 41 4e 4c 49 42 5f  AC_SUBST(RANLIB_
1ac80 53 54 55 42 29 0a 20 20 20 20 41 43 5f 53 55 42  STUB).    AC_SUB
1ac90 53 54 28 56 43 5f 4d 41 4e 49 46 45 53 54 5f 45  ST(VC_MANIFEST_E
1aca0 4d 42 45 44 5f 44 4c 4c 29 0a 20 20 20 20 41 43  MBED_DLL).    AC
1acb0 5f 53 55 42 53 54 28 56 43 5f 4d 41 4e 49 46 45  _SUBST(VC_MANIFE
1acc0 53 54 5f 45 4d 42 45 44 5f 45 58 45 29 0a 5d 29  ST_EMBED_EXE).])
1acd0 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
1ace0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1acf0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ad00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ad10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45  -----------.# TE
1ad20 41 5f 4c 49 42 5f 53 50 45 43 20 2d 2d 0a 23 0a  A_LIB_SPEC --.#.
1ad30 23 09 43 6f 6d 70 75 74 65 20 74 68 65 20 6e 61  #.Compute the na
1ad40 6d 65 20 6f 66 20 61 6e 20 65 78 69 73 74 69 6e  me of an existin
1ad50 67 20 6f 62 6a 65 63 74 20 6c 69 62 72 61 72 79  g object library
1ad60 20 6c 6f 63 61 74 65 64 20 69 6e 20 6c 69 62 64   located in libd
1ad70 69 72 0a 23 09 66 72 6f 6d 20 74 68 65 20 67 69  ir.#.from the gi
1ad80 76 65 6e 20 62 61 73 65 20 6e 61 6d 65 20 61 6e  ven base name an
1ad90 64 20 70 72 6f 64 75 63 65 20 74 68 65 20 61 70  d produce the ap
1ada0 70 72 6f 70 72 69 61 74 65 20 6c 69 6e 6b 65 72  propriate linker
1adb0 20 66 6c 61 67 73 2e 0a 23 0a 23 20 41 72 67 75   flags..#.# Argu
1adc0 6d 65 6e 74 73 3a 0a 23 09 62 61 73 65 6e 61 6d  ments:.#.basenam
1add0 65 09 54 68 65 20 62 61 73 65 20 6e 61 6d 65 20  e.The base name 
1ade0 6f 66 20 74 68 65 20 6c 69 62 72 61 72 79 20 77  of the library w
1adf0 69 74 68 6f 75 74 20 76 65 72 73 69 6f 6e 0a 23  ithout version.#
1ae00 09 09 09 6e 75 6d 62 65 72 73 2c 20 65 78 74 65  ...numbers, exte
1ae10 6e 73 69 6f 6e 73 2c 20 6f 72 20 22 6c 69 62 22  nsions, or "lib"
1ae20 20 70 72 65 66 69 78 65 73 2e 0a 23 09 65 78 74   prefixes..#.ext
1ae30 72 61 5f 64 69 72 09 45 78 74 72 61 20 64 69 72  ra_dir.Extra dir
1ae40 65 63 74 6f 72 79 20 69 6e 20 77 68 69 63 68 20  ectory in which 
1ae50 74 6f 20 73 65 61 72 63 68 20 66 6f 72 20 74 68  to search for th
1ae60 65 0a 23 09 09 09 6c 69 62 72 61 72 79 2e 20 20  e.#...library.  
1ae70 54 68 69 73 20 6c 6f 63 61 74 69 6f 6e 20 69 73  This location is
1ae80 20 75 73 65 64 20 66 69 72 73 74 2c 20 74 68 65   used first, the
1ae90 6e 0a 23 09 09 09 24 70 72 65 66 69 78 2f 24 65  n.#...$prefix/$e
1aea0 78 65 63 2d 70 72 65 66 69 78 2c 20 74 68 65 6e  xec-prefix, then
1aeb0 20 73 6f 6d 65 20 64 65 66 61 75 6c 74 73 2e 0a   some defaults..
1aec0 23 0a 23 20 52 65 71 75 69 72 65 73 3a 0a 23 09  #.# Requires:.#.
1aed0 54 45 41 5f 49 4e 49 54 20 61 6e 64 20 54 45 41  TEA_INIT and TEA
1aee0 5f 50 52 45 46 49 58 20 6d 75 73 74 20 62 65 20  _PREFIX must be 
1aef0 63 61 6c 6c 65 64 20 66 69 72 73 74 2e 0a 23 0a  called first..#.
1af00 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 44  # Results:.#.#.D
1af10 65 66 69 6e 65 73 20 74 68 65 20 66 6f 6c 6c 6f  efines the follo
1af20 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 24 7b  wing vars:.#..${
1af30 62 61 73 65 6e 61 6d 65 7d 5f 4c 49 42 5f 4e 41  basename}_LIB_NA
1af40 4d 45 09 54 68 65 20 63 6f 6d 70 75 74 65 64 20  ME.The computed 
1af50 6c 69 62 72 61 72 79 20 6e 61 6d 65 2e 0a 23 09  library name..#.
1af60 09 24 7b 62 61 73 65 6e 61 6d 65 7d 5f 4c 49 42  .${basename}_LIB
1af70 5f 53 50 45 43 09 54 68 65 20 63 6f 6d 70 75 74  _SPEC.The comput
1af80 65 64 20 6c 69 6e 6b 65 72 20 66 6c 61 67 73 2e  ed linker flags.
1af90 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
1afa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1afb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1afc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1afd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44  ----------..AC_D
1afe0 45 46 55 4e 28 5b 54 45 41 5f 4c 49 42 5f 53 50  EFUN([TEA_LIB_SP
1aff0 45 43 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d 53  EC], [.    AC_MS
1b000 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20  G_CHECKING([for 
1b010 24 31 20 6c 69 62 72 61 72 79 5d 29 0a 0a 20 20  $1 library])..  
1b020 20 20 23 20 4c 6f 6f 6b 20 69 6e 20 65 78 65 63    # Look in exec
1b030 2d 70 72 65 66 69 78 20 66 6f 72 20 74 68 65 20  -prefix for the 
1b040 6c 69 62 72 61 72 79 20 28 64 65 66 69 6e 65 64  library (defined
1b050 20 62 79 20 54 45 41 5f 50 52 45 46 49 58 29 2e   by TEA_PREFIX).
1b060 0a 0a 20 20 20 20 74 65 61 5f 6c 69 62 5f 6e 61  ..    tea_lib_na
1b070 6d 65 5f 64 69 72 3d 22 24 7b 65 78 65 63 5f 70  me_dir="${exec_p
1b080 72 65 66 69 78 7d 2f 6c 69 62 22 0a 0a 20 20 20  refix}/lib"..   
1b090 20 23 20 4f 72 20 69 6e 20 61 20 75 73 65 72 2d   # Or in a user-
1b0a0 73 70 65 63 69 66 69 65 64 20 6c 6f 63 61 74 69  specified locati
1b0b0 6f 6e 2e 0a 0a 20 20 20 20 69 66 20 74 65 73 74  on...    if test
1b0c0 20 78 22 24 32 22 20 21 3d 20 78 20 3b 20 74 68   x"$2" != x ; th
1b0d0 65 6e 0a 09 74 65 61 5f 65 78 74 72 61 5f 6c 69  en..tea_extra_li
1b0e0 62 5f 64 69 72 3d 24 32 0a 20 20 20 20 65 6c 73  b_dir=$2.    els
1b0f0 65 0a 09 74 65 61 5f 65 78 74 72 61 5f 6c 69 62  e..tea_extra_lib
1b100 5f 64 69 72 3d 4e 4f 4e 45 0a 20 20 20 20 66 69  _dir=NONE.    fi
1b110 0a 0a 20 20 20 20 66 6f 72 20 69 20 69 6e 20 5c  ..    for i in \
1b120 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 24 7b  ..    `ls -dr ${
1b130 74 65 61 5f 65 78 74 72 61 5f 6c 69 62 5f 64 69  tea_extra_lib_di
1b140 72 7d 2f 24 31 5b 5b 30 2d 39 5d 5d 2a 2e 6c 69  r}/$1[[0-9]]*.li
1b150 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 60 20  b 2>/dev/null ` 
1b160 5c 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 24  \..    `ls -dr $
1b170 7b 74 65 61 5f 65 78 74 72 61 5f 6c 69 62 5f 64  {tea_extra_lib_d
1b180 69 72 7d 2f 6c 69 62 24 31 5b 5b 30 2d 39 5d 5d  ir}/lib$1[[0-9]]
1b190 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 60 20  * 2>/dev/null ` 
1b1a0 5c 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 24  \..    `ls -dr $
1b1b0 7b 74 65 61 5f 6c 69 62 5f 6e 61 6d 65 5f 64 69  {tea_lib_name_di
1b1c0 72 7d 2f 24 31 5b 5b 30 2d 39 5d 5d 2a 2e 6c 69  r}/$1[[0-9]]*.li
1b1d0 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 60 20  b 2>/dev/null ` 
1b1e0 5c 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 24  \..    `ls -dr $
1b1f0 7b 74 65 61 5f 6c 69 62 5f 6e 61 6d 65 5f 64 69  {tea_lib_name_di
1b200 72 7d 2f 6c 69 62 24 31 5b 5b 30 2d 39 5d 5d 2a  r}/lib$1[[0-9]]*
1b210 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 60 20 5c   2>/dev/null ` \
1b220 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 2f 75  ..    `ls -dr /u
1b230 73 72 2f 6c 69 62 2f 24 31 5b 5b 30 2d 39 5d 5d  sr/lib/$1[[0-9]]
1b240 2a 2e 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c  *.lib 2>/dev/nul
1b250 6c 20 60 20 5c 0a 09 20 20 20 20 60 6c 73 20 2d  l ` \..    `ls -
1b260 64 72 20 2f 75 73 72 2f 6c 69 62 2f 6c 69 62 24  dr /usr/lib/lib$
1b270 31 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76  1[[0-9]]* 2>/dev
1b280 2f 6e 75 6c 6c 20 60 20 5c 0a 09 20 20 20 20 60  /null ` \..    `
1b290 6c 73 20 2d 64 72 20 2f 75 73 72 2f 6c 69 62 36  ls -dr /usr/lib6
1b2a0 34 2f 24 31 5b 5b 30 2d 39 5d 5d 2a 2e 6c 69 62  4/$1[[0-9]]*.lib
1b2b0 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 60 20 5c   2>/dev/null ` \
1b2c0 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 2f 75  ..    `ls -dr /u
1b2d0 73 72 2f 6c 69 62 36 34 2f 6c 69 62 24 31 5b 5b  sr/lib64/lib$1[[
1b2e0 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75  0-9]]* 2>/dev/nu
1b2f0 6c 6c 20 60 20 5c 0a 09 20 20 20 20 60 6c 73 20  ll ` \..    `ls 
1b300 2d 64 72 20 2f 75 73 72 2f 6c 6f 63 61 6c 2f 6c  -dr /usr/local/l
1b310 69 62 2f 24 31 5b 5b 30 2d 39 5d 5d 2a 2e 6c 69  ib/$1[[0-9]]*.li
1b320 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 60 20  b 2>/dev/null ` 
1b330 5c 0a 09 20 20 20 20 60 6c 73 20 2d 64 72 20 2f  \..    `ls -dr /
1b340 75 73 72 2f 6c 6f 63 61 6c 2f 6c 69 62 2f 6c 69  usr/local/lib/li
1b350 62 24 31 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64  b$1[[0-9]]* 2>/d
1b360 65 76 2f 6e 75 6c 6c 20 60 20 3b 20 64 6f 0a 09  ev/null ` ; do..
1b370 69 66 20 74 65 73 74 20 2d 66 20 22 24 69 22 20  if test -f "$i" 
1b380 3b 20 74 68 65 6e 0a 09 20 20 20 20 74 65 61 5f  ; then..    tea_
1b390 6c 69 62 5f 6e 61 6d 65 5f 64 69 72 3d 60 64 69  lib_name_dir=`di
1b3a0 72 6e 61 6d 65 20 24 69 60 0a 09 20 20 20 20 24  rname $i`..    $
1b3b0 31 5f 4c 49 42 5f 4e 41 4d 45 3d 60 62 61 73 65  1_LIB_NAME=`base
1b3c0 6e 61 6d 65 20 24 69 60 0a 09 20 20 20 20 24 31  name $i`..    $1
1b3d0 5f 4c 49 42 5f 50 41 54 48 5f 4e 41 4d 45 3d 24  _LIB_PATH_NAME=$
1b3e0 69 0a 09 20 20 20 20 62 72 65 61 6b 0a 09 66 69  i..    break..fi
1b3f0 0a 20 20 20 20 64 6f 6e 65 0a 0a 20 20 20 20 69  .    done..    i
1b400 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c  f test "${TEA_PL
1b410 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64  ATFORM}" = "wind
1b420 6f 77 73 22 3b 20 74 68 65 6e 0a 09 24 31 5f 4c  ows"; then..$1_L
1b430 49 42 5f 53 50 45 43 3d 5c 22 60 24 7b 43 59 47  IB_SPEC=\"`${CYG
1b440 50 41 54 48 7d 20 24 7b 24 31 5f 4c 49 42 5f 50  PATH} ${$1_LIB_P
1b450 41 54 48 5f 4e 41 4d 45 7d 20 32 3e 2f 64 65 76  ATH_NAME} 2>/dev
1b460 2f 6e 75 6c 6c 60 5c 22 0a 20 20 20 20 65 6c 73  /null`\".    els
1b470 65 0a 09 23 20 53 74 72 69 70 20 6f 66 66 20 74  e..# Strip off t
1b480 68 65 20 6c 65 61 64 69 6e 67 20 22 6c 69 62 22  he leading "lib"
1b490 20 61 6e 64 20 74 72 61 69 6c 69 6e 67 20 22 2e   and trailing ".
1b4a0 61 22 20 6f 72 20 22 2e 73 6f 22 0a 0a 09 74 65  a" or ".so"...te
1b4b0 61 5f 6c 69 62 5f 6e 61 6d 65 5f 6c 69 62 3d 60  a_lib_name_lib=`
1b4c0 65 63 68 6f 20 24 7b 24 31 5f 4c 49 42 5f 4e 41  echo ${$1_LIB_NA
1b4d0 4d 45 7d 7c 73 65 64 20 2d 65 20 27 73 2f 5e 6c  ME}|sed -e 's/^l
1b4e0 69 62 2f 2f 27 20 2d 65 20 27 73 2f 5c 2e 5b 5b  ib//' -e 's/\.[[
1b4f0 5e 2e 5d 5d 2a 24 2f 2f 27 20 2d 65 20 27 73 2f  ^.]]*$//' -e 's/
1b500 5c 2e 73 6f 2e 2a 2f 2f 27 60 0a 09 24 31 5f 4c  \.so.*//'`..$1_L
1b510 49 42 5f 53 50 45 43 3d 22 2d 4c 24 7b 74 65 61  IB_SPEC="-L${tea
1b520 5f 6c 69 62 5f 6e 61 6d 65 5f 64 69 72 7d 20 2d  _lib_name_dir} -
1b530 6c 24 7b 74 65 61 5f 6c 69 62 5f 6e 61 6d 65 5f  l${tea_lib_name_
1b540 6c 69 62 7d 22 0a 20 20 20 20 66 69 0a 0a 20 20  lib}".    fi..  
1b550 20 20 69 66 20 74 65 73 74 20 22 78 24 7b 24 31    if test "x${$1
1b560 5f 4c 49 42 5f 4e 41 4d 45 7d 22 20 3d 20 78 20  _LIB_NAME}" = x 
1b570 3b 20 74 68 65 6e 0a 09 41 43 5f 4d 53 47 5f 45  ; then..AC_MSG_E
1b580 52 52 4f 52 28 5b 6e 6f 74 20 66 6f 75 6e 64 5d  RROR([not found]
1b590 29 0a 20 20 20 20 65 6c 73 65 0a 09 41 43 5f 4d  ).    else..AC_M
1b5a0 53 47 5f 52 45 53 55 4c 54 28 5b 24 7b 24 31 5f  SG_RESULT([${$1_
1b5b0 4c 49 42 5f 53 50 45 43 7d 5d 29 0a 20 20 20 20  LIB_SPEC}]).    
1b5c0 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.])..#--------
1b5d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b5e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b5f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b610 0a 23 20 54 45 41 5f 50 52 49 56 41 54 45 5f 54  .# TEA_PRIVATE_T
1b620 43 4c 5f 48 45 41 44 45 52 53 20 2d 2d 0a 23 0a  CL_HEADERS --.#.
1b630 23 09 4c 6f 63 61 74 65 20 74 68 65 20 70 72 69  #.Locate the pri
1b640 76 61 74 65 20 54 63 6c 20 69 6e 63 6c 75 64 65  vate Tcl include
1b650 20 66 69 6c 65 73 0a 23 0a 23 20 41 72 67 75 6d   files.#.# Argum
1b660 65 6e 74 73 3a 0a 23 0a 23 09 52 65 71 75 69 72  ents:.#.#.Requir
1b670 65 73 3a 0a 23 09 09 54 43 4c 5f 53 52 43 5f 44  es:.#..TCL_SRC_D
1b680 49 52 09 41 73 73 75 6d 65 73 20 74 68 61 74 20  IR.Assumes that 
1b690 54 45 41 5f 4c 4f 41 44 5f 54 43 4c 43 4f 4e 46  TEA_LOAD_TCLCONF
1b6a0 49 47 20 68 61 73 0a 23 09 09 09 09 61 6c 72 65  IG has.#....alre
1b6b0 61 64 79 20 62 65 65 6e 20 63 61 6c 6c 65 64 2e  ady been called.
1b6c0 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a  .#.# Results:.#.
1b6d0 23 09 53 75 62 73 74 69 74 75 74 65 73 20 74 68  #.Substitutes th
1b6e0 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
1b6f0 3a 0a 23 09 09 54 43 4c 5f 54 4f 50 5f 44 49 52  :.#..TCL_TOP_DIR
1b700 5f 4e 41 54 49 56 45 0a 23 09 09 54 43 4c 5f 49  _NATIVE.#..TCL_I
1b710 4e 43 4c 55 44 45 53 0a 23 2d 2d 2d 2d 2d 2d 2d  NCLUDES.#-------
1b720 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b730 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b740 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b750 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b760 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45 41  -..AC_DEFUN([TEA
1b770 5f 50 52 49 56 41 54 45 5f 54 43 4c 5f 48 45 41  _PRIVATE_TCL_HEA
1b780 44 45 52 53 5d 2c 20 5b 0a 20 20 20 20 23 20 41  DERS], [.    # A
1b790 6c 6c 6f 77 20 66 6f 72 20 2d 2d 77 69 74 68 2d  llow for --with-
1b7a0 74 63 6c 69 6e 63 6c 75 64 65 20 74 6f 20 74 61  tclinclude to ta
1b7b0 6b 65 20 65 66 66 65 63 74 20 61 6e 64 20 64 65  ke effect and de
1b7c0 66 69 6e 65 20 24 7b 61 63 5f 63 76 5f 63 5f 74  fine ${ac_cv_c_t
1b7d0 63 6c 68 7d 0a 20 20 20 20 41 43 5f 52 45 51 55  clh}.    AC_REQU
1b7e0 49 52 45 28 5b 54 45 41 5f 50 55 42 4c 49 43 5f  IRE([TEA_PUBLIC_
1b7f0 54 43 4c 5f 48 45 41 44 45 52 53 5d 29 0a 20 20  TCL_HEADERS]).  
1b800 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e    AC_MSG_CHECKIN
1b810 47 28 5b 66 6f 72 20 54 63 6c 20 70 72 69 76 61  G([for Tcl priva
1b820 74 65 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 73  te include files
1b830 5d 29 0a 0a 20 20 20 20 54 43 4c 5f 53 52 43 5f  ])..    TCL_SRC_
1b840 44 49 52 5f 4e 41 54 49 56 45 3d 60 24 7b 43 59  DIR_NATIVE=`${CY
1b850 47 50 41 54 48 7d 20 24 7b 54 43 4c 5f 53 52 43  GPATH} ${TCL_SRC
1b860 5f 44 49 52 7d 60 0a 20 20 20 20 54 43 4c 5f 54  _DIR}`.    TCL_T
1b870 4f 50 5f 44 49 52 5f 4e 41 54 49 56 45 3d 5c 22  OP_DIR_NATIVE=\"
1b880 24 7b 54 43 4c 5f 53 52 43 5f 44 49 52 5f 4e 41  ${TCL_SRC_DIR_NA
1b890 54 49 56 45 7d 5c 22 0a 0a 20 20 20 20 23 20 43  TIVE}\"..    # C
1b8a0 68 65 63 6b 20 74 6f 20 73 65 65 20 69 66 20 74  heck to see if t
1b8b0 63 6c 3c 50 6c 61 74 3e 50 6f 72 74 2e 68 20 69  cl<Plat>Port.h i
1b8c0 73 6e 27 74 20 61 6c 72 65 61 64 79 20 77 69 74  sn't already wit
1b8d0 68 20 74 68 65 20 70 75 62 6c 69 63 20 68 65 61  h the public hea
1b8e0 64 65 72 73 0a 20 20 20 20 23 20 44 6f 6e 27 74  ders.    # Don't
1b8f0 20 6c 6f 6f 6b 20 66 6f 72 20 74 63 6c 49 6e 74   look for tclInt
1b900 2e 68 20 62 65 63 61 75 73 65 20 74 68 61 74 20  .h because that 
1b910 72 65 73 69 64 65 73 20 77 69 74 68 20 74 63 6c  resides with tcl
1b920 2e 68 20 69 6e 20 74 68 65 20 63 6f 72 65 0a 20  .h in the core. 
1b930 20 20 20 23 20 73 6f 75 72 63 65 73 2c 20 62 75     # sources, bu
1b940 74 20 74 68 65 20 3c 70 6c 61 74 3e 50 6f 72 74  t the <plat>Port
1b950 20 68 65 61 64 65 72 73 20 61 72 65 20 69 6e 20   headers are in 
1b960 61 20 64 69 66 66 65 72 65 6e 74 20 64 69 72 65  a different dire
1b970 63 74 6f 72 79 0a 20 20 20 20 69 66 20 74 65 73  ctory.    if tes
1b980 74 20 22 24 7b 54 45 41 5f 50 4c 41 54 46 4f 52  t "${TEA_PLATFOR
1b990 4d 7d 22 20 3d 20 22 77 69 6e 64 6f 77 73 22 20  M}" = "windows" 
1b9a0 2d 61 20 5c 0a 09 2d 66 20 22 24 7b 61 63 5f 63  -a \..-f "${ac_c
1b9b0 76 5f 63 5f 74 63 6c 68 7d 2f 74 63 6c 57 69 6e  v_c_tclh}/tclWin
1b9c0 50 6f 72 74 2e 68 22 3b 20 74 68 65 6e 0a 09 72  Port.h"; then..r
1b9d0 65 73 75 6c 74 3d 22 70 72 69 76 61 74 65 20 68  esult="private h
1b9e0 65 61 64 65 72 73 20 66 6f 75 6e 64 20 77 69 74  eaders found wit
1b9f0 68 20 70 75 62 6c 69 63 20 68 65 61 64 65 72 73  h public headers
1ba00 22 0a 20 20 20 20 65 6c 69 66 20 74 65 73 74 20  ".    elif test 
1ba10 22 24 7b 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d  "${TEA_PLATFORM}
1ba20 22 20 3d 20 22 75 6e 69 78 22 20 2d 61 20 5c 0a  " = "unix" -a \.
1ba30 09 2d 66 20 22 24 7b 61 63 5f 63 76 5f 63 5f 74  .-f "${ac_cv_c_t
1ba40 63 6c 68 7d 2f 74 63 6c 55 6e 69 78 50 6f 72 74  clh}/tclUnixPort
1ba50 2e 68 22 3b 20 74 68 65 6e 0a 09 72 65 73 75 6c  .h"; then..resul
1ba60 74 3d 22 70 72 69 76 61 74 65 20 68 65 61 64 65  t="private heade
1ba70 72 73 20 66 6f 75 6e 64 20 77 69 74 68 20 70 75  rs found with pu
1ba80 62 6c 69 63 20 68 65 61 64 65 72 73 22 0a 20 20  blic headers".  
1ba90 20 20 65 6c 73 65 0a 09 54 43 4c 5f 47 45 4e 45    else..TCL_GENE
1baa0 52 49 43 5f 44 49 52 5f 4e 41 54 49 56 45 3d 5c  RIC_DIR_NATIVE=\
1bab0 22 24 7b 54 43 4c 5f 53 52 43 5f 44 49 52 5f 4e  "${TCL_SRC_DIR_N
1bac0 41 54 49 56 45 7d 2f 67 65 6e 65 72 69 63 5c 22  ATIVE}/generic\"
1bad0 0a 09 69 66 20 74 65 73 74 20 22 24 7b 54 45 41  ..if test "${TEA
1bae0 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77  _PLATFORM}" = "w
1baf0 69 6e 64 6f 77 73 22 3b 20 74 68 65 6e 0a 09 20  indows"; then.. 
1bb00 20 20 20 54 43 4c 5f 50 4c 41 54 46 4f 52 4d 5f     TCL_PLATFORM_
1bb10 44 49 52 5f 4e 41 54 49 56 45 3d 5c 22 24 7b 54  DIR_NATIVE=\"${T
1bb20 43 4c 5f 53 52 43 5f 44 49 52 5f 4e 41 54 49 56  CL_SRC_DIR_NATIV
1bb30 45 7d 2f 77 69 6e 5c 22 0a 09 65 6c 73 65 0a 09  E}/win\"..else..
1bb40 20 20 20 20 54 43 4c 5f 50 4c 41 54 46 4f 52 4d      TCL_PLATFORM
1bb50 5f 44 49 52 5f 4e 41 54 49 56 45 3d 5c 22 24 7b  _DIR_NATIVE=\"${
1bb60 54 43 4c 5f 53 52 43 5f 44 49 52 5f 4e 41 54 49  TCL_SRC_DIR_NATI
1bb70 56 45 7d 2f 75 6e 69 78 5c 22 0a 09 66 69 0a 09  VE}/unix\"..fi..
1bb80 23 20 4f 76 65 72 77 72 69 74 65 20 74 68 65 20  # Overwrite the 
1bb90 70 72 65 76 69 6f 75 73 20 54 43 4c 5f 49 4e 43  previous TCL_INC
1bba0 4c 55 44 45 53 20 61 73 20 74 68 69 73 20 73 68  LUDES as this sh
1bbb0 6f 75 6c 64 20 63 61 70 74 75 72 65 20 62 6f 74  ould capture bot
1bbc0 68 0a 09 23 20 70 75 62 6c 69 63 20 61 6e 64 20  h..# public and 
1bbd0 70 72 69 76 61 74 65 20 68 65 61 64 65 72 73 20  private headers 
1bbe0 69 6e 20 74 68 65 20 73 61 6d 65 20 73 65 74 2e  in the same set.
1bbf0 0a 09 23 20 57 65 20 77 61 6e 74 20 74 6f 20 65  ..# We want to e
1bc00 6e 73 75 72 65 20 74 68 65 73 65 20 61 72 65 20  nsure these are 
1bc10 73 75 62 73 74 69 74 75 74 65 64 20 73 6f 20 61  substituted so a
1bc20 73 20 6e 6f 74 20 74 6f 20 72 65 71 75 69 72 65  s not to require
1bc30 0a 09 23 20 61 6e 79 20 2a 5f 4e 41 54 49 56 45  ..# any *_NATIVE
1bc40 20 76 61 72 73 20 62 65 20 64 65 66 69 6e 65 64   vars be defined
1bc50 20 69 6e 20 74 68 65 20 4d 61 6b 65 66 69 6c 65   in the Makefile
1bc60 0a 09 54 43 4c 5f 49 4e 43 4c 55 44 45 53 3d 22  ..TCL_INCLUDES="
1bc70 2d 49 24 7b 54 43 4c 5f 47 45 4e 45 52 49 43 5f  -I${TCL_GENERIC_
1bc80 44 49 52 5f 4e 41 54 49 56 45 7d 20 2d 49 24 7b  DIR_NATIVE} -I${
1bc90 54 43 4c 5f 50 4c 41 54 46 4f 52 4d 5f 44 49 52  TCL_PLATFORM_DIR
1bca0 5f 4e 41 54 49 56 45 7d 22 0a 09 69 66 20 74 65  _NATIVE}"..if te
1bcb0 73 74 20 22 60 75 6e 61 6d 65 20 2d 73 60 22 20  st "`uname -s`" 
1bcc0 3d 20 22 44 61 72 77 69 6e 22 3b 20 74 68 65 6e  = "Darwin"; then
1bcd0 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 49  .            # I
1bce0 66 20 54 63 6c 20 77 61 73 20 62 75 69 6c 74 20  f Tcl was built 
1bcf0 61 73 20 61 20 66 72 61 6d 65 77 6f 72 6b 2c 20  as a framework, 
1bd00 61 74 74 65 6d 70 74 20 74 6f 20 75 73 65 0a 20  attempt to use. 
1bd10 20 20 20 20 20 20 20 20 20 20 20 23 20 74 68 65             # the
1bd20 20 66 72 61 6d 65 77 6f 72 6b 27 73 20 48 65 61   framework's Hea
1bd30 64 65 72 73 20 61 6e 64 20 50 72 69 76 61 74 65  ders and Private
1bd40 48 65 61 64 65 72 73 20 64 69 72 65 63 74 6f 72  Headers director
1bd50 69 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20  ies.            
1bd60 63 61 73 65 20 24 7b 54 43 4c 5f 44 45 46 53 7d  case ${TCL_DEFS}
1bd70 20 69 6e 0a 09 20 20 20 20 09 2a 54 43 4c 5f 46   in..    .*TCL_F
1bd80 52 41 4d 45 57 4f 52 4b 2a 29 0a 09 09 20 20 20  RAMEWORK*)...   
1bd90 20 69 66 20 74 65 73 74 20 2d 64 20 22 24 7b 54   if test -d "${T
1bda0 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 48 65 61 64  CL_BIN_DIR}/Head
1bdb0 65 72 73 22 20 2d 61 20 5c 0a 09 09 09 20 20 20  ers" -a \....   
1bdc0 20 2d 64 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44   -d "${TCL_BIN_D
1bdd0 49 52 7d 2f 50 72 69 76 61 74 65 48 65 61 64 65  IR}/PrivateHeade
1bde0 72 73 22 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c  rs"; then....TCL
1bdf0 5f 49 4e 43 4c 55 44 45 53 3d 22 2d 49 5c 22 24  _INCLUDES="-I\"$
1be00 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 48 65  {TCL_BIN_DIR}/He
1be10 61 64 65 72 73 5c 22 20 2d 49 5c 22 24 7b 54 43  aders\" -I\"${TC
1be20 4c 5f 42 49 4e 5f 44 49 52 7d 2f 50 72 69 76 61  L_BIN_DIR}/Priva
1be30 74 65 48 65 61 64 65 72 73 5c 22 20 24 7b 54 43  teHeaders\" ${TC
1be40 4c 5f 49 4e 43 4c 55 44 45 53 7d 22 0a 09 09 20  L_INCLUDES}"... 
1be50 20 20 20 65 6c 73 65 0a 09 09 09 54 43 4c 5f 49     else....TCL_I
1be60 4e 43 4c 55 44 45 53 3d 22 24 7b 54 43 4c 5f 49  NCLUDES="${TCL_I
1be70 4e 43 4c 55 44 45 53 7d 20 24 7b 54 43 4c 5f 49  NCLUDES} ${TCL_I
1be80 4e 43 4c 55 44 45 5f 53 50 45 43 7d 20 60 65 63  NCLUDE_SPEC} `ec
1be90 68 6f 20 22 24 7b 54 43 4c 5f 49 4e 43 4c 55 44  ho "${TCL_INCLUD
1bea0 45 5f 53 50 45 43 7d 22 20 7c 20 73 65 64 20 2d  E_SPEC}" | sed -
1beb0 65 20 27 73 2f 48 65 61 64 65 72 73 2f 50 72 69  e 's/Headers/Pri
1bec0 76 61 74 65 48 65 61 64 65 72 73 2f 27 60 22 0a  vateHeaders/'`".
1bed0 09 09 20 20 20 20 66 69 0a 09 20 20 20 20 20 20  ..    fi..      
1bee0 20 20 20 20 20 20 3b 3b 0a 09 20 20 20 20 65 73        ;;..    es
1bef0 61 63 0a 09 20 20 20 20 72 65 73 75 6c 74 3d 22  ac..    result="
1bf00 55 73 69 6e 67 20 24 7b 54 43 4c 5f 49 4e 43 4c  Using ${TCL_INCL
1bf10 55 44 45 53 7d 22 0a 09 65 6c 73 65 0a 09 20 20  UDES}"..else..  
1bf20 20 20 69 66 20 74 65 73 74 20 21 20 2d 66 20 22    if test ! -f "
1bf30 24 7b 54 43 4c 5f 53 52 43 5f 44 49 52 7d 2f 67  ${TCL_SRC_DIR}/g
1bf40 65 6e 65 72 69 63 2f 74 63 6c 49 6e 74 2e 68 22  eneric/tclInt.h"
1bf50 20 3b 20 74 68 65 6e 0a 09 09 41 43 5f 4d 53 47   ; then...AC_MSG
1bf60 5f 45 52 52 4f 52 28 5b 43 61 6e 6e 6f 74 20 66  _ERROR([Cannot f
1bf70 69 6e 64 20 70 72 69 76 61 74 65 20 68 65 61 64  ind private head
1bf80 65 72 20 74 63 6c 49 6e 74 2e 68 20 69 6e 20 24  er tclInt.h in $
1bf90 7b 54 43 4c 5f 53 52 43 5f 44 49 52 7d 5d 29 0a  {TCL_SRC_DIR}]).
1bfa0 09 20 20 20 20 66 69 0a 09 20 20 20 20 72 65 73  .    fi..    res
1bfb0 75 6c 74 3d 22 55 73 69 6e 67 20 73 72 63 64 69  ult="Using srcdi
1bfc0 72 20 66 6f 75 6e 64 20 69 6e 20 74 63 6c 43 6f  r found in tclCo
1bfd0 6e 66 69 67 2e 73 68 3a 20 24 7b 54 43 4c 5f 53  nfig.sh: ${TCL_S
1bfe0 52 43 5f 44 49 52 7d 22 0a 09 66 69 0a 20 20 20  RC_DIR}"..fi.   
1bff0 20 66 69 0a 0a 20 20 20 20 41 43 5f 53 55 42 53   fi..    AC_SUBS
1c000 54 28 54 43 4c 5f 54 4f 50 5f 44 49 52 5f 4e 41  T(TCL_TOP_DIR_NA
1c010 54 49 56 45 29 0a 0a 20 20 20 20 41 43 5f 53 55  TIVE)..    AC_SU
1c020 42 53 54 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53  BST(TCL_INCLUDES
1c030 29 0a 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53  ).    AC_MSG_RES
1c040 55 4c 54 28 5b 24 7b 72 65 73 75 6c 74 7d 5d 29  ULT([${result}])
1c050 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .])..#----------
1c060 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c070 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c080 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c090 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
1c0a0 20 54 45 41 5f 50 55 42 4c 49 43 5f 54 43 4c 5f   TEA_PUBLIC_TCL_
1c0b0 48 45 41 44 45 52 53 20 2d 2d 0a 23 0a 23 09 4c  HEADERS --.#.#.L
1c0c0 6f 63 61 74 65 20 74 68 65 20 69 6e 73 74 61 6c  ocate the instal
1c0d0 6c 65 64 20 70 75 62 6c 69 63 20 54 63 6c 20 68  led public Tcl h
1c0e0 65 61 64 65 72 20 66 69 6c 65 73 0a 23 0a 23 20  eader files.#.# 
1c0f0 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 4e 6f 6e  Arguments:.#.Non
1c100 65 2e 0a 23 0a 23 20 52 65 71 75 69 72 65 73 3a  e..#.# Requires:
1c110 0a 23 09 43 59 47 50 41 54 48 20 6d 75 73 74 20  .#.CYGPATH must 
1c120 62 65 20 73 65 74 0a 23 0a 23 20 52 65 73 75 6c  be set.#.# Resul
1c130 74 73 3a 0a 23 0a 23 09 41 64 64 73 20 61 20 2d  ts:.#.#.Adds a -
1c140 2d 77 69 74 68 2d 74 63 6c 69 6e 63 6c 75 64 65  -with-tclinclude
1c150 20 73 77 69 74 63 68 20 74 6f 20 63 6f 6e 66 69   switch to confi
1c160 67 75 72 65 2e 0a 23 09 52 65 73 75 6c 74 20 69  gure..#.Result i
1c170 73 20 63 61 63 68 65 64 2e 0a 23 0a 23 09 53 75  s cached..#.#.Su
1c180 62 73 74 69 74 75 74 65 73 20 74 68 65 20 66 6f  bstitutes the fo
1c190 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09  llowing vars:.#.
1c1a0 09 54 43 4c 5f 49 4e 43 4c 55 44 45 53 0a 23 2d  .TCL_INCLUDES.#-
1c1b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c1c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c1d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c1e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c1f0 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55  -------..AC_DEFU
1c200 4e 28 5b 54 45 41 5f 50 55 42 4c 49 43 5f 54 43  N([TEA_PUBLIC_TC
1c210 4c 5f 48 45 41 44 45 52 53 5d 2c 20 5b 0a 20 20  L_HEADERS], [.  
1c220 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e    AC_MSG_CHECKIN
1c230 47 28 5b 66 6f 72 20 54 63 6c 20 70 75 62 6c 69  G([for Tcl publi
1c240 63 20 68 65 61 64 65 72 73 5d 29 0a 0a 20 20 20  c headers])..   
1c250 20 41 43 5f 41 52 47 5f 57 49 54 48 28 74 63 6c   AC_ARG_WITH(tcl
1c260 69 6e 63 6c 75 64 65 2c 20 5b 20 20 2d 2d 77 69  include, [  --wi
1c270 74 68 2d 74 63 6c 69 6e 63 6c 75 64 65 20 20 20  th-tclinclude   
1c280 20 20 20 20 64 69 72 65 63 74 6f 72 79 20 63 6f      directory co
1c290 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 70 75 62  ntaining the pub
1c2a0 6c 69 63 20 54 63 6c 20 68 65 61 64 65 72 20 66  lic Tcl header f
1c2b0 69 6c 65 73 5d 2c 20 77 69 74 68 5f 74 63 6c 69  iles], with_tcli
1c2c0 6e 63 6c 75 64 65 3d 24 7b 77 69 74 68 76 61 6c  nclude=${withval
1c2d0 7d 29 0a 0a 20 20 20 20 41 43 5f 43 41 43 48 45  })..    AC_CACHE
1c2e0 5f 56 41 4c 28 61 63 5f 63 76 5f 63 5f 74 63 6c  _VAL(ac_cv_c_tcl
1c2f0 68 2c 20 5b 0a 09 23 20 55 73 65 20 74 68 65 20  h, [..# Use the 
1c300 76 61 6c 75 65 20 66 72 6f 6d 20 2d 2d 77 69 74  value from --wit
1c310 68 2d 74 63 6c 69 6e 63 6c 75 64 65 2c 20 69 66  h-tclinclude, if
1c320 20 69 74 20 77 61 73 20 67 69 76 65 6e 0a 0a 09   it was given...
1c330 69 66 20 74 65 73 74 20 78 22 24 7b 77 69 74 68  if test x"${with
1c340 5f 74 63 6c 69 6e 63 6c 75 64 65 7d 22 20 21 3d  _tclinclude}" !=
1c350 20 78 20 3b 20 74 68 65 6e 0a 09 20 20 20 20 69   x ; then..    i
1c360 66 20 74 65 73 74 20 2d 66 20 22 24 7b 77 69 74  f test -f "${wit
1c370 68 5f 74 63 6c 69 6e 63 6c 75 64 65 7d 2f 74 63  h_tclinclude}/tc
1c380 6c 2e 68 22 20 3b 20 74 68 65 6e 0a 09 09 61 63  l.h" ; then...ac
1c390 5f 63 76 5f 63 5f 74 63 6c 68 3d 24 7b 77 69 74  _cv_c_tclh=${wit
1c3a0 68 5f 74 63 6c 69 6e 63 6c 75 64 65 7d 0a 09 20  h_tclinclude}.. 
1c3b0 20 20 20 65 6c 73 65 0a 09 09 41 43 5f 4d 53 47     else...AC_MSG
1c3c0 5f 45 52 52 4f 52 28 5b 24 7b 77 69 74 68 5f 74  _ERROR([${with_t
1c3d0 63 6c 69 6e 63 6c 75 64 65 7d 20 64 69 72 65 63  clinclude} direc
1c3e0 74 6f 72 79 20 64 6f 65 73 20 6e 6f 74 20 63 6f  tory does not co
1c3f0 6e 74 61 69 6e 20 74 63 6c 2e 68 5d 29 0a 09 20  ntain tcl.h]).. 
1c400 20 20 20 66 69 0a 09 65 6c 73 65 0a 09 20 20 20     fi..else..   
1c410 20 6c 69 73 74 3d 22 22 0a 09 20 20 20 20 69 66   list=""..    if
1c420 20 74 65 73 74 20 22 60 75 6e 61 6d 65 20 2d 73   test "`uname -s
1c430 60 22 20 3d 20 22 44 61 72 77 69 6e 22 3b 20 74  `" = "Darwin"; t
1c440 68 65 6e 0a 09 09 23 20 49 66 20 54 63 6c 20 77  hen...# If Tcl w
1c450 61 73 20 62 75 69 6c 74 20 61 73 20 61 20 66 72  as built as a fr
1c460 61 6d 65 77 6f 72 6b 2c 20 61 74 74 65 6d 70 74  amework, attempt
1c470 20 74 6f 20 75 73 65 0a 09 09 23 20 74 68 65 20   to use...# the 
1c480 66 72 61 6d 65 77 6f 72 6b 27 73 20 48 65 61 64  framework's Head
1c490 65 72 73 20 64 69 72 65 63 74 6f 72 79 0a 09 09  ers directory...
1c4a0 63 61 73 65 20 24 7b 54 43 4c 5f 44 45 46 53 7d  case ${TCL_DEFS}
1c4b0 20 69 6e 0a 09 09 20 20 20 20 2a 54 43 4c 5f 46   in...    *TCL_F
1c4c0 52 41 4d 45 57 4f 52 4b 2a 29 0a 09 09 09 6c 69  RAMEWORK*)....li
1c4d0 73 74 3d 22 60 6c 73 20 2d 64 20 24 7b 54 43 4c  st="`ls -d ${TCL
1c4e0 5f 42 49 4e 5f 44 49 52 7d 2f 48 65 61 64 65 72  _BIN_DIR}/Header
1c4f0 73 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a  s 2>/dev/null`".
1c500 09 09 09 3b 3b 0a 09 09 65 73 61 63 0a 09 20 20  ...;;...esac..  
1c510 20 20 66 69 0a 0a 09 20 20 20 20 23 20 4c 6f 6f    fi...    # Loo
1c520 6b 20 69 6e 20 74 68 65 20 73 6f 75 72 63 65 20  k in the source 
1c530 64 69 72 20 6f 6e 6c 79 20 69 66 20 54 63 6c 20  dir only if Tcl 
1c540 69 73 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64  is not installed
1c550 2c 0a 09 20 20 20 20 23 20 61 6e 64 20 69 6e 20  ,..    # and in 
1c560 74 68 61 74 20 73 69 74 75 61 74 69 6f 6e 2c 20  that situation, 
1c570 6c 6f 6f 6b 20 74 68 65 72 65 20 62 65 66 6f 72  look there befor
1c580 65 20 69 6e 73 74 61 6c 6c 65 64 20 6c 6f 63 61  e installed loca
1c590 74 69 6f 6e 73 2e 0a 09 20 20 20 20 69 66 20 74  tions...    if t
1c5a0 65 73 74 20 2d 66 20 22 24 7b 54 43 4c 5f 42 49  est -f "${TCL_BI
1c5b0 4e 5f 44 49 52 7d 2f 4d 61 6b 65 66 69 6c 65 22  N_DIR}/Makefile"
1c5c0 20 3b 20 74 68 65 6e 0a 09 09 6c 69 73 74 3d 22   ; then...list="
1c5d0 24 6c 69 73 74 20 60 6c 73 20 2d 64 20 24 7b 54  $list `ls -d ${T
1c5e0 43 4c 5f 53 52 43 5f 44 49 52 7d 2f 67 65 6e 65  CL_SRC_DIR}/gene
1c5f0 72 69 63 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  ric 2>/dev/null`
1c600 22 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20  "..    fi...    
1c610 23 20 43 68 65 63 6b 20 6f 72 64 65 72 3a 20 70  # Check order: p
1c620 6b 67 20 2d 2d 70 72 65 66 69 78 20 6c 6f 63 61  kg --prefix loca
1c630 74 69 6f 6e 2c 20 54 63 6c 27 73 20 2d 2d 70 72  tion, Tcl's --pr
1c640 65 66 69 78 20 6c 6f 63 61 74 69 6f 6e 2c 0a 09  efix location,..
1c650 20 20 20 20 23 20 72 65 6c 61 74 69 76 65 20 74      # relative t
1c660 6f 20 64 69 72 65 63 74 6f 72 79 20 6f 66 20 74  o directory of t
1c670 63 6c 43 6f 6e 66 69 67 2e 73 68 2e 0a 0a 09 20  clConfig.sh.... 
1c680 20 20 20 65 76 61 6c 20 22 74 65 6d 70 5f 69 6e     eval "temp_in
1c690 63 6c 75 64 65 64 69 72 3d 24 7b 69 6e 63 6c 75  cludedir=${inclu
1c6a0 64 65 64 69 72 7d 22 0a 09 20 20 20 20 6c 69 73  dedir}"..    lis
1c6b0 74 3d 22 24 6c 69 73 74 20 5c 0a 09 09 60 6c 73  t="$list \...`ls
1c6c0 20 2d 64 20 24 7b 74 65 6d 70 5f 69 6e 63 6c 75   -d ${temp_inclu
1c6d0 64 65 64 69 72 7d 20 20 20 20 20 20 20 20 32 3e  dedir}        2>
1c6e0 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 60  /dev/null` \...`
1c6f0 6c 73 20 2d 64 20 24 7b 54 43 4c 5f 50 52 45 46  ls -d ${TCL_PREF
1c700 49 58 7d 2f 69 6e 63 6c 75 64 65 20 20 20 20 20  IX}/include     
1c710 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09  2>/dev/null` \..
1c720 09 60 6c 73 20 2d 64 20 24 7b 54 43 4c 5f 42 49  .`ls -d ${TCL_BI
1c730 4e 5f 44 49 52 7d 2f 2e 2e 2f 69 6e 63 6c 75 64  N_DIR}/../includ
1c740 65 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a  e 2>/dev/null`".
1c750 09 20 20 20 20 69 66 20 74 65 73 74 20 22 24 7b  .    if test "${
1c760 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 21  TEA_PLATFORM}" !
1c770 3d 20 22 77 69 6e 64 6f 77 73 22 20 2d 6f 20 22  = "windows" -o "
1c780 24 47 43 43 22 20 3d 20 22 79 65 73 22 3b 20 74  $GCC" = "yes"; t
1c790 68 65 6e 0a 09 09 6c 69 73 74 3d 22 24 6c 69 73  hen...list="$lis
1c7a0 74 20 2f 75 73 72 2f 6c 6f 63 61 6c 2f 69 6e 63  t /usr/local/inc
1c7b0 6c 75 64 65 20 2f 75 73 72 2f 69 6e 63 6c 75 64  lude /usr/includ
1c7c0 65 22 0a 09 09 69 66 20 74 65 73 74 20 78 22 24  e"...if test x"$
1c7d0 7b 54 43 4c 5f 49 4e 43 4c 55 44 45 5f 53 50 45  {TCL_INCLUDE_SPE
1c7e0 43 7d 22 20 21 3d 20 78 20 3b 20 74 68 65 6e 0a  C}" != x ; then.
1c7f0 09 09 20 20 20 20 64 3d 60 65 63 68 6f 20 22 24  ..    d=`echo "$
1c800 7b 54 43 4c 5f 49 4e 43 4c 55 44 45 5f 53 50 45  {TCL_INCLUDE_SPE
1c810 43 7d 22 20 7c 20 73 65 64 20 2d 65 20 27 73 2f  C}" | sed -e 's/
1c820 5e 2d 49 2f 2f 27 60 0a 09 09 20 20 20 20 6c 69  ^-I//'`...    li
1c830 73 74 3d 22 24 6c 69 73 74 20 60 6c 73 20 2d 64  st="$list `ls -d
1c840 20 24 7b 64 7d 20 32 3e 2f 64 65 76 2f 6e 75 6c   ${d} 2>/dev/nul
1c850 6c 60 22 0a 09 09 66 69 0a 09 20 20 20 20 66 69  l`"...fi..    fi
1c860 0a 09 20 20 20 20 66 6f 72 20 69 20 69 6e 20 24  ..    for i in $
1c870 6c 69 73 74 20 3b 20 64 6f 0a 09 09 69 66 20 74  list ; do...if t
1c880 65 73 74 20 2d 66 20 22 24 69 2f 74 63 6c 2e 68  est -f "$i/tcl.h
1c890 22 20 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 61  " ; then...    a
1c8a0 63 5f 63 76 5f 63 5f 74 63 6c 68 3d 24 69 0a 09  c_cv_c_tclh=$i..
1c8b0 09 20 20 20 20 62 72 65 61 6b 0a 09 09 66 69 0a  .    break...fi.
1c8c0 09 20 20 20 20 64 6f 6e 65 0a 09 66 69 0a 20 20  .    done..fi.  
1c8d0 20 20 5d 29 0a 0a 20 20 20 20 23 20 50 72 69 6e    ])..    # Prin
1c8e0 74 20 61 20 6d 65 73 73 61 67 65 20 62 61 73 65  t a message base
1c8f0 64 20 6f 6e 20 68 6f 77 20 77 65 20 64 65 74 65  d on how we dete
1c900 72 6d 69 6e 65 64 20 74 68 65 20 69 6e 63 6c 75  rmined the inclu
1c910 64 65 20 70 61 74 68 0a 0a 20 20 20 20 69 66 20  de path..    if 
1c920 74 65 73 74 20 78 22 24 7b 61 63 5f 63 76 5f 63  test x"${ac_cv_c
1c930 5f 74 63 6c 68 7d 22 20 3d 20 78 20 3b 20 74 68  _tclh}" = x ; th
1c940 65 6e 0a 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52  en..AC_MSG_ERROR
1c950 28 5b 74 63 6c 2e 68 20 6e 6f 74 20 66 6f 75 6e  ([tcl.h not foun
1c960 64 2e 20 20 50 6c 65 61 73 65 20 73 70 65 63 69  d.  Please speci
1c970 66 79 20 69 74 73 20 6c 6f 63 61 74 69 6f 6e 20  fy its location 
1c980 77 69 74 68 20 2d 2d 77 69 74 68 2d 74 63 6c 69  with --with-tcli
1c990 6e 63 6c 75 64 65 5d 29 0a 20 20 20 20 65 6c 73  nclude]).    els
1c9a0 65 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  e..AC_MSG_RESULT
1c9b0 28 5b 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 68  ([${ac_cv_c_tclh
1c9c0 7d 5d 29 0a 20 20 20 20 66 69 0a 0a 20 20 20 20  }]).    fi..    
1c9d0 23 20 43 6f 6e 76 65 72 74 20 74 6f 20 61 20 6e  # Convert to a n
1c9e0 61 74 69 76 65 20 70 61 74 68 20 61 6e 64 20 73  ative path and s
1c9f0 75 62 73 74 69 74 75 74 65 20 69 6e 74 6f 20 74  ubstitute into t
1ca00 68 65 20 6f 75 74 70 75 74 20 66 69 6c 65 73 2e  he output files.
1ca10 0a 0a 20 20 20 20 49 4e 43 4c 55 44 45 5f 44 49  ..    INCLUDE_DI
1ca20 52 5f 4e 41 54 49 56 45 3d 60 24 7b 43 59 47 50  R_NATIVE=`${CYGP
1ca30 41 54 48 7d 20 24 7b 61 63 5f 63 76 5f 63 5f 74  ATH} ${ac_cv_c_t
1ca40 63 6c 68 7d 60 0a 0a 20 20 20 20 54 43 4c 5f 49  clh}`..    TCL_I
1ca50 4e 43 4c 55 44 45 53 3d 2d 49 5c 22 24 7b 49 4e  NCLUDES=-I\"${IN
1ca60 43 4c 55 44 45 5f 44 49 52 5f 4e 41 54 49 56 45  CLUDE_DIR_NATIVE
1ca70 7d 5c 22 0a 0a 20 20 20 20 41 43 5f 53 55 42 53  }\"..    AC_SUBS
1ca80 54 28 54 43 4c 5f 49 4e 43 4c 55 44 45 53 29 0a  T(TCL_INCLUDES).
1ca90 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ])..#-----------
1caa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cab0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cac0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cad0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
1cae0 54 45 41 5f 50 52 49 56 41 54 45 5f 54 4b 5f 48  TEA_PRIVATE_TK_H
1caf0 45 41 44 45 52 53 20 2d 2d 0a 23 0a 23 09 4c 6f  EADERS --.#.#.Lo
1cb00 63 61 74 65 20 74 68 65 20 70 72 69 76 61 74 65  cate the private
1cb10 20 54 6b 20 69 6e 63 6c 75 64 65 20 66 69 6c 65   Tk include file
1cb20 73 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a  s.#.# Arguments:
1cb30 0a 23 0a 23 09 52 65 71 75 69 72 65 73 3a 0a 23  .#.#.Requires:.#
1cb40 09 09 54 4b 5f 53 52 43 5f 44 49 52 09 41 73 73  ..TK_SRC_DIR.Ass
1cb50 75 6d 65 73 20 74 68 61 74 20 54 45 41 5f 4c 4f  umes that TEA_LO
1cb60 41 44 5f 54 4b 43 4f 4e 46 49 47 20 68 61 73 0a  AD_TKCONFIG has.
1cb70 23 09 09 09 09 20 61 6c 72 65 61 64 79 20 62 65  #.... already be
1cb80 65 6e 20 63 61 6c 6c 65 64 2e 0a 23 0a 23 20 52  en called..#.# R
1cb90 65 73 75 6c 74 73 3a 0a 23 0a 23 09 53 75 62 73  esults:.#.#.Subs
1cba0 74 69 74 75 74 65 73 20 74 68 65 20 66 6f 6c 6c  titutes the foll
1cbb0 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 54  owing vars:.#..T
1cbc0 4b 5f 49 4e 43 4c 55 44 45 53 0a 23 2d 2d 2d 2d  K_INCLUDES.#----
1cbd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cbe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cbf0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cc00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cc10 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b  ----..AC_DEFUN([
1cc20 54 45 41 5f 50 52 49 56 41 54 45 5f 54 4b 5f 48  TEA_PRIVATE_TK_H
1cc30 45 41 44 45 52 53 5d 2c 20 5b 0a 20 20 20 20 23  EADERS], [.    #
1cc40 20 41 6c 6c 6f 77 20 66 6f 72 20 2d 2d 77 69 74   Allow for --wit
1cc50 68 2d 74 6b 69 6e 63 6c 75 64 65 20 74 6f 20 74  h-tkinclude to t
1cc60 61 6b 65 20 65 66 66 65 63 74 20 61 6e 64 20 64  ake effect and d
1cc70 65 66 69 6e 65 20 24 7b 61 63 5f 63 76 5f 63 5f  efine ${ac_cv_c_
1cc80 74 6b 68 7d 0a 20 20 20 20 41 43 5f 52 45 51 55  tkh}.    AC_REQU
1cc90 49 52 45 28 5b 54 45 41 5f 50 55 42 4c 49 43 5f  IRE([TEA_PUBLIC_
1cca0 54 4b 5f 48 45 41 44 45 52 53 5d 29 0a 20 20 20  TK_HEADERS]).   
1ccb0 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47   AC_MSG_CHECKING
1ccc0 28 5b 66 6f 72 20 54 6b 20 70 72 69 76 61 74 65  ([for Tk private
1ccd0 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 73 5d 29   include files])
1cce0 0a 0a 20 20 20 20 54 4b 5f 53 52 43 5f 44 49 52  ..    TK_SRC_DIR
1ccf0 5f 4e 41 54 49 56 45 3d 60 24 7b 43 59 47 50 41  _NATIVE=`${CYGPA
1cd00 54 48 7d 20 24 7b 54 4b 5f 53 52 43 5f 44 49 52  TH} ${TK_SRC_DIR
1cd10 7d 60 0a 20 20 20 20 54 4b 5f 54 4f 50 5f 44 49  }`.    TK_TOP_DI
1cd20 52 5f 4e 41 54 49 56 45 3d 5c 22 24 7b 54 4b 5f  R_NATIVE=\"${TK_
1cd30 53 52 43 5f 44 49 52 5f 4e 41 54 49 56 45 7d 5c  SRC_DIR_NATIVE}\
1cd40 22 0a 0a 20 20 20 20 23 20 43 68 65 63 6b 20 74  "..    # Check t
1cd50 6f 20 73 65 65 20 69 66 20 74 6b 3c 50 6c 61 74  o see if tk<Plat
1cd60 3e 50 6f 72 74 2e 68 20 69 73 6e 27 74 20 61 6c  >Port.h isn't al
1cd70 72 65 61 64 79 20 77 69 74 68 20 74 68 65 20 70  ready with the p
1cd80 75 62 6c 69 63 20 68 65 61 64 65 72 73 0a 20 20  ublic headers.  
1cd90 20 20 23 20 44 6f 6e 27 74 20 6c 6f 6f 6b 20 66    # Don't look f
1cda0 6f 72 20 74 6b 49 6e 74 2e 68 20 62 65 63 61 75  or tkInt.h becau
1cdb0 73 65 20 74 68 61 74 20 72 65 73 69 64 65 73 20  se that resides 
1cdc0 77 69 74 68 20 74 6b 2e 68 20 69 6e 20 74 68 65  with tk.h in the
1cdd0 20 63 6f 72 65 0a 20 20 20 20 23 20 73 6f 75 72   core.    # sour
1cde0 63 65 73 2c 20 62 75 74 20 74 68 65 20 3c 70 6c  ces, but the <pl
1cdf0 61 74 3e 50 6f 72 74 20 68 65 61 64 65 72 73 20  at>Port headers 
1ce00 61 72 65 20 69 6e 20 61 20 64 69 66 66 65 72 65  are in a differe
1ce10 6e 74 20 64 69 72 65 63 74 6f 72 79 0a 20 20 20  nt directory.   
1ce20 20 69 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f   if test "${TEA_
1ce30 50 4c 41 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69  PLATFORM}" = "wi
1ce40 6e 64 6f 77 73 22 20 2d 61 20 5c 0a 09 2d 66 20  ndows" -a \..-f 
1ce50 22 24 7b 61 63 5f 63 76 5f 63 5f 74 6b 68 7d 2f  "${ac_cv_c_tkh}/
1ce60 74 6b 57 69 6e 50 6f 72 74 2e 68 22 3b 20 74 68  tkWinPort.h"; th
1ce70 65 6e 0a 09 72 65 73 75 6c 74 3d 22 70 72 69 76  en..result="priv
1ce80 61 74 65 20 68 65 61 64 65 72 73 20 66 6f 75 6e  ate headers foun
1ce90 64 20 77 69 74 68 20 70 75 62 6c 69 63 20 68 65  d with public he
1cea0 61 64 65 72 73 22 0a 20 20 20 20 65 6c 69 66 20  aders".    elif 
1ceb0 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54  test "${TEA_PLAT
1cec0 46 4f 52 4d 7d 22 20 3d 20 22 75 6e 69 78 22 20  FORM}" = "unix" 
1ced0 2d 61 20 5c 0a 09 2d 66 20 22 24 7b 61 63 5f 63  -a \..-f "${ac_c
1cee0 76 5f 63 5f 74 6b 68 7d 2f 74 6b 55 6e 69 78 50  v_c_tkh}/tkUnixP
1cef0 6f 72 74 2e 68 22 3b 20 74 68 65 6e 0a 09 72 65  ort.h"; then..re
1cf00 73 75 6c 74 3d 22 70 72 69 76 61 74 65 20 68 65  sult="private he
1cf10 61 64 65 72 73 20 66 6f 75 6e 64 20 77 69 74 68  aders found with
1cf20 20 70 75 62 6c 69 63 20 68 65 61 64 65 72 73 22   public headers"
1cf30 0a 20 20 20 20 65 6c 73 65 0a 09 54 4b 5f 47 45  .    else..TK_GE
1cf40 4e 45 52 49 43 5f 44 49 52 5f 4e 41 54 49 56 45  NERIC_DIR_NATIVE
1cf50 3d 5c 22 24 7b 54 4b 5f 53 52 43 5f 44 49 52 5f  =\"${TK_SRC_DIR_
1cf60 4e 41 54 49 56 45 7d 2f 67 65 6e 65 72 69 63 5c  NATIVE}/generic\
1cf70 22 0a 09 54 4b 5f 58 4c 49 42 5f 44 49 52 5f 4e  "..TK_XLIB_DIR_N
1cf80 41 54 49 56 45 3d 5c 22 24 7b 54 4b 5f 53 52 43  ATIVE=\"${TK_SRC
1cf90 5f 44 49 52 5f 4e 41 54 49 56 45 7d 2f 78 6c 69  _DIR_NATIVE}/xli
1cfa0 62 5c 22 0a 09 69 66 20 74 65 73 74 20 22 24 7b  b\"..if test "${
1cfb0 54 45 41 5f 50 4c 41 54 46 4f 52 4d 7d 22 20 3d  TEA_PLATFORM}" =
1cfc0 20 22 77 69 6e 64 6f 77 73 22 3b 20 74 68 65 6e   "windows"; then
1cfd0 0a 09 20 20 20 20 54 4b 5f 50 4c 41 54 46 4f 52  ..    TK_PLATFOR
1cfe0 4d 5f 44 49 52 5f 4e 41 54 49 56 45 3d 5c 22 24  M_DIR_NATIVE=\"$
1cff0 7b 54 4b 5f 53 52 43 5f 44 49 52 5f 4e 41 54 49  {TK_SRC_DIR_NATI
1d000 56 45 7d 2f 77 69 6e 5c 22 0a 09 65 6c 73 65 0a  VE}/win\"..else.
1d010 09 20 20 20 20 54 4b 5f 50 4c 41 54 46 4f 52 4d  .    TK_PLATFORM
1d020 5f 44 49 52 5f 4e 41 54 49 56 45 3d 5c 22 24 7b  _DIR_NATIVE=\"${
1d030 54 4b 5f 53 52 43 5f 44 49 52 5f 4e 41 54 49 56  TK_SRC_DIR_NATIV
1d040 45 7d 2f 75 6e 69 78 5c 22 0a 09 66 69 0a 09 23  E}/unix\"..fi..#
1d050 20 4f 76 65 72 77 72 69 74 65 20 74 68 65 20 70   Overwrite the p
1d060 72 65 76 69 6f 75 73 20 54 4b 5f 49 4e 43 4c 55  revious TK_INCLU
1d070 44 45 53 20 61 73 20 74 68 69 73 20 73 68 6f 75  DES as this shou
1d080 6c 64 20 63 61 70 74 75 72 65 20 62 6f 74 68 0a  ld capture both.
1d090 09 23 20 70 75 62 6c 69 63 20 61 6e 64 20 70 72  .# public and pr
1d0a0 69 76 61 74 65 20 68 65 61 64 65 72 73 20 69 6e  ivate headers in
1d0b0 20 74 68 65 20 73 61 6d 65 20 73 65 74 2e 0a 09   the same set...
1d0c0 23 20 57 65 20 77 61 6e 74 20 74 6f 20 65 6e 73  # We want to ens
1d0d0 75 72 65 20 74 68 65 73 65 20 61 72 65 20 73 75  ure these are su
1d0e0 62 73 74 69 74 75 74 65 64 20 73 6f 20 61 73 20  bstituted so as 
1d0f0 6e 6f 74 20 74 6f 20 72 65 71 75 69 72 65 0a 09  not to require..
1d100 23 20 61 6e 79 20 2a 5f 4e 41 54 49 56 45 20 76  # any *_NATIVE v
1d110 61 72 73 20 62 65 20 64 65 66 69 6e 65 64 20 69  ars be defined i
1d120 6e 20 74 68 65 20 4d 61 6b 65 66 69 6c 65 0a 09  n the Makefile..
1d130 54 4b 5f 49 4e 43 4c 55 44 45 53 3d 22 2d 49 24  TK_INCLUDES="-I$
1d140 7b 54 4b 5f 47 45 4e 45 52 49 43 5f 44 49 52 5f  {TK_GENERIC_DIR_
1d150 4e 41 54 49 56 45 7d 20 2d 49 24 7b 54 4b 5f 50  NATIVE} -I${TK_P
1d160 4c 41 54 46 4f 52 4d 5f 44 49 52 5f 4e 41 54 49  LATFORM_DIR_NATI
1d170 56 45 7d 22 0a 09 23 20 44 65 74 65 63 74 20 61  VE}"..# Detect a
1d180 6e 64 20 61 64 64 20 74 74 6b 20 73 75 62 64 69  nd add ttk subdi
1d190 72 0a 09 69 66 20 74 65 73 74 20 2d 64 20 22 24  r..if test -d "$
1d1a0 7b 54 4b 5f 53 52 43 5f 44 49 52 7d 2f 67 65 6e  {TK_SRC_DIR}/gen
1d1b0 65 72 69 63 2f 74 74 6b 22 3b 20 74 68 65 6e 0a  eric/ttk"; then.
1d1c0 09 20 20 20 54 4b 5f 49 4e 43 4c 55 44 45 53 3d  .   TK_INCLUDES=
1d1d0 22 24 7b 54 4b 5f 49 4e 43 4c 55 44 45 53 7d 20  "${TK_INCLUDES} 
1d1e0 2d 49 5c 22 24 7b 54 4b 5f 53 52 43 5f 44 49 52  -I\"${TK_SRC_DIR
1d1f0 5f 4e 41 54 49 56 45 7d 2f 67 65 6e 65 72 69 63  _NATIVE}/generic
1d200 2f 74 74 6b 5c 22 22 0a 09 66 69 0a 09 69 66 20  /ttk\""..fi..if 
1d210 74 65 73 74 20 22 24 7b 54 45 41 5f 57 49 4e 44  test "${TEA_WIND
1d220 4f 57 49 4e 47 53 59 53 54 45 4d 7d 22 20 21 3d  OWINGSYSTEM}" !=
1d230 20 22 78 31 31 22 3b 20 74 68 65 6e 0a 09 20 20   "x11"; then..  
1d240 20 54 4b 5f 49 4e 43 4c 55 44 45 53 3d 22 24 7b   TK_INCLUDES="${
1d250 54 4b 5f 49 4e 43 4c 55 44 45 53 7d 20 2d 49 5c  TK_INCLUDES} -I\
1d260 22 24 7b 54 4b 5f 58 4c 49 42 5f 44 49 52 5f 4e  "${TK_XLIB_DIR_N
1d270 41 54 49 56 45 7d 5c 22 22 0a 09 66 69 0a 09 69  ATIVE}\""..fi..i
1d280 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f 57 49  f test "${TEA_WI
1d290 4e 44 4f 57 49 4e 47 53 59 53 54 45 4d 7d 22 20  NDOWINGSYSTEM}" 
1d2a0 3d 20 22 61 71 75 61 22 3b 20 74 68 65 6e 0a 09  = "aqua"; then..
1d2b0 20 20 20 54 4b 5f 49 4e 43 4c 55 44 45 53 3d 22     TK_INCLUDES="
1d2c0 24 7b 54 4b 5f 49 4e 43 4c 55 44 45 53 7d 20 2d  ${TK_INCLUDES} -
1d2d0 49 5c 22 24 7b 54 4b 5f 53 52 43 5f 44 49 52 5f  I\"${TK_SRC_DIR_
1d2e0 4e 41 54 49 56 45 7d 2f 6d 61 63 6f 73 78 5c 22  NATIVE}/macosx\"
1d2f0 22 0a 09 66 69 0a 09 69 66 20 74 65 73 74 20 22  "..fi..if test "
1d300 60 75 6e 61 6d 65 20 2d 73 60 22 20 3d 20 22 44  `uname -s`" = "D
1d310 61 72 77 69 6e 22 3b 20 74 68 65 6e 0a 09 20 20  arwin"; then..  
1d320 20 20 23 20 49 66 20 54 6b 20 77 61 73 20 62 75    # If Tk was bu
1d330 69 6c 74 20 61 73 20 61 20 66 72 61 6d 65 77 6f  ilt as a framewo
1d340 72 6b 2c 20 61 74 74 65 6d 70 74 20 74 6f 20 75  rk, attempt to u
1d350 73 65 0a 09 20 20 20 20 23 20 74 68 65 20 66 72  se..    # the fr
1d360 61 6d 65 77 6f 72 6b 27 73 20 48 65 61 64 65 72  amework's Header
1d370 73 20 61 6e 64 20 50 72 69 76 61 74 65 48 65 61  s and PrivateHea
1d380 64 65 72 73 20 64 69 72 65 63 74 6f 72 69 65 73  ders directories
1d390 0a 09 20 20 20 20 63 61 73 65 20 24 7b 54 4b 5f  ..    case ${TK_
1d3a0 44 45 46 53 7d 20 69 6e 0a 09 09 2a 54 4b 5f 46  DEFS} in...*TK_F
1d3b0 52 41 4d 45 57 4f 52 4b 2a 29 0a 09 09 09 69 66  RAMEWORK*)....if
1d3c0 20 74 65 73 74 20 2d 64 20 22 24 7b 54 4b 5f 42   test -d "${TK_B
1d3d0 49 4e 5f 44 49 52 7d 2f 48 65 61 64 65 72 73 22  IN_DIR}/Headers"
1d3e0 20 2d 61 20 5c 0a 09 09 09 09 2d 64 20 22 24 7b   -a \.....-d "${
1d3f0 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 50 72 69 76  TK_BIN_DIR}/Priv
1d400 61 74 65 48 65 61 64 65 72 73 22 3b 20 74 68 65  ateHeaders"; the
1d410 6e 0a 09 09 09 20 20 20 20 54 4b 5f 49 4e 43 4c  n....    TK_INCL
1d420 55 44 45 53 3d 22 2d 49 5c 22 24 7b 54 4b 5f 42  UDES="-I\"${TK_B
1d430 49 4e 5f 44 49 52 7d 2f 48 65 61 64 65 72 73 5c  IN_DIR}/Headers\
1d440 22 20 2d 49 5c 22 24 7b 54 4b 5f 42 49 4e 5f 44  " -I\"${TK_BIN_D
1d450 49 52 7d 2f 50 72 69 76 61 74 65 48 65 61 64 65  IR}/PrivateHeade
1d460 72 73 5c 22 20 24 7b 54 4b 5f 49 4e 43 4c 55 44  rs\" ${TK_INCLUD
1d470 45 53 7d 22 0a 09 09 09 65 6c 73 65 0a 09 09 09  ES}"....else....
1d480 20 20 20 20 54 4b 5f 49 4e 43 4c 55 44 45 53 3d      TK_INCLUDES=
1d490 22 24 7b 54 4b 5f 49 4e 43 4c 55 44 45 53 7d 20  "${TK_INCLUDES} 
1d4a0 24 7b 54 4b 5f 49 4e 43 4c 55 44 45 5f 53 50 45  ${TK_INCLUDE_SPE
1d4b0 43 7d 20 60 65 63 68 6f 20 22 24 7b 54 4b 5f 49  C} `echo "${TK_I
1d4c0 4e 43 4c 55 44 45 5f 53 50 45 43 7d 22 20 7c 20  NCLUDE_SPEC}" | 
1d4d0 73 65 64 20 2d 65 20 27 73 2f 48 65 61 64 65 72  sed -e 's/Header
1d4e0 73 2f 50 72 69 76 61 74 65 48 65 61 64 65 72 73  s/PrivateHeaders
1d4f0 2f 27 60 22 0a 09 09 09 66 69 0a 09 09 09 3b 3b  /'`"....fi....;;
1d500 0a 09 20 20 20 20 65 73 61 63 0a 09 20 20 20 20  ..    esac..    
1d510 72 65 73 75 6c 74 3d 22 55 73 69 6e 67 20 24 7b  result="Using ${
1d520 54 4b 5f 49 4e 43 4c 55 44 45 53 7d 22 0a 09 65  TK_INCLUDES}"..e
1d530 6c 73 65 0a 09 20 20 20 20 69 66 20 74 65 73 74  lse..    if test
1d540 20 21 20 2d 66 20 22 24 7b 54 4b 5f 53 52 43 5f   ! -f "${TK_SRC_
1d550 44 49 52 7d 2f 67 65 6e 65 72 69 63 2f 74 6b 49  DIR}/generic/tkI
1d560 6e 74 2e 68 22 20 3b 20 74 68 65 6e 0a 09 20 20  nt.h" ; then..  
1d570 20 20 20 20 20 41 43 5f 4d 53 47 5f 45 52 52 4f       AC_MSG_ERRO
1d580 52 28 5b 43 61 6e 6e 6f 74 20 66 69 6e 64 20 70  R([Cannot find p
1d590 72 69 76 61 74 65 20 68 65 61 64 65 72 20 74 6b  rivate header tk
1d5a0 49 6e 74 2e 68 20 69 6e 20 24 7b 54 4b 5f 53 52  Int.h in ${TK_SR
1d5b0 43 5f 44 49 52 7d 5d 29 0a 09 20 20 20 20 66 69  C_DIR}])..    fi
1d5c0 0a 09 20 20 20 20 72 65 73 75 6c 74 3d 22 55 73  ..    result="Us
1d5d0 69 6e 67 20 73 72 63 64 69 72 20 66 6f 75 6e 64  ing srcdir found
1d5e0 20 69 6e 20 74 6b 43 6f 6e 66 69 67 2e 73 68 3a   in tkConfig.sh:
1d5f0 20 24 7b 54 4b 5f 53 52 43 5f 44 49 52 7d 22 0a   ${TK_SRC_DIR}".
1d600 09 66 69 0a 20 20 20 20 66 69 0a 0a 20 20 20 20  .fi.    fi..    
1d610 41 43 5f 53 55 42 53 54 28 54 4b 5f 54 4f 50 5f  AC_SUBST(TK_TOP_
1d620 44 49 52 5f 4e 41 54 49 56 45 29 0a 20 20 20 20  DIR_NATIVE).    
1d630 41 43 5f 53 55 42 53 54 28 54 4b 5f 58 4c 49 42  AC_SUBST(TK_XLIB
1d640 5f 44 49 52 5f 4e 41 54 49 56 45 29 0a 0a 20 20  _DIR_NATIVE)..  
1d650 20 20 41 43 5f 53 55 42 53 54 28 54 4b 5f 49 4e    AC_SUBST(TK_IN
1d660 43 4c 55 44 45 53 29 0a 20 20 20 20 41 43 5f 4d  CLUDES).    AC_M
1d670 53 47 5f 52 45 53 55 4c 54 28 5b 24 7b 72 65 73  SG_RESULT([${res
1d680 75 6c 74 7d 5d 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d  ult}]).])..#----
1d690 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d6a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d6b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d6c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d6d0 2d 2d 2d 2d 0a 23 20 54 45 41 5f 50 55 42 4c 49  ----.# TEA_PUBLI
1d6e0 43 5f 54 4b 5f 48 45 41 44 45 52 53 20 2d 2d 0a  C_TK_HEADERS --.
1d6f0 23 0a 23 09 4c 6f 63 61 74 65 20 74 68 65 20 69  #.#.Locate the i
1d700 6e 73 74 61 6c 6c 65 64 20 70 75 62 6c 69 63 20  nstalled public 
1d710 54 6b 20 68 65 61 64 65 72 20 66 69 6c 65 73 0a  Tk header files.
1d720 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23  #.# Arguments:.#
1d730 09 4e 6f 6e 65 2e 0a 23 0a 23 20 52 65 71 75 69  .None..#.# Requi
1d740 72 65 73 3a 0a 23 09 43 59 47 50 41 54 48 20 6d  res:.#.CYGPATH m
1d750 75 73 74 20 62 65 20 73 65 74 0a 23 0a 23 20 52  ust be set.#.# R
1d760 65 73 75 6c 74 73 3a 0a 23 0a 23 09 41 64 64 73  esults:.#.#.Adds
1d770 20 61 20 2d 2d 77 69 74 68 2d 74 6b 69 6e 63 6c   a --with-tkincl
1d780 75 64 65 20 73 77 69 74 63 68 20 74 6f 20 63 6f  ude switch to co
1d790 6e 66 69 67 75 72 65 2e 0a 23 09 52 65 73 75 6c  nfigure..#.Resul
1d7a0 74 20 69 73 20 63 61 63 68 65 64 2e 0a 23 0a 23  t is cached..#.#
1d7b0 09 53 75 62 73 74 69 74 75 74 65 73 20 74 68 65  .Substitutes the
1d7c0 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a   following vars:
1d7d0 0a 23 09 09 54 4b 5f 49 4e 43 4c 55 44 45 53 0a  .#..TK_INCLUDES.
1d7e0 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
1d7f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d800 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d810 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d820 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
1d830 46 55 4e 28 5b 54 45 41 5f 50 55 42 4c 49 43 5f  FUN([TEA_PUBLIC_
1d840 54 4b 5f 48 45 41 44 45 52 53 5d 2c 20 5b 0a 20  TK_HEADERS], [. 
1d850 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49     AC_MSG_CHECKI
1d860 4e 47 28 5b 66 6f 72 20 54 6b 20 70 75 62 6c 69  NG([for Tk publi
1d870 63 20 68 65 61 64 65 72 73 5d 29 0a 0a 20 20 20  c headers])..   
1d880 20 41 43 5f 41 52 47 5f 57 49 54 48 28 74 6b 69   AC_ARG_WITH(tki
1d890 6e 63 6c 75 64 65 2c 20 5b 20 20 2d 2d 77 69 74  nclude, [  --wit
1d8a0 68 2d 74 6b 69 6e 63 6c 75 64 65 20 20 20 20 20  h-tkinclude     
1d8b0 20 20 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e     directory con
1d8c0 74 61 69 6e 69 6e 67 20 74 68 65 20 70 75 62 6c  taining the publ
1d8d0 69 63 20 54 6b 20 68 65 61 64 65 72 20 66 69 6c  ic Tk header fil
1d8e0 65 73 5d 2c 20 77 69 74 68 5f 74 6b 69 6e 63 6c  es], with_tkincl
1d8f0 75 64 65 3d 24 7b 77 69 74 68 76 61 6c 7d 29 0a  ude=${withval}).
1d900 0a 20 20 20 20 41 43 5f 43 41 43 48 45 5f 56 41  .    AC_CACHE_VA
1d910 4c 28 61 63 5f 63 76 5f 63 5f 74 6b 68 2c 20 5b  L(ac_cv_c_tkh, [
1d920 0a 09 23 20 55 73 65 20 74 68 65 20 76 61 6c 75  ..# Use the valu
1d930 65 20 66 72 6f 6d 20 2d 2d 77 69 74 68 2d 74 6b  e from --with-tk
1d940 69 6e 63 6c 75 64 65 2c 20 69 66 20 69 74 20 77  include, if it w
1d950 61 73 20 67 69 76 65 6e 0a 0a 09 69 66 20 74 65  as given...if te
1d960 73 74 20 78 22 24 7b 77 69 74 68 5f 74 6b 69 6e  st x"${with_tkin
1d970 63 6c 75 64 65 7d 22 20 21 3d 20 78 20 3b 20 74  clude}" != x ; t
1d980 68 65 6e 0a 09 20 20 20 20 69 66 20 74 65 73 74  hen..    if test
1d990 20 2d 66 20 22 24 7b 77 69 74 68 5f 74 6b 69 6e   -f "${with_tkin
1d9a0 63 6c 75 64 65 7d 2f 74 6b 2e 68 22 20 3b 20 74  clude}/tk.h" ; t
1d9b0 68 65 6e 0a 09 09 61 63 5f 63 76 5f 63 5f 74 6b  hen...ac_cv_c_tk
1d9c0 68 3d 24 7b 77 69 74 68 5f 74 6b 69 6e 63 6c 75  h=${with_tkinclu
1d9d0 64 65 7d 0a 09 20 20 20 20 65 6c 73 65 0a 09 09  de}..    else...
1d9e0 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 24 7b  AC_MSG_ERROR([${
1d9f0 77 69 74 68 5f 74 6b 69 6e 63 6c 75 64 65 7d 20  with_tkinclude} 
1da00 64 69 72 65 63 74 6f 72 79 20 64 6f 65 73 20 6e  directory does n
1da10 6f 74 20 63 6f 6e 74 61 69 6e 20 74 6b 2e 68 5d  ot contain tk.h]
1da20 29 0a 09 20 20 20 20 66 69 0a 09 65 6c 73 65 0a  )..    fi..else.
1da30 09 20 20 20 20 6c 69 73 74 3d 22 22 0a 09 20 20  .    list=""..  
1da40 20 20 69 66 20 74 65 73 74 20 22 60 75 6e 61 6d    if test "`unam
1da50 65 20 2d 73 60 22 20 3d 20 22 44 61 72 77 69 6e  e -s`" = "Darwin
1da60 22 3b 20 74 68 65 6e 0a 09 09 23 20 49 66 20 54  "; then...# If T
1da70 6b 20 77 61 73 20 62 75 69 6c 74 20 61 73 20 61  k was built as a
1da80 20 66 72 61 6d 65 77 6f 72 6b 2c 20 61 74 74 65   framework, atte
1da90 6d 70 74 20 74 6f 20 75 73 65 0a 09 09 23 20 74  mpt to use...# t
1daa0 68 65 20 66 72 61 6d 65 77 6f 72 6b 27 73 20 48  he framework's H
1dab0 65 61 64 65 72 73 20 64 69 72 65 63 74 6f 72 79  eaders directory
1dac0 2e 0a 09 09 63 61 73 65 20 24 7b 54 4b 5f 44 45  ....case ${TK_DE
1dad0 46 53 7d 20 69 6e 0a 09 09 20 20 20 20 2a 54 4b  FS} in...    *TK
1dae0 5f 46 52 41 4d 45 57 4f 52 4b 2a 29 0a 09 09 09  _FRAMEWORK*)....
1daf0 6c 69 73 74 3d 22 60 6c 73 20 2d 64 20 24 7b 54  list="`ls -d ${T
1db00 4b 5f 42 49 4e 5f 44 49 52 7d 2f 48 65 61 64 65  K_BIN_DIR}/Heade
1db10 72 73 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22  rs 2>/dev/null`"
1db20 0a 09 09 09 3b 3b 0a 09 09 65 73 61 63 0a 09 20  ....;;...esac.. 
1db30 20 20 20 66 69 0a 0a 09 20 20 20 20 23 20 4c 6f     fi...    # Lo
1db40 6f 6b 20 69 6e 20 74 68 65 20 73 6f 75 72 63 65  ok in the source
1db50 20 64 69 72 20 6f 6e 6c 79 20 69 66 20 54 6b 20   dir only if Tk 
1db60 69 73 20 6e 6f 74 20 69 6e 73 74 61 6c 6c 65 64  is not installed
1db70 2c 0a 09 20 20 20 20 23 20 61 6e 64 20 69 6e 20  ,..    # and in 
1db80 74 68 61 74 20 73 69 74 75 61 74 69 6f 6e 2c 20  that situation, 
1db90 6c 6f 6f 6b 20 74 68 65 72 65 20 62 65 66 6f 72  look there befor
1dba0 65 20 69 6e 73 74 61 6c 6c 65 64 20 6c 6f 63 61  e installed loca
1dbb0 74 69 6f 6e 73 2e 0a 09 20 20 20 20 69 66 20 74  tions...    if t
1dbc0 65 73 74 20 2d 66 20 22 24 7b 54 4b 5f 42 49 4e  est -f "${TK_BIN
1dbd0 5f 44 49 52 7d 2f 4d 61 6b 65 66 69 6c 65 22 20  _DIR}/Makefile" 
1dbe0 3b 20 74 68 65 6e 0a 09 09 6c 69 73 74 3d 22 24  ; then...list="$
1dbf0 6c 69 73 74 20 60 6c 73 20 2d 64 20 24 7b 54 4b  list `ls -d ${TK
1dc00 5f 53 52 43 5f 44 49 52 7d 2f 67 65 6e 65 72 69  _SRC_DIR}/generi
1dc10 63 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a  c 2>/dev/null`".
1dc20 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 23 20  .    fi...    # 
1dc30 43 68 65 63 6b 20 6f 72 64 65 72 3a 20 70 6b 67  Check order: pkg
1dc40 20 2d 2d 70 72 65 66 69 78 20 6c 6f 63 61 74 69   --prefix locati
1dc50 6f 6e 2c 20 54 6b 27 73 20 2d 2d 70 72 65 66 69  on, Tk's --prefi
1dc60 78 20 6c 6f 63 61 74 69 6f 6e 2c 0a 09 20 20 20  x location,..   
1dc70 20 23 20 72 65 6c 61 74 69 76 65 20 74 6f 20 64   # relative to d
1dc80 69 72 65 63 74 6f 72 79 20 6f 66 20 74 6b 43 6f  irectory of tkCo
1dc90 6e 66 69 67 2e 73 68 2c 20 54 63 6c 27 73 20 2d  nfig.sh, Tcl's -
1dca0 2d 70 72 65 66 69 78 20 6c 6f 63 61 74 69 6f 6e  -prefix location
1dcb0 2c 0a 09 20 20 20 20 23 20 72 65 6c 61 74 69 76  ,..    # relativ
1dcc0 65 20 74 6f 20 64 69 72 65 63 74 6f 72 79 20 6f  e to directory o
1dcd0 66 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68 2e 0a  f tclConfig.sh..
1dce0 0a 09 20 20 20 20 65 76 61 6c 20 22 74 65 6d 70  ..    eval "temp
1dcf0 5f 69 6e 63 6c 75 64 65 64 69 72 3d 24 7b 69 6e  _includedir=${in
1dd00 63 6c 75 64 65 64 69 72 7d 22 0a 09 20 20 20 20  cludedir}"..    
1dd10 6c 69 73 74 3d 22 24 6c 69 73 74 20 5c 0a 09 09  list="$list \...
1dd20 60 6c 73 20 2d 64 20 24 7b 74 65 6d 70 5f 69 6e  `ls -d ${temp_in
1dd30 63 6c 75 64 65 64 69 72 7d 20 20 20 20 20 20 20  cludedir}       
1dd40 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a   2>/dev/null` \.
1dd50 09 09 60 6c 73 20 2d 64 20 24 7b 54 4b 5f 50 52  ..`ls -d ${TK_PR
1dd60 45 46 49 58 7d 2f 69 6e 63 6c 75 64 65 20 20 20  EFIX}/include   
1dd70 20 20 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20     2>/dev/null` 
1dd80 5c 0a 09 09 60 6c 73 20 2d 64 20 24 7b 54 4b 5f  \...`ls -d ${TK_
1dd90 42 49 4e 5f 44 49 52 7d 2f 2e 2e 2f 69 6e 63 6c  BIN_DIR}/../incl
1dda0 75 64 65 20 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  ude  2>/dev/null
1ddb0 60 20 5c 0a 09 09 60 6c 73 20 2d 64 20 24 7b 54  ` \...`ls -d ${T
1ddc0 43 4c 5f 50 52 45 46 49 58 7d 2f 69 6e 63 6c 75  CL_PREFIX}/inclu
1ddd0 64 65 20 20 20 20 20 32 3e 2f 64 65 76 2f 6e 75  de     2>/dev/nu
1dde0 6c 6c 60 20 5c 0a 09 09 60 6c 73 20 2d 64 20 24  ll` \...`ls -d $
1ddf0 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 2e 2e  {TCL_BIN_DIR}/..
1de00 2f 69 6e 63 6c 75 64 65 20 32 3e 2f 64 65 76 2f  /include 2>/dev/
1de10 6e 75 6c 6c 60 22 0a 09 20 20 20 20 69 66 20 74  null`"..    if t
1de20 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41 54 46  est "${TEA_PLATF
1de30 4f 52 4d 7d 22 20 21 3d 20 22 77 69 6e 64 6f 77  ORM}" != "window
1de40 73 22 20 2d 6f 20 22 24 47 43 43 22 20 3d 20 22  s" -o "$GCC" = "
1de50 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 6c 69 73  yes"; then...lis
1de60 74 3d 22 24 6c 69 73 74 20 2f 75 73 72 2f 6c 6f  t="$list /usr/lo
1de70 63 61 6c 2f 69 6e 63 6c 75 64 65 20 2f 75 73 72  cal/include /usr
1de80 2f 69 6e 63 6c 75 64 65 22 0a 09 09 69 66 20 74  /include"...if t
1de90 65 73 74 20 78 22 24 7b 54 4b 5f 49 4e 43 4c 55  est x"${TK_INCLU
1dea0 44 45 5f 53 50 45 43 7d 22 20 21 3d 20 78 20 3b  DE_SPEC}" != x ;
1deb0 20 74 68 65 6e 0a 09 09 20 20 20 20 64 3d 60 65   then...    d=`e
1dec0 63 68 6f 20 22 24 7b 54 4b 5f 49 4e 43 4c 55 44  cho "${TK_INCLUD
1ded0 45 5f 53 50 45 43 7d 22 20 7c 20 73 65 64 20 2d  E_SPEC}" | sed -
1dee0 65 20 27 73 2f 5e 2d 49 2f 2f 27 60 0a 09 09 20  e 's/^-I//'`... 
1def0 20 20 20 6c 69 73 74 3d 22 24 6c 69 73 74 20 60     list="$list `
1df00 6c 73 20 2d 64 20 24 7b 64 7d 20 32 3e 2f 64 65  ls -d ${d} 2>/de
1df10 76 2f 6e 75 6c 6c 60 22 0a 09 09 66 69 0a 09 20  v/null`"...fi.. 
1df20 20 20 20 66 69 0a 09 20 20 20 20 66 6f 72 20 69     fi..    for i
1df30 20 69 6e 20 24 6c 69 73 74 20 3b 20 64 6f 0a 09   in $list ; do..
1df40 09 69 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f  .if test -f "$i/
1df50 74 6b 2e 68 22 20 3b 20 74 68 65 6e 0a 09 09 20  tk.h" ; then... 
1df60 20 20 20 61 63 5f 63 76 5f 63 5f 74 6b 68 3d 24     ac_cv_c_tkh=$
1df70 69 0a 09 09 20 20 20 20 62 72 65 61 6b 0a 09 09  i...    break...
1df80 66 69 0a 09 20 20 20 20 64 6f 6e 65 0a 09 66 69  fi..    done..fi
1df90 0a 20 20 20 20 5d 29 0a 0a 20 20 20 20 23 20 50  .    ])..    # P
1dfa0 72 69 6e 74 20 61 20 6d 65 73 73 61 67 65 20 62  rint a message b
1dfb0 61 73 65 64 20 6f 6e 20 68 6f 77 20 77 65 20 64  ased on how we d
1dfc0 65 74 65 72 6d 69 6e 65 64 20 74 68 65 20 69 6e  etermined the in
1dfd0 63 6c 75 64 65 20 70 61 74 68 0a 0a 20 20 20 20  clude path..    
1dfe0 69 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f 63  if test x"${ac_c
1dff0 76 5f 63 5f 74 6b 68 7d 22 20 3d 20 78 20 3b 20  v_c_tkh}" = x ; 
1e000 74 68 65 6e 0a 09 41 43 5f 4d 53 47 5f 45 52 52  then..AC_MSG_ERR
1e010 4f 52 28 5b 74 6b 2e 68 20 6e 6f 74 20 66 6f 75  OR([tk.h not fou
1e020 6e 64 2e 20 20 50 6c 65 61 73 65 20 73 70 65 63  nd.  Please spec
1e030 69 66 79 20 69 74 73 20 6c 6f 63 61 74 69 6f 6e  ify its location
1e040 20 77 69 74 68 20 2d 2d 77 69 74 68 2d 74 6b 69   with --with-tki
1e050 6e 63 6c 75 64 65 5d 29 0a 20 20 20 20 65 6c 73  nclude]).    els
1e060 65 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  e..AC_MSG_RESULT
1e070 28 5b 24 7b 61 63 5f 63 76 5f 63 5f 74 6b 68 7d  ([${ac_cv_c_tkh}
1e080 5d 29 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 23  ]).    fi..    #
1e090 20 43 6f 6e 76 65 72 74 20 74 6f 20 61 20 6e 61   Convert to a na
1e0a0 74 69 76 65 20 70 61 74 68 20 61 6e 64 20 73 75  tive path and su
1e0b0 62 73 74 69 74 75 74 65 20 69 6e 74 6f 20 74 68  bstitute into th
1e0c0 65 20 6f 75 74 70 75 74 20 66 69 6c 65 73 2e 0a  e output files..
1e0d0 0a 20 20 20 20 49 4e 43 4c 55 44 45 5f 44 49 52  .    INCLUDE_DIR
1e0e0 5f 4e 41 54 49 56 45 3d 60 24 7b 43 59 47 50 41  _NATIVE=`${CYGPA
1e0f0 54 48 7d 20 24 7b 61 63 5f 63 76 5f 63 5f 74 6b  TH} ${ac_cv_c_tk
1e100 68 7d 60 0a 0a 20 20 20 20 54 4b 5f 49 4e 43 4c  h}`..    TK_INCL
1e110 55 44 45 53 3d 2d 49 5c 22 24 7b 49 4e 43 4c 55  UDES=-I\"${INCLU
1e120 44 45 5f 44 49 52 5f 4e 41 54 49 56 45 7d 5c 22  DE_DIR_NATIVE}\"
1e130 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54  ..    AC_SUBST(T
1e140 4b 5f 49 4e 43 4c 55 44 45 53 29 0a 0a 20 20 20  K_INCLUDES)..   
1e150 20 69 66 20 74 65 73 74 20 22 24 7b 54 45 41 5f   if test "${TEA_
1e160 57 49 4e 44 4f 57 49 4e 47 53 59 53 54 45 4d 7d  WINDOWINGSYSTEM}
1e170 22 20 21 3d 20 22 78 31 31 22 3b 20 74 68 65 6e  " != "x11"; then
1e180 0a 09 23 20 4f 6e 20 57 69 6e 64 6f 77 73 20 61  ..# On Windows a
1e190 6e 64 20 41 71 75 61 2c 20 77 65 20 6e 65 65 64  nd Aqua, we need
1e1a0 20 74 68 65 20 58 20 63 6f 6d 70 61 74 20 68 65   the X compat he
1e1b0 61 64 65 72 73 0a 09 41 43 5f 4d 53 47 5f 43 48  aders..AC_MSG_CH
1e1c0 45 43 4b 49 4e 47 28 5b 66 6f 72 20 58 31 31 20  ECKING([for X11 
1e1d0 68 65 61 64 65 72 20 66 69 6c 65 73 5d 29 0a 09  header files])..
1e1e0 69 66 20 74 65 73 74 20 21 20 2d 72 20 22 24 7b  if test ! -r "${
1e1f0 49 4e 43 4c 55 44 45 5f 44 49 52 5f 4e 41 54 49  INCLUDE_DIR_NATI
1e200 56 45 7d 2f 58 31 31 2f 58 6c 69 62 2e 68 22 3b  VE}/X11/Xlib.h";
1e210 20 74 68 65 6e 0a 09 20 20 20 20 49 4e 43 4c 55   then..    INCLU
1e220 44 45 5f 44 49 52 5f 4e 41 54 49 56 45 3d 22 60  DE_DIR_NATIVE="`
1e230 24 7b 43 59 47 50 41 54 48 7d 20 24 7b 54 4b 5f  ${CYGPATH} ${TK_
1e240 53 52 43 5f 44 49 52 7d 2f 78 6c 69 62 60 22 0a  SRC_DIR}/xlib`".
1e250 09 20 20 20 20 54 4b 5f 58 49 4e 43 4c 55 44 45  .    TK_XINCLUDE
1e260 53 3d 2d 49 5c 22 24 7b 49 4e 43 4c 55 44 45 5f  S=-I\"${INCLUDE_
1e270 44 49 52 5f 4e 41 54 49 56 45 7d 5c 22 0a 09 20  DIR_NATIVE}\".. 
1e280 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b 5f 58     AC_SUBST(TK_X
1e290 49 4e 43 4c 55 44 45 53 29 0a 09 66 69 0a 09 41  INCLUDES)..fi..A
1e2a0 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 7b  C_MSG_RESULT([${
1e2b0 49 4e 43 4c 55 44 45 5f 44 49 52 5f 4e 41 54 49  INCLUDE_DIR_NATI
1e2c0 56 45 7d 5d 29 0a 20 20 20 20 66 69 0a 5d 29 0a  VE}]).    fi.]).
1e2d0 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
1e2e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e2f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e300 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e310 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41  ----------.# TEA
1e320 5f 50 41 54 48 5f 43 4f 4e 46 49 47 20 2d 2d 0a  _PATH_CONFIG --.
1e330 23 0a 23 09 4c 6f 63 61 74 65 20 74 68 65 20 24  #.#.Locate the $
1e340 7b 31 7d 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c  {1}Config.sh fil
1e350 65 20 61 6e 64 20 70 65 72 66 6f 72 6d 20 61 20  e and perform a 
1e360 73 61 6e 69 74 79 20 63 68 65 63 6b 20 6f 6e 0a  sanity check on.
1e370 23 09 74 68 65 20 24 7b 31 7d 20 63 6f 6d 70 69  #.the ${1} compi
1e380 6c 65 20 66 6c 61 67 73 2e 20 20 54 68 65 73 65  le flags.  These
1e390 20 61 72 65 20 75 73 65 64 20 62 79 20 70 61 63   are used by pac
1e3a0 6b 61 67 65 73 20 6c 69 6b 65 0a 23 09 5b 69 6e  kages like.#.[in
1e3b0 63 72 20 54 6b 5d 20 74 68 61 74 20 6c 6f 61 64  cr Tk] that load
1e3c0 20 2a 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c 65   *Config.sh file
1e3d0 73 20 66 72 6f 6d 20 6d 6f 72 65 20 74 68 61 6e  s from more than
1e3e0 20 54 63 6c 20 61 6e 64 20 54 6b 2e 0a 23 0a 23   Tcl and Tk..#.#
1e3f0 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f   Arguments:.#.no
1e400 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a  ne.#.# Results:.
1e410 23 0a 23 09 41 64 64 73 20 74 68 65 20 66 6f 6c  #.#.Adds the fol
1e420 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65 6e 74 73  lowing arguments
1e430 20 74 6f 20 63 6f 6e 66 69 67 75 72 65 3a 0a 23   to configure:.#
1e440 09 09 2d 2d 77 69 74 68 2d 24 31 3d 2e 2e 2e 0a  ..--with-$1=....
1e450 23 0a 23 09 44 65 66 69 6e 65 73 20 74 68 65 20  #.#.Defines the 
1e460 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a  following vars:.
1e470 23 09 09 24 31 5f 42 49 4e 5f 44 49 52 09 46 75  #..$1_BIN_DIR.Fu
1e480 6c 6c 20 70 61 74 68 20 74 6f 20 74 68 65 20 64  ll path to the d
1e490 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e  irectory contain
1e4a0 69 6e 67 0a 23 09 09 09 09 74 68 65 20 24 31 43  ing.#....the $1C
1e4b0 6f 6e 66 69 67 2e 73 68 20 66 69 6c 65 0a 23 2d  onfig.sh file.#-
1e4c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e4d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e4e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e4f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e500 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55  -------..AC_DEFU
1e510 4e 28 5b 54 45 41 5f 50 41 54 48 5f 43 4f 4e 46  N([TEA_PATH_CONF
1e520 49 47 5d 2c 20 5b 0a 20 20 20 20 23 0a 20 20 20  IG], [.    #.   
1e530 20 23 20 4f 6b 2c 20 6c 65 74 73 20 66 69 6e 64   # Ok, lets find
1e540 20 74 68 65 20 24 31 20 63 6f 6e 66 69 67 75 72   the $1 configur
1e550 61 74 69 6f 6e 0a 20 20 20 20 23 20 46 69 72 73  ation.    # Firs
1e560 74 2c 20 6c 6f 6f 6b 20 66 6f 72 20 6f 6e 65 20  t, look for one 
1e570 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 0a 20 20 20  uninstalled..   
1e580 20 23 20 74 68 65 20 61 6c 74 65 72 6e 61 74 69   # the alternati
1e590 76 65 20 73 65 61 72 63 68 20 64 69 72 65 63 74  ve search direct
1e5a0 6f 72 79 20 69 73 20 69 6e 76 6f 6b 65 64 20 62  ory is invoked b
1e5b0 79 20 2d 2d 77 69 74 68 2d 24 31 0a 20 20 20 20  y --with-$1.    
1e5c0 23 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20 78  #..    if test x
1e5d0 22 24 7b 6e 6f 5f 24 31 7d 22 20 3d 20 78 20 3b  "${no_$1}" = x ;
1e5e0 20 74 68 65 6e 0a 09 23 20 77 65 20 72 65 73 65   then..# we rese
1e5f0 74 20 6e 6f 5f 24 31 20 69 6e 20 63 61 73 65 20  t no_$1 in case 
1e600 73 6f 6d 65 74 68 69 6e 67 20 66 61 69 6c 73 20  something fails 
1e610 68 65 72 65 0a 09 6e 6f 5f 24 31 3d 74 72 75 65  here..no_$1=true
1e620 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 24 31  ..AC_ARG_WITH($1
1e630 2c 20 5b 20 20 2d 2d 77 69 74 68 2d 24 31 20 20  , [  --with-$1  
1e640 20 20 20 20 20 20 20 20 20 20 20 20 64 69 72 65              dire
1e650 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67  ctory containing
1e660 20 24 31 20 63 6f 6e 66 69 67 75 72 61 74 69 6f   $1 configuratio
1e670 6e 20 28 24 31 43 6f 6e 66 69 67 2e 73 68 29 5d  n ($1Config.sh)]
1e680 2c 20 77 69 74 68 5f 24 31 63 6f 6e 66 69 67 3d  , with_$1config=
1e690 24 7b 77 69 74 68 76 61 6c 7d 29 0a 09 41 43 5f  ${withval})..AC_
1e6a0 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f  MSG_CHECKING([fo
1e6b0 72 20 24 31 20 63 6f 6e 66 69 67 75 72 61 74 69  r $1 configurati
1e6c0 6f 6e 5d 29 0a 09 41 43 5f 43 41 43 48 45 5f 56  on])..AC_CACHE_V
1e6d0 41 4c 28 61 63 5f 63 76 5f 63 5f 24 31 63 6f 6e  AL(ac_cv_c_$1con
1e6e0 66 69 67 2c 5b 0a 0a 09 20 20 20 20 23 20 46 69  fig,[...    # Fi
1e6f0 72 73 74 20 63 68 65 63 6b 20 74 6f 20 73 65 65  rst check to see
1e700 20 69 66 20 2d 2d 77 69 74 68 2d 24 31 20 77 61   if --with-$1 wa
1e710 73 20 73 70 65 63 69 66 69 65 64 2e 0a 09 20 20  s specified...  
1e720 20 20 69 66 20 74 65 73 74 20 78 22 24 7b 77 69    if test x"${wi
1e730 74 68 5f 24 31 63 6f 6e 66 69 67 7d 22 20 21 3d  th_$1config}" !=
1e740 20 78 20 3b 20 74 68 65 6e 0a 09 09 63 61 73 65   x ; then...case
1e750 20 24 7b 77 69 74 68 5f 24 31 63 6f 6e 66 69 67   ${with_$1config
1e760 7d 20 69 6e 0a 09 09 20 20 20 20 2a 2f 24 31 43  } in...    */$1C
1e770 6f 6e 66 69 67 2e 73 68 20 29 0a 09 09 09 69 66  onfig.sh )....if
1e780 20 74 65 73 74 20 2d 66 20 24 7b 77 69 74 68 5f   test -f ${with_
1e790 24 31 63 6f 6e 66 69 67 7d 3b 20 74 68 65 6e 0a  $1config}; then.
1e7a0 09 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 57 41  ...    AC_MSG_WA
1e7b0 52 4e 28 5b 2d 2d 77 69 74 68 2d 24 31 20 61 72  RN([--with-$1 ar
1e7c0 67 75 6d 65 6e 74 20 73 68 6f 75 6c 64 20 72 65  gument should re
1e7d0 66 65 72 20 74 6f 20 64 69 72 65 63 74 6f 72 79  fer to directory
1e7e0 20 63 6f 6e 74 61 69 6e 69 6e 67 20 24 31 43 6f   containing $1Co
1e7f0 6e 66 69 67 2e 73 68 2c 20 6e 6f 74 20 74 6f 20  nfig.sh, not to 
1e800 24 31 43 6f 6e 66 69 67 2e 73 68 20 69 74 73 65  $1Config.sh itse
1e810 6c 66 5d 29 0a 09 09 09 20 20 20 20 77 69 74 68  lf])....    with
1e820 5f 24 31 63 6f 6e 66 69 67 3d 60 65 63 68 6f 20  _$1config=`echo 
1e830 24 7b 77 69 74 68 5f 24 31 63 6f 6e 66 69 67 7d  ${with_$1config}
1e840 20 7c 20 73 65 64 20 27 73 21 2f 24 31 43 6f 6e   | sed 's!/$1Con
1e850 66 69 67 5c 2e 73 68 24 21 21 27 60 0a 09 09 09  fig\.sh$!!'`....
1e860 66 69 3b 3b 0a 09 09 65 73 61 63 0a 09 09 69 66  fi;;...esac...if
1e870 20 74 65 73 74 20 2d 66 20 22 24 7b 77 69 74 68   test -f "${with
1e880 5f 24 31 63 6f 6e 66 69 67 7d 2f 24 31 43 6f 6e  _$1config}/$1Con
1e890 66 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09  fig.sh" ; then..
1e8a0 09 20 20 20 20 61 63 5f 63 76 5f 63 5f 24 31 63  .    ac_cv_c_$1c
1e8b0 6f 6e 66 69 67 3d 60 28 63 64 20 24 7b 77 69 74  onfig=`(cd ${wit
1e8c0 68 5f 24 31 63 6f 6e 66 69 67 7d 3b 20 70 77 64  h_$1config}; pwd
1e8d0 29 60 0a 09 09 65 6c 73 65 0a 09 09 20 20 20 20  )`...else...    
1e8e0 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 24 7b  AC_MSG_ERROR([${
1e8f0 77 69 74 68 5f 24 31 63 6f 6e 66 69 67 7d 20 64  with_$1config} d
1e900 69 72 65 63 74 6f 72 79 20 64 6f 65 73 6e 27 74  irectory doesn't
1e910 20 63 6f 6e 74 61 69 6e 20 24 31 43 6f 6e 66 69   contain $1Confi
1e920 67 2e 73 68 5d 29 0a 09 09 66 69 0a 09 20 20 20  g.sh])...fi..   
1e930 20 66 69 0a 0a 09 20 20 20 20 23 20 74 68 65 6e   fi...    # then
1e940 20 63 68 65 63 6b 20 66 6f 72 20 61 20 70 72 69   check for a pri
1e950 76 61 74 65 20 24 31 20 69 6e 73 74 61 6c 6c 61  vate $1 installa
1e960 74 69 6f 6e 0a 09 20 20 20 20 69 66 20 74 65 73  tion..    if tes
1e970 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f 24 31  t x"${ac_cv_c_$1
1e980 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74  config}" = x ; t
1e990 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 5c  hen...for i in \
1e9a0 0a 09 09 09 2e 2e 2f 24 31 20 5c 0a 09 09 09 60  ....../$1 \....`
1e9b0 6c 73 20 2d 64 72 20 2e 2e 2f 24 31 2a 5b 5b 30  ls -dr ../$1*[[0
1e9c0 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 2e 5b 5b  -9]].[[0-9]]*.[[
1e9d0 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75  0-9]]* 2>/dev/nu
1e9e0 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72  ll` \....`ls -dr
1e9f0 20 2e 2e 2f 24 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b   ../$1*[[0-9]].[
1ea00 5b 30 2d 39 5d 5d 5b 5b 30 2d 39 5d 5d 20 32 3e  [0-9]][[0-9]] 2>
1ea10 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09  /dev/null` \....
1ea20 60 6c 73 20 2d 64 72 20 2e 2e 2f 24 31 2a 5b 5b  `ls -dr ../$1*[[
1ea30 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 32 3e  0-9]].[[0-9]] 2>
1ea40 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09  /dev/null` \....
1ea50 60 6c 73 20 2d 64 72 20 2e 2e 2f 24 31 2a 5b 5b  `ls -dr ../$1*[[
1ea60 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32  0-9]].[[0-9]]* 2
1ea70 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
1ea80 09 2e 2e 2f 2e 2e 2f 24 31 20 5c 0a 09 09 09 60  .../../$1 \....`
1ea90 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 24 31 2a  ls -dr ../../$1*
1eaa0 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a  [[0-9]].[[0-9]]*
1eab0 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76  .[[0-9]]* 2>/dev
1eac0 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20  /null` \....`ls 
1ead0 2d 64 72 20 2e 2e 2f 2e 2e 2f 24 31 2a 5b 5b 30  -dr ../../$1*[[0
1eae0 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 5b 5b 30 2d  -9]].[[0-9]][[0-
1eaf0 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  9]] 2>/dev/null`
1eb00 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e   \....`ls -dr ..
1eb10 2f 2e 2e 2f 24 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b  /../$1*[[0-9]].[
1eb20 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75  [0-9]] 2>/dev/nu
1eb30 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72  ll` \....`ls -dr
1eb40 20 2e 2e 2f 2e 2e 2f 24 31 2a 5b 5b 30 2d 39 5d   ../../$1*[[0-9]
1eb50 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65  ].[[0-9]]* 2>/de
1eb60 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 2e 2e 2f  v/null` \....../
1eb70 2e 2e 2f 2e 2e 2f 24 31 20 5c 0a 09 09 09 60 6c  ../../$1 \....`l
1eb80 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 24  s -dr ../../../$
1eb90 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d  1*[[0-9]].[[0-9]
1eba0 5d 2a 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64  ]*.[[0-9]]* 2>/d
1ebb0 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c  ev/null` \....`l
1ebc0 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 24  s -dr ../../../$
1ebd0 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d  1*[[0-9]].[[0-9]
1ebe0 5d 5b 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f  ][[0-9]] 2>/dev/
1ebf0 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d  null` \....`ls -
1ec00 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 24 31 2a 5b  dr ../../../$1*[
1ec10 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 32  [0-9]].[[0-9]] 2
1ec20 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
1ec30 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e  .`ls -dr ../../.
1ec40 2e 2f 24 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30  ./$1*[[0-9]].[[0
1ec50 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c  -9]]* 2>/dev/nul
1ec60 6c 60 20 5c 0a 09 09 09 24 7b 73 72 63 64 69 72  l` \....${srcdir
1ec70 7d 2f 2e 2e 2f 24 31 20 5c 0a 09 09 09 60 6c 73  }/../$1 \....`ls
1ec80 20 2d 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e   -dr ${srcdir}/.
1ec90 2e 2f 24 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30  ./$1*[[0-9]].[[0
1eca0 2d 39 5d 5d 2a 2e 5b 5b 30 2d 39 5d 5d 2a 20 32  -9]]*.[[0-9]]* 2
1ecb0 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
1ecc0 09 60 6c 73 20 2d 64 72 20 24 7b 73 72 63 64 69  .`ls -dr ${srcdi
1ecd0 72 7d 2f 2e 2e 2f 24 31 2a 5b 5b 30 2d 39 5d 5d  r}/../$1*[[0-9]]
1ece0 2e 5b 5b 30 2d 39 5d 5d 5b 5b 30 2d 39 5d 5d 20  .[[0-9]][[0-9]] 
1ecf0 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09  2>/dev/null` \..
1ed00 09 09 60 6c 73 20 2d 64 72 20 24 7b 73 72 63 64  ..`ls -dr ${srcd
1ed10 69 72 7d 2f 2e 2e 2f 24 31 2a 5b 5b 30 2d 39 5d  ir}/../$1*[[0-9]
1ed20 5d 2e 5b 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65 76  ].[[0-9]] 2>/dev
1ed30 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20  /null` \....`ls 
1ed40 2d 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e  -dr ${srcdir}/..
1ed50 2f 24 31 2a 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d  /$1*[[0-9]].[[0-
1ed60 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  9]]* 2>/dev/null
1ed70 60 20 5c 0a 09 09 09 3b 20 64 6f 0a 09 09 20 20  ` \....; do...  
1ed80 20 20 69 66 20 74 65 73 74 20 2d 66 20 22 24 69    if test -f "$i
1ed90 2f 24 31 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20  /$1Config.sh" ; 
1eda0 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f  then....ac_cv_c_
1edb0 24 31 63 6f 6e 66 69 67 3d 60 28 63 64 20 24 69  $1config=`(cd $i
1edc0 3b 20 70 77 64 29 60 0a 09 09 09 62 72 65 61 6b  ; pwd)`....break
1edd0 0a 09 09 20 20 20 20 66 69 0a 09 09 20 20 20 20  ...    fi...    
1ede0 69 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 75  if test -f "$i/u
1edf0 6e 69 78 2f 24 31 43 6f 6e 66 69 67 2e 73 68 22  nix/$1Config.sh"
1ee00 20 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63 76   ; then....ac_cv
1ee10 5f 63 5f 24 31 63 6f 6e 66 69 67 3d 60 28 63 64  _c_$1config=`(cd
1ee20 20 24 69 2f 75 6e 69 78 3b 20 70 77 64 29 60 0a   $i/unix; pwd)`.
1ee30 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20 20 66  ...break...    f
1ee40 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20 66 69  i...done..    fi
1ee50 0a 0a 09 20 20 20 20 23 20 63 68 65 63 6b 20 69  ...    # check i
1ee60 6e 20 61 20 66 65 77 20 63 6f 6d 6d 6f 6e 20 69  n a few common i
1ee70 6e 73 74 61 6c 6c 20 6c 6f 63 61 74 69 6f 6e 73  nstall locations
1ee80 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 78 22  ..    if test x"
1ee90 24 7b 61 63 5f 63 76 5f 63 5f 24 31 63 6f 6e 66  ${ac_cv_c_$1conf
1eea0 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e 0a  ig}" = x ; then.
1eeb0 09 09 66 6f 72 20 69 20 69 6e 20 60 6c 73 20 2d  ..for i in `ls -
1eec0 64 20 24 7b 6c 69 62 64 69 72 7d 20 32 3e 2f 64  d ${libdir} 2>/d
1eed0 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c  ev/null` \....`l
1eee0 73 20 2d 64 20 24 7b 65 78 65 63 5f 70 72 65 66  s -d ${exec_pref
1eef0 69 78 7d 2f 6c 69 62 20 32 3e 2f 64 65 76 2f 6e  ix}/lib 2>/dev/n
1ef00 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64  ull` \....`ls -d
1ef10 20 24 7b 70 72 65 66 69 78 7d 2f 6c 69 62 20 32   ${prefix}/lib 2
1ef20 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
1ef30 09 60 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 6f 63  .`ls -d /usr/loc
1ef40 61 6c 2f 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75  al/lib 2>/dev/nu
1ef50 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20  ll` \....`ls -d 
1ef60 2f 75 73 72 2f 63 6f 6e 74 72 69 62 2f 6c 69 62  /usr/contrib/lib
1ef70 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a   2>/dev/null` \.
1ef80 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72 2f 6c  ...`ls -d /usr/l
1ef90 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ib 2>/dev/null` 
1efa0 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72  \....`ls -d /usr
1efb0 2f 6c 69 62 36 34 20 32 3e 2f 64 65 76 2f 6e 75  /lib64 2>/dev/nu
1efc0 6c 6c 60 20 5c 0a 09 09 09 3b 20 64 6f 0a 09 09  ll` \....; do...
1efd0 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20 22      if test -f "
1efe0 24 69 2f 24 31 43 6f 6e 66 69 67 2e 73 68 22 20  $i/$1Config.sh" 
1eff0 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f  ; then....ac_cv_
1f000 63 5f 24 31 63 6f 6e 66 69 67 3d 60 28 63 64 20  c_$1config=`(cd 
1f010 24 69 3b 20 70 77 64 29 60 0a 09 09 09 62 72 65  $i; pwd)`....bre
1f020 61 6b 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f  ak...    fi...do
1f030 6e 65 0a 09 20 20 20 20 66 69 0a 09 5d 29 0a 0a  ne..    fi..])..
1f040 09 69 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f  .if test x"${ac_
1f050 63 76 5f 63 5f 24 31 63 6f 6e 66 69 67 7d 22 20  cv_c_$1config}" 
1f060 3d 20 78 20 3b 20 74 68 65 6e 0a 09 20 20 20 20  = x ; then..    
1f070 24 31 5f 42 49 4e 5f 44 49 52 3d 22 23 20 6e 6f  $1_BIN_DIR="# no
1f080 20 24 31 20 63 6f 6e 66 69 67 73 20 66 6f 75 6e   $1 configs foun
1f090 64 22 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 57  d"..    AC_MSG_W
1f0a0 41 52 4e 28 5b 43 61 6e 6e 6f 74 20 66 69 6e 64  ARN([Cannot find
1f0b0 20 24 31 20 63 6f 6e 66 69 67 75 72 61 74 69 6f   $1 configuratio
1f0c0 6e 20 64 65 66 69 6e 69 74 69 6f 6e 73 5d 29 0a  n definitions]).
1f0d0 09 20 20 20 20 65 78 69 74 20 30 0a 09 65 6c 73  .    exit 0..els
1f0e0 65 0a 09 20 20 20 20 6e 6f 5f 24 31 3d 0a 09 20  e..    no_$1=.. 
1f0f0 20 20 20 24 31 5f 42 49 4e 5f 44 49 52 3d 24 7b     $1_BIN_DIR=${
1f100 61 63 5f 63 76 5f 63 5f 24 31 63 6f 6e 66 69 67  ac_cv_c_$1config
1f110 7d 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52 45  }..    AC_MSG_RE
1f120 53 55 4c 54 28 5b 66 6f 75 6e 64 20 24 24 31 5f  SULT([found $$1_
1f130 42 49 4e 5f 44 49 52 2f 24 31 43 6f 6e 66 69 67  BIN_DIR/$1Config
1f140 2e 73 68 5d 29 0a 09 66 69 0a 20 20 20 20 66 69  .sh])..fi.    fi
1f150 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .])..#----------
1f160 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f170 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f180 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f190 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
1f1a0 20 54 45 41 5f 4c 4f 41 44 5f 43 4f 4e 46 49 47   TEA_LOAD_CONFIG
1f1b0 20 2d 2d 0a 23 0a 23 09 4c 6f 61 64 20 74 68 65   --.#.#.Load the
1f1c0 20 24 31 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c   $1Config.sh fil
1f1d0 65 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a  e.#.# Arguments:
1f1e0 0a 23 0a 23 09 52 65 71 75 69 72 65 73 20 74 68  .#.#.Requires th
1f1f0 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
1f200 20 74 6f 20 62 65 20 73 65 74 3a 0a 23 09 09 24   to be set:.#..$
1f210 31 5f 42 49 4e 5f 44 49 52 0a 23 0a 23 20 52 65  1_BIN_DIR.#.# Re
1f220 73 75 6c 74 73 3a 0a 23 0a 23 09 53 75 62 73 74  sults:.#.#.Subst
1f230 69 74 75 74 65 73 20 74 68 65 20 66 6f 6c 6c 6f  itutes the follo
1f240 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 24 31  wing vars:.#..$1
1f250 5f 53 52 43 5f 44 49 52 0a 23 09 09 24 31 5f 4c  _SRC_DIR.#..$1_L
1f260 49 42 5f 46 49 4c 45 0a 23 09 09 24 31 5f 4c 49  IB_FILE.#..$1_LI
1f270 42 5f 53 50 45 43 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  B_SPEC.#--------
1f280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f2a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f2b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f2c0 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f  ..AC_DEFUN([TEA_
1f2d0 4c 4f 41 44 5f 43 4f 4e 46 49 47 5d 2c 20 5b 0a  LOAD_CONFIG], [.
1f2e0 20 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b      AC_MSG_CHECK
1f2f0 49 4e 47 28 5b 66 6f 72 20 65 78 69 73 74 65 6e  ING([for existen
1f300 63 65 20 6f 66 20 24 7b 24 31 5f 42 49 4e 5f 44  ce of ${$1_BIN_D
1f310 49 52 7d 2f 24 31 43 6f 6e 66 69 67 2e 73 68 5d  IR}/$1Config.sh]
1f320 29 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20 2d  )..    if test -
1f330 66 20 22 24 7b 24 31 5f 42 49 4e 5f 44 49 52 7d  f "${$1_BIN_DIR}
1f340 2f 24 31 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20  /$1Config.sh" ; 
1f350 74 68 65 6e 0a 20 20 20 20 20 20 20 20 41 43 5f  then.        AC_
1f360 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6c 6f 61 64  MSG_RESULT([load
1f370 69 6e 67 5d 29 0a 09 2e 20 22 24 7b 24 31 5f 42  ing])... "${$1_B
1f380 49 4e 5f 44 49 52 7d 2f 24 31 43 6f 6e 66 69 67  IN_DIR}/$1Config
1f390 2e 73 68 22 0a 20 20 20 20 65 6c 73 65 0a 20 20  .sh".    else.  
1f3a0 20 20 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53        AC_MSG_RES
1f3b0 55 4c 54 28 5b 66 69 6c 65 20 6e 6f 74 20 66 6f  ULT([file not fo
1f3c0 75 6e 64 5d 29 0a 20 20 20 20 66 69 0a 0a 20 20  und]).    fi..  
1f3d0 20 20 23 0a 20 20 20 20 23 20 49 66 20 74 68 65    #.    # If the
1f3e0 20 24 31 5f 42 49 4e 5f 44 49 52 20 69 73 20 74   $1_BIN_DIR is t
1f3f0 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 74 6f  he build directo
1f400 72 79 20 28 6e 6f 74 20 74 68 65 20 69 6e 73 74  ry (not the inst
1f410 61 6c 6c 20 64 69 72 65 63 74 6f 72 79 29 2c 0a  all directory),.
1f420 20 20 20 20 23 20 74 68 65 6e 20 73 65 74 20 74      # then set t
1f430 68 65 20 63 6f 6d 6d 6f 6e 20 76 61 72 69 61 62  he common variab
1f440 6c 65 20 6e 61 6d 65 20 74 6f 20 74 68 65 20 76  le name to the v
1f450 61 6c 75 65 20 6f 66 20 74 68 65 20 62 75 69 6c  alue of the buil
1f460 64 20 76 61 72 69 61 62 6c 65 73 2e 0a 20 20 20  d variables..   
1f470 20 23 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20   # For example, 
1f480 74 68 65 20 76 61 72 69 61 62 6c 65 20 24 31 5f  the variable $1_
1f490 4c 49 42 5f 53 50 45 43 20 77 69 6c 6c 20 62 65  LIB_SPEC will be
1f4a0 20 73 65 74 20 74 6f 20 74 68 65 20 76 61 6c 75   set to the valu
1f4b0 65 0a 20 20 20 20 23 20 6f 66 20 24 31 5f 42 55  e.    # of $1_BU
1f4c0 49 4c 44 5f 4c 49 42 5f 53 50 45 43 2e 20 41 6e  ILD_LIB_SPEC. An
1f4d0 20 65 78 74 65 6e 73 69 6f 6e 20 73 68 6f 75 6c   extension shoul
1f4e0 64 20 6d 61 6b 65 20 75 73 65 20 6f 66 20 24 31  d make use of $1
1f4f0 5f 4c 49 42 5f 53 50 45 43 0a 20 20 20 20 23 20  _LIB_SPEC.    # 
1f500 69 6e 73 74 65 61 64 20 6f 66 20 24 31 5f 42 55  instead of $1_BU
1f510 49 4c 44 5f 4c 49 42 5f 53 50 45 43 20 73 69 6e  ILD_LIB_SPEC sin
1f520 63 65 20 69 74 20 77 69 6c 6c 20 77 6f 72 6b 20  ce it will work 
1f530 77 69 74 68 20 62 6f 74 68 20 61 6e 0a 20 20 20  with both an.   
1f540 20 23 20 69 6e 73 74 61 6c 6c 65 64 20 61 6e 64   # installed and
1f550 20 75 6e 69 6e 73 74 61 6c 6c 65 64 20 76 65 72   uninstalled ver
1f560 73 69 6f 6e 20 6f 66 20 54 63 6c 2e 0a 20 20 20  sion of Tcl..   
1f570 20 23 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20   #..    if test 
1f580 2d 66 20 22 24 7b 24 31 5f 42 49 4e 5f 44 49 52  -f "${$1_BIN_DIR
1f590 7d 2f 4d 61 6b 65 66 69 6c 65 22 20 3b 20 74 68  }/Makefile" ; th
1f5a0 65 6e 0a 09 41 43 5f 4d 53 47 5f 57 41 52 4e 28  en..AC_MSG_WARN(
1f5b0 5b 46 6f 75 6e 64 20 4d 61 6b 65 66 69 6c 65 20  [Found Makefile 
1f5c0 2d 20 75 73 69 6e 67 20 62 75 69 6c 64 20 6c 69  - using build li
1f5d0 62 72 61 72 79 20 73 70 65 63 73 20 66 6f 72 20  brary specs for 
1f5e0 24 31 5d 29 0a 20 20 20 20 20 20 20 20 24 31 5f  $1]).        $1_
1f5f0 4c 49 42 5f 53 50 45 43 3d 24 7b 24 31 5f 42 55  LIB_SPEC=${$1_BU
1f600 49 4c 44 5f 4c 49 42 5f 53 50 45 43 7d 0a 20 20  ILD_LIB_SPEC}.  
1f610 20 20 20 20 20 20 24 31 5f 53 54 55 42 5f 4c 49        $1_STUB_LI
1f620 42 5f 53 50 45 43 3d 24 7b 24 31 5f 42 55 49 4c  B_SPEC=${$1_BUIL
1f630 44 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 7d  D_STUB_LIB_SPEC}
1f640 0a 20 20 20 20 20 20 20 20 24 31 5f 53 54 55 42  .        $1_STUB
1f650 5f 4c 49 42 5f 50 41 54 48 3d 24 7b 24 31 5f 42  _LIB_PATH=${$1_B
1f660 55 49 4c 44 5f 53 54 55 42 5f 4c 49 42 5f 50 41  UILD_STUB_LIB_PA
1f670 54 48 7d 0a 20 20 20 20 20 20 20 20 24 31 5f 49  TH}.        $1_I
1f680 4e 43 4c 55 44 45 5f 53 50 45 43 3d 24 7b 24 31  NCLUDE_SPEC=${$1
1f690 5f 42 55 49 4c 44 5f 49 4e 43 4c 55 44 45 5f 53  _BUILD_INCLUDE_S
1f6a0 50 45 43 7d 0a 20 20 20 20 20 20 20 20 24 31 5f  PEC}.        $1_
1f6b0 4c 49 42 52 41 52 59 5f 50 41 54 48 3d 24 7b 24  LIBRARY_PATH=${$
1f6c0 31 5f 4c 49 42 52 41 52 59 5f 50 41 54 48 7d 0a  1_LIBRARY_PATH}.
1f6d0 20 20 20 20 66 69 0a 0a 20 20 20 20 41 43 5f 53      fi..    AC_S
1f6e0 55 42 53 54 28 24 31 5f 56 45 52 53 49 4f 4e 29  UBST($1_VERSION)
1f6f0 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 24 31  .    AC_SUBST($1
1f700 5f 42 49 4e 5f 44 49 52 29 0a 20 20 20 20 41 43  _BIN_DIR).    AC
1f710 5f 53 55 42 53 54 28 24 31 5f 53 52 43 5f 44 49  _SUBST($1_SRC_DI
1f720 52 29 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54  R)..    AC_SUBST
1f730 28 24 31 5f 4c 49 42 5f 46 49 4c 45 29 0a 20 20  ($1_LIB_FILE).  
1f740 20 20 41 43 5f 53 55 42 53 54 28 24 31 5f 4c 49    AC_SUBST($1_LI
1f750 42 5f 53 50 45 43 29 0a 0a 20 20 20 20 41 43 5f  B_SPEC)..    AC_
1f760 53 55 42 53 54 28 24 31 5f 53 54 55 42 5f 4c 49  SUBST($1_STUB_LI
1f770 42 5f 46 49 4c 45 29 0a 20 20 20 20 41 43 5f 53  B_FILE).    AC_S
1f780 55 42 53 54 28 24 31 5f 53 54 55 42 5f 4c 49 42  UBST($1_STUB_LIB
1f790 5f 53 50 45 43 29 0a 20 20 20 20 41 43 5f 53 55  _SPEC).    AC_SU
1f7a0 42 53 54 28 24 31 5f 53 54 55 42 5f 4c 49 42 5f  BST($1_STUB_LIB_
1f7b0 50 41 54 48 29 0a 0a 20 20 20 20 23 20 41 6c 6c  PATH)..    # All
1f7c0 6f 77 20 74 68 65 20 63 61 6c 6c 65 72 20 74 6f  ow the caller to
1f7d0 20 70 72 65 76 65 6e 74 20 74 68 69 73 20 61 75   prevent this au
1f7e0 74 6f 2d 63 68 65 63 6b 20 62 79 20 73 70 65 63  to-check by spec
1f7f0 69 66 79 69 6e 67 20 61 6e 79 20 32 6e 64 20 61  ifying any 2nd a
1f800 72 67 0a 20 20 20 20 41 53 5f 49 46 28 5b 74 65  rg.    AS_IF([te
1f810 73 74 20 22 78 24 32 22 20 3d 20 78 5d 2c 20 5b  st "x$2" = x], [
1f820 0a 09 23 20 43 68 65 63 6b 20 62 6f 74 68 20 75  ..# Check both u
1f830 70 70 65 72 20 61 6e 64 20 6c 6f 77 65 72 2d 63  pper and lower-c
1f840 61 73 65 20 76 61 72 69 61 6e 74 73 0a 09 23 20  ase variants..# 
1f850 49 66 20 61 20 64 65 76 20 77 61 6e 74 65 64 20  If a dev wanted 
1f860 6e 6f 6e 2d 73 74 75 62 73 20 6c 69 62 73 2c 20  non-stubs libs, 
1f870 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 63 6f  this function co
1f880 75 6c 64 20 74 61 6b 65 20 61 6e 20 6f 70 74 69  uld take an opti
1f890 6f 6e 0a 09 23 20 74 6f 20 6e 6f 74 20 75 73 65  on..# to not use
1f8a0 20 5f 53 54 55 42 20 69 6e 20 74 68 65 20 70 61   _STUB in the pa
1f8b0 74 68 73 20 62 65 6c 6f 77 0a 09 41 53 5f 49 46  ths below..AS_IF
1f8c0 28 5b 74 65 73 74 20 22 78 24 7b 24 31 5f 53 54  ([test "x${$1_ST
1f8d0 55 42 5f 4c 49 42 5f 53 50 45 43 7d 22 20 3d 20  UB_LIB_SPEC}" = 
1f8e0 78 5d 2c 0a 09 20 20 20 20 5b 54 45 41 5f 4c 4f  x],..    [TEA_LO
1f8f0 41 44 5f 43 4f 4e 46 49 47 5f 4c 49 42 28 74 72  AD_CONFIG_LIB(tr
1f900 61 6e 73 6c 69 74 28 24 31 2c 5b 61 2d 7a 5d 2c  anslit($1,[a-z],
1f910 5b 41 2d 5a 5d 29 5f 53 54 55 42 29 5d 2c 0a 09  [A-Z])_STUB)],..
1f920 20 20 20 20 5b 54 45 41 5f 4c 4f 41 44 5f 43 4f      [TEA_LOAD_CO
1f930 4e 46 49 47 5f 4c 49 42 28 24 31 5f 53 54 55 42  NFIG_LIB($1_STUB
1f940 29 5d 29 0a 20 20 20 20 5d 29 0a 5d 29 0a 0a 23  )]).    ]).])..#
1f950 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f960 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f970 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f980 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f990 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 45 41 5f 4c  --------.# TEA_L
1f9a0 4f 41 44 5f 43 4f 4e 46 49 47 5f 4c 49 42 20 2d  OAD_CONFIG_LIB -
1f9b0 2d 0a 23 0a 23 09 48 65 6c 70 65 72 20 66 75 6e  -.#.#.Helper fun
1f9c0 63 74 69 6f 6e 20 74 6f 20 6c 6f 61 64 20 63 6f  ction to load co
1f9d0 72 72 65 63 74 20 6c 69 62 72 61 72 79 20 66 72  rrect library fr
1f9e0 6f 6d 20 61 6e 6f 74 68 65 72 20 65 78 74 65 6e  om another exten
1f9f0 73 69 6f 6e 27 73 0a 23 09 24 7b 50 41 43 4b 41  sion's.#.${PACKA
1fa00 47 45 7d 43 6f 6e 66 69 67 2e 73 68 2e 0a 23 0a  GE}Config.sh..#.
1fa10 23 20 52 65 73 75 6c 74 73 3a 0a 23 09 41 64 64  # Results:.#.Add
1fa20 73 20 74 6f 20 4c 49 42 53 20 74 68 65 20 61 70  s to LIBS the ap
1fa30 70 72 6f 70 72 69 61 74 65 20 65 78 74 65 6e 73  propriate extens
1fa40 69 6f 6e 20 6c 69 62 72 61 72 79 0a 23 2d 2d 2d  ion library.#---
1fa50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fa60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fa70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fa80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fa90 2d 2d 2d 2d 2d 0a 41 43 5f 44 45 46 55 4e 28 5b  -----.AC_DEFUN([
1faa0 54 45 41 5f 4c 4f 41 44 5f 43 4f 4e 46 49 47 5f  TEA_LOAD_CONFIG_
1fab0 4c 49 42 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d  LIB], [.    AC_M
1fac0 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 46 6f 72  SG_CHECKING([For
1fad0 20 24 31 20 6c 69 62 72 61 72 79 20 66 6f 72 20   $1 library for 
1fae0 4c 49 42 53 5d 29 0a 20 20 20 20 23 20 54 68 69  LIBS]).    # Thi
1faf0 73 20 73 69 6d 70 6c 69 66 69 65 73 20 74 68 65  s simplifies the
1fb00 20 75 73 65 20 6f 66 20 73 74 75 62 20 6c 69 62   use of stub lib
1fb10 72 61 72 69 65 73 20 62 79 20 61 75 74 6f 6d 61  raries by automa
1fb20 74 69 63 61 6c 6c 79 20 61 64 64 69 6e 67 0a 20  tically adding. 
1fb30 20 20 20 23 20 74 68 65 20 73 74 75 62 20 6c 69     # the stub li
1fb40 62 20 74 6f 20 79 6f 75 72 20 70 61 74 68 2e 20  b to your path. 
1fb50 20 4e 6f 72 6d 61 6c 6c 79 20 74 68 69 73 20 77   Normally this w
1fb60 6f 75 6c 64 20 61 64 64 20 74 6f 20 53 48 4c 49  ould add to SHLI
1fb70 42 5f 4c 44 5f 4c 49 42 53 2c 0a 20 20 20 20 23  B_LD_LIBS,.    #
1fb80 20 62 75 74 20 74 68 69 73 20 69 73 20 63 61 6c   but this is cal
1fb90 6c 65 64 20 62 65 66 6f 72 65 20 43 4f 4e 46 49  led before CONFI
1fba0 47 5f 43 46 4c 41 47 53 2e 20 20 4d 6f 72 65 20  G_CFLAGS.  More 
1fbb0 69 6d 70 6f 72 74 61 6e 74 6c 79 2c 20 74 68 69  importantly, thi
1fbc0 73 20 61 64 64 73 0a 20 20 20 20 23 20 74 6f 20  s adds.    # to 
1fbd0 50 4b 47 5f 4c 49 42 53 2c 20 77 68 69 63 68 20  PKG_LIBS, which 
1fbe0 62 65 63 6f 6d 65 73 20 4c 49 42 53 2c 20 61 6e  becomes LIBS, an
1fbf0 64 20 74 68 61 74 20 69 73 20 6f 6e 6c 79 20 75  d that is only u
1fc00 73 65 64 20 62 79 20 53 48 4c 49 42 5f 4c 44 2e  sed by SHLIB_LD.
1fc10 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 78 24  .    if test "x$
1fc20 7b 24 31 5f 4c 49 42 5f 53 50 45 43 7d 22 20 21  {$1_LIB_SPEC}" !
1fc30 3d 20 22 78 22 20 3b 20 74 68 65 6e 0a 09 69 66  = "x" ; then..if
1fc40 20 74 65 73 74 20 22 24 7b 54 45 41 5f 50 4c 41   test "${TEA_PLA
1fc50 54 46 4f 52 4d 7d 22 20 3d 20 22 77 69 6e 64 6f  TFORM}" = "windo
1fc60 77 73 22 20 2d 61 20 22 24 47 43 43 22 20 21 3d  ws" -a "$GCC" !=
1fc70 20 22 79 65 73 22 20 3b 20 74 68 65 6e 0a 09 20   "yes" ; then.. 
1fc80 20 20 20 54 45 41 5f 41 44 44 5f 4c 49 42 53 28     TEA_ADD_LIBS(
1fc90 5b 5c 22 60 24 7b 43 59 47 50 41 54 48 7d 20 24  [\"`${CYGPATH} $
1fca0 7b 24 31 5f 4c 49 42 5f 50 41 54 48 7d 60 5c 22  {$1_LIB_PATH}`\"
1fcb0 5d 29 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52  ])..    AC_MSG_R
1fcc0 45 53 55 4c 54 28 5b 75 73 69 6e 67 20 24 31 5f  ESULT([using $1_
1fcd0 4c 49 42 5f 50 41 54 48 20 24 7b 24 31 5f 4c 49  LIB_PATH ${$1_LI
1fce0 42 5f 50 41 54 48 7d 5d 29 0a 09 65 6c 73 65 0a  B_PATH}])..else.
1fcf0 09 20 20 20 20 54 45 41 5f 41 44 44 5f 4c 49 42  .    TEA_ADD_LIB
1fd00 53 28 5b 24 7b 24 31 5f 4c 49 42 5f 53 50 45 43  S([${$1_LIB_SPEC
1fd10 7d 5d 29 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f  }])..    AC_MSG_
1fd20 52 45 53 55 4c 54 28 5b 75 73 69 6e 67 20 24 31  RESULT([using $1
1fd30 5f 4c 49 42 5f 53 50 45 43 20 24 7b 24 31 5f 4c  _LIB_SPEC ${$1_L
1fd40 49 42 5f 53 50 45 43 7d 5d 29 0a 09 66 69 0a 20  IB_SPEC}])..fi. 
1fd50 20 20 20 65 6c 73 65 0a 09 41 43 5f 4d 53 47 5f     else..AC_MSG_
1fd60 52 45 53 55 4c 54 28 5b 66 69 6c 65 20 6e 6f 74  RESULT([file not
1fd70 20 66 6f 75 6e 64 5d 29 0a 20 20 20 20 66 69 0a   found]).    fi.
1fd80 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ])..#-----------
1fd90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fda0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fdb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fdc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
1fdd0 54 45 41 5f 45 58 50 4f 52 54 5f 43 4f 4e 46 49  TEA_EXPORT_CONFI
1fde0 47 20 2d 2d 0a 23 0a 23 09 44 65 66 69 6e 65 20  G --.#.#.Define 
1fdf0 74 68 65 20 64 61 74 61 20 74 6f 20 69 6e 73 65  the data to inse
1fe00 72 74 20 69 6e 74 6f 20 74 68 65 20 24 7b 50 41  rt into the ${PA
1fe10 43 4b 41 47 45 7d 43 6f 6e 66 69 67 2e 73 68 20  CKAGE}Config.sh 
1fe20 66 69 6c 65 0a 23 0a 23 20 41 72 67 75 6d 65 6e  file.#.# Argumen
1fe30 74 73 3a 0a 23 0a 23 09 52 65 71 75 69 72 65 73  ts:.#.#.Requires
1fe40 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76   the following v
1fe50 61 72 73 20 74 6f 20 62 65 20 73 65 74 3a 0a 23  ars to be set:.#
1fe60 09 09 24 31 0a 23 0a 23 20 52 65 73 75 6c 74 73  ..$1.#.# Results
1fe70 3a 0a 23 09 53 75 62 73 74 69 74 75 74 65 73 20  :.#.Substitutes 
1fe80 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
1fe90 72 73 3a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  rs:.#-----------
1fea0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1feb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fec0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fed0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41  -------------..A
1fee0 43 5f 44 45 46 55 4e 28 5b 54 45 41 5f 45 58 50  C_DEFUN([TEA_EXP
1fef0 4f 52 54 5f 43 4f 4e 46 49 47 5d 2c 20 5b 0a 20  ORT_CONFIG], [. 
1ff00 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
1ff10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ff20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ff30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ff40 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54  --------.    # T
1ff50 68 65 73 65 20 61 72 65 20 66 6f 72 20 24 31 43  hese are for $1C
1ff60 6f 6e 66 69 67 2e 73 68 0a 20 20 20 20 23 2d 2d  onfig.sh.    #--
1ff70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ff80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ff90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ffa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ffb0 2d 2d 0a 0a 20 20 20 20 23 20 70 6b 67 6c 69 62  --..    # pkglib
1ffc0 64 69 72 20 6d 75 73 74 20 62 65 20 61 20 66 75  dir must be a fu
1ffd0 6c 6c 79 20 71 75 61 6c 69 66 69 65 64 20 70 61  lly qualified pa
1ffe0 74 68 20 61 6e 64 20 28 6e 6f 74 20 24 7b 65 78  th and (not ${ex
1fff0 65 63 5f 70 72 65 66 69 78 7d 2f 6c 69 62 29 0a  ec_prefix}/lib).
20000 20 20 20 20 65 76 61 6c 20 70 6b 67 6c 69 62 64      eval pkglibd
20010 69 72 3d 22 5b 24 5d 7b 6c 69 62 64 69 72 7d 2f  ir="[$]{libdir}/
20020 24 31 24 7b 50 41 43 4b 41 47 45 5f 56 45 52 53  $1${PACKAGE_VERS
20030 49 4f 4e 7d 22 0a 20 20 20 20 69 66 20 74 65 73  ION}".    if tes
20040 74 20 22 24 7b 54 43 4c 5f 4c 49 42 5f 56 45 52  t "${TCL_LIB_VER
20050 53 49 4f 4e 53 5f 4f 4b 7d 22 20 3d 20 22 6f 6b  SIONS_OK}" = "ok
20060 22 3b 20 74 68 65 6e 0a 09 65 76 61 6c 20 24 31  "; then..eval $1
20070 5f 4c 49 42 5f 46 4c 41 47 3d 22 2d 6c 24 31 24  _LIB_FLAG="-l$1$
20080 7b 50 41 43 4b 41 47 45 5f 56 45 52 53 49 4f 4e  {PACKAGE_VERSION
20090 7d 24 7b 44 42 47 58 7d 22 0a 09 65 76 61 6c 20  }${DBGX}"..eval 
200a0 24 31 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47  $1_STUB_LIB_FLAG
200b0 3d 22 2d 6c 24 31 73 74 75 62 24 7b 50 41 43 4b  ="-l$1stub${PACK
200c0 41 47 45 5f 56 45 52 53 49 4f 4e 7d 24 7b 44 42  AGE_VERSION}${DB
200d0 47 58 7d 22 0a 20 20 20 20 65 6c 73 65 0a 09 65  GX}".    else..e
200e0 76 61 6c 20 24 31 5f 4c 49 42 5f 46 4c 41 47 3d  val $1_LIB_FLAG=
200f0 22 2d 6c 24 31 60 65 63 68 6f 20 24 7b 50 41 43  "-l$1`echo ${PAC
20100 4b 41 47 45 5f 56 45 52 53 49 4f 4e 7d 20 7c 20  KAGE_VERSION} | 
20110 74 72 20 2d 64 20 2e 60 24 7b 44 42 47 58 7d 22  tr -d .`${DBGX}"
20120 0a 09 65 76 61 6c 20 24 31 5f 53 54 55 42 5f 4c  ..eval $1_STUB_L
20130 49 42 5f 46 4c 41 47 3d 22 2d 6c 24 31 73 74 75  IB_FLAG="-l$1stu
20140 62 60 65 63 68 6f 20 24 7b 50 41 43 4b 41 47 45  b`echo ${PACKAGE
20150 5f 56 45 52 53 49 4f 4e 7d 20 7c 20 74 72 20 2d  _VERSION} | tr -
20160 64 20 2e 60 24 7b 44 42 47 58 7d 22 0a 20 20 20  d .`${DBGX}".   
20170 20 66 69 0a 20 20 20 20 24 31 5f 42 55 49 4c 44   fi.    $1_BUILD
20180 5f 4c 49 42 5f 53 50 45 43 3d 22 2d 4c 60 70 77  _LIB_SPEC="-L`pw
20190 64 60 20 24 7b 24 31 5f 4c 49 42 5f 46 4c 41 47  d` ${$1_LIB_FLAG
201a0 7d 22 0a 20 20 20 20 24 31 5f 4c 49 42 5f 53 50  }".    $1_LIB_SP
201b0 45 43 3d 22 2d 4c 24 7b 70 6b 67 6c 69 62 64 69  EC="-L${pkglibdi
201c0 72 7d 20 24 7b 24 31 5f 4c 49 42 5f 46 4c 41 47  r} ${$1_LIB_FLAG
201d0 7d 22 0a 20 20 20 20 24 31 5f 42 55 49 4c 44 5f  }".    $1_BUILD_
201e0 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 3d 22 2d  STUB_LIB_SPEC="-
201f0 4c 60 70 77 64 60 20 5b 24 5d 7b 24 31 5f 53 54  L`pwd` [$]{$1_ST
20200 55 42 5f 4c 49 42 5f 46 4c 41 47 7d 22 0a 20 20  UB_LIB_FLAG}".  
20210 20 20 24 31 5f 53 54 55 42 5f 4c 49 42 5f 53 50    $1_STUB_LIB_SP
20220 45 43 3d 22 2d 4c 24 7b 70 6b 67 6c 69 62 64 69  EC="-L${pkglibdi
20230 72 7d 20 5b 24 5d 7b 24 31 5f 53 54 55 42 5f 4c  r} [$]{$1_STUB_L
20240 49 42 5f 46 4c 41 47 7d 22 0a 20 20 20 20 24 31  IB_FLAG}".    $1
20250 5f 42 55 49 4c 44 5f 53 54 55 42 5f 4c 49 42 5f  _BUILD_STUB_LIB_
20260 50 41 54 48 3d 22 60 70 77 64 60 2f 5b 24 5d 7b  PATH="`pwd`/[$]{
20270 50 4b 47 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c  PKG_STUB_LIB_FIL
20280 45 7d 22 0a 20 20 20 20 24 31 5f 53 54 55 42 5f  E}".    $1_STUB_
20290 4c 49 42 5f 50 41 54 48 3d 22 24 7b 70 6b 67 6c  LIB_PATH="${pkgl
202a0 69 62 64 69 72 7d 2f 5b 24 5d 7b 50 4b 47 5f 53  ibdir}/[$]{PKG_S
202b0 54 55 42 5f 4c 49 42 5f 46 49 4c 45 7d 22 0a 0a  TUB_LIB_FILE}"..
202c0 20 20 20 20 41 43 5f 53 55 42 53 54 28 24 31 5f      AC_SUBST($1_
202d0 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43 29 0a  BUILD_LIB_SPEC).
202e0 20 20 20 20 41 43 5f 53 55 42 53 54 28 24 31 5f      AC_SUBST($1_
202f0 4c 49 42 5f 53 50 45 43 29 0a 20 20 20 20 41 43  LIB_SPEC).    AC
20300 5f 53 55 42 53 54 28 24 31 5f 42 55 49 4c 44 5f  _SUBST($1_BUILD_
20310 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 29 0a 20  STUB_LIB_SPEC). 
20320 20 20 20 41 43 5f 53 55 42 53 54 28 24 31 5f 53     AC_SUBST($1_S
20330 54 55 42 5f 4c 49 42 5f 53 50 45 43 29 0a 20 20  TUB_LIB_SPEC).  
20340 20 20 41 43 5f 53 55 42 53 54 28 24 31 5f 42 55    AC_SUBST($1_BU
20350 49 4c 44 5f 53 54 55 42 5f 4c 49 42 5f 50 41 54  ILD_STUB_LIB_PAT
20360 48 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  H).    AC_SUBST(
20370 24 31 5f 53 54 55 42 5f 4c 49 42 5f 50 41 54 48  $1_STUB_LIB_PATH
20380 29 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  )..    AC_SUBST(
20390 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 29 0a 20  MAJOR_VERSION). 
203a0 20 20 20 41 43 5f 53 55 42 53 54 28 4d 49 4e 4f     AC_SUBST(MINO
203b0 52 5f 56 45 52 53 49 4f 4e 29 0a 20 20 20 20 41  R_VERSION).    A
203c0 43 5f 53 55 42 53 54 28 50 41 54 43 48 4c 45 56  C_SUBST(PATCHLEV
203d0 45 4c 29 0a 5d 29 0a 0a 0a 23 2d 2d 2d 2d 2d 2d  EL).])...#------
203e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
203f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
20400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
20410 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
20420 2d 2d 0a 23 20 54 45 41 5f 50 41 54 48 5f 43 45  --.# TEA_PATH_CE
20430 4c 49 42 20 2d 2d 0a 23 0a 23 09 4c 6f 63 61 74  LIB --.#.#.Locat
20440 65 20 4b 65 75 63 68 65 6c 27 73 20 63 65 6c 69  e Keuchel's celi
20450 62 20 65 6d 75 6c 61 74 69 6f 6e 20 6c 61 79 65  b emulation laye
20460 72 20 66 6f 72 20 74 61 72 67 65 74 69 6e 67 20  r for targeting 
20470 57 69 6e 2f 43 45 0a 23 0a 23 20 41 72 67 75 6d  Win/CE.#.# Argum
20480 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23  ents:.#.none.#.#
20490 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 41 64   Results:.#.#.Ad
204a0 64 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ds the following
204b0 20 61 72 67 75 6d 65 6e 74 73 20 74 6f 20 63 6f   arguments to co
204c0 6e 66 69 67 75 72 65 3a 0a 23 09 09 2d 2d 77 69  nfigure:.#..--wi
204d0 74 68 2d 63 65 6c 69 62 3d 2e 2e 2e 0a 23 0a 23  th-celib=....#.#
204e0 09 44 65 66 69 6e 65 73 20 74 68 65 20 66 6f 6c  .Defines the fol
204f0 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
20500 43 45 4c 49 42 5f 44 49 52 09 46 75 6c 6c 20 70  CELIB_DIR.Full p
20510 61 74 68 20 74 6f 20 74 68 65 20 64 69 72 65 63  ath to the direc
20520 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 0a  tory containing.
20530 23 09 09 09 09 74 68 65 20 69 6e 63 6c 75 64 65  #....the include
20540 20 61 6e 64 20 70 6c 61 74 66 6f 72 6d 20 6c 69   and platform li
20550 62 20 66 69 6c 65 73 0a 23 2d 2d 2d 2d 2d 2d 2d  b files.#-------
20560 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
20570 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
20580 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
20590 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
205a0 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 45 41  -..AC_DEFUN([TEA
205b0 5f 50 41 54 48 5f 43 45 4c 49 42 5d 2c 20 5b 0a  _PATH_CELIB], [.
205c0 20 20 20 20 23 20 46 69 72 73 74 2c 20 6c 6f 6f      # First, loo
205d0 6b 20 66 6f 72 20 6f 6e 65 20 75 6e 69 6e 73 74  k for one uninst
205e0 61 6c 6c 65 64 2e 0a 20 20 20 20 23 20 74 68 65  alled..    # the
205f0 20 61 6c 74 65 72 6e 61 74 69 76 65 20 73 65 61   alternative sea
20600 72 63 68 20 64 69 72 65 63 74 6f 72 79 20 69 73  rch directory is
20610 20 69 6e 76 6f 6b 65 64 20 62 79 20 2d 2d 77 69   invoked by --wi
20620 74 68 2d 63 65 6c 69 62 0a 0a 20 20 20 20 69 66  th-celib..    if
20630 20 74 65 73 74 20 78 22 24 7b 6e 6f 5f 63 65 6c   test x"${no_cel
20640 69 62 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e 0a  ib}" = x ; then.
20650 09 23 20 77 65 20 72 65 73 65 74 20 6e 6f 5f 63  .# we reset no_c
20660 65 6c 69 62 20 69 6e 20 63 61 73 65 20 73 6f 6d  elib in case som
20670 65 74 68 69 6e 67 20 66 61 69 6c 73 20 68 65 72  ething fails her
20680 65 0a 09 6e 6f 5f 63 65 6c 69 62 3d 74 72 75 65  e..no_celib=true
20690 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 63 65  ..AC_ARG_WITH(ce
206a0 6c 69 62 2c 5b 20 20 2d 2d 77 69 74 68 2d 63 65  lib,[  --with-ce
206b0 6c 69 62 3d 44 49 52 20 20 20 20 20 20 20 20 75  lib=DIR        u
206c0 73 65 20 57 69 6e 64 6f 77 73 2f 43 45 20 73 75  se Windows/CE su
206d0 70 70 6f 72 74 20 6c 69 62 72 61 72 79 20 66 72  pport library fr
206e0 6f 6d 20 44 49 52 5d 2c 20 77 69 74 68 5f 63 65  om DIR], with_ce
206f0 6c 69 62 63 6f 6e 66 69 67 3d 24 7b 77 69 74 68  libconfig=${with
20700 76 61 6c 7d 29 0a 09 41 43 5f 4d 53 47 5f 43 48  val})..AC_MSG_CH
20710 45 43 4b 49 4e 47 28 5b 66 6f 72 20 57 69 6e 64  ECKING([for Wind
20720 6f 77 73 2f 43 45 20 63 65 6c 69 62 20 64 69 72  ows/CE celib dir
20730 65 63 74 6f 72 79 5d 29 0a 09 41 43 5f 43 41 43  ectory])..AC_CAC
20740 48 45 5f 56 41 4c 28 61 63 5f 63 76 5f 63 5f 63  HE_VAL(ac_cv_c_c
20750 65 6c 69 62 63 6f 6e 66 69 67 2c 5b 0a 09 20 20  elibconfig,[..  
20760 20 20 23 20 46 69 72 73 74 20 63 68 65 63 6b 20    # First check 
20770 74 6f 20 73 65 65 20 69 66 20 2d 2d 77 69 74 68  to see if --with
20780 2d 63 65 6c 69 62 63 6f 6e 66 69 67 20 77 61 73  -celibconfig was
20790 20 73 70 65 63 69 66 69 65 64 2e 0a 09 20 20 20   specified...   
207a0 20 69 66 20 74 65 73 74 20 78 22 24 7b 77 69 74   if test x"${wit
207b0 68 5f 63 65 6c 69 62 63 6f 6e 66 69 67 7d 22 20  h_celibconfig}" 
207c0 21 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 69 66  != x ; then...if
207d0 20 74 65 73 74 20 2d 64 20 22 24 7b 77 69 74 68   test -d "${with
207e0 5f 63 65 6c 69 62 63 6f 6e 66 69 67 7d 2f 69 6e  _celibconfig}/in
207f0 63 22 20 3b 20 74 68 65 6e 0a 09 09 20 20 20 20  c" ; then...    
20800 61 63 5f 63 76 5f 63 5f 63 65 6c 69 62 63 6f 6e  ac_cv_c_celibcon
20810 66 69 67 3d 60 28 63 64 20 24 7b 77 69 74 68 5f  fig=`(cd ${with_
20820 63 65 6c 69 62 63 6f 6e 66 69 67 7d 3b 20 70 77  celibconfig}; pw
20830 64 29 60 0a 09 09 65 6c 73 65 0a 09 09 20 20 20  d)`...else...   
20840 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 24   AC_MSG_ERROR([$
20850 7b 77 69 74 68 5f 63 65 6c 69 62 63 6f 6e 66 69  {with_celibconfi
20860 67 7d 20 64 69 72 65 63 74 6f 72 79 20 64 6f 65  g} directory doe
20870 73 6e 27 74 20 63 6f 6e 74 61 69 6e 20 69 6e 63  sn't contain inc
20880 20 64 69 72 65 63 74 6f 72 79 5d 29 0a 09 09 66   directory])...f
20890 69 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20  i..    fi...    
208a0 23 20 74 68 65 6e 20 63 68 65 63 6b 20 66 6f 72  # then check for
208b0 20 61 20 63 65 6c 69 62 20 6c 69 62 72 61 72 79   a celib library
208c0 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 78 22  ..    if test x"
208d0 24 7b 61 63 5f 63 76 5f 63 5f 63 65 6c 69 62 63  ${ac_cv_c_celibc
208e0 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68  onfig}" = x ; th
208f0 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 5c 0a  en...for i in \.
20900 09 09 09 2e 2e 2f 63 65 6c 69 62 2d 70 61 6c 6d  ...../celib-palm
20910 2d 33 2e 30 20 5c 0a 09 09 09 2e 2e 2f 63 65 6c  -3.0 \....../cel
20920 69 62 20 5c 0a 09 09 09 2e 2e 2f 2e 2e 2f 63 65  ib \....../../ce
20930 6c 69 62 2d 70 61 6c 6d 2d 33 2e 30 20 5c 0a 09  lib-palm-3.0 \..
20940 09 09 2e 2e 2f 2e 2e 2f 63 65 6c 69 62 20 5c 0a  ..../../celib \.
20950 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 63 65  ...`ls -dr ../ce
20960 6c 69 62 2d 2a 33 2e 5b 5b 30 2d 39 5d 5d 2a 20  lib-*3.[[0-9]]* 
20970 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09  2>/dev/null` \..
20980 09 09 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f 63  ..${srcdir}/../c
20990 65 6c 69 62 2d 70 61 6c 6d 2d 33 2e 30 20 5c 0a  elib-palm-3.0 \.
209a0 09 09 09 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f  ...${srcdir}/../
209b0 63 65 6c 69 62 20 5c 0a 09 09 09 60 6c 73 20 2d  celib \....`ls -
209c0 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f  dr ${srcdir}/../
209d0 63 65 6c 69 62 2d 2a 33 2e 5b 5b 30 2d 39 5d 5d  celib-*3.[[0-9]]
209e0 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  * 2>/dev/null` \
209f0 0a 09 09 09 3b 20 64 6f 0a 09 09 20 20 20 20 69  ....; do...    i
20a00 66 20 74 65 73 74 20 2d 64 20 22 24 69 2f 69 6e  f test -d "$i/in
20a10 63 22 20 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f  c" ; then....ac_
20a20 63 76 5f 63 5f 63 65 6c 69 62 63 6f 6e 66 69 67  cv_c_celibconfig
20a30 3d 60 28 63 64 20 24 69 3b 20 70 77 64 29 60 0a  =`(cd $i; pwd)`.
20a40 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20 20 66  ...break...    f
20a50 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20 66 69  i...done..    fi
20a60 0a 09 5d 29 0a 09 69 66 20 74 65 73 74 20 78 22  ..])..if test x"
20a70 24 7b 61 63 5f 63 76 5f 63 5f 63 65 6c 69 62 63  ${ac_cv_c_celibc
20a80 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68  onfig}" = x ; th
20a90 65 6e 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 45  en..    AC_MSG_E
20aa0 52 52 4f 52 28 5b 43 61 6e 6e 6f 74 20 66 69 6e  RROR([Cannot fin
20ab0 64 20 63 65 6c 69 62 20 73 75 70 70 6f 72 74 20  d celib support 
20ac0 6c 69 62 72 61 72 79 20 64 69 72 65 63 74 6f 72  library director
20ad0 79 5d 29 0a 09 65 6c 73 65 0a 09 20 20 20 20 6e  y])..else..    n
20ae0 6f 5f 63 65 6c 69 62 3d 0a 09 20 20 20 20 43 45  o_celib=..    CE
20af0 4c 49 42 5f 44 49 52 3d 24 7b 61 63 5f 63 76 5f  LIB_DIR=${ac_cv_
20b00 63 5f 63 65 6c 69 62 63 6f 6e 66 69 67 7d 0a 09  c_celibconfig}..
20b10 20 20 20 20 43 45 4c 49 42 5f 44 49 52 3d 60 65      CELIB_DIR=`e
20b20 63 68 6f 20 22 24 43 45 4c 49 42 5f 44 49 52 22  cho "$CELIB_DIR"
20b30 20 7c 20 73 65 64 20 2d 65 20 27 73 21 5c 5c 5c   | sed -e 's!\\\
20b40 21 2f 21 67 27 60 0a 09 20 20 20 20 41 43 5f 4d  !/!g'`..    AC_M
20b50 53 47 5f 52 45 53 55 4c 54 28 5b 66 6f 75 6e 64  SG_RESULT([found
20b60 20 24 43 45 4c 49 42 5f 44 49 52 5d 29 0a 09 66   $CELIB_DIR])..f
20b70 69 0a 20 20 20 20 66 69 0a 5d 29 0a 23 20 4c 6f  i.    fi.]).# Lo
20b80 63 61 6c 20 56 61 72 69 61 62 6c 65 73 3a 0a 23  cal Variables:.#
20b90 20 6d 6f 64 65 3a 20 61 75 74 6f 63 6f 6e 66 0a   mode: autoconf.
20ba0 23 20 45 6e 64 3a 0a                             # End:.