Tcl Source Code

Hex Artifact Content
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Artifact 67cc05d5acf1179a6dbbd82de022af019abcd4f0:


0000: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 50  ---------.# SC_P
0050: 41 54 48 5f 54 43 4c 43 4f 4e 46 49 47 20 2d 2d  ATH_TCLCONFIG --
0060: 0a 23 0a 23 09 4c 6f 63 61 74 65 20 74 68 65 20  .#.#.Locate the 
0070: 74 63 6c 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c  tclConfig.sh fil
0080: 65 20 61 6e 64 20 70 65 72 66 6f 72 6d 20 61 20  e and perform a 
0090: 73 61 6e 69 74 79 20 63 68 65 63 6b 20 6f 6e 0a  sanity check on.
00a0: 23 09 74 68 65 20 54 63 6c 20 63 6f 6d 70 69 6c  #.the Tcl compil
00b0: 65 20 66 6c 61 67 73 0a 23 0a 23 20 41 72 67 75  e flags.#.# Argu
00c0: 6d 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a  ments:.#.none.#.
00d0: 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 41  # Results:.#.#.A
00e0: 64 64 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e  dds the followin
00f0: 67 20 61 72 67 75 6d 65 6e 74 73 20 74 6f 20 63  g arguments to c
0100: 6f 6e 66 69 67 75 72 65 3a 0a 23 09 09 2d 2d 77  onfigure:.#..--w
0110: 69 74 68 2d 74 63 6c 3d 2e 2e 2e 0a 23 0a 23 09  ith-tcl=....#.#.
0120: 44 65 66 69 6e 65 73 20 74 68 65 20 66 6f 6c 6c  Defines the foll
0130: 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 54  owing vars:.#..T
0140: 43 4c 5f 42 49 4e 5f 44 49 52 09 46 75 6c 6c 20  CL_BIN_DIR.Full 
0150: 70 61 74 68 20 74 6f 20 74 68 65 20 64 69 72 65  path to the dire
0160: 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67  ctory containing
0170: 0a 23 09 09 09 09 74 68 65 20 74 63 6c 43 6f 6e  .#....the tclCon
0180: 66 69 67 2e 73 68 20 66 69 6c 65 0a 23 2d 2d 2d  fig.sh file.#---
0190: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
01d0: 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28  -----..AC_DEFUN(
01e0: 5b 53 43 5f 50 41 54 48 5f 54 43 4c 43 4f 4e 46  [SC_PATH_TCLCONF
01f0: 49 47 5d 2c 20 5b 0a 20 20 20 20 23 0a 20 20 20  IG], [.    #.   
0200: 20 23 20 4f 6b 2c 20 6c 65 74 73 20 66 69 6e 64   # Ok, lets find
0210: 20 74 68 65 20 74 63 6c 20 63 6f 6e 66 69 67 75   the tcl configu
0220: 72 61 74 69 6f 6e 0a 20 20 20 20 23 20 46 69 72  ration.    # Fir
0230: 73 74 2c 20 6c 6f 6f 6b 20 66 6f 72 20 6f 6e 65  st, look for one
0240: 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 0a 20 20   uninstalled..  
0250: 20 20 23 20 74 68 65 20 61 6c 74 65 72 6e 61 74    # the alternat
0260: 69 76 65 20 73 65 61 72 63 68 20 64 69 72 65 63  ive search direc
0270: 74 6f 72 79 20 69 73 20 69 6e 76 6f 6b 65 64 20  tory is invoked 
0280: 62 79 20 2d 2d 77 69 74 68 2d 74 63 6c 0a 20 20  by --with-tcl.  
0290: 20 20 23 0a 0a 20 20 20 20 69 66 20 74 65 73 74    #..    if test
02a0: 20 78 22 24 7b 6e 6f 5f 74 63 6c 7d 22 20 3d 20   x"${no_tcl}" = 
02b0: 78 20 3b 20 74 68 65 6e 0a 09 23 20 77 65 20 72  x ; then..# we r
02c0: 65 73 65 74 20 6e 6f 5f 74 63 6c 20 69 6e 20 63  eset no_tcl in c
02d0: 61 73 65 20 73 6f 6d 65 74 68 69 6e 67 20 66 61  ase something fa
02e0: 69 6c 73 20 68 65 72 65 0a 09 6e 6f 5f 74 63 6c  ils here..no_tcl
02f0: 3d 74 72 75 65 0a 09 41 43 5f 41 52 47 5f 57 49  =true..AC_ARG_WI
0300: 54 48 28 74 63 6c 2c 0a 09 20 20 20 20 41 43 5f  TH(tcl,..    AC_
0310: 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77  HELP_STRING([--w
0320: 69 74 68 2d 74 63 6c 5d 2c 0a 09 09 5b 64 69 72  ith-tcl],...[dir
0330: 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e  ectory containin
0340: 67 20 74 63 6c 20 63 6f 6e 66 69 67 75 72 61 74  g tcl configurat
0350: 69 6f 6e 20 28 74 63 6c 43 6f 6e 66 69 67 2e 73  ion (tclConfig.s
0360: 68 29 5d 29 2c 0a 09 20 20 20 20 77 69 74 68 5f  h)]),..    with_
0370: 74 63 6c 63 6f 6e 66 69 67 3d 22 24 7b 77 69 74  tclconfig="${wit
0380: 68 76 61 6c 7d 22 29 0a 09 41 43 5f 4d 53 47 5f  hval}")..AC_MSG_
0390: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 54 63  CHECKING([for Tc
03a0: 6c 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d  l configuration]
03b0: 29 0a 09 41 43 5f 43 41 43 48 45 5f 56 41 4c 28  )..AC_CACHE_VAL(
03c0: 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69  ac_cv_c_tclconfi
03d0: 67 2c 5b 0a 0a 09 20 20 20 20 23 20 46 69 72 73  g,[...    # Firs
03e0: 74 20 63 68 65 63 6b 20 74 6f 20 73 65 65 20 69  t check to see i
03f0: 66 20 2d 2d 77 69 74 68 2d 74 63 6c 20 77 61 73  f --with-tcl was
0400: 20 73 70 65 63 69 66 69 65 64 2e 0a 09 20 20 20   specified...   
0410: 20 69 66 20 74 65 73 74 20 78 22 24 7b 77 69 74   if test x"${wit
0420: 68 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20 21 3d  h_tclconfig}" !=
0430: 20 78 20 3b 20 74 68 65 6e 0a 09 09 63 61 73 65   x ; then...case
0440: 20 22 24 7b 77 69 74 68 5f 74 63 6c 63 6f 6e 66   "${with_tclconf
0450: 69 67 7d 22 20 69 6e 0a 09 09 20 20 20 20 2a 2f  ig}" in...    */
0460: 74 63 6c 43 6f 6e 66 69 67 2e 73 68 20 29 0a 09  tclConfig.sh )..
0470: 09 09 69 66 20 74 65 73 74 20 2d 66 20 22 24 7b  ..if test -f "${
0480: 77 69 74 68 5f 74 63 6c 63 6f 6e 66 69 67 7d 22  with_tclconfig}"
0490: 3b 20 74 68 65 6e 0a 09 09 09 20 20 20 20 41 43  ; then....    AC
04a0: 5f 4d 53 47 5f 57 41 52 4e 28 5b 2d 2d 77 69 74  _MSG_WARN([--wit
04b0: 68 2d 74 63 6c 20 61 72 67 75 6d 65 6e 74 20 73  h-tcl argument s
04c0: 68 6f 75 6c 64 20 72 65 66 65 72 20 74 6f 20 64  hould refer to d
04d0: 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e  irectory contain
04e0: 69 6e 67 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68  ing tclConfig.sh
04f0: 2c 20 6e 6f 74 20 74 6f 20 74 63 6c 43 6f 6e 66  , not to tclConf
0500: 69 67 2e 73 68 20 69 74 73 65 6c 66 5d 29 0a 09  ig.sh itself])..
0510: 09 09 20 20 20 20 77 69 74 68 5f 74 63 6c 63 6f  ..    with_tclco
0520: 6e 66 69 67 3d 22 60 65 63 68 6f 20 22 24 7b 77  nfig="`echo "${w
0530: 69 74 68 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20  ith_tclconfig}" 
0540: 7c 20 73 65 64 20 27 73 21 2f 74 63 6c 43 6f 6e  | sed 's!/tclCon
0550: 66 69 67 5c 2e 73 68 24 21 21 27 60 22 0a 09 09  fig\.sh$!!'`"...
0560: 09 66 69 20 3b 3b 0a 09 09 65 73 61 63 0a 09 09  .fi ;;...esac...
0570: 69 66 20 74 65 73 74 20 2d 66 20 22 24 7b 77 69  if test -f "${wi
0580: 74 68 5f 74 63 6c 63 6f 6e 66 69 67 7d 2f 74 63  th_tclconfig}/tc
0590: 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68  lConfig.sh" ; th
05a0: 65 6e 0a 09 09 20 20 20 20 61 63 5f 63 76 5f 63  en...    ac_cv_c
05b0: 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 60 28 63 64  _tclconfig="`(cd
05c0: 20 22 24 7b 77 69 74 68 5f 74 63 6c 63 6f 6e 66   "${with_tclconf
05d0: 69 67 7d 22 3b 20 70 77 64 29 60 22 0a 09 09 65  ig}"; pwd)`"...e
05e0: 6c 73 65 0a 09 09 20 20 20 20 41 43 5f 4d 53 47  lse...    AC_MSG
05f0: 5f 45 52 52 4f 52 28 5b 24 7b 77 69 74 68 5f 74  _ERROR([${with_t
0600: 63 6c 63 6f 6e 66 69 67 7d 20 64 69 72 65 63 74  clconfig} direct
0610: 6f 72 79 20 64 6f 65 73 6e 27 74 20 63 6f 6e 74  ory doesn't cont
0620: 61 69 6e 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68  ain tclConfig.sh
0630: 5d 29 0a 09 09 66 69 0a 09 20 20 20 20 66 69 0a  ])...fi..    fi.
0640: 0a 09 20 20 20 20 23 20 74 68 65 6e 20 63 68 65  ..    # then che
0650: 63 6b 20 66 6f 72 20 61 20 70 72 69 76 61 74 65  ck for a private
0660: 20 54 63 6c 20 69 6e 73 74 61 6c 6c 61 74 69 6f   Tcl installatio
0670: 6e 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 78  n..    if test x
0680: 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f  "${ac_cv_c_tclco
0690: 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65  nfig}" = x ; the
06a0: 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20 5c 0a 09  n...for i in \..
06b0: 09 09 2e 2e 2f 74 63 6c 20 5c 0a 09 09 09 60 6c  ..../tcl \....`l
06c0: 73 20 2d 64 72 20 2e 2e 2f 74 63 6c 5b 5b 38 2d  s -dr ../tcl[[8-
06d0: 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d  9]].[[0-9]].[[0-
06e0: 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  9]]* 2>/dev/null
06f0: 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e  ` \....`ls -dr .
0700: 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30  ./tcl[[8-9]].[[0
0710: 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  -9]] 2>/dev/null
0720: 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e  ` \....`ls -dr .
0730: 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30  ./tcl[[8-9]].[[0
0740: 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c  -9]]* 2>/dev/nul
0750: 6c 60 20 5c 0a 09 09 09 2e 2e 2f 2e 2e 2f 74 63  l` \....../../tc
0760: 6c 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e  l \....`ls -dr .
0770: 2e 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e  ./../tcl[[8-9]].
0780: 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a  [[0-9]].[[0-9]]*
0790: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a   2>/dev/null` \.
07a0: 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e  ...`ls -dr ../..
07b0: 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d  /tcl[[8-9]].[[0-
07c0: 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  9]] 2>/dev/null`
07d0: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e   \....`ls -dr ..
07e0: 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b  /../tcl[[8-9]].[
07f0: 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e  [0-9]]* 2>/dev/n
0800: 75 6c 6c 60 20 5c 0a 09 09 09 2e 2e 2f 2e 2e 2f  ull` \....../../
0810: 2e 2e 2f 74 63 6c 20 5c 0a 09 09 09 60 6c 73 20  ../tcl \....`ls 
0820: 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 63 6c  -dr ../../../tcl
0830: 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e  [[8-9]].[[0-9]].
0840: 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f  [[0-9]]* 2>/dev/
0850: 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d  null` \....`ls -
0860: 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 63 6c 5b  dr ../../../tcl[
0870: 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 32  [8-9]].[[0-9]] 2
0880: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
0890: 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e  .`ls -dr ../../.
08a0: 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30  ./tcl[[8-9]].[[0
08b0: 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c  -9]]* 2>/dev/nul
08c0: 6c 60 20 3b 20 64 6f 0a 09 09 20 20 20 20 69 66  l` ; do...    if
08d0: 20 74 65 73 74 20 2d 66 20 22 24 69 2f 75 6e 69   test -f "$i/uni
08e0: 78 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20  x/tclConfig.sh" 
08f0: 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f  ; then....ac_cv_
0900: 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 60 28 63  c_tclconfig="`(c
0910: 64 20 24 69 2f 75 6e 69 78 3b 20 70 77 64 29 60  d $i/unix; pwd)`
0920: 22 0a 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20  "....break...   
0930: 20 66 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20   fi...done..    
0940: 66 69 0a 0a 09 20 20 20 20 23 20 6f 6e 20 44 61  fi...    # on Da
0950: 72 77 69 6e 2c 20 63 68 65 63 6b 20 69 6e 20 46  rwin, check in F
0960: 72 61 6d 65 77 6f 72 6b 20 69 6e 73 74 61 6c 6c  ramework install
0970: 61 74 69 6f 6e 20 6c 6f 63 61 74 69 6f 6e 73 0a  ation locations.
0980: 09 20 20 20 20 69 66 20 74 65 73 74 20 22 60 75  .    if test "`u
0990: 6e 61 6d 65 20 2d 73 60 22 20 3d 20 22 44 61 72  name -s`" = "Dar
09a0: 77 69 6e 22 20 2d 61 20 78 22 24 7b 61 63 5f 63  win" -a x"${ac_c
09b0: 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20  v_c_tclconfig}" 
09c0: 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 66 6f 72  = x ; then...for
09d0: 20 69 20 69 6e 20 60 6c 73 20 2d 64 20 7e 2f 4c   i in `ls -d ~/L
09e0: 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b  ibrary/Framework
09f0: 73 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  s 2>/dev/null` \
0a00: 0a 09 09 09 60 6c 73 20 2d 64 20 2f 4c 69 62 72  ....`ls -d /Libr
0a10: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 20 32  ary/Frameworks 2
0a20: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
0a30: 09 60 6c 73 20 2d 64 20 2f 4e 65 74 77 6f 72 6b  .`ls -d /Network
0a40: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f  /Library/Framewo
0a50: 72 6b 73 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  rks 2>/dev/null`
0a60: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 53 79   \....`ls -d /Sy
0a70: 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61  stem/Library/Fra
0a80: 6d 65 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f 6e  meworks 2>/dev/n
0a90: 75 6c 6c 60 20 5c 0a 09 09 09 3b 20 64 6f 0a 09  ull` \....; do..
0aa0: 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20  .    if test -f 
0ab0: 22 24 69 2f 54 63 6c 2e 66 72 61 6d 65 77 6f 72  "$i/Tcl.framewor
0ac0: 6b 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20  k/tclConfig.sh" 
0ad0: 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f  ; then....ac_cv_
0ae0: 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 60 28 63  c_tclconfig="`(c
0af0: 64 20 24 69 2f 54 63 6c 2e 66 72 61 6d 65 77 6f  d $i/Tcl.framewo
0b00: 72 6b 3b 20 70 77 64 29 60 22 0a 09 09 09 62 72  rk; pwd)`"....br
0b10: 65 61 6b 0a 09 09 20 20 20 20 66 69 0a 09 09 64  eak...    fi...d
0b20: 6f 6e 65 0a 09 20 20 20 20 66 69 0a 0a 09 20 20  one..    fi...  
0b30: 20 20 23 20 63 68 65 63 6b 20 69 6e 20 61 20 66    # check in a f
0b40: 65 77 20 63 6f 6d 6d 6f 6e 20 69 6e 73 74 61 6c  ew common instal
0b50: 6c 20 6c 6f 63 61 74 69 6f 6e 73 0a 09 20 20 20  l locations..   
0b60: 20 69 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f   if test x"${ac_
0b70: 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 7d 22  cv_c_tclconfig}"
0b80: 20 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 66 6f   = x ; then...fo
0b90: 72 20 69 20 69 6e 20 60 6c 73 20 2d 64 20 24 7b  r i in `ls -d ${
0ba0: 6c 69 62 64 69 72 7d 20 32 3e 2f 64 65 76 2f 6e  libdir} 2>/dev/n
0bb0: 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64  ull` \....`ls -d
0bc0: 20 24 7b 65 78 65 63 5f 70 72 65 66 69 78 7d 2f   ${exec_prefix}/
0bd0: 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  lib 2>/dev/null`
0be0: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 24 7b 70   \....`ls -d ${p
0bf0: 72 65 66 69 78 7d 2f 6c 69 62 20 32 3e 2f 64 65  refix}/lib 2>/de
0c00: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73  v/null` \....`ls
0c10: 20 2d 64 20 2f 75 73 72 2f 6c 6f 63 61 6c 2f 6c   -d /usr/local/l
0c20: 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ib 2>/dev/null` 
0c30: 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72  \....`ls -d /usr
0c40: 2f 63 6f 6e 74 72 69 62 2f 6c 69 62 20 32 3e 2f  /contrib/lib 2>/
0c50: 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60  dev/null` \....`
0c60: 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62 20 32  ls -d /usr/lib 2
0c70: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09  >/dev/null` \...
0c80: 09 60 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62  .`ls -d /usr/lib
0c90: 36 34 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  64 2>/dev/null` 
0ca0: 5c 0a 09 09 09 3b 20 64 6f 0a 09 09 20 20 20 20  \....; do...    
0cb0: 69 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 74  if test -f "$i/t
0cc0: 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74  clConfig.sh" ; t
0cd0: 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f 74  hen....ac_cv_c_t
0ce0: 63 6c 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 24  clconfig="`(cd $
0cf0: 69 3b 20 70 77 64 29 60 22 0a 09 09 09 62 72 65  i; pwd)`"....bre
0d00: 61 6b 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f  ak...    fi...do
0d10: 6e 65 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20  ne..    fi...   
0d20: 20 23 20 63 68 65 63 6b 20 69 6e 20 61 20 66 65   # check in a fe
0d30: 77 20 6f 74 68 65 72 20 70 72 69 76 61 74 65 20  w other private 
0d40: 6c 6f 63 61 74 69 6f 6e 73 0a 09 20 20 20 20 69  locations..    i
0d50: 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f 63 76  f test x"${ac_cv
0d60: 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20 3d  _c_tclconfig}" =
0d70: 20 78 20 3b 20 74 68 65 6e 0a 09 09 66 6f 72 20   x ; then...for 
0d80: 69 20 69 6e 20 5c 0a 09 09 09 24 7b 73 72 63 64  i in \....${srcd
0d90: 69 72 7d 2f 2e 2e 2f 74 63 6c 20 5c 0a 09 09 09  ir}/../tcl \....
0da0: 60 6c 73 20 2d 64 72 20 24 7b 73 72 63 64 69 72  `ls -dr ${srcdir
0db0: 7d 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e  }/../tcl[[8-9]].
0dc0: 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a  [[0-9]].[[0-9]]*
0dd0: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a   2>/dev/null` \.
0de0: 09 09 09 60 6c 73 20 2d 64 72 20 24 7b 73 72 63  ...`ls -dr ${src
0df0: 64 69 72 7d 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39  dir}/../tcl[[8-9
0e00: 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65  ]].[[0-9]] 2>/de
0e10: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73  v/null` \....`ls
0e20: 20 2d 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e   -dr ${srcdir}/.
0e30: 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30  ./tcl[[8-9]].[[0
0e40: 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c  -9]]* 2>/dev/nul
0e50: 6c 60 20 3b 20 64 6f 0a 09 09 20 20 20 20 69 66  l` ; do...    if
0e60: 20 74 65 73 74 20 2d 66 20 22 24 69 2f 75 6e 69   test -f "$i/uni
0e70: 78 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20  x/tclConfig.sh" 
0e80: 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63 76 5f  ; then....ac_cv_
0e90: 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 60 28 63  c_tclconfig="`(c
0ea0: 64 20 24 69 2f 75 6e 69 78 3b 20 70 77 64 29 60  d $i/unix; pwd)`
0eb0: 22 0a 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20  "....break...   
0ec0: 20 66 69 0a 09 09 64 6f 6e 65 0a 09 20 20 20 20   fi...done..    
0ed0: 66 69 0a 09 5d 29 0a 0a 09 69 66 20 74 65 73 74  fi..])...if test
0ee0: 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c   x"${ac_cv_c_tcl
0ef0: 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74  config}" = x ; t
0f00: 68 65 6e 0a 09 20 20 20 20 54 43 4c 5f 42 49 4e  hen..    TCL_BIN
0f10: 5f 44 49 52 3d 22 23 20 6e 6f 20 54 63 6c 20 63  _DIR="# no Tcl c
0f20: 6f 6e 66 69 67 73 20 66 6f 75 6e 64 22 0a 09 20  onfigs found".. 
0f30: 20 20 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28     AC_MSG_ERROR(
0f40: 5b 43 61 6e 27 74 20 66 69 6e 64 20 54 63 6c 20  [Can't find Tcl 
0f50: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 64 65  configuration de
0f60: 66 69 6e 69 74 69 6f 6e 73 2e 20 55 73 65 20 2d  finitions. Use -
0f70: 2d 77 69 74 68 2d 74 63 6c 20 74 6f 20 73 70 65  -with-tcl to spe
0f80: 63 69 66 79 20 61 20 64 69 72 65 63 74 6f 72 79  cify a directory
0f90: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 63 6c 43   containing tclC
0fa0: 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 65 6c 73 65  onfig.sh])..else
0fb0: 0a 09 20 20 20 20 6e 6f 5f 74 63 6c 3d 0a 09 20  ..    no_tcl=.. 
0fc0: 20 20 20 54 43 4c 5f 42 49 4e 5f 44 49 52 3d 22     TCL_BIN_DIR="
0fd0: 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e  ${ac_cv_c_tclcon
0fe0: 66 69 67 7d 22 0a 09 20 20 20 20 41 43 5f 4d 53  fig}"..    AC_MS
0ff0: 47 5f 52 45 53 55 4c 54 28 5b 66 6f 75 6e 64 20  G_RESULT([found 
1000: 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 74  ${TCL_BIN_DIR}/t
1010: 63 6c 43 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 66  clConfig.sh])..f
1020: 69 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d  i.    fi.])..#--
1030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1050: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1060: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1070: 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 50 41 54 48  ------.# SC_PATH
1080: 5f 54 4b 43 4f 4e 46 49 47 20 2d 2d 0a 23 0a 23  _TKCONFIG --.#.#
1090: 09 4c 6f 63 61 74 65 20 74 68 65 20 74 6b 43 6f  .Locate the tkCo
10a0: 6e 66 69 67 2e 73 68 20 66 69 6c 65 0a 23 0a 23  nfig.sh file.#.#
10b0: 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f   Arguments:.#.no
10c0: 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a  ne.#.# Results:.
10d0: 23 0a 23 09 41 64 64 73 20 74 68 65 20 66 6f 6c  #.#.Adds the fol
10e0: 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65 6e 74 73  lowing arguments
10f0: 20 74 6f 20 63 6f 6e 66 69 67 75 72 65 3a 0a 23   to configure:.#
1100: 09 09 2d 2d 77 69 74 68 2d 74 6b 3d 2e 2e 2e 0a  ..--with-tk=....
1110: 23 0a 23 09 44 65 66 69 6e 65 73 20 74 68 65 20  #.#.Defines the 
1120: 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a  following vars:.
1130: 23 09 09 54 4b 5f 42 49 4e 5f 44 49 52 09 46 75  #..TK_BIN_DIR.Fu
1140: 6c 6c 20 70 61 74 68 20 74 6f 20 74 68 65 20 64  ll path to the d
1150: 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e  irectory contain
1160: 69 6e 67 0a 23 09 09 09 09 74 68 65 20 74 6b 43  ing.#....the tkC
1170: 6f 6e 66 69 67 2e 73 68 20 66 69 6c 65 0a 23 2d  onfig.sh file.#-
1180: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1190: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11c0: 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55  -------..AC_DEFU
11d0: 4e 28 5b 53 43 5f 50 41 54 48 5f 54 4b 43 4f 4e  N([SC_PATH_TKCON
11e0: 46 49 47 5d 2c 20 5b 0a 20 20 20 20 23 0a 20 20  FIG], [.    #.  
11f0: 20 20 23 20 4f 6b 2c 20 6c 65 74 73 20 66 69 6e    # Ok, lets fin
1200: 64 20 74 68 65 20 74 6b 20 63 6f 6e 66 69 67 75  d the tk configu
1210: 72 61 74 69 6f 6e 0a 20 20 20 20 23 20 46 69 72  ration.    # Fir
1220: 73 74 2c 20 6c 6f 6f 6b 20 66 6f 72 20 6f 6e 65  st, look for one
1230: 20 75 6e 69 6e 73 74 61 6c 6c 65 64 2e 0a 20 20   uninstalled..  
1240: 20 20 23 20 74 68 65 20 61 6c 74 65 72 6e 61 74    # the alternat
1250: 69 76 65 20 73 65 61 72 63 68 20 64 69 72 65 63  ive search direc
1260: 74 6f 72 79 20 69 73 20 69 6e 76 6f 6b 65 64 20  tory is invoked 
1270: 62 79 20 2d 2d 77 69 74 68 2d 74 6b 0a 20 20 20  by --with-tk.   
1280: 20 23 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20   #..    if test 
1290: 78 22 24 7b 6e 6f 5f 74 6b 7d 22 20 3d 20 78 20  x"${no_tk}" = x 
12a0: 3b 20 74 68 65 6e 0a 09 23 20 77 65 20 72 65 73  ; then..# we res
12b0: 65 74 20 6e 6f 5f 74 6b 20 69 6e 20 63 61 73 65  et no_tk in case
12c0: 20 73 6f 6d 65 74 68 69 6e 67 20 66 61 69 6c 73   something fails
12d0: 20 68 65 72 65 0a 09 6e 6f 5f 74 6b 3d 74 72 75   here..no_tk=tru
12e0: 65 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 74  e..AC_ARG_WITH(t
12f0: 6b 2c 0a 09 20 20 20 20 41 43 5f 48 45 4c 50 5f  k,..    AC_HELP_
1300: 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 74  STRING([--with-t
1310: 6b 5d 2c 0a 09 09 5b 64 69 72 65 63 74 6f 72 79  k],...[directory
1320: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 6b 20 63   containing tk c
1330: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 28 74 6b  onfiguration (tk
1340: 43 6f 6e 66 69 67 2e 73 68 29 5d 29 2c 0a 09 20  Config.sh)]),.. 
1350: 20 20 20 77 69 74 68 5f 74 6b 63 6f 6e 66 69 67     with_tkconfig
1360: 3d 22 24 7b 77 69 74 68 76 61 6c 7d 22 29 0a 09  ="${withval}")..
1370: 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28  AC_MSG_CHECKING(
1380: 5b 66 6f 72 20 54 6b 20 63 6f 6e 66 69 67 75 72  [for Tk configur
1390: 61 74 69 6f 6e 5d 29 0a 09 41 43 5f 43 41 43 48  ation])..AC_CACH
13a0: 45 5f 56 41 4c 28 61 63 5f 63 76 5f 63 5f 74 6b  E_VAL(ac_cv_c_tk
13b0: 63 6f 6e 66 69 67 2c 5b 0a 0a 09 20 20 20 20 23  config,[...    #
13c0: 20 46 69 72 73 74 20 63 68 65 63 6b 20 74 6f 20   First check to 
13d0: 73 65 65 20 69 66 20 2d 2d 77 69 74 68 2d 74 6b  see if --with-tk
13e0: 63 6f 6e 66 69 67 20 77 61 73 20 73 70 65 63 69  config was speci
13f0: 66 69 65 64 2e 0a 09 20 20 20 20 69 66 20 74 65  fied...    if te
1400: 73 74 20 78 22 24 7b 77 69 74 68 5f 74 6b 63 6f  st x"${with_tkco
1410: 6e 66 69 67 7d 22 20 21 3d 20 78 20 3b 20 74 68  nfig}" != x ; th
1420: 65 6e 0a 09 09 63 61 73 65 20 22 24 7b 77 69 74  en...case "${wit
1430: 68 5f 74 6b 63 6f 6e 66 69 67 7d 22 20 69 6e 0a  h_tkconfig}" in.
1440: 09 09 20 20 20 20 2a 2f 74 6b 43 6f 6e 66 69 67  ..    */tkConfig
1450: 2e 73 68 20 29 0a 09 09 09 69 66 20 74 65 73 74  .sh )....if test
1460: 20 2d 66 20 22 24 7b 77 69 74 68 5f 74 6b 63 6f   -f "${with_tkco
1470: 6e 66 69 67 7d 22 3b 20 74 68 65 6e 0a 09 09 09  nfig}"; then....
1480: 20 20 20 20 41 43 5f 4d 53 47 5f 57 41 52 4e 28      AC_MSG_WARN(
1490: 5b 2d 2d 77 69 74 68 2d 74 6b 20 61 72 67 75 6d  [--with-tk argum
14a0: 65 6e 74 20 73 68 6f 75 6c 64 20 72 65 66 65 72  ent should refer
14b0: 20 74 6f 20 64 69 72 65 63 74 6f 72 79 20 63 6f   to directory co
14c0: 6e 74 61 69 6e 69 6e 67 20 74 6b 43 6f 6e 66 69  ntaining tkConfi
14d0: 67 2e 73 68 2c 20 6e 6f 74 20 74 6f 20 74 6b 43  g.sh, not to tkC
14e0: 6f 6e 66 69 67 2e 73 68 20 69 74 73 65 6c 66 5d  onfig.sh itself]
14f0: 29 0a 09 09 09 20 20 20 20 77 69 74 68 5f 74 6b  )....    with_tk
1500: 63 6f 6e 66 69 67 3d 22 60 65 63 68 6f 20 22 24  config="`echo "$
1510: 7b 77 69 74 68 5f 74 6b 63 6f 6e 66 69 67 7d 22  {with_tkconfig}"
1520: 20 7c 20 73 65 64 20 27 73 21 2f 74 6b 43 6f 6e   | sed 's!/tkCon
1530: 66 69 67 5c 2e 73 68 24 21 21 27 60 22 0a 09 09  fig\.sh$!!'`"...
1540: 09 66 69 20 3b 3b 0a 09 09 65 73 61 63 0a 09 09  .fi ;;...esac...
1550: 69 66 20 74 65 73 74 20 2d 66 20 22 24 7b 77 69  if test -f "${wi
1560: 74 68 5f 74 6b 63 6f 6e 66 69 67 7d 2f 74 6b 43  th_tkconfig}/tkC
1570: 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 6e  onfig.sh" ; then
1580: 0a 09 09 20 20 20 20 61 63 5f 63 76 5f 63 5f 74  ...    ac_cv_c_t
1590: 6b 63 6f 6e 66 69 67 3d 22 60 28 63 64 20 22 24  kconfig="`(cd "$
15a0: 7b 77 69 74 68 5f 74 6b 63 6f 6e 66 69 67 7d 22  {with_tkconfig}"
15b0: 3b 20 70 77 64 29 60 22 0a 09 09 65 6c 73 65 0a  ; pwd)`"...else.
15c0: 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 45 52 52  ..    AC_MSG_ERR
15d0: 4f 52 28 5b 24 7b 77 69 74 68 5f 74 6b 63 6f 6e  OR([${with_tkcon
15e0: 66 69 67 7d 20 64 69 72 65 63 74 6f 72 79 20 64  fig} directory d
15f0: 6f 65 73 6e 27 74 20 63 6f 6e 74 61 69 6e 20 74  oesn't contain t
1600: 6b 43 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 09 66  kConfig.sh])...f
1610: 69 0a 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20  i..    fi...    
1620: 23 20 74 68 65 6e 20 63 68 65 63 6b 20 66 6f 72  # then check for
1630: 20 61 20 70 72 69 76 61 74 65 20 54 6b 20 6c 69   a private Tk li
1640: 62 72 61 72 79 0a 09 20 20 20 20 69 66 20 74 65  brary..    if te
1650: 73 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74  st x"${ac_cv_c_t
1660: 6b 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20  kconfig}" = x ; 
1670: 74 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e 20  then...for i in 
1680: 5c 0a 09 09 09 2e 2e 2f 74 6b 20 5c 0a 09 09 09  \....../tk \....
1690: 60 6c 73 20 2d 64 72 20 2e 2e 2f 74 6b 5b 5b 38  `ls -dr ../tk[[8
16a0: 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30  -9]].[[0-9]].[[0
16b0: 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c  -9]]* 2>/dev/nul
16c0: 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20  l` \....`ls -dr 
16d0: 2e 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30  ../tk[[8-9]].[[0
16e0: 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  -9]] 2>/dev/null
16f0: 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e  ` \....`ls -dr .
1700: 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d  ./tk[[8-9]].[[0-
1710: 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  9]]* 2>/dev/null
1720: 60 20 5c 0a 09 09 09 2e 2e 2f 2e 2e 2f 74 6b 20  ` \....../../tk 
1730: 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f  \....`ls -dr ../
1740: 2e 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30  ../tk[[8-9]].[[0
1750: 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e  -9]].[[0-9]]* 2>
1760: 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09  /dev/null` \....
1770: 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 74 6b  `ls -dr ../../tk
1780: 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20  [[8-9]].[[0-9]] 
1790: 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09  2>/dev/null` \..
17a0: 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f  ..`ls -dr ../../
17b0: 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d  tk[[8-9]].[[0-9]
17c0: 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ]* 2>/dev/null` 
17d0: 5c 0a 09 09 09 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 6b  \....../../../tk
17e0: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e   \....`ls -dr ..
17f0: 2f 2e 2e 2f 2e 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d  /../../tk[[8-9]]
1800: 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d  .[[0-9]].[[0-9]]
1810: 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  * 2>/dev/null` \
1820: 0a 09 09 09 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e  ....`ls -dr ../.
1830: 2e 2f 2e 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b  ./../tk[[8-9]].[
1840: 5b 30 2d 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75  [0-9]] 2>/dev/nu
1850: 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72  ll` \....`ls -dr
1860: 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 6b 5b 5b 38 2d   ../../../tk[[8-
1870: 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f  9]].[[0-9]]* 2>/
1880: 64 65 76 2f 6e 75 6c 6c 60 20 3b 20 64 6f 0a 09  dev/null` ; do..
1890: 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20  .    if test -f 
18a0: 22 24 69 2f 75 6e 69 78 2f 74 6b 43 6f 6e 66 69  "$i/unix/tkConfi
18b0: 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09 09  g.sh" ; then....
18c0: 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69 67  ac_cv_c_tkconfig
18d0: 3d 22 60 28 63 64 20 24 69 2f 75 6e 69 78 3b 20  ="`(cd $i/unix; 
18e0: 70 77 64 29 60 22 0a 09 09 09 62 72 65 61 6b 0a  pwd)`"....break.
18f0: 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e 65 0a  ..    fi...done.
1900: 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 23 20  .    fi...    # 
1910: 6f 6e 20 44 61 72 77 69 6e 2c 20 63 68 65 63 6b  on Darwin, check
1920: 20 69 6e 20 46 72 61 6d 65 77 6f 72 6b 20 69 6e   in Framework in
1930: 73 74 61 6c 6c 61 74 69 6f 6e 20 6c 6f 63 61 74  stallation locat
1940: 69 6f 6e 73 0a 09 20 20 20 20 69 66 20 74 65 73  ions..    if tes
1950: 74 20 22 60 75 6e 61 6d 65 20 2d 73 60 22 20 3d  t "`uname -s`" =
1960: 20 22 44 61 72 77 69 6e 22 20 2d 61 20 78 22 24   "Darwin" -a x"$
1970: 7b 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69  {ac_cv_c_tkconfi
1980: 67 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e 0a 09  g}" = x ; then..
1990: 09 66 6f 72 20 69 20 69 6e 20 60 6c 73 20 2d 64  .for i in `ls -d
19a0: 20 7e 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65   ~/Library/Frame
19b0: 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f 6e 75 6c  works 2>/dev/nul
19c0: 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f  l` \....`ls -d /
19d0: 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72  Library/Framewor
19e0: 6b 73 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ks 2>/dev/null` 
19f0: 5c 0a 09 09 09 60 6c 73 20 2d 64 20 2f 4e 65 74  \....`ls -d /Net
1a00: 77 6f 72 6b 2f 4c 69 62 72 61 72 79 2f 46 72 61  work/Library/Fra
1a10: 6d 65 77 6f 72 6b 73 20 32 3e 2f 64 65 76 2f 6e  meworks 2>/dev/n
1a20: 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64  ull` \....`ls -d
1a30: 20 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79   /System/Library
1a40: 2f 46 72 61 6d 65 77 6f 72 6b 73 20 32 3e 2f 64  /Frameworks 2>/d
1a50: 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 3b 20  ev/null` \....; 
1a60: 64 6f 0a 09 09 20 20 20 20 69 66 20 74 65 73 74  do...    if test
1a70: 20 2d 66 20 22 24 69 2f 54 6b 2e 66 72 61 6d 65   -f "$i/Tk.frame
1a80: 77 6f 72 6b 2f 74 6b 43 6f 6e 66 69 67 2e 73 68  work/tkConfig.sh
1a90: 22 20 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63  " ; then....ac_c
1aa0: 76 5f 63 5f 74 6b 63 6f 6e 66 69 67 3d 22 60 28  v_c_tkconfig="`(
1ab0: 63 64 20 24 69 2f 54 6b 2e 66 72 61 6d 65 77 6f  cd $i/Tk.framewo
1ac0: 72 6b 3b 20 70 77 64 29 60 22 0a 09 09 09 62 72  rk; pwd)`"....br
1ad0: 65 61 6b 0a 09 09 20 20 20 20 66 69 0a 09 09 64  eak...    fi...d
1ae0: 6f 6e 65 0a 09 20 20 20 20 66 69 0a 0a 09 20 20  one..    fi...  
1af0: 20 20 23 20 63 68 65 63 6b 20 69 6e 20 61 20 66    # check in a f
1b00: 65 77 20 63 6f 6d 6d 6f 6e 20 69 6e 73 74 61 6c  ew common instal
1b10: 6c 20 6c 6f 63 61 74 69 6f 6e 73 0a 09 20 20 20  l locations..   
1b20: 20 69 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f   if test x"${ac_
1b30: 63 76 5f 63 5f 74 6b 63 6f 6e 66 69 67 7d 22 20  cv_c_tkconfig}" 
1b40: 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 66 6f 72  = x ; then...for
1b50: 20 69 20 69 6e 20 60 6c 73 20 2d 64 20 24 7b 6c   i in `ls -d ${l
1b60: 69 62 64 69 72 7d 20 32 3e 2f 64 65 76 2f 6e 75  ibdir} 2>/dev/nu
1b70: 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20 2d 64 20  ll` \....`ls -d 
1b80: 24 7b 65 78 65 63 5f 70 72 65 66 69 78 7d 2f 6c  ${exec_prefix}/l
1b90: 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20  ib 2>/dev/null` 
1ba0: 5c 0a 09 09 09 60 6c 73 20 2d 64 20 24 7b 70 72  \....`ls -d ${pr
1bb0: 65 66 69 78 7d 2f 6c 69 62 20 32 3e 2f 64 65 76  efix}/lib 2>/dev
1bc0: 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73 20  /null` \....`ls 
1bd0: 2d 64 20 2f 75 73 72 2f 6c 6f 63 61 6c 2f 6c 69  -d /usr/local/li
1be0: 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  b 2>/dev/null` \
1bf0: 0a 09 09 09 60 6c 73 20 2d 64 20 2f 75 73 72 2f  ....`ls -d /usr/
1c00: 63 6f 6e 74 72 69 62 2f 6c 69 62 20 32 3e 2f 64  contrib/lib 2>/d
1c10: 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c  ev/null` \....`l
1c20: 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62 20 32 3e  s -d /usr/lib 2>
1c30: 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09  /dev/null` \....
1c40: 60 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62 36  `ls -d /usr/lib6
1c50: 34 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c  4 2>/dev/null` \
1c60: 0a 09 09 09 3b 20 64 6f 0a 09 09 20 20 20 20 69  ....; do...    i
1c70: 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 74 6b  f test -f "$i/tk
1c80: 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65  Config.sh" ; the
1c90: 6e 0a 09 09 09 61 63 5f 63 76 5f 63 5f 74 6b 63  n....ac_cv_c_tkc
1ca0: 6f 6e 66 69 67 3d 22 60 28 63 64 20 24 69 3b 20  onfig="`(cd $i; 
1cb0: 70 77 64 29 60 22 0a 09 09 09 62 72 65 61 6b 0a  pwd)`"....break.
1cc0: 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e 65 0a  ..    fi...done.
1cd0: 09 20 20 20 20 66 69 0a 0a 09 20 20 20 20 23 20  .    fi...    # 
1ce0: 63 68 65 63 6b 20 69 6e 20 61 20 66 65 77 20 6f  check in a few o
1cf0: 74 68 65 72 20 70 72 69 76 61 74 65 20 6c 6f 63  ther private loc
1d00: 61 74 69 6f 6e 73 0a 09 20 20 20 20 69 66 20 74  ations..    if t
1d10: 65 73 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 5f  est x"${ac_cv_c_
1d20: 74 6b 63 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b  tkconfig}" = x ;
1d30: 20 74 68 65 6e 0a 09 09 66 6f 72 20 69 20 69 6e   then...for i in
1d40: 20 5c 0a 09 09 09 24 7b 73 72 63 64 69 72 7d 2f   \....${srcdir}/
1d50: 2e 2e 2f 74 6b 20 5c 0a 09 09 09 60 6c 73 20 2d  ../tk \....`ls -
1d60: 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f  dr ${srcdir}/../
1d70: 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d  tk[[8-9]].[[0-9]
1d80: 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65  ].[[0-9]]* 2>/de
1d90: 76 2f 6e 75 6c 6c 60 20 5c 0a 09 09 09 60 6c 73  v/null` \....`ls
1da0: 20 2d 64 72 20 24 7b 73 72 63 64 69 72 7d 2f 2e   -dr ${srcdir}/.
1db0: 2e 2f 74 6b 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d  ./tk[[8-9]].[[0-
1dc0: 39 5d 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  9]] 2>/dev/null`
1dd0: 20 5c 0a 09 09 09 60 6c 73 20 2d 64 72 20 24 7b   \....`ls -dr ${
1de0: 73 72 63 64 69 72 7d 2f 2e 2e 2f 74 6b 5b 5b 38  srcdir}/../tk[[8
1df0: 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 3e  -9]].[[0-9]]* 2>
1e00: 2f 64 65 76 2f 6e 75 6c 6c 60 20 3b 20 64 6f 0a  /dev/null` ; do.
1e10: 09 09 20 20 20 20 69 66 20 74 65 73 74 20 2d 66  ..    if test -f
1e20: 20 22 24 69 2f 75 6e 69 78 2f 74 6b 43 6f 6e 66   "$i/unix/tkConf
1e30: 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 09 09  ig.sh" ; then...
1e40: 09 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69  .ac_cv_c_tkconfi
1e50: 67 3d 22 60 28 63 64 20 24 69 2f 75 6e 69 78 3b  g="`(cd $i/unix;
1e60: 20 70 77 64 29 60 22 0a 09 09 09 62 72 65 61 6b   pwd)`"....break
1e70: 0a 09 09 20 20 20 20 66 69 0a 09 09 64 6f 6e 65  ...    fi...done
1e80: 0a 09 20 20 20 20 66 69 0a 09 5d 29 0a 0a 09 69  ..    fi..])...i
1e90: 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f 63 76  f test x"${ac_cv
1ea0: 5f 63 5f 74 6b 63 6f 6e 66 69 67 7d 22 20 3d 20  _c_tkconfig}" = 
1eb0: 78 20 3b 20 74 68 65 6e 0a 09 20 20 20 20 54 4b  x ; then..    TK
1ec0: 5f 42 49 4e 5f 44 49 52 3d 22 23 20 6e 6f 20 54  _BIN_DIR="# no T
1ed0: 6b 20 63 6f 6e 66 69 67 73 20 66 6f 75 6e 64 22  k configs found"
1ee0: 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 45 52 52  ..    AC_MSG_ERR
1ef0: 4f 52 28 5b 43 61 6e 27 74 20 66 69 6e 64 20 54  OR([Can't find T
1f00: 6b 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20  k configuration 
1f10: 64 65 66 69 6e 69 74 69 6f 6e 73 2e 20 55 73 65  definitions. Use
1f20: 20 2d 2d 77 69 74 68 2d 74 6b 20 74 6f 20 73 70   --with-tk to sp
1f30: 65 63 69 66 79 20 61 20 64 69 72 65 63 74 6f 72  ecify a director
1f40: 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 6b 43  y containing tkC
1f50: 6f 6e 66 69 67 2e 73 68 5d 29 0a 09 65 6c 73 65  onfig.sh])..else
1f60: 0a 09 20 20 20 20 6e 6f 5f 74 6b 3d 0a 09 20 20  ..    no_tk=..  
1f70: 20 20 54 4b 5f 42 49 4e 5f 44 49 52 3d 22 24 7b    TK_BIN_DIR="${
1f80: 61 63 5f 63 76 5f 63 5f 74 6b 63 6f 6e 66 69 67  ac_cv_c_tkconfig
1f90: 7d 22 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52  }"..    AC_MSG_R
1fa0: 45 53 55 4c 54 28 5b 66 6f 75 6e 64 20 24 7b 54  ESULT([found ${T
1fb0: 4b 5f 42 49 4e 5f 44 49 52 7d 2f 74 6b 43 6f 6e  K_BIN_DIR}/tkCon
1fc0: 66 69 67 2e 73 68 5d 29 0a 09 66 69 0a 20 20 20  fig.sh])..fi.   
1fd0: 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d   fi.])..#-------
1fe0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ff0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2000: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2020: 2d 0a 23 20 53 43 5f 4c 4f 41 44 5f 54 43 4c 43  -.# SC_LOAD_TCLC
2030: 4f 4e 46 49 47 20 2d 2d 0a 23 0a 23 09 4c 6f 61  ONFIG --.#.#.Loa
2040: 64 20 74 68 65 20 74 63 6c 43 6f 6e 66 69 67 2e  d the tclConfig.
2050: 73 68 20 66 69 6c 65 0a 23 0a 23 20 41 72 67 75  sh file.#.# Argu
2060: 6d 65 6e 74 73 3a 0a 23 0a 23 09 52 65 71 75 69  ments:.#.#.Requi
2070: 72 65 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e  res the followin
2080: 67 20 76 61 72 73 20 74 6f 20 62 65 20 73 65 74  g vars to be set
2090: 3a 0a 23 09 09 54 43 4c 5f 42 49 4e 5f 44 49 52  :.#..TCL_BIN_DIR
20a0: 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a  .#.# Results:.#.
20b0: 23 09 53 75 62 73 74 69 74 75 74 65 73 20 74 68  #.Substitutes th
20c0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
20d0: 3a 0a 23 09 09 54 43 4c 5f 42 49 4e 5f 44 49 52  :.#..TCL_BIN_DIR
20e0: 0a 23 09 09 54 43 4c 5f 53 52 43 5f 44 49 52 0a  .#..TCL_SRC_DIR.
20f0: 23 09 09 54 43 4c 5f 4c 49 42 5f 46 49 4c 45 0a  #..TCL_LIB_FILE.
2100: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
2110: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2120: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2130: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2140: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
2150: 46 55 4e 28 5b 53 43 5f 4c 4f 41 44 5f 54 43 4c  FUN([SC_LOAD_TCL
2160: 43 4f 4e 46 49 47 5d 2c 20 5b 0a 20 20 20 20 41  CONFIG], [.    A
2170: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
2180: 66 6f 72 20 65 78 69 73 74 65 6e 63 65 20 6f 66  for existence of
2190: 20 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f   ${TCL_BIN_DIR}/
21a0: 74 63 6c 43 6f 6e 66 69 67 2e 73 68 5d 29 0a 0a  tclConfig.sh])..
21b0: 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20 22      if test -f "
21c0: 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f 74  ${TCL_BIN_DIR}/t
21d0: 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74  clConfig.sh" ; t
21e0: 68 65 6e 0a 20 20 20 20 20 20 20 20 41 43 5f 4d  hen.        AC_M
21f0: 53 47 5f 52 45 53 55 4c 54 28 5b 6c 6f 61 64 69  SG_RESULT([loadi
2200: 6e 67 5d 29 0a 09 2e 20 22 24 7b 54 43 4c 5f 42  ng])... "${TCL_B
2210: 49 4e 5f 44 49 52 7d 2f 74 63 6c 43 6f 6e 66 69  IN_DIR}/tclConfi
2220: 67 2e 73 68 22 0a 20 20 20 20 65 6c 73 65 0a 20  g.sh".    else. 
2230: 20 20 20 20 20 20 20 41 43 5f 4d 53 47 5f 52 45         AC_MSG_RE
2240: 53 55 4c 54 28 5b 63 6f 75 6c 64 20 6e 6f 74 20  SULT([could not 
2250: 66 69 6e 64 20 24 7b 54 43 4c 5f 42 49 4e 5f 44  find ${TCL_BIN_D
2260: 49 52 7d 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68  IR}/tclConfig.sh
2270: 5d 29 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 23  ]).    fi..    #
2280: 20 65 76 61 6c 20 69 73 20 72 65 71 75 69 72 65   eval is require
2290: 64 20 74 6f 20 64 6f 20 74 68 65 20 54 43 4c 5f  d to do the TCL_
22a0: 44 42 47 58 20 73 75 62 73 74 69 74 75 74 69 6f  DBGX substitutio
22b0: 6e 0a 20 20 20 20 65 76 61 6c 20 22 54 43 4c 5f  n.    eval "TCL_
22c0: 4c 49 42 5f 46 49 4c 45 3d 5c 22 24 7b 54 43 4c  LIB_FILE=\"${TCL
22d0: 5f 4c 49 42 5f 46 49 4c 45 7d 5c 22 22 0a 20 20  _LIB_FILE}\"".  
22e0: 20 20 65 76 61 6c 20 22 54 43 4c 5f 53 54 55 42    eval "TCL_STUB
22f0: 5f 4c 49 42 5f 46 49 4c 45 3d 5c 22 24 7b 54 43  _LIB_FILE=\"${TC
2300: 4c 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 7d  L_STUB_LIB_FILE}
2310: 5c 22 22 0a 0a 20 20 20 20 23 20 49 66 20 74 68  \""..    # If th
2320: 65 20 54 43 4c 5f 42 49 4e 5f 44 49 52 20 69 73  e TCL_BIN_DIR is
2330: 20 74 68 65 20 62 75 69 6c 64 20 64 69 72 65 63   the build direc
2340: 74 6f 72 79 20 28 6e 6f 74 20 74 68 65 20 69 6e  tory (not the in
2350: 73 74 61 6c 6c 20 64 69 72 65 63 74 6f 72 79 29  stall directory)
2360: 2c 0a 20 20 20 20 23 20 74 68 65 6e 20 73 65 74  ,.    # then set
2370: 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 76 61 72 69   the common vari
2380: 61 62 6c 65 20 6e 61 6d 65 20 74 6f 20 74 68 65  able name to the
2390: 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 62 75   value of the bu
23a0: 69 6c 64 20 76 61 72 69 61 62 6c 65 73 2e 0a 20  ild variables.. 
23b0: 20 20 20 23 20 46 6f 72 20 65 78 61 6d 70 6c 65     # For example
23c0: 2c 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 54  , the variable T
23d0: 43 4c 5f 4c 49 42 5f 53 50 45 43 20 77 69 6c 6c  CL_LIB_SPEC will
23e0: 20 62 65 20 73 65 74 20 74 6f 20 74 68 65 20 76   be set to the v
23f0: 61 6c 75 65 0a 20 20 20 20 23 20 6f 66 20 54 43  alue.    # of TC
2400: 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43  L_BUILD_LIB_SPEC
2410: 2e 20 41 6e 20 65 78 74 65 6e 73 69 6f 6e 20 73  . An extension s
2420: 68 6f 75 6c 64 20 6d 61 6b 65 20 75 73 65 20 6f  hould make use o
2430: 66 20 54 43 4c 5f 4c 49 42 5f 53 50 45 43 0a 20  f TCL_LIB_SPEC. 
2440: 20 20 20 23 20 69 6e 73 74 65 61 64 20 6f 66 20     # instead of 
2450: 54 43 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50  TCL_BUILD_LIB_SP
2460: 45 43 20 73 69 6e 63 65 20 69 74 20 77 69 6c 6c  EC since it will
2470: 20 77 6f 72 6b 20 77 69 74 68 20 62 6f 74 68 20   work with both 
2480: 61 6e 0a 20 20 20 20 23 20 69 6e 73 74 61 6c 6c  an.    # install
2490: 65 64 20 61 6e 64 20 75 6e 69 6e 73 74 61 6c 6c  ed and uninstall
24a0: 65 64 20 76 65 72 73 69 6f 6e 20 6f 66 20 54 63  ed version of Tc
24b0: 6c 2e 0a 20 20 20 20 69 66 20 74 65 73 74 20 2d  l..    if test -
24c0: 66 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52  f "${TCL_BIN_DIR
24d0: 7d 2f 4d 61 6b 65 66 69 6c 65 22 20 3b 20 74 68  }/Makefile" ; th
24e0: 65 6e 0a 20 20 20 20 20 20 20 20 54 43 4c 5f 4c  en.        TCL_L
24f0: 49 42 5f 53 50 45 43 3d 22 24 7b 54 43 4c 5f 42  IB_SPEC="${TCL_B
2500: 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43 7d 22 0a  UILD_LIB_SPEC}".
2510: 20 20 20 20 20 20 20 20 54 43 4c 5f 53 54 55 42          TCL_STUB
2520: 5f 4c 49 42 5f 53 50 45 43 3d 22 24 7b 54 43 4c  _LIB_SPEC="${TCL
2530: 5f 42 55 49 4c 44 5f 53 54 55 42 5f 4c 49 42 5f  _BUILD_STUB_LIB_
2540: 53 50 45 43 7d 22 0a 20 20 20 20 20 20 20 20 54  SPEC}".        T
2550: 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 50 41 54 48  CL_STUB_LIB_PATH
2560: 3d 22 24 7b 54 43 4c 5f 42 55 49 4c 44 5f 53 54  ="${TCL_BUILD_ST
2570: 55 42 5f 4c 49 42 5f 50 41 54 48 7d 22 0a 20 20  UB_LIB_PATH}".  
2580: 20 20 65 6c 69 66 20 74 65 73 74 20 22 60 75 6e    elif test "`un
2590: 61 6d 65 20 2d 73 60 22 20 3d 20 22 44 61 72 77  ame -s`" = "Darw
25a0: 69 6e 22 3b 20 74 68 65 6e 0a 09 23 20 49 66 20  in"; then..# If 
25b0: 54 63 6c 20 77 61 73 20 62 75 69 6c 74 20 61 73  Tcl was built as
25c0: 20 61 20 66 72 61 6d 65 77 6f 72 6b 2c 20 61 74   a framework, at
25d0: 74 65 6d 70 74 20 74 6f 20 75 73 65 20 74 68 65  tempt to use the
25e0: 20 6c 69 62 72 61 72 69 65 73 0a 09 23 20 66 72   libraries..# fr
25f0: 6f 6d 20 74 68 65 20 66 72 61 6d 65 77 6f 72 6b  om the framework
2600: 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 6c 6f   at the given lo
2610: 63 61 74 69 6f 6e 20 73 6f 20 74 68 61 74 20 6c  cation so that l
2620: 69 6e 6b 69 6e 67 20 77 6f 72 6b 73 0a 09 23 20  inking works..# 
2630: 61 67 61 69 6e 73 74 20 54 63 6c 2e 66 72 61 6d  against Tcl.fram
2640: 65 77 6f 72 6b 20 69 6e 73 74 61 6c 6c 65 64 20  ework installed 
2650: 69 6e 20 61 6e 20 61 72 62 69 74 72 61 72 79 20  in an arbitrary 
2660: 6c 6f 63 61 74 69 6f 6e 2e 0a 09 63 61 73 65 20  location...case 
2670: 24 7b 54 43 4c 5f 44 45 46 53 7d 20 69 6e 0a 09  ${TCL_DEFS} in..
2680: 20 20 20 20 2a 54 43 4c 5f 46 52 41 4d 45 57 4f      *TCL_FRAMEWO
2690: 52 4b 2a 29 0a 09 09 69 66 20 74 65 73 74 20 2d  RK*)...if test -
26a0: 66 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52  f "${TCL_BIN_DIR
26b0: 7d 2f 24 7b 54 43 4c 5f 4c 49 42 5f 46 49 4c 45  }/${TCL_LIB_FILE
26c0: 7d 22 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 66  }"; then...    f
26d0: 6f 72 20 69 20 69 6e 20 22 60 63 64 20 22 24 7b  or i in "`cd "${
26e0: 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 22 3b 20 70  TCL_BIN_DIR}"; p
26f0: 77 64 60 22 20 5c 0a 09 09 09 20 20 20 20 20 22  wd`" \....     "
2700: 60 63 64 20 22 24 7b 54 43 4c 5f 42 49 4e 5f 44  `cd "${TCL_BIN_D
2710: 49 52 7d 22 2f 2e 2e 2f 2e 2e 3b 20 70 77 64 60  IR}"/../..; pwd`
2720: 22 3b 20 64 6f 0a 09 09 09 69 66 20 74 65 73 74  "; do....if test
2730: 20 22 60 62 61 73 65 6e 61 6d 65 20 22 24 69 22   "`basename "$i"
2740: 60 22 20 3d 20 22 24 7b 54 43 4c 5f 4c 49 42 5f  `" = "${TCL_LIB_
2750: 46 49 4c 45 7d 2e 66 72 61 6d 65 77 6f 72 6b 22  FILE}.framework"
2760: 3b 20 74 68 65 6e 0a 09 09 09 20 20 20 20 54 43  ; then....    TC
2770: 4c 5f 4c 49 42 5f 53 50 45 43 3d 22 2d 46 60 64  L_LIB_SPEC="-F`d
2780: 69 72 6e 61 6d 65 20 22 24 69 22 20 7c 20 73 65  irname "$i" | se
2790: 64 20 2d 65 20 27 73 2f 20 2f 5c 5c 5c 5c 20 2f  d -e 's/ /\\\\ /
27a0: 67 27 60 20 2d 66 72 61 6d 65 77 6f 72 6b 20 24  g'` -framework $
27b0: 7b 54 43 4c 5f 4c 49 42 5f 46 49 4c 45 7d 22 0a  {TCL_LIB_FILE}".
27c0: 09 09 09 20 20 20 20 62 72 65 61 6b 0a 09 09 09  ...    break....
27d0: 66 69 0a 09 09 20 20 20 20 64 6f 6e 65 0a 09 09  fi...    done...
27e0: 66 69 0a 09 09 69 66 20 74 65 73 74 20 2d 66 20  fi...if test -f 
27f0: 22 24 7b 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 2f  "${TCL_BIN_DIR}/
2800: 24 7b 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46  ${TCL_STUB_LIB_F
2810: 49 4c 45 7d 22 3b 20 74 68 65 6e 0a 09 09 20 20  ILE}"; then...  
2820: 20 20 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 53    TCL_STUB_LIB_S
2830: 50 45 43 3d 22 2d 4c 60 65 63 68 6f 20 22 24 7b  PEC="-L`echo "${
2840: 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 22 20 20 7c  TCL_BIN_DIR}"  |
2850: 20 73 65 64 20 2d 65 20 27 73 2f 20 2f 5c 5c 5c   sed -e 's/ /\\\
2860: 5c 20 2f 67 27 60 20 24 7b 54 43 4c 5f 53 54 55  \ /g'` ${TCL_STU
2870: 42 5f 4c 49 42 5f 46 4c 41 47 7d 22 0a 09 09 20  B_LIB_FLAG}"... 
2880: 20 20 20 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f     TCL_STUB_LIB_
2890: 50 41 54 48 3d 22 24 7b 54 43 4c 5f 42 49 4e 5f  PATH="${TCL_BIN_
28a0: 44 49 52 7d 2f 24 7b 54 43 4c 5f 53 54 55 42 5f  DIR}/${TCL_STUB_
28b0: 4c 49 42 5f 46 49 4c 45 7d 22 0a 09 09 66 69 0a  LIB_FILE}"...fi.
28c0: 09 09 3b 3b 0a 09 65 73 61 63 0a 20 20 20 20 66  ..;;..esac.    f
28d0: 69 0a 0a 20 20 20 20 23 20 65 76 61 6c 20 69 73  i..    # eval is
28e0: 20 72 65 71 75 69 72 65 64 20 74 6f 20 64 6f 20   required to do 
28f0: 74 68 65 20 54 43 4c 5f 44 42 47 58 20 73 75 62  the TCL_DBGX sub
2900: 73 74 69 74 75 74 69 6f 6e 0a 20 20 20 20 65 76  stitution.    ev
2910: 61 6c 20 22 54 43 4c 5f 4c 49 42 5f 46 4c 41 47  al "TCL_LIB_FLAG
2920: 3d 5c 22 24 7b 54 43 4c 5f 4c 49 42 5f 46 4c 41  =\"${TCL_LIB_FLA
2930: 47 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c 20 22  G}\"".    eval "
2940: 54 43 4c 5f 4c 49 42 5f 53 50 45 43 3d 5c 22 24  TCL_LIB_SPEC=\"$
2950: 7b 54 43 4c 5f 4c 49 42 5f 53 50 45 43 7d 5c 22  {TCL_LIB_SPEC}\"
2960: 22 0a 20 20 20 20 65 76 61 6c 20 22 54 43 4c 5f  ".    eval "TCL_
2970: 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 3d 5c 22  STUB_LIB_FLAG=\"
2980: 24 7b 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46  ${TCL_STUB_LIB_F
2990: 4c 41 47 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c  LAG}\"".    eval
29a0: 20 22 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 53   "TCL_STUB_LIB_S
29b0: 50 45 43 3d 5c 22 24 7b 54 43 4c 5f 53 54 55 42  PEC=\"${TCL_STUB
29c0: 5f 4c 49 42 5f 53 50 45 43 7d 5c 22 22 0a 0a 20  _LIB_SPEC}\"".. 
29d0: 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f     AC_SUBST(TCL_
29e0: 56 45 52 53 49 4f 4e 29 0a 20 20 20 20 41 43 5f  VERSION).    AC_
29f0: 53 55 42 53 54 28 54 43 4c 5f 50 41 54 43 48 5f  SUBST(TCL_PATCH_
2a00: 4c 45 56 45 4c 29 0a 20 20 20 20 41 43 5f 53 55  LEVEL).    AC_SU
2a10: 42 53 54 28 54 43 4c 5f 42 49 4e 5f 44 49 52 29  BST(TCL_BIN_DIR)
2a20: 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 43  .    AC_SUBST(TC
2a30: 4c 5f 53 52 43 5f 44 49 52 29 0a 0a 20 20 20 20  L_SRC_DIR)..    
2a40: 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 4c 49 42  AC_SUBST(TCL_LIB
2a50: 5f 46 49 4c 45 29 0a 20 20 20 20 41 43 5f 53 55  _FILE).    AC_SU
2a60: 42 53 54 28 54 43 4c 5f 4c 49 42 5f 46 4c 41 47  BST(TCL_LIB_FLAG
2a70: 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54  ).    AC_SUBST(T
2a80: 43 4c 5f 4c 49 42 5f 53 50 45 43 29 0a 0a 20 20  CL_LIB_SPEC)..  
2a90: 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 53    AC_SUBST(TCL_S
2aa0: 54 55 42 5f 4c 49 42 5f 46 49 4c 45 29 0a 20 20  TUB_LIB_FILE).  
2ab0: 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 53    AC_SUBST(TCL_S
2ac0: 54 55 42 5f 4c 49 42 5f 46 4c 41 47 29 0a 20 20  TUB_LIB_FLAG).  
2ad0: 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 53    AC_SUBST(TCL_S
2ae0: 54 55 42 5f 4c 49 42 5f 53 50 45 43 29 0a 5d 29  TUB_LIB_SPEC).])
2af0: 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
2b00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43  -----------.# SC
2b40: 5f 4c 4f 41 44 5f 54 4b 43 4f 4e 46 49 47 20 2d  _LOAD_TKCONFIG -
2b50: 2d 0a 23 0a 23 09 4c 6f 61 64 20 74 68 65 20 74  -.#.#.Load the t
2b60: 6b 43 6f 6e 66 69 67 2e 73 68 20 66 69 6c 65 0a  kConfig.sh file.
2b70: 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23  #.# Arguments:.#
2b80: 0a 23 09 52 65 71 75 69 72 65 73 20 74 68 65 20  .#.Requires the 
2b90: 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 20 74  following vars t
2ba0: 6f 20 62 65 20 73 65 74 3a 0a 23 09 09 54 4b 5f  o be set:.#..TK_
2bb0: 42 49 4e 5f 44 49 52 0a 23 0a 23 20 52 65 73 75  BIN_DIR.#.# Resu
2bc0: 6c 74 73 3a 0a 23 0a 23 09 53 65 74 73 20 74 68  lts:.#.#.Sets th
2bd0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
2be0: 20 74 68 61 74 20 73 68 6f 75 6c 64 20 62 65 20   that should be 
2bf0: 69 6e 20 74 6b 43 6f 6e 66 69 67 2e 73 68 3a 0a  in tkConfig.sh:.
2c00: 23 09 09 54 4b 5f 42 49 4e 5f 44 49 52 0a 23 2d  #..TK_BIN_DIR.#-
2c10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c50: 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55  -------..AC_DEFU
2c60: 4e 28 5b 53 43 5f 4c 4f 41 44 5f 54 4b 43 4f 4e  N([SC_LOAD_TKCON
2c70: 46 49 47 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d  FIG], [.    AC_M
2c80: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72  SG_CHECKING([for
2c90: 20 65 78 69 73 74 65 6e 63 65 20 6f 66 20 24 7b   existence of ${
2ca0: 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 74 6b 43 6f  TK_BIN_DIR}/tkCo
2cb0: 6e 66 69 67 2e 73 68 5d 29 0a 0a 20 20 20 20 69  nfig.sh])..    i
2cc0: 66 20 74 65 73 74 20 2d 66 20 22 24 7b 54 4b 5f  f test -f "${TK_
2cd0: 42 49 4e 5f 44 49 52 7d 2f 74 6b 43 6f 6e 66 69  BIN_DIR}/tkConfi
2ce0: 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 20 20 20  g.sh" ; then.   
2cf0: 20 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55       AC_MSG_RESU
2d00: 4c 54 28 5b 6c 6f 61 64 69 6e 67 5d 29 0a 09 2e  LT([loading])...
2d10: 20 22 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f   "${TK_BIN_DIR}/
2d20: 74 6b 43 6f 6e 66 69 67 2e 73 68 22 0a 20 20 20  tkConfig.sh".   
2d30: 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 41 43   else.        AC
2d40: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 63 6f 75  _MSG_RESULT([cou
2d50: 6c 64 20 6e 6f 74 20 66 69 6e 64 20 24 7b 54 4b  ld not find ${TK
2d60: 5f 42 49 4e 5f 44 49 52 7d 2f 74 6b 43 6f 6e 66  _BIN_DIR}/tkConf
2d70: 69 67 2e 73 68 5d 29 0a 20 20 20 20 66 69 0a 0a  ig.sh]).    fi..
2d80: 20 20 20 20 23 20 65 76 61 6c 20 69 73 20 72 65      # eval is re
2d90: 71 75 69 72 65 64 20 74 6f 20 64 6f 20 74 68 65  quired to do the
2da0: 20 54 4b 5f 44 42 47 58 20 73 75 62 73 74 69 74   TK_DBGX substit
2db0: 75 74 69 6f 6e 0a 20 20 20 20 65 76 61 6c 20 22  ution.    eval "
2dc0: 54 4b 5f 4c 49 42 5f 46 49 4c 45 3d 5c 22 24 7b  TK_LIB_FILE=\"${
2dd0: 54 4b 5f 4c 49 42 5f 46 49 4c 45 7d 5c 22 22 0a  TK_LIB_FILE}\"".
2de0: 20 20 20 20 65 76 61 6c 20 22 54 4b 5f 53 54 55      eval "TK_STU
2df0: 42 5f 4c 49 42 5f 46 49 4c 45 3d 5c 22 24 7b 54  B_LIB_FILE=\"${T
2e00: 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 7d  K_STUB_LIB_FILE}
2e10: 5c 22 22 0a 0a 20 20 20 20 23 20 49 66 20 74 68  \""..    # If th
2e20: 65 20 54 4b 5f 42 49 4e 5f 44 49 52 20 69 73 20  e TK_BIN_DIR is 
2e30: 74 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 74  the build direct
2e40: 6f 72 79 20 28 6e 6f 74 20 74 68 65 20 69 6e 73  ory (not the ins
2e50: 74 61 6c 6c 20 64 69 72 65 63 74 6f 72 79 29 2c  tall directory),
2e60: 0a 20 20 20 20 23 20 74 68 65 6e 20 73 65 74 20  .    # then set 
2e70: 74 68 65 20 63 6f 6d 6d 6f 6e 20 76 61 72 69 61  the common varia
2e80: 62 6c 65 20 6e 61 6d 65 20 74 6f 20 74 68 65 20  ble name to the 
2e90: 76 61 6c 75 65 20 6f 66 20 74 68 65 20 62 75 69  value of the bui
2ea0: 6c 64 20 76 61 72 69 61 62 6c 65 73 2e 0a 20 20  ld variables..  
2eb0: 20 20 23 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c    # For example,
2ec0: 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 54 4b   the variable TK
2ed0: 5f 4c 49 42 5f 53 50 45 43 20 77 69 6c 6c 20 62  _LIB_SPEC will b
2ee0: 65 20 73 65 74 20 74 6f 20 74 68 65 20 76 61 6c  e set to the val
2ef0: 75 65 0a 20 20 20 20 23 20 6f 66 20 54 4b 5f 42  ue.    # of TK_B
2f00: 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43 2e 20 41  UILD_LIB_SPEC. A
2f10: 6e 20 65 78 74 65 6e 73 69 6f 6e 20 73 68 6f 75  n extension shou
2f20: 6c 64 20 6d 61 6b 65 20 75 73 65 20 6f 66 20 54  ld make use of T
2f30: 4b 5f 4c 49 42 5f 53 50 45 43 0a 20 20 20 20 23  K_LIB_SPEC.    #
2f40: 20 69 6e 73 74 65 61 64 20 6f 66 20 54 4b 5f 42   instead of TK_B
2f50: 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43 20 73 69  UILD_LIB_SPEC si
2f60: 6e 63 65 20 69 74 20 77 69 6c 6c 20 77 6f 72 6b  nce it will work
2f70: 20 77 69 74 68 20 62 6f 74 68 20 61 6e 0a 20 20   with both an.  
2f80: 20 20 23 20 69 6e 73 74 61 6c 6c 65 64 20 61 6e    # installed an
2f90: 64 20 75 6e 69 6e 73 74 61 6c 6c 65 64 20 76 65  d uninstalled ve
2fa0: 72 73 69 6f 6e 20 6f 66 20 54 63 6c 2e 0a 20 20  rsion of Tcl..  
2fb0: 20 20 69 66 20 74 65 73 74 20 2d 66 20 22 24 7b    if test -f "${
2fc0: 54 4b 5f 42 49 4e 5f 44 49 52 7d 2f 4d 61 6b 65  TK_BIN_DIR}/Make
2fd0: 66 69 6c 65 22 20 3b 20 74 68 65 6e 0a 20 20 20  file" ; then.   
2fe0: 20 20 20 20 20 54 4b 5f 4c 49 42 5f 53 50 45 43       TK_LIB_SPEC
2ff0: 3d 22 24 7b 54 4b 5f 42 55 49 4c 44 5f 4c 49 42  ="${TK_BUILD_LIB
3000: 5f 53 50 45 43 7d 22 0a 20 20 20 20 20 20 20 20  _SPEC}".        
3010: 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43  TK_STUB_LIB_SPEC
3020: 3d 22 24 7b 54 4b 5f 42 55 49 4c 44 5f 53 54 55  ="${TK_BUILD_STU
3030: 42 5f 4c 49 42 5f 53 50 45 43 7d 22 0a 20 20 20  B_LIB_SPEC}".   
3040: 20 20 20 20 20 54 4b 5f 53 54 55 42 5f 4c 49 42       TK_STUB_LIB
3050: 5f 50 41 54 48 3d 22 24 7b 54 4b 5f 42 55 49 4c  _PATH="${TK_BUIL
3060: 44 5f 53 54 55 42 5f 4c 49 42 5f 50 41 54 48 7d  D_STUB_LIB_PATH}
3070: 22 0a 20 20 20 20 65 6c 69 66 20 74 65 73 74 20  ".    elif test 
3080: 22 60 75 6e 61 6d 65 20 2d 73 60 22 20 3d 20 22  "`uname -s`" = "
3090: 44 61 72 77 69 6e 22 3b 20 74 68 65 6e 0a 09 23  Darwin"; then..#
30a0: 20 49 66 20 54 6b 20 77 61 73 20 62 75 69 6c 74   If Tk was built
30b0: 20 61 73 20 61 20 66 72 61 6d 65 77 6f 72 6b 2c   as a framework,
30c0: 20 61 74 74 65 6d 70 74 20 74 6f 20 75 73 65 20   attempt to use 
30d0: 74 68 65 20 6c 69 62 72 61 72 69 65 73 0a 09 23  the libraries..#
30e0: 20 66 72 6f 6d 20 74 68 65 20 66 72 61 6d 65 77   from the framew
30f0: 6f 72 6b 20 61 74 20 74 68 65 20 67 69 76 65 6e  ork at the given
3100: 20 6c 6f 63 61 74 69 6f 6e 20 73 6f 20 74 68 61   location so tha
3110: 74 20 6c 69 6e 6b 69 6e 67 20 77 6f 72 6b 73 0a  t linking works.
3120: 09 23 20 61 67 61 69 6e 73 74 20 54 6b 2e 66 72  .# against Tk.fr
3130: 61 6d 65 77 6f 72 6b 20 69 6e 73 74 61 6c 6c 65  amework installe
3140: 64 20 69 6e 20 61 6e 20 61 72 62 69 74 72 61 72  d in an arbitrar
3150: 79 20 6c 6f 63 61 74 69 6f 6e 2e 0a 09 63 61 73  y location...cas
3160: 65 20 24 7b 54 4b 5f 44 45 46 53 7d 20 69 6e 0a  e ${TK_DEFS} in.
3170: 09 20 20 20 20 2a 54 4b 5f 46 52 41 4d 45 57 4f  .    *TK_FRAMEWO
3180: 52 4b 2a 29 0a 09 09 69 66 20 74 65 73 74 20 2d  RK*)...if test -
3190: 66 20 22 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d  f "${TK_BIN_DIR}
31a0: 2f 24 7b 54 4b 5f 4c 49 42 5f 46 49 4c 45 7d 22  /${TK_LIB_FILE}"
31b0: 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 66 6f 72  ; then...    for
31c0: 20 69 20 69 6e 20 22 60 63 64 20 22 24 7b 54 4b   i in "`cd "${TK
31d0: 5f 42 49 4e 5f 44 49 52 7d 22 3b 20 70 77 64 60  _BIN_DIR}"; pwd`
31e0: 22 20 5c 0a 09 09 09 20 20 20 20 20 22 60 63 64  " \....     "`cd
31f0: 20 22 24 7b 54 4b 5f 42 49 4e 5f 44 49 52 7d 22   "${TK_BIN_DIR}"
3200: 2f 2e 2e 2f 2e 2e 3b 20 70 77 64 60 22 3b 20 64  /../..; pwd`"; d
3210: 6f 0a 09 09 09 69 66 20 74 65 73 74 20 22 60 62  o....if test "`b
3220: 61 73 65 6e 61 6d 65 20 22 24 69 22 60 22 20 3d  asename "$i"`" =
3230: 20 22 24 7b 54 4b 5f 4c 49 42 5f 46 49 4c 45 7d   "${TK_LIB_FILE}
3240: 2e 66 72 61 6d 65 77 6f 72 6b 22 3b 20 74 68 65  .framework"; the
3250: 6e 0a 09 09 09 20 20 20 20 54 4b 5f 4c 49 42 5f  n....    TK_LIB_
3260: 53 50 45 43 3d 22 2d 46 60 64 69 72 6e 61 6d 65  SPEC="-F`dirname
3270: 20 22 24 69 22 20 7c 20 73 65 64 20 2d 65 20 27   "$i" | sed -e '
3280: 73 2f 20 2f 5c 5c 5c 5c 20 2f 67 27 60 20 2d 66  s/ /\\\\ /g'` -f
3290: 72 61 6d 65 77 6f 72 6b 20 24 7b 54 4b 5f 4c 49  ramework ${TK_LI
32a0: 42 5f 46 49 4c 45 7d 22 0a 09 09 09 20 20 20 20  B_FILE}"....    
32b0: 62 72 65 61 6b 0a 09 09 09 66 69 0a 09 09 20 20  break....fi...  
32c0: 20 20 64 6f 6e 65 0a 09 09 66 69 0a 09 09 69 66    done...fi...if
32d0: 20 74 65 73 74 20 2d 66 20 22 24 7b 54 4b 5f 42   test -f "${TK_B
32e0: 49 4e 5f 44 49 52 7d 2f 24 7b 54 4b 5f 53 54 55  IN_DIR}/${TK_STU
32f0: 42 5f 4c 49 42 5f 46 49 4c 45 7d 22 3b 20 74 68  B_LIB_FILE}"; th
3300: 65 6e 0a 09 09 20 20 20 20 54 4b 5f 53 54 55 42  en...    TK_STUB
3310: 5f 4c 49 42 5f 53 50 45 43 3d 22 2d 4c 60 20 65  _LIB_SPEC="-L` e
3320: 63 68 6f 20 22 24 7b 54 4b 5f 42 49 4e 5f 44 49  cho "${TK_BIN_DI
3330: 52 7d 22 20 20 7c 20 73 65 64 20 2d 65 20 27 73  R}"  | sed -e 's
3340: 2f 20 2f 5c 5c 5c 5c 20 2f 67 27 60 20 24 7b 54  / /\\\\ /g'` ${T
3350: 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 7d  K_STUB_LIB_FLAG}
3360: 22 0a 09 09 20 20 20 20 54 4b 5f 53 54 55 42 5f  "...    TK_STUB_
3370: 4c 49 42 5f 50 41 54 48 3d 22 24 7b 54 4b 5f 42  LIB_PATH="${TK_B
3380: 49 4e 5f 44 49 52 7d 2f 24 7b 54 4b 5f 53 54 55  IN_DIR}/${TK_STU
3390: 42 5f 4c 49 42 5f 46 49 4c 45 7d 22 0a 09 09 66  B_LIB_FILE}"...f
33a0: 69 0a 09 09 3b 3b 0a 09 65 73 61 63 0a 20 20 20  i...;;..esac.   
33b0: 20 66 69 0a 0a 20 20 20 20 23 20 65 76 61 6c 20   fi..    # eval 
33c0: 69 73 20 72 65 71 75 69 72 65 64 20 74 6f 20 64  is required to d
33d0: 6f 20 74 68 65 20 54 4b 5f 44 42 47 58 20 73 75  o the TK_DBGX su
33e0: 62 73 74 69 74 75 74 69 6f 6e 0a 20 20 20 20 65  bstitution.    e
33f0: 76 61 6c 20 22 54 4b 5f 4c 49 42 5f 46 4c 41 47  val "TK_LIB_FLAG
3400: 3d 5c 22 24 7b 54 4b 5f 4c 49 42 5f 46 4c 41 47  =\"${TK_LIB_FLAG
3410: 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c 20 22 54  }\"".    eval "T
3420: 4b 5f 4c 49 42 5f 53 50 45 43 3d 5c 22 24 7b 54  K_LIB_SPEC=\"${T
3430: 4b 5f 4c 49 42 5f 53 50 45 43 7d 5c 22 22 0a 20  K_LIB_SPEC}\"". 
3440: 20 20 20 65 76 61 6c 20 22 54 4b 5f 53 54 55 42     eval "TK_STUB
3450: 5f 4c 49 42 5f 46 4c 41 47 3d 5c 22 24 7b 54 4b  _LIB_FLAG=\"${TK
3460: 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 7d 5c  _STUB_LIB_FLAG}\
3470: 22 22 0a 20 20 20 20 65 76 61 6c 20 22 54 4b 5f  "".    eval "TK_
3480: 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 3d 5c 22  STUB_LIB_SPEC=\"
3490: 24 7b 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 53 50  ${TK_STUB_LIB_SP
34a0: 45 43 7d 5c 22 22 0a 0a 20 20 20 20 41 43 5f 53  EC}\""..    AC_S
34b0: 55 42 53 54 28 54 4b 5f 56 45 52 53 49 4f 4e 29  UBST(TK_VERSION)
34c0: 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b  .    AC_SUBST(TK
34d0: 5f 42 49 4e 5f 44 49 52 29 0a 20 20 20 20 41 43  _BIN_DIR).    AC
34e0: 5f 53 55 42 53 54 28 54 4b 5f 53 52 43 5f 44 49  _SUBST(TK_SRC_DI
34f0: 52 29 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54  R)..    AC_SUBST
3500: 28 54 4b 5f 4c 49 42 5f 46 49 4c 45 29 0a 20 20  (TK_LIB_FILE).  
3510: 20 20 41 43 5f 53 55 42 53 54 28 54 4b 5f 4c 49    AC_SUBST(TK_LI
3520: 42 5f 46 4c 41 47 29 0a 20 20 20 20 41 43 5f 53  B_FLAG).    AC_S
3530: 55 42 53 54 28 54 4b 5f 4c 49 42 5f 53 50 45 43  UBST(TK_LIB_SPEC
3540: 29 0a 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  )..    AC_SUBST(
3550: 54 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45  TK_STUB_LIB_FILE
3560: 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54  ).    AC_SUBST(T
3570: 4b 5f 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 29  K_STUB_LIB_FLAG)
3580: 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 4b  .    AC_SUBST(TK
3590: 5f 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 29 0a  _STUB_LIB_SPEC).
35a0: 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ])..#-----------
35b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
35c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
35d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
35e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
35f0: 53 43 5f 50 52 4f 47 5f 54 43 4c 53 48 0a 23 09  SC_PROG_TCLSH.#.
3600: 4c 6f 63 61 74 65 20 61 20 74 63 6c 73 68 20 73  Locate a tclsh s
3610: 68 65 6c 6c 20 69 6e 73 74 61 6c 6c 65 64 20 6f  hell installed o
3620: 6e 20 74 68 65 20 73 79 73 74 65 6d 20 70 61 74  n the system pat
3630: 68 2e 20 54 68 69 73 20 6d 61 63 72 6f 0a 23 09  h. This macro.#.
3640: 77 69 6c 6c 20 6f 6e 6c 79 20 66 69 6e 64 20 61  will only find a
3650: 20 54 63 6c 20 73 68 65 6c 6c 20 74 68 61 74 20   Tcl shell that 
3660: 61 6c 72 65 61 64 79 20 65 78 69 73 74 73 20 6f  already exists o
3670: 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 0a 23 09  n the system..#.
3680: 49 74 20 77 69 6c 6c 20 6e 6f 74 20 66 69 6e 64  It will not find
3690: 20 61 20 54 63 6c 20 73 68 65 6c 6c 20 69 6e 20   a Tcl shell in 
36a0: 74 68 65 20 54 63 6c 20 62 75 69 6c 64 20 64 69  the Tcl build di
36b0: 72 65 63 74 6f 72 79 20 6f 72 0a 23 09 61 20 54  rectory or.#.a T
36c0: 63 6c 20 73 68 65 6c 6c 20 74 68 61 74 20 68 61  cl shell that ha
36d0: 73 20 62 65 65 6e 20 69 6e 73 74 61 6c 6c 65 64  s been installed
36e0: 20 66 72 6f 6d 20 74 68 65 20 54 63 6c 20 62 75   from the Tcl bu
36f0: 69 6c 64 20 64 69 72 65 63 74 6f 72 79 2e 0a 23  ild directory..#
3700: 09 49 66 20 61 20 54 63 6c 20 73 68 65 6c 6c 20  .If a Tcl shell 
3710: 63 61 6e 27 74 20 62 65 20 6c 6f 63 61 74 65 64  can't be located
3720: 20 6f 6e 20 74 68 65 20 50 41 54 48 2c 20 74 68   on the PATH, th
3730: 65 6e 20 54 43 4c 53 48 5f 50 52 4f 47 20 77 69  en TCLSH_PROG wi
3740: 6c 6c 0a 23 09 62 65 20 73 65 74 20 74 6f 20 22  ll.#.be set to "
3750: 22 2e 20 45 78 74 65 6e 73 69 6f 6e 73 20 73 68  ". Extensions sh
3760: 6f 75 6c 64 20 74 61 6b 65 20 63 61 72 65 20 6e  ould take care n
3770: 6f 74 20 74 6f 20 63 72 65 61 74 65 20 4d 61 6b  ot to create Mak
3780: 65 66 69 6c 65 0a 23 09 72 75 6c 65 73 20 74 68  efile.#.rules th
3790: 61 74 20 61 72 65 20 72 75 6e 20 62 79 20 64 65  at are run by de
37a0: 66 61 75 6c 74 20 61 6e 64 20 64 65 70 65 6e 64  fault and depend
37b0: 20 6f 6e 20 54 43 4c 53 48 5f 50 52 4f 47 2e 20   on TCLSH_PROG. 
37c0: 41 6e 0a 23 09 65 78 74 65 6e 73 69 6f 6e 20 63  An.#.extension c
37d0: 61 6e 27 74 20 61 73 73 75 6d 65 20 74 68 61 74  an't assume that
37e0: 20 61 6e 20 65 78 65 63 75 74 61 62 6c 65 20 54   an executable T
37f0: 63 6c 20 73 68 65 6c 6c 20 65 78 69 73 74 73 20  cl shell exists 
3800: 61 74 0a 23 09 62 75 69 6c 64 20 74 69 6d 65 2e  at.#.build time.
3810: 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a  .#.# Arguments:.
3820: 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c  #.none.#.# Resul
3830: 74 73 3a 0a 23 09 53 75 62 73 74 69 74 75 74 65  ts:.#.Substitute
3840: 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  s the following 
3850: 76 61 72 73 3a 0a 23 09 09 54 43 4c 53 48 5f 50  vars:.#..TCLSH_P
3860: 52 4f 47 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ROG.#-----------
3870: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3880: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3890: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
38a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41  -------------..A
38b0: 43 5f 44 45 46 55 4e 28 5b 53 43 5f 50 52 4f 47  C_DEFUN([SC_PROG
38c0: 5f 54 43 4c 53 48 5d 2c 20 5b 0a 20 20 20 20 41  _TCLSH], [.    A
38d0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
38e0: 66 6f 72 20 74 63 6c 73 68 5d 29 0a 20 20 20 20  for tclsh]).    
38f0: 41 43 5f 43 41 43 48 45 5f 56 41 4c 28 61 63 5f  AC_CACHE_VAL(ac_
3900: 63 76 5f 70 61 74 68 5f 74 63 6c 73 68 2c 20 5b  cv_path_tclsh, [
3910: 0a 09 73 65 61 72 63 68 5f 70 61 74 68 3d 60 65  ..search_path=`e
3920: 63 68 6f 20 24 7b 50 41 54 48 7d 20 7c 20 73 65  cho ${PATH} | se
3930: 64 20 2d 65 20 27 73 2f 3a 2f 20 2f 67 27 60 0a  d -e 's/:/ /g'`.
3940: 09 66 6f 72 20 64 69 72 20 69 6e 20 24 73 65 61  .for dir in $sea
3950: 72 63 68 5f 70 61 74 68 20 3b 20 64 6f 0a 09 20  rch_path ; do.. 
3960: 20 20 20 66 6f 72 20 6a 20 69 6e 20 60 6c 73 20     for j in `ls 
3970: 2d 72 20 24 64 69 72 2f 74 63 6c 73 68 5b 5b 38  -r $dir/tclsh[[8
3980: 2d 39 5d 5d 2a 20 32 3e 20 2f 64 65 76 2f 6e 75  -9]]* 2> /dev/nu
3990: 6c 6c 60 20 5c 0a 09 09 20 20 20 20 60 6c 73 20  ll` \...    `ls 
39a0: 2d 72 20 24 64 69 72 2f 74 63 6c 73 68 2a 20 32  -r $dir/tclsh* 2
39b0: 3e 20 2f 64 65 76 2f 6e 75 6c 6c 60 20 3b 20 64  > /dev/null` ; d
39c0: 6f 0a 09 09 69 66 20 74 65 73 74 20 78 22 24 61  o...if test x"$a
39d0: 63 5f 63 76 5f 70 61 74 68 5f 74 63 6c 73 68 22  c_cv_path_tclsh"
39e0: 20 3d 20 78 20 3b 20 74 68 65 6e 0a 09 09 20 20   = x ; then...  
39f0: 20 20 69 66 20 74 65 73 74 20 2d 66 20 22 24 6a    if test -f "$j
3a00: 22 20 3b 20 74 68 65 6e 0a 09 09 09 61 63 5f 63  " ; then....ac_c
3a10: 76 5f 70 61 74 68 5f 74 63 6c 73 68 3d 24 6a 0a  v_path_tclsh=$j.
3a20: 09 09 09 62 72 65 61 6b 0a 09 09 20 20 20 20 66  ...break...    f
3a30: 69 0a 09 09 66 69 0a 09 20 20 20 20 64 6f 6e 65  i...fi..    done
3a40: 0a 09 64 6f 6e 65 0a 20 20 20 20 5d 29 0a 0a 20  ..done.    ]).. 
3a50: 20 20 20 69 66 20 74 65 73 74 20 2d 66 20 22 24     if test -f "$
3a60: 61 63 5f 63 76 5f 70 61 74 68 5f 74 63 6c 73 68  ac_cv_path_tclsh
3a70: 22 20 3b 20 74 68 65 6e 0a 09 54 43 4c 53 48 5f  " ; then..TCLSH_
3a80: 50 52 4f 47 3d 22 24 61 63 5f 63 76 5f 70 61 74  PROG="$ac_cv_pat
3a90: 68 5f 74 63 6c 73 68 22 0a 09 41 43 5f 4d 53 47  h_tclsh"..AC_MSG
3aa0: 5f 52 45 53 55 4c 54 28 5b 24 54 43 4c 53 48 5f  _RESULT([$TCLSH_
3ab0: 50 52 4f 47 5d 29 0a 20 20 20 20 65 6c 73 65 0a  PROG]).    else.
3ac0: 09 23 20 49 74 20 69 73 20 6e 6f 74 20 61 6e 20  .# It is not an 
3ad0: 65 72 72 6f 72 20 69 66 20 61 6e 20 69 6e 73 74  error if an inst
3ae0: 61 6c 6c 65 64 20 76 65 72 73 69 6f 6e 20 6f 66  alled version of
3af0: 20 54 63 6c 20 63 61 6e 27 74 20 62 65 20 6c 6f   Tcl can't be lo
3b00: 63 61 74 65 64 2e 0a 09 54 43 4c 53 48 5f 50 52  cated...TCLSH_PR
3b10: 4f 47 3d 22 22 0a 09 41 43 5f 4d 53 47 5f 52 45  OG=""..AC_MSG_RE
3b20: 53 55 4c 54 28 5b 4e 6f 20 74 63 6c 73 68 20 66  SULT([No tclsh f
3b30: 6f 75 6e 64 20 6f 6e 20 50 41 54 48 5d 29 0a 20  ound on PATH]). 
3b40: 20 20 20 66 69 0a 20 20 20 20 41 43 5f 53 55 42     fi.    AC_SUB
3b50: 53 54 28 54 43 4c 53 48 5f 50 52 4f 47 29 0a 5d  ST(TCLSH_PROG).]
3b60: 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  )..#------------
3b70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3b80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3b90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3ba0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53  ------------.# S
3bb0: 43 5f 42 55 49 4c 44 5f 54 43 4c 53 48 0a 23 09  C_BUILD_TCLSH.#.
3bc0: 44 65 74 65 72 6d 69 6e 65 20 74 68 65 20 66 75  Determine the fu
3bd0: 6c 6c 79 20 71 75 61 6c 69 66 69 65 64 20 70 61  lly qualified pa
3be0: 74 68 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 74  th name of the t
3bf0: 63 6c 73 68 20 65 78 65 63 75 74 61 62 6c 65 0a  clsh executable.
3c00: 23 09 69 6e 20 74 68 65 20 54 63 6c 20 62 75 69  #.in the Tcl bui
3c10: 6c 64 20 64 69 72 65 63 74 6f 72 79 2e 20 54 68  ld directory. Th
3c20: 69 73 20 6d 61 63 72 6f 20 77 69 6c 6c 20 63 6f  is macro will co
3c30: 72 72 65 63 74 6c 79 20 64 65 74 65 72 6d 69 6e  rrectly determin
3c40: 65 0a 23 09 74 68 65 20 6e 61 6d 65 20 6f 66 20  e.#.the name of 
3c50: 74 68 65 20 74 63 6c 73 68 20 65 78 65 63 75 74  the tclsh execut
3c60: 61 62 6c 65 20 65 76 65 6e 20 69 66 20 74 63 6c  able even if tcl
3c70: 73 68 20 68 61 73 20 6e 6f 74 20 79 65 74 0a 23  sh has not yet.#
3c80: 09 62 65 65 6e 20 62 75 69 6c 74 20 69 6e 20 74  .been built in t
3c90: 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 74 6f  he build directo
3ca0: 72 79 2e 20 54 68 65 20 62 75 69 6c 64 20 74 63  ry. The build tc
3cb0: 6c 73 68 20 6d 75 73 74 20 62 65 20 75 73 65 64  lsh must be used
3cc0: 0a 23 09 77 68 65 6e 20 72 75 6e 6e 69 6e 67 20  .#.when running 
3cd0: 74 65 73 74 73 20 66 72 6f 6d 20 61 6e 20 65 78  tests from an ex
3ce0: 74 65 6e 73 69 6f 6e 20 62 75 69 6c 64 20 64 69  tension build di
3cf0: 72 65 63 74 6f 72 79 2e 20 49 74 20 69 73 20 6e  rectory. It is n
3d00: 6f 74 0a 23 09 63 6f 72 72 65 63 74 20 74 6f 20  ot.#.correct to 
3d10: 75 73 65 20 74 68 65 20 54 43 4c 53 48 5f 50 52  use the TCLSH_PR
3d20: 4f 47 20 69 6e 20 63 61 73 65 73 20 6c 69 6b 65  OG in cases like
3d30: 20 74 68 69 73 2e 0a 23 0a 23 20 41 72 67 75 6d   this..#.# Argum
3d40: 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23  ents:.#.none.#.#
3d50: 20 52 65 73 75 6c 74 73 3a 0a 23 09 53 75 62 73   Results:.#.Subs
3d60: 74 69 74 75 74 65 73 20 74 68 65 20 66 6f 6c 6c  titutes the foll
3d70: 6f 77 69 6e 67 20 76 61 6c 75 65 73 3a 0a 23 09  owing values:.#.
3d80: 09 42 55 49 4c 44 5f 54 43 4c 53 48 0a 23 2d 2d  .BUILD_TCLSH.#--
3d90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3da0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3db0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3dc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3dd0: 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e  ------..AC_DEFUN
3de0: 28 5b 53 43 5f 42 55 49 4c 44 5f 54 43 4c 53 48  ([SC_BUILD_TCLSH
3df0: 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d 53 47 5f  ], [.    AC_MSG_
3e00: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 74 63  CHECKING([for tc
3e10: 6c 73 68 20 69 6e 20 54 63 6c 20 62 75 69 6c 64  lsh in Tcl build
3e20: 20 64 69 72 65 63 74 6f 72 79 5d 29 0a 20 20 20   directory]).   
3e30: 20 42 55 49 4c 44 5f 54 43 4c 53 48 3d 22 24 7b   BUILD_TCLSH="${
3e40: 54 43 4c 5f 42 49 4e 5f 44 49 52 7d 22 2f 74 63  TCL_BIN_DIR}"/tc
3e50: 6c 73 68 0a 20 20 20 20 41 43 5f 4d 53 47 5f 52  lsh.    AC_MSG_R
3e60: 45 53 55 4c 54 28 5b 24 42 55 49 4c 44 5f 54 43  ESULT([$BUILD_TC
3e70: 4c 53 48 5d 29 0a 20 20 20 20 41 43 5f 53 55 42  LSH]).    AC_SUB
3e80: 53 54 28 42 55 49 4c 44 5f 54 43 4c 53 48 29 0a  ST(BUILD_TCLSH).
3e90: 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ])..#-----------
3ea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3eb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3ec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3ed0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
3ee0: 53 43 5f 45 4e 41 42 4c 45 5f 53 48 41 52 45 44  SC_ENABLE_SHARED
3ef0: 20 2d 2d 0a 23 0a 23 09 41 6c 6c 6f 77 73 20 74   --.#.#.Allows t
3f00: 68 65 20 62 75 69 6c 64 69 6e 67 20 6f 66 20 73  he building of s
3f10: 68 61 72 65 64 20 6c 69 62 72 61 72 69 65 73 0a  hared libraries.
3f20: 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23  #.# Arguments:.#
3f30: 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74  .none.#.# Result
3f40: 73 3a 0a 23 0a 23 09 41 64 64 73 20 74 68 65 20  s:.#.#.Adds the 
3f50: 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65  following argume
3f60: 6e 74 73 20 74 6f 20 63 6f 6e 66 69 67 75 72 65  nts to configure
3f70: 3a 0a 23 09 09 2d 2d 65 6e 61 62 6c 65 2d 73 68  :.#..--enable-sh
3f80: 61 72 65 64 3d 79 65 73 7c 6e 6f 0a 23 0a 23 09  ared=yes|no.#.#.
3f90: 44 65 66 69 6e 65 73 20 74 68 65 20 66 6f 6c 6c  Defines the foll
3fa0: 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 53  owing vars:.#..S
3fb0: 54 41 54 49 43 5f 42 55 49 4c 44 09 55 73 65 64  TATIC_BUILD.Used
3fc0: 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 69 6d   for building im
3fd0: 70 6f 72 74 2f 65 78 70 6f 72 74 20 6c 69 62 72  port/export libr
3fe0: 61 72 69 65 73 0a 23 09 09 09 09 6f 6e 20 57 69  aries.#....on Wi
3ff0: 6e 64 6f 77 73 2e 0a 23 0a 23 09 53 65 74 73 20  ndows..#.#.Sets 
4000: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
4010: 72 73 3a 0a 23 09 09 53 48 41 52 45 44 5f 42 55  rs:.#..SHARED_BU
4020: 49 4c 44 09 56 61 6c 75 65 20 6f 66 20 31 20 6f  ILD.Value of 1 o
4030: 72 20 30 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  r 0.#-----------
4040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4050: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4060: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4070: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41  -------------..A
4080: 43 5f 44 45 46 55 4e 28 5b 53 43 5f 45 4e 41 42  C_DEFUN([SC_ENAB
4090: 4c 45 5f 53 48 41 52 45 44 5d 2c 20 5b 0a 20 20  LE_SHARED], [.  
40a0: 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e    AC_MSG_CHECKIN
40b0: 47 28 5b 68 6f 77 20 74 6f 20 62 75 69 6c 64 20  G([how to build 
40c0: 6c 69 62 72 61 72 69 65 73 5d 29 0a 20 20 20 20  libraries]).    
40d0: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 73 68  AC_ARG_ENABLE(sh
40e0: 61 72 65 64 2c 0a 09 41 43 5f 48 45 4c 50 5f 53  ared,..AC_HELP_S
40f0: 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d  TRING([--enable-
4100: 73 68 61 72 65 64 5d 2c 0a 09 20 20 20 20 5b 62  shared],..    [b
4110: 75 69 6c 64 20 61 6e 64 20 6c 69 6e 6b 20 77 69  uild and link wi
4120: 74 68 20 73 68 61 72 65 64 20 6c 69 62 72 61 72  th shared librar
4130: 69 65 73 20 28 64 65 66 61 75 6c 74 3a 20 6f 6e  ies (default: on
4140: 29 5d 29 2c 0a 09 5b 74 63 6c 5f 6f 6b 3d 24 65  )]),..[tcl_ok=$e
4150: 6e 61 62 6c 65 76 61 6c 5d 2c 20 5b 74 63 6c 5f  nableval], [tcl_
4160: 6f 6b 3d 79 65 73 5d 29 0a 0a 20 20 20 20 69 66  ok=yes])..    if
4170: 20 74 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 5f   test "${enable_
4180: 73 68 61 72 65 64 2b 73 65 74 7d 22 20 3d 20 73  shared+set}" = s
4190: 65 74 3b 20 74 68 65 6e 0a 09 65 6e 61 62 6c 65  et; then..enable
41a0: 76 61 6c 3d 22 24 65 6e 61 62 6c 65 5f 73 68 61  val="$enable_sha
41b0: 72 65 64 22 0a 09 74 63 6c 5f 6f 6b 3d 24 65 6e  red"..tcl_ok=$en
41c0: 61 62 6c 65 76 61 6c 0a 20 20 20 20 65 6c 73 65  ableval.    else
41d0: 0a 09 74 63 6c 5f 6f 6b 3d 79 65 73 0a 20 20 20  ..tcl_ok=yes.   
41e0: 20 66 69 0a 0a 20 20 20 20 69 66 20 74 65 73 74   fi..    if test
41f0: 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 22 79 65   "$tcl_ok" = "ye
4200: 73 22 20 3b 20 74 68 65 6e 0a 09 41 43 5f 4d 53  s" ; then..AC_MS
4210: 47 5f 52 45 53 55 4c 54 28 5b 73 68 61 72 65 64  G_RESULT([shared
4220: 5d 29 0a 09 53 48 41 52 45 44 5f 42 55 49 4c 44  ])..SHARED_BUILD
4230: 3d 31 0a 20 20 20 20 65 6c 73 65 0a 09 41 43 5f  =1.    else..AC_
4240: 4d 53 47 5f 52 45 53 55 4c 54 28 5b 73 74 61 74  MSG_RESULT([stat
4250: 69 63 5d 29 0a 09 53 48 41 52 45 44 5f 42 55 49  ic])..SHARED_BUI
4260: 4c 44 3d 30 0a 09 41 43 5f 44 45 46 49 4e 45 28  LD=0..AC_DEFINE(
4270: 53 54 41 54 49 43 5f 42 55 49 4c 44 2c 20 31 2c  STATIC_BUILD, 1,
4280: 20 5b 49 73 20 74 68 69 73 20 61 20 73 74 61 74   [Is this a stat
4290: 69 63 20 62 75 69 6c 64 3f 5d 29 0a 20 20 20 20  ic build?]).    
42a0: 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.])..#--------
42b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
42c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
42d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
42e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
42f0: 0a 23 20 53 43 5f 45 4e 41 42 4c 45 5f 46 52 41  .# SC_ENABLE_FRA
4300: 4d 45 57 4f 52 4b 20 2d 2d 0a 23 0a 23 09 41 6c  MEWORK --.#.#.Al
4310: 6c 6f 77 73 20 74 68 65 20 62 75 69 6c 64 69 6e  lows the buildin
4320: 67 20 6f 66 20 73 68 61 72 65 64 20 6c 69 62 72  g of shared libr
4330: 61 72 69 65 73 20 69 6e 74 6f 20 66 72 61 6d 65  aries into frame
4340: 77 6f 72 6b 73 0a 23 0a 23 20 41 72 67 75 6d 65  works.#.# Argume
4350: 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20  nts:.#.none.#.# 
4360: 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 41 64 64  Results:.#.#.Add
4370: 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  s the following 
4380: 61 72 67 75 6d 65 6e 74 73 20 74 6f 20 63 6f 6e  arguments to con
4390: 66 69 67 75 72 65 3a 0a 23 09 09 2d 2d 65 6e 61  figure:.#..--ena
43a0: 62 6c 65 2d 66 72 61 6d 65 77 6f 72 6b 3d 79 65  ble-framework=ye
43b0: 73 7c 6e 6f 0a 23 0a 23 09 53 65 74 73 20 74 68  s|no.#.#.Sets th
43c0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
43d0: 3a 0a 23 09 09 46 52 41 4d 45 57 4f 52 4b 5f 42  :.#..FRAMEWORK_B
43e0: 55 49 4c 44 09 56 61 6c 75 65 20 6f 66 20 31 20  UILD.Value of 1 
43f0: 6f 72 20 30 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  or 0.#----------
4400: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4410: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4420: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4430: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
4440: 41 43 5f 44 45 46 55 4e 28 5b 53 43 5f 45 4e 41  AC_DEFUN([SC_ENA
4450: 42 4c 45 5f 46 52 41 4d 45 57 4f 52 4b 5d 2c 20  BLE_FRAMEWORK], 
4460: 5b 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 60  [.    if test "`
4470: 75 6e 61 6d 65 20 2d 73 60 22 20 3d 20 22 44 61  uname -s`" = "Da
4480: 72 77 69 6e 22 20 3b 20 74 68 65 6e 0a 09 41 43  rwin" ; then..AC
4490: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 68  _MSG_CHECKING([h
44a0: 6f 77 20 74 6f 20 70 61 63 6b 61 67 65 20 6c 69  ow to package li
44b0: 62 72 61 72 69 65 73 5d 29 0a 09 41 43 5f 41 52  braries])..AC_AR
44c0: 47 5f 45 4e 41 42 4c 45 28 66 72 61 6d 65 77 6f  G_ENABLE(framewo
44d0: 72 6b 2c 0a 09 20 20 20 20 41 43 5f 48 45 4c 50  rk,..    AC_HELP
44e0: 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c  _STRING([--enabl
44f0: 65 2d 66 72 61 6d 65 77 6f 72 6b 5d 2c 0a 09 09  e-framework],...
4500: 5b 70 61 63 6b 61 67 65 20 73 68 61 72 65 64 20  [package shared 
4510: 6c 69 62 72 61 72 69 65 73 20 69 6e 20 4d 61 63  libraries in Mac
4520: 4f 53 58 20 66 72 61 6d 65 77 6f 72 6b 73 20 28  OSX frameworks (
4530: 64 65 66 61 75 6c 74 3a 20 6f 66 66 29 5d 29 2c  default: off)]),
4540: 0a 09 20 20 20 20 5b 65 6e 61 62 6c 65 5f 66 72  ..    [enable_fr
4550: 61 6d 65 77 6f 72 6b 3d 24 65 6e 61 62 6c 65 76  amework=$enablev
4560: 61 6c 5d 2c 20 5b 65 6e 61 62 6c 65 5f 66 72 61  al], [enable_fra
4570: 6d 65 77 6f 72 6b 3d 6e 6f 5d 29 0a 09 69 66 20  mework=no])..if 
4580: 74 65 73 74 20 24 65 6e 61 62 6c 65 5f 66 72 61  test $enable_fra
4590: 6d 65 77 6f 72 6b 20 3d 20 79 65 73 3b 20 74 68  mework = yes; th
45a0: 65 6e 0a 09 20 20 20 20 69 66 20 74 65 73 74 20  en..    if test 
45b0: 24 53 48 41 52 45 44 5f 42 55 49 4c 44 20 3d 20  $SHARED_BUILD = 
45c0: 30 3b 20 74 68 65 6e 0a 09 09 41 43 5f 4d 53 47  0; then...AC_MSG
45d0: 5f 57 41 52 4e 28 5b 46 72 61 6d 65 77 6f 72 6b  _WARN([Framework
45e0: 73 20 63 61 6e 20 6f 6e 6c 79 20 62 65 20 62 75  s can only be bu
45f0: 69 6c 74 20 69 66 20 2d 2d 65 6e 61 62 6c 65 2d  ilt if --enable-
4600: 73 68 61 72 65 64 20 69 73 20 79 65 73 5d 29 0a  shared is yes]).
4610: 09 09 65 6e 61 62 6c 65 5f 66 72 61 6d 65 77 6f  ..enable_framewo
4620: 72 6b 3d 6e 6f 0a 09 20 20 20 20 66 69 0a 09 20  rk=no..    fi.. 
4630: 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f     if test $tcl_
4640: 63 6f 72 65 66 6f 75 6e 64 61 74 69 6f 6e 20 3d  corefoundation =
4650: 20 6e 6f 3b 20 74 68 65 6e 0a 09 09 41 43 5f 4d   no; then...AC_M
4660: 53 47 5f 57 41 52 4e 28 5b 46 72 61 6d 65 77 6f  SG_WARN([Framewo
4670: 72 6b 73 20 63 61 6e 20 6f 6e 6c 79 20 62 65 20  rks can only be 
4680: 75 73 65 64 20 77 68 65 6e 20 43 6f 72 65 46 6f  used when CoreFo
4690: 75 6e 64 61 74 69 6f 6e 20 69 73 20 61 76 61 69  undation is avai
46a0: 6c 61 62 6c 65 5d 29 0a 09 09 65 6e 61 62 6c 65  lable])...enable
46b0: 5f 66 72 61 6d 65 77 6f 72 6b 3d 6e 6f 0a 09 20  _framework=no.. 
46c0: 20 20 20 66 69 0a 09 66 69 0a 09 69 66 20 74 65     fi..fi..if te
46d0: 73 74 20 24 65 6e 61 62 6c 65 5f 66 72 61 6d 65  st $enable_frame
46e0: 77 6f 72 6b 20 3d 20 79 65 73 3b 20 74 68 65 6e  work = yes; then
46f0: 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53  ..    AC_MSG_RES
4700: 55 4c 54 28 5b 66 72 61 6d 65 77 6f 72 6b 5d 29  ULT([framework])
4710: 0a 09 20 20 20 20 46 52 41 4d 45 57 4f 52 4b 5f  ..    FRAMEWORK_
4720: 42 55 49 4c 44 3d 31 0a 09 65 6c 73 65 0a 09 20  BUILD=1..else.. 
4730: 20 20 20 69 66 20 74 65 73 74 20 24 53 48 41 52     if test $SHAR
4740: 45 44 5f 42 55 49 4c 44 20 3d 20 31 3b 20 74 68  ED_BUILD = 1; th
4750: 65 6e 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55  en...AC_MSG_RESU
4760: 4c 54 28 5b 73 68 61 72 65 64 20 6c 69 62 72 61  LT([shared libra
4770: 72 79 5d 29 0a 09 20 20 20 20 65 6c 73 65 0a 09  ry])..    else..
4780: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b  .AC_MSG_RESULT([
4790: 73 74 61 74 69 63 20 6c 69 62 72 61 72 79 5d 29  static library])
47a0: 0a 09 20 20 20 20 66 69 0a 09 20 20 20 20 46 52  ..    fi..    FR
47b0: 41 4d 45 57 4f 52 4b 5f 42 55 49 4c 44 3d 30 0a  AMEWORK_BUILD=0.
47c0: 09 66 69 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23  .fi.    fi.])..#
47d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
47e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
47f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4800: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4810: 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 45 4e  --------.# SC_EN
4820: 41 42 4c 45 5f 54 48 52 45 41 44 53 20 2d 2d 0a  ABLE_THREADS --.
4830: 23 0a 23 09 53 70 65 63 69 66 79 20 69 66 20 74  #.#.Specify if t
4840: 68 72 65 61 64 20 73 75 70 70 6f 72 74 20 73 68  hread support sh
4850: 6f 75 6c 64 20 62 65 20 65 6e 61 62 6c 65 64 0a  ould be enabled.
4860: 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23  #.# Arguments:.#
4870: 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74  .none.#.# Result
4880: 73 3a 0a 23 0a 23 09 41 64 64 73 20 74 68 65 20  s:.#.#.Adds the 
4890: 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65  following argume
48a0: 6e 74 73 20 74 6f 20 63 6f 6e 66 69 67 75 72 65  nts to configure
48b0: 3a 0a 23 09 09 2d 2d 65 6e 61 62 6c 65 2d 74 68  :.#..--enable-th
48c0: 72 65 61 64 73 0a 23 0a 23 09 53 65 74 73 20 74  reads.#.#.Sets t
48d0: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72  he following var
48e0: 73 3a 0a 23 09 09 54 48 52 45 41 44 53 5f 4c 49  s:.#..THREADS_LI
48f0: 42 53 09 54 68 72 65 61 64 20 6c 69 62 72 61 72  BS.Thread librar
4900: 79 28 73 29 0a 23 0a 23 09 44 65 66 69 6e 65 73  y(s).#.#.Defines
4910: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76   the following v
4920: 61 72 73 3a 0a 23 09 09 54 43 4c 5f 54 48 52 45  ars:.#..TCL_THRE
4930: 41 44 53 0a 23 09 09 5f 52 45 45 4e 54 52 41 4e  ADS.#.._REENTRAN
4940: 54 0a 23 09 09 5f 54 48 52 45 41 44 5f 53 41 46  T.#.._THREAD_SAF
4950: 45 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  E.#.#-----------
4960: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4970: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4980: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
4990: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41  -------------..A
49a0: 43 5f 44 45 46 55 4e 28 5b 53 43 5f 45 4e 41 42  C_DEFUN([SC_ENAB
49b0: 4c 45 5f 54 48 52 45 41 44 53 5d 2c 20 5b 0a 20  LE_THREADS], [. 
49c0: 20 20 20 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45     AC_ARG_ENABLE
49d0: 28 74 68 72 65 61 64 73 2c 0a 09 41 43 5f 48 45  (threads,..AC_HE
49e0: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61  LP_STRING([--ena
49f0: 62 6c 65 2d 74 68 72 65 61 64 73 5d 2c 0a 09 20  ble-threads],.. 
4a00: 20 20 20 5b 62 75 69 6c 64 20 77 69 74 68 20 74     [build with t
4a10: 68 72 65 61 64 73 20 28 64 65 66 61 75 6c 74 3a  hreads (default:
4a20: 20 6f 6e 29 5d 29 2c 0a 09 5b 74 63 6c 5f 6f 6b   on)]),..[tcl_ok
4a30: 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20 5b 74  =$enableval], [t
4a40: 63 6c 5f 6f 6b 3d 79 65 73 5d 29 0a 0a 20 20 20  cl_ok=yes])..   
4a50: 20 69 66 20 74 65 73 74 20 22 24 7b 54 43 4c 5f   if test "${TCL_
4a60: 54 48 52 45 41 44 53 7d 22 20 3d 20 31 3b 20 74  THREADS}" = 1; t
4a70: 68 65 6e 0a 09 74 63 6c 5f 74 68 72 65 61 64 65  hen..tcl_threade
4a80: 64 5f 63 6f 72 65 3d 31 3b 0a 20 20 20 20 66 69  d_core=1;.    fi
4a90: 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24  ..    if test "$
4aa0: 74 63 6c 5f 6f 6b 22 20 3d 20 22 79 65 73 22 20  tcl_ok" = "yes" 
4ab0: 2d 6f 20 22 24 7b 54 43 4c 5f 54 48 52 45 41 44  -o "${TCL_THREAD
4ac0: 53 7d 22 20 3d 20 31 3b 20 74 68 65 6e 0a 09 54  S}" = 1; then..T
4ad0: 43 4c 5f 54 48 52 45 41 44 53 3d 31 0a 09 23 20  CL_THREADS=1..# 
4ae0: 55 53 45 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43  USE_THREAD_ALLOC
4af0: 20 74 65 6c 6c 73 20 75 73 20 74 6f 20 74 72 79   tells us to try
4b00: 20 74 68 65 20 73 70 65 63 69 61 6c 20 74 68 72   the special thr
4b10: 65 61 64 2d 62 61 73 65 64 0a 09 23 20 61 6c 6c  ead-based..# all
4b20: 6f 63 61 74 6f 72 20 74 68 61 74 20 73 69 67 6e  ocator that sign
4b30: 69 66 69 63 61 6e 74 6c 79 20 72 65 64 75 63 65  ificantly reduce
4b40: 73 20 6c 6f 63 6b 20 63 6f 6e 74 65 6e 74 69 6f  s lock contentio
4b50: 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 55 53 45  n..AC_DEFINE(USE
4b60: 5f 54 48 52 45 41 44 5f 41 4c 4c 4f 43 2c 20 31  _THREAD_ALLOC, 1
4b70: 2c 0a 09 20 20 20 20 5b 44 6f 20 77 65 20 77 61  ,..    [Do we wa
4b80: 6e 74 20 74 6f 20 75 73 65 20 74 68 65 20 74 68  nt to use the th
4b90: 72 65 61 64 65 64 20 6d 65 6d 6f 72 79 20 61 6c  readed memory al
4ba0: 6c 6f 63 61 74 6f 72 3f 5d 29 0a 09 41 43 5f 44  locator?])..AC_D
4bb0: 45 46 49 4e 45 28 5f 52 45 45 4e 54 52 41 4e 54  EFINE(_REENTRANT
4bc0: 2c 20 31 2c 20 5b 44 6f 20 77 65 20 77 61 6e 74  , 1, [Do we want
4bd0: 20 74 68 65 20 72 65 65 6e 74 72 61 6e 74 20 4f   the reentrant O
4be0: 53 20 41 50 49 3f 5d 29 0a 09 69 66 20 74 65 73  S API?])..if tes
4bf0: 74 20 22 60 75 6e 61 6d 65 20 2d 73 60 22 20 3d  t "`uname -s`" =
4c00: 20 22 53 75 6e 4f 53 22 20 3b 20 74 68 65 6e 0a   "SunOS" ; then.
4c10: 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28 5f  .    AC_DEFINE(_
4c20: 50 4f 53 49 58 5f 50 54 48 52 45 41 44 5f 53 45  POSIX_PTHREAD_SE
4c30: 4d 41 4e 54 49 43 53 2c 20 31 2c 0a 09 09 20 20  MANTICS, 1,...  
4c40: 20 20 5b 44 6f 20 77 65 20 72 65 61 6c 6c 79 20    [Do we really 
4c50: 77 61 6e 74 20 74 6f 20 66 6f 6c 6c 6f 77 20 74  want to follow t
4c60: 68 65 20 73 74 61 6e 64 61 72 64 3f 20 59 65 73  he standard? Yes
4c70: 20 77 65 20 64 6f 21 5d 29 0a 09 66 69 0a 09 41   we do!])..fi..A
4c80: 43 5f 44 45 46 49 4e 45 28 5f 54 48 52 45 41 44  C_DEFINE(_THREAD
4c90: 5f 53 41 46 45 2c 20 31 2c 20 5b 44 6f 20 77 65  _SAFE, 1, [Do we
4ca0: 20 77 61 6e 74 20 74 68 65 20 74 68 72 65 61 64   want the thread
4cb0: 2d 73 61 66 65 20 4f 53 20 41 50 49 3f 5d 29 0a  -safe OS API?]).
4cc0: 09 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 70 74  .AC_CHECK_LIB(pt
4cd0: 68 72 65 61 64 2c 70 74 68 72 65 61 64 5f 6d 75  hread,pthread_mu
4ce0: 74 65 78 5f 69 6e 69 74 2c 74 63 6c 5f 6f 6b 3d  tex_init,tcl_ok=
4cf0: 79 65 73 2c 74 63 6c 5f 6f 6b 3d 6e 6f 29 0a 09  yes,tcl_ok=no)..
4d00: 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b  if test "$tcl_ok
4d10: 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09  " = "no"; then..
4d20: 20 20 20 20 23 20 43 68 65 63 6b 20 61 20 6c 69      # Check a li
4d30: 74 74 6c 65 20 68 61 72 64 65 72 20 66 6f 72 20  ttle harder for 
4d40: 5f 5f 70 74 68 72 65 61 64 5f 6d 75 74 65 78 5f  __pthread_mutex_
4d50: 69 6e 69 74 20 69 6e 20 74 68 65 20 73 61 6d 65  init in the same
4d60: 0a 09 20 20 20 20 23 20 6c 69 62 72 61 72 79 2c  ..    # library,
4d70: 20 61 73 20 73 6f 6d 65 20 73 79 73 74 65 6d 73   as some systems
4d80: 20 68 69 64 65 20 69 74 20 74 68 65 72 65 20 75   hide it there u
4d90: 6e 74 69 6c 20 70 74 68 72 65 61 64 2e 68 20 69  ntil pthread.h i
4da0: 73 0a 09 20 20 20 20 23 20 64 65 66 69 6e 65 64  s..    # defined
4db0: 2e 20 20 57 65 20 63 6f 75 6c 64 20 61 6c 74 65  .  We could alte
4dc0: 72 6e 61 74 69 76 65 6c 79 20 64 6f 20 61 6e 20  rnatively do an 
4dd0: 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 20 77  AC_TRY_COMPILE w
4de0: 69 74 68 0a 09 20 20 20 20 23 20 70 74 68 72 65  ith..    # pthre
4df0: 61 64 2e 68 2c 20 62 75 74 20 74 68 61 74 20 77  ad.h, but that w
4e00: 69 6c 6c 20 77 6f 72 6b 20 77 69 74 68 20 6c 69  ill work with li
4e10: 62 70 74 68 72 65 61 64 20 72 65 61 6c 6c 79 20  bpthread really 
4e20: 64 6f 65 73 6e 27 74 0a 09 20 20 20 20 23 20 65  doesn't..    # e
4e30: 78 69 73 74 2c 20 6c 69 6b 65 20 41 49 58 20 34  xist, like AIX 4
4e40: 2e 32 2e 20 20 5b 42 75 67 3a 20 34 33 35 39 5d  .2.  [Bug: 4359]
4e50: 0a 09 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c  ..    AC_CHECK_L
4e60: 49 42 28 70 74 68 72 65 61 64 2c 20 5f 5f 70 74  IB(pthread, __pt
4e70: 68 72 65 61 64 5f 6d 75 74 65 78 5f 69 6e 69 74  hread_mutex_init
4e80: 2c 0a 09 09 74 63 6c 5f 6f 6b 3d 79 65 73 2c 20  ,...tcl_ok=yes, 
4e90: 74 63 6c 5f 6f 6b 3d 6e 6f 29 0a 09 66 69 0a 0a  tcl_ok=no)..fi..
4ea0: 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f  .if test "$tcl_o
4eb0: 6b 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e  k" = "yes"; then
4ec0: 0a 09 20 20 20 20 23 20 54 68 65 20 73 70 61 63  ..    # The spac
4ed0: 65 20 69 73 20 6e 65 65 64 65 64 0a 09 20 20 20  e is needed..   
4ee0: 20 54 48 52 45 41 44 53 5f 4c 49 42 53 3d 22 20   THREADS_LIBS=" 
4ef0: 2d 6c 70 74 68 72 65 61 64 22 0a 09 65 6c 73 65  -lpthread"..else
4f00: 0a 09 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c  ..    AC_CHECK_L
4f10: 49 42 28 70 74 68 72 65 61 64 73 2c 20 70 74 68  IB(pthreads, pth
4f20: 72 65 61 64 5f 6d 75 74 65 78 5f 69 6e 69 74 2c  read_mutex_init,
4f30: 0a 09 09 74 63 6c 5f 6f 6b 3d 79 65 73 2c 20 74  ...tcl_ok=yes, t
4f40: 63 6c 5f 6f 6b 3d 6e 6f 29 0a 09 20 20 20 20 69  cl_ok=no)..    i
4f50: 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22  f test "$tcl_ok"
4f60: 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e 0a 09   = "yes"; then..
4f70: 09 23 20 54 68 65 20 73 70 61 63 65 20 69 73 20  .# The space is 
4f80: 6e 65 65 64 65 64 0a 09 09 54 48 52 45 41 44 53  needed...THREADS
4f90: 5f 4c 49 42 53 3d 22 20 2d 6c 70 74 68 72 65 61  _LIBS=" -lpthrea
4fa0: 64 73 22 0a 09 20 20 20 20 65 6c 73 65 0a 09 09  ds"..    else...
4fb0: 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 63 2c 20  AC_CHECK_LIB(c, 
4fc0: 70 74 68 72 65 61 64 5f 6d 75 74 65 78 5f 69 6e  pthread_mutex_in
4fd0: 69 74 2c 0a 09 09 20 20 20 20 74 63 6c 5f 6f 6b  it,...    tcl_ok
4fe0: 3d 79 65 73 2c 20 74 63 6c 5f 6f 6b 3d 6e 6f 29  =yes, tcl_ok=no)
4ff0: 0a 09 09 69 66 20 74 65 73 74 20 22 24 74 63 6c  ...if test "$tcl
5000: 5f 6f 6b 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65  _ok" = "no"; the
5010: 6e 0a 09 09 20 20 20 20 41 43 5f 43 48 45 43 4b  n...    AC_CHECK
5020: 5f 4c 49 42 28 63 5f 72 2c 20 70 74 68 72 65 61  _LIB(c_r, pthrea
5030: 64 5f 6d 75 74 65 78 5f 69 6e 69 74 2c 0a 09 09  d_mutex_init,...
5040: 09 74 63 6c 5f 6f 6b 3d 79 65 73 2c 20 74 63 6c  .tcl_ok=yes, tcl
5050: 5f 6f 6b 3d 6e 6f 29 0a 09 09 20 20 20 20 69 66  _ok=no)...    if
5060: 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20   test "$tcl_ok" 
5070: 3d 20 22 79 65 73 22 3b 20 74 68 65 6e 0a 09 09  = "yes"; then...
5080: 09 23 20 54 68 65 20 73 70 61 63 65 20 69 73 20  .# The space is 
5090: 6e 65 65 64 65 64 0a 09 09 09 54 48 52 45 41 44  needed....THREAD
50a0: 53 5f 4c 49 42 53 3d 22 20 2d 70 74 68 72 65 61  S_LIBS=" -pthrea
50b0: 64 22 0a 09 09 20 20 20 20 65 6c 73 65 0a 09 09  d"...    else...
50c0: 09 54 43 4c 5f 54 48 52 45 41 44 53 3d 30 0a 09  .TCL_THREADS=0..
50d0: 09 09 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 44  ..AC_MSG_WARN([D
50e0: 6f 6e 27 74 20 6b 6e 6f 77 20 68 6f 77 20 74 6f  on't know how to
50f0: 20 66 69 6e 64 20 70 74 68 72 65 61 64 20 6c 69   find pthread li
5100: 62 20 6f 6e 20 79 6f 75 72 20 73 79 73 74 65 6d  b on your system
5110: 20 2d 20 79 6f 75 20 6d 75 73 74 20 64 69 73 61   - you must disa
5120: 62 6c 65 20 74 68 72 65 61 64 20 73 75 70 70 6f  ble thread suppo
5130: 72 74 20 6f 72 20 65 64 69 74 20 74 68 65 20 4c  rt or edit the L
5140: 49 42 53 20 69 6e 20 74 68 65 20 4d 61 6b 65 66  IBS in the Makef
5150: 69 6c 65 2e 2e 2e 5d 29 0a 09 09 20 20 20 20 66  ile...])...    f
5160: 69 0a 09 09 66 69 0a 09 20 20 20 20 66 69 0a 09  i...fi..    fi..
5170: 66 69 0a 0a 09 23 20 44 6f 65 73 20 74 68 65 20  fi...# Does the 
5180: 70 74 68 72 65 61 64 2d 69 6d 70 6c 65 6d 65 6e  pthread-implemen
5190: 74 61 74 69 6f 6e 20 70 72 6f 76 69 64 65 0a 09  tation provide..
51a0: 23 20 27 70 74 68 72 65 61 64 5f 61 74 74 72 5f  # 'pthread_attr_
51b0: 73 65 74 73 74 61 63 6b 73 69 7a 65 27 20 3f 0a  setstacksize' ?.
51c0: 0a 09 61 63 5f 73 61 76 65 64 5f 6c 69 62 73 3d  ..ac_saved_libs=
51d0: 24 4c 49 42 53 0a 09 4c 49 42 53 3d 22 24 4c 49  $LIBS..LIBS="$LI
51e0: 42 53 20 24 54 48 52 45 41 44 53 5f 4c 49 42 53  BS $THREADS_LIBS
51f0: 22 0a 09 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43  "..AC_CHECK_FUNC
5200: 53 28 70 74 68 72 65 61 64 5f 61 74 74 72 5f 73  S(pthread_attr_s
5210: 65 74 73 74 61 63 6b 73 69 7a 65 20 70 74 68 72  etstacksize pthr
5220: 65 61 64 5f 61 74 66 6f 72 6b 29 0a 09 4c 49 42  ead_atfork)..LIB
5230: 53 3d 24 61 63 5f 73 61 76 65 64 5f 6c 69 62 73  S=$ac_saved_libs
5240: 0a 20 20 20 20 65 6c 73 65 0a 09 54 43 4c 5f 54  .    else..TCL_T
5250: 48 52 45 41 44 53 3d 30 0a 20 20 20 20 66 69 0a  HREADS=0.    fi.
5260: 20 20 20 20 23 20 44 6f 20 63 68 65 63 6b 69 6e      # Do checkin
5270: 67 20 6d 65 73 73 61 67 65 20 68 65 72 65 20 74  g message here t
5280: 6f 20 6e 6f 74 20 6d 65 73 73 20 75 70 20 69 6e  o not mess up in
5290: 74 65 72 6c 65 61 76 65 64 20 63 6f 6e 66 69 67  terleaved config
52a0: 75 72 65 20 6f 75 74 70 75 74 0a 20 20 20 20 41  ure output.    A
52b0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
52c0: 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 77 69 74  for building wit
52d0: 68 20 74 68 72 65 61 64 73 5d 29 0a 20 20 20 20  h threads]).    
52e0: 69 66 20 74 65 73 74 20 22 24 7b 54 43 4c 5f 54  if test "${TCL_T
52f0: 48 52 45 41 44 53 7d 22 20 3d 20 31 3b 20 74 68  HREADS}" = 1; th
5300: 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 54 43  en..AC_DEFINE(TC
5310: 4c 5f 54 48 52 45 41 44 53 2c 20 31 2c 20 5b 41  L_THREADS, 1, [A
5320: 72 65 20 77 65 20 62 75 69 6c 64 69 6e 67 20 77  re we building w
5330: 69 74 68 20 74 68 72 65 61 64 73 20 65 6e 61 62  ith threads enab
5340: 6c 65 64 3f 5d 29 0a 09 69 66 20 74 65 73 74 20  led?])..if test 
5350: 22 24 7b 74 63 6c 5f 74 68 72 65 61 64 65 64 5f  "${tcl_threaded_
5360: 63 6f 72 65 7d 22 20 3d 20 31 3b 20 74 68 65 6e  core}" = 1; then
5370: 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53  ..    AC_MSG_RES
5380: 55 4c 54 28 5b 79 65 73 20 28 74 68 72 65 61 64  ULT([yes (thread
5390: 65 64 20 63 6f 72 65 29 5d 29 0a 09 65 6c 73 65  ed core)])..else
53a0: 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 53  ..    AC_MSG_RES
53b0: 55 4c 54 28 5b 79 65 73 5d 29 0a 09 66 69 0a 20  ULT([yes])..fi. 
53c0: 20 20 20 65 6c 73 65 0a 09 41 43 5f 4d 53 47 5f     else..AC_MSG_
53d0: 52 45 53 55 4c 54 28 5b 6e 6f 5d 29 0a 20 20 20  RESULT([no]).   
53e0: 20 66 69 0a 0a 20 20 20 20 41 43 5f 53 55 42 53   fi..    AC_SUBS
53f0: 54 28 54 43 4c 5f 54 48 52 45 41 44 53 29 0a 5d  T(TCL_THREADS).]
5400: 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  )..#------------
5410: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5420: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5430: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5440: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53  ------------.# S
5450: 43 5f 45 4e 41 42 4c 45 5f 53 59 4d 42 4f 4c 53  C_ENABLE_SYMBOLS
5460: 20 2d 2d 0a 23 0a 23 09 53 70 65 63 69 66 79 20   --.#.#.Specify 
5470: 69 66 20 64 65 62 75 67 67 69 6e 67 20 73 79 6d  if debugging sym
5480: 62 6f 6c 73 20 73 68 6f 75 6c 64 20 62 65 20 75  bols should be u
5490: 73 65 64 2e 0a 23 09 4d 65 6d 6f 72 79 20 28 54  sed..#.Memory (T
54a0: 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 29 20 61 6e  CL_MEM_DEBUG) an
54b0: 64 20 63 6f 6d 70 69 6c 65 20 28 54 43 4c 5f 43  d compile (TCL_C
54c0: 4f 4d 50 49 4c 45 5f 44 45 42 55 47 29 20 64 65  OMPILE_DEBUG) de
54d0: 62 75 67 67 69 6e 67 0a 23 09 63 61 6e 20 61 6c  bugging.#.can al
54e0: 73 6f 20 62 65 20 65 6e 61 62 6c 65 64 2e 0a 23  so be enabled..#
54f0: 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
5500: 6e 6f 6e 65 0a 23 0a 23 09 52 65 71 75 69 72 65  none.#.#.Require
5510: 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  s the following 
5520: 76 61 72 73 20 74 6f 20 62 65 20 73 65 74 20 69  vars to be set i
5530: 6e 20 74 68 65 20 4d 61 6b 65 66 69 6c 65 3a 0a  n the Makefile:.
5540: 23 09 09 43 46 4c 41 47 53 5f 44 45 42 55 47 0a  #..CFLAGS_DEBUG.
5550: 23 09 09 43 46 4c 41 47 53 5f 4f 50 54 49 4d 49  #..CFLAGS_OPTIMI
5560: 5a 45 0a 23 09 09 4c 44 46 4c 41 47 53 5f 44 45  ZE.#..LDFLAGS_DE
5570: 42 55 47 0a 23 09 09 4c 44 46 4c 41 47 53 5f 4f  BUG.#..LDFLAGS_O
5580: 50 54 49 4d 49 5a 45 0a 23 0a 23 20 52 65 73 75  PTIMIZE.#.# Resu
5590: 6c 74 73 3a 0a 23 0a 23 09 41 64 64 73 20 74 68  lts:.#.#.Adds th
55a0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75  e following argu
55b0: 6d 65 6e 74 73 20 74 6f 20 63 6f 6e 66 69 67 75  ments to configu
55c0: 72 65 3a 0a 23 09 09 2d 2d 65 6e 61 62 6c 65 2d  re:.#..--enable-
55d0: 73 79 6d 62 6f 6c 73 0a 23 0a 23 09 44 65 66 69  symbols.#.#.Defi
55e0: 6e 65 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e  nes the followin
55f0: 67 20 76 61 72 73 3a 0a 23 09 09 43 46 4c 41 47  g vars:.#..CFLAG
5600: 53 5f 44 45 46 41 55 4c 54 09 53 65 74 73 20 74  S_DEFAULT.Sets t
5610: 6f 20 24 28 43 46 4c 41 47 53 5f 44 45 42 55 47  o $(CFLAGS_DEBUG
5620: 29 20 69 66 20 74 72 75 65 0a 23 09 09 09 09 53  ) if true.#....S
5630: 65 74 73 20 74 6f 20 24 28 43 46 4c 41 47 53 5f  ets to $(CFLAGS_
5640: 4f 50 54 49 4d 49 5a 45 29 20 69 66 20 66 61 6c  OPTIMIZE) if fal
5650: 73 65 0a 23 09 09 4c 44 46 4c 41 47 53 5f 44 45  se.#..LDFLAGS_DE
5660: 46 41 55 4c 54 09 53 65 74 73 20 74 6f 20 24 28  FAULT.Sets to $(
5670: 4c 44 46 4c 41 47 53 5f 44 45 42 55 47 29 20 69  LDFLAGS_DEBUG) i
5680: 66 20 74 72 75 65 0a 23 09 09 09 09 53 65 74 73  f true.#....Sets
5690: 20 74 6f 20 24 28 4c 44 46 4c 41 47 53 5f 4f 50   to $(LDFLAGS_OP
56a0: 54 49 4d 49 5a 45 29 20 69 66 20 66 61 6c 73 65  TIMIZE) if false
56b0: 0a 23 09 09 44 42 47 58 09 09 46 6f 72 6d 65 72  .#..DBGX..Former
56c0: 6c 79 20 75 73 65 64 20 61 73 20 64 65 62 75 67  ly used as debug
56d0: 20 6c 69 62 72 61 72 79 20 65 78 74 65 6e 73 69   library extensi
56e0: 6f 6e 3b 0a 23 09 09 09 09 61 6c 77 61 79 73 20  on;.#....always 
56f0: 62 6c 61 6e 6b 20 6e 6f 77 2e 0a 23 0a 23 2d 2d  blank now..#.#--
5700: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5710: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5720: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5730: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5740: 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e  ------..AC_DEFUN
5750: 28 5b 53 43 5f 45 4e 41 42 4c 45 5f 53 59 4d 42  ([SC_ENABLE_SYMB
5760: 4f 4c 53 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 4d  OLS], [.    AC_M
5770: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72  SG_CHECKING([for
5780: 20 62 75 69 6c 64 20 77 69 74 68 20 73 79 6d 62   build with symb
5790: 6f 6c 73 5d 29 0a 20 20 20 20 41 43 5f 41 52 47  ols]).    AC_ARG
57a0: 5f 45 4e 41 42 4c 45 28 73 79 6d 62 6f 6c 73 2c  _ENABLE(symbols,
57b0: 0a 09 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47  ..AC_HELP_STRING
57c0: 28 5b 2d 2d 65 6e 61 62 6c 65 2d 73 79 6d 62 6f  ([--enable-symbo
57d0: 6c 73 5d 2c 0a 09 20 20 20 20 5b 62 75 69 6c 64  ls],..    [build
57e0: 20 77 69 74 68 20 64 65 62 75 67 67 69 6e 67 20   with debugging 
57f0: 73 79 6d 62 6f 6c 73 20 28 64 65 66 61 75 6c 74  symbols (default
5800: 3a 20 6f 66 66 29 5d 29 2c 0a 09 5b 74 63 6c 5f  : off)]),..[tcl_
5810: 6f 6b 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20  ok=$enableval], 
5820: 5b 74 63 6c 5f 6f 6b 3d 6e 6f 5d 29 0a 23 20 46  [tcl_ok=no]).# F
5830: 49 58 4d 45 3a 20 43 75 72 72 65 6e 74 6c 79 2c  IXME: Currently,
5840: 20 4c 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54   LDFLAGS_DEFAULT
5850: 20 69 73 20 6e 6f 74 20 75 73 65 64 2c 20 69 74   is not used, it
5860: 20 73 68 6f 75 6c 64 20 77 6f 72 6b 20 6c 69 6b   should work lik
5870: 65 20 43 46 4c 41 47 53 5f 44 45 46 41 55 4c 54  e CFLAGS_DEFAULT
5880: 2e 0a 20 20 20 20 44 42 47 58 3d 22 22 0a 20 20  ..    DBGX="".  
5890: 20 20 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f    if test "$tcl_
58a0: 6f 6b 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e  ok" = "no"; then
58b0: 0a 09 43 46 4c 41 47 53 5f 44 45 46 41 55 4c 54  ..CFLAGS_DEFAULT
58c0: 3d 27 24 28 43 46 4c 41 47 53 5f 4f 50 54 49 4d  ='$(CFLAGS_OPTIM
58d0: 49 5a 45 29 27 0a 09 4c 44 46 4c 41 47 53 5f 44  IZE)'..LDFLAGS_D
58e0: 45 46 41 55 4c 54 3d 27 24 28 4c 44 46 4c 41 47  EFAULT='$(LDFLAG
58f0: 53 5f 4f 50 54 49 4d 49 5a 45 29 27 0a 09 41 43  S_OPTIMIZE)'..AC
5900: 5f 44 45 46 49 4e 45 28 4e 44 45 42 55 47 2c 20  _DEFINE(NDEBUG, 
5910: 31 2c 20 5b 49 73 20 6e 6f 20 64 65 62 75 67 67  1, [Is no debugg
5920: 69 6e 67 20 65 6e 61 62 6c 65 64 3f 5d 29 0a 09  ing enabled?])..
5930: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e  AC_MSG_RESULT([n
5940: 6f 5d 29 0a 09 41 43 5f 44 45 46 49 4e 45 28 54  o])..AC_DEFINE(T
5950: 43 4c 5f 43 46 47 5f 4f 50 54 49 4d 49 5a 45 44  CL_CFG_OPTIMIZED
5960: 2c 20 31 2c 20 5b 49 73 20 74 68 69 73 20 61 6e  , 1, [Is this an
5970: 20 6f 70 74 69 6d 69 7a 65 64 20 62 75 69 6c 64   optimized build
5980: 3f 5d 29 0a 20 20 20 20 65 6c 73 65 0a 09 43 46  ?]).    else..CF
5990: 4c 41 47 53 5f 44 45 46 41 55 4c 54 3d 27 24 28  LAGS_DEFAULT='$(
59a0: 43 46 4c 41 47 53 5f 44 45 42 55 47 29 27 0a 09  CFLAGS_DEBUG)'..
59b0: 4c 44 46 4c 41 47 53 5f 44 45 46 41 55 4c 54 3d  LDFLAGS_DEFAULT=
59c0: 27 24 28 4c 44 46 4c 41 47 53 5f 44 45 42 55 47  '$(LDFLAGS_DEBUG
59d0: 29 27 0a 09 69 66 20 74 65 73 74 20 22 24 74 63  )'..if test "$tc
59e0: 6c 5f 6f 6b 22 20 3d 20 22 79 65 73 22 3b 20 74  l_ok" = "yes"; t
59f0: 68 65 6e 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f  hen..    AC_MSG_
5a00: 52 45 53 55 4c 54 28 5b 79 65 73 20 28 73 74 61  RESULT([yes (sta
5a10: 6e 64 61 72 64 20 64 65 62 75 67 67 69 6e 67 29  ndard debugging)
5a20: 5d 29 0a 09 66 69 0a 20 20 20 20 66 69 0a 20 20  ])..fi.    fi.  
5a30: 20 20 41 43 5f 53 55 42 53 54 28 43 46 4c 41 47    AC_SUBST(CFLAG
5a40: 53 5f 44 45 46 41 55 4c 54 29 0a 20 20 20 20 41  S_DEFAULT).    A
5a50: 43 5f 53 55 42 53 54 28 4c 44 46 4c 41 47 53 5f  C_SUBST(LDFLAGS_
5a60: 44 45 46 41 55 4c 54 29 0a 0a 20 20 20 20 69 66  DEFAULT)..    if
5a70: 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20   test "$tcl_ok" 
5a80: 3d 20 22 6d 65 6d 22 20 2d 6f 20 22 24 74 63 6c  = "mem" -o "$tcl
5a90: 5f 6f 6b 22 20 3d 20 22 61 6c 6c 22 3b 20 74 68  _ok" = "all"; th
5aa0: 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 54 43  en..AC_DEFINE(TC
5ab0: 4c 5f 4d 45 4d 5f 44 45 42 55 47 2c 20 31 2c 20  L_MEM_DEBUG, 1, 
5ac0: 5b 49 73 20 6d 65 6d 6f 72 79 20 64 65 62 75 67  [Is memory debug
5ad0: 67 69 6e 67 20 65 6e 61 62 6c 65 64 3f 5d 29 0a  ging enabled?]).
5ae0: 20 20 20 20 66 69 0a 0a 20 20 20 20 69 66 65 6c      fi..    ifel
5af0: 73 65 28 24 31 2c 62 63 63 64 65 62 75 67 2c 64  se($1,bccdebug,d
5b00: 6e 6c 20 4f 6e 6c 79 20 65 6e 61 62 6c 65 20 27  nl Only enable '
5b10: 63 6f 6d 70 69 6c 65 27 20 66 6f 72 20 74 68 65  compile' for the
5b20: 20 54 63 6c 20 63 6f 72 65 20 69 74 73 65 6c 66   Tcl core itself
5b30: 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f  ..if test "$tcl_
5b40: 6f 6b 22 20 3d 20 22 63 6f 6d 70 69 6c 65 22 20  ok" = "compile" 
5b50: 2d 6f 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 22  -o "$tcl_ok" = "
5b60: 61 6c 6c 22 3b 20 74 68 65 6e 0a 09 20 20 20 20  all"; then..    
5b70: 41 43 5f 44 45 46 49 4e 45 28 54 43 4c 5f 43 4f  AC_DEFINE(TCL_CO
5b80: 4d 50 49 4c 45 5f 44 45 42 55 47 2c 20 31 2c 20  MPILE_DEBUG, 1, 
5b90: 5b 49 73 20 62 79 74 65 63 6f 64 65 20 64 65 62  [Is bytecode deb
5ba0: 75 67 67 69 6e 67 20 65 6e 61 62 6c 65 64 3f 5d  ugging enabled?]
5bb0: 29 0a 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45  )..    AC_DEFINE
5bc0: 28 54 43 4c 5f 43 4f 4d 50 49 4c 45 5f 53 54 41  (TCL_COMPILE_STA
5bd0: 54 53 2c 20 31 2c 20 5b 41 72 65 20 62 79 74 65  TS, 1, [Are byte
5be0: 63 6f 64 65 20 73 74 61 74 69 73 74 69 63 73 20  code statistics 
5bf0: 65 6e 61 62 6c 65 64 3f 5d 29 0a 09 66 69 29 0a  enabled?])..fi).
5c00: 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24 74  .    if test "$t
5c10: 63 6c 5f 6f 6b 22 20 21 3d 20 22 79 65 73 22 20  cl_ok" != "yes" 
5c20: 2d 61 20 22 24 74 63 6c 5f 6f 6b 22 20 21 3d 20  -a "$tcl_ok" != 
5c30: 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 69 66 20 74  "no"; then..if t
5c40: 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20  est "$tcl_ok" = 
5c50: 22 61 6c 6c 22 3b 20 74 68 65 6e 0a 09 20 20 20  "all"; then..   
5c60: 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b   AC_MSG_RESULT([
5c70: 65 6e 61 62 6c 65 64 20 73 79 6d 62 6f 6c 73 20  enabled symbols 
5c80: 6d 65 6d 20 5d 69 66 65 6c 73 65 28 24 31 2c 62  mem ]ifelse($1,b
5c90: 63 63 64 65 62 75 67 2c 5b 63 6f 6d 70 69 6c 65  ccdebug,[compile
5ca0: 20 5d 29 5b 64 65 62 75 67 67 69 6e 67 5d 29 0a   ])[debugging]).
5cb0: 09 65 6c 73 65 0a 09 20 20 20 20 41 43 5f 4d 53  .else..    AC_MS
5cc0: 47 5f 52 45 53 55 4c 54 28 5b 65 6e 61 62 6c 65  G_RESULT([enable
5cd0: 64 20 24 74 63 6c 5f 6f 6b 20 64 65 62 75 67 67  d $tcl_ok debugg
5ce0: 69 6e 67 5d 29 0a 09 66 69 0a 20 20 20 20 66 69  ing])..fi.    fi
5cf0: 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .])..#----------
5d00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5d10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5d20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5d30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
5d40: 20 53 43 5f 45 4e 41 42 4c 45 5f 4c 41 4e 47 49   SC_ENABLE_LANGI
5d50: 4e 46 4f 20 2d 2d 0a 23 0a 23 09 41 6c 6c 6f 77  NFO --.#.#.Allow
5d60: 73 20 75 73 65 20 6f 66 20 6d 6f 64 65 72 6e 20  s use of modern 
5d70: 6e 6c 5f 6c 61 6e 67 69 6e 66 6f 20 63 68 65 63  nl_langinfo chec
5d80: 6b 20 66 6f 72 20 62 65 74 74 65 72 20 6c 31 30  k for better l10
5d90: 6e 2e 0a 23 09 54 68 69 73 20 69 73 20 6f 6e 6c  n..#.This is onl
5da0: 79 20 72 65 6c 65 76 61 6e 74 20 66 6f 72 20 55  y relevant for U
5db0: 6e 69 78 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e  nix..#.# Argumen
5dc0: 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52  ts:.#.none.#.# R
5dd0: 65 73 75 6c 74 73 3a 0a 23 0a 23 09 41 64 64 73  esults:.#.#.Adds
5de0: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61   the following a
5df0: 72 67 75 6d 65 6e 74 73 20 74 6f 20 63 6f 6e 66  rguments to conf
5e00: 69 67 75 72 65 3a 0a 23 09 09 2d 2d 65 6e 61 62  igure:.#..--enab
5e10: 6c 65 2d 6c 61 6e 67 69 6e 66 6f 3d 79 65 73 7c  le-langinfo=yes|
5e20: 6e 6f 20 28 64 65 66 61 75 6c 74 20 69 73 20 79  no (default is y
5e30: 65 73 29 0a 23 0a 23 09 44 65 66 69 6e 65 73 20  es).#.#.Defines 
5e40: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
5e50: 72 73 3a 0a 23 09 09 48 41 56 45 5f 4c 41 4e 47  rs:.#..HAVE_LANG
5e60: 49 4e 46 4f 09 54 72 69 67 67 65 72 73 20 75 73  INFO.Triggers us
5e70: 65 20 6f 66 20 6e 6c 5f 6c 61 6e 67 69 6e 66 6f  e of nl_langinfo
5e80: 20 69 66 20 64 65 66 69 6e 65 64 2e 0a 23 2d 2d   if defined..#--
5e90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5ea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5eb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5ec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5ed0: 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e  ------..AC_DEFUN
5ee0: 28 5b 53 43 5f 45 4e 41 42 4c 45 5f 4c 41 4e 47  ([SC_ENABLE_LANG
5ef0: 49 4e 46 4f 5d 2c 20 5b 0a 20 20 20 20 41 43 5f  INFO], [.    AC_
5f00: 41 52 47 5f 45 4e 41 42 4c 45 28 6c 61 6e 67 69  ARG_ENABLE(langi
5f10: 6e 66 6f 2c 0a 09 41 43 5f 48 45 4c 50 5f 53 54  nfo,..AC_HELP_ST
5f20: 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 6c  RING([--enable-l
5f30: 61 6e 67 69 6e 66 6f 5d 2c 0a 09 20 20 20 20 5b  anginfo],..    [
5f40: 75 73 65 20 6e 6c 5f 6c 61 6e 67 69 6e 66 6f 20  use nl_langinfo 
5f50: 69 66 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 64  if possible to d
5f60: 65 74 65 72 6d 69 6e 65 20 65 6e 63 6f 64 69 6e  etermine encodin
5f70: 67 20 61 74 20 73 74 61 72 74 75 70 2c 20 6f 74  g at startup, ot
5f80: 68 65 72 77 69 73 65 20 75 73 65 20 6f 6c 64 20  herwise use old 
5f90: 68 65 75 72 69 73 74 69 63 20 28 64 65 66 61 75  heuristic (defau
5fa0: 6c 74 3a 20 6f 6e 29 5d 29 2c 0a 09 5b 6c 61 6e  lt: on)]),..[lan
5fb0: 67 69 6e 66 6f 5f 6f 6b 3d 24 65 6e 61 62 6c 65  ginfo_ok=$enable
5fc0: 76 61 6c 5d 2c 20 5b 6c 61 6e 67 69 6e 66 6f 5f  val], [langinfo_
5fd0: 6f 6b 3d 79 65 73 5d 29 0a 0a 20 20 20 20 48 41  ok=yes])..    HA
5fe0: 56 45 5f 4c 41 4e 47 49 4e 46 4f 3d 30 0a 20 20  VE_LANGINFO=0.  
5ff0: 20 20 69 66 20 74 65 73 74 20 22 24 6c 61 6e 67    if test "$lang
6000: 69 6e 66 6f 5f 6f 6b 22 20 3d 20 22 79 65 73 22  info_ok" = "yes"
6010: 3b 20 74 68 65 6e 0a 09 41 43 5f 43 48 45 43 4b  ; then..AC_CHECK
6020: 5f 48 45 41 44 45 52 28 6c 61 6e 67 69 6e 66 6f  _HEADER(langinfo
6030: 2e 68 2c 5b 6c 61 6e 67 69 6e 66 6f 5f 6f 6b 3d  .h,[langinfo_ok=
6040: 79 65 73 5d 2c 5b 6c 61 6e 67 69 6e 66 6f 5f 6f  yes],[langinfo_o
6050: 6b 3d 6e 6f 5d 29 0a 20 20 20 20 66 69 0a 20 20  k=no]).    fi.  
6060: 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e    AC_MSG_CHECKIN
6070: 47 28 5b 77 68 65 74 68 65 72 20 74 6f 20 75 73  G([whether to us
6080: 65 20 6e 6c 5f 6c 61 6e 67 69 6e 66 6f 5d 29 0a  e nl_langinfo]).
6090: 20 20 20 20 69 66 20 74 65 73 74 20 22 24 6c 61      if test "$la
60a0: 6e 67 69 6e 66 6f 5f 6f 6b 22 20 3d 20 22 79 65  nginfo_ok" = "ye
60b0: 73 22 3b 20 74 68 65 6e 0a 09 41 43 5f 43 41 43  s"; then..AC_CAC
60c0: 48 45 5f 56 41 4c 28 74 63 6c 5f 63 76 5f 6c 61  HE_VAL(tcl_cv_la
60d0: 6e 67 69 6e 66 6f 5f 68 2c 20 5b 0a 09 20 20 20  nginfo_h, [..   
60e0: 20 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28   AC_TRY_COMPILE(
60f0: 5b 23 69 6e 63 6c 75 64 65 20 3c 6c 61 6e 67 69  [#include <langi
6100: 6e 66 6f 2e 68 3e 5d 2c 20 5b 6e 6c 5f 6c 61 6e  nfo.h>], [nl_lan
6110: 67 69 6e 66 6f 28 43 4f 44 45 53 45 54 29 3b 5d  ginfo(CODESET);]
6120: 2c 0a 09 09 20 20 20 20 5b 74 63 6c 5f 63 76 5f  ,...    [tcl_cv_
6130: 6c 61 6e 67 69 6e 66 6f 5f 68 3d 79 65 73 5d 2c  langinfo_h=yes],
6140: 5b 74 63 6c 5f 63 76 5f 6c 61 6e 67 69 6e 66 6f  [tcl_cv_langinfo
6150: 5f 68 3d 6e 6f 5d 29 5d 29 0a 09 41 43 5f 4d 53  _h=no])])..AC_MS
6160: 47 5f 52 45 53 55 4c 54 28 5b 24 74 63 6c 5f 63  G_RESULT([$tcl_c
6170: 76 5f 6c 61 6e 67 69 6e 66 6f 5f 68 5d 29 0a 09  v_langinfo_h])..
6180: 69 66 20 74 65 73 74 20 24 74 63 6c 5f 63 76 5f  if test $tcl_cv_
6190: 6c 61 6e 67 69 6e 66 6f 5f 68 20 3d 20 79 65 73  langinfo_h = yes
61a0: 3b 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 44  ; then..    AC_D
61b0: 45 46 49 4e 45 28 48 41 56 45 5f 4c 41 4e 47 49  EFINE(HAVE_LANGI
61c0: 4e 46 4f 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68  NFO, 1, [Do we h
61d0: 61 76 65 20 6e 6c 5f 6c 61 6e 67 69 6e 66 6f 28  ave nl_langinfo(
61e0: 29 3f 5d 29 0a 09 66 69 0a 20 20 20 20 65 6c 73  )?])..fi.    els
61f0: 65 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  e..AC_MSG_RESULT
6200: 28 5b 24 6c 61 6e 67 69 6e 66 6f 5f 6f 6b 5d 29  ([$langinfo_ok])
6210: 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d  .    fi.])..#---
6220: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6230: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6240: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6260: 2d 0a 23 20 53 43 5f 43 4f 4e 46 49 47 5f 4d 41  -.# SC_CONFIG_MA
6270: 4e 50 41 47 45 53 0a 23 0a 23 09 44 65 63 69 64  NPAGES.#.#.Decid
6280: 65 20 77 68 65 74 68 65 72 20 74 6f 20 75 73 65  e whether to use
6290: 20 73 79 6d 6c 69 6e 6b 73 20 66 6f 72 20 6c 69   symlinks for li
62a0: 6e 6b 69 6e 67 20 74 68 65 20 6d 61 6e 70 61 67  nking the manpag
62b0: 65 73 2c 0a 23 09 77 68 65 74 68 65 72 20 74 6f  es,.#.whether to
62c0: 20 63 6f 6d 70 72 65 73 73 20 74 68 65 20 6d 61   compress the ma
62d0: 6e 70 61 67 65 73 20 61 66 74 65 72 20 69 6e 73  npages after ins
62e0: 74 61 6c 6c 61 74 69 6f 6e 2c 20 61 6e 64 0a 23  tallation, and.#
62f0: 09 77 68 65 74 68 65 72 20 74 6f 20 61 64 64 20  .whether to add 
6300: 61 20 70 61 63 6b 61 67 65 20 6e 61 6d 65 20 73  a package name s
6310: 75 66 66 69 78 20 74 6f 20 74 68 65 20 69 6e 73  uffix to the ins
6320: 74 61 6c 6c 65 64 0a 23 09 6d 61 6e 70 61 67 65  talled.#.manpage
6330: 73 20 74 6f 20 61 76 6f 69 64 66 69 6c 65 20 6e  s to avoidfile n
6340: 61 6d 65 20 63 6c 61 73 68 65 73 2e 0a 23 09 49  ame clashes..#.I
6350: 66 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 69 73  f compression is
6360: 20 65 6e 61 62 6c 65 64 20 61 6c 73 6f 20 66 69   enabled also fi
6370: 6e 64 20 6f 75 74 20 77 68 61 74 20 66 69 6c 65  nd out what file
6380: 20 6e 61 6d 65 20 73 75 66 66 69 78 0a 23 09 74   name suffix.#.t
6390: 68 65 20 67 69 76 65 6e 20 63 6f 6d 70 72 65 73  he given compres
63a0: 73 69 6f 6e 20 70 72 6f 67 72 61 6d 20 69 73 20  sion program is 
63b0: 75 73 69 6e 67 2e 0a 23 0a 23 20 41 72 67 75 6d  using..#.# Argum
63c0: 65 6e 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23  ents:.#.none.#.#
63d0: 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 41 64   Results:.#.#.Ad
63e0: 64 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ds the following
63f0: 20 61 72 67 75 6d 65 6e 74 73 20 74 6f 20 63 6f   arguments to co
6400: 6e 66 69 67 75 72 65 3a 0a 23 09 09 2d 2d 65 6e  nfigure:.#..--en
6410: 61 62 6c 65 2d 6d 61 6e 2d 73 79 6d 6c 69 6e 6b  able-man-symlink
6420: 73 0a 23 09 09 2d 2d 65 6e 61 62 6c 65 2d 6d 61  s.#..--enable-ma
6430: 6e 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 3d 50 52  n-compression=PR
6440: 4f 47 0a 23 09 09 2d 2d 65 6e 61 62 6c 65 2d 6d  OG.#..--enable-m
6450: 61 6e 2d 73 75 66 66 69 78 5b 3d 53 54 52 49 4e  an-suffix[=STRIN
6460: 47 5d 0a 23 0a 23 09 44 65 66 69 6e 65 73 20 74  G].#.#.Defines t
6470: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72  he following var
6480: 69 61 62 6c 65 3a 0a 23 0a 23 09 4d 41 4e 5f 46  iable:.#.#.MAN_F
6490: 4c 41 47 53 20 2d 09 54 68 65 20 61 70 72 6f 70  LAGS -.The aprop
64a0: 72 69 61 74 65 20 66 6c 61 67 73 20 66 6f 72 20  riate flags for 
64b0: 69 6e 73 74 61 6c 6c 4d 61 6e 50 61 67 65 0a 23  installManPage.#
64c0: 09 09 09 61 63 63 6f 72 64 69 6e 67 20 74 6f 20  ...according to 
64d0: 74 68 65 20 75 73 65 72 27 73 20 73 65 6c 65 63  the user's selec
64e0: 74 69 6f 6e 2e 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d  tion..#.#-------
64f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6500: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6510: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6520: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41  -------------..A
6530: 43 5f 44 45 46 55 4e 28 5b 53 43 5f 43 4f 4e 46  C_DEFUN([SC_CONF
6540: 49 47 5f 4d 41 4e 50 41 47 45 53 5d 2c 20 5b 0a  IG_MANPAGES], [.
6550: 20 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b      AC_MSG_CHECK
6560: 49 4e 47 28 5b 77 68 65 74 68 65 72 20 74 6f 20  ING([whether to 
6570: 75 73 65 20 73 79 6d 6c 69 6e 6b 73 20 66 6f 72  use symlinks for
6580: 20 6d 61 6e 70 61 67 65 73 5d 29 0a 20 20 20 20   manpages]).    
6590: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 6d 61  AC_ARG_ENABLE(ma
65a0: 6e 2d 73 79 6d 6c 69 6e 6b 73 2c 0a 09 41 43 5f  n-symlinks,..AC_
65b0: 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65  HELP_STRING([--e
65c0: 6e 61 62 6c 65 2d 6d 61 6e 2d 73 79 6d 6c 69 6e  nable-man-symlin
65d0: 6b 73 5d 2c 0a 09 20 20 20 20 5b 75 73 65 20 73  ks],..    [use s
65e0: 79 6d 6c 69 6e 6b 73 20 66 6f 72 20 74 68 65 20  ymlinks for the 
65f0: 6d 61 6e 70 61 67 65 73 20 28 64 65 66 61 75 6c  manpages (defaul
6600: 74 3a 20 6f 66 66 29 5d 29 2c 0a 09 74 65 73 74  t: off)]),..test
6610: 20 22 24 65 6e 61 62 6c 65 76 61 6c 22 20 21 3d   "$enableval" !=
6620: 20 22 6e 6f 22 20 26 26 20 4d 41 4e 5f 46 4c 41   "no" && MAN_FLA
6630: 47 53 3d 22 24 4d 41 4e 5f 46 4c 41 47 53 20 2d  GS="$MAN_FLAGS -
6640: 2d 73 79 6d 6c 69 6e 6b 73 22 2c 0a 09 65 6e 61  -symlinks",..ena
6650: 62 6c 65 76 61 6c 3d 22 6e 6f 22 29 0a 20 20 20  bleval="no").   
6660: 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b   AC_MSG_RESULT([
6670: 24 65 6e 61 62 6c 65 76 61 6c 5d 29 0a 0a 20 20  $enableval])..  
6680: 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e    AC_MSG_CHECKIN
6690: 47 28 5b 77 68 65 74 68 65 72 20 74 6f 20 63 6f  G([whether to co
66a0: 6d 70 72 65 73 73 20 74 68 65 20 6d 61 6e 70 61  mpress the manpa
66b0: 67 65 73 5d 29 0a 20 20 20 20 41 43 5f 41 52 47  ges]).    AC_ARG
66c0: 5f 45 4e 41 42 4c 45 28 6d 61 6e 2d 63 6f 6d 70  _ENABLE(man-comp
66d0: 72 65 73 73 69 6f 6e 2c 0a 09 41 43 5f 48 45 4c  ression,..AC_HEL
66e0: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62  P_STRING([--enab
66f0: 6c 65 2d 6d 61 6e 2d 63 6f 6d 70 72 65 73 73 69  le-man-compressi
6700: 6f 6e 3d 50 52 4f 47 5d 2c 0a 09 20 20 20 20 5b  on=PROG],..    [
6710: 63 6f 6d 70 72 65 73 73 20 74 68 65 20 6d 61 6e  compress the man
6720: 70 61 67 65 73 20 77 69 74 68 20 50 52 4f 47 20  pages with PROG 
6730: 28 64 65 66 61 75 6c 74 3a 20 6f 66 66 29 5d 29  (default: off)])
6740: 2c 0a 09 5b 63 61 73 65 20 24 65 6e 61 62 6c 65  ,..[case $enable
6750: 76 61 6c 20 69 6e 0a 09 20 20 20 20 79 65 73 29  val in..    yes)
6760: 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 6d   AC_MSG_ERROR([m
6770: 69 73 73 69 6e 67 20 61 72 67 75 6d 65 6e 74 20  issing argument 
6780: 74 6f 20 2d 2d 65 6e 61 62 6c 65 2d 6d 61 6e 2d  to --enable-man-
6790: 63 6f 6d 70 72 65 73 73 69 6f 6e 5d 29 3b 3b 0a  compression]);;.
67a0: 09 20 20 20 20 6e 6f 29 20 20 3b 3b 0a 09 20 20  .    no)  ;;..  
67b0: 20 20 2a 29 20 20 20 4d 41 4e 5f 46 4c 41 47 53    *)   MAN_FLAGS
67c0: 3d 22 24 4d 41 4e 5f 46 4c 41 47 53 20 2d 2d 63  ="$MAN_FLAGS --c
67d0: 6f 6d 70 72 65 73 73 20 24 65 6e 61 62 6c 65 76  ompress $enablev
67e0: 61 6c 22 3b 3b 0a 09 65 73 61 63 5d 2c 0a 09 65  al";;..esac],..e
67f0: 6e 61 62 6c 65 76 61 6c 3d 22 6e 6f 22 29 0a 20  nableval="no"). 
6800: 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54     AC_MSG_RESULT
6810: 28 5b 24 65 6e 61 62 6c 65 76 61 6c 5d 29 0a 20  ([$enableval]). 
6820: 20 20 20 69 66 20 74 65 73 74 20 22 24 65 6e 61     if test "$ena
6830: 62 6c 65 76 61 6c 22 20 21 3d 20 22 6e 6f 22 3b  bleval" != "no";
6840: 20 74 68 65 6e 0a 09 41 43 5f 4d 53 47 5f 43 48   then..AC_MSG_CH
6850: 45 43 4b 49 4e 47 28 5b 66 6f 72 20 63 6f 6d 70  ECKING([for comp
6860: 72 65 73 73 65 64 20 66 69 6c 65 20 73 75 66 66  ressed file suff
6870: 69 78 5d 29 0a 09 74 6f 75 63 68 20 54 65 53 54  ix])..touch TeST
6880: 0a 09 24 65 6e 61 62 6c 65 76 61 6c 20 54 65 53  ..$enableval TeS
6890: 54 0a 09 5a 3d 60 6c 73 20 54 65 53 54 2a 20 7c  T..Z=`ls TeST* |
68a0: 20 73 65 64 20 27 73 2f 5e 2e 2e 2e 2e 2f 2f 27   sed 's/^....//'
68b0: 60 0a 09 72 6d 20 2d 66 20 54 65 53 54 2a 0a 09  `..rm -f TeST*..
68c0: 4d 41 4e 5f 46 4c 41 47 53 3d 22 24 4d 41 4e 5f  MAN_FLAGS="$MAN_
68d0: 46 4c 41 47 53 20 2d 2d 65 78 74 65 6e 73 69 6f  FLAGS --extensio
68e0: 6e 20 24 5a 22 0a 09 41 43 5f 4d 53 47 5f 52 45  n $Z"..AC_MSG_RE
68f0: 53 55 4c 54 28 5b 24 5a 5d 29 0a 20 20 20 20 66  SULT([$Z]).    f
6900: 69 0a 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43 48  i..    AC_MSG_CH
6910: 45 43 4b 49 4e 47 28 5b 77 68 65 74 68 65 72 20  ECKING([whether 
6920: 74 6f 20 61 64 64 20 61 20 70 61 63 6b 61 67 65  to add a package
6930: 20 6e 61 6d 65 20 73 75 66 66 69 78 20 66 6f 72   name suffix for
6940: 20 74 68 65 20 6d 61 6e 70 61 67 65 73 5d 29 0a   the manpages]).
6950: 20 20 20 20 41 43 5f 41 52 47 5f 45 4e 41 42 4c      AC_ARG_ENABL
6960: 45 28 6d 61 6e 2d 73 75 66 66 69 78 2c 0a 09 41  E(man-suffix,..A
6970: 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d  C_HELP_STRING([-
6980: 2d 65 6e 61 62 6c 65 2d 6d 61 6e 2d 73 75 66 66  -enable-man-suff
6990: 69 78 3d 53 54 52 49 4e 47 5d 2c 0a 09 20 20 20  ix=STRING],..   
69a0: 20 5b 75 73 65 20 53 54 52 49 4e 47 20 61 73 20   [use STRING as 
69b0: 61 20 73 75 66 66 69 78 20 74 6f 20 6d 61 6e 70  a suffix to manp
69c0: 61 67 65 20 66 69 6c 65 20 6e 61 6d 65 73 20 28  age file names (
69d0: 64 65 66 61 75 6c 74 3a 20 6e 6f 2c 20 41 43 5f  default: no, AC_
69e0: 50 41 43 4b 41 47 45 5f 4e 41 4d 45 20 69 66 20  PACKAGE_NAME if 
69f0: 65 6e 61 62 6c 65 64 20 77 69 74 68 6f 75 74 20  enabled without 
6a00: 73 70 65 63 69 66 79 69 6e 67 20 53 54 52 49 4e  specifying STRIN
6a10: 47 29 5d 29 2c 0a 09 5b 63 61 73 65 20 24 65 6e  G)]),..[case $en
6a20: 61 62 6c 65 76 61 6c 20 69 6e 0a 09 20 20 20 20  ableval in..    
6a30: 79 65 73 29 20 65 6e 61 62 6c 65 76 61 6c 3d 22  yes) enableval="
6a40: 41 43 5f 50 41 43 4b 41 47 45 5f 4e 41 4d 45 22  AC_PACKAGE_NAME"
6a50: 20 4d 41 4e 5f 46 4c 41 47 53 3d 22 24 4d 41 4e   MAN_FLAGS="$MAN
6a60: 5f 46 4c 41 47 53 20 2d 2d 73 75 66 66 69 78 20  _FLAGS --suffix 
6a70: 24 65 6e 61 62 6c 65 76 61 6c 22 3b 3b 0a 09 20  $enableval";;.. 
6a80: 20 20 20 6e 6f 29 20 20 3b 3b 0a 09 20 20 20 20     no)  ;;..    
6a90: 2a 29 20 20 20 4d 41 4e 5f 46 4c 41 47 53 3d 22  *)   MAN_FLAGS="
6aa0: 24 4d 41 4e 5f 46 4c 41 47 53 20 2d 2d 73 75 66  $MAN_FLAGS --suf
6ab0: 66 69 78 20 24 65 6e 61 62 6c 65 76 61 6c 22 3b  fix $enableval";
6ac0: 3b 0a 09 65 73 61 63 5d 2c 0a 09 65 6e 61 62 6c  ;..esac],..enabl
6ad0: 65 76 61 6c 3d 22 6e 6f 22 29 0a 20 20 20 20 41  eval="no").    A
6ae0: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 65  C_MSG_RESULT([$e
6af0: 6e 61 62 6c 65 76 61 6c 5d 29 0a 0a 20 20 20 20  nableval])..    
6b00: 41 43 5f 53 55 42 53 54 28 4d 41 4e 5f 46 4c 41  AC_SUBST(MAN_FLA
6b10: 47 53 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  GS).])..#-------
6b20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6b30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6b40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6b50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
6b60: 53 43 5f 43 4f 4e 46 49 47 5f 53 59 53 54 45 4d  SC_CONFIG_SYSTEM
6b70: 0a 23 0a 23 09 44 65 74 65 72 6d 69 6e 65 20 77  .#.#.Determine w
6b80: 68 61 74 20 74 68 65 20 73 79 73 74 65 6d 20 69  hat the system i
6b90: 73 20 28 73 6f 6d 65 20 74 68 69 6e 67 73 20 63  s (some things c
6ba0: 61 6e 6e 6f 74 20 62 65 20 65 61 73 69 6c 79 20  annot be easily 
6bb0: 63 68 65 63 6b 65 64 0a 23 09 6f 6e 20 61 20 66  checked.#.on a f
6bc0: 65 61 74 75 72 65 2d 64 72 69 76 65 6e 20 62 61  eature-driven ba
6bd0: 73 69 73 2c 20 61 6c 61 73 29 2e 20 54 68 69 73  sis, alas). This
6be0: 20 63 61 6e 20 75 73 75 61 6c 6c 79 20 62 65 20   can usually be 
6bf0: 64 6f 6e 65 20 76 69 61 20 74 68 65 0a 23 09 22  done via the.#."
6c00: 75 6e 61 6d 65 22 20 63 6f 6d 6d 61 6e 64 2c 20  uname" command, 
6c10: 62 75 74 20 74 68 65 72 65 20 61 72 65 20 61 20  but there are a 
6c20: 66 65 77 20 73 79 73 74 65 6d 73 2c 20 6c 69 6b  few systems, lik
6c30: 65 20 4e 65 78 74 2c 20 77 68 65 72 65 0a 23 09  e Next, where.#.
6c40: 74 68 69 73 20 64 6f 65 73 6e 27 74 20 77 6f 72  this doesn't wor
6c50: 6b 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73  k..#.# Arguments
6c60: 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73  :.#.none.#.# Res
6c70: 75 6c 74 73 3a 0a 23 09 44 65 66 69 6e 65 73 20  ults:.#.Defines 
6c80: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
6c90: 72 3a 0a 23 0a 23 09 73 79 73 74 65 6d 20 2d 09  r:.#.#.system -.
6ca0: 53 79 73 74 65 6d 2f 70 6c 61 74 66 6f 72 6d 2f  System/platform/
6cb0: 76 65 72 73 69 6f 6e 20 69 64 65 6e 74 69 66 69  version identifi
6cc0: 63 61 74 69 6f 6e 20 63 6f 64 65 2e 0a 23 0a 23  cation code..#.#
6cd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6ce0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6cf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6d00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6d10: 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b  ----..AC_DEFUN([
6d20: 53 43 5f 43 4f 4e 46 49 47 5f 53 59 53 54 45 4d  SC_CONFIG_SYSTEM
6d30: 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 43 41 43 48  ], [.    AC_CACH
6d40: 45 5f 43 48 45 43 4b 28 5b 73 79 73 74 65 6d 20  E_CHECK([system 
6d50: 76 65 72 73 69 6f 6e 5d 2c 20 74 63 6c 5f 63 76  version], tcl_cv
6d60: 5f 73 79 73 5f 76 65 72 73 69 6f 6e 2c 20 5b 0a  _sys_version, [.
6d70: 09 69 66 20 74 65 73 74 20 2d 66 20 2f 75 73 72  .if test -f /usr
6d80: 2f 6c 69 62 2f 4e 65 78 74 53 74 65 70 2f 73 6f  /lib/NextStep/so
6d90: 66 74 77 61 72 65 5f 76 65 72 73 69 6f 6e 3b 20  ftware_version; 
6da0: 74 68 65 6e 0a 09 20 20 20 20 74 63 6c 5f 63 76  then..    tcl_cv
6db0: 5f 73 79 73 5f 76 65 72 73 69 6f 6e 3d 4e 45 58  _sys_version=NEX
6dc0: 54 53 54 45 50 2d 60 61 77 6b 20 27 2f 33 2f 2c  TSTEP-`awk '/3/,
6dd0: 2f 33 2f 27 20 2f 75 73 72 2f 6c 69 62 2f 4e 65  /3/' /usr/lib/Ne
6de0: 78 74 53 74 65 70 2f 73 6f 66 74 77 61 72 65 5f  xtStep/software_
6df0: 76 65 72 73 69 6f 6e 60 0a 09 65 6c 73 65 0a 09  version`..else..
6e00: 20 20 20 20 74 63 6c 5f 63 76 5f 73 79 73 5f 76      tcl_cv_sys_v
6e10: 65 72 73 69 6f 6e 3d 60 75 6e 61 6d 65 20 2d 73  ersion=`uname -s
6e20: 60 2d 60 75 6e 61 6d 65 20 2d 72 60 0a 09 20 20  `-`uname -r`..  
6e30: 20 20 69 66 20 74 65 73 74 20 22 24 3f 22 20 2d    if test "$?" -
6e40: 6e 65 20 30 20 3b 20 74 68 65 6e 0a 09 09 41 43  ne 0 ; then...AC
6e50: 5f 4d 53 47 5f 57 41 52 4e 28 5b 63 61 6e 27 74  _MSG_WARN([can't
6e60: 20 66 69 6e 64 20 75 6e 61 6d 65 20 63 6f 6d 6d   find uname comm
6e70: 61 6e 64 5d 29 0a 09 09 74 63 6c 5f 63 76 5f 73  and])...tcl_cv_s
6e80: 79 73 5f 76 65 72 73 69 6f 6e 3d 75 6e 6b 6e 6f  ys_version=unkno
6e90: 77 6e 0a 09 20 20 20 20 65 6c 73 65 0a 09 09 23  wn..    else...#
6ea0: 20 53 70 65 63 69 61 6c 20 63 68 65 63 6b 20 66   Special check f
6eb0: 6f 72 20 77 65 69 72 64 20 4d 50 2d 52 41 53 20  or weird MP-RAS 
6ec0: 73 79 73 74 65 6d 20 28 75 6e 61 6d 65 20 72 65  system (uname re
6ed0: 74 75 72 6e 73 20 77 65 69 72 64 0a 09 09 23 20  turns weird...# 
6ee0: 72 65 73 75 6c 74 73 2c 20 61 6e 64 20 74 68 65  results, and the
6ef0: 20 76 65 72 73 69 6f 6e 20 69 73 20 6b 65 70 74   version is kept
6f00: 20 69 6e 20 73 70 65 63 69 61 6c 20 66 69 6c 65   in special file
6f10: 29 2e 0a 0a 09 09 69 66 20 74 65 73 74 20 2d 72  ).....if test -r
6f20: 20 2f 65 74 63 2f 2e 72 65 6c 69 64 20 2d 61 20   /etc/.relid -a 
6f30: 22 58 60 75 6e 61 6d 65 20 2d 6e 60 22 20 3d 20  "X`uname -n`" = 
6f40: 22 58 60 75 6e 61 6d 65 20 2d 73 60 22 20 3b 20  "X`uname -s`" ; 
6f50: 74 68 65 6e 0a 09 09 20 20 20 20 74 63 6c 5f 63  then...    tcl_c
6f60: 76 5f 73 79 73 5f 76 65 72 73 69 6f 6e 3d 4d 50  v_sys_version=MP
6f70: 2d 52 41 53 2d 60 61 77 6b 20 27 7b 70 72 69 6e  -RAS-`awk '{prin
6f80: 74 20 24 5b 33 5d 7d 27 20 2f 65 74 63 2f 2e 72  t $[3]}' /etc/.r
6f90: 65 6c 69 64 60 0a 09 09 66 69 0a 09 09 69 66 20  elid`...fi...if 
6fa0: 74 65 73 74 20 22 60 75 6e 61 6d 65 20 2d 73 60  test "`uname -s`
6fb0: 22 20 3d 20 22 41 49 58 22 20 3b 20 74 68 65 6e  " = "AIX" ; then
6fc0: 0a 09 09 20 20 20 20 74 63 6c 5f 63 76 5f 73 79  ...    tcl_cv_sy
6fd0: 73 5f 76 65 72 73 69 6f 6e 3d 41 49 58 2d 60 75  s_version=AIX-`u
6fe0: 6e 61 6d 65 20 2d 76 60 2e 60 75 6e 61 6d 65 20  name -v`.`uname 
6ff0: 2d 72 60 0a 09 09 66 69 0a 09 20 20 20 20 66 69  -r`...fi..    fi
7000: 0a 09 66 69 0a 20 20 20 20 5d 29 0a 20 20 20 20  ..fi.    ]).    
7010: 73 79 73 74 65 6d 3d 24 74 63 6c 5f 63 76 5f 73  system=$tcl_cv_s
7020: 79 73 5f 76 65 72 73 69 6f 6e 0a 5d 29 0a 0a 23  ys_version.])..#
7030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7050: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7060: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7070: 2d 2d 2d 2d 0a 23 20 53 43 5f 43 4f 4e 46 49 47  ----.# SC_CONFIG
7080: 5f 43 46 4c 41 47 53 0a 23 0a 23 09 54 72 79 20  _CFLAGS.#.#.Try 
7090: 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65  to determine the
70a0: 20 70 72 6f 70 65 72 20 66 6c 61 67 73 20 74 6f   proper flags to
70b0: 20 70 61 73 73 20 74 6f 20 74 68 65 20 63 6f 6d   pass to the com
70c0: 70 69 6c 65 72 0a 23 09 66 6f 72 20 62 75 69 6c  piler.#.for buil
70d0: 64 69 6e 67 20 73 68 61 72 65 64 20 6c 69 62 72  ding shared libr
70e0: 61 72 69 65 73 20 61 6e 64 20 6f 74 68 65 72 20  aries and other 
70f0: 73 75 63 68 20 6e 6f 6e 73 65 6e 73 65 2e 0a 23  such nonsense..#
7100: 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
7110: 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73  none.#.# Results
7120: 3a 0a 23 0a 23 09 44 65 66 69 6e 65 73 20 61 6e  :.#.#.Defines an
7130: 64 20 73 75 62 73 74 69 74 75 74 65 73 20 74 68  d substitutes th
7140: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73  e following vars
7150: 3a 0a 23 0a 23 20 20 20 20 20 20 20 44 4c 5f 4f  :.#.#       DL_O
7160: 42 4a 53 20 2d 20 20 20 20 20 20 20 4e 61 6d 65  BJS -       Name
7170: 20 6f 66 20 74 68 65 20 6f 62 6a 65 63 74 20 66   of the object f
7180: 69 6c 65 20 74 68 61 74 20 69 6d 70 6c 65 6d 65  ile that impleme
7190: 6e 74 73 20 64 79 6e 61 6d 69 63 0a 23 20 20 20  nts dynamic.#   
71a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
71b0: 20 20 20 20 6c 6f 61 64 69 6e 67 20 66 6f 72 20      loading for 
71c0: 54 63 6c 20 6f 6e 20 74 68 69 73 20 73 79 73 74  Tcl on this syst
71d0: 65 6d 2e 0a 23 20 20 20 20 20 20 20 44 4c 5f 4c  em..#       DL_L
71e0: 49 42 53 20 2d 20 20 20 20 20 20 20 4c 69 62 72  IBS -       Libr
71f0: 61 72 79 20 66 69 6c 65 28 73 29 20 74 6f 20 69  ary file(s) to i
7200: 6e 63 6c 75 64 65 20 69 6e 20 74 63 6c 73 68 20  nclude in tclsh 
7210: 61 6e 64 20 6f 74 68 65 72 20 62 61 73 65 0a 23  and other base.#
7220: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7230: 20 20 20 20 20 20 20 61 70 70 6c 69 63 61 74 69         applicati
7240: 6f 6e 73 20 69 6e 20 6f 72 64 65 72 20 66 6f 72  ons in order for
7250: 20 74 68 65 20 22 6c 6f 61 64 22 20 63 6f 6d 6d   the "load" comm
7260: 61 6e 64 20 74 6f 20 77 6f 72 6b 2e 0a 23 20 20  and to work..#  
7270: 20 20 20 20 20 4c 44 46 4c 41 47 53 20 2d 20 20       LDFLAGS -  
7280: 20 20 20 20 46 6c 61 67 73 20 74 6f 20 70 61 73      Flags to pas
7290: 73 20 74 6f 20 74 68 65 20 63 6f 6d 70 69 6c 65  s to the compile
72a0: 72 20 77 68 65 6e 20 6c 69 6e 6b 69 6e 67 20 6f  r when linking o
72b0: 62 6a 65 63 74 0a 23 20 20 20 20 20 20 20 20 20  bject.#         
72c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69                fi
72d0: 6c 65 73 20 69 6e 74 6f 20 61 6e 20 65 78 65 63  les into an exec
72e0: 75 74 61 62 6c 65 20 61 70 70 6c 69 63 61 74 69  utable applicati
72f0: 6f 6e 20 62 69 6e 61 72 79 20 73 75 63 68 0a 23  on binary such.#
7300: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7310: 20 20 20 20 20 20 20 61 73 20 74 63 6c 73 68 2e         as tclsh.
7320: 0a 23 20 20 20 20 20 20 20 4c 44 5f 53 45 41 52  .#       LD_SEAR
7330: 43 48 5f 46 4c 41 47 53 2d 46 6c 61 67 73 20 74  CH_FLAGS-Flags t
7340: 6f 20 70 61 73 73 20 74 6f 20 6c 64 2c 20 73 75  o pass to ld, su
7350: 63 68 20 61 73 20 22 2d 52 20 2f 75 73 72 2f 6c  ch as "-R /usr/l
7360: 6f 63 61 6c 2f 74 63 6c 2f 6c 69 62 22 2c 0a 23  ocal/tcl/lib",.#
7370: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7380: 20 20 20 20 20 20 20 74 68 61 74 20 74 65 6c 6c         that tell
7390: 20 74 68 65 20 72 75 6e 2d 74 69 6d 65 20 64 79   the run-time dy
73a0: 6e 61 6d 69 63 20 6c 69 6e 6b 65 72 20 77 68 65  namic linker whe
73b0: 72 65 20 74 6f 20 6c 6f 6f 6b 0a 23 20 20 20 20  re to look.#    
73c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
73d0: 20 20 20 66 6f 72 20 73 68 61 72 65 64 20 6c 69     for shared li
73e0: 62 72 61 72 69 65 73 20 73 75 63 68 20 61 73 20  braries such as 
73f0: 6c 69 62 74 63 6c 2e 73 6f 2e 20 20 44 65 70 65  libtcl.so.  Depe
7400: 6e 64 73 20 6f 6e 0a 23 20 20 20 20 20 20 20 20  nds on.#        
7410: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74                 t
7420: 68 65 20 76 61 72 69 61 62 6c 65 20 4c 49 42 5f  he variable LIB_
7430: 52 55 4e 54 49 4d 45 5f 44 49 52 20 69 6e 20 74  RUNTIME_DIR in t
7440: 68 65 20 4d 61 6b 65 66 69 6c 65 2e 20 43 6f 75  he Makefile. Cou
7450: 6c 64 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  ld.#            
7460: 20 20 20 20 20 20 20 20 20 20 20 62 65 20 74 68             be th
7470: 65 20 73 61 6d 65 20 61 73 20 43 43 5f 53 45 41  e same as CC_SEA
7480: 52 43 48 5f 46 4c 41 47 53 20 69 66 20 24 7b 43  RCH_FLAGS if ${C
7490: 43 7d 20 69 73 20 75 73 65 64 20 74 6f 20 6c 69  C} is used to li
74a0: 6e 6b 2e 0a 23 20 20 20 20 20 20 20 43 43 5f 53  nk..#       CC_S
74b0: 45 41 52 43 48 5f 46 4c 41 47 53 2d 46 6c 61 67  EARCH_FLAGS-Flag
74c0: 73 20 74 6f 20 70 61 73 73 20 74 6f 20 24 7b 43  s to pass to ${C
74d0: 43 7d 2c 20 73 75 63 68 20 61 73 20 22 2d 57 6c  C}, such as "-Wl
74e0: 2c 2d 72 70 61 74 68 2c 2f 75 73 72 2f 6c 6f 63  ,-rpath,/usr/loc
74f0: 61 6c 2f 74 63 6c 2f 6c 69 62 22 2c 0a 23 20 20  al/tcl/lib",.#  
7500: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7510: 20 20 20 20 20 74 68 61 74 20 74 65 6c 6c 20 74       that tell t
7520: 68 65 20 72 75 6e 2d 74 69 6d 65 20 64 79 6e 61  he run-time dyna
7530: 6d 69 63 20 6c 69 6e 6b 65 72 20 77 68 65 72 65  mic linker where
7540: 20 74 6f 20 6c 6f 6f 6b 0a 23 20 20 20 20 20 20   to look.#      
7550: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7560: 20 66 6f 72 20 73 68 61 72 65 64 20 6c 69 62 72   for shared libr
7570: 61 72 69 65 73 20 73 75 63 68 20 61 73 20 6c 69  aries such as li
7580: 62 74 63 6c 2e 73 6f 2e 20 20 44 65 70 65 6e 64  btcl.so.  Depend
7590: 73 20 6f 6e 0a 23 20 20 20 20 20 20 20 20 20 20  s on.#          
75a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 65               the
75b0: 20 76 61 72 69 61 62 6c 65 20 4c 49 42 5f 52 55   variable LIB_RU
75c0: 4e 54 49 4d 45 5f 44 49 52 20 69 6e 20 74 68 65  NTIME_DIR in the
75d0: 20 4d 61 6b 65 66 69 6c 65 2e 0a 23 20 20 20 20   Makefile..#    
75e0: 20 20 20 4d 41 4b 45 5f 4c 49 42 20 2d 20 20 20     MAKE_LIB -   
75f0: 20 20 20 43 6f 6d 6d 61 6e 64 20 74 6f 20 65 78     Command to ex
7600: 65 63 75 74 65 20 74 6f 20 62 75 69 6c 64 20 74  ecute to build t
7610: 68 65 20 61 20 6c 69 62 72 61 72 79 3b 0a 23 20  he a library;.# 
7620: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7630: 20 20 20 20 20 20 64 69 66 66 65 72 73 20 77 68        differs wh
7640: 65 6e 20 62 75 69 6c 64 69 6e 67 20 73 68 61 72  en building shar
7650: 65 64 20 6f 72 20 73 74 61 74 69 63 2e 0a 23 20  ed or static..# 
7660: 20 20 20 20 20 20 4d 41 4b 45 5f 53 54 55 42 5f        MAKE_STUB_
7670: 4c 49 42 20 2d 0a 23 20 20 20 20 20 20 20 20 20  LIB -.#         
7680: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 6f                Co
7690: 6d 6d 61 6e 64 20 74 6f 20 65 78 65 63 75 74 65  mmand to execute
76a0: 20 74 6f 20 62 75 69 6c 64 20 61 20 73 74 75 62   to build a stub
76b0: 20 6c 69 62 72 61 72 79 2e 0a 23 20 20 20 20 20   library..#     
76c0: 20 20 49 4e 53 54 41 4c 4c 5f 4c 49 42 20 2d 20    INSTALL_LIB - 
76d0: 20 20 43 6f 6d 6d 61 6e 64 20 74 6f 20 65 78 65    Command to exe
76e0: 63 75 74 65 20 74 6f 20 69 6e 73 74 61 6c 6c 20  cute to install 
76f0: 61 20 6c 69 62 72 61 72 79 3b 0a 23 20 20 20 20  a library;.#    
7700: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7710: 20 20 20 64 69 66 66 65 72 73 20 77 68 65 6e 20     differs when 
7720: 62 75 69 6c 64 69 6e 67 20 73 68 61 72 65 64 20  building shared 
7730: 6f 72 20 73 74 61 74 69 63 2e 0a 23 20 20 20 20  or static..#    
7740: 20 20 20 49 4e 53 54 41 4c 4c 5f 53 54 55 42 5f     INSTALL_STUB_
7750: 4c 49 42 20 2d 0a 23 20 20 20 20 20 20 20 20 20  LIB -.#         
7760: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 6f                Co
7770: 6d 6d 61 6e 64 20 74 6f 20 65 78 65 63 75 74 65  mmand to execute
7780: 20 74 6f 20 69 6e 73 74 61 6c 6c 20 61 20 73 74   to install a st
7790: 75 62 20 6c 69 62 72 61 72 79 2e 0a 23 20 20 20  ub library..#   
77a0: 20 20 20 20 53 54 4c 49 42 5f 4c 44 20 2d 20 20      STLIB_LD -  
77b0: 20 20 20 20 42 61 73 65 20 63 6f 6d 6d 61 6e 64      Base command
77c0: 20 74 6f 20 75 73 65 20 66 6f 72 20 63 6f 6d 62   to use for comb
77d0: 69 6e 69 6e 67 20 6f 62 6a 65 63 74 20 66 69 6c  ining object fil
77e0: 65 73 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  es.#            
77f0: 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 6f 20             into 
7800: 61 20 73 74 61 74 69 63 20 6c 69 62 72 61 72 79  a static library
7810: 2e 0a 23 20 20 20 20 20 20 20 53 48 4c 49 42 5f  ..#       SHLIB_
7820: 43 46 4c 41 47 53 20 2d 20 20 46 6c 61 67 73 20  CFLAGS -  Flags 
7830: 74 6f 20 70 61 73 73 20 74 6f 20 63 63 20 77 68  to pass to cc wh
7840: 65 6e 20 63 6f 6d 70 69 6c 69 6e 67 20 74 68 65  en compiling the
7850: 20 63 6f 6d 70 6f 6e 65 6e 74 73 0a 23 20 20 20   components.#   
7860: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7870: 20 20 20 20 6f 66 20 61 20 73 68 61 72 65 64 20      of a shared 
7880: 6c 69 62 72 61 72 79 20 28 6d 61 79 20 72 65 71  library (may req
7890: 75 65 73 74 20 70 6f 73 69 74 69 6f 6e 2d 69 6e  uest position-in
78a0: 64 65 70 65 6e 64 65 6e 74 0a 23 20 20 20 20 20  dependent.#     
78b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
78c0: 20 20 63 6f 64 65 2c 20 61 6d 6f 6e 67 20 6f 74    code, among ot
78d0: 68 65 72 20 74 68 69 6e 67 73 29 2e 0a 23 20 20  her things)..#  
78e0: 20 20 20 20 20 53 48 4c 49 42 5f 4c 44 20 2d 20       SHLIB_LD - 
78f0: 20 20 20 20 20 42 61 73 65 20 63 6f 6d 6d 61 6e       Base comman
7900: 64 20 74 6f 20 75 73 65 20 66 6f 72 20 63 6f 6d  d to use for com
7910: 62 69 6e 69 6e 67 20 6f 62 6a 65 63 74 20 66 69  bining object fi
7920: 6c 65 73 0a 23 20 20 20 20 20 20 20 20 20 20 20  les.#           
7930: 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 6f              into
7940: 20 61 20 73 68 61 72 65 64 20 6c 69 62 72 61 72   a shared librar
7950: 79 2e 0a 23 20 20 20 20 20 20 20 53 48 4c 49 42  y..#       SHLIB
7960: 5f 4c 44 5f 4c 49 42 53 20 2d 20 44 65 70 65 6e  _LD_LIBS - Depen
7970: 64 65 6e 74 20 6c 69 62 72 61 72 69 65 73 20 66  dent libraries f
7980: 6f 72 20 74 68 65 20 6c 69 6e 6b 65 72 20 74 6f  or the linker to
7990: 20 73 63 61 6e 20 77 68 65 6e 0a 23 20 20 20 20   scan when.#    
79a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
79b0: 20 20 20 63 72 65 61 74 69 6e 67 20 73 68 61 72     creating shar
79c0: 65 64 20 6c 69 62 72 61 72 69 65 73 2e 20 20 54  ed libraries.  T
79d0: 68 69 73 20 73 79 6d 62 6f 6c 20 74 79 70 69 63  his symbol typic
79e0: 61 6c 6c 79 0a 23 20 20 20 20 20 20 20 20 20 20  ally.#          
79f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 67 6f 65               goe
7a00: 73 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20  s at the end of 
7a10: 74 68 65 20 22 6c 64 22 20 63 6f 6d 6d 61 6e 64  the "ld" command
7a20: 73 20 74 68 61 74 20 62 75 69 6c 64 0a 23 20 20  s that build.#  
7a30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7a40: 20 20 20 20 20 73 68 61 72 65 64 20 6c 69 62 72       shared libr
7a50: 61 72 69 65 73 2e 20 54 68 65 20 76 61 6c 75 65  aries. The value
7a60: 20 6f 66 20 74 68 65 20 73 79 6d 62 6f 6c 20 69   of the symbol i
7a70: 73 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  s.#             
7a80: 20 20 20 20 20 20 20 20 20 20 22 24 7b 4c 49 42            "${LIB
7a90: 53 7d 22 20 69 66 20 61 6c 6c 20 6f 66 20 74 68  S}" if all of th
7aa0: 65 20 64 65 70 65 6e 64 65 6e 74 20 6c 69 62 72  e dependent libr
7ab0: 61 72 69 65 73 20 73 68 6f 75 6c 64 0a 23 20 20  aries should.#  
7ac0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7ad0: 20 20 20 20 20 62 65 20 73 70 65 63 69 66 69 65       be specifie
7ae0: 64 20 77 68 65 6e 20 63 72 65 61 74 69 6e 67 20  d when creating 
7af0: 61 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 79  a shared library
7b00: 2e 20 20 49 66 0a 23 20 20 20 20 20 20 20 20 20  .  If.#         
7b10: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65                de
7b20: 70 65 6e 64 65 6e 74 20 6c 69 62 72 61 72 69 65  pendent librarie
7b30: 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20  s should not be 
7b40: 73 70 65 63 69 66 69 65 64 20 28 61 73 20 6f 6e  specified (as on
7b50: 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
7b60: 20 20 20 20 20 20 20 20 20 53 75 6e 4f 53 20 34           SunOS 4
7b70: 2e 78 2c 20 77 68 65 72 65 20 74 68 65 79 20 63  .x, where they c
7b80: 61 75 73 65 20 74 68 65 20 6c 69 6e 6b 20 74 6f  ause the link to
7b90: 20 66 61 69 6c 2c 20 6f 72 20 69 6e 0a 23 20 20   fail, or in.#  
7ba0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7bb0: 20 20 20 20 20 67 65 6e 65 72 61 6c 20 69 66 20       general if 
7bc0: 54 63 6c 20 61 6e 64 20 54 6b 20 61 72 65 6e 27  Tcl and Tk aren'
7bd0: 74 20 74 68 65 6d 73 65 6c 76 65 73 20 73 68 61  t themselves sha
7be0: 72 65 64 0a 23 20 20 20 20 20 20 20 20 20 20 20  red.#           
7bf0: 20 20 20 20 20 20 20 20 20 20 20 20 6c 69 62 72              libr
7c00: 61 72 69 65 73 29 2c 20 74 68 65 6e 20 74 68 69  aries), then thi
7c10: 73 20 73 79 6d 62 6f 6c 20 68 61 73 20 61 6e 20  s symbol has an 
7c20: 65 6d 70 74 79 20 73 74 72 69 6e 67 0a 23 20 20  empty string.#  
7c30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7c40: 20 20 20 20 20 61 73 20 69 74 73 20 76 61 6c 75       as its valu
7c50: 65 2e 0a 23 20 20 20 20 20 20 20 53 48 4c 49 42  e..#       SHLIB
7c60: 5f 53 55 46 46 49 58 20 2d 20 20 53 75 66 66 69  _SUFFIX -  Suffi
7c70: 78 20 74 6f 20 75 73 65 20 66 6f 72 20 74 68 65  x to use for the
7c80: 20 6e 61 6d 65 73 20 6f 66 20 64 79 6e 61 6d 69   names of dynami
7c90: 63 61 6c 6c 79 20 6c 6f 61 64 61 62 6c 65 0a 23  cally loadable.#
7ca0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7cb0: 20 20 20 20 20 20 20 65 78 74 65 6e 73 69 6f 6e         extension
7cc0: 73 2e 20 20 41 6e 20 65 6d 70 74 79 20 73 74 72  s.  An empty str
7cd0: 69 6e 67 20 6d 65 61 6e 73 20 77 65 20 64 6f 6e  ing means we don
7ce0: 27 74 20 6b 6e 6f 77 20 68 6f 77 0a 23 20 20 20  't know how.#   
7cf0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7d00: 20 20 20 20 74 6f 20 75 73 65 20 73 68 61 72 65      to use share
7d10: 64 20 6c 69 62 72 61 72 69 65 73 20 6f 6e 20 74  d libraries on t
7d20: 68 69 73 20 70 6c 61 74 66 6f 72 6d 2e 0a 23 20  his platform..# 
7d30: 54 43 4c 5f 53 48 4c 49 42 5f 4c 44 5f 45 58 54  TCL_SHLIB_LD_EXT
7d40: 52 41 53 20 2d 20 41 64 64 69 74 69 6f 6e 61 6c  RAS - Additional
7d50: 20 65 6c 65 6d 65 6e 74 20 77 68 69 63 68 20 61   element which a
7d60: 72 65 20 61 64 64 65 64 20 74 6f 20 53 48 4c 49  re added to SHLI
7d70: 42 5f 4c 44 5f 4c 49 42 53 0a 23 20 20 54 4b 5f  B_LD_LIBS.#  TK_
7d80: 53 48 4c 49 42 5f 4c 44 5f 45 58 54 52 41 53 20  SHLIB_LD_EXTRAS 
7d90: 20 20 66 6f 72 20 74 68 65 20 62 75 69 6c 64 20    for the build 
7da0: 6f 66 20 54 63 6c 20 61 6e 64 20 54 6b 2c 20 62  of Tcl and Tk, b
7db0: 75 74 20 6e 6f 74 20 72 65 63 6f 72 64 65 64 20  ut not recorded 
7dc0: 69 6e 20 74 68 65 0a 23 20 20 20 20 20 20 20 20  in the.#        
7dd0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74                 t
7de0: 63 6c 43 6f 6e 66 69 67 2e 73 68 2c 20 73 69 6e  clConfig.sh, sin
7df0: 63 65 20 74 68 65 79 20 61 72 65 20 6f 6e 6c 79  ce they are only
7e00: 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 62 75   used for the bu
7e10: 69 6c 64 0a 23 20 20 20 20 20 20 20 20 20 20 20  ild.#           
7e20: 20 20 20 20 20 20 20 20 20 20 20 20 6f 66 20 54              of T
7e30: 63 6c 20 61 6e 64 20 54 6b 2e 0a 23 20 20 20 20  cl and Tk..#    
7e40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7e50: 20 20 20 45 78 61 6d 70 6c 65 73 3a 20 4d 61 63     Examples: Mac
7e60: 4f 53 20 58 20 72 65 63 6f 72 64 73 20 74 68 65  OS X records the
7e70: 20 6c 69 62 72 61 72 79 20 76 65 72 73 69 6f 6e   library version
7e80: 20 61 6e 64 0a 23 20 20 20 20 20 20 20 20 20 20   and.#          
7e90: 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6d               com
7ea0: 70 61 74 69 62 69 6c 69 74 79 20 76 65 72 73 69  patibility versi
7eb0: 6f 6e 20 69 6e 20 74 68 65 20 73 68 61 72 65 64  on in the shared
7ec0: 20 6c 69 62 72 61 72 79 2e 20 20 42 75 74 0a 23   library.  But.#
7ed0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7ee0: 20 20 20 20 20 20 20 6f 66 20 63 6f 75 72 73 65         of course
7ef0: 20 74 68 65 20 54 63 6c 20 76 65 72 73 69 6f 6e   the Tcl version
7f00: 20 6f 66 20 74 68 69 73 20 69 73 20 6f 6e 6c 79   of this is only
7f10: 20 75 73 65 64 20 66 6f 72 20 54 63 6c 2e 0a 23   used for Tcl..#
7f20: 20 20 20 20 20 20 20 4c 49 42 5f 53 55 46 46 49         LIB_SUFFI
7f30: 58 20 2d 20 20 20 20 53 70 65 63 69 66 69 65 73  X -    Specifies
7f40: 20 65 76 65 72 79 74 68 69 6e 67 20 74 68 61 74   everything that
7f50: 20 63 6f 6d 65 73 20 61 66 74 65 72 20 74 68 65   comes after the
7f60: 20 22 6c 69 62 66 6f 6f 22 0a 23 20 20 20 20 20   "libfoo".#     
7f70: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
7f80: 20 20 69 6e 20 61 20 73 74 61 74 69 63 20 6f 72    in a static or
7f90: 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 79 20   shared library 
7fa0: 6e 61 6d 65 2c 20 75 73 69 6e 67 20 74 68 65 20  name, using the 
7fb0: 24 56 45 52 53 49 4f 4e 20 76 61 72 69 61 62 6c  $VERSION variabl
7fc0: 65 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  e.#             
7fd0: 20 20 20 20 20 20 20 20 20 20 74 6f 20 70 75 74            to put
7fe0: 20 74 68 65 20 76 65 72 73 69 6f 6e 20 69 6e 20   the version in 
7ff0: 74 68 65 20 72 69 67 68 74 20 70 6c 61 63 65 2e  the right place.
8000: 20 20 54 68 69 73 20 69 73 20 75 73 65 64 0a 23    This is used.#
8010: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8020: 20 20 20 20 20 20 20 62 79 20 70 6c 61 74 66 6f         by platfo
8030: 72 6d 73 20 74 68 61 74 20 6e 65 65 64 20 6e 6f  rms that need no
8040: 6e 2d 73 74 61 6e 64 61 72 64 20 6c 69 62 72 61  n-standard libra
8050: 72 79 20 6e 61 6d 65 73 2e 0a 23 20 20 20 20 20  ry names..#     
8060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8070: 20 20 45 78 61 6d 70 6c 65 73 3a 20 20 24 7b 56    Examples:  ${V
8080: 45 52 53 49 4f 4e 7d 2e 73 6f 2e 31 2e 31 20 6f  ERSION}.so.1.1 o
8090: 6e 20 4e 65 74 42 53 44 2c 20 73 69 6e 63 65 20  n NetBSD, since 
80a0: 69 74 20 6e 65 65 64 73 0a 23 20 20 20 20 20 20  it needs.#      
80b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
80c0: 20 74 6f 20 68 61 76 65 20 61 20 76 65 72 73 69   to have a versi
80d0: 6f 6e 20 61 66 74 65 72 20 74 68 65 20 2e 73 6f  on after the .so
80e0: 2c 20 61 6e 64 20 24 7b 56 45 52 53 49 4f 4e 7d  , and ${VERSION}
80f0: 2e 61 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  .a.#            
8100: 20 20 20 20 20 20 20 20 20 20 20 6f 6e 20 41 49             on AI
8110: 58 2c 20 73 69 6e 63 65 20 61 20 73 68 61 72 65  X, since a share
8120: 64 20 6c 69 62 72 61 72 79 20 6e 65 65 64 73 20  d library needs 
8130: 74 6f 20 68 61 76 65 0a 23 20 20 20 20 20 20 20  to have.#       
8140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8150: 61 20 2e 61 20 65 78 74 65 6e 73 69 6f 6e 20 77  a .a extension w
8160: 68 65 72 65 61 73 20 73 68 61 72 65 64 20 6f 62  hereas shared ob
8170: 6a 65 63 74 73 20 66 6f 72 20 6c 6f 61 64 61 62  jects for loadab
8180: 6c 65 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  le.#            
8190: 20 20 20 20 20 20 20 20 20 20 20 65 78 74 65 6e             exten
81a0: 73 69 6f 6e 73 20 68 61 76 65 20 61 20 2e 73 6f  sions have a .so
81b0: 20 65 78 74 65 6e 73 69 6f 6e 2e 20 20 44 65 66   extension.  Def
81c0: 61 75 6c 74 73 20 74 6f 0a 23 20 20 20 20 20 20  aults to.#      
81d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
81e0: 20 24 7b 56 45 52 53 49 4f 4e 7d 24 7b 53 48 4c   ${VERSION}${SHL
81f0: 49 42 5f 53 55 46 46 49 58 7d 2e 0a 23 20 20 20  IB_SUFFIX}..#   
8200: 20 20 20 20 54 43 4c 5f 4c 49 42 53 20 2d 0a 23      TCL_LIBS -.#
8210: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8220: 20 20 20 20 20 20 20 4c 69 62 73 20 74 6f 20 75         Libs to u
8230: 73 65 20 77 68 65 6e 20 6c 69 6e 6b 69 6e 67 20  se when linking 
8240: 54 63 6c 20 73 68 65 6c 6c 20 6f 72 20 73 6f 6d  Tcl shell or som
8250: 65 20 6f 74 68 65 72 0a 23 20 20 20 20 20 20 20  e other.#       
8260: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
8270: 73 68 65 6c 6c 20 74 68 61 74 20 69 6e 63 6c 75  shell that inclu
8280: 64 65 73 20 54 63 6c 20 6c 69 62 73 2e 0a 23 09  des Tcl libs..#.
8290: 43 46 4c 41 47 53 5f 44 45 42 55 47 20 2d 0a 23  CFLAGS_DEBUG -.#
82a0: 09 09 09 46 6c 61 67 73 20 75 73 65 64 20 77 68  ...Flags used wh
82b0: 65 6e 20 72 75 6e 6e 69 6e 67 20 74 68 65 20 63  en running the c
82c0: 6f 6d 70 69 6c 65 72 20 69 6e 20 64 65 62 75 67  ompiler in debug
82d0: 20 6d 6f 64 65 0a 23 09 43 46 4c 41 47 53 5f 4f   mode.#.CFLAGS_O
82e0: 50 54 49 4d 49 5a 45 20 2d 0a 23 09 09 09 46 6c  PTIMIZE -.#...Fl
82f0: 61 67 73 20 75 73 65 64 20 77 68 65 6e 20 72 75  ags used when ru
8300: 6e 6e 69 6e 67 20 74 68 65 20 63 6f 6d 70 69 6c  nning the compil
8310: 65 72 20 69 6e 20 6f 70 74 69 6d 69 7a 65 20 6d  er in optimize m
8320: 6f 64 65 0a 23 09 43 46 4c 41 47 53 20 2d 09 41  ode.#.CFLAGS -.A
8330: 64 64 69 74 69 6f 6e 61 6c 20 43 46 4c 41 47 53  dditional CFLAGS
8340: 20 61 64 64 65 64 20 61 73 20 6e 65 63 65 73 73   added as necess
8350: 61 72 79 20 28 75 73 75 61 6c 6c 79 20 36 34 2d  ary (usually 64-
8360: 62 69 74 29 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  bit).#.#--------
8370: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
8380: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
8390: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
83a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43  ------------..AC
83b0: 5f 44 45 46 55 4e 28 5b 53 43 5f 43 4f 4e 46 49  _DEFUN([SC_CONFI
83c0: 47 5f 43 46 4c 41 47 53 5d 2c 20 5b 0a 0a 20 20  G_CFLAGS], [..  
83d0: 20 20 23 20 53 74 65 70 20 30 2e 61 3a 20 45 6e    # Step 0.a: En
83e0: 61 62 6c 65 20 36 34 20 62 69 74 20 73 75 70 70  able 64 bit supp
83f0: 6f 72 74 3f 0a 0a 20 20 20 20 41 43 5f 4d 53 47  ort?..    AC_MSG
8400: 5f 43 48 45 43 4b 49 4e 47 28 5b 69 66 20 36 34  _CHECKING([if 64
8410: 62 69 74 20 73 75 70 70 6f 72 74 20 69 73 20 72  bit support is r
8420: 65 71 75 65 73 74 65 64 5d 29 0a 20 20 20 20 41  equested]).    A
8430: 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 36 34 62  C_ARG_ENABLE(64b
8440: 69 74 2c 0a 09 41 43 5f 48 45 4c 50 5f 53 54 52  it,..AC_HELP_STR
8450: 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 36 34  ING([--enable-64
8460: 62 69 74 5d 2c 0a 09 20 20 20 20 5b 65 6e 61 62  bit],..    [enab
8470: 6c 65 20 36 34 62 69 74 20 73 75 70 70 6f 72 74  le 64bit support
8480: 20 28 64 65 66 61 75 6c 74 3a 20 6f 66 66 29 5d   (default: off)]
8490: 29 2c 0a 09 5b 64 6f 36 34 62 69 74 3d 24 65 6e  ),..[do64bit=$en
84a0: 61 62 6c 65 76 61 6c 5d 2c 20 5b 64 6f 36 34 62  ableval], [do64b
84b0: 69 74 3d 6e 6f 5d 29 0a 20 20 20 20 41 43 5f 4d  it=no]).    AC_M
84c0: 53 47 5f 52 45 53 55 4c 54 28 5b 24 64 6f 36 34  SG_RESULT([$do64
84d0: 62 69 74 5d 29 0a 0a 20 20 20 20 23 20 53 74 65  bit])..    # Ste
84e0: 70 20 30 2e 62 3a 20 45 6e 61 62 6c 65 20 53 6f  p 0.b: Enable So
84f0: 6c 61 72 69 73 20 36 34 20 62 69 74 20 56 49 53  laris 64 bit VIS
8500: 20 73 75 70 70 6f 72 74 3f 0a 0a 20 20 20 20 41   support?..    A
8510: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
8520: 69 66 20 36 34 62 69 74 20 53 70 61 72 63 20 56  if 64bit Sparc V
8530: 49 53 20 73 75 70 70 6f 72 74 20 69 73 20 72 65  IS support is re
8540: 71 75 65 73 74 65 64 5d 29 0a 20 20 20 20 41 43  quested]).    AC
8550: 5f 41 52 47 5f 45 4e 41 42 4c 45 28 36 34 62 69  _ARG_ENABLE(64bi
8560: 74 2d 76 69 73 2c 0a 09 41 43 5f 48 45 4c 50 5f  t-vis,..AC_HELP_
8570: 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65  STRING([--enable
8580: 2d 36 34 62 69 74 2d 76 69 73 5d 2c 0a 09 20 20  -64bit-vis],..  
8590: 20 20 5b 65 6e 61 62 6c 65 20 36 34 62 69 74 20    [enable 64bit 
85a0: 53 70 61 72 63 20 56 49 53 20 73 75 70 70 6f 72  Sparc VIS suppor
85b0: 74 20 28 64 65 66 61 75 6c 74 3a 20 6f 66 66 29  t (default: off)
85c0: 5d 29 2c 0a 09 5b 64 6f 36 34 62 69 74 56 49 53  ]),..[do64bitVIS
85d0: 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 20 5b 64  =$enableval], [d
85e0: 6f 36 34 62 69 74 56 49 53 3d 6e 6f 5d 29 0a 20  o64bitVIS=no]). 
85f0: 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54     AC_MSG_RESULT
8600: 28 5b 24 64 6f 36 34 62 69 74 56 49 53 5d 29 0a  ([$do64bitVIS]).
8610: 20 20 20 20 23 20 46 6f 72 63 65 20 36 34 62 69      # Force 64bi
8620: 74 20 6f 6e 20 77 69 74 68 20 56 49 53 0a 20 20  t on with VIS.  
8630: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24    AS_IF([test "$
8640: 64 6f 36 34 62 69 74 56 49 53 22 20 3d 20 22 79  do64bitVIS" = "y
8650: 65 73 22 5d 2c 20 5b 64 6f 36 34 62 69 74 3d 79  es"], [do64bit=y
8660: 65 73 5d 29 0a 0a 20 20 20 20 23 20 53 74 65 70  es])..    # Step
8670: 20 30 2e 63 3a 20 43 68 65 63 6b 20 69 66 20 76   0.c: Check if v
8680: 69 73 69 62 69 6c 69 74 79 20 73 75 70 70 6f 72  isibility suppor
8690: 74 20 69 73 20 61 76 61 69 6c 61 62 6c 65 2e 20  t is available. 
86a0: 44 6f 20 74 68 69 73 20 68 65 72 65 20 73 6f 0a  Do this here so.
86b0: 20 20 20 20 23 20 74 68 61 74 20 70 6c 61 74 66      # that platf
86c0: 6f 72 6d 20 73 70 65 63 69 66 69 63 20 61 6c 74  orm specific alt
86d0: 65 72 6e 61 74 69 76 65 73 20 63 61 6e 20 62 65  ernatives can be
86e0: 20 75 73 65 64 20 62 65 6c 6f 77 20 69 66 20 74   used below if t
86f0: 68 69 73 20 66 61 69 6c 73 2e 0a 0a 20 20 20 20  his fails...    
8700: 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b  AC_CACHE_CHECK([
8710: 69 66 20 63 6f 6d 70 69 6c 65 72 20 73 75 70 70  if compiler supp
8720: 6f 72 74 73 20 76 69 73 69 62 69 6c 69 74 79 20  orts visibility 
8730: 22 68 69 64 64 65 6e 22 5d 2c 0a 09 74 63 6c 5f  "hidden"],..tcl_
8740: 63 76 5f 63 63 5f 76 69 73 69 62 69 6c 69 74 79  cv_cc_visibility
8750: 5f 68 69 64 64 65 6e 2c 20 5b 0a 09 68 6f 6c 64  _hidden, [..hold
8760: 5f 63 66 6c 61 67 73 3d 24 43 46 4c 41 47 53 3b  _cflags=$CFLAGS;
8770: 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53   CFLAGS="$CFLAGS
8780: 20 2d 57 65 72 72 6f 72 22 0a 09 41 43 5f 54 52   -Werror"..AC_TR
8790: 59 5f 4c 49 4e 4b 28 5b 0a 09 20 20 20 20 65 78  Y_LINK([..    ex
87a0: 74 65 72 6e 20 5f 5f 61 74 74 72 69 62 75 74 65  tern __attribute
87b0: 5f 5f 28 28 5f 5f 76 69 73 69 62 69 6c 69 74 79  __((__visibility
87c0: 5f 5f 28 22 68 69 64 64 65 6e 22 29 29 29 20 76  __("hidden"))) v
87d0: 6f 69 64 20 66 28 76 6f 69 64 29 3b 0a 09 20 20  oid f(void);..  
87e0: 20 20 76 6f 69 64 20 66 28 76 6f 69 64 29 20 7b    void f(void) {
87f0: 7d 5d 2c 20 5b 66 28 29 3b 5d 2c 20 74 63 6c 5f  }], [f();], tcl_
8800: 63 76 5f 63 63 5f 76 69 73 69 62 69 6c 69 74 79  cv_cc_visibility
8810: 5f 68 69 64 64 65 6e 3d 79 65 73 2c 0a 09 20 20  _hidden=yes,..  
8820: 20 20 74 63 6c 5f 63 76 5f 63 63 5f 76 69 73 69    tcl_cv_cc_visi
8830: 62 69 6c 69 74 79 5f 68 69 64 64 65 6e 3d 6e 6f  bility_hidden=no
8840: 29 0a 09 43 46 4c 41 47 53 3d 24 68 6f 6c 64 5f  )..CFLAGS=$hold_
8850: 63 66 6c 61 67 73 5d 29 0a 20 20 20 20 41 53 5f  cflags]).    AS_
8860: 49 46 28 5b 74 65 73 74 20 24 74 63 6c 5f 63 76  IF([test $tcl_cv
8870: 5f 63 63 5f 76 69 73 69 62 69 6c 69 74 79 5f 68  _cc_visibility_h
8880: 69 64 64 65 6e 20 3d 20 79 65 73 5d 2c 20 5b 0a  idden = yes], [.
8890: 09 41 43 5f 44 45 46 49 4e 45 28 4d 4f 44 55 4c  .AC_DEFINE(MODUL
88a0: 45 5f 53 43 4f 50 45 2c 0a 09 20 20 20 20 5b 65  E_SCOPE,..    [e
88b0: 78 74 65 72 6e 20 5f 5f 61 74 74 72 69 62 75 74  xtern __attribut
88c0: 65 5f 5f 28 28 5f 5f 76 69 73 69 62 69 6c 69 74  e__((__visibilit
88d0: 79 5f 5f 28 22 68 69 64 64 65 6e 22 29 29 29 5d  y__("hidden")))]
88e0: 2c 0a 09 20 20 20 20 5b 43 6f 6d 70 69 6c 65 72  ,..    [Compiler
88f0: 20 73 75 70 70 6f 72 74 20 66 6f 72 20 6d 6f 64   support for mod
8900: 75 6c 65 20 73 63 6f 70 65 20 73 79 6d 62 6f 6c  ule scope symbol
8910: 73 5d 29 0a 09 41 43 5f 44 45 46 49 4e 45 28 48  s])..AC_DEFINE(H
8920: 41 56 45 5f 48 49 44 44 45 4e 2c 20 5b 31 5d 2c  AVE_HIDDEN, [1],
8930: 20 5b 43 6f 6d 70 69 6c 65 72 20 73 75 70 70 6f   [Compiler suppo
8940: 72 74 20 66 6f 72 20 6d 6f 64 75 6c 65 20 73 63  rt for module sc
8950: 6f 70 65 20 73 79 6d 62 6f 6c 73 5d 29 0a 20 20  ope symbols]).  
8960: 20 20 5d 29 0a 0a 20 20 20 20 23 20 53 74 65 70    ])..    # Step
8970: 20 30 2e 64 3a 20 44 69 73 61 62 6c 65 20 2d 72   0.d: Disable -r
8980: 70 61 74 68 20 73 75 70 70 6f 72 74 3f 0a 0a 20  path support?.. 
8990: 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49     AC_MSG_CHECKI
89a0: 4e 47 28 5b 69 66 20 72 70 61 74 68 20 73 75 70  NG([if rpath sup
89b0: 70 6f 72 74 20 69 73 20 72 65 71 75 65 73 74 65  port is requeste
89c0: 64 5d 29 0a 20 20 20 20 41 43 5f 41 52 47 5f 45  d]).    AC_ARG_E
89d0: 4e 41 42 4c 45 28 72 70 61 74 68 2c 0a 09 41 43  NABLE(rpath,..AC
89e0: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d  _HELP_STRING([--
89f0: 64 69 73 61 62 6c 65 2d 72 70 61 74 68 5d 2c 0a  disable-rpath],.
8a00: 09 20 20 20 20 5b 64 69 73 61 62 6c 65 20 72 70  .    [disable rp
8a10: 61 74 68 20 73 75 70 70 6f 72 74 20 28 64 65 66  ath support (def
8a20: 61 75 6c 74 3a 20 6f 6e 29 5d 29 2c 0a 09 5b 64  ault: on)]),..[d
8a30: 6f 52 70 61 74 68 3d 24 65 6e 61 62 6c 65 76 61  oRpath=$enableva
8a40: 6c 5d 2c 20 5b 64 6f 52 70 61 74 68 3d 79 65 73  l], [doRpath=yes
8a50: 5d 29 0a 20 20 20 20 41 43 5f 4d 53 47 5f 52 45  ]).    AC_MSG_RE
8a60: 53 55 4c 54 28 5b 24 64 6f 52 70 61 74 68 5d 29  SULT([$doRpath])
8a70: 0a 0a 20 20 20 20 23 20 53 74 65 70 20 31 3a 20  ..    # Step 1: 
8a80: 73 65 74 20 74 68 65 20 76 61 72 69 61 62 6c 65  set the variable
8a90: 20 22 73 79 73 74 65 6d 22 20 74 6f 20 68 6f 6c   "system" to hol
8aa0: 64 20 74 68 65 20 6e 61 6d 65 20 61 6e 64 20 76  d the name and v
8ab0: 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 0a 20 20  ersion number.  
8ac0: 20 20 23 20 66 6f 72 20 74 68 65 20 73 79 73 74    # for the syst
8ad0: 65 6d 2e 0a 0a 20 20 20 20 53 43 5f 43 4f 4e 46  em...    SC_CONF
8ae0: 49 47 5f 53 59 53 54 45 4d 0a 0a 20 20 20 20 23  IG_SYSTEM..    #
8af0: 20 53 74 65 70 20 32 3a 20 63 68 65 63 6b 20 66   Step 2: check f
8b00: 6f 72 20 65 78 69 73 74 65 6e 63 65 20 6f 66 20  or existence of 
8b10: 2d 6c 64 6c 20 6c 69 62 72 61 72 79 2e 20 20 54  -ldl library.  T
8b20: 68 69 73 20 69 73 20 6e 65 65 64 65 64 20 62 65  his is needed be
8b30: 63 61 75 73 65 0a 20 20 20 20 23 20 4c 69 6e 75  cause.    # Linu
8b40: 78 20 63 61 6e 20 75 73 65 20 65 69 74 68 65 72  x can use either
8b50: 20 2d 6c 64 6c 20 6f 72 20 2d 6c 64 6c 64 20 66   -ldl or -ldld f
8b60: 6f 72 20 64 79 6e 61 6d 69 63 20 6c 6f 61 64 69  or dynamic loadi
8b70: 6e 67 2e 0a 0a 20 20 20 20 41 43 5f 43 48 45 43  ng...    AC_CHEC
8b80: 4b 5f 4c 49 42 28 64 6c 2c 20 64 6c 6f 70 65 6e  K_LIB(dl, dlopen
8b90: 2c 20 68 61 76 65 5f 64 6c 3d 79 65 73 2c 20 68  , have_dl=yes, h
8ba0: 61 76 65 5f 64 6c 3d 6e 6f 29 0a 0a 20 20 20 20  ave_dl=no)..    
8bb0: 23 20 52 65 71 75 69 72 65 20 72 61 6e 6c 69 62  # Require ranlib
8bc0: 20 65 61 72 6c 79 20 73 6f 20 77 65 20 63 61 6e   early so we can
8bd0: 20 6f 76 65 72 72 69 64 65 20 69 74 20 69 6e 20   override it in 
8be0: 73 70 65 63 69 61 6c 20 63 61 73 65 73 20 62 65  special cases be
8bf0: 6c 6f 77 2e 0a 0a 20 20 20 20 41 43 5f 52 45 51  low...    AC_REQ
8c00: 55 49 52 45 28 5b 41 43 5f 50 52 4f 47 5f 52 41  UIRE([AC_PROG_RA
8c10: 4e 4c 49 42 5d 29 0a 0a 20 20 20 20 23 20 53 74  NLIB])..    # St
8c20: 65 70 20 33 3a 20 73 65 74 20 63 6f 6e 66 69 67  ep 3: set config
8c30: 75 72 61 74 69 6f 6e 20 6f 70 74 69 6f 6e 73 20  uration options 
8c40: 62 61 73 65 64 20 6f 6e 20 73 79 73 74 65 6d 20  based on system 
8c50: 6e 61 6d 65 20 61 6e 64 20 76 65 72 73 69 6f 6e  name and version
8c60: 2e 0a 0a 20 20 20 20 64 6f 36 34 62 69 74 5f 6f  ...    do64bit_o
8c70: 6b 3d 6e 6f 0a 20 20 20 20 23 20 64 65 66 61 75  k=no.    # defau
8c80: 6c 74 20 74 6f 20 27 7b 24 4c 49 42 53 7d 27 20  lt to '{$LIBS}' 
8c90: 61 6e 64 20 73 65 74 20 74 6f 20 22 22 20 6f 6e  and set to "" on
8ca0: 20 70 65 72 2d 70 6c 61 74 66 6f 72 6d 20 6e 65   per-platform ne
8cb0: 63 65 73 73 61 72 79 20 62 61 73 69 73 0a 20 20  cessary basis.  
8cc0: 20 20 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d    SHLIB_LD_LIBS=
8cd0: 27 24 7b 4c 49 42 53 7d 27 0a 20 20 20 20 4c 44  '${LIBS}'.    LD
8ce0: 46 4c 41 47 53 5f 4f 52 49 47 3d 22 24 4c 44 46  FLAGS_ORIG="$LDF
8cf0: 4c 41 47 53 22 0a 20 20 20 20 23 20 57 68 65 6e  LAGS".    # When
8d00: 20 6c 64 20 6e 65 65 64 73 20 6f 70 74 69 6f 6e   ld needs option
8d10: 73 20 74 6f 20 77 6f 72 6b 20 69 6e 20 36 34 2d  s to work in 64-
8d20: 62 69 74 20 6d 6f 64 65 2c 20 70 75 74 20 74 68  bit mode, put th
8d30: 65 6d 20 69 6e 0a 20 20 20 20 23 20 4c 44 46 4c  em in.    # LDFL
8d40: 41 47 53 5f 41 52 43 48 20 73 6f 20 74 68 65 79  AGS_ARCH so they
8d50: 20 65 76 65 6e 74 75 61 6c 6c 79 20 65 6e 64 20   eventually end 
8d60: 75 70 20 69 6e 20 4c 44 46 4c 41 47 53 20 65 76  up in LDFLAGS ev
8d70: 65 6e 20 69 66 20 5b 6c 6f 61 64 5d 0a 20 20 20  en if [load].   
8d80: 20 23 20 69 73 20 64 69 73 61 62 6c 65 64 20 62   # is disabled b
8d90: 79 20 74 68 65 20 75 73 65 72 2e 20 5b 42 75 67  y the user. [Bug
8da0: 20 31 30 31 36 37 39 36 5d 0a 20 20 20 20 4c 44   1016796].    LD
8db0: 46 4c 41 47 53 5f 41 52 43 48 3d 22 22 0a 20 20  FLAGS_ARCH="".  
8dc0: 20 20 55 4e 53 48 41 52 45 44 5f 4c 49 42 5f 53    UNSHARED_LIB_S
8dd0: 55 46 46 49 58 3d 22 22 0a 20 20 20 20 54 43 4c  UFFIX="".    TCL
8de0: 5f 54 52 49 4d 5f 44 4f 54 53 3d 27 60 65 63 68  _TRIM_DOTS='`ech
8df0: 6f 20 24 7b 56 45 52 53 49 4f 4e 7d 20 7c 20 74  o ${VERSION} | t
8e00: 72 20 2d 64 20 2e 60 27 0a 20 20 20 20 45 43 48  r -d .`'.    ECH
8e10: 4f 5f 56 45 52 53 49 4f 4e 3d 27 60 65 63 68 6f  O_VERSION='`echo
8e20: 20 24 7b 56 45 52 53 49 4f 4e 7d 60 27 0a 20 20   ${VERSION}`'.  
8e30: 20 20 54 43 4c 5f 4c 49 42 5f 56 45 52 53 49 4f    TCL_LIB_VERSIO
8e40: 4e 53 5f 4f 4b 3d 6f 6b 0a 20 20 20 20 43 46 4c  NS_OK=ok.    CFL
8e50: 41 47 53 5f 44 45 42 55 47 3d 2d 67 0a 20 20 20  AGS_DEBUG=-g.   
8e60: 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47   AS_IF([test "$G
8e70: 43 43 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 43  CC" = yes], [..C
8e80: 46 4c 41 47 53 5f 4f 50 54 49 4d 49 5a 45 3d 2d  FLAGS_OPTIMIZE=-
8e90: 4f 32 0a 09 43 46 4c 41 47 53 5f 57 41 52 4e 49  O2..CFLAGS_WARNI
8ea0: 4e 47 3d 22 2d 57 61 6c 6c 22 0a 20 20 20 20 5d  NG="-Wall".    ]
8eb0: 2c 20 5b 0a 09 43 46 4c 41 47 53 5f 4f 50 54 49  , [..CFLAGS_OPTI
8ec0: 4d 49 5a 45 3d 2d 4f 0a 09 43 46 4c 41 47 53 5f  MIZE=-O..CFLAGS_
8ed0: 57 41 52 4e 49 4e 47 3d 22 22 0a 20 20 20 20 5d  WARNING="".    ]
8ee0: 29 0a 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 54  ).    AC_CHECK_T
8ef0: 4f 4f 4c 28 41 52 2c 20 61 72 29 0a 20 20 20 20  OOL(AR, ar).    
8f00: 53 54 4c 49 42 5f 4c 44 3d 27 24 7b 41 52 7d 20  STLIB_LD='${AR} 
8f10: 63 72 27 0a 20 20 20 20 4c 44 5f 4c 49 42 52 41  cr'.    LD_LIBRA
8f20: 52 59 5f 50 41 54 48 5f 56 41 52 3d 22 4c 44 5f  RY_PATH_VAR="LD_
8f30: 4c 49 42 52 41 52 59 5f 50 41 54 48 22 0a 20 20  LIBRARY_PATH".  
8f40: 20 20 50 4c 41 54 5f 4f 42 4a 53 3d 22 22 0a 20    PLAT_OBJS="". 
8f50: 20 20 20 50 4c 41 54 5f 53 52 43 53 3d 22 22 0a     PLAT_SRCS="".
8f60: 20 20 20 20 4c 44 41 49 58 5f 53 52 43 3d 22 22      LDAIX_SRC=""
8f70: 0a 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
8f80: 20 78 22 24 7b 53 48 4c 49 42 5f 56 45 52 53 49   x"${SHLIB_VERSI
8f90: 4f 4e 7d 22 20 3d 20 78 5d 2c 20 5b 53 48 4c 49  ON}" = x], [SHLI
8fa0: 42 5f 56 45 52 53 49 4f 4e 3d 22 31 2e 30 22 5d  B_VERSION="1.0"]
8fb0: 29 0a 20 20 20 20 63 61 73 65 20 24 73 79 73 74  ).    case $syst
8fc0: 65 6d 20 69 6e 0a 09 41 49 58 2d 2a 29 0a 09 20  em in..AIX-*).. 
8fd0: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
8fe0: 24 7b 54 43 4c 5f 54 48 52 45 41 44 53 7d 22 20  ${TCL_THREADS}" 
8ff0: 3d 20 22 31 22 20 2d 61 20 22 24 47 43 43 22 20  = "1" -a "$GCC" 
9000: 21 3d 20 22 79 65 73 22 5d 2c 20 5b 0a 09 09 23  != "yes"], [...#
9010: 20 41 49 58 20 72 65 71 75 69 72 65 73 20 74 68   AIX requires th
9020: 65 20 5f 72 20 63 6f 6d 70 69 6c 65 72 20 77 68  e _r compiler wh
9030: 65 6e 20 67 63 63 20 69 73 6e 27 74 20 62 65 69  en gcc isn't bei
9040: 6e 67 20 75 73 65 64 0a 09 09 63 61 73 65 20 22  ng used...case "
9050: 24 7b 43 43 7d 22 20 69 6e 0a 09 09 20 20 20 20  ${CC}" in...    
9060: 2a 5f 72 7c 2a 5f 72 5c 20 2a 29 0a 09 09 09 23  *_r|*_r\ *)....#
9070: 20 6f 6b 20 2e 2e 2e 0a 09 09 09 3b 3b 0a 09 09   ok .......;;...
9080: 20 20 20 20 2a 29 0a 09 09 09 23 20 4d 61 6b 65      *)....# Make
9090: 20 73 75 72 65 20 6f 6e 6c 79 20 66 69 72 73 74   sure only first
90a0: 20 61 72 67 20 67 65 74 73 20 5f 72 0a 09 09 20   arg gets _r... 
90b0: 20 20 20 09 43 43 3d 60 65 63 68 6f 20 22 24 43     .CC=`echo "$C
90c0: 43 22 20 7c 20 73 65 64 20 2d 65 20 27 73 2f 5e  C" | sed -e 's/^
90d0: 5c 28 5b 5b 5e 20 5d 5d 2a 5c 29 2f 5c 31 5f 72  \([[^ ]]*\)/\1_r
90e0: 2f 27 60 0a 09 09 09 3b 3b 0a 09 09 65 73 61 63  /'`....;;...esac
90f0: 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  ...AC_MSG_RESULT
9100: 28 5b 55 73 69 6e 67 20 24 43 43 20 66 6f 72 20  ([Using $CC for 
9110: 63 6f 6d 70 69 6c 69 6e 67 20 77 69 74 68 20 74  compiling with t
9120: 68 72 65 61 64 73 5d 29 0a 09 20 20 20 20 5d 29  hreads])..    ])
9130: 0a 09 20 20 20 20 4c 49 42 53 3d 22 24 4c 49 42  ..    LIBS="$LIB
9140: 53 20 2d 6c 63 22 0a 09 20 20 20 20 53 48 4c 49  S -lc"..    SHLI
9150: 42 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20 20 20  B_CFLAGS=""..   
9160: 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e   SHLIB_SUFFIX=".
9170: 73 6f 22 0a 0a 09 20 20 20 20 44 4c 5f 4f 42 4a  so"...    DL_OBJ
9180: 53 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a  S="tclLoadDl.o".
9190: 09 20 20 20 20 4c 44 5f 4c 49 42 52 41 52 59 5f  .    LD_LIBRARY_
91a0: 50 41 54 48 5f 56 41 52 3d 22 4c 49 42 50 41 54  PATH_VAR="LIBPAT
91b0: 48 22 0a 0a 09 20 20 20 20 23 20 6c 64 41 69 78  H"...    # ldAix
91c0: 20 4e 6f 20 6c 6f 6e 67 65 72 20 6e 65 65 64 65   No longer neede
91d0: 64 20 77 69 74 68 20 75 73 65 20 6f 66 20 2d 62  d with use of -b
91e0: 65 78 70 61 6c 6c 2f 2d 62 72 74 6c 0a 09 20 20  expall/-brtl..  
91f0: 20 20 23 20 62 75 74 20 73 6f 6d 65 20 65 78 74    # but some ext
9200: 65 6e 73 69 6f 6e 73 20 6d 61 79 20 73 74 69 6c  ensions may stil
9210: 6c 20 72 65 66 65 72 65 6e 63 65 20 69 74 0a 09  l reference it..
9220: 20 20 20 20 4c 44 41 49 58 5f 53 52 43 3d 27 24      LDAIX_SRC='$
9230: 28 55 4e 49 58 5f 44 49 52 29 2f 6c 64 41 69 78  (UNIX_DIR)/ldAix
9240: 27 0a 0a 09 20 20 20 20 23 20 43 68 65 63 6b 20  '...    # Check 
9250: 74 6f 20 65 6e 61 62 6c 65 20 36 34 2d 62 69 74  to enable 64-bit
9260: 20 66 6c 61 67 73 20 66 6f 72 20 63 6f 6d 70 69   flags for compi
9270: 6c 65 72 2f 6c 69 6e 6b 65 72 0a 09 20 20 20 20  ler/linker..    
9280: 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 64 6f  AS_IF([test "$do
9290: 36 34 62 69 74 22 20 3d 20 79 65 73 5d 2c 20 5b  64bit" = yes], [
92a0: 0a 09 09 41 53 5f 49 46 28 5b 74 65 73 74 20 22  ...AS_IF([test "
92b0: 24 47 43 43 22 20 3d 20 79 65 73 5d 2c 20 5b 0a  $GCC" = yes], [.
92c0: 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 57 41 52  ..    AC_MSG_WAR
92d0: 4e 28 5b 36 34 62 69 74 20 6d 6f 64 65 20 6e 6f  N([64bit mode no
92e0: 74 20 73 75 70 70 6f 72 74 65 64 20 77 69 74 68  t supported with
92f0: 20 47 43 43 20 6f 6e 20 24 73 79 73 74 65 6d 5d   GCC on $system]
9300: 29 0a 09 09 5d 2c 20 5b 0a 09 09 20 20 20 20 64  )...], [...    d
9310: 6f 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09  o64bit_ok=yes...
9320: 20 20 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c      CFLAGS="$CFL
9330: 41 47 53 20 2d 71 36 34 22 0a 09 09 20 20 20 20  AGS -q64"...    
9340: 4c 44 46 4c 41 47 53 5f 41 52 43 48 3d 22 2d 71  LDFLAGS_ARCH="-q
9350: 36 34 22 0a 09 09 20 20 20 20 52 41 4e 4c 49 42  64"...    RANLIB
9360: 3d 22 24 7b 52 41 4e 4c 49 42 7d 20 2d 58 36 34  ="${RANLIB} -X64
9370: 22 0a 09 09 20 20 20 20 41 52 3d 22 24 7b 41 52  "...    AR="${AR
9380: 7d 20 2d 58 36 34 22 0a 09 09 20 20 20 20 53 48  } -X64"...    SH
9390: 4c 49 42 5f 4c 44 5f 46 4c 41 47 53 3d 22 2d 62  LIB_LD_FLAGS="-b
93a0: 36 34 22 0a 09 09 5d 29 0a 09 20 20 20 20 5d 29  64"...])..    ])
93b0: 0a 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  ...    AS_IF([te
93c0: 73 74 20 22 60 75 6e 61 6d 65 20 2d 6d 60 22 20  st "`uname -m`" 
93d0: 3d 20 69 61 36 34 5d 2c 20 5b 0a 09 09 23 20 41  = ia64], [...# A
93e0: 49 58 2d 35 20 75 73 65 73 20 45 4c 46 20 73 74  IX-5 uses ELF st
93f0: 79 6c 65 20 64 79 6e 61 6d 69 63 20 6c 69 62 72  yle dynamic libr
9400: 61 72 69 65 73 20 6f 6e 20 49 41 2d 36 34 2c 20  aries on IA-64, 
9410: 62 75 74 20 6e 6f 74 20 50 50 43 0a 09 09 53 48  but not PPC...SH
9420: 4c 49 42 5f 4c 44 3d 22 2f 75 73 72 2f 63 63 73  LIB_LD="/usr/ccs
9430: 2f 62 69 6e 2f 6c 64 20 2d 47 20 2d 7a 20 74 65  /bin/ld -G -z te
9440: 78 74 22 0a 09 09 23 20 41 49 58 2d 35 20 68 61  xt"...# AIX-5 ha
9450: 73 20 64 6c 2a 20 69 6e 20 6c 69 62 63 2e 73 6f  s dl* in libc.so
9460: 0a 09 09 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 09  ...DL_LIBS=""...
9470: 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43  AS_IF([test "$GC
9480: 43 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20  C" = yes], [... 
9490: 20 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41     CC_SEARCH_FLA
94a0: 47 53 3d 27 2d 57 6c 2c 2d 52 2c 24 7b 4c 49 42  GS='-Wl,-R,${LIB
94b0: 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09  _RUNTIME_DIR}'..
94c0: 09 5d 2c 20 5b 0a 09 09 20 20 20 20 43 43 5f 53  .], [...    CC_S
94d0: 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d 52 24  EARCH_FLAGS='-R$
94e0: 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52  {LIB_RUNTIME_DIR
94f0: 7d 27 0a 09 09 5d 29 0a 09 09 4c 44 5f 53 45 41  }'...])...LD_SEA
9500: 52 43 48 5f 46 4c 41 47 53 3d 27 2d 52 20 24 7b  RCH_FLAGS='-R ${
9510: 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d  LIB_RUNTIME_DIR}
9520: 27 0a 09 20 20 20 20 5d 2c 20 5b 0a 09 09 41 53  '..    ], [...AS
9530: 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43 43 22  _IF([test "$GCC"
9540: 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20 20 20   = yes], [...   
9550: 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d   SHLIB_LD='${CC}
9560: 20 2d 73 68 61 72 65 64 20 2d 57 6c 2c 2d 62 65   -shared -Wl,-be
9570: 78 70 61 6c 6c 27 0a 09 09 5d 2c 20 5b 0a 09 09  xpall'...], [...
9580: 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 22 2f 62      SHLIB_LD="/b
9590: 69 6e 2f 6c 64 20 2d 62 68 61 6c 74 3a 34 20 2d  in/ld -bhalt:4 -
95a0: 62 4d 3a 53 52 45 20 2d 62 65 78 70 61 6c 6c 20  bM:SRE -bexpall 
95b0: 2d 48 35 31 32 20 2d 54 35 31 32 20 2d 62 6e 6f  -H512 -T512 -bno
95c0: 65 6e 74 72 79 22 0a 09 09 20 20 20 20 4c 44 46  entry"...    LDF
95d0: 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d  LAGS="$LDFLAGS -
95e0: 62 72 74 6c 22 0a 09 09 5d 29 0a 09 09 53 48 4c  brtl"...])...SHL
95f0: 49 42 5f 4c 44 3d 22 24 7b 53 48 4c 49 42 5f 4c  IB_LD="${SHLIB_L
9600: 44 7d 20 24 7b 53 48 4c 49 42 5f 4c 44 5f 46 4c  D} ${SHLIB_LD_FL
9610: 41 47 53 7d 22 0a 09 09 44 4c 5f 4c 49 42 53 3d  AGS}"...DL_LIBS=
9620: 22 2d 6c 64 6c 22 0a 09 09 43 43 5f 53 45 41 52  "-ldl"...CC_SEAR
9630: 43 48 5f 46 4c 41 47 53 3d 27 2d 4c 24 7b 4c 49  CH_FLAGS='-L${LI
9640: 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a  B_RUNTIME_DIR}'.
9650: 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..LD_SEARCH_FLAG
9660: 53 3d 24 7b 43 43 5f 53 45 41 52 43 48 5f 46 4c  S=${CC_SEARCH_FL
9670: 41 47 53 7d 0a 09 20 20 20 20 5d 29 0a 09 20 20  AGS}..    ])..  
9680: 20 20 3b 3b 0a 09 42 65 4f 53 2a 29 0a 09 20 20    ;;..BeOS*)..  
9690: 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22    SHLIB_CFLAGS="
96a0: 2d 66 50 49 43 22 0a 09 20 20 20 20 53 48 4c 49  -fPIC"..    SHLI
96b0: 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 6e 6f 73  B_LD='${CC} -nos
96c0: 74 61 72 74 27 0a 09 20 20 20 20 53 48 4c 49 42  tart'..    SHLIB
96d0: 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09 20  _SUFFIX=".so".. 
96e0: 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c     DL_OBJS="tclL
96f0: 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44 4c  oadDl.o"..    DL
9700: 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a 0a 09 20  _LIBS="-ldl"... 
9710: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
9720: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9730: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9740: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
9750: 09 20 20 20 20 23 20 43 68 65 63 6b 20 66 6f 72  .    # Check for
9760: 20 69 6e 65 74 5f 6e 74 6f 61 20 69 6e 20 2d 6c   inet_ntoa in -l
9770: 62 69 6e 64 2c 20 66 6f 72 20 42 65 4f 53 20 28  bind, for BeOS (
9780: 77 68 69 63 68 20 61 6c 73 6f 20 6e 65 65 64 73  which also needs
9790: 0a 09 20 20 20 20 23 20 2d 6c 73 6f 63 6b 65 74  ..    # -lsocket
97a0: 2c 20 65 76 65 6e 20 69 66 20 74 68 65 20 6e 65  , even if the ne
97b0: 74 77 6f 72 6b 20 66 75 6e 63 74 69 6f 6e 73 20  twork functions 
97c0: 61 72 65 20 69 6e 20 2d 6c 6e 65 74 20 77 68 69  are in -lnet whi
97d0: 63 68 0a 09 20 20 20 20 23 20 69 73 20 61 6c 77  ch..    # is alw
97e0: 61 79 73 20 6c 69 6e 6b 65 64 20 74 6f 2c 20 66  ays linked to, f
97f0: 6f 72 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79  or compatibility
9800: 2e 0a 09 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  ...    #--------
9810: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9820: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9830: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9840: 2d 2d 2d 0a 09 20 20 20 20 41 43 5f 43 48 45 43  ---..    AC_CHEC
9850: 4b 5f 4c 49 42 28 62 69 6e 64 2c 20 69 6e 65 74  K_LIB(bind, inet
9860: 5f 6e 74 6f 61 2c 20 5b 4c 49 42 53 3d 22 24 4c  _ntoa, [LIBS="$L
9870: 49 42 53 20 2d 6c 62 69 6e 64 20 2d 6c 73 6f 63  IBS -lbind -lsoc
9880: 6b 65 74 22 5d 29 0a 09 20 20 20 20 3b 3b 0a 09  ket"])..    ;;..
9890: 42 53 44 2f 4f 53 2d 32 2e 31 2a 7c 42 53 44 2f  BSD/OS-2.1*|BSD/
98a0: 4f 53 2d 33 2a 29 0a 09 20 20 20 20 53 48 4c 49  OS-3*)..    SHLI
98b0: 42 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20 20 20  B_CFLAGS=""..   
98c0: 20 53 48 4c 49 42 5f 4c 44 3d 22 73 68 6c 69 63   SHLIB_LD="shlic
98d0: 63 20 2d 72 22 0a 09 20 20 20 20 53 48 4c 49 42  c -r"..    SHLIB
98e0: 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09 20  _SUFFIX=".so".. 
98f0: 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c     DL_OBJS="tclL
9900: 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44 4c  oadDl.o"..    DL
9910: 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a 09 20 20  _LIBS="-ldl"..  
9920: 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47    CC_SEARCH_FLAG
9930: 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f 53 45 41  S=""..    LD_SEA
9940: 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20  RCH_FLAGS=""..  
9950: 20 20 3b 3b 0a 09 42 53 44 2f 4f 53 2d 34 2e 2a    ;;..BSD/OS-4.*
9960: 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46 4c  )..    SHLIB_CFL
9970: 41 47 53 3d 22 2d 65 78 70 6f 72 74 2d 64 79 6e  AGS="-export-dyn
9980: 61 6d 69 63 20 2d 66 50 49 43 22 0a 09 20 20 20  amic -fPIC"..   
9990: 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d   SHLIB_LD='${CC}
99a0: 20 2d 73 68 61 72 65 64 27 0a 09 20 20 20 20 53   -shared'..    S
99b0: 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f  HLIB_SUFFIX=".so
99c0: 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22  "..    DL_OBJS="
99d0: 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20  tclLoadDl.o"..  
99e0: 20 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22    DL_LIBS="-ldl"
99f0: 0a 09 20 20 20 20 4c 44 46 4c 41 47 53 3d 22 24  ..    LDFLAGS="$
9a00: 4c 44 46 4c 41 47 53 20 2d 65 78 70 6f 72 74 2d  LDFLAGS -export-
9a10: 64 79 6e 61 6d 69 63 22 0a 09 20 20 20 20 43 43  dynamic"..    CC
9a20: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22 22  _SEARCH_FLAGS=""
9a30: 0a 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48 5f  ..    LD_SEARCH_
9a40: 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 3b 3b  FLAGS=""..    ;;
9a50: 0a 09 43 59 47 57 49 4e 5f 2a 7c 4d 49 4e 47 57  ..CYGWIN_*|MINGW
9a60: 33 32 2a 29 0a 09 20 20 20 20 53 48 4c 49 42 5f  32*)..    SHLIB_
9a70: 43 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 53  CFLAGS=""..    S
9a80: 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d  HLIB_LD='${CC} -
9a90: 73 68 61 72 65 64 27 0a 09 20 20 20 20 53 48 4c  shared'..    SHL
9aa0: 49 42 5f 53 55 46 46 49 58 3d 22 2e 64 6c 6c 22  IB_SUFFIX=".dll"
9ab0: 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74  ..    DL_OBJS="t
9ac0: 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20  clLoadDl.o"..   
9ad0: 20 50 4c 41 54 5f 4f 42 4a 53 3d 27 24 7b 43 59   PLAT_OBJS='${CY
9ae0: 47 57 49 4e 5f 4f 42 4a 53 7d 27 0a 09 20 20 20  GWIN_OBJS}'..   
9af0: 20 50 4c 41 54 5f 53 52 43 53 3d 27 24 7b 43 59   PLAT_SRCS='${CY
9b00: 47 57 49 4e 5f 53 52 43 53 7d 27 0a 09 20 20 20  GWIN_SRCS}'..   
9b10: 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a   DL_LIBS="-ldl".
9b20: 09 20 20 20 20 43 43 5f 53 45 41 52 43 48 5f 46  .    CC_SEARCH_F
9b30: 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f  LAGS=""..    LD_
9b40: 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a  SEARCH_FLAGS="".
9b50: 09 20 20 20 20 54 43 4c 5f 4e 45 45 44 53 5f 45  .    TCL_NEEDS_E
9b60: 58 50 5f 46 49 4c 45 3d 31 0a 09 20 20 20 20 54  XP_FILE=1..    T
9b70: 43 4c 5f 45 58 50 4f 52 54 5f 46 49 4c 45 5f 53  CL_EXPORT_FILE_S
9b80: 55 46 46 49 58 3d 27 24 7b 56 45 52 53 49 4f 4e  UFFIX='${VERSION
9b90: 7d 5c 24 5c 7b 44 42 47 58 5c 7d 2e 64 6c 6c 2e  }\$\{DBGX\}.dll.
9ba0: 61 27 0a 09 20 20 20 20 54 43 4c 5f 53 48 4c 49  a'..    TCL_SHLI
9bb0: 42 5f 4c 44 5f 45 58 54 52 41 53 3d 27 2d 57 6c  B_LD_EXTRAS='-Wl
9bc0: 2c 2d 2d 6f 75 74 2d 69 6d 70 6c 69 62 2c 24 5b  ,--out-implib,$[
9bd0: 40 5d 2e 61 27 0a 09 20 20 20 20 54 4b 5f 53 48  @].a'..    TK_SH
9be0: 4c 49 42 5f 4c 44 5f 45 58 54 52 41 53 3d 27 2d  LIB_LD_EXTRAS='-
9bf0: 57 6c 2c 2d 2d 6f 75 74 2d 69 6d 70 6c 69 62 2c  Wl,--out-implib,
9c00: 24 5b 40 5d 2e 61 27 0a 09 20 20 20 20 41 43 5f  $[@].a'..    AC_
9c10: 43 41 43 48 45 5f 43 48 45 43 4b 28 66 6f 72 20  CACHE_CHECK(for 
9c20: 43 79 67 77 69 6e 20 76 65 72 73 69 6f 6e 20 6f  Cygwin version o
9c30: 66 20 67 63 63 2c 0a 09 09 61 63 5f 63 76 5f 63  f gcc,...ac_cv_c
9c40: 79 67 77 69 6e 2c 0a 09 09 41 43 5f 54 52 59 5f  ygwin,...AC_TRY_
9c50: 43 4f 4d 50 49 4c 45 28 5b 0a 09 09 23 69 66 64  COMPILE([...#ifd
9c60: 65 66 20 5f 5f 43 59 47 57 49 4e 5f 5f 0a 09 09  ef __CYGWIN__...
9c70: 20 20 20 20 23 65 72 72 6f 72 20 63 79 67 77 69      #error cygwi
9c80: 6e 0a 09 09 23 65 6e 64 69 66 0a 09 09 5d 2c 20  n...#endif...], 
9c90: 5b 5d 2c 0a 09 09 61 63 5f 63 76 5f 63 79 67 77  [],...ac_cv_cygw
9ca0: 69 6e 3d 6e 6f 2c 0a 09 09 61 63 5f 63 76 5f 63  in=no,...ac_cv_c
9cb0: 79 67 77 69 6e 3d 79 65 73 29 0a 09 20 20 20 20  ygwin=yes)..    
9cc0: 29 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 22  )..    if test "
9cd0: 24 61 63 5f 63 76 5f 63 79 67 77 69 6e 22 20 3d  $ac_cv_cygwin" =
9ce0: 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 41 43   "no"; then...AC
9cf0: 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 24 7b 43 43  _MSG_ERROR([${CC
9d00: 7d 20 69 73 20 6e 6f 74 20 61 20 63 79 67 77 69  } is not a cygwi
9d10: 6e 20 63 6f 6d 70 69 6c 65 72 2e 5d 29 0a 09 20  n compiler.]).. 
9d20: 20 20 20 66 69 0a 09 20 20 20 20 69 66 20 74 65     fi..    if te
9d30: 73 74 20 22 78 24 7b 54 43 4c 5f 54 48 52 45 41  st "x${TCL_THREA
9d40: 44 53 7d 22 20 3d 20 22 78 30 22 3b 20 74 68 65  DS}" = "x0"; the
9d50: 6e 0a 09 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52  n...AC_MSG_ERROR
9d60: 28 5b 43 59 47 57 49 4e 20 63 6f 6d 70 69 6c 65  ([CYGWIN compile
9d70: 20 69 73 20 6f 6e 6c 79 20 73 75 70 70 6f 72 74   is only support
9d80: 65 64 20 77 69 74 68 20 2d 2d 65 6e 61 62 6c 65  ed with --enable
9d90: 2d 74 68 72 65 61 64 73 5d 29 0a 09 20 20 20 20  -threads])..    
9da0: 66 69 0a 09 20 20 20 20 64 6f 36 34 62 69 74 5f  fi..    do64bit_
9db0: 6f 6b 3d 79 65 73 0a 09 20 20 20 20 69 66 20 74  ok=yes..    if t
9dc0: 65 73 74 20 22 78 24 7b 53 48 41 52 45 44 5f 42  est "x${SHARED_B
9dd0: 55 49 4c 44 7d 22 20 3d 20 22 78 31 22 3b 20 74  UILD}" = "x1"; t
9de0: 68 65 6e 0a 09 09 65 63 68 6f 20 22 72 75 6e 6e  hen...echo "runn
9df0: 69 6e 67 20 63 64 20 2e 2e 2f 77 69 6e 3b 20 24  ing cd ../win; $
9e00: 7b 43 4f 4e 46 49 47 5f 53 48 45 4c 4c 2d 2f 62  {CONFIG_SHELL-/b
9e10: 69 6e 2f 73 68 7d 20 2e 2f 63 6f 6e 66 69 67 75  in/sh} ./configu
9e20: 72 65 20 24 61 63 5f 63 6f 6e 66 69 67 75 72 65  re $ac_configure
9e30: 5f 61 72 67 73 22 0a 09 09 23 20 54 68 65 20 65  _args"...# The e
9e40: 76 61 6c 20 6d 61 6b 65 73 20 71 75 6f 74 69 6e  val makes quotin
9e50: 67 20 61 72 67 75 6d 65 6e 74 73 20 77 6f 72 6b  g arguments work
9e60: 2e 0a 09 09 69 66 20 63 64 20 2e 2e 2f 77 69 6e  ....if cd ../win
9e70: 3b 20 65 76 61 6c 20 24 7b 43 4f 4e 46 49 47 5f  ; eval ${CONFIG_
9e80: 53 48 45 4c 4c 2d 2f 62 69 6e 2f 73 68 7d 20 2e  SHELL-/bin/sh} .
9e90: 2f 63 6f 6e 66 69 67 75 72 65 20 24 61 63 5f 63  /configure $ac_c
9ea0: 6f 6e 66 69 67 75 72 65 5f 61 72 67 73 3b 20 63  onfigure_args; c
9eb0: 64 20 2e 2e 2f 75 6e 69 78 0a 09 09 74 68 65 6e  d ../unix...then
9ec0: 20 3a 0a 09 09 65 6c 73 65 0a 09 09 20 20 20 20   :...else...    
9ed0: 7b 20 65 63 68 6f 20 22 63 6f 6e 66 69 67 75 72  { echo "configur
9ee0: 65 3a 20 65 72 72 6f 72 3a 20 63 6f 6e 66 69 67  e: error: config
9ef0: 75 72 65 20 66 61 69 6c 65 64 20 66 6f 72 20 2e  ure failed for .
9f00: 2e 2f 77 69 6e 22 20 31 3e 26 32 3b 20 65 78 69  ./win" 1>&2; exi
9f10: 74 20 31 3b 20 7d 0a 09 09 66 69 0a 09 20 20 20  t 1; }...fi..   
9f20: 20 66 69 0a 09 20 20 20 20 3b 3b 0a 09 64 67 75   fi..    ;;..dgu
9f30: 78 2a 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43  x*)..    SHLIB_C
9f40: 46 4c 41 47 53 3d 22 2d 4b 20 50 49 43 22 0a 09  FLAGS="-K PIC"..
9f50: 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b      SHLIB_LD='${
9f60: 43 43 7d 20 2d 47 27 0a 09 20 20 20 20 53 48 4c  CC} -G'..    SHL
9f70: 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a 09 20  IB_LD_LIBS="".. 
9f80: 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d     SHLIB_SUFFIX=
9f90: 22 2e 73 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42  ".so"..    DL_OB
9fa0: 4a 53 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22  JS="tclLoadDl.o"
9fb0: 0a 09 20 20 20 20 44 4c 5f 4c 49 42 53 3d 22 2d  ..    DL_LIBS="-
9fc0: 6c 64 6c 22 0a 09 20 20 20 20 43 43 5f 53 45 41  ldl"..    CC_SEA
9fd0: 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20  RCH_FLAGS=""..  
9fe0: 20 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47    LD_SEARCH_FLAG
9ff0: 53 3d 22 22 0a 09 20 20 20 20 3b 3b 0a 09 48 61  S=""..    ;;..Ha
a000: 69 6b 75 2a 29 0a 09 20 20 20 20 4c 44 46 4c 41  iku*)..    LDFLA
a010: 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 57 6c  GS="$LDFLAGS -Wl
a020: 2c 2d 2d 65 78 70 6f 72 74 2d 64 79 6e 61 6d 69  ,--export-dynami
a030: 63 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  c"..    SHLIB_CF
a040: 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a 09 20 20  LAGS="-fPIC"..  
a050: 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22    SHLIB_SUFFIX="
a060: 2e 73 6f 22 0a 09 20 20 20 20 53 48 4c 49 42 5f  .so"..    SHLIB_
a070: 4c 44 3d 27 24 7b 43 43 7d 20 2d 73 68 61 72 65  LD='${CC} -share
a080: 64 20 24 7b 43 46 4c 41 47 53 7d 20 24 7b 4c 44  d ${CFLAGS} ${LD
a090: 46 4c 41 47 53 7d 27 0a 09 20 20 20 20 44 4c 5f  FLAGS}'..    DL_
a0a0: 4f 42 4a 53 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e  OBJS="tclLoadDl.
a0b0: 6f 22 0a 09 20 20 20 20 44 4c 5f 4c 49 42 53 3d  o"..    DL_LIBS=
a0c0: 22 2d 6c 72 6f 6f 74 22 0a 09 20 20 20 20 41 43  "-lroot"..    AC
a0d0: 5f 43 48 45 43 4b 5f 4c 49 42 28 6e 65 74 77 6f  _CHECK_LIB(netwo
a0e0: 72 6b 2c 20 69 6e 65 74 5f 6e 74 6f 61 2c 20 5b  rk, inet_ntoa, [
a0f0: 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d 6c 6e 65  LIBS="$LIBS -lne
a100: 74 77 6f 72 6b 22 5d 29 0a 09 20 20 20 20 3b 3b  twork"])..    ;;
a110: 0a 09 48 50 2d 55 58 2d 2a 2e 31 31 2e 2a 29 0a  ..HP-UX-*.11.*).
a120: 09 20 20 20 20 23 20 55 73 65 20 75 70 64 61 74  .    # Use updat
a130: 65 64 20 68 65 61 64 65 72 20 64 65 66 69 6e 69  ed header defini
a140: 74 69 6f 6e 73 20 77 68 65 72 65 20 70 6f 73 73  tions where poss
a150: 69 62 6c 65 0a 09 20 20 20 20 41 43 5f 44 45 46  ible..    AC_DEF
a160: 49 4e 45 28 5f 58 4f 50 45 4e 5f 53 4f 55 52 43  INE(_XOPEN_SOURC
a170: 45 5f 45 58 54 45 4e 44 45 44 2c 20 31 2c 20 5b  E_EXTENDED, 1, [
a180: 44 6f 20 77 65 20 77 61 6e 74 20 74 6f 20 75 73  Do we want to us
a190: 65 20 74 68 65 20 58 4f 50 45 4e 20 6e 65 74 77  e the XOPEN netw
a1a0: 6f 72 6b 20 6c 69 62 72 61 72 79 3f 5d 29 0a 09  ork library?])..
a1b0: 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28 5f 58      AC_DEFINE(_X
a1c0: 4f 50 45 4e 5f 53 4f 55 52 43 45 2c 20 31 2c 20  OPEN_SOURCE, 1, 
a1d0: 5b 44 6f 20 77 65 20 77 61 6e 74 20 74 6f 20 75  [Do we want to u
a1e0: 73 65 20 74 68 65 20 58 4f 50 45 4e 20 6e 65 74  se the XOPEN net
a1f0: 77 6f 72 6b 20 6c 69 62 72 61 72 79 3f 5d 29 0a  work library?]).
a200: 09 20 20 20 20 4c 49 42 53 3d 22 24 4c 49 42 53  .    LIBS="$LIBS
a210: 20 2d 6c 78 6e 65 74 22 20 20 20 20 20 20 20 20   -lxnet"        
a220: 20 20 20 20 20 20 20 23 20 55 73 65 20 74 68 65         # Use the
a230: 20 58 4f 50 45 4e 20 6e 65 74 77 6f 72 6b 20 6c   XOPEN network l
a240: 69 62 72 61 72 79 0a 0a 09 20 20 20 20 41 53 5f  ibrary...    AS_
a250: 49 46 28 5b 74 65 73 74 20 22 60 75 6e 61 6d 65  IF([test "`uname
a260: 20 2d 6d 60 22 20 3d 20 69 61 36 34 5d 2c 20 5b   -m`" = ia64], [
a270: 0a 09 09 53 48 4c 49 42 5f 53 55 46 46 49 58 3d  ...SHLIB_SUFFIX=
a280: 22 2e 73 6f 22 0a 09 20 20 20 20 5d 2c 20 5b 0a  ".so"..    ], [.
a290: 09 09 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22  ..SHLIB_SUFFIX="
a2a0: 2e 73 6c 22 0a 09 20 20 20 20 5d 29 0a 09 20 20  .sl"..    ])..  
a2b0: 20 20 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 64    AC_CHECK_LIB(d
a2c0: 6c 64 2c 20 73 68 6c 5f 6c 6f 61 64 2c 20 74 63  ld, shl_load, tc
a2d0: 6c 5f 6f 6b 3d 79 65 73 2c 20 74 63 6c 5f 6f 6b  l_ok=yes, tcl_ok
a2e0: 3d 6e 6f 29 0a 09 20 20 20 20 41 53 5f 49 46 28  =no)..    AS_IF(
a2f0: 5b 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20  [test "$tcl_ok" 
a300: 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 53 48 4c 49  = yes], [...SHLI
a310: 42 5f 43 46 4c 41 47 53 3d 22 2b 7a 22 0a 09 09  B_CFLAGS="+z"...
a320: 53 48 4c 49 42 5f 4c 44 3d 22 6c 64 20 2d 62 22  SHLIB_LD="ld -b"
a330: 0a 09 09 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c  ...DL_OBJS="tclL
a340: 6f 61 64 53 68 6c 2e 6f 22 0a 09 09 44 4c 5f 4c  oadShl.o"...DL_L
a350: 49 42 53 3d 22 2d 6c 64 6c 64 22 0a 09 09 4c 44  IBS="-ldld"...LD
a360: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20  FLAGS="$LDFLAGS 
a370: 2d 57 6c 2c 2d 45 22 0a 09 09 43 43 5f 53 45 41  -Wl,-E"...CC_SEA
a380: 52 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2b  RCH_FLAGS='-Wl,+
a390: 73 2c 2b 62 2c 24 7b 4c 49 42 5f 52 55 4e 54 49  s,+b,${LIB_RUNTI
a3a0: 4d 45 5f 44 49 52 7d 3a 2e 27 0a 09 09 4c 44 5f  ME_DIR}:.'...LD_
a3b0: 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2b 73  SEARCH_FLAGS='+s
a3c0: 20 2b 62 20 24 7b 4c 49 42 5f 52 55 4e 54 49 4d   +b ${LIB_RUNTIM
a3d0: 45 5f 44 49 52 7d 3a 2e 27 0a 09 09 4c 44 5f 4c  E_DIR}:.'...LD_L
a3e0: 49 42 52 41 52 59 5f 50 41 54 48 5f 56 41 52 3d  IBRARY_PATH_VAR=
a3f0: 22 53 48 4c 49 42 5f 50 41 54 48 22 0a 09 20 20  "SHLIB_PATH"..  
a400: 20 20 5d 29 0a 09 20 20 20 20 41 53 5f 49 46 28    ])..    AS_IF(
a410: 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 79  [test "$GCC" = y
a420: 65 73 5d 2c 20 5b 0a 09 09 53 48 4c 49 42 5f 4c  es], [...SHLIB_L
a430: 44 3d 27 24 7b 43 43 7d 20 2d 73 68 61 72 65 64  D='${CC} -shared
a440: 27 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c  '...LD_SEARCH_FL
a450: 41 47 53 3d 24 7b 43 43 5f 53 45 41 52 43 48 5f  AGS=${CC_SEARCH_
a460: 46 4c 41 47 53 7d 0a 09 20 20 20 20 5d 2c 20 5b  FLAGS}..    ], [
a470: 0a 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c 41  ...CFLAGS="$CFLA
a480: 47 53 20 2d 7a 22 0a 09 20 20 20 20 5d 29 0a 0a  GS -z"..    ])..
a490: 09 20 20 20 20 23 20 55 73 65 72 73 20 6d 61 79  .    # Users may
a4a0: 20 77 61 6e 74 20 50 41 2d 52 49 53 43 20 31 2e   want PA-RISC 1.
a4b0: 31 2f 32 2e 30 20 70 6f 72 74 61 62 6c 65 20 63  1/2.0 portable c
a4c0: 6f 64 65 20 2d 20 6e 65 65 64 73 20 48 50 20 63  ode - needs HP c
a4d0: 63 0a 09 20 20 20 20 23 43 46 4c 41 47 53 3d 22  c..    #CFLAGS="
a4e0: 24 43 46 4c 41 47 53 20 2b 44 41 70 6f 72 74 61  $CFLAGS +DAporta
a4f0: 62 6c 65 22 0a 0a 09 20 20 20 20 23 20 43 68 65  ble"...    # Che
a500: 63 6b 20 74 6f 20 65 6e 61 62 6c 65 20 36 34 2d  ck to enable 64-
a510: 62 69 74 20 66 6c 61 67 73 20 66 6f 72 20 63 6f  bit flags for co
a520: 6d 70 69 6c 65 72 2f 6c 69 6e 6b 65 72 0a 09 20  mpiler/linker.. 
a530: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
a540: 24 64 6f 36 34 62 69 74 22 20 3d 20 22 79 65 73  $do64bit" = "yes
a550: 22 5d 2c 20 5b 0a 09 09 41 53 5f 49 46 28 5b 74  "], [...AS_IF([t
a560: 65 73 74 20 22 24 47 43 43 22 20 3d 20 79 65 73  est "$GCC" = yes
a570: 5d 2c 20 5b 0a 09 09 20 20 20 20 63 61 73 65 20  ], [...    case 
a580: 60 24 7b 43 43 7d 20 2d 64 75 6d 70 6d 61 63 68  `${CC} -dumpmach
a590: 69 6e 65 60 20 69 6e 0a 09 09 09 68 70 70 61 36  ine` in....hppa6
a5a0: 34 2a 29 0a 09 09 09 20 20 20 20 23 20 36 34 2d  4*)....    # 64-
a5b0: 62 69 74 20 67 63 63 20 69 6e 20 75 73 65 2e 20  bit gcc in use. 
a5c0: 20 46 69 78 20 66 6c 61 67 73 20 66 6f 72 20 47   Fix flags for G
a5d0: 4e 55 20 6c 64 2e 0a 09 09 09 20 20 20 20 64 6f  NU ld.....    do
a5e0: 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09 09  64bit_ok=yes....
a5f0: 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b      SHLIB_LD='${
a600: 43 43 7d 20 2d 73 68 61 72 65 64 27 0a 09 09 09  CC} -shared'....
a610: 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
a620: 24 64 6f 52 70 61 74 68 20 3d 20 79 65 73 5d 2c  $doRpath = yes],
a630: 20 5b 0a 09 09 09 09 43 43 5f 53 45 41 52 43 48   [.....CC_SEARCH
a640: 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d 72 70 61  _FLAGS='-Wl,-rpa
a650: 74 68 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45  th,${LIB_RUNTIME
a660: 5f 44 49 52 7d 27 5d 29 0a 09 09 09 20 20 20 20  _DIR}'])....    
a670: 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d  LD_SEARCH_FLAGS=
a680: 24 7b 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47  ${CC_SEARCH_FLAG
a690: 53 7d 0a 09 09 09 20 20 20 20 3b 3b 0a 09 09 09  S}....    ;;....
a6a0: 2a 29 0a 09 09 09 20 20 20 20 41 43 5f 4d 53 47  *)....    AC_MSG
a6b0: 5f 57 41 52 4e 28 5b 36 34 62 69 74 20 6d 6f 64  _WARN([64bit mod
a6c0: 65 20 6e 6f 74 20 73 75 70 70 6f 72 74 65 64 20  e not supported 
a6d0: 77 69 74 68 20 47 43 43 20 6f 6e 20 24 73 79 73  with GCC on $sys
a6e0: 74 65 6d 5d 29 0a 09 09 09 20 20 20 20 3b 3b 0a  tem])....    ;;.
a6f0: 09 09 20 20 20 20 65 73 61 63 0a 09 09 5d 2c 20  ..    esac...], 
a700: 5b 0a 09 09 20 20 20 20 64 6f 36 34 62 69 74 5f  [...    do64bit_
a710: 6f 6b 3d 79 65 73 0a 09 09 20 20 20 20 43 46 4c  ok=yes...    CFL
a720: 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2b 44 44  AGS="$CFLAGS +DD
a730: 36 34 22 0a 09 09 20 20 20 20 4c 44 46 4c 41 47  64"...    LDFLAG
a740: 53 5f 41 52 43 48 3d 22 2b 44 44 36 34 22 0a 09  S_ARCH="+DD64"..
a750: 09 5d 29 0a 09 20 20 20 20 5d 29 20 3b 3b 0a 09  .])..    ]) ;;..
a760: 48 50 2d 55 58 2d 2a 2e 30 38 2e 2a 7c 48 50 2d  HP-UX-*.08.*|HP-
a770: 55 58 2d 2a 2e 30 39 2e 2a 7c 48 50 2d 55 58 2d  UX-*.09.*|HP-UX-
a780: 2a 2e 31 30 2e 2a 29 0a 09 20 20 20 20 53 48 4c  *.10.*)..    SHL
a790: 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6c 22 0a  IB_SUFFIX=".sl".
a7a0: 09 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 4c 49  .    AC_CHECK_LI
a7b0: 42 28 64 6c 64 2c 20 73 68 6c 5f 6c 6f 61 64 2c  B(dld, shl_load,
a7c0: 20 74 63 6c 5f 6f 6b 3d 79 65 73 2c 20 74 63 6c   tcl_ok=yes, tcl
a7d0: 5f 6f 6b 3d 6e 6f 29 0a 09 20 20 20 20 41 53 5f  _ok=no)..    AS_
a7e0: 49 46 28 5b 74 65 73 74 20 22 24 74 63 6c 5f 6f  IF([test "$tcl_o
a7f0: 6b 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 53  k" = yes], [...S
a800: 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2b 7a 22  HLIB_CFLAGS="+z"
a810: 0a 09 09 53 48 4c 49 42 5f 4c 44 3d 22 6c 64 20  ...SHLIB_LD="ld 
a820: 2d 62 22 0a 09 09 53 48 4c 49 42 5f 4c 44 5f 4c  -b"...SHLIB_LD_L
a830: 49 42 53 3d 22 22 0a 09 09 44 4c 5f 4f 42 4a 53  IBS=""...DL_OBJS
a840: 3d 22 74 63 6c 4c 6f 61 64 53 68 6c 2e 6f 22 0a  ="tclLoadShl.o".
a850: 09 09 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 64  ..DL_LIBS="-ldld
a860: 22 0a 09 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44  "...LDFLAGS="$LD
a870: 46 4c 41 47 53 20 2d 57 6c 2c 2d 45 22 0a 09 09  FLAGS -Wl,-E"...
a880: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d  CC_SEARCH_FLAGS=
a890: 27 2d 57 6c 2c 2b 73 2c 2b 62 2c 24 7b 4c 49 42  '-Wl,+s,+b,${LIB
a8a0: 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 3a 2e 27  _RUNTIME_DIR}:.'
a8b0: 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41  ...LD_SEARCH_FLA
a8c0: 47 53 3d 27 2b 73 20 2b 62 20 24 7b 4c 49 42 5f  GS='+s +b ${LIB_
a8d0: 52 55 4e 54 49 4d 45 5f 44 49 52 7d 3a 2e 27 0a  RUNTIME_DIR}:.'.
a8e0: 09 09 4c 44 5f 4c 49 42 52 41 52 59 5f 50 41 54  ..LD_LIBRARY_PAT
a8f0: 48 5f 56 41 52 3d 22 53 48 4c 49 42 5f 50 41 54  H_VAR="SHLIB_PAT
a900: 48 22 0a 09 20 20 20 20 5d 29 20 3b 3b 0a 09 49  H"..    ]) ;;..I
a910: 52 49 58 2d 35 2e 2a 29 0a 09 20 20 20 20 53 48  RIX-5.*)..    SH
a920: 4c 49 42 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20  LIB_CFLAGS="".. 
a930: 20 20 20 53 48 4c 49 42 5f 4c 44 3d 22 6c 64 20     SHLIB_LD="ld 
a940: 2d 73 68 61 72 65 64 20 2d 72 64 61 74 61 5f 73  -shared -rdata_s
a950: 68 61 72 65 64 22 0a 09 20 20 20 20 53 48 4c 49  hared"..    SHLI
a960: 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09  B_SUFFIX=".so"..
a970: 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c      DL_OBJS="tcl
a980: 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44  LoadDl.o"..    D
a990: 4c 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20 41  L_LIBS=""..    A
a9a0: 43 5f 4c 49 42 4f 42 4a 28 6d 6b 73 74 65 6d 70  C_LIBOBJ(mkstemp
a9b0: 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  )..    AS_IF([te
a9c0: 73 74 20 24 64 6f 52 70 61 74 68 20 3d 20 79 65  st $doRpath = ye
a9d0: 73 5d 2c 20 5b 0a 09 09 43 43 5f 53 45 41 52 43  s], [...CC_SEARC
a9e0: 48 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d 72 70  H_FLAGS='-Wl,-rp
a9f0: 61 74 68 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d  ath,${LIB_RUNTIM
aa00: 45 5f 44 49 52 7d 27 0a 09 09 4c 44 5f 53 45 41  E_DIR}'...LD_SEA
aa10: 52 43 48 5f 46 4c 41 47 53 3d 27 2d 72 70 61 74  RCH_FLAGS='-rpat
aa20: 68 20 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f  h ${LIB_RUNTIME_
aa30: 44 49 52 7d 27 5d 29 0a 09 20 20 20 20 3b 3b 0a  DIR}'])..    ;;.
aa40: 09 49 52 49 58 2d 36 2e 2a 29 0a 09 20 20 20 20  .IRIX-6.*)..    
aa50: 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 22 0a  SHLIB_CFLAGS="".
aa60: 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 22 6c  .    SHLIB_LD="l
aa70: 64 20 2d 6e 33 32 20 2d 73 68 61 72 65 64 20 2d  d -n32 -shared -
aa80: 72 64 61 74 61 5f 73 68 61 72 65 64 22 0a 09 20  rdata_shared".. 
aa90: 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d     SHLIB_SUFFIX=
aaa0: 22 2e 73 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42  ".so"..    DL_OB
aab0: 4a 53 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22  JS="tclLoadDl.o"
aac0: 0a 09 20 20 20 20 44 4c 5f 4c 49 42 53 3d 22 22  ..    DL_LIBS=""
aad0: 0a 09 20 20 20 20 41 43 5f 4c 49 42 4f 42 4a 28  ..    AC_LIBOBJ(
aae0: 6d 6b 73 74 65 6d 70 29 0a 09 20 20 20 20 41 53  mkstemp)..    AS
aaf0: 5f 49 46 28 5b 74 65 73 74 20 24 64 6f 52 70 61  _IF([test $doRpa
ab00: 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 43  th = yes], [...C
ab10: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27  C_SEARCH_FLAGS='
ab20: 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b 4c 49 42  -Wl,-rpath,${LIB
ab30: 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09  _RUNTIME_DIR}'..
ab40: 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53  .LD_SEARCH_FLAGS
ab50: 3d 27 2d 72 70 61 74 68 20 24 7b 4c 49 42 5f 52  ='-rpath ${LIB_R
ab60: 55 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29 0a 09  UNTIME_DIR}'])..
ab70: 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
ab80: 22 24 47 43 43 22 20 3d 20 79 65 73 5d 2c 20 5b  "$GCC" = yes], [
ab90: 0a 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c 41  ...CFLAGS="$CFLA
aba0: 47 53 20 2d 6d 61 62 69 3d 6e 33 32 22 0a 09 09  GS -mabi=n32"...
abb0: 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47  LDFLAGS="$LDFLAG
abc0: 53 20 2d 6d 61 62 69 3d 6e 33 32 22 0a 09 20 20  S -mabi=n32"..  
abd0: 20 20 5d 2c 20 5b 0a 09 09 63 61 73 65 20 24 73    ], [...case $s
abe0: 79 73 74 65 6d 20 69 6e 0a 09 09 20 20 20 20 49  ystem in...    I
abf0: 52 49 58 2d 36 2e 33 29 0a 09 09 09 23 20 55 73  RIX-6.3)....# Us
ac00: 65 20 74 6f 20 62 75 69 6c 64 20 36 2e 32 20 63  e to build 6.2 c
ac10: 6f 6d 70 61 74 69 62 6c 65 20 62 69 6e 61 72 69  ompatible binari
ac20: 65 73 20 6f 6e 20 36 2e 33 2e 0a 09 09 09 43 46  es on 6.3.....CF
ac30: 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 6e  LAGS="$CFLAGS -n
ac40: 33 32 20 2d 44 5f 4f 4c 44 5f 54 45 52 4d 49 4f  32 -D_OLD_TERMIO
ac50: 53 22 0a 09 09 09 3b 3b 0a 09 09 20 20 20 20 2a  S"....;;...    *
ac60: 29 0a 09 09 09 43 46 4c 41 47 53 3d 22 24 43 46  )....CFLAGS="$CF
ac70: 4c 41 47 53 20 2d 6e 33 32 22 0a 09 09 09 3b 3b  LAGS -n32"....;;
ac80: 0a 09 09 65 73 61 63 0a 09 09 4c 44 46 4c 41 47  ...esac...LDFLAG
ac90: 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 6e 33 32  S="$LDFLAGS -n32
aca0: 22 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 3b  "..    ])..    ;
acb0: 3b 0a 09 49 52 49 58 36 34 2d 36 2e 2a 29 0a 09  ;..IRIX64-6.*)..
acc0: 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53      SHLIB_CFLAGS
acd0: 3d 22 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c  =""..    SHLIB_L
ace0: 44 3d 22 6c 64 20 2d 6e 33 32 20 2d 73 68 61 72  D="ld -n32 -shar
acf0: 65 64 20 2d 72 64 61 74 61 5f 73 68 61 72 65 64  ed -rdata_shared
ad00: 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46  "..    SHLIB_SUF
ad10: 46 49 58 3d 22 2e 73 6f 22 0a 09 20 20 20 20 44  FIX=".so"..    D
ad20: 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c 6f 61 64 44  L_OBJS="tclLoadD
ad30: 6c 2e 6f 22 0a 09 20 20 20 20 44 4c 5f 4c 49 42  l.o"..    DL_LIB
ad40: 53 3d 22 22 0a 09 20 20 20 20 41 43 5f 4c 49 42  S=""..    AC_LIB
ad50: 4f 42 4a 28 6d 6b 73 74 65 6d 70 29 0a 09 20 20  OBJ(mkstemp)..  
ad60: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24 64    AS_IF([test $d
ad70: 6f 52 70 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b  oRpath = yes], [
ad80: 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  ...CC_SEARCH_FLA
ad90: 47 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24  GS='-Wl,-rpath,$
ada0: 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52  {LIB_RUNTIME_DIR
adb0: 7d 27 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46  }'...LD_SEARCH_F
adc0: 4c 41 47 53 3d 27 2d 72 70 61 74 68 20 24 7b 4c  LAGS='-rpath ${L
add0: 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27  IB_RUNTIME_DIR}'
ade0: 5d 29 0a 0a 09 20 20 20 20 23 20 43 68 65 63 6b  ])...    # Check
adf0: 20 74 6f 20 65 6e 61 62 6c 65 20 36 34 2d 62 69   to enable 64-bi
ae00: 74 20 66 6c 61 67 73 20 66 6f 72 20 63 6f 6d 70  t flags for comp
ae10: 69 6c 65 72 2f 6c 69 6e 6b 65 72 0a 0a 09 20 20  iler/linker...  
ae20: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24    AS_IF([test "$
ae30: 64 6f 36 34 62 69 74 22 20 3d 20 79 65 73 5d 2c  do64bit" = yes],
ae40: 20 5b 0a 09 20 20 20 20 20 20 20 20 41 53 5f 49   [..        AS_I
ae50: 46 28 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d  F([test "$GCC" =
ae60: 20 79 65 73 5d 2c 20 5b 0a 09 20 20 20 20 20 20   yes], [..      
ae70: 20 20 20 20 20 20 41 43 5f 4d 53 47 5f 57 41 52        AC_MSG_WAR
ae80: 4e 28 5b 36 34 62 69 74 20 6d 6f 64 65 20 6e 6f  N([64bit mode no
ae90: 74 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 67  t supported by g
aea0: 63 63 5d 29 0a 09 20 20 20 20 20 20 20 20 5d 2c  cc])..        ],
aeb0: 20 5b 0a 09 20 20 20 20 20 20 20 20 20 20 20 20   [..            
aec0: 64 6f 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09  do64bit_ok=yes..
aed0: 20 20 20 20 20 20 20 20 20 20 20 20 53 48 4c 49              SHLI
aee0: 42 5f 4c 44 3d 22 6c 64 20 2d 36 34 20 2d 73 68  B_LD="ld -64 -sh
aef0: 61 72 65 64 20 2d 72 64 61 74 61 5f 73 68 61 72  ared -rdata_shar
af00: 65 64 22 0a 09 20 20 20 20 20 20 20 20 20 20 20  ed"..           
af10: 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53   CFLAGS="$CFLAGS
af20: 20 2d 36 34 22 0a 09 20 20 20 20 20 20 20 20 20   -64"..         
af30: 20 20 20 4c 44 46 4c 41 47 53 5f 41 52 43 48 3d     LDFLAGS_ARCH=
af40: 22 2d 36 34 22 0a 09 20 20 20 20 20 20 20 20 5d  "-64"..        ]
af50: 29 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 3b  )..    ])..    ;
af60: 3b 0a 09 4c 69 6e 75 78 2a 7c 47 4e 55 2a 7c 4e  ;..Linux*|GNU*|N
af70: 65 74 42 53 44 2d 44 65 62 69 61 6e 29 0a 09 20  etBSD-Debian).. 
af80: 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d     SHLIB_CFLAGS=
af90: 22 2d 66 50 49 43 22 0a 09 20 20 20 20 53 48 4c  "-fPIC"..    SHL
afa0: 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a  IB_SUFFIX=".so".
afb0: 0a 09 20 20 20 20 43 46 4c 41 47 53 5f 4f 50 54  ..    CFLAGS_OPT
afc0: 49 4d 49 5a 45 3d 22 2d 4f 32 22 0a 09 20 20 20  IMIZE="-O2"..   
afd0: 20 23 20 65 67 63 73 2d 32 2e 39 31 2e 36 36 20   # egcs-2.91.66 
afe0: 6f 6e 20 52 65 64 68 61 74 20 4c 69 6e 75 78 20  on Redhat Linux 
aff0: 36 2e 30 20 67 65 6e 65 72 61 74 65 73 20 6c 6f  6.0 generates lo
b000: 74 73 20 6f 66 20 77 61 72 6e 69 6e 67 73 0a 09  ts of warnings..
b010: 20 20 20 20 23 20 77 68 65 6e 20 79 6f 75 20 69      # when you i
b020: 6e 6c 69 6e 65 20 74 68 65 20 73 74 72 69 6e 67  nline the string
b030: 20 61 6e 64 20 6d 61 74 68 20 6f 70 65 72 61 74   and math operat
b040: 69 6f 6e 73 2e 20 20 54 75 72 6e 20 74 68 69 73  ions.  Turn this
b050: 20 6f 66 66 20 74 6f 0a 09 20 20 20 20 23 20 67   off to..    # g
b060: 65 74 20 72 69 64 20 6f 66 20 74 68 65 20 77 61  et rid of the wa
b070: 72 6e 69 6e 67 73 2e 0a 09 20 20 20 20 23 43 46  rnings...    #CF
b080: 4c 41 47 53 5f 4f 50 54 49 4d 49 5a 45 3d 22 24  LAGS_OPTIMIZE="$
b090: 7b 43 46 4c 41 47 53 5f 4f 50 54 49 4d 49 5a 45  {CFLAGS_OPTIMIZE
b0a0: 7d 20 2d 44 5f 5f 4e 4f 5f 53 54 52 49 4e 47 5f  } -D__NO_STRING_
b0b0: 49 4e 4c 49 4e 45 53 20 2d 44 5f 5f 4e 4f 5f 4d  INLINES -D__NO_M
b0c0: 41 54 48 5f 49 4e 4c 49 4e 45 53 22 0a 0a 09 20  ATH_INLINES"... 
b0d0: 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43     SHLIB_LD='${C
b0e0: 43 7d 20 2d 73 68 61 72 65 64 20 24 7b 43 46 4c  C} -shared ${CFL
b0f0: 41 47 53 7d 20 24 7b 4c 44 46 4c 41 47 53 7d 27  AGS} ${LDFLAGS}'
b100: 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74  ..    DL_OBJS="t
b110: 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20  clLoadDl.o"..   
b120: 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a   DL_LIBS="-ldl".
b130: 09 20 20 20 20 4c 44 46 4c 41 47 53 3d 22 24 4c  .    LDFLAGS="$L
b140: 44 46 4c 41 47 53 20 2d 57 6c 2c 2d 2d 65 78 70  DFLAGS -Wl,--exp
b150: 6f 72 74 2d 64 79 6e 61 6d 69 63 22 0a 09 20 20  ort-dynamic"..  
b160: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24 64    AS_IF([test $d
b170: 6f 52 70 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b  oRpath = yes], [
b180: 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  ...CC_SEARCH_FLA
b190: 47 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24  GS='-Wl,-rpath,$
b1a0: 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52  {LIB_RUNTIME_DIR
b1b0: 7d 27 5d 29 0a 09 20 20 20 20 4c 44 5f 53 45 41  }'])..    LD_SEA
b1c0: 52 43 48 5f 46 4c 41 47 53 3d 24 7b 43 43 5f 53  RCH_FLAGS=${CC_S
b1d0: 45 41 52 43 48 5f 46 4c 41 47 53 7d 0a 09 20 20  EARCH_FLAGS}..  
b1e0: 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 60    AS_IF([test "`
b1f0: 75 6e 61 6d 65 20 2d 6d 60 22 20 3d 20 22 61 6c  uname -m`" = "al
b200: 70 68 61 22 5d 2c 20 5b 43 46 4c 41 47 53 3d 22  pha"], [CFLAGS="
b210: 24 43 46 4c 41 47 53 20 2d 6d 69 65 65 65 22 5d  $CFLAGS -mieee"]
b220: 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  )..    AS_IF([te
b230: 73 74 20 24 64 6f 36 34 62 69 74 20 3d 20 79 65  st $do64bit = ye
b240: 73 5d 2c 20 5b 0a 09 09 41 43 5f 43 41 43 48 45  s], [...AC_CACHE
b250: 5f 43 48 45 43 4b 28 5b 69 66 20 63 6f 6d 70 69  _CHECK([if compi
b260: 6c 65 72 20 61 63 63 65 70 74 73 20 2d 6d 36 34  ler accepts -m64
b270: 20 66 6c 61 67 5d 2c 20 74 63 6c 5f 63 76 5f 63   flag], tcl_cv_c
b280: 63 5f 6d 36 34 2c 20 5b 0a 09 09 20 20 20 20 68  c_m64, [...    h
b290: 6f 6c 64 5f 63 66 6c 61 67 73 3d 24 43 46 4c 41  old_cflags=$CFLA
b2a0: 47 53 0a 09 09 20 20 20 20 43 46 4c 41 47 53 3d  GS...    CFLAGS=
b2b0: 22 24 43 46 4c 41 47 53 20 2d 6d 36 34 22 0a 09  "$CFLAGS -m64"..
b2c0: 09 20 20 20 20 41 43 5f 54 52 59 5f 4c 49 4e 4b  .    AC_TRY_LINK
b2d0: 28 2c 2c 20 74 63 6c 5f 63 76 5f 63 63 5f 6d 36  (,, tcl_cv_cc_m6
b2e0: 34 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f 63 63  4=yes, tcl_cv_cc
b2f0: 5f 6d 36 34 3d 6e 6f 29 0a 09 09 20 20 20 20 43  _m64=no)...    C
b300: 46 4c 41 47 53 3d 24 68 6f 6c 64 5f 63 66 6c 61  FLAGS=$hold_cfla
b310: 67 73 5d 29 0a 09 09 41 53 5f 49 46 28 5b 74 65  gs])...AS_IF([te
b320: 73 74 20 24 74 63 6c 5f 63 76 5f 63 63 5f 6d 36  st $tcl_cv_cc_m6
b330: 34 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20 20  4 = yes], [...  
b340: 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47    CFLAGS="$CFLAG
b350: 53 20 2d 6d 36 34 22 0a 09 09 20 20 20 20 64 6f  S -m64"...    do
b360: 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09 09 5d  64bit_ok=yes...]
b370: 29 0a 09 20 20 20 5d 29 0a 0a 09 20 20 20 20 23  )..   ])...    #
b380: 20 54 68 65 20 63 6f 6d 62 6f 20 6f 66 20 67 63   The combo of gc
b390: 63 20 2b 20 67 6c 69 62 63 20 68 61 73 20 61 20  c + glibc has a 
b3a0: 62 75 67 20 72 65 6c 61 74 65 64 20 74 6f 20 69  bug related to i
b3b0: 6e 6c 69 6e 69 6e 67 20 6f 66 0a 09 20 20 20 20  nlining of..    
b3c0: 23 20 66 75 6e 63 74 69 6f 6e 73 20 6c 69 6b 65  # functions like
b3d0: 20 73 74 72 74 6f 64 28 29 2e 20 54 68 65 20 2d   strtod(). The -
b3e0: 66 6e 6f 2d 62 75 69 6c 74 69 6e 20 66 6c 61 67  fno-builtin flag
b3f0: 20 73 68 6f 75 6c 64 20 61 64 64 72 65 73 73 0a   should address.
b400: 09 20 20 20 20 23 20 74 68 69 73 20 70 72 6f 62  .    # this prob
b410: 6c 65 6d 20 62 75 74 20 69 74 20 64 6f 65 73 20  lem but it does 
b420: 6e 6f 74 20 77 6f 72 6b 2e 20 54 68 65 20 2d 66  not work. The -f
b430: 6e 6f 2d 69 6e 6c 69 6e 65 20 66 6c 61 67 20 69  no-inline flag i
b440: 73 20 6b 69 6e 64 0a 09 20 20 20 20 23 20 6f 66  s kind..    # of
b450: 20 6f 76 65 72 6b 69 6c 6c 20 62 75 74 20 69 74   overkill but it
b460: 20 77 6f 72 6b 73 2e 20 44 69 73 61 62 6c 65 20   works. Disable 
b470: 69 6e 6c 69 6e 69 6e 67 20 6f 6e 6c 79 20 77 68  inlining only wh
b480: 65 6e 20 6f 6e 65 20 6f 66 20 74 68 65 0a 09 20  en one of the.. 
b490: 20 20 20 23 20 66 69 6c 65 73 20 69 6e 20 63 6f     # files in co
b4a0: 6d 70 61 74 2f 2a 2e 63 20 69 73 20 62 65 69 6e  mpat/*.c is bein
b4b0: 67 20 6c 69 6e 6b 65 64 20 69 6e 2e 0a 0a 09 20  g linked in.... 
b4c0: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 78     AS_IF([test x
b4d0: 22 24 7b 55 53 45 5f 43 4f 4d 50 41 54 7d 22 20  "${USE_COMPAT}" 
b4e0: 21 3d 20 78 5d 2c 5b 43 46 4c 41 47 53 3d 22 24  != x],[CFLAGS="$
b4f0: 43 46 4c 41 47 53 20 2d 66 6e 6f 2d 69 6e 6c 69  CFLAGS -fno-inli
b500: 6e 65 22 5d 29 0a 09 20 20 20 20 3b 3b 0a 09 4c  ne"])..    ;;..L
b510: 79 6e 78 2a 29 0a 09 20 20 20 20 53 48 4c 49 42  ynx*)..    SHLIB
b520: 5f 43 46 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a  _CFLAGS="-fPIC".
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 09 20 20 20 20 43 46 4c  X=".so"..    CFL
b550: 41 47 53 5f 4f 50 54 49 4d 49 5a 45 3d 2d 30 32  AGS_OPTIMIZE=-02
b560: 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27  ..    SHLIB_LD='
b570: 24 7b 43 43 7d 20 2d 73 68 61 72 65 64 27 0a 09  ${CC} -shared'..
b580: 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c      DL_OBJS="tcl
b590: 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44  LoadDl.o"..    D
b5a0: 4c 5f 4c 49 42 53 3d 22 2d 6d 73 68 61 72 65 64  L_LIBS="-mshared
b5b0: 20 2d 6c 64 6c 22 0a 09 20 20 20 20 4c 44 5f 46   -ldl"..    LD_F
b5c0: 4c 41 47 53 3d 22 2d 57 6c 2c 2d 2d 65 78 70 6f  LAGS="-Wl,--expo
b5d0: 72 74 2d 64 79 6e 61 6d 69 63 22 0a 09 20 20 20  rt-dynamic"..   
b5e0: 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24 64 6f   AS_IF([test $do
b5f0: 52 70 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a  Rpath = yes], [.
b600: 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..CC_SEARCH_FLAG
b610: 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b  S='-Wl,-rpath,${
b620: 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d  LIB_RUNTIME_DIR}
b630: 27 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c  '...LD_SEARCH_FL
b640: 41 47 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c  AGS='-Wl,-rpath,
b650: 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49  ${LIB_RUNTIME_DI
b660: 52 7d 27 5d 29 0a 09 20 20 20 20 3b 3b 0a 09 4d  R}'])..    ;;..M
b670: 50 2d 52 41 53 2d 30 32 2a 29 0a 09 20 20 20 20  P-RAS-02*)..    
b680: 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d 4b  SHLIB_CFLAGS="-K
b690: 20 50 49 43 22 0a 09 20 20 20 20 53 48 4c 49 42   PIC"..    SHLIB
b6a0: 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 47 27 0a 09  _LD='${CC} -G'..
b6b0: 20 20 20 20 53 48 4c 49 42 5f 4c 44 5f 4c 49 42      SHLIB_LD_LIB
b6c0: 53 3d 22 22 0a 09 20 20 20 20 53 48 4c 49 42 5f  S=""..    SHLIB_
b6d0: 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09 20 20  SUFFIX=".so"..  
b6e0: 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c 6f    DL_OBJS="tclLo
b6f0: 61 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44 4c 5f  adDl.o"..    DL_
b700: 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a 09 20 20 20  LIBS="-ldl"..   
b710: 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53   CC_SEARCH_FLAGS
b720: 3d 22 22 0a 09 20 20 20 20 4c 44 5f 53 45 41 52  =""..    LD_SEAR
b730: 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20 20  CH_FLAGS=""..   
b740: 20 3b 3b 0a 09 4d 50 2d 52 41 53 2d 2a 29 0a 09   ;;..MP-RAS-*)..
b750: 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53      SHLIB_CFLAGS
b760: 3d 22 2d 4b 20 50 49 43 22 0a 09 20 20 20 20 53  ="-K PIC"..    S
b770: 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d  HLIB_LD='${CC} -
b780: 47 27 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44  G'..    SHLIB_LD
b790: 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20 53 48  _LIBS=""..    SH
b7a0: 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22  LIB_SUFFIX=".so"
b7b0: 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74  ..    DL_OBJS="t
b7c0: 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20  clLoadDl.o"..   
b7d0: 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a   DL_LIBS="-ldl".
b7e0: 09 20 20 20 20 4c 44 46 4c 41 47 53 3d 22 24 4c  .    LDFLAGS="$L
b7f0: 44 46 4c 41 47 53 20 2d 57 6c 2c 2d 42 65 78 70  DFLAGS -Wl,-Bexp
b800: 6f 72 74 22 0a 09 20 20 20 20 43 43 5f 53 45 41  ort"..    CC_SEA
b810: 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20  RCH_FLAGS=""..  
b820: 20 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47    LD_SEARCH_FLAG
b830: 53 3d 22 22 0a 09 20 20 20 20 3b 3b 0a 09 4f 70  S=""..    ;;..Op
b840: 65 6e 42 53 44 2d 2a 29 0a 09 20 20 20 20 61 72  enBSD-*)..    ar
b850: 63 68 3d 60 61 72 63 68 20 2d 73 60 0a 09 20 20  ch=`arch -s`..  
b860: 20 20 63 61 73 65 20 22 24 61 72 63 68 22 20 69    case "$arch" i
b870: 6e 0a 09 20 20 20 20 76 61 78 29 0a 09 09 23 20  n..    vax)...# 
b880: 45 71 75 69 76 61 6c 65 6e 74 20 75 73 69 6e 67  Equivalent using
b890: 20 63 6f 6e 66 69 67 75 72 65 20 6f 70 74 69 6f   configure optio
b8a0: 6e 20 2d 2d 64 69 73 61 62 6c 65 2d 6c 6f 61 64  n --disable-load
b8b0: 0a 09 09 23 20 53 74 65 70 20 34 20 77 69 6c 6c  ...# Step 4 will
b8c0: 20 73 65 74 20 74 68 65 20 6e 65 63 65 73 73 61   set the necessa
b8d0: 72 79 20 76 61 72 69 61 62 6c 65 73 0a 09 09 44  ry variables...D
b8e0: 4c 5f 4f 42 4a 53 3d 22 22 0a 09 09 53 48 4c 49  L_OBJS=""...SHLI
b8f0: 42 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a 09 09 4c  B_LD_LIBS=""...L
b900: 44 46 4c 41 47 53 3d 22 22 0a 09 09 3b 3b 0a 09  DFLAGS=""...;;..
b910: 20 20 20 20 2a 29 0a 09 09 53 48 4c 49 42 5f 43      *)...SHLIB_C
b920: 46 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a 09 09  FLAGS="-fPIC"...
b930: 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20  SHLIB_LD='${CC} 
b940: 2d 73 68 61 72 65 64 20 24 7b 53 48 4c 49 42 5f  -shared ${SHLIB_
b950: 43 46 4c 41 47 53 7d 27 0a 09 09 53 48 4c 49 42  CFLAGS}'...SHLIB
b960: 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09 09  _SUFFIX=".so"...
b970: 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c 6f 61 64  DL_OBJS="tclLoad
b980: 44 6c 2e 6f 22 0a 09 09 44 4c 5f 4c 49 42 53 3d  Dl.o"...DL_LIBS=
b990: 22 22 0a 09 09 41 53 5f 49 46 28 5b 74 65 73 74  ""...AS_IF([test
b9a0: 20 24 64 6f 52 70 61 74 68 20 3d 20 79 65 73 5d   $doRpath = yes]
b9b0: 2c 20 5b 0a 09 09 20 20 20 20 43 43 5f 53 45 41  , [...    CC_SEA
b9c0: 52 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d  RCH_FLAGS='-Wl,-
b9d0: 72 70 61 74 68 2c 24 7b 4c 49 42 5f 52 55 4e 54  rpath,${LIB_RUNT
b9e0: 49 4d 45 5f 44 49 52 7d 27 5d 29 0a 09 09 4c 44  IME_DIR}'])...LD
b9f0: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 24 7b  _SEARCH_FLAGS=${
ba00: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 7d  CC_SEARCH_FLAGS}
ba10: 0a 09 09 53 48 41 52 45 44 5f 4c 49 42 5f 53 55  ...SHARED_LIB_SU
ba20: 46 46 49 58 3d 27 24 7b 54 43 4c 5f 54 52 49 4d  FFIX='${TCL_TRIM
ba30: 5f 44 4f 54 53 7d 2e 73 6f 2e 24 7b 53 48 4c 49  _DOTS}.so.${SHLI
ba40: 42 5f 56 45 52 53 49 4f 4e 7d 27 0a 09 09 4c 44  B_VERSION}'...LD
ba50: 46 4c 41 47 53 3d 22 2d 57 6c 2c 2d 65 78 70 6f  FLAGS="-Wl,-expo
ba60: 72 74 2d 64 79 6e 61 6d 69 63 22 0a 09 09 3b 3b  rt-dynamic"...;;
ba70: 0a 09 20 20 20 20 65 73 61 63 0a 09 20 20 20 20  ..    esac..    
ba80: 63 61 73 65 20 22 24 61 72 63 68 22 20 69 6e 0a  case "$arch" in.
ba90: 09 20 20 20 20 76 61 78 29 0a 09 09 43 46 4c 41  .    vax)...CFLA
baa0: 47 53 5f 4f 50 54 49 4d 49 5a 45 3d 22 2d 4f 31  GS_OPTIMIZE="-O1
bab0: 22 0a 09 09 3b 3b 0a 09 20 20 20 20 73 68 29 0a  "...;;..    sh).
bac0: 09 09 43 46 4c 41 47 53 5f 4f 50 54 49 4d 49 5a  ..CFLAGS_OPTIMIZ
bad0: 45 3d 22 2d 4f 30 22 0a 09 09 3b 3b 0a 09 20 20  E="-O0"...;;..  
bae0: 20 20 2a 29 0a 09 09 43 46 4c 41 47 53 5f 4f 50    *)...CFLAGS_OP
baf0: 54 49 4d 49 5a 45 3d 22 2d 4f 32 22 0a 09 09 3b  TIMIZE="-O2"...;
bb00: 3b 0a 09 20 20 20 20 65 73 61 63 0a 09 20 20 20  ;..    esac..   
bb10: 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 7b   AS_IF([test "${
bb20: 54 43 4c 5f 54 48 52 45 41 44 53 7d 22 20 3d 20  TCL_THREADS}" = 
bb30: 22 31 22 5d 2c 20 5b 0a 09 09 23 20 4f 6e 20 4f  "1"], [...# On O
bb40: 70 65 6e 42 53 44 3a 09 43 6f 6d 70 69 6c 65 20  penBSD:.Compile 
bb50: 77 69 74 68 20 2d 70 74 68 72 65 61 64 0a 09 09  with -pthread...
bb60: 23 09 09 44 6f 6e 27 74 20 6c 69 6e 6b 20 77 69  #..Don't link wi
bb70: 74 68 20 2d 6c 70 74 68 72 65 61 64 0a 09 09 4c  th -lpthread...L
bb80: 49 42 53 3d 60 65 63 68 6f 20 24 4c 49 42 53 20  IBS=`echo $LIBS 
bb90: 7c 20 73 65 64 20 73 2f 2d 6c 70 74 68 72 65 61  | sed s/-lpthrea
bba0: 64 2f 2f 60 0a 09 09 43 46 4c 41 47 53 3d 22 24  d//`...CFLAGS="$
bbb0: 43 46 4c 41 47 53 20 2d 70 74 68 72 65 61 64 22  CFLAGS -pthread"
bbc0: 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 23 20  ..    ])..    # 
bbd0: 4f 70 65 6e 42 53 44 20 64 6f 65 73 6e 27 74 20  OpenBSD doesn't 
bbe0: 64 6f 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65  do version numbe
bbf0: 72 73 20 77 69 74 68 20 64 6f 74 73 2e 0a 09 20  rs with dots... 
bc00: 20 20 20 55 4e 53 48 41 52 45 44 5f 4c 49 42 5f     UNSHARED_LIB_
bc10: 53 55 46 46 49 58 3d 27 24 7b 54 43 4c 5f 54 52  SUFFIX='${TCL_TR
bc20: 49 4d 5f 44 4f 54 53 7d 2e 61 27 0a 09 20 20 20  IM_DOTS}.a'..   
bc30: 20 54 43 4c 5f 4c 49 42 5f 56 45 52 53 49 4f 4e   TCL_LIB_VERSION
bc40: 53 5f 4f 4b 3d 6e 6f 64 6f 74 73 0a 09 20 20 20  S_OK=nodots..   
bc50: 20 3b 3b 0a 09 4e 65 74 42 53 44 2d 2a 29 0a 09   ;;..NetBSD-*)..
bc60: 20 20 20 20 23 20 4e 65 74 42 53 44 20 68 61 73      # NetBSD has
bc70: 20 45 4c 46 20 61 6e 64 20 63 61 6e 20 75 73 65   ELF and can use
bc80: 20 27 63 63 20 2d 73 68 61 72 65 64 27 20 74 6f   'cc -shared' to
bc90: 20 62 75 69 6c 64 20 73 68 61 72 65 64 20 6c 69   build shared li
bca0: 62 73 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  bs..    SHLIB_CF
bcb0: 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a 09 20 20  LAGS="-fPIC"..  
bcc0: 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43    SHLIB_LD='${CC
bcd0: 7d 20 2d 73 68 61 72 65 64 20 24 7b 53 48 4c 49  } -shared ${SHLI
bce0: 42 5f 43 46 4c 41 47 53 7d 27 0a 09 20 20 20 20  B_CFLAGS}'..    
bcf0: 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73  SHLIB_SUFFIX=".s
bd00: 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d  o"..    DL_OBJS=
bd10: 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20  "tclLoadDl.o".. 
bd20: 20 20 20 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 20     DL_LIBS="".. 
bd30: 20 20 20 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46     LDFLAGS="$LDF
bd40: 4c 41 47 53 20 2d 65 78 70 6f 72 74 2d 64 79 6e  LAGS -export-dyn
bd50: 61 6d 69 63 22 0a 09 20 20 20 20 41 53 5f 49 46  amic"..    AS_IF
bd60: 28 5b 74 65 73 74 20 24 64 6f 52 70 61 74 68 20  ([test $doRpath 
bd70: 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 43 43 5f 53  = yes], [...CC_S
bd80: 45 41 52 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c  EARCH_FLAGS='-Wl
bd90: 2c 2d 72 70 61 74 68 2c 24 7b 4c 49 42 5f 52 55  ,-rpath,${LIB_RU
bda0: 4e 54 49 4d 45 5f 44 49 52 7d 27 5d 29 0a 09 20  NTIME_DIR}']).. 
bdb0: 20 20 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41     LD_SEARCH_FLA
bdc0: 47 53 3d 24 7b 43 43 5f 53 45 41 52 43 48 5f 46  GS=${CC_SEARCH_F
bdd0: 4c 41 47 53 7d 0a 09 20 20 20 20 41 53 5f 49 46  LAGS}..    AS_IF
bde0: 28 5b 74 65 73 74 20 22 24 7b 54 43 4c 5f 54 48  ([test "${TCL_TH
bdf0: 52 45 41 44 53 7d 22 20 3d 20 22 31 22 5d 2c 20  READS}" = "1"], 
be00: 5b 0a 09 09 23 20 54 68 65 20 2d 70 74 68 72 65  [...# The -pthre
be10: 61 64 20 6e 65 65 64 73 20 74 6f 20 67 6f 20 69  ad needs to go i
be20: 6e 20 74 68 65 20 43 46 4c 41 47 53 2c 20 6e 6f  n the CFLAGS, no
be30: 74 20 4c 49 42 53 0a 09 09 4c 49 42 53 3d 60 65  t LIBS...LIBS=`e
be40: 63 68 6f 20 24 4c 49 42 53 20 7c 20 73 65 64 20  cho $LIBS | sed 
be50: 73 2f 2d 70 74 68 72 65 61 64 2f 2f 60 0a 09 09  s/-pthread//`...
be60: 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20  CFLAGS="$CFLAGS 
be70: 2d 70 74 68 72 65 61 64 22 0a 09 20 20 20 20 09  -pthread"..    .
be80: 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47  LDFLAGS="$LDFLAG
be90: 53 20 2d 70 74 68 72 65 61 64 22 0a 09 20 20 20  S -pthread"..   
bea0: 20 5d 29 0a 09 20 20 20 20 3b 3b 0a 09 46 72 65   ])..    ;;..Fre
beb0: 65 42 53 44 2d 2a 29 0a 09 20 20 20 20 23 20 54  eBSD-*)..    # T
bec0: 68 69 73 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  his configuratio
bed0: 6e 20 66 72 6f 6d 20 46 72 65 65 42 53 44 20 50  n from FreeBSD P
bee0: 6f 72 74 73 2e 0a 09 20 20 20 20 53 48 4c 49 42  orts...    SHLIB
bef0: 5f 43 46 4c 41 47 53 3d 22 2d 66 50 49 43 22 0a  _CFLAGS="-fPIC".
bf00: 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 22 24  .    SHLIB_LD="$
bf10: 7b 43 43 7d 20 2d 73 68 61 72 65 64 22 0a 09 20  {CC} -shared".. 
bf20: 20 20 20 54 43 4c 5f 53 48 4c 49 42 5f 4c 44 5f     TCL_SHLIB_LD_
bf30: 45 58 54 52 41 53 3d 22 2d 57 6c 2c 2d 73 6f 6e  EXTRAS="-Wl,-son
bf40: 61 6d 65 3d 5c 24 5b 40 5d 22 0a 09 20 20 20 20  ame=\$[@]"..    
bf50: 54 4b 5f 53 48 4c 49 42 5f 4c 44 5f 45 58 54 52  TK_SHLIB_LD_EXTR
bf60: 41 53 3d 22 2d 57 6c 2c 2d 73 6f 6e 61 6d 65 2c  AS="-Wl,-soname,
bf70: 5c 24 5b 40 5d 22 0a 09 20 20 20 20 53 48 4c 49  \$[@]"..    SHLI
bf80: 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09  B_SUFFIX=".so"..
bf90: 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c      DL_OBJS="tcl
bfa0: 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44  LoadDl.o"..    D
bfb0: 4c 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20 4c  L_LIBS=""..    L
bfc0: 44 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 41  DFLAGS=""..    A
bfd0: 53 5f 49 46 28 5b 74 65 73 74 20 24 64 6f 52 70  S_IF([test $doRp
bfe0: 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09  ath = yes], [...
bff0: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d  CC_SEARCH_FLAGS=
c000: 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b 4c 49  '-Wl,-rpath,${LI
c010: 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a  B_RUNTIME_DIR}'.
c020: 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..LD_SEARCH_FLAG
c030: 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b  S='-Wl,-rpath,${
c040: 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d  LIB_RUNTIME_DIR}
c050: 27 5d 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b  '])..    AS_IF([
c060: 74 65 73 74 20 22 24 7b 54 43 4c 5f 54 48 52 45  test "${TCL_THRE
c070: 41 44 53 7d 22 20 3d 20 22 31 22 5d 2c 20 5b 0a  ADS}" = "1"], [.
c080: 09 09 23 20 54 68 65 20 2d 70 74 68 72 65 61 64  ..# The -pthread
c090: 20 6e 65 65 64 73 20 74 6f 20 67 6f 20 69 6e 20   needs to go in 
c0a0: 74 68 65 20 4c 44 46 4c 41 47 53 2c 20 6e 6f 74  the LDFLAGS, not
c0b0: 20 4c 49 42 53 0a 09 09 4c 49 42 53 3d 60 65 63   LIBS...LIBS=`ec
c0c0: 68 6f 20 24 4c 49 42 53 20 7c 20 73 65 64 20 73  ho $LIBS | sed s
c0d0: 2f 2d 70 74 68 72 65 61 64 2f 2f 60 0a 09 09 43  /-pthread//`...C
c0e0: 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 24  FLAGS="$CFLAGS $
c0f0: 50 54 48 52 45 41 44 5f 43 46 4c 41 47 53 22 0a  PTHREAD_CFLAGS".
c100: 09 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c  ..LDFLAGS="$LDFL
c110: 41 47 53 20 24 50 54 48 52 45 41 44 5f 4c 49 42  AGS $PTHREAD_LIB
c120: 53 22 5d 29 0a 09 20 20 20 20 63 61 73 65 20 24  S"])..    case $
c130: 73 79 73 74 65 6d 20 69 6e 0a 09 20 20 20 20 46  system in..    F
c140: 72 65 65 42 53 44 2d 33 2e 2a 29 0a 09 09 23 20  reeBSD-3.*)...# 
c150: 56 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20  Version numbers 
c160: 61 72 65 20 64 6f 74 2d 73 74 72 69 70 70 65 64  are dot-stripped
c170: 20 62 79 20 73 79 73 74 65 6d 20 70 6f 6c 69 63   by system polic
c180: 79 2e 0a 09 09 54 43 4c 5f 54 52 49 4d 5f 44 4f  y....TCL_TRIM_DO
c190: 54 53 3d 60 65 63 68 6f 20 24 7b 56 45 52 53 49  TS=`echo ${VERSI
c1a0: 4f 4e 7d 20 7c 20 74 72 20 2d 64 20 2e 60 0a 09  ON} | tr -d .`..
c1b0: 09 55 4e 53 48 41 52 45 44 5f 4c 49 42 5f 53 55  .UNSHARED_LIB_SU
c1c0: 46 46 49 58 3d 27 24 7b 54 43 4c 5f 54 52 49 4d  FFIX='${TCL_TRIM
c1d0: 5f 44 4f 54 53 7d 2e 61 27 0a 09 09 53 48 41 52  _DOTS}.a'...SHAR
c1e0: 45 44 5f 4c 49 42 5f 53 55 46 46 49 58 3d 27 24  ED_LIB_SUFFIX='$
c1f0: 7b 54 43 4c 5f 54 52 49 4d 5f 44 4f 54 53 7d 2e  {TCL_TRIM_DOTS}.
c200: 73 6f 27 0a 09 09 54 43 4c 5f 4c 49 42 5f 56 45  so'...TCL_LIB_VE
c210: 52 53 49 4f 4e 53 5f 4f 4b 3d 6e 6f 64 6f 74 73  RSIONS_OK=nodots
c220: 0a 09 09 3b 3b 0a 09 20 20 20 20 65 73 61 63 0a  ...;;..    esac.
c230: 09 20 20 20 20 3b 3b 0a 09 44 61 72 77 69 6e 2d  .    ;;..Darwin-
c240: 2a 29 0a 09 20 20 20 20 43 46 4c 41 47 53 5f 4f  *)..    CFLAGS_O
c250: 50 54 49 4d 49 5a 45 3d 22 2d 4f 73 22 0a 09 20  PTIMIZE="-Os".. 
c260: 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d     SHLIB_CFLAGS=
c270: 22 2d 66 6e 6f 2d 63 6f 6d 6d 6f 6e 22 0a 09 20  "-fno-common".. 
c280: 20 20 20 23 20 54 6f 20 61 76 6f 69 64 20 64 69     # To avoid di
c290: 73 63 72 65 70 61 6e 63 69 65 73 20 62 65 74 77  screpancies betw
c2a0: 65 65 6e 20 77 68 61 74 20 68 65 61 64 65 72 73  een what headers
c2b0: 20 63 6f 6e 66 69 67 75 72 65 20 73 65 65 73 20   configure sees 
c2c0: 64 75 72 69 6e 67 0a 09 20 20 20 20 23 20 70 72  during..    # pr
c2d0: 65 70 72 6f 63 65 73 73 69 6e 67 20 74 65 73 74  eprocessing test
c2e0: 73 20 61 6e 64 20 63 6f 6d 70 69 6c 69 6e 67 20  s and compiling 
c2f0: 74 65 73 74 73 2c 20 6d 6f 76 65 20 61 6e 79 20  tests, move any 
c300: 2d 69 73 79 73 72 6f 6f 74 20 61 6e 64 0a 09 20  -isysroot and.. 
c310: 20 20 20 23 20 2d 6d 6d 61 63 6f 73 78 2d 76 65     # -mmacosx-ve
c320: 72 73 69 6f 6e 2d 6d 69 6e 20 66 6c 61 67 73 20  rsion-min flags 
c330: 66 72 6f 6d 20 43 46 4c 41 47 53 20 74 6f 20 43  from CFLAGS to C
c340: 50 50 46 4c 41 47 53 3a 0a 09 20 20 20 20 43 50  PPFLAGS:..    CP
c350: 50 46 4c 41 47 53 3d 22 24 7b 43 50 50 46 4c 41  PFLAGS="${CPPFLA
c360: 47 53 7d 20 60 65 63 68 6f 20 22 20 24 7b 43 46  GS} `echo " ${CF
c370: 4c 41 47 53 7d 22 20 7c 20 5c 0a 09 09 61 77 6b  LAGS}" | \...awk
c380: 20 27 42 45 47 49 4e 20 7b 46 53 3d 22 20 2b 2d   'BEGIN {FS=" +-
c390: 22 3b 4f 52 53 3d 22 20 22 7d 3b 20 7b 66 6f 72  ";ORS=" "}; {for
c3a0: 20 28 69 3d 32 3b 69 3c 3d 4e 46 3b 69 2b 2b 29   (i=2;i<=NF;i++)
c3b0: 20 5c 0a 09 09 69 66 20 28 5b 24 5d 69 7e 2f 5e   \...if ([$]i~/^
c3c0: 28 69 73 79 73 72 6f 6f 74 7c 6d 6d 61 63 6f 73  (isysroot|mmacos
c3d0: 78 2d 76 65 72 73 69 6f 6e 2d 6d 69 6e 29 2f 29  x-version-min)/)
c3e0: 20 70 72 69 6e 74 20 22 2d 22 5b 24 5d 69 7d 27   print "-"[$]i}'
c3f0: 60 22 0a 09 20 20 20 20 43 46 4c 41 47 53 3d 22  `"..    CFLAGS="
c400: 60 65 63 68 6f 20 22 20 24 7b 43 46 4c 41 47 53  `echo " ${CFLAGS
c410: 7d 22 20 7c 20 5c 0a 09 09 61 77 6b 20 27 42 45  }" | \...awk 'BE
c420: 47 49 4e 20 7b 46 53 3d 22 20 2b 2d 22 3b 4f 52  GIN {FS=" +-";OR
c430: 53 3d 22 20 22 7d 3b 20 7b 66 6f 72 20 28 69 3d  S=" "}; {for (i=
c440: 32 3b 69 3c 3d 4e 46 3b 69 2b 2b 29 20 5c 0a 09  2;i<=NF;i++) \..
c450: 09 69 66 20 28 21 28 5b 24 5d 69 7e 2f 5e 28 69  .if (!([$]i~/^(i
c460: 73 79 73 72 6f 6f 74 7c 6d 6d 61 63 6f 73 78 2d  sysroot|mmacosx-
c470: 76 65 72 73 69 6f 6e 2d 6d 69 6e 29 2f 29 29 20  version-min)/)) 
c480: 70 72 69 6e 74 20 22 2d 22 5b 24 5d 69 7d 27 60  print "-"[$]i}'`
c490: 22 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  "..    AS_IF([te
c4a0: 73 74 20 24 64 6f 36 34 62 69 74 20 3d 20 79 65  st $do64bit = ye
c4b0: 73 5d 2c 20 5b 0a 09 09 63 61 73 65 20 60 61 72  s], [...case `ar
c4c0: 63 68 60 20 69 6e 0a 09 09 20 20 20 20 70 70 63  ch` in...    ppc
c4d0: 29 0a 09 09 09 41 43 5f 43 41 43 48 45 5f 43 48  )....AC_CACHE_CH
c4e0: 45 43 4b 28 5b 69 66 20 63 6f 6d 70 69 6c 65 72  ECK([if compiler
c4f0: 20 61 63 63 65 70 74 73 20 2d 61 72 63 68 20 70   accepts -arch p
c500: 70 63 36 34 20 66 6c 61 67 5d 2c 0a 09 09 09 09  pc64 flag],.....
c510: 74 63 6c 5f 63 76 5f 63 63 5f 61 72 63 68 5f 70  tcl_cv_cc_arch_p
c520: 70 63 36 34 2c 20 5b 0a 09 09 09 20 20 20 20 68  pc64, [....    h
c530: 6f 6c 64 5f 63 66 6c 61 67 73 3d 24 43 46 4c 41  old_cflags=$CFLA
c540: 47 53 0a 09 09 09 20 20 20 20 43 46 4c 41 47 53  GS....    CFLAGS
c550: 3d 22 24 43 46 4c 41 47 53 20 2d 61 72 63 68 20  ="$CFLAGS -arch 
c560: 70 70 63 36 34 20 2d 6d 70 6f 77 65 72 70 63 36  ppc64 -mpowerpc6
c570: 34 20 2d 6d 63 70 75 3d 47 35 22 0a 09 09 09 20  4 -mcpu=G5".... 
c580: 20 20 20 41 43 5f 54 52 59 5f 4c 49 4e 4b 28 2c     AC_TRY_LINK(,
c590: 2c 20 74 63 6c 5f 63 76 5f 63 63 5f 61 72 63 68  , tcl_cv_cc_arch
c5a0: 5f 70 70 63 36 34 3d 79 65 73 2c 0a 09 09 09 09  _ppc64=yes,.....
c5b0: 20 20 20 20 74 63 6c 5f 63 76 5f 63 63 5f 61 72      tcl_cv_cc_ar
c5c0: 63 68 5f 70 70 63 36 34 3d 6e 6f 29 0a 09 09 09  ch_ppc64=no)....
c5d0: 20 20 20 20 43 46 4c 41 47 53 3d 24 68 6f 6c 64      CFLAGS=$hold
c5e0: 5f 63 66 6c 61 67 73 5d 29 0a 09 09 09 41 53 5f  _cflags])....AS_
c5f0: 49 46 28 5b 74 65 73 74 20 24 74 63 6c 5f 63 76  IF([test $tcl_cv
c600: 5f 63 63 5f 61 72 63 68 5f 70 70 63 36 34 20 3d  _cc_arch_ppc64 =
c610: 20 79 65 73 5d 2c 20 5b 0a 09 09 09 20 20 20 20   yes], [....    
c620: 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20  CFLAGS="$CFLAGS 
c630: 2d 61 72 63 68 20 70 70 63 36 34 20 2d 6d 70 6f  -arch ppc64 -mpo
c640: 77 65 72 70 63 36 34 20 2d 6d 63 70 75 3d 47 35  werpc64 -mcpu=G5
c650: 22 0a 09 09 09 20 20 20 20 64 6f 36 34 62 69 74  "....    do64bit
c660: 5f 6f 6b 3d 79 65 73 0a 09 09 09 5d 29 3b 3b 0a  _ok=yes....]);;.
c670: 09 09 20 20 20 20 69 33 38 36 29 0a 09 09 09 41  ..    i386)....A
c680: 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 69  C_CACHE_CHECK([i
c690: 66 20 63 6f 6d 70 69 6c 65 72 20 61 63 63 65 70  f compiler accep
c6a0: 74 73 20 2d 61 72 63 68 20 78 38 36 5f 36 34 20  ts -arch x86_64 
c6b0: 66 6c 61 67 5d 2c 0a 09 09 09 09 74 63 6c 5f 63  flag],.....tcl_c
c6c0: 76 5f 63 63 5f 61 72 63 68 5f 78 38 36 5f 36 34  v_cc_arch_x86_64
c6d0: 2c 20 5b 0a 09 09 09 20 20 20 20 68 6f 6c 64 5f  , [....    hold_
c6e0: 63 66 6c 61 67 73 3d 24 43 46 4c 41 47 53 0a 09  cflags=$CFLAGS..
c6f0: 09 09 20 20 20 20 43 46 4c 41 47 53 3d 22 24 43  ..    CFLAGS="$C
c700: 46 4c 41 47 53 20 2d 61 72 63 68 20 78 38 36 5f  FLAGS -arch x86_
c710: 36 34 22 0a 09 09 09 20 20 20 20 41 43 5f 54 52  64"....    AC_TR
c720: 59 5f 4c 49 4e 4b 28 2c 2c 20 74 63 6c 5f 63 76  Y_LINK(,, tcl_cv
c730: 5f 63 63 5f 61 72 63 68 5f 78 38 36 5f 36 34 3d  _cc_arch_x86_64=
c740: 79 65 73 2c 0a 09 09 09 09 20 20 20 20 74 63 6c  yes,.....    tcl
c750: 5f 63 76 5f 63 63 5f 61 72 63 68 5f 78 38 36 5f  _cv_cc_arch_x86_
c760: 36 34 3d 6e 6f 29 0a 09 09 09 20 20 20 20 43 46  64=no)....    CF
c770: 4c 41 47 53 3d 24 68 6f 6c 64 5f 63 66 6c 61 67  LAGS=$hold_cflag
c780: 73 5d 29 0a 09 09 09 41 53 5f 49 46 28 5b 74 65  s])....AS_IF([te
c790: 73 74 20 24 74 63 6c 5f 63 76 5f 63 63 5f 61 72  st $tcl_cv_cc_ar
c7a0: 63 68 5f 78 38 36 5f 36 34 20 3d 20 79 65 73 5d  ch_x86_64 = yes]
c7b0: 2c 20 5b 0a 09 09 09 20 20 20 20 43 46 4c 41 47  , [....    CFLAG
c7c0: 53 3d 22 24 43 46 4c 41 47 53 20 2d 61 72 63 68  S="$CFLAGS -arch
c7d0: 20 78 38 36 5f 36 34 22 0a 09 09 09 20 20 20 20   x86_64"....    
c7e0: 64 6f 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a 09  do64bit_ok=yes..
c7f0: 09 09 5d 29 3b 3b 0a 09 09 20 20 20 20 2a 29 0a  ..]);;...    *).
c800: 09 09 09 41 43 5f 4d 53 47 5f 57 41 52 4e 28 5b  ...AC_MSG_WARN([
c810: 44 6f 6e 27 74 20 6b 6e 6f 77 20 68 6f 77 20 65  Don't know how e
c820: 6e 61 62 6c 65 20 36 34 2d 62 69 74 20 6f 6e 20  nable 64-bit on 
c830: 61 72 63 68 69 74 65 63 74 75 72 65 20 60 61 72  architecture `ar
c840: 63 68 60 5d 29 3b 3b 0a 09 09 65 73 61 63 0a 09  ch`]);;...esac..
c850: 20 20 20 20 5d 2c 20 5b 0a 09 09 23 20 43 68 65      ], [...# Che
c860: 63 6b 20 66 6f 72 20 63 6f 6d 62 69 6e 65 64 20  ck for combined 
c870: 33 32 2d 62 69 74 20 61 6e 64 20 36 34 2d 62 69  32-bit and 64-bi
c880: 74 20 66 61 74 20 62 75 69 6c 64 0a 09 09 41 53  t fat build...AS
c890: 5f 49 46 28 5b 65 63 68 6f 20 22 24 43 46 4c 41  _IF([echo "$CFLA
c8a0: 47 53 20 22 20 7c 67 72 65 70 20 2d 45 20 2d 71  GS " |grep -E -q
c8b0: 20 2d 2d 20 27 2d 61 72 63 68 20 28 70 70 63 36   -- '-arch (ppc6
c8c0: 34 7c 78 38 36 5f 36 34 29 20 27 20 5c 0a 09 09  4|x86_64) ' \...
c8d0: 20 20 20 20 26 26 20 65 63 68 6f 20 22 24 43 46      && echo "$CF
c8e0: 4c 41 47 53 20 22 20 7c 67 72 65 70 20 2d 45 20  LAGS " |grep -E 
c8f0: 2d 71 20 2d 2d 20 27 2d 61 72 63 68 20 28 70 70  -q -- '-arch (pp
c900: 63 7c 69 33 38 36 29 20 27 5d 2c 20 5b 0a 09 09  c|i386) '], [...
c910: 20 20 20 20 66 61 74 5f 33 32 5f 36 34 3d 79 65      fat_32_64=ye
c920: 73 5d 29 0a 09 20 20 20 20 5d 29 0a 09 20 20 20  s])..    ])..   
c930: 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d   SHLIB_LD='${CC}
c940: 20 2d 64 79 6e 61 6d 69 63 6c 69 62 20 24 7b 43   -dynamiclib ${C
c950: 46 4c 41 47 53 7d 20 24 7b 4c 44 46 4c 41 47 53  FLAGS} ${LDFLAGS
c960: 7d 27 0a 09 20 20 20 20 41 43 5f 43 41 43 48 45  }'..    AC_CACHE
c970: 5f 43 48 45 43 4b 28 5b 69 66 20 6c 64 20 61 63  _CHECK([if ld ac
c980: 63 65 70 74 73 20 2d 73 69 6e 67 6c 65 5f 6d 6f  cepts -single_mo
c990: 64 75 6c 65 20 66 6c 61 67 5d 2c 20 74 63 6c 5f  dule flag], tcl_
c9a0: 63 76 5f 6c 64 5f 73 69 6e 67 6c 65 5f 6d 6f 64  cv_ld_single_mod
c9b0: 75 6c 65 2c 20 5b 0a 09 09 68 6f 6c 64 5f 6c 64  ule, [...hold_ld
c9c0: 66 6c 61 67 73 3d 24 4c 44 46 4c 41 47 53 0a 09  flags=$LDFLAGS..
c9d0: 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41  .LDFLAGS="$LDFLA
c9e0: 47 53 20 2d 64 79 6e 61 6d 69 63 6c 69 62 20 2d  GS -dynamiclib -
c9f0: 57 6c 2c 2d 73 69 6e 67 6c 65 5f 6d 6f 64 75 6c  Wl,-single_modul
ca00: 65 22 0a 09 09 41 43 5f 54 52 59 5f 4c 49 4e 4b  e"...AC_TRY_LINK
ca10: 28 2c 20 5b 69 6e 74 20 69 3b 5d 2c 20 74 63 6c  (, [int i;], tcl
ca20: 5f 63 76 5f 6c 64 5f 73 69 6e 67 6c 65 5f 6d 6f  _cv_ld_single_mo
ca30: 64 75 6c 65 3d 79 65 73 2c 20 74 63 6c 5f 63 76  dule=yes, tcl_cv
ca40: 5f 6c 64 5f 73 69 6e 67 6c 65 5f 6d 6f 64 75 6c  _ld_single_modul
ca50: 65 3d 6e 6f 29 0a 09 09 4c 44 46 4c 41 47 53 3d  e=no)...LDFLAGS=
ca60: 24 68 6f 6c 64 5f 6c 64 66 6c 61 67 73 5d 29 0a  $hold_ldflags]).
ca70: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
ca80: 20 24 74 63 6c 5f 63 76 5f 6c 64 5f 73 69 6e 67   $tcl_cv_ld_sing
ca90: 6c 65 5f 6d 6f 64 75 6c 65 20 3d 20 79 65 73 5d  le_module = yes]
caa0: 2c 20 5b 0a 09 09 53 48 4c 49 42 5f 4c 44 3d 22  , [...SHLIB_LD="
cab0: 24 7b 53 48 4c 49 42 5f 4c 44 7d 20 2d 57 6c 2c  ${SHLIB_LD} -Wl,
cac0: 2d 73 69 6e 67 6c 65 5f 6d 6f 64 75 6c 65 22 0a  -single_module".
cad0: 09 20 20 20 20 5d 29 0a 09 20 20 20 20 53 48 4c  .    ])..    SHL
cae0: 49 42 5f 53 55 46 46 49 58 3d 22 2e 64 79 6c 69  IB_SUFFIX=".dyli
caf0: 62 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d  b"..    DL_OBJS=
cb00: 22 74 63 6c 4c 6f 61 64 44 79 6c 64 2e 6f 22 0a  "tclLoadDyld.o".
cb10: 09 20 20 20 20 44 4c 5f 4c 49 42 53 3d 22 22 0a  .    DL_LIBS="".
cb20: 09 20 20 20 20 23 20 44 6f 6e 27 74 20 75 73 65  .    # Don't use
cb30: 20 2d 70 72 65 62 69 6e 64 20 77 68 65 6e 20 62   -prebind when b
cb40: 75 69 6c 64 69 6e 67 20 66 6f 72 20 4d 61 63 20  uilding for Mac 
cb50: 4f 53 20 58 20 31 30 2e 34 20 6f 72 20 6c 61 74  OS X 10.4 or lat
cb60: 65 72 20 6f 6e 6c 79 3a 0a 09 20 20 20 20 41 53  er only:..    AS
cb70: 5f 49 46 28 5b 74 65 73 74 20 22 60 65 63 68 6f  _IF([test "`echo
cb80: 20 22 24 7b 4d 41 43 4f 53 58 5f 44 45 50 4c 4f   "${MACOSX_DEPLO
cb90: 59 4d 45 4e 54 5f 54 41 52 47 45 54 7d 22 20 7c  YMENT_TARGET}" |
cba0: 20 61 77 6b 20 2d 46 20 27 31 30 5c 5c 2e 27 20   awk -F '10\\.' 
cbb0: 27 7b 70 72 69 6e 74 20 69 6e 74 28 5b 24 5d 32  '{print int([$]2
cbc0: 29 7d 27 60 22 20 2d 6c 74 20 34 20 2d 61 20 5c  )}'`" -lt 4 -a \
cbd0: 0a 09 09 22 60 65 63 68 6f 20 22 24 7b 43 50 50  ..."`echo "${CPP
cbe0: 46 4c 41 47 53 7d 22 20 7c 20 61 77 6b 20 2d 46  FLAGS}" | awk -F
cbf0: 20 27 2d 6d 6d 61 63 6f 73 78 2d 76 65 72 73 69   '-mmacosx-versi
cc00: 6f 6e 2d 6d 69 6e 3d 31 30 5c 5c 2e 27 20 27 7b  on-min=10\\.' '{
cc10: 70 72 69 6e 74 20 69 6e 74 28 5b 24 5d 32 29 7d  print int([$]2)}
cc20: 27 60 22 20 2d 6c 74 20 34 5d 2c 20 5b 0a 09 09  '`" -lt 4], [...
cc30: 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47  LDFLAGS="$LDFLAG
cc40: 53 20 2d 70 72 65 62 69 6e 64 22 5d 29 0a 09 20  S -prebind"]).. 
cc50: 20 20 20 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46     LDFLAGS="$LDF
cc60: 4c 41 47 53 20 2d 68 65 61 64 65 72 70 61 64 5f  LAGS -headerpad_
cc70: 6d 61 78 5f 69 6e 73 74 61 6c 6c 5f 6e 61 6d 65  max_install_name
cc80: 73 22 0a 09 20 20 20 20 41 43 5f 43 41 43 48 45  s"..    AC_CACHE
cc90: 5f 43 48 45 43 4b 28 5b 69 66 20 6c 64 20 61 63  _CHECK([if ld ac
cca0: 63 65 70 74 73 20 2d 73 65 61 72 63 68 5f 70 61  cepts -search_pa
ccb0: 74 68 73 5f 66 69 72 73 74 20 66 6c 61 67 5d 2c  ths_first flag],
ccc0: 0a 09 09 20 20 20 20 74 63 6c 5f 63 76 5f 6c 64  ...    tcl_cv_ld
ccd0: 5f 73 65 61 72 63 68 5f 70 61 74 68 73 5f 66 69  _search_paths_fi
cce0: 72 73 74 2c 20 5b 0a 09 09 68 6f 6c 64 5f 6c 64  rst, [...hold_ld
ccf0: 66 6c 61 67 73 3d 24 4c 44 46 4c 41 47 53 0a 09  flags=$LDFLAGS..
cd00: 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41  .LDFLAGS="$LDFLA
cd10: 47 53 20 2d 57 6c 2c 2d 73 65 61 72 63 68 5f 70  GS -Wl,-search_p
cd20: 61 74 68 73 5f 66 69 72 73 74 22 0a 09 09 41 43  aths_first"...AC
cd30: 5f 54 52 59 5f 4c 49 4e 4b 28 2c 20 5b 69 6e 74  _TRY_LINK(, [int
cd40: 20 69 3b 5d 2c 20 74 63 6c 5f 63 76 5f 6c 64 5f   i;], tcl_cv_ld_
cd50: 73 65 61 72 63 68 5f 70 61 74 68 73 5f 66 69 72  search_paths_fir
cd60: 73 74 3d 79 65 73 2c 0a 09 09 09 74 63 6c 5f 63  st=yes,....tcl_c
cd70: 76 5f 6c 64 5f 73 65 61 72 63 68 5f 70 61 74 68  v_ld_search_path
cd80: 73 5f 66 69 72 73 74 3d 6e 6f 29 0a 09 09 4c 44  s_first=no)...LD
cd90: 46 4c 41 47 53 3d 24 68 6f 6c 64 5f 6c 64 66 6c  FLAGS=$hold_ldfl
cda0: 61 67 73 5d 29 0a 09 20 20 20 20 41 53 5f 49 46  ags])..    AS_IF
cdb0: 28 5b 74 65 73 74 20 24 74 63 6c 5f 63 76 5f 6c  ([test $tcl_cv_l
cdc0: 64 5f 73 65 61 72 63 68 5f 70 61 74 68 73 5f 66  d_search_paths_f
cdd0: 69 72 73 74 20 3d 20 79 65 73 5d 2c 20 5b 0a 09  irst = yes], [..
cde0: 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41  .LDFLAGS="$LDFLA
cdf0: 47 53 20 2d 57 6c 2c 2d 73 65 61 72 63 68 5f 70  GS -Wl,-search_p
ce00: 61 74 68 73 5f 66 69 72 73 74 22 0a 09 20 20 20  aths_first"..   
ce10: 20 5d 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b   ])..    AS_IF([
ce20: 74 65 73 74 20 22 24 74 63 6c 5f 63 76 5f 63 63  test "$tcl_cv_cc
ce30: 5f 76 69 73 69 62 69 6c 69 74 79 5f 68 69 64 64  _visibility_hidd
ce40: 65 6e 22 20 21 3d 20 79 65 73 5d 2c 20 5b 0a 09  en" != yes], [..
ce50: 09 41 43 5f 44 45 46 49 4e 45 28 4d 4f 44 55 4c  .AC_DEFINE(MODUL
ce60: 45 5f 53 43 4f 50 45 2c 20 5b 5f 5f 70 72 69 76  E_SCOPE, [__priv
ce70: 61 74 65 5f 65 78 74 65 72 6e 5f 5f 5d 2c 0a 09  ate_extern__],..
ce80: 09 20 20 20 20 5b 43 6f 6d 70 69 6c 65 72 20 73  .    [Compiler s
ce90: 75 70 70 6f 72 74 20 66 6f 72 20 6d 6f 64 75 6c  upport for modul
cea0: 65 20 73 63 6f 70 65 20 73 79 6d 62 6f 6c 73 5d  e scope symbols]
ceb0: 29 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 43  )..    ])..    C
cec0: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22  C_SEARCH_FLAGS="
ced0: 22 0a 09 20 20 20 20 4c 44 5f 53 45 41 52 43 48  "..    LD_SEARCH
cee0: 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 4c  _FLAGS=""..    L
cef0: 44 5f 4c 49 42 52 41 52 59 5f 50 41 54 48 5f 56  D_LIBRARY_PATH_V
cf00: 41 52 3d 22 44 59 4c 44 5f 4c 49 42 52 41 52 59  AR="DYLD_LIBRARY
cf10: 5f 50 41 54 48 22 0a 09 20 20 20 20 41 43 5f 44  _PATH"..    AC_D
cf20: 45 46 49 4e 45 28 4d 41 43 5f 4f 53 58 5f 54 43  EFINE(MAC_OSX_TC
cf30: 4c 2c 20 31 2c 20 5b 49 73 20 74 68 69 73 20 61  L, 1, [Is this a
cf40: 20 4d 61 63 20 49 20 73 65 65 20 62 65 66 6f 72   Mac I see befor
cf50: 65 20 6d 65 3f 5d 29 0a 09 20 20 20 20 50 4c 41  e me?])..    PLA
cf60: 54 5f 4f 42 4a 53 3d 27 24 7b 4d 41 43 5f 4f 53  T_OBJS='${MAC_OS
cf70: 58 5f 4f 42 4a 53 7d 27 0a 09 20 20 20 20 50 4c  X_OBJS}'..    PL
cf80: 41 54 5f 53 52 43 53 3d 27 24 7b 4d 41 43 5f 4f  AT_SRCS='${MAC_O
cf90: 53 58 5f 53 52 43 53 7d 27 0a 09 20 20 20 20 41  SX_SRCS}'..    A
cfa0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
cfb0: 77 68 65 74 68 65 72 20 74 6f 20 75 73 65 20 43  whether to use C
cfc0: 6f 72 65 46 6f 75 6e 64 61 74 69 6f 6e 5d 29 0a  oreFoundation]).
cfd0: 09 20 20 20 20 41 43 5f 41 52 47 5f 45 4e 41 42  .    AC_ARG_ENAB
cfe0: 4c 45 28 63 6f 72 65 66 6f 75 6e 64 61 74 69 6f  LE(corefoundatio
cff0: 6e 2c 0a 09 09 41 43 5f 48 45 4c 50 5f 53 54 52  n,...AC_HELP_STR
d000: 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 63 6f  ING([--enable-co
d010: 72 65 66 6f 75 6e 64 61 74 69 6f 6e 5d 2c 0a 09  refoundation],..
d020: 09 20 20 20 20 5b 75 73 65 20 43 6f 72 65 46 6f  .    [use CoreFo
d030: 75 6e 64 61 74 69 6f 6e 20 41 50 49 20 6f 6e 20  undation API on 
d040: 4d 61 63 4f 53 58 20 28 64 65 66 61 75 6c 74 3a  MacOSX (default:
d050: 20 6f 6e 29 5d 29 2c 0a 09 09 5b 74 63 6c 5f 63   on)]),...[tcl_c
d060: 6f 72 65 66 6f 75 6e 64 61 74 69 6f 6e 3d 24 65  orefoundation=$e
d070: 6e 61 62 6c 65 76 61 6c 5d 2c 20 5b 74 63 6c 5f  nableval], [tcl_
d080: 63 6f 72 65 66 6f 75 6e 64 61 74 69 6f 6e 3d 79  corefoundation=y
d090: 65 73 5d 29 0a 09 20 20 20 20 41 43 5f 4d 53 47  es])..    AC_MSG
d0a0: 5f 52 45 53 55 4c 54 28 5b 24 74 63 6c 5f 63 6f  _RESULT([$tcl_co
d0b0: 72 65 66 6f 75 6e 64 61 74 69 6f 6e 5d 29 0a 09  refoundation])..
d0c0: 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
d0d0: 24 74 63 6c 5f 63 6f 72 65 66 6f 75 6e 64 61 74  $tcl_corefoundat
d0e0: 69 6f 6e 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09  ion = yes], [...
d0f0: 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b  AC_CACHE_CHECK([
d100: 66 6f 72 20 43 6f 72 65 46 6f 75 6e 64 61 74 69  for CoreFoundati
d110: 6f 6e 2e 66 72 61 6d 65 77 6f 72 6b 5d 2c 0a 09  on.framework],..
d120: 09 09 74 63 6c 5f 63 76 5f 6c 69 62 5f 63 6f 72  ..tcl_cv_lib_cor
d130: 65 66 6f 75 6e 64 61 74 69 6f 6e 2c 20 5b 0a 09  efoundation, [..
d140: 09 20 20 20 20 68 6f 6c 64 5f 6c 69 62 73 3d 24  .    hold_libs=$
d150: 4c 49 42 53 0a 09 09 20 20 20 20 41 53 5f 49 46  LIBS...    AS_IF
d160: 28 5b 74 65 73 74 20 22 24 66 61 74 5f 33 32 5f  ([test "$fat_32_
d170: 36 34 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09  64" = yes], [...
d180: 09 66 6f 72 20 76 20 69 6e 20 43 46 4c 41 47 53  .for v in CFLAGS
d190: 20 43 50 50 46 4c 41 47 53 20 4c 44 46 4c 41 47   CPPFLAGS LDFLAG
d1a0: 53 3b 20 64 6f 0a 09 09 09 20 20 20 20 23 20 4f  S; do....    # O
d1b0: 6e 20 54 69 67 65 72 20 74 68 65 72 65 20 69 73  n Tiger there is
d1c0: 20 6e 6f 20 36 34 2d 62 69 74 20 43 46 2c 20 73   no 64-bit CF, s
d1d0: 6f 20 72 65 6d 6f 76 65 20 36 34 2d 62 69 74 0a  o remove 64-bit.
d1e0: 09 09 09 20 20 20 20 23 20 61 72 63 68 73 20 66  ...    # archs f
d1f0: 72 6f 6d 20 43 46 4c 41 47 53 20 65 74 20 61 6c  rom CFLAGS et al
d200: 2e 20 77 68 69 6c 65 20 74 65 73 74 69 6e 67 20  . while testing 
d210: 66 6f 72 0a 09 09 09 20 20 20 20 23 20 70 72 65  for....    # pre
d220: 73 65 6e 63 65 20 6f 66 20 43 46 2e 20 36 34 2d  sence of CF. 64-
d230: 62 69 74 20 43 46 20 69 73 20 64 69 73 61 62 6c  bit CF is disabl
d240: 65 64 20 69 6e 0a 09 09 09 20 20 20 20 23 20 74  ed in....    # t
d250: 63 6c 55 6e 69 78 50 6f 72 74 2e 68 20 69 66 20  clUnixPort.h if 
d260: 6e 65 63 65 73 73 61 72 79 2e 0a 09 09 09 20 20  necessary.....  
d270: 20 20 65 76 61 6c 20 27 68 6f 6c 64 5f 27 24 76    eval 'hold_'$v
d280: 27 3d 22 24 27 24 76 27 22 3b 27 24 76 27 3d 22  '="$'$v'";'$v'="
d290: 60 65 63 68 6f 20 22 24 27 24 76 27 20 22 7c 73  `echo "$'$v' "|s
d2a0: 65 64 20 2d 65 20 22 73 2f 2d 61 72 63 68 20 70  ed -e "s/-arch p
d2b0: 70 63 36 34 20 2f 20 2f 67 22 20 2d 65 20 22 73  pc64 / /g" -e "s
d2c0: 2f 2d 61 72 63 68 20 78 38 36 5f 36 34 20 2f 20  /-arch x86_64 / 
d2d0: 2f 67 22 60 22 27 0a 09 09 09 64 6f 6e 65 5d 29  /g"`"'....done])
d2e0: 0a 09 09 20 20 20 20 4c 49 42 53 3d 22 24 4c 49  ...    LIBS="$LI
d2f0: 42 53 20 2d 66 72 61 6d 65 77 6f 72 6b 20 43 6f  BS -framework Co
d300: 72 65 46 6f 75 6e 64 61 74 69 6f 6e 22 0a 09 09  reFoundation"...
d310: 20 20 20 20 41 43 5f 54 52 59 5f 4c 49 4e 4b 28      AC_TRY_LINK(
d320: 5b 23 69 6e 63 6c 75 64 65 20 3c 43 6f 72 65 46  [#include <CoreF
d330: 6f 75 6e 64 61 74 69 6f 6e 2f 43 6f 72 65 46 6f  oundation/CoreFo
d340: 75 6e 64 61 74 69 6f 6e 2e 68 3e 5d 2c 0a 09 09  undation.h>],...
d350: 09 5b 43 46 42 75 6e 64 6c 65 52 65 66 20 62 20  .[CFBundleRef b 
d360: 3d 20 43 46 42 75 6e 64 6c 65 47 65 74 4d 61 69  = CFBundleGetMai
d370: 6e 42 75 6e 64 6c 65 28 29 3b 5d 2c 0a 09 09 09  nBundle();],....
d380: 74 63 6c 5f 63 76 5f 6c 69 62 5f 63 6f 72 65 66  tcl_cv_lib_coref
d390: 6f 75 6e 64 61 74 69 6f 6e 3d 79 65 73 2c 0a 09  oundation=yes,..
d3a0: 09 09 74 63 6c 5f 63 76 5f 6c 69 62 5f 63 6f 72  ..tcl_cv_lib_cor
d3b0: 65 66 6f 75 6e 64 61 74 69 6f 6e 3d 6e 6f 29 0a  efoundation=no).
d3c0: 09 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
d3d0: 74 20 22 24 66 61 74 5f 33 32 5f 36 34 22 20 3d  t "$fat_32_64" =
d3e0: 20 79 65 73 5d 2c 20 5b 0a 09 09 09 66 6f 72 20   yes], [....for 
d3f0: 76 20 69 6e 20 43 46 4c 41 47 53 20 43 50 50 46  v in CFLAGS CPPF
d400: 4c 41 47 53 20 4c 44 46 4c 41 47 53 3b 20 64 6f  LAGS LDFLAGS; do
d410: 0a 09 09 09 20 20 20 20 65 76 61 6c 20 24 76 27  ....    eval $v'
d420: 3d 22 24 68 6f 6c 64 5f 27 24 76 27 22 27 0a 09  ="$hold_'$v'"'..
d430: 09 20 20 20 20 20 20 20 20 64 6f 6e 65 5d 29 0a  .        done]).
d440: 09 09 20 20 20 20 4c 49 42 53 3d 24 68 6f 6c 64  ..    LIBS=$hold
d450: 5f 6c 69 62 73 5d 29 0a 09 09 41 53 5f 49 46 28  _libs])...AS_IF(
d460: 5b 74 65 73 74 20 24 74 63 6c 5f 63 76 5f 6c 69  [test $tcl_cv_li
d470: 62 5f 63 6f 72 65 66 6f 75 6e 64 61 74 69 6f 6e  b_corefoundation
d480: 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 20 20 20   = yes], [...   
d490: 20 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d 66 72   LIBS="$LIBS -fr
d4a0: 61 6d 65 77 6f 72 6b 20 43 6f 72 65 46 6f 75 6e  amework CoreFoun
d4b0: 64 61 74 69 6f 6e 22 0a 09 09 20 20 20 20 41 43  dation"...    AC
d4c0: 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 43 4f 52  _DEFINE(HAVE_COR
d4d0: 45 46 4f 55 4e 44 41 54 49 4f 4e 2c 20 31 2c 0a  EFOUNDATION, 1,.
d4e0: 09 09 09 5b 44 6f 20 77 65 20 68 61 76 65 20 61  ...[Do we have a
d4f0: 63 63 65 73 73 20 74 6f 20 44 61 72 77 69 6e 20  ccess to Darwin 
d500: 43 6f 72 65 46 6f 75 6e 64 61 74 69 6f 6e 2e 66  CoreFoundation.f
d510: 72 61 6d 65 77 6f 72 6b 3f 5d 29 0a 09 09 5d 2c  ramework?])...],
d520: 20 5b 74 63 6c 5f 63 6f 72 65 66 6f 75 6e 64 61   [tcl_corefounda
d530: 74 69 6f 6e 3d 6e 6f 5d 29 0a 09 09 41 53 5f 49  tion=no])...AS_I
d540: 46 28 5b 74 65 73 74 20 22 24 66 61 74 5f 33 32  F([test "$fat_32
d550: 5f 36 34 22 20 3d 20 79 65 73 20 2d 61 20 24 74  _64" = yes -a $t
d560: 63 6c 5f 63 6f 72 65 66 6f 75 6e 64 61 74 69 6f  cl_corefoundatio
d570: 6e 20 3d 20 79 65 73 5d 2c 5b 0a 09 09 20 20 20  n = yes],[...   
d580: 20 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28   AC_CACHE_CHECK(
d590: 5b 66 6f 72 20 36 34 2d 62 69 74 20 43 6f 72 65  [for 64-bit Core
d5a0: 46 6f 75 6e 64 61 74 69 6f 6e 5d 2c 0a 09 09 09  Foundation],....
d5b0: 20 20 20 20 74 63 6c 5f 63 76 5f 6c 69 62 5f 63      tcl_cv_lib_c
d5c0: 6f 72 65 66 6f 75 6e 64 61 74 69 6f 6e 5f 36 34  orefoundation_64
d5d0: 2c 20 5b 0a 09 09 09 66 6f 72 20 76 20 69 6e 20  , [....for v in 
d5e0: 43 46 4c 41 47 53 20 43 50 50 46 4c 41 47 53 20  CFLAGS CPPFLAGS 
d5f0: 4c 44 46 4c 41 47 53 3b 20 64 6f 0a 09 09 09 20  LDFLAGS; do.... 
d600: 20 20 20 65 76 61 6c 20 27 68 6f 6c 64 5f 27 24     eval 'hold_'$
d610: 76 27 3d 22 24 27 24 76 27 22 3b 27 24 76 27 3d  v'="$'$v'";'$v'=
d620: 22 60 65 63 68 6f 20 22 24 27 24 76 27 20 22 7c  "`echo "$'$v' "|
d630: 73 65 64 20 2d 65 20 22 73 2f 2d 61 72 63 68 20  sed -e "s/-arch 
d640: 70 70 63 20 2f 20 2f 67 22 20 2d 65 20 22 73 2f  ppc / /g" -e "s/
d650: 2d 61 72 63 68 20 69 33 38 36 20 2f 20 2f 67 22  -arch i386 / /g"
d660: 60 22 27 0a 09 09 09 64 6f 6e 65 0a 09 09 09 41  `"'....done....A
d670: 43 5f 54 52 59 5f 4c 49 4e 4b 28 5b 23 69 6e 63  C_TRY_LINK([#inc
d680: 6c 75 64 65 20 3c 43 6f 72 65 46 6f 75 6e 64 61  lude <CoreFounda
d690: 74 69 6f 6e 2f 43 6f 72 65 46 6f 75 6e 64 61 74  tion/CoreFoundat
d6a0: 69 6f 6e 2e 68 3e 5d 2c 0a 09 09 09 20 20 20 20  ion.h>],....    
d6b0: 5b 43 46 42 75 6e 64 6c 65 52 65 66 20 62 20 3d  [CFBundleRef b =
d6c0: 20 43 46 42 75 6e 64 6c 65 47 65 74 4d 61 69 6e   CFBundleGetMain
d6d0: 42 75 6e 64 6c 65 28 29 3b 5d 2c 0a 09 09 09 20  Bundle();],.... 
d6e0: 20 20 20 74 63 6c 5f 63 76 5f 6c 69 62 5f 63 6f     tcl_cv_lib_co
d6f0: 72 65 66 6f 75 6e 64 61 74 69 6f 6e 5f 36 34 3d  refoundation_64=
d700: 79 65 73 2c 0a 09 09 09 20 20 20 20 74 63 6c 5f  yes,....    tcl_
d710: 63 76 5f 6c 69 62 5f 63 6f 72 65 66 6f 75 6e 64  cv_lib_corefound
d720: 61 74 69 6f 6e 5f 36 34 3d 6e 6f 29 0a 09 09 09  ation_64=no)....
d730: 66 6f 72 20 76 20 69 6e 20 43 46 4c 41 47 53 20  for v in CFLAGS 
d740: 43 50 50 46 4c 41 47 53 20 4c 44 46 4c 41 47 53  CPPFLAGS LDFLAGS
d750: 3b 20 64 6f 0a 09 09 09 20 20 20 20 65 76 61 6c  ; do....    eval
d760: 20 24 76 27 3d 22 24 68 6f 6c 64 5f 27 24 76 27   $v'="$hold_'$v'
d770: 22 27 0a 09 09 09 64 6f 6e 65 5d 29 0a 09 09 20  "'....done])... 
d780: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24     AS_IF([test $
d790: 74 63 6c 5f 63 76 5f 6c 69 62 5f 63 6f 72 65 66  tcl_cv_lib_coref
d7a0: 6f 75 6e 64 61 74 69 6f 6e 5f 36 34 20 3d 20 6e  oundation_64 = n
d7b0: 6f 5d 2c 20 5b 0a 09 09 09 41 43 5f 44 45 46 49  o], [....AC_DEFI
d7c0: 4e 45 28 4e 4f 5f 43 4f 52 45 46 4f 55 4e 44 41  NE(NO_COREFOUNDA
d7d0: 54 49 4f 4e 5f 36 34 2c 20 31 2c 0a 09 09 09 20  TION_64, 1,.... 
d7e0: 20 20 20 5b 49 73 20 44 61 72 77 69 6e 20 43 6f     [Is Darwin Co
d7f0: 72 65 46 6f 75 6e 64 61 74 69 6f 6e 20 75 6e 61  reFoundation una
d800: 76 61 69 6c 61 62 6c 65 20 66 6f 72 20 36 34 2d  vailable for 64-
d810: 62 69 74 3f 5d 29 0a 20 20 20 20 20 20 20 20 20  bit?]).         
d820: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c                 L
d830: 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53  DFLAGS="$LDFLAGS
d840: 20 2d 57 6c 2c 2d 6e 6f 5f 61 72 63 68 5f 77 61   -Wl,-no_arch_wa
d850: 72 6e 69 6e 67 73 22 0a 09 09 20 20 20 20 5d 29  rnings"...    ])
d860: 0a 09 09 5d 29 0a 09 20 20 20 20 5d 29 0a 09 20  ...])..    ]).. 
d870: 20 20 20 3b 3b 0a 09 4e 45 58 54 53 54 45 50 2d     ;;..NEXTSTEP-
d880: 2a 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  *)..    SHLIB_CF
d890: 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 53 48 4c  LAGS=""..    SHL
d8a0: 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d 6e 6f  IB_LD='${CC} -no
d8b0: 73 74 64 6c 69 62 20 2d 72 27 0a 09 20 20 20 20  stdlib -r'..    
d8c0: 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 22  SHLIB_LD_LIBS=""
d8d0: 0a 09 20 20 20 20 53 48 4c 49 42 5f 53 55 46 46  ..    SHLIB_SUFF
d8e0: 49 58 3d 22 2e 73 6f 22 0a 09 20 20 20 20 44 4c  IX=".so"..    DL
d8f0: 5f 4f 42 4a 53 3d 22 74 63 6c 4c 6f 61 64 4e 65  _OBJS="tclLoadNe
d900: 78 74 2e 6f 22 0a 09 20 20 20 20 44 4c 5f 4c 49  xt.o"..    DL_LI
d910: 42 53 3d 22 22 0a 09 20 20 20 20 43 43 5f 53 45  BS=""..    CC_SE
d920: 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20  ARCH_FLAGS="".. 
d930: 20 20 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41     LD_SEARCH_FLA
d940: 47 53 3d 22 22 0a 09 20 20 20 20 3b 3b 0a 09 4f  GS=""..    ;;..O
d950: 53 2f 33 39 30 2d 2a 29 0a 09 20 20 20 20 53 48  S/390-*)..    SH
d960: 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a 09  LIB_LD_LIBS=""..
d970: 20 20 20 20 43 46 4c 41 47 53 5f 4f 50 54 49 4d      CFLAGS_OPTIM
d980: 49 5a 45 3d 22 22 09 09 23 20 4f 70 74 69 6d 69  IZE=""..# Optimi
d990: 7a 65 72 20 69 73 20 62 75 67 67 79 0a 09 20 20  zer is buggy..  
d9a0: 20 20 41 43 5f 44 45 46 49 4e 45 28 5f 4f 45 5f    AC_DEFINE(_OE_
d9b0: 53 4f 43 4b 45 54 53 2c 20 31 2c 09 23 20 6e 65  SOCKETS, 1,.# ne
d9c0: 65 64 65 64 20 69 6e 20 73 79 73 2f 73 6f 63 6b  eded in sys/sock
d9d0: 65 74 2e 68 0a 09 09 5b 53 68 6f 75 6c 64 20 4f  et.h...[Should O
d9e0: 53 2f 33 39 30 20 64 6f 20 74 68 65 20 72 69 67  S/390 do the rig
d9f0: 68 74 20 74 68 69 6e 67 20 77 69 74 68 20 73 6f  ht thing with so
da00: 63 6b 65 74 73 3f 5d 29 0a 09 20 20 20 20 3b 3b  ckets?])..    ;;
da10: 0a 09 4f 53 46 31 2d 31 2e 30 7c 4f 53 46 31 2d  ..OSF1-1.0|OSF1-
da20: 31 2e 31 7c 4f 53 46 31 2d 31 2e 32 29 0a 09 20  1.1|OSF1-1.2).. 
da30: 20 20 20 23 20 4f 53 46 2f 31 20 31 2e 5b 30 31     # OSF/1 1.[01
da40: 32 5d 20 66 72 6f 6d 20 4f 53 46 2c 20 61 6e 64  2] from OSF, and
da50: 20 64 65 72 69 76 61 74 69 76 65 73 2c 20 69 6e   derivatives, in
da60: 63 6c 75 64 69 6e 67 20 50 61 72 61 67 6f 6e 20  cluding Paragon 
da70: 4f 53 46 2f 31 0a 09 20 20 20 20 53 48 4c 49 42  OSF/1..    SHLIB
da80: 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20  _CFLAGS=""..    
da90: 23 20 48 61 63 6b 3a 20 6d 61 6b 65 20 70 61 63  # Hack: make pac
daa0: 6b 61 67 65 20 6e 61 6d 65 20 73 61 6d 65 20 61  kage name same a
dab0: 73 20 6c 69 62 72 61 72 79 20 6e 61 6d 65 0a 09  s library name..
dac0: 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27 6c 64      SHLIB_LD='ld
dad0: 20 2d 52 20 2d 65 78 70 6f 72 74 20 24 40 3a 27   -R -export $@:'
dae0: 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 5f 4c  ..    SHLIB_LD_L
daf0: 49 42 53 3d 22 22 0a 09 20 20 20 20 53 48 4c 49  IBS=""..    SHLI
db00: 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09  B_SUFFIX=".so"..
db10: 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c      DL_OBJS="tcl
db20: 4c 6f 61 64 4f 53 46 2e 6f 22 0a 09 20 20 20 20  LoadOSF.o"..    
db30: 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20  DL_LIBS=""..    
db40: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d  CC_SEARCH_FLAGS=
db50: 22 22 0a 09 20 20 20 20 4c 44 5f 53 45 41 52 43  ""..    LD_SEARC
db60: 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20  H_FLAGS=""..    
db70: 3b 3b 0a 09 4f 53 46 31 2d 31 2e 2a 29 0a 09 20  ;;..OSF1-1.*).. 
db80: 20 20 20 23 20 4f 53 46 2f 31 20 31 2e 33 20 66     # OSF/1 1.3 f
db90: 72 6f 6d 20 4f 53 46 20 75 73 69 6e 67 20 45 4c  rom OSF using EL
dba0: 46 2c 20 61 6e 64 20 64 65 72 69 76 61 74 69 76  F, and derivativ
dbb0: 65 73 2c 20 69 6e 63 6c 75 64 69 6e 67 20 41 44  es, including AD
dbc0: 32 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46 4c  2..    SHLIB_CFL
dbd0: 41 47 53 3d 22 2d 66 50 49 43 22 0a 09 20 20 20  AGS="-fPIC"..   
dbe0: 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 53   AS_IF([test "$S
dbf0: 48 41 52 45 44 5f 42 55 49 4c 44 22 20 3d 20 31  HARED_BUILD" = 1
dc00: 5d 2c 20 5b 53 48 4c 49 42 5f 4c 44 3d 22 6c 64  ], [SHLIB_LD="ld
dc10: 20 2d 73 68 61 72 65 64 22 5d 2c 20 5b 0a 09 20   -shared"], [.. 
dc20: 20 20 20 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d         SHLIB_LD=
dc30: 22 6c 64 20 2d 6e 6f 6e 5f 73 68 61 72 65 64 22  "ld -non_shared"
dc40: 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 53 48  ..    ])..    SH
dc50: 4c 49 42 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a 09  LIB_LD_LIBS=""..
dc60: 20 20 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58      SHLIB_SUFFIX
dc70: 3d 22 2e 73 6f 22 0a 09 20 20 20 20 44 4c 5f 4f  =".so"..    DL_O
dc80: 42 4a 53 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f  BJS="tclLoadDl.o
dc90: 22 0a 09 20 20 20 20 44 4c 5f 4c 49 42 53 3d 22  "..    DL_LIBS="
dca0: 22 0a 09 20 20 20 20 43 43 5f 53 45 41 52 43 48  "..    CC_SEARCH
dcb0: 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20 20 20 4c  _FLAGS=""..    L
dcc0: 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 22  D_SEARCH_FLAGS="
dcd0: 22 0a 09 20 20 20 20 3b 3b 0a 09 4f 53 46 31 2d  "..    ;;..OSF1-
dce0: 56 2a 29 0a 09 20 20 20 20 23 20 44 69 67 69 74  V*)..    # Digit
dcf0: 61 6c 20 4f 53 46 2f 31 0a 09 20 20 20 20 53 48  al OSF/1..    SH
dd00: 4c 49 42 5f 43 46 4c 41 47 53 3d 22 22 0a 09 20  LIB_CFLAGS="".. 
dd10: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
dd20: 24 53 48 41 52 45 44 5f 42 55 49 4c 44 22 20 3d  $SHARED_BUILD" =
dd30: 20 31 5d 2c 20 5b 0a 09 20 20 20 20 20 20 20 20   1], [..        
dd40: 53 48 4c 49 42 5f 4c 44 3d 27 6c 64 20 2d 73 68  SHLIB_LD='ld -sh
dd50: 61 72 65 64 20 2d 65 78 70 65 63 74 5f 75 6e 72  ared -expect_unr
dd60: 65 73 6f 6c 76 65 64 20 22 2a 22 27 0a 09 20 20  esolved "*"'..  
dd70: 20 20 5d 2c 20 5b 0a 09 20 20 20 20 20 20 20 20    ], [..        
dd80: 53 48 4c 49 42 5f 4c 44 3d 27 6c 64 20 2d 6e 6f  SHLIB_LD='ld -no
dd90: 6e 5f 73 68 61 72 65 64 20 2d 65 78 70 65 63 74  n_shared -expect
dda0: 5f 75 6e 72 65 73 6f 6c 76 65 64 20 22 2a 22 27  _unresolved "*"'
ddb0: 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 53 48  ..    ])..    SH
ddc0: 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22  LIB_SUFFIX=".so"
ddd0: 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74  ..    DL_OBJS="t
dde0: 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20  clLoadDl.o"..   
ddf0: 20 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20   DL_LIBS=""..   
de00: 20 41 53 5f 49 46 28 5b 74 65 73 74 20 24 64 6f   AS_IF([test $do
de10: 52 70 61 74 68 20 3d 20 79 65 73 5d 2c 20 5b 0a  Rpath = yes], [.
de20: 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..CC_SEARCH_FLAG
de30: 53 3d 27 2d 57 6c 2c 2d 72 70 61 74 68 2c 24 7b  S='-Wl,-rpath,${
de40: 4c 49 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d  LIB_RUNTIME_DIR}
de50: 27 0a 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c  '...LD_SEARCH_FL
de60: 41 47 53 3d 27 2d 72 70 61 74 68 20 24 7b 4c 49  AGS='-rpath ${LI
de70: 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 5d  B_RUNTIME_DIR}']
de80: 29 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  )..    AS_IF([te
de90: 73 74 20 22 24 47 43 43 22 20 3d 20 79 65 73 5d  st "$GCC" = yes]
dea0: 2c 20 5b 43 46 4c 41 47 53 3d 22 24 43 46 4c 41  , [CFLAGS="$CFLA
deb0: 47 53 20 2d 6d 69 65 65 65 22 5d 2c 20 5b 0a 09  GS -mieee"], [..
dec0: 09 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53  .CFLAGS="$CFLAGS
ded0: 20 2d 44 48 41 56 45 5f 54 5a 53 45 54 20 2d 73   -DHAVE_TZSET -s
dee0: 74 64 31 20 2d 69 65 65 65 22 5d 29 0a 09 20 20  td1 -ieee"])..  
def0: 20 20 23 20 73 65 65 20 70 74 68 72 65 61 64 5f    # see pthread_
df00: 69 6e 74 72 6f 28 33 29 20 66 6f 72 20 70 74 68  intro(3) for pth
df10: 72 65 61 64 20 73 75 70 70 6f 72 74 20 6f 6e 20  read support on 
df20: 6f 73 66 31 2c 20 6b 2e 66 75 72 75 6b 61 77 61  osf1, k.furukawa
df30: 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
df40: 74 20 22 24 7b 54 43 4c 5f 54 48 52 45 41 44 53  t "${TCL_THREADS
df50: 7d 22 20 3d 20 31 5d 2c 20 5b 0a 09 09 43 46 4c  }" = 1], [...CFL
df60: 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 44 48  AGS="$CFLAGS -DH
df70: 41 56 45 5f 50 54 48 52 45 41 44 5f 41 54 54 52  AVE_PTHREAD_ATTR
df80: 5f 53 45 54 53 54 41 43 4b 53 49 5a 45 22 0a 09  _SETSTACKSIZE"..
df90: 09 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53  .CFLAGS="$CFLAGS
dfa0: 20 2d 44 54 43 4c 5f 54 48 52 45 41 44 5f 53 54   -DTCL_THREAD_ST
dfb0: 41 43 4b 5f 4d 49 4e 3d 50 54 48 52 45 41 44 5f  ACK_MIN=PTHREAD_
dfc0: 53 54 41 43 4b 5f 4d 49 4e 2a 36 34 22 0a 09 09  STACK_MIN*64"...
dfd0: 4c 49 42 53 3d 60 65 63 68 6f 20 24 4c 49 42 53  LIBS=`echo $LIBS
dfe0: 20 7c 20 73 65 64 20 73 2f 2d 6c 70 74 68 72 65   | sed s/-lpthre
dff0: 61 64 73 2f 2f 60 0a 09 09 41 53 5f 49 46 28 5b  ads//`...AS_IF([
e000: 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 79 65  test "$GCC" = ye
e010: 73 5d 2c 20 5b 0a 09 09 20 20 20 20 4c 49 42 53  s], [...    LIBS
e020: 3d 22 24 4c 49 42 53 20 2d 6c 70 74 68 72 65 61  ="$LIBS -lpthrea
e030: 64 20 2d 6c 6d 61 63 68 20 2d 6c 65 78 63 22 0a  d -lmach -lexc".
e040: 09 09 5d 2c 20 5b 0a 09 09 20 20 20 20 43 46 4c  ..], [...    CFL
e050: 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 70 74  AGS="$CFLAGS -pt
e060: 68 72 65 61 64 22 0a 09 09 20 20 20 20 4c 44 46  hread"...    LDF
e070: 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d  LAGS="$LDFLAGS -
e080: 70 74 68 72 65 61 64 22 0a 09 09 5d 29 0a 09 20  pthread"...]).. 
e090: 20 20 20 5d 29 0a 09 20 20 20 20 3b 3b 0a 09 51     ])..    ;;..Q
e0a0: 4e 58 2d 36 2a 29 0a 09 20 20 20 20 23 20 51 4e  NX-6*)..    # QN
e0b0: 58 20 52 54 50 0a 09 20 20 20 20 23 20 54 68 69  X RTP..    # Thi
e0c0: 73 20 6d 61 79 20 77 6f 72 6b 20 66 6f 72 20 61  s may work for a
e0d0: 6c 6c 20 51 4e 58 2c 20 62 75 74 20 69 74 20 77  ll QNX, but it w
e0e0: 61 73 20 6f 6e 6c 79 20 72 65 70 6f 72 74 65 64  as only reported
e0f0: 20 66 6f 72 20 76 36 2e 0a 09 20 20 20 20 53 48   for v6...    SH
e100: 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d 66 50 49  LIB_CFLAGS="-fPI
e110: 43 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44  C"..    SHLIB_LD
e120: 3d 22 6c 64 20 2d 42 73 68 61 72 65 61 62 6c 65  ="ld -Bshareable
e130: 20 2d 78 22 0a 09 20 20 20 20 53 48 4c 49 42 5f   -x"..    SHLIB_
e140: 4c 44 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20  LD_LIBS=""..    
e150: 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73  SHLIB_SUFFIX=".s
e160: 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d  o"..    DL_OBJS=
e170: 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20  "tclLoadDl.o".. 
e180: 20 20 20 23 20 64 6c 6f 70 65 6e 20 69 73 20 69     # dlopen is i
e190: 6e 20 2d 6c 63 20 6f 6e 20 51 4e 58 0a 09 20 20  n -lc on QNX..  
e1a0: 20 20 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 20 20    DL_LIBS=""..  
e1b0: 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47    CC_SEARCH_FLAG
e1c0: 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f 53 45 41  S=""..    LD_SEA
e1d0: 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20  RCH_FLAGS=""..  
e1e0: 20 20 3b 3b 0a 09 53 43 4f 5f 53 56 2d 33 2e 32    ;;..SCO_SV-3.2
e1f0: 2a 29 0a 09 20 20 20 20 23 20 4e 6f 74 65 2c 20  *)..    # Note, 
e200: 64 6c 6f 70 65 6e 20 69 73 20 61 76 61 69 6c 61  dlopen is availa
e210: 62 6c 65 20 6f 6e 6c 79 20 6f 6e 20 53 43 4f 20  ble only on SCO 
e220: 33 2e 32 2e 35 20 61 6e 64 20 67 72 65 61 74 65  3.2.5 and greate
e230: 72 2e 20 48 6f 77 65 76 65 72 2c 0a 09 20 20 20  r. However,..   
e240: 20 23 20 74 68 69 73 20 74 65 73 74 20 77 6f 72   # this test wor
e250: 6b 73 2c 20 73 69 6e 63 65 20 22 75 6e 61 6d 65  ks, since "uname
e260: 20 2d 73 22 20 77 61 73 20 6e 6f 6e 2d 73 74 61   -s" was non-sta
e270: 6e 64 61 72 64 20 69 6e 20 33 2e 32 2e 34 20 61  ndard in 3.2.4 a
e280: 6e 64 0a 09 20 20 20 20 23 20 62 65 6c 6f 77 2e  nd..    # below.
e290: 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
e2a0: 74 20 22 24 47 43 43 22 20 3d 20 79 65 73 5d 2c  t "$GCC" = yes],
e2b0: 20 5b 0a 09 20 20 20 20 09 53 48 4c 49 42 5f 43   [..    .SHLIB_C
e2c0: 46 4c 41 47 53 3d 22 2d 66 50 49 43 20 2d 6d 65  FLAGS="-fPIC -me
e2d0: 6c 66 22 0a 09 20 20 20 20 09 4c 44 46 4c 41 47  lf"..    .LDFLAG
e2e0: 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 6d 65 6c  S="$LDFLAGS -mel
e2f0: 66 20 2d 57 6c 2c 2d 42 65 78 70 6f 72 74 22 0a  f -Wl,-Bexport".
e300: 09 20 20 20 20 5d 2c 20 5b 0a 09 20 20 20 20 09  .    ], [..    .
e310: 53 48 4c 49 42 5f 43 46 4c 41 47 53 3d 22 2d 4b  SHLIB_CFLAGS="-K
e320: 70 69 63 20 2d 62 65 6c 66 22 0a 09 20 20 20 20  pic -belf"..    
e330: 09 4c 44 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41  .LDFLAGS="$LDFLA
e340: 47 53 20 2d 62 65 6c 66 20 2d 57 6c 2c 2d 42 65  GS -belf -Wl,-Be
e350: 78 70 6f 72 74 22 0a 09 20 20 20 20 5d 29 0a 09  xport"..    ])..
e360: 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 22 6c 64      SHLIB_LD="ld
e370: 20 2d 47 22 0a 09 20 20 20 20 53 48 4c 49 42 5f   -G"..    SHLIB_
e380: 4c 44 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20  LD_LIBS=""..    
e390: 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73  SHLIB_SUFFIX=".s
e3a0: 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d  o"..    DL_OBJS=
e3b0: 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20  "tclLoadDl.o".. 
e3c0: 20 20 20 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 20     DL_LIBS="".. 
e3d0: 20 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41     CC_SEARCH_FLA
e3e0: 47 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f 53 45  GS=""..    LD_SE
e3f0: 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20  ARCH_FLAGS="".. 
e400: 20 20 20 3b 3b 0a 09 53 49 4e 49 58 2a 35 2e 34     ;;..SINIX*5.4
e410: 2a 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  *)..    SHLIB_CF
e420: 4c 41 47 53 3d 22 2d 4b 20 50 49 43 22 0a 09 20  LAGS="-K PIC".. 
e430: 20 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43     SHLIB_LD='${C
e440: 43 7d 20 2d 47 27 0a 09 20 20 20 20 53 48 4c 49  C} -G'..    SHLI
e450: 42 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a 09 20 20  B_LD_LIBS=""..  
e460: 20 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22    SHLIB_SUFFIX="
e470: 2e 73 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a  .so"..    DL_OBJ
e480: 53 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a  S="tclLoadDl.o".
e490: 09 20 20 20 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c  .    DL_LIBS="-l
e4a0: 64 6c 22 0a 09 20 20 20 20 43 43 5f 53 45 41 52  dl"..    CC_SEAR
e4b0: 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20 20  CH_FLAGS=""..   
e4c0: 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53   LD_SEARCH_FLAGS
e4d0: 3d 22 22 0a 09 20 20 20 20 3b 3b 0a 09 53 75 6e  =""..    ;;..Sun
e4e0: 4f 53 2d 34 2a 29 0a 09 20 20 20 20 53 48 4c 49  OS-4*)..    SHLI
e4f0: 42 5f 43 46 4c 41 47 53 3d 22 2d 50 49 43 22 0a  B_CFLAGS="-PIC".
e500: 09 20 20 20 20 53 48 4c 49 42 5f 4c 44 3d 22 6c  .    SHLIB_LD="l
e510: 64 22 0a 09 20 20 20 20 53 48 4c 49 42 5f 4c 44  d"..    SHLIB_LD
e520: 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20 20 53 48  _LIBS=""..    SH
e530: 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22  LIB_SUFFIX=".so"
e540: 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74  ..    DL_OBJS="t
e550: 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20  clLoadDl.o"..   
e560: 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a   DL_LIBS="-ldl".
e570: 09 20 20 20 20 43 43 5f 53 45 41 52 43 48 5f 46  .    CC_SEARCH_F
e580: 4c 41 47 53 3d 27 2d 4c 24 7b 4c 49 42 5f 52 55  LAGS='-L${LIB_RU
e590: 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09 20 20 20  NTIME_DIR}'..   
e5a0: 20 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47 53   LD_SEARCH_FLAGS
e5b0: 3d 24 7b 43 43 5f 53 45 41 52 43 48 5f 46 4c 41  =${CC_SEARCH_FLA
e5c0: 47 53 7d 0a 0a 09 20 20 20 20 23 20 53 75 6e 4f  GS}...    # SunO
e5d0: 53 20 63 61 6e 27 74 20 68 61 6e 64 6c 65 20 76  S can't handle v
e5e0: 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 20 77  ersion numbers w
e5f0: 69 74 68 20 64 6f 74 73 20 69 6e 20 74 68 65 6d  ith dots in them
e600: 20 69 6e 20 6c 69 62 72 61 72 79 0a 09 20 20 20   in library..   
e610: 20 23 20 73 70 65 63 73 2c 20 6c 69 6b 65 20 2d   # specs, like -
e620: 6c 74 63 6c 37 2e 35 2c 20 73 6f 20 75 73 65 20  ltcl7.5, so use 
e630: 2d 6c 74 63 6c 37 35 20 69 6e 73 74 65 61 64 2e  -ltcl75 instead.
e640: 20 20 41 6c 73 6f 2c 20 69 74 0a 09 20 20 20 20    Also, it..    
e650: 23 20 72 65 71 75 69 72 65 73 20 61 6e 20 65 78  # requires an ex
e660: 74 72 61 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62  tra version numb
e670: 65 72 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66  er at the end of
e680: 20 2e 73 6f 20 66 69 6c 65 20 6e 61 6d 65 73 2e   .so file names.
e690: 0a 09 20 20 20 20 23 20 53 6f 2c 20 74 68 65 20  ..    # So, the 
e6a0: 6c 69 62 72 61 72 79 20 68 61 73 20 74 6f 20 68  library has to h
e6b0: 61 76 65 20 61 20 6e 61 6d 65 20 6c 69 6b 65 20  ave a name like 
e6c0: 6c 69 62 74 63 6c 37 35 2e 73 6f 2e 31 2e 30 0a  libtcl75.so.1.0.
e6d0: 0a 09 20 20 20 20 53 48 41 52 45 44 5f 4c 49 42  ..    SHARED_LIB
e6e0: 5f 53 55 46 46 49 58 3d 27 24 7b 54 43 4c 5f 54  _SUFFIX='${TCL_T
e6f0: 52 49 4d 5f 44 4f 54 53 7d 2e 73 6f 2e 24 7b 53  RIM_DOTS}.so.${S
e700: 48 4c 49 42 5f 56 45 52 53 49 4f 4e 7d 27 0a 09  HLIB_VERSION}'..
e710: 20 20 20 20 55 4e 53 48 41 52 45 44 5f 4c 49 42      UNSHARED_LIB
e720: 5f 53 55 46 46 49 58 3d 27 24 7b 54 43 4c 5f 54  _SUFFIX='${TCL_T
e730: 52 49 4d 5f 44 4f 54 53 7d 2e 61 27 0a 09 20 20  RIM_DOTS}.a'..  
e740: 20 20 54 43 4c 5f 4c 49 42 5f 56 45 52 53 49 4f    TCL_LIB_VERSIO
e750: 4e 53 5f 4f 4b 3d 6e 6f 64 6f 74 73 0a 09 20 20  NS_OK=nodots..  
e760: 20 20 3b 3b 0a 09 53 75 6e 4f 53 2d 35 2e 5b 5b    ;;..SunOS-5.[[
e770: 30 2d 36 5d 5d 29 0a 09 20 20 20 20 23 20 43 61  0-6]])..    # Ca
e780: 72 65 66 75 6c 20 74 6f 20 6e 6f 74 20 6c 65 74  reful to not let
e790: 20 35 2e 31 30 2b 20 66 61 6c 6c 20 69 6e 74 6f   5.10+ fall into
e7a0: 20 74 68 69 73 20 63 61 73 65 0a 0a 09 20 20 20   this case...   
e7b0: 20 23 20 4e 6f 74 65 3a 20 49 66 20 5f 52 45 45   # Note: If _REE
e7c0: 4e 54 52 41 4e 54 20 69 73 6e 27 74 20 64 65 66  NTRANT isn't def
e7d0: 69 6e 65 64 2c 20 74 68 65 6e 20 53 6f 6c 61 72  ined, then Solar
e7e0: 69 73 0a 09 20 20 20 20 23 20 77 6f 6e 27 74 20  is..    # won't 
e7f0: 64 65 66 69 6e 65 20 74 68 72 65 61 64 2d 73 61  define thread-sa
e800: 66 65 20 6c 69 62 72 61 72 79 20 72 6f 75 74 69  fe library routi
e810: 6e 65 73 2e 0a 0a 09 20 20 20 20 41 43 5f 44 45  nes....    AC_DE
e820: 46 49 4e 45 28 5f 52 45 45 4e 54 52 41 4e 54 2c  FINE(_REENTRANT,
e830: 20 31 2c 20 5b 44 6f 20 77 65 20 77 61 6e 74 20   1, [Do we want 
e840: 74 68 65 20 72 65 65 6e 74 72 61 6e 74 20 4f 53  the reentrant OS
e850: 20 41 50 49 3f 5d 29 0a 09 20 20 20 20 41 43 5f   API?])..    AC_
e860: 44 45 46 49 4e 45 28 5f 50 4f 53 49 58 5f 50 54  DEFINE(_POSIX_PT
e870: 48 52 45 41 44 5f 53 45 4d 41 4e 54 49 43 53 2c  HREAD_SEMANTICS,
e880: 20 31 2c 0a 09 09 5b 44 6f 20 77 65 20 72 65 61   1,...[Do we rea
e890: 6c 6c 79 20 77 61 6e 74 20 74 6f 20 66 6f 6c 6c  lly want to foll
e8a0: 6f 77 20 74 68 65 20 73 74 61 6e 64 61 72 64 3f  ow the standard?
e8b0: 20 59 65 73 20 77 65 20 64 6f 21 5d 29 0a 0a 09   Yes we do!])...
e8c0: 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53      SHLIB_CFLAGS
e8d0: 3d 22 2d 4b 50 49 43 22 0a 09 20 20 20 20 53 48  ="-KPIC"..    SH
e8e0: 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e 73 6f 22  LIB_SUFFIX=".so"
e8f0: 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53 3d 22 74  ..    DL_OBJS="t
e900: 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09 20 20 20  clLoadDl.o"..   
e910: 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64 6c 22 0a   DL_LIBS="-ldl".
e920: 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
e930: 20 22 24 47 43 43 22 20 3d 20 79 65 73 5d 2c 20   "$GCC" = yes], 
e940: 5b 0a 09 09 53 48 4c 49 42 5f 4c 44 3d 27 24 7b  [...SHLIB_LD='${
e950: 43 43 7d 20 2d 73 68 61 72 65 64 27 0a 09 09 43  CC} -shared'...C
e960: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 27  C_SEARCH_FLAGS='
e970: 2d 57 6c 2c 2d 52 2c 24 7b 4c 49 42 5f 52 55 4e  -Wl,-R,${LIB_RUN
e980: 54 49 4d 45 5f 44 49 52 7d 27 0a 09 09 4c 44 5f  TIME_DIR}'...LD_
e990: 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 24 7b 43  SEARCH_FLAGS=${C
e9a0: 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 7d 0a  C_SEARCH_FLAGS}.
e9b0: 09 20 20 20 20 5d 2c 20 5b 0a 09 09 53 48 4c 49  .    ], [...SHLI
e9c0: 42 5f 4c 44 3d 22 2f 75 73 72 2f 63 63 73 2f 62  B_LD="/usr/ccs/b
e9d0: 69 6e 2f 6c 64 20 2d 47 20 2d 7a 20 74 65 78 74  in/ld -G -z text
e9e0: 22 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c  "...CC_SEARCH_FL
e9f0: 41 47 53 3d 27 2d 52 20 24 7b 4c 49 42 5f 52 55  AGS='-R ${LIB_RU
ea00: 4e 54 49 4d 45 5f 44 49 52 7d 27 0a 09 09 4c 44  NTIME_DIR}'...LD
ea10: 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 3d 24 7b  _SEARCH_FLAGS=${
ea20: 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47 53 7d  CC_SEARCH_FLAGS}
ea30: 0a 09 20 20 20 20 5d 29 0a 09 20 20 20 20 3b 3b  ..    ])..    ;;
ea40: 0a 09 53 75 6e 4f 53 2d 35 2a 29 0a 09 20 20 20  ..SunOS-5*)..   
ea50: 20 23 20 4e 6f 74 65 3a 20 49 66 20 5f 52 45 45   # Note: If _REE
ea60: 4e 54 52 41 4e 54 20 69 73 6e 27 74 20 64 65 66  NTRANT isn't def
ea70: 69 6e 65 64 2c 20 74 68 65 6e 20 53 6f 6c 61 72  ined, then Solar
ea80: 69 73 0a 09 20 20 20 20 23 20 77 6f 6e 27 74 20  is..    # won't 
ea90: 64 65 66 69 6e 65 20 74 68 72 65 61 64 2d 73 61  define thread-sa
eaa0: 66 65 20 6c 69 62 72 61 72 79 20 72 6f 75 74 69  fe library routi
eab0: 6e 65 73 2e 0a 0a 09 20 20 20 20 41 43 5f 44 45  nes....    AC_DE
eac0: 46 49 4e 45 28 5f 52 45 45 4e 54 52 41 4e 54 2c  FINE(_REENTRANT,
ead0: 20 31 2c 20 5b 44 6f 20 77 65 20 77 61 6e 74 20   1, [Do we want 
eae0: 74 68 65 20 72 65 65 6e 74 72 61 6e 74 20 4f 53  the reentrant OS
eaf0: 20 41 50 49 3f 5d 29 0a 09 20 20 20 20 41 43 5f   API?])..    AC_
eb00: 44 45 46 49 4e 45 28 5f 50 4f 53 49 58 5f 50 54  DEFINE(_POSIX_PT
eb10: 48 52 45 41 44 5f 53 45 4d 41 4e 54 49 43 53 2c  HREAD_SEMANTICS,
eb20: 20 31 2c 0a 09 09 5b 44 6f 20 77 65 20 72 65 61   1,...[Do we rea
eb30: 6c 6c 79 20 77 61 6e 74 20 74 6f 20 66 6f 6c 6c  lly want to foll
eb40: 6f 77 20 74 68 65 20 73 74 61 6e 64 61 72 64 3f  ow the standard?
eb50: 20 59 65 73 20 77 65 20 64 6f 21 5d 29 0a 0a 09   Yes we do!])...
eb60: 20 20 20 20 53 48 4c 49 42 5f 43 46 4c 41 47 53      SHLIB_CFLAGS
eb70: 3d 22 2d 4b 50 49 43 22 0a 0a 09 20 20 20 20 23  ="-KPIC"...    #
eb80: 20 43 68 65 63 6b 20 74 6f 20 65 6e 61 62 6c 65   Check to enable
eb90: 20 36 34 2d 62 69 74 20 66 6c 61 67 73 20 66 6f   64-bit flags fo
eba0: 72 20 63 6f 6d 70 69 6c 65 72 2f 6c 69 6e 6b 65  r compiler/linke
ebb0: 72 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  r..    AS_IF([te
ebc0: 73 74 20 22 24 64 6f 36 34 62 69 74 22 20 3d 20  st "$do64bit" = 
ebd0: 79 65 73 5d 2c 20 5b 0a 09 09 61 72 63 68 3d 60  yes], [...arch=`
ebe0: 69 73 61 69 6e 66 6f 60 0a 09 09 41 53 5f 49 46  isainfo`...AS_IF
ebf0: 28 5b 74 65 73 74 20 22 24 61 72 63 68 22 20 3d  ([test "$arch" =
ec00: 20 22 73 70 61 72 63 76 39 20 73 70 61 72 63 22   "sparcv9 sparc"
ec10: 5d 2c 20 5b 0a 09 09 20 20 20 20 41 53 5f 49 46  ], [...    AS_IF
ec20: 28 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d 20  ([test "$GCC" = 
ec30: 79 65 73 5d 2c 20 5b 0a 09 09 09 41 53 5f 49 46  yes], [....AS_IF
ec40: 28 5b 74 65 73 74 20 22 60 24 7b 43 43 7d 20 2d  ([test "`${CC} -
ec50: 64 75 6d 70 76 65 72 73 69 6f 6e 20 7c 20 61 77  dumpversion | aw
ec60: 6b 20 2d 46 2e 20 27 7b 70 72 69 6e 74 20 5b 24  k -F. '{print [$
ec70: 5d 31 7d 27 60 22 20 2d 6c 74 20 33 5d 2c 20 5b  ]1}'`" -lt 3], [
ec80: 0a 09 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 57  ....    AC_MSG_W
ec90: 41 52 4e 28 5b 36 34 62 69 74 20 6d 6f 64 65 20  ARN([64bit mode 
eca0: 6e 6f 74 20 73 75 70 70 6f 72 74 65 64 20 77 69  not supported wi
ecb0: 74 68 20 47 43 43 20 3c 20 33 2e 32 20 6f 6e 20  th GCC < 3.2 on 
ecc0: 24 73 79 73 74 65 6d 5d 29 0a 09 09 09 5d 2c 20  $system])....], 
ecd0: 5b 0a 09 09 09 20 20 20 20 64 6f 36 34 62 69 74  [....    do64bit
ece0: 5f 6f 6b 3d 79 65 73 0a 09 09 09 20 20 20 20 43  _ok=yes....    C
ecf0: 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d  FLAGS="$CFLAGS -
ed00: 6d 36 34 20 2d 6d 63 70 75 3d 76 39 22 0a 09 09  m64 -mcpu=v9"...
ed10: 09 20 20 20 20 4c 44 46 4c 41 47 53 3d 22 24 4c  .    LDFLAGS="$L
ed20: 44 46 4c 41 47 53 20 2d 6d 36 34 20 2d 6d 63 70  DFLAGS -m64 -mcp
ed30: 75 3d 76 39 22 0a 09 09 09 20 20 20 20 53 48 4c  u=v9"....    SHL
ed40: 49 42 5f 43 46 4c 41 47 53 3d 22 2d 66 50 49 43  IB_CFLAGS="-fPIC
ed50: 22 0a 09 09 09 5d 29 0a 09 09 20 20 20 20 5d 2c  "....])...    ],
ed60: 20 5b 0a 09 09 09 64 6f 36 34 62 69 74 5f 6f 6b   [....do64bit_ok
ed70: 3d 79 65 73 0a 09 09 09 41 53 5f 49 46 28 5b 74  =yes....AS_IF([t
ed80: 65 73 74 20 22 24 64 6f 36 34 62 69 74 56 49 53  est "$do64bitVIS
ed90: 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 09 20  " = yes], [.... 
eda0: 20 20 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41     CFLAGS="$CFLA
edb0: 47 53 20 2d 78 61 72 63 68 3d 76 39 61 22 0a 09  GS -xarch=v9a"..
edc0: 09 09 20 20 20 20 4c 44 46 4c 41 47 53 5f 41 52  ..    LDFLAGS_AR
edd0: 43 48 3d 22 2d 78 61 72 63 68 3d 76 39 61 22 0a  CH="-xarch=v9a".
ede0: 09 09 09 5d 2c 20 5b 0a 09 09 09 20 20 20 20 43  ...], [....    C
edf0: 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d  FLAGS="$CFLAGS -
ee00: 78 61 72 63 68 3d 76 39 22 0a 09 09 09 20 20 20  xarch=v9"....   
ee10: 20 4c 44 46 4c 41 47 53 5f 41 52 43 48 3d 22 2d   LDFLAGS_ARCH="-
ee20: 78 61 72 63 68 3d 76 39 22 0a 09 09 09 5d 29 0a  xarch=v9"....]).
ee30: 09 09 09 23 20 53 6f 6c 61 72 69 73 20 36 34 20  ...# Solaris 64 
ee40: 75 73 65 73 20 74 68 69 73 20 61 73 20 77 65 6c  uses this as wel
ee50: 6c 0a 09 09 09 23 4c 44 5f 4c 49 42 52 41 52 59  l....#LD_LIBRARY
ee60: 5f 50 41 54 48 5f 56 41 52 3d 22 4c 44 5f 4c 49  _PATH_VAR="LD_LI
ee70: 42 52 41 52 59 5f 50 41 54 48 5f 36 34 22 0a 09  BRARY_PATH_64"..
ee80: 09 20 20 20 20 5d 29 0a 09 09 5d 2c 20 5b 41 53  .    ])...], [AS
ee90: 5f 49 46 28 5b 74 65 73 74 20 22 24 61 72 63 68  _IF([test "$arch
eea0: 22 20 3d 20 22 61 6d 64 36 34 20 69 33 38 36 22  " = "amd64 i386"
eeb0: 5d 2c 20 5b 0a 09 09 20 20 20 20 41 53 5f 49 46  ], [...    AS_IF
eec0: 28 5b 74 65 73 74 20 22 24 47 43 43 22 20 3d 20  ([test "$GCC" = 
eed0: 79 65 73 5d 2c 20 5b 0a 09 09 09 63 61 73 65 20  yes], [....case 
eee0: 24 73 79 73 74 65 6d 20 69 6e 0a 09 09 09 20 20  $system in....  
eef0: 20 20 53 75 6e 4f 53 2d 35 2e 31 5b 5b 31 2d 39    SunOS-5.1[[1-9
ef00: 5d 5d 2a 7c 53 75 6e 4f 53 2d 35 2e 5b 5b 32 2d  ]]*|SunOS-5.[[2-
ef10: 39 5d 5d 5b 5b 30 2d 39 5d 5d 2a 29 0a 09 09 09  9]][[0-9]]*)....
ef20: 09 64 6f 36 34 62 69 74 5f 6f 6b 3d 79 65 73 0a  .do64bit_ok=yes.
ef30: 09 09 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c  ....CFLAGS="$CFL
ef40: 41 47 53 20 2d 6d 36 34 22 0a 09 09 09 09 4c 44  AGS -m64".....LD
ef50: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20  FLAGS="$LDFLAGS 
ef60: 2d 6d 36 34 22 3b 3b 0a 09 09 09 20 20 20 20 2a  -m64";;....    *
ef70: 29 0a 09 09 09 09 41 43 5f 4d 53 47 5f 57 41 52  ).....AC_MSG_WAR
ef80: 4e 28 5b 36 34 62 69 74 20 6d 6f 64 65 20 6e 6f  N([64bit mode no
ef90: 74 20 73 75 70 70 6f 72 74 65 64 20 77 69 74 68  t supported with
efa0: 20 47 43 43 20 6f 6e 20 24 73 79 73 74 65 6d 5d   GCC on $system]
efb0: 29 3b 3b 0a 09 09 09 65 73 61 63 0a 09 09 20 20  );;....esac...  
efc0: 20 20 5d 2c 20 5b 0a 09 09 09 64 6f 36 34 62 69    ], [....do64bi
efd0: 74 5f 6f 6b 3d 79 65 73 0a 09 09 09 63 61 73 65  t_ok=yes....case
efe0: 20 24 73 79 73 74 65 6d 20 69 6e 0a 09 09 09 20   $system in.... 
eff0: 20 20 20 53 75 6e 4f 53 2d 35 2e 31 5b 5b 31 2d     SunOS-5.1[[1-
f000: 39 5d 5d 2a 7c 53 75 6e 4f 53 2d 35 2e 5b 5b 32  9]]*|SunOS-5.[[2
f010: 2d 39 5d 5d 5b 5b 30 2d 39 5d 5d 2a 29 0a 09 09  -9]][[0-9]]*)...
f020: 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47  ..CFLAGS="$CFLAG
f030: 53 20 2d 6d 36 34 22 0a 09 09 09 09 4c 44 46 4c  S -m64".....LDFL
f040: 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d 6d  AGS="$LDFLAGS -m
f050: 36 34 22 3b 3b 0a 09 09 09 20 20 20 20 2a 29 0a  64";;....    *).
f060: 09 09 09 09 43 46 4c 41 47 53 3d 22 24 43 46 4c  ....CFLAGS="$CFL
f070: 41 47 53 20 2d 78 61 72 63 68 3d 61 6d 64 36 34  AGS -xarch=amd64
f080: 22 0a 09 09 09 09 4c 44 46 4c 41 47 53 3d 22 24  ".....LDFLAGS="$
f090: 4c 44 46 4c 41 47 53 20 2d 78 61 72 63 68 3d 61  LDFLAGS -xarch=a
f0a0: 6d 64 36 34 22 3b 3b 0a 09 09 09 65 73 61 63 0a  md64";;....esac.
f0b0: 09 09 20 20 20 20 5d 29 0a 09 09 5d 2c 20 5b 41  ..    ])...], [A
f0c0: 43 5f 4d 53 47 5f 57 41 52 4e 28 5b 36 34 62 69  C_MSG_WARN([64bi
f0d0: 74 20 6d 6f 64 65 20 6e 6f 74 20 73 75 70 70 6f  t mode not suppo
f0e0: 72 74 65 64 20 66 6f 72 20 24 61 72 63 68 5d 29  rted for $arch])
f0f0: 5d 29 5d 29 0a 09 20 20 20 20 5d 29 0a 0a 09 20  ])])..    ])... 
f100: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
f110: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f120: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f130: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f140: 2d 2d 2d 2d 2d 2d 2d 2d 0a 09 20 20 20 20 23 20  --------..    # 
f150: 4f 6e 20 53 6f 6c 61 72 69 73 20 35 2e 78 20 69  On Solaris 5.x i
f160: 33 38 36 20 77 69 74 68 20 74 68 65 20 73 75 6e  386 with the sun
f170: 70 72 6f 20 63 6f 6d 70 69 6c 65 72 20 77 65 20  pro compiler we 
f180: 6e 65 65 64 20 74 6f 20 6c 69 6e 6b 0a 09 20 20  need to link..  
f190: 20 20 23 20 77 69 74 68 20 73 75 6e 6d 61 74 68    # with sunmath
f1a0: 20 74 6f 20 67 65 74 20 66 6c 6f 61 74 69 6e 67   to get floating
f1b0: 20 70 6f 69 6e 74 20 72 6f 75 6e 64 69 6e 67 20   point rounding 
f1c0: 63 6f 6e 74 72 6f 6c 0a 09 20 20 20 20 23 2d 2d  control..    #--
f1d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f1e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f1f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f200: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f210: 2d 2d 0a 09 20 20 20 20 41 53 5f 49 46 28 5b 74  --..    AS_IF([t
f220: 65 73 74 20 22 24 47 43 43 22 20 3d 20 79 65 73  est "$GCC" = yes
f230: 5d 2c 5b 75 73 65 5f 73 75 6e 6d 61 74 68 3d 6e  ],[use_sunmath=n
f240: 6f 5d 2c 5b 0a 09 09 61 72 63 68 3d 60 69 73 61  o],[...arch=`isa
f250: 69 6e 66 6f 60 0a 09 09 41 43 5f 4d 53 47 5f 43  info`...AC_MSG_C
f260: 48 45 43 4b 49 4e 47 28 5b 77 68 65 74 68 65 72  HECKING([whether
f270: 20 74 6f 20 75 73 65 20 2d 6c 73 75 6e 6d 61 74   to use -lsunmat
f280: 68 20 66 6f 72 20 66 70 20 72 6f 75 6e 64 69 6e  h for fp roundin
f290: 67 20 63 6f 6e 74 72 6f 6c 5d 29 0a 09 09 41 53  g control])...AS
f2a0: 5f 49 46 28 5b 74 65 73 74 20 22 24 61 72 63 68  _IF([test "$arch
f2b0: 22 20 3d 20 22 61 6d 64 36 34 20 69 33 38 36 22  " = "amd64 i386"
f2c0: 20 2d 6f 20 22 24 61 72 63 68 22 20 3d 20 22 69   -o "$arch" = "i
f2d0: 33 38 36 22 5d 2c 20 5b 0a 09 09 09 41 43 5f 4d  386"], [....AC_M
f2e0: 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29  SG_RESULT([yes])
f2f0: 0a 09 09 09 4d 41 54 48 5f 4c 49 42 53 3d 22 2d  ....MATH_LIBS="-
f300: 6c 73 75 6e 6d 61 74 68 20 24 4d 41 54 48 5f 4c  lsunmath $MATH_L
f310: 49 42 53 22 0a 09 09 09 41 43 5f 43 48 45 43 4b  IBS"....AC_CHECK
f320: 5f 48 45 41 44 45 52 28 73 75 6e 6d 61 74 68 2e  _HEADER(sunmath.
f330: 68 29 0a 09 09 09 75 73 65 5f 73 75 6e 6d 61 74  h)....use_sunmat
f340: 68 3d 79 65 73 0a 09 09 09 5d 2c 20 5b 0a 09 09  h=yes....], [...
f350: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b  .AC_MSG_RESULT([
f360: 6e 6f 5d 29 0a 09 09 09 75 73 65 5f 73 75 6e 6d  no])....use_sunm
f370: 61 74 68 3d 6e 6f 0a 09 09 5d 29 0a 09 20 20 20  ath=no...])..   
f380: 20 5d 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 53   ])..    SHLIB_S
f390: 55 46 46 49 58 3d 22 2e 73 6f 22 0a 09 20 20 20  UFFIX=".so"..   
f3a0: 20 44 4c 5f 4f 42 4a 53 3d 22 74 63 6c 4c 6f 61   DL_OBJS="tclLoa
f3b0: 64 44 6c 2e 6f 22 0a 09 20 20 20 20 44 4c 5f 4c  dDl.o"..    DL_L
f3c0: 49 42 53 3d 22 2d 6c 64 6c 22 0a 09 20 20 20 20  IBS="-ldl"..    
f3d0: 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24 47 43  AS_IF([test "$GC
f3e0: 43 22 20 3d 20 79 65 73 5d 2c 20 5b 0a 09 09 53  C" = yes], [...S
f3f0: 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43 7d 20 2d  HLIB_LD='${CC} -
f400: 73 68 61 72 65 64 27 0a 09 09 43 43 5f 53 45 41  shared'...CC_SEA
f410: 52 43 48 5f 46 4c 41 47 53 3d 27 2d 57 6c 2c 2d  RCH_FLAGS='-Wl,-
f420: 52 2c 24 7b 4c 49 42 5f 52 55 4e 54 49 4d 45 5f  R,${LIB_RUNTIME_
f430: 44 49 52 7d 27 0a 09 09 4c 44 5f 53 45 41 52 43  DIR}'...LD_SEARC
f440: 48 5f 46 4c 41 47 53 3d 24 7b 43 43 5f 53 45 41  H_FLAGS=${CC_SEA
f450: 52 43 48 5f 46 4c 41 47 53 7d 0a 09 09 41 53 5f  RCH_FLAGS}...AS_
f460: 49 46 28 5b 74 65 73 74 20 22 24 64 6f 36 34 62  IF([test "$do64b
f470: 69 74 5f 6f 6b 22 20 3d 20 79 65 73 5d 2c 20 5b  it_ok" = yes], [
f480: 0a 09 09 20 20 20 20 41 53 5f 49 46 28 5b 74 65  ...    AS_IF([te
f490: 73 74 20 22 24 61 72 63 68 22 20 3d 20 22 73 70  st "$arch" = "sp
f4a0: 61 72 63 76 39 20 73 70 61 72 63 22 5d 2c 20 5b  arcv9 sparc"], [
f4b0: 0a 09 09 09 23 20 57 65 20 6e 65 65 64 20 74 6f  ....# We need to
f4c0: 20 73 70 65 63 69 66 79 20 2d 73 74 61 74 69 63   specify -static
f4d0: 2d 6c 69 62 67 63 63 20 6f 72 20 77 65 20 6e 65  -libgcc or we ne
f4e0: 65 64 20 74 6f 0a 09 09 09 23 20 61 64 64 20 74  ed to....# add t
f4f0: 68 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 73  he path to the s
f500: 70 61 72 76 39 20 6c 69 62 67 63 63 2e 0a 09 09  parv9 libgcc....
f510: 09 53 48 4c 49 42 5f 4c 44 3d 22 24 53 48 4c 49  .SHLIB_LD="$SHLI
f520: 42 5f 4c 44 20 2d 6d 36 34 20 2d 6d 63 70 75 3d  B_LD -m64 -mcpu=
f530: 76 39 20 2d 73 74 61 74 69 63 2d 6c 69 62 67 63  v9 -static-libgc
f540: 63 22 0a 09 09 09 23 20 66 6f 72 20 66 69 6e 64  c"....# for find
f550: 69 6e 67 20 73 70 61 72 63 76 39 20 6c 69 62 67  ing sparcv9 libg
f560: 63 63 2c 20 67 65 74 20 74 68 65 20 72 65 67 75  cc, get the regu
f570: 6c 61 72 20 6c 69 62 67 63 63 0a 09 09 09 23 20  lar libgcc....# 
f580: 70 61 74 68 2c 20 72 65 6d 6f 76 65 20 73 6f 20  path, remove so 
f590: 6e 61 6d 65 20 61 6e 64 20 61 70 70 65 6e 64 20  name and append 
f5a0: 27 73 70 61 72 63 76 39 27 0a 09 09 09 23 76 39  'sparcv9'....#v9
f5b0: 67 63 63 6c 69 62 64 69 72 3d 22 60 67 63 63 20  gcclibdir="`gcc 
f5c0: 2d 70 72 69 6e 74 2d 66 69 6c 65 2d 6e 61 6d 65  -print-file-name
f5d0: 3d 6c 69 62 67 63 63 5f 73 2e 73 6f 60 20 7c 20  =libgcc_s.so` | 
f5e0: 2e 2e 2e 22 0a 09 09 09 23 43 43 5f 53 45 41 52  ..."....#CC_SEAR
f5f0: 43 48 5f 46 4c 41 47 53 3d 22 24 7b 43 43 5f 53  CH_FLAGS="${CC_S
f600: 45 41 52 43 48 5f 46 4c 41 47 53 7d 2c 2d 52 2c  EARCH_FLAGS},-R,
f610: 24 76 39 67 63 63 6c 69 62 64 69 72 22 0a 09 09  $v9gcclibdir"...
f620: 20 20 20 20 5d 2c 20 5b 41 53 5f 49 46 28 5b 74      ], [AS_IF([t
f630: 65 73 74 20 22 24 61 72 63 68 22 20 3d 20 22 61  est "$arch" = "a
f640: 6d 64 36 34 20 69 33 38 36 22 5d 2c 20 5b 0a 09  md64 i386"], [..
f650: 09 09 53 48 4c 49 42 5f 4c 44 3d 22 24 53 48 4c  ..SHLIB_LD="$SHL
f660: 49 42 5f 4c 44 20 2d 6d 36 34 20 2d 73 74 61 74  IB_LD -m64 -stat
f670: 69 63 2d 6c 69 62 67 63 63 22 0a 09 09 20 20 20  ic-libgcc"...   
f680: 20 5d 29 5d 29 0a 09 09 5d 29 0a 09 20 20 20 20   ])])...])..    
f690: 5d 2c 20 5b 0a 09 09 41 53 5f 49 46 28 5b 74 65  ], [...AS_IF([te
f6a0: 73 74 20 22 24 75 73 65 5f 73 75 6e 6d 61 74 68  st "$use_sunmath
f6b0: 22 20 3d 20 79 65 73 5d 2c 20 5b 74 65 78 74 6d  " = yes], [textm
f6c0: 6f 64 65 3d 74 65 78 74 6f 66 66 5d 2c 5b 74 65  ode=textoff],[te
f6d0: 78 74 6d 6f 64 65 3d 74 65 78 74 5d 29 0a 09 09  xtmode=text])...
f6e0: 63 61 73 65 20 24 73 79 73 74 65 6d 20 69 6e 0a  case $system in.
f6f0: 09 09 20 20 20 20 53 75 6e 4f 53 2d 35 2e 5b 5b  ..    SunOS-5.[[
f700: 31 2d 39 5d 5d 5b 5b 30 2d 39 5d 5d 2a 7c 53 75  1-9]][[0-9]]*|Su
f710: 6e 4f 53 2d 35 2e 5b 5b 37 2d 39 5d 5d 29 0a 09  nOS-5.[[7-9]])..
f720: 09 09 53 48 4c 49 42 5f 4c 44 3d 22 5c 24 7b 43  ..SHLIB_LD="\${C
f730: 43 7d 20 2d 47 20 2d 7a 20 24 74 65 78 74 6d 6f  C} -G -z $textmo
f740: 64 65 20 5c 24 7b 4c 44 46 4c 41 47 53 7d 22 3b  de \${LDFLAGS}";
f750: 3b 0a 09 09 20 20 20 20 2a 29 0a 09 09 09 53 48  ;...    *)....SH
f760: 4c 49 42 5f 4c 44 3d 22 2f 75 73 72 2f 63 63 73  LIB_LD="/usr/ccs
f770: 2f 62 69 6e 2f 6c 64 20 2d 47 20 2d 7a 20 24 74  /bin/ld -G -z $t
f780: 65 78 74 6d 6f 64 65 22 3b 3b 0a 09 09 65 73 61  extmode";;...esa
f790: 63 0a 09 09 43 43 5f 53 45 41 52 43 48 5f 46 4c  c...CC_SEARCH_FL
f7a0: 41 47 53 3d 27 2d 57 6c 2c 2d 52 2c 24 7b 4c 49  AGS='-Wl,-R,${LI
f7b0: 42 5f 52 55 4e 54 49 4d 45 5f 44 49 52 7d 27 0a  B_RUNTIME_DIR}'.
f7c0: 09 09 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41 47  ..LD_SEARCH_FLAG
f7d0: 53 3d 27 2d 52 20 24 7b 4c 49 42 5f 52 55 4e 54  S='-R ${LIB_RUNT
f7e0: 49 4d 45 5f 44 49 52 7d 27 0a 09 20 20 20 20 5d  IME_DIR}'..    ]
f7f0: 29 0a 09 20 20 20 20 3b 3b 0a 09 55 4e 49 58 5f  )..    ;;..UNIX_
f800: 53 56 2a 20 7c 20 55 6e 69 78 57 61 72 65 2d 35  SV* | UnixWare-5
f810: 2a 29 0a 09 20 20 20 20 53 48 4c 49 42 5f 43 46  *)..    SHLIB_CF
f820: 4c 41 47 53 3d 22 2d 4b 50 49 43 22 0a 09 20 20  LAGS="-KPIC"..  
f830: 20 20 53 48 4c 49 42 5f 4c 44 3d 27 24 7b 43 43    SHLIB_LD='${CC
f840: 7d 20 2d 47 27 0a 09 20 20 20 20 53 48 4c 49 42  } -G'..    SHLIB
f850: 5f 4c 44 5f 4c 49 42 53 3d 22 22 0a 09 20 20 20  _LD_LIBS=""..   
f860: 20 53 48 4c 49 42 5f 53 55 46 46 49 58 3d 22 2e   SHLIB_SUFFIX=".
f870: 73 6f 22 0a 09 20 20 20 20 44 4c 5f 4f 42 4a 53  so"..    DL_OBJS
f880: 3d 22 74 63 6c 4c 6f 61 64 44 6c 2e 6f 22 0a 09  ="tclLoadDl.o"..
f890: 20 20 20 20 44 4c 5f 4c 49 42 53 3d 22 2d 6c 64      DL_LIBS="-ld
f8a0: 6c 22 0a 09 20 20 20 20 23 20 53 6f 6d 65 20 55  l"..    # Some U
f8b0: 4e 49 58 5f 53 56 2a 20 73 79 73 74 65 6d 73 20  NIX_SV* systems 
f8c0: 28 75 6e 69 78 77 61 72 65 20 31 2e 31 2e 32 20  (unixware 1.1.2 
f8d0: 66 6f 72 20 65 78 61 6d 70 6c 65 29 20 68 61 76  for example) hav
f8e0: 65 20 6c 69 6e 6b 65 72 73 0a 09 20 20 20 20 23  e linkers..    #
f8f0: 20 74 68 61 74 20 64 6f 6e 27 74 20 67 72 6f 6b   that don't grok
f900: 20 74 68 65 20 2d 42 65 78 70 6f 72 74 20 6f 70   the -Bexport op
f910: 74 69 6f 6e 2e 20 20 54 65 73 74 20 74 68 61 74  tion.  Test that
f920: 20 69 74 20 64 6f 65 73 2e 0a 09 20 20 20 20 41   it does...    A
f930: 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66  C_CACHE_CHECK([f
f940: 6f 72 20 6c 64 20 61 63 63 65 70 74 73 20 2d 42  or ld accepts -B
f950: 65 78 70 6f 72 74 20 66 6c 61 67 5d 2c 20 74 63  export flag], tc
f960: 6c 5f 63 76 5f 6c 64 5f 42 65 78 70 6f 72 74 2c  l_cv_ld_Bexport,
f970: 20 5b 0a 09 09 68 6f 6c 64 5f 6c 64 66 6c 61 67   [...hold_ldflag
f980: 73 3d 24 4c 44 46 4c 41 47 53 0a 09 09 4c 44 46  s=$LDFLAGS...LDF
f990: 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 20 2d  LAGS="$LDFLAGS -
f9a0: 57 6c 2c 2d 42 65 78 70 6f 72 74 22 0a 09 09 41  Wl,-Bexport"...A
f9b0: 43 5f 54 52 59 5f 4c 49 4e 4b 28 2c 20 5b 69 6e  C_TRY_LINK(, [in
f9c0: 74 20 69 3b 5d 2c 20 74 63 6c 5f 63 76 5f 6c 64  t i;], tcl_cv_ld
f9d0: 5f 42 65 78 70 6f 72 74 3d 79 65 73 2c 20 74 63  _Bexport=yes, tc
f9e0: 6c 5f 63 76 5f 6c 64 5f 42 65 78 70 6f 72 74 3d  l_cv_ld_Bexport=
f9f0: 6e 6f 29 0a 09 20 20 20 20 20 20 20 20 4c 44 46  no)..        LDF
fa00: 4c 41 47 53 3d 24 68 6f 6c 64 5f 6c 64 66 6c 61  LAGS=$hold_ldfla
fa10: 67 73 5d 29 0a 09 20 20 20 20 41 53 5f 49 46 28  gs])..    AS_IF(
fa20: 5b 74 65 73 74 20 24 74 63 6c 5f 63 76 5f 6c 64  [test $tcl_cv_ld
fa30: 5f 42 65 78 70 6f 72 74 20 3d 20 79 65 73 5d 2c  _Bexport = yes],
fa40: 20 5b 0a 09 09 4c 44 46 4c 41 47 53 3d 22 24 4c   [...LDFLAGS="$L
fa50: 44 46 4c 41 47 53 20 2d 57 6c 2c 2d 42 65 78 70  DFLAGS -Wl,-Bexp
fa60: 6f 72 74 22 0a 09 20 20 20 20 5d 29 0a 09 20 20  ort"..    ])..  
fa70: 20 20 43 43 5f 53 45 41 52 43 48 5f 46 4c 41 47    CC_SEARCH_FLAG
fa80: 53 3d 22 22 0a 09 20 20 20 20 4c 44 5f 53 45 41  S=""..    LD_SEA
fa90: 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 20 20  RCH_FLAGS=""..  
faa0: 20 20 3b 3b 0a 20 20 20 20 65 73 61 63 0a 0a 20    ;;.    esac.. 
fab0: 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
fac0: 24 64 6f 36 34 62 69 74 22 20 3d 20 79 65 73 20  $do64bit" = yes 
fad0: 2d 61 20 22 24 64 6f 36 34 62 69 74 5f 6f 6b 22  -a "$do64bit_ok"
fae0: 20 3d 20 6e 6f 5d 2c 20 5b 0a 09 41 43 5f 4d 53   = no], [..AC_MS
faf0: 47 5f 57 41 52 4e 28 5b 36 34 62 69 74 20 73 75  G_WARN([64bit su
fb00: 70 70 6f 72 74 20 62 65 69 6e 67 20 64 69 73 61  pport being disa
fb10: 62 6c 65 64 20 2d 2d 20 64 6f 6e 27 74 20 6b 6e  bled -- don't kn
fb20: 6f 77 20 6d 61 67 69 63 20 66 6f 72 20 74 68 69  ow magic for thi
fb30: 73 20 70 6c 61 74 66 6f 72 6d 5d 29 0a 20 20 20  s platform]).   
fb40: 20 5d 29 0a 0a 20 20 20 20 41 53 5f 49 46 28 5b   ])..    AS_IF([
fb50: 74 65 73 74 20 22 24 64 6f 36 34 62 69 74 22 20  test "$do64bit" 
fb60: 3d 20 79 65 73 20 2d 61 20 22 24 64 6f 36 34 62  = yes -a "$do64b
fb70: 69 74 5f 6f 6b 22 20 3d 20 79 65 73 5d 2c 20 5b  it_ok" = yes], [
fb80: 0a 09 41 43 5f 44 45 46 49 4e 45 28 54 43 4c 5f  ..AC_DEFINE(TCL_
fb90: 43 46 47 5f 44 4f 36 34 42 49 54 2c 20 31 2c 20  CFG_DO64BIT, 1, 
fba0: 5b 49 73 20 74 68 69 73 20 61 20 36 34 2d 62 69  [Is this a 64-bi
fbb0: 74 20 62 75 69 6c 64 3f 5d 29 0a 20 20 20 20 5d  t build?]).    ]
fbc0: 29 0a 0a 64 6e 6c 20 23 20 41 64 64 20 61 6e 79  )..dnl # Add any
fbd0: 20 43 50 50 46 4c 41 47 53 20 73 65 74 20 69 6e   CPPFLAGS set in
fbe0: 20 74 68 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74   the environment
fbf0: 20 74 6f 20 6f 75 72 20 43 46 4c 41 47 53 2c 20   to our CFLAGS, 
fc00: 62 75 74 20 64 65 6c 61 79 20 64 6f 69 6e 67 20  but delay doing 
fc10: 73 6f 0a 64 6e 6c 20 23 20 75 6e 74 69 6c 20 74  so.dnl # until t
fc20: 68 65 20 65 6e 64 20 6f 66 20 63 6f 6e 66 69 67  he end of config
fc30: 75 72 65 2c 20 61 73 20 63 6f 6e 66 69 67 75 72  ure, as configur
fc40: 65 27 73 20 63 6f 6d 70 69 6c 65 20 61 6e 64 20  e's compile and 
fc50: 6c 69 6e 6b 20 74 65 73 74 73 20 75 73 65 0a 64  link tests use.d
fc60: 6e 6c 20 23 20 62 6f 74 68 20 43 50 50 46 4c 41  nl # both CPPFLA
fc70: 47 53 20 61 6e 64 20 43 46 4c 41 47 53 20 28 75  GS and CFLAGS (u
fc80: 6e 6c 69 6b 65 20 6f 75 72 20 63 6f 6d 70 69 6c  nlike our compil
fc90: 65 20 61 6e 64 20 6c 69 6e 6b 29 20 62 75 74 20  e and link) but 
fca0: 63 6f 6e 66 69 67 75 72 65 27 73 0a 64 6e 6c 20  configure's.dnl 
fcb0: 23 20 70 72 65 70 72 6f 63 65 73 73 69 6e 67 20  # preprocessing 
fcc0: 74 65 73 74 73 20 75 73 65 20 6f 6e 6c 79 20 43  tests use only C
fcd0: 50 50 46 4c 41 47 53 2e 0a 20 20 20 20 41 43 5f  PPFLAGS..    AC_
fce0: 43 4f 4e 46 49 47 5f 43 4f 4d 4d 41 4e 44 53 5f  CONFIG_COMMANDS_
fcf0: 50 52 45 28 5b 43 46 4c 41 47 53 3d 22 24 7b 43  PRE([CFLAGS="${C
fd00: 46 4c 41 47 53 7d 20 24 7b 43 50 50 46 4c 41 47  FLAGS} ${CPPFLAG
fd10: 53 7d 22 3b 20 43 50 50 46 4c 41 47 53 3d 22 22  S}"; CPPFLAGS=""
fd20: 5d 29 0a 0a 20 20 20 20 23 20 53 74 65 70 20 34  ])..    # Step 4
fd30: 3a 20 64 69 73 61 62 6c 65 20 64 79 6e 61 6d 69  : disable dynami
fd40: 63 20 6c 6f 61 64 69 6e 67 20 69 66 20 72 65 71  c loading if req
fd50: 75 65 73 74 65 64 20 76 69 61 20 61 20 63 6f 6d  uested via a com
fd60: 6d 61 6e 64 2d 6c 69 6e 65 20 73 77 69 74 63 68  mand-line switch
fd70: 2e 0a 0a 20 20 20 20 41 43 5f 41 52 47 5f 45 4e  ...    AC_ARG_EN
fd80: 41 42 4c 45 28 6c 6f 61 64 2c 0a 09 41 43 5f 48  ABLE(load,..AC_H
fd90: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e  ELP_STRING([--en
fda0: 61 62 6c 65 2d 6c 6f 61 64 5d 2c 0a 09 20 20 20  able-load],..   
fdb0: 20 5b 61 6c 6c 6f 77 20 64 79 6e 61 6d 69 63 20   [allow dynamic 
fdc0: 6c 6f 61 64 69 6e 67 20 61 6e 64 20 22 6c 6f 61  loading and "loa
fdd0: 64 22 20 63 6f 6d 6d 61 6e 64 20 28 64 65 66 61  d" command (defa
fde0: 75 6c 74 3a 20 6f 6e 29 5d 29 2c 0a 09 5b 74 63  ult: on)]),..[tc
fdf0: 6c 5f 6f 6b 3d 24 65 6e 61 62 6c 65 76 61 6c 5d  l_ok=$enableval]
fe00: 2c 20 5b 74 63 6c 5f 6f 6b 3d 79 65 73 5d 29 0a  , [tcl_ok=yes]).
fe10: 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
fe20: 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 6e 6f 5d 2c  "$tcl_ok" = no],
fe30: 20 5b 44 4c 5f 4f 42 4a 53 3d 22 22 5d 29 0a 0a   [DL_OBJS=""])..
fe40: 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
fe50: 22 78 24 44 4c 5f 4f 42 4a 53 22 20 21 3d 20 78  "x$DL_OBJS" != x
fe60: 5d 2c 20 5b 42 55 49 4c 44 5f 44 4c 54 45 53 54  ], [BUILD_DLTEST
fe70: 3d 22 5c 24 28 44 4c 54 45 53 54 5f 54 41 52 47  ="\$(DLTEST_TARG
fe80: 45 54 53 29 22 5d 2c 20 5b 0a 09 41 43 5f 4d 53  ETS)"], [..AC_MS
fe90: 47 5f 57 41 52 4e 28 5b 43 61 6e 27 74 20 66 69  G_WARN([Can't fi
fea0: 67 75 72 65 20 6f 75 74 20 68 6f 77 20 74 6f 20  gure out how to 
feb0: 64 6f 20 64 79 6e 61 6d 69 63 20 6c 6f 61 64 69  do dynamic loadi
fec0: 6e 67 20 6f 72 20 73 68 61 72 65 64 20 6c 69 62  ng or shared lib
fed0: 72 61 72 69 65 73 20 6f 6e 20 74 68 69 73 20 73  raries on this s
fee0: 79 73 74 65 6d 2e 5d 29 0a 09 53 48 4c 49 42 5f  ystem.])..SHLIB_
fef0: 43 46 4c 41 47 53 3d 22 22 0a 09 53 48 4c 49 42  CFLAGS=""..SHLIB
ff00: 5f 4c 44 3d 22 22 0a 09 53 48 4c 49 42 5f 53 55  _LD=""..SHLIB_SU
ff10: 46 46 49 58 3d 22 22 0a 09 44 4c 5f 4f 42 4a 53  FFIX=""..DL_OBJS
ff20: 3d 22 74 63 6c 4c 6f 61 64 4e 6f 6e 65 2e 6f 22  ="tclLoadNone.o"
ff30: 0a 09 44 4c 5f 4c 49 42 53 3d 22 22 0a 09 4c 44  ..DL_LIBS=""..LD
ff40: 46 4c 41 47 53 3d 22 24 4c 44 46 4c 41 47 53 5f  FLAGS="$LDFLAGS_
ff50: 4f 52 49 47 22 0a 09 43 43 5f 53 45 41 52 43 48  ORIG"..CC_SEARCH
ff60: 5f 46 4c 41 47 53 3d 22 22 0a 09 4c 44 5f 53 45  _FLAGS=""..LD_SE
ff70: 41 52 43 48 5f 46 4c 41 47 53 3d 22 22 0a 09 42  ARCH_FLAGS=""..B
ff80: 55 49 4c 44 5f 44 4c 54 45 53 54 3d 22 22 0a 20  UILD_DLTEST="". 
ff90: 20 20 20 5d 29 0a 20 20 20 20 4c 44 46 4c 41 47     ]).    LDFLAG
ffa0: 53 3d 22 24 4c 44 46 4c 41 47 53 20 24 4c 44 46  S="$LDFLAGS $LDF
ffb0: 4c 41 47 53 5f 41 52 43 48 22 0a 0a 20 20 20 20  LAGS_ARCH"..    
ffc0: 23 20 49 66 20 77 65 27 72 65 20 72 75 6e 6e 69  # If we're runni
ffd0: 6e 67 20 67 63 63 2c 20 74 68 65 6e 20 63 68 61  ng gcc, then cha
ffe0: 6e 67 65 20 74 68 65 20 43 20 66 6c 61 67 73 20  nge the C flags 
fff0: 66 6f 72 20 63 6f 6d 70 69 6c 69 6e 67 20 73 68  for compiling sh
10000 61 72 65 64 0a 20 20 20 20 23 20 6c 69 62 72 61  ared.    # libra
10010 72 69 65 73 20 74 6f 20 74 68 65 20 72 69 67 68  ries to the righ
10020 74 20 66 6c 61 67 73 20 66 6f 72 20 67 63 63 2c  t flags for gcc,
10030 20 69 6e 73 74 65 61 64 20 6f 66 20 74 68 6f 73   instead of thos
10040 65 20 66 6f 72 20 74 68 65 0a 20 20 20 20 23 20  e for the.    # 
10050 73 74 61 6e 64 61 72 64 20 6d 61 6e 75 66 61 63  standard manufac
10060 74 75 72 65 72 20 63 6f 6d 70 69 6c 65 72 2e 0a  turer compiler..
10070 0a 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74  .    AS_IF([test
10080 20 22 24 44 4c 5f 4f 42 4a 53 22 20 21 3d 20 22   "$DL_OBJS" != "
10090 74 63 6c 4c 6f 61 64 4e 6f 6e 65 2e 6f 22 20 2d  tclLoadNone.o" -
100a0 61 20 22 24 47 43 43 22 20 3d 20 79 65 73 5d 2c  a "$GCC" = yes],
100b0 20 5b 0a 09 63 61 73 65 20 24 73 79 73 74 65 6d   [..case $system
100c0 20 69 6e 0a 09 20 20 20 20 41 49 58 2d 2a 29 20   in..    AIX-*) 
100d0 3b 3b 0a 09 20 20 20 20 42 53 44 2f 4f 53 2a 29  ;;..    BSD/OS*)
100e0 20 3b 3b 0a 09 20 20 20 20 43 59 47 57 49 4e 5f   ;;..    CYGWIN_
100f0 2a 7c 4d 49 4e 47 57 33 32 5f 2a 29 20 3b 3b 0a  *|MINGW32_*) ;;.
10100 09 20 20 20 20 49 52 49 58 2a 29 20 3b 3b 0a 09  .    IRIX*) ;;..
10110 20 20 20 20 4e 65 74 42 53 44 2d 2a 7c 46 72 65      NetBSD-*|Fre
10120 65 42 53 44 2d 2a 7c 4f 70 65 6e 42 53 44 2d 2a  eBSD-*|OpenBSD-*
10130 29 20 3b 3b 0a 09 20 20 20 20 44 61 72 77 69 6e  ) ;;..    Darwin
10140 2d 2a 29 20 3b 3b 0a 09 20 20 20 20 53 43 4f 5f  -*) ;;..    SCO_
10150 53 56 2d 33 2e 32 2a 29 20 3b 3b 0a 09 20 20 20  SV-3.2*) ;;..   
10160 20 2a 29 20 53 48 4c 49 42 5f 43 46 4c 41 47 53   *) SHLIB_CFLAGS
10170 3d 22 2d 66 50 49 43 22 20 3b 3b 0a 09 65 73 61  ="-fPIC" ;;..esa
10180 63 5d 29 0a 0a 20 20 20 20 41 53 5f 49 46 28 5b  c])..    AS_IF([
10190 74 65 73 74 20 22 24 74 63 6c 5f 63 76 5f 63 63  test "$tcl_cv_cc
101a0 5f 76 69 73 69 62 69 6c 69 74 79 5f 68 69 64 64  _visibility_hidd
101b0 65 6e 22 20 21 3d 20 79 65 73 5d 2c 20 5b 0a 09  en" != yes], [..
101c0 41 43 5f 44 45 46 49 4e 45 28 4d 4f 44 55 4c 45  AC_DEFINE(MODULE
101d0 5f 53 43 4f 50 45 2c 20 5b 65 78 74 65 72 6e 5d  _SCOPE, [extern]
101e0 2c 0a 09 20 20 20 20 5b 4e 6f 20 43 6f 6d 70 69  ,..    [No Compi
101f0 6c 65 72 20 73 75 70 70 6f 72 74 20 66 6f 72 20  ler support for 
10200 6d 6f 64 75 6c 65 20 73 63 6f 70 65 20 73 79 6d  module scope sym
10210 62 6f 6c 73 5d 29 0a 20 20 20 20 5d 29 0a 0a 20  bols]).    ]).. 
10220 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
10230 24 53 48 41 52 45 44 5f 4c 49 42 5f 53 55 46 46  $SHARED_LIB_SUFF
10240 49 58 22 20 3d 20 22 22 5d 2c 20 5b 0a 09 53 48  IX" = ""], [..SH
10250 41 52 45 44 5f 4c 49 42 5f 53 55 46 46 49 58 3d  ARED_LIB_SUFFIX=
10260 27 24 7b 56 45 52 53 49 4f 4e 7d 24 7b 53 48 4c  '${VERSION}${SHL
10270 49 42 5f 53 55 46 46 49 58 7d 27 5d 29 0a 20 20  IB_SUFFIX}']).  
10280 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22 24    AS_IF([test "$
10290 55 4e 53 48 41 52 45 44 5f 4c 49 42 5f 53 55 46  UNSHARED_LIB_SUF
102a0 46 49 58 22 20 3d 20 22 22 5d 2c 20 5b 0a 09 55  FIX" = ""], [..U
102b0 4e 53 48 41 52 45 44 5f 4c 49 42 5f 53 55 46 46  NSHARED_LIB_SUFF
102c0 49 58 3d 27 24 7b 56 45 52 53 49 4f 4e 7d 2e 61  IX='${VERSION}.a
102d0 27 5d 29 0a 20 20 20 20 44 4c 4c 5f 49 4e 53 54  ']).    DLL_INST
102e0 41 4c 4c 5f 44 49 52 3d 22 5c 24 28 4c 49 42 5f  ALL_DIR="\$(LIB_
102f0 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 0a 20  INSTALL_DIR)".. 
10300 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
10310 24 7b 53 48 41 52 45 44 5f 42 55 49 4c 44 7d 22  ${SHARED_BUILD}"
10320 20 3d 20 31 20 2d 61 20 22 24 7b 53 48 4c 49 42   = 1 -a "${SHLIB
10330 5f 53 55 46 46 49 58 7d 22 20 21 3d 20 22 22 5d  _SUFFIX}" != ""]
10340 2c 20 5b 0a 20 20 20 20 20 20 20 20 4c 49 42 5f  , [.        LIB_
10350 53 55 46 46 49 58 3d 24 7b 53 48 41 52 45 44 5f  SUFFIX=${SHARED_
10360 4c 49 42 5f 53 55 46 46 49 58 7d 0a 20 20 20 20  LIB_SUFFIX}.    
10370 20 20 20 20 4d 41 4b 45 5f 4c 49 42 3d 27 24 7b      MAKE_LIB='${
10380 53 48 4c 49 42 5f 4c 44 7d 20 2d 6f 20 5b 24 5d  SHLIB_LD} -o [$]
10390 40 20 24 7b 4f 42 4a 53 7d 20 24 7b 54 43 4c 5f  @ ${OBJS} ${TCL_
103a0 53 48 4c 49 42 5f 4c 44 5f 45 58 54 52 41 53 7d  SHLIB_LD_EXTRAS}
103b0 20 24 7b 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53   ${SHLIB_LD_LIBS
103c0 7d 20 24 7b 54 4b 5f 53 48 4c 49 42 5f 4c 44 5f  } ${TK_SHLIB_LD_
103d0 45 58 54 52 41 53 7d 20 24 7b 4c 44 5f 53 45 41  EXTRAS} ${LD_SEA
103e0 52 43 48 5f 46 4c 41 47 53 7d 27 0a 20 20 20 20  RCH_FLAGS}'.    
103f0 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20      AS_IF([test 
10400 22 24 7b 53 48 4c 49 42 5f 53 55 46 46 49 58 7d  "${SHLIB_SUFFIX}
10410 22 20 3d 20 22 2e 64 6c 6c 22 5d 2c 20 5b 0a 20  " = ".dll"], [. 
10420 20 20 20 20 20 20 20 20 20 20 20 49 4e 53 54 41             INSTA
10430 4c 4c 5f 4c 49 42 3d 27 24 28 49 4e 53 54 41 4c  LL_LIB='$(INSTAL
10440 4c 5f 4c 49 42 52 41 52 59 29 20 24 28 4c 49 42  L_LIBRARY) $(LIB
10450 5f 46 49 4c 45 29 20 22 24 28 42 49 4e 5f 49 4e  _FILE) "$(BIN_IN
10460 53 54 41 4c 4c 5f 44 49 52 29 2f 24 28 4c 49 42  STALL_DIR)/$(LIB
10470 5f 46 49 4c 45 29 22 27 0a 20 20 20 20 20 20 20  _FILE)"'.       
10480 20 20 20 20 20 44 4c 4c 5f 49 4e 53 54 41 4c 4c       DLL_INSTALL
10490 5f 44 49 52 3d 22 5c 24 28 42 49 4e 5f 49 4e 53  _DIR="\$(BIN_INS
104a0 54 41 4c 4c 5f 44 49 52 29 22 0a 20 20 20 20 20  TALL_DIR)".     
104b0 20 20 20 5d 2c 20 5b 0a 20 20 20 20 20 20 20 20     ], [.        
104c0 20 20 20 20 49 4e 53 54 41 4c 4c 5f 4c 49 42 3d      INSTALL_LIB=
104d0 27 24 28 49 4e 53 54 41 4c 4c 5f 4c 49 42 52 41  '$(INSTALL_LIBRA
104e0 52 59 29 20 24 28 4c 49 42 5f 46 49 4c 45 29 20  RY) $(LIB_FILE) 
104f0 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44  "$(LIB_INSTALL_D
10500 49 52 29 2f 24 28 4c 49 42 5f 46 49 4c 45 29 22  IR)/$(LIB_FILE)"
10510 27 0a 20 20 20 20 20 20 20 20 5d 29 0a 20 20 20  '.        ]).   
10520 20 5d 2c 20 5b 0a 20 20 20 20 20 20 20 20 4c 49   ], [.        LI
10530 42 5f 53 55 46 46 49 58 3d 24 7b 55 4e 53 48 41  B_SUFFIX=${UNSHA
10540 52 45 44 5f 4c 49 42 5f 53 55 46 46 49 58 7d 0a  RED_LIB_SUFFIX}.
10550 0a 20 20 20 20 20 20 20 20 41 53 5f 49 46 28 5b  .        AS_IF([
10560 74 65 73 74 20 22 24 52 41 4e 4c 49 42 22 20 3d  test "$RANLIB" =
10570 20 22 22 5d 2c 20 5b 0a 20 20 20 20 20 20 20 20   ""], [.        
10580 20 20 20 20 4d 41 4b 45 5f 4c 49 42 3d 27 24 28      MAKE_LIB='$(
10590 53 54 4c 49 42 5f 4c 44 29 20 5b 24 5d 40 20 24  STLIB_LD) [$]@ $
105a0 7b 4f 42 4a 53 7d 27 0a 20 20 20 20 20 20 20 20  {OBJS}'.        
105b0 20 20 20 20 49 4e 53 54 41 4c 4c 5f 4c 49 42 3d      INSTALL_LIB=
105c0 27 24 28 49 4e 53 54 41 4c 4c 5f 4c 49 42 52 41  '$(INSTALL_LIBRA
105d0 52 59 29 20 24 28 4c 49 42 5f 46 49 4c 45 29 20  RY) $(LIB_FILE) 
105e0 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44  "$(LIB_INSTALL_D
105f0 49 52 29 2f 24 28 4c 49 42 5f 46 49 4c 45 29 22  IR)/$(LIB_FILE)"
10600 27 0a 20 20 20 20 20 20 20 20 5d 2c 20 5b 0a 20  '.        ], [. 
10610 20 20 20 20 20 20 20 20 20 20 20 4d 41 4b 45 5f             MAKE_
10620 4c 49 42 3d 27 24 7b 53 54 4c 49 42 5f 4c 44 7d  LIB='${STLIB_LD}
10630 20 5b 24 5d 40 20 24 7b 4f 42 4a 53 7d 20 3b 20   [$]@ ${OBJS} ; 
10640 24 7b 52 41 4e 4c 49 42 7d 20 5b 24 5d 40 27 0a  ${RANLIB} [$]@'.
10650 20 20 20 20 20 20 20 20 20 20 20 20 49 4e 53 54              INST
10660 41 4c 4c 5f 4c 49 42 3d 27 24 28 49 4e 53 54 41  ALL_LIB='$(INSTA
10670 4c 4c 5f 4c 49 42 52 41 52 59 29 20 24 28 4c 49  LL_LIBRARY) $(LI
10680 42 5f 46 49 4c 45 29 20 22 24 28 4c 49 42 5f 49  B_FILE) "$(LIB_I
10690 4e 53 54 41 4c 4c 5f 44 49 52 29 2f 24 28 4c 49  NSTALL_DIR)/$(LI
106a0 42 5f 46 49 4c 45 29 22 20 3b 20 28 63 64 20 22  B_FILE)" ; (cd "
106b0 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49  $(LIB_INSTALL_DI
106c0 52 29 22 20 3b 20 24 28 52 41 4e 4c 49 42 29 20  R)" ; $(RANLIB) 
106d0 24 28 4c 49 42 5f 46 49 4c 45 29 29 27 0a 20 20  $(LIB_FILE))'.  
106e0 20 20 20 20 20 20 5d 29 0a 20 20 20 20 5d 29 0a        ]).    ]).
106f0 0a 20 20 20 20 23 20 53 74 75 62 20 6c 69 62 20  .    # Stub lib 
10700 64 6f 65 73 20 6e 6f 74 20 64 65 70 65 6e 64 20  does not depend 
10710 6f 6e 20 73 68 61 72 65 64 2f 73 74 61 74 69 63  on shared/static
10720 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a 20   configuration. 
10730 20 20 20 41 53 5f 49 46 28 5b 74 65 73 74 20 22     AS_IF([test "
10740 24 52 41 4e 4c 49 42 22 20 3d 20 22 22 5d 2c 20  $RANLIB" = ""], 
10750 5b 0a 20 20 20 20 20 20 20 20 4d 41 4b 45 5f 53  [.        MAKE_S
10760 54 55 42 5f 4c 49 42 3d 27 24 7b 53 54 4c 49 42  TUB_LIB='${STLIB
10770 5f 4c 44 7d 20 5b 24 5d 40 20 24 7b 53 54 55 42  _LD} [$]@ ${STUB
10780 5f 4c 49 42 5f 4f 42 4a 53 7d 27 0a 20 20 20 20  _LIB_OBJS}'.    
10790 20 20 20 20 49 4e 53 54 41 4c 4c 5f 53 54 55 42      INSTALL_STUB
107a0 5f 4c 49 42 3d 27 24 28 49 4e 53 54 41 4c 4c 5f  _LIB='$(INSTALL_
107b0 4c 49 42 52 41 52 59 29 20 24 28 53 54 55 42 5f  LIBRARY) $(STUB_
107c0 4c 49 42 5f 46 49 4c 45 29 20 22 24 28 4c 49 42  LIB_FILE) "$(LIB
107d0 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 2f 24 28  _INSTALL_DIR)/$(
107e0 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 29 22 27  STUB_LIB_FILE)"'
107f0 0a 20 20 20 20 5d 2c 20 5b 0a 20 20 20 20 20 20  .    ], [.      
10800 20 20 4d 41 4b 45 5f 53 54 55 42 5f 4c 49 42 3d    MAKE_STUB_LIB=
10810 27 24 7b 53 54 4c 49 42 5f 4c 44 7d 20 5b 24 5d  '${STLIB_LD} [$]
10820 40 20 24 7b 53 54 55 42 5f 4c 49 42 5f 4f 42 4a  @ ${STUB_LIB_OBJ
10830 53 7d 20 3b 20 24 7b 52 41 4e 4c 49 42 7d 20 5b  S} ; ${RANLIB} [
10840 24 5d 40 27 0a 20 20 20 20 20 20 20 20 49 4e 53  $]@'.        INS
10850 54 41 4c 4c 5f 53 54 55 42 5f 4c 49 42 3d 27 24  TALL_STUB_LIB='$
10860 28 49 4e 53 54 41 4c 4c 5f 4c 49 42 52 41 52 59  (INSTALL_LIBRARY
10870 29 20 24 28 53 54 55 42 5f 4c 49 42 5f 46 49 4c  ) $(STUB_LIB_FIL
10880 45 29 20 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c  E) "$(LIB_INSTAL
10890 4c 5f 44 49 52 29 2f 24 28 53 54 55 42 5f 4c 49  L_DIR)/$(STUB_LI
108a0 42 5f 46 49 4c 45 29 22 20 3b 20 28 63 64 20 22  B_FILE)" ; (cd "
108b0 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f 44 49  $(LIB_INSTALL_DI
108c0 52 29 22 20 3b 20 24 28 52 41 4e 4c 49 42 29 20  R)" ; $(RANLIB) 
108d0 24 28 53 54 55 42 5f 4c 49 42 5f 46 49 4c 45 29  $(STUB_LIB_FILE)
108e0 29 27 0a 20 20 20 20 5d 29 0a 0a 20 20 20 20 23  )'.    ])..    #
108f0 20 44 65 66 69 6e 65 20 54 43 4c 5f 4c 49 42 53   Define TCL_LIBS
10900 20 6e 6f 77 20 74 68 61 74 20 77 65 20 6b 6e 6f   now that we kno
10910 77 20 77 68 61 74 20 44 4c 5f 4c 49 42 53 20 69  w what DL_LIBS i
10920 73 2e 0a 20 20 20 20 23 20 54 68 65 20 74 72 69  s..    # The tri
10930 63 6b 20 68 65 72 65 20 69 73 20 74 68 61 74 20  ck here is that 
10940 77 65 20 64 6f 6e 27 74 20 77 61 6e 74 20 74 6f  we don't want to
10950 20 63 68 61 6e 67 65 20 74 68 65 20 76 61 6c 75   change the valu
10960 65 20 6f 66 20 54 43 4c 5f 4c 49 42 53 20 69 66  e of TCL_LIBS if
10970 0a 20 20 20 20 23 20 69 74 20 69 73 20 61 6c 72  .    # it is alr
10980 65 61 64 79 20 73 65 74 20 77 68 65 6e 20 74 63  eady set when tc
10990 6c 43 6f 6e 66 69 67 2e 73 68 20 68 61 64 20 62  lConfig.sh had b
109a0 65 65 6e 20 6c 6f 61 64 65 64 20 62 79 20 54 6b  een loaded by Tk
109b0 2e 0a 20 20 20 20 41 53 5f 49 46 28 5b 74 65 73  ..    AS_IF([tes
109c0 74 20 22 78 24 7b 54 43 4c 5f 4c 49 42 53 7d 22  t "x${TCL_LIBS}"
109d0 20 3d 20 78 5d 2c 20 5b 0a 20 20 20 20 20 20 20   = x], [.       
109e0 20 54 43 4c 5f 4c 49 42 53 3d 22 24 7b 44 4c 5f   TCL_LIBS="${DL_
109f0 4c 49 42 53 7d 20 24 7b 4c 49 42 53 7d 20 24 7b  LIBS} ${LIBS} ${
10a00 4d 41 54 48 5f 4c 49 42 53 7d 22 5d 29 0a 20 20  MATH_LIBS}"]).  
10a10 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 4c    AC_SUBST(TCL_L
10a20 49 42 53 29 0a 0a 09 23 20 53 65 65 20 69 66 20  IBS)...# See if 
10a30 74 68 65 20 63 6f 6d 70 69 6c 65 72 20 73 75 70  the compiler sup
10a40 70 6f 72 74 73 20 63 61 73 74 69 6e 67 20 74 6f  ports casting to
10a50 20 61 20 75 6e 69 6f 6e 20 74 79 70 65 2e 0a 09   a union type...
10a60 23 20 54 68 69 73 20 69 73 20 75 73 65 64 20 74  # This is used t
10a70 6f 20 73 74 6f 70 20 67 63 63 20 66 72 6f 6d 20  o stop gcc from 
10a80 70 72 69 6e 74 69 6e 67 20 61 20 63 6f 6d 70 69  printing a compi
10a90 6c 65 72 0a 09 23 20 77 61 72 6e 69 6e 67 20 77  ler..# warning w
10aa0 68 65 6e 20 69 6e 69 74 69 61 6c 69 7a 69 6e 67  hen initializing
10ab0 20 61 20 75 6e 69 6f 6e 20 6d 65 6d 62 65 72 2e   a union member.
10ac0 0a 0a 09 41 43 5f 43 41 43 48 45 5f 43 48 45 43  ...AC_CACHE_CHEC
10ad0 4b 28 66 6f 72 20 63 61 73 74 20 74 6f 20 75 6e  K(for cast to un
10ae0 69 6f 6e 20 73 75 70 70 6f 72 74 2c 0a 09 20 20  ion support,..  
10af0 20 20 74 63 6c 5f 63 76 5f 63 61 73 74 5f 74 6f    tcl_cv_cast_to
10b00 5f 75 6e 69 6f 6e 2c 0a 09 20 20 20 20 41 43 5f  _union,..    AC_
10b10 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 5d 2c 0a  TRY_COMPILE([],.
10b20 09 20 20 20 20 5b 0a 09 09 20 20 75 6e 69 6f 6e  .    [...  union
10b30 20 66 6f 6f 20 7b 20 69 6e 74 20 69 3b 20 64 6f   foo { int i; do
10b40 75 62 6c 65 20 64 3b 20 7d 3b 0a 09 09 20 20 75  uble d; };...  u
10b50 6e 69 6f 6e 20 66 6f 6f 20 66 20 3d 20 28 75 6e  nion foo f = (un
10b60 69 6f 6e 20 66 6f 6f 29 20 28 69 6e 74 29 20 30  ion foo) (int) 0
10b70 3b 0a 09 20 20 20 20 5d 2c 0a 09 20 20 20 20 74  ;..    ],..    t
10b80 63 6c 5f 63 76 5f 63 61 73 74 5f 74 6f 5f 75 6e  cl_cv_cast_to_un
10b90 69 6f 6e 3d 79 65 73 2c 0a 09 20 20 20 20 74 63  ion=yes,..    tc
10ba0 6c 5f 63 76 5f 63 61 73 74 5f 74 6f 5f 75 6e 69  l_cv_cast_to_uni
10bb0 6f 6e 3d 6e 6f 29 0a 09 29 0a 09 69 66 20 74 65  on=no)..)..if te
10bc0 73 74 20 22 24 74 63 6c 5f 63 76 5f 63 61 73 74  st "$tcl_cv_cast
10bd0 5f 74 6f 5f 75 6e 69 6f 6e 22 20 3d 20 22 79 65  _to_union" = "ye
10be0 73 22 3b 20 74 68 65 6e 0a 09 20 20 20 20 41 43  s"; then..    AC
10bf0 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 43 41 53  _DEFINE(HAVE_CAS
10c00 54 5f 54 4f 5f 55 4e 49 4f 4e 2c 20 31 2c 0a 09  T_TO_UNION, 1,..
10c10 09 20 20 20 20 5b 44 65 66 69 6e 65 64 20 77 68  .    [Defined wh
10c20 65 6e 20 63 6f 6d 70 69 6c 65 72 20 73 75 70 70  en compiler supp
10c30 6f 72 74 73 20 63 61 73 74 69 6e 67 20 74 6f 20  orts casting to 
10c40 75 6e 69 6f 6e 20 74 79 70 65 2e 5d 29 0a 09 66  union type.])..f
10c50 69 0a 0a 20 20 20 20 23 20 46 49 58 4d 45 3a 20  i..    # FIXME: 
10c60 54 68 69 73 20 73 75 62 73 74 20 77 61 73 20 6c  This subst was l
10c70 65 66 74 20 69 6e 20 6f 6e 6c 79 20 62 65 63 61  eft in only beca
10c80 75 73 65 20 74 68 65 20 54 43 4c 5f 44 4c 5f 4c  use the TCL_DL_L
10c90 49 42 53 0a 20 20 20 20 23 20 65 6e 74 72 79 20  IBS.    # entry 
10ca0 69 6e 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68 20  in tclConfig.sh 
10cb0 75 73 65 73 20 69 74 2e 20 49 74 20 69 73 20 6e  uses it. It is n
10cc0 6f 74 20 63 6c 65 61 72 20 77 68 79 20 73 6f 6d  ot clear why som
10cd0 65 6f 6e 65 0a 20 20 20 20 23 20 77 6f 75 6c 64  eone.    # would
10ce0 20 75 73 65 20 54 43 4c 5f 44 4c 5f 4c 49 42 53   use TCL_DL_LIBS
10cf0 20 69 6e 73 74 65 61 64 20 6f 66 20 54 43 4c 5f   instead of TCL_
10d00 4c 49 42 53 2e 0a 20 20 20 20 41 43 5f 53 55 42  LIBS..    AC_SUB
10d10 53 54 28 44 4c 5f 4c 49 42 53 29 0a 0a 20 20 20  ST(DL_LIBS)..   
10d20 20 41 43 5f 53 55 42 53 54 28 44 4c 5f 4f 42 4a   AC_SUBST(DL_OBJ
10d30 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  S).    AC_SUBST(
10d40 50 4c 41 54 5f 4f 42 4a 53 29 0a 20 20 20 20 41  PLAT_OBJS).    A
10d50 43 5f 53 55 42 53 54 28 50 4c 41 54 5f 53 52 43  C_SUBST(PLAT_SRC
10d60 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  S).    AC_SUBST(
10d70 4c 44 41 49 58 5f 53 52 43 29 0a 20 20 20 20 41  LDAIX_SRC).    A
10d80 43 5f 53 55 42 53 54 28 43 46 4c 41 47 53 29 0a  C_SUBST(CFLAGS).
10d90 20 20 20 20 41 43 5f 53 55 42 53 54 28 43 46 4c      AC_SUBST(CFL
10da0 41 47 53 5f 44 45 42 55 47 29 0a 20 20 20 20 41  AGS_DEBUG).    A
10db0 43 5f 53 55 42 53 54 28 43 46 4c 41 47 53 5f 4f  C_SUBST(CFLAGS_O
10dc0 50 54 49 4d 49 5a 45 29 0a 20 20 20 20 41 43 5f  PTIMIZE).    AC_
10dd0 53 55 42 53 54 28 43 46 4c 41 47 53 5f 57 41 52  SUBST(CFLAGS_WAR
10de0 4e 49 4e 47 29 0a 0a 20 20 20 20 41 43 5f 53 55  NING)..    AC_SU
10df0 42 53 54 28 4c 44 46 4c 41 47 53 29 0a 20 20 20  BST(LDFLAGS).   
10e00 20 41 43 5f 53 55 42 53 54 28 4c 44 46 4c 41 47   AC_SUBST(LDFLAG
10e10 53 5f 44 45 42 55 47 29 0a 20 20 20 20 41 43 5f  S_DEBUG).    AC_
10e20 53 55 42 53 54 28 4c 44 46 4c 41 47 53 5f 4f 50  SUBST(LDFLAGS_OP
10e30 54 49 4d 49 5a 45 29 0a 20 20 20 20 41 43 5f 53  TIMIZE).    AC_S
10e40 55 42 53 54 28 43 43 5f 53 45 41 52 43 48 5f 46  UBST(CC_SEARCH_F
10e50 4c 41 47 53 29 0a 20 20 20 20 41 43 5f 53 55 42  LAGS).    AC_SUB
10e60 53 54 28 4c 44 5f 53 45 41 52 43 48 5f 46 4c 41  ST(LD_SEARCH_FLA
10e70 47 53 29 0a 0a 20 20 20 20 41 43 5f 53 55 42 53  GS)..    AC_SUBS
10e80 54 28 53 54 4c 49 42 5f 4c 44 29 0a 20 20 20 20  T(STLIB_LD).    
10e90 41 43 5f 53 55 42 53 54 28 53 48 4c 49 42 5f 4c  AC_SUBST(SHLIB_L
10ea0 44 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  D).    AC_SUBST(
10eb0 54 43 4c 5f 53 48 4c 49 42 5f 4c 44 5f 45 58 54  TCL_SHLIB_LD_EXT
10ec0 52 41 53 29 0a 20 20 20 20 41 43 5f 53 55 42 53  RAS).    AC_SUBS
10ed0 54 28 54 4b 5f 53 48 4c 49 42 5f 4c 44 5f 45 58  T(TK_SHLIB_LD_EX
10ee0 54 52 41 53 29 0a 20 20 20 20 41 43 5f 53 55 42  TRAS).    AC_SUB
10ef0 53 54 28 53 48 4c 49 42 5f 4c 44 5f 4c 49 42 53  ST(SHLIB_LD_LIBS
10f00 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 53  ).    AC_SUBST(S
10f10 48 4c 49 42 5f 43 46 4c 41 47 53 29 0a 20 20 20  HLIB_CFLAGS).   
10f20 20 41 43 5f 53 55 42 53 54 28 53 48 4c 49 42 5f   AC_SUBST(SHLIB_
10f30 53 55 46 46 49 58 29 0a 20 20 20 20 41 43 5f 44  SUFFIX).    AC_D
10f40 45 46 49 4e 45 5f 55 4e 51 55 4f 54 45 44 28 54  EFINE_UNQUOTED(T
10f50 43 4c 5f 53 48 4c 49 42 5f 45 58 54 2c 22 24 7b  CL_SHLIB_EXT,"${
10f60 53 48 4c 49 42 5f 53 55 46 46 49 58 7d 22 2c 0a  SHLIB_SUFFIX}",.
10f70 09 5b 57 68 61 74 20 69 73 20 74 68 65 20 64 65  .[What is the de
10f80 66 61 75 6c 74 20 65 78 74 65 6e 73 69 6f 6e 20  fault extension 
10f90 66 6f 72 20 73 68 61 72 65 64 20 6c 69 62 72 61  for shared libra
10fa0 72 69 65 73 3f 5d 29 0a 0a 20 20 20 20 41 43 5f  ries?])..    AC_
10fb0 53 55 42 53 54 28 4d 41 4b 45 5f 4c 49 42 29 0a  SUBST(MAKE_LIB).
10fc0 20 20 20 20 41 43 5f 53 55 42 53 54 28 4d 41 4b      AC_SUBST(MAK
10fd0 45 5f 53 54 55 42 5f 4c 49 42 29 0a 20 20 20 20  E_STUB_LIB).    
10fe0 41 43 5f 53 55 42 53 54 28 49 4e 53 54 41 4c 4c  AC_SUBST(INSTALL
10ff0 5f 4c 49 42 29 0a 20 20 20 20 41 43 5f 53 55 42  _LIB).    AC_SUB
11000 53 54 28 44 4c 4c 5f 49 4e 53 54 41 4c 4c 5f 44  ST(DLL_INSTALL_D
11010 49 52 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54  IR).    AC_SUBST
11020 28 49 4e 53 54 41 4c 4c 5f 53 54 55 42 5f 4c 49  (INSTALL_STUB_LI
11030 42 29 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28  B).    AC_SUBST(
11040 52 41 4e 4c 49 42 29 0a 5d 29 0a 0a 23 2d 2d 2d  RANLIB).])..#---
11050 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11060 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11070 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11080 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11090 2d 0a 23 20 53 43 5f 4d 49 53 53 49 4e 47 5f 50  -.# SC_MISSING_P
110a0 4f 53 49 58 5f 48 45 41 44 45 52 53 0a 23 0a 23  OSIX_HEADERS.#.#
110b0 09 53 75 70 70 6c 79 20 73 75 62 73 74 69 74 75  .Supply substitu
110c0 74 65 73 20 66 6f 72 20 6d 69 73 73 69 6e 67 20  tes for missing 
110d0 50 4f 53 49 58 20 68 65 61 64 65 72 20 66 69 6c  POSIX header fil
110e0 65 73 2e 20 20 53 70 65 63 69 61 6c 0a 23 09 6e  es.  Special.#.n
110f0 6f 74 65 73 3a 0a 23 09 20 20 20 20 2d 20 73 74  otes:.#.    - st
11100 64 6c 69 62 2e 68 20 64 6f 65 73 6e 27 74 20 64  dlib.h doesn't d
11110 65 66 69 6e 65 20 73 74 72 74 6f 6c 2c 20 73 74  efine strtol, st
11120 72 74 6f 75 6c 2c 20 6f 72 0a 23 09 20 20 20 20  rtoul, or.#.    
11130 20 20 73 74 72 74 6f 64 20 69 6e 73 6f 6d 65 20    strtod insome 
11140 76 65 72 73 69 6f 6e 73 20 6f 66 20 53 75 6e 4f  versions of SunO
11150 53 0a 23 09 20 20 20 20 2d 20 73 6f 6d 65 20 76  S.#.    - some v
11160 65 72 73 69 6f 6e 73 20 6f 66 20 73 74 72 69 6e  ersions of strin
11170 67 2e 68 20 64 6f 6e 27 74 20 64 65 63 6c 61 72  g.h don't declar
11180 65 20 70 72 6f 63 65 64 75 72 65 73 20 73 75 63  e procedures suc
11190 68 0a 23 09 20 20 20 20 20 20 61 73 20 73 74 72  h.#.      as str
111a0 73 74 72 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74  str.#.# Argument
111b0 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65  s:.#.none.#.# Re
111c0 73 75 6c 74 73 3a 0a 23 0a 23 09 44 65 66 69 6e  sults:.#.#.Defin
111d0 65 73 20 73 6f 6d 65 20 6f 66 20 74 68 65 20 66  es some of the f
111e0 6f 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23  ollowing vars:.#
111f0 09 09 4e 4f 5f 44 49 52 45 4e 54 5f 48 0a 23 09  ..NO_DIRENT_H.#.
11200 09 4e 4f 5f 56 41 4c 55 45 53 5f 48 0a 23 09 09  .NO_VALUES_H.#..
11210 48 41 56 45 5f 4c 49 4d 49 54 53 5f 48 20 6f 72  HAVE_LIMITS_H or
11220 20 4e 4f 5f 4c 49 4d 49 54 53 5f 48 0a 23 09 09   NO_LIMITS_H.#..
11230 4e 4f 5f 53 54 44 4c 49 42 5f 48 0a 23 09 09 4e  NO_STDLIB_H.#..N
11240 4f 5f 53 54 52 49 4e 47 5f 48 0a 23 09 09 4e 4f  O_STRING_H.#..NO
11250 5f 53 59 53 5f 57 41 49 54 5f 48 0a 23 09 09 4e  _SYS_WAIT_H.#..N
11260 4f 5f 44 4c 46 43 4e 5f 48 0a 23 09 09 48 41 56  O_DLFCN_H.#..HAV
11270 45 5f 53 59 53 5f 50 41 52 41 4d 5f 48 0a 23 0a  E_SYS_PARAM_H.#.
11280 23 09 09 48 41 56 45 5f 53 54 52 49 4e 47 5f 48  #..HAVE_STRING_H
11290 20 3f 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   ?.#.#----------
112a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
112b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
112c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
112d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44  ----------..AC_D
112e0 45 46 55 4e 28 5b 53 43 5f 4d 49 53 53 49 4e 47  EFUN([SC_MISSING
112f0 5f 50 4f 53 49 58 5f 48 45 41 44 45 52 53 5d 2c  _POSIX_HEADERS],
11300 20 5b 0a 20 20 20 20 41 43 5f 43 41 43 48 45 5f   [.    AC_CACHE_
11310 43 48 45 43 4b 28 5b 64 69 72 65 6e 74 2e 68 5d  CHECK([dirent.h]
11320 2c 20 74 63 6c 5f 63 76 5f 64 69 72 65 6e 74 5f  , tcl_cv_dirent_
11330 68 2c 20 5b 0a 20 20 20 20 41 43 5f 54 52 59 5f  h, [.    AC_TRY_
11340 4c 49 4e 4b 28 5b 23 69 6e 63 6c 75 64 65 20 3c  LINK([#include <
11350 73 79 73 2f 74 79 70 65 73 2e 68 3e 0a 23 69 6e  sys/types.h>.#in
11360 63 6c 75 64 65 20 3c 64 69 72 65 6e 74 2e 68 3e  clude <dirent.h>
11370 5d 2c 20 5b 0a 23 69 66 6e 64 65 66 20 5f 50 4f  ], [.#ifndef _PO
11380 53 49 58 5f 53 4f 55 52 43 45 0a 23 20 20 20 69  SIX_SOURCE.#   i
11390 66 64 65 66 20 5f 5f 4c 79 6e 78 5f 5f 0a 09 2f  fdef __Lynx__../
113a0 2a 0a 09 20 2a 20 47 65 6e 65 72 61 74 65 20 63  *.. * Generate c
113b0 6f 6d 70 69 6c 61 74 69 6f 6e 20 65 72 72 6f 72  ompilation error
113c0 20 74 6f 20 6d 61 6b 65 20 74 68 65 20 74 65 73   to make the tes
113d0 74 20 66 61 69 6c 3a 20 20 4c 79 6e 78 20 68 65  t fail:  Lynx he
113e0 61 64 65 72 73 0a 09 20 2a 20 61 72 65 20 6f 6e  aders.. * are on
113f0 6c 79 20 76 61 6c 69 64 20 69 66 20 72 65 61 6c  ly valid if real
11400 6c 79 20 69 6e 20 74 68 65 20 50 4f 53 49 58 20  ly in the POSIX 
11410 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 0a 09 20 2a  environment... *
11420 2f 0a 0a 09 6d 69 73 73 69 6e 67 5f 70 72 6f 63  /...missing_proc
11430 65 64 75 72 65 28 29 3b 0a 23 20 20 20 65 6e 64  edure();.#   end
11440 69 66 0a 23 65 6e 64 69 66 0a 44 49 52 20 2a 64  if.#endif.DIR *d
11450 3b 0a 73 74 72 75 63 74 20 64 69 72 65 6e 74 20  ;.struct dirent 
11460 2a 65 6e 74 72 79 50 74 72 3b 0a 63 68 61 72 20  *entryPtr;.char 
11470 2a 70 3b 0a 64 20 3d 20 6f 70 65 6e 64 69 72 28  *p;.d = opendir(
11480 22 66 6f 6f 62 61 72 22 29 3b 0a 65 6e 74 72 79  "foobar");.entry
11490 50 74 72 20 3d 20 72 65 61 64 64 69 72 28 64 29  Ptr = readdir(d)
114a0 3b 0a 70 20 3d 20 65 6e 74 72 79 50 74 72 2d 3e  ;.p = entryPtr->
114b0 64 5f 6e 61 6d 65 3b 0a 63 6c 6f 73 65 64 69 72  d_name;.closedir
114c0 28 64 29 3b 0a 5d 2c 20 74 63 6c 5f 63 76 5f 64  (d);.], tcl_cv_d
114d0 69 72 65 6e 74 5f 68 3d 79 65 73 2c 20 74 63 6c  irent_h=yes, tcl
114e0 5f 63 76 5f 64 69 72 65 6e 74 5f 68 3d 6e 6f 29  _cv_dirent_h=no)
114f0 5d 29 0a 0a 20 20 20 20 69 66 20 74 65 73 74 20  ])..    if test 
11500 24 74 63 6c 5f 63 76 5f 64 69 72 65 6e 74 5f 68  $tcl_cv_dirent_h
11510 20 3d 20 6e 6f 3b 20 74 68 65 6e 0a 09 41 43 5f   = no; then..AC_
11520 44 45 46 49 4e 45 28 4e 4f 5f 44 49 52 45 4e 54  DEFINE(NO_DIRENT
11530 5f 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68 61  _H, 1, [Do we ha
11540 76 65 20 3c 64 69 72 65 6e 74 2e 68 3e 3f 5d 29  ve <dirent.h>?])
11550 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 41 43 5f  .    fi..    AC_
11560 43 48 45 43 4b 5f 48 45 41 44 45 52 28 66 6c 6f  CHECK_HEADER(flo
11570 61 74 2e 68 2c 20 2c 20 5b 41 43 5f 44 45 46 49  at.h, , [AC_DEFI
11580 4e 45 28 4e 4f 5f 46 4c 4f 41 54 5f 48 2c 20 31  NE(NO_FLOAT_H, 1
11590 2c 20 5b 44 6f 20 77 65 20 68 61 76 65 20 3c 66  , [Do we have <f
115a0 6c 6f 61 74 2e 68 3e 3f 5d 29 5d 29 0a 20 20 20  loat.h>?])]).   
115b0 20 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45 52   AC_CHECK_HEADER
115c0 28 76 61 6c 75 65 73 2e 68 2c 20 2c 20 5b 41 43  (values.h, , [AC
115d0 5f 44 45 46 49 4e 45 28 4e 4f 5f 56 41 4c 55 45  _DEFINE(NO_VALUE
115e0 53 5f 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68  S_H, 1, [Do we h
115f0 61 76 65 20 3c 76 61 6c 75 65 73 2e 68 3e 3f 5d  ave <values.h>?]
11600 29 5d 29 0a 20 20 20 20 41 43 5f 43 48 45 43 4b  )]).    AC_CHECK
11610 5f 48 45 41 44 45 52 28 6c 69 6d 69 74 73 2e 68  _HEADER(limits.h
11620 2c 0a 09 5b 41 43 5f 44 45 46 49 4e 45 28 48 41  ,..[AC_DEFINE(HA
11630 56 45 5f 4c 49 4d 49 54 53 5f 48 2c 20 31 2c 20  VE_LIMITS_H, 1, 
11640 5b 44 6f 20 77 65 20 68 61 76 65 20 3c 6c 69 6d  [Do we have <lim
11650 69 74 73 2e 68 3e 3f 5d 29 5d 2c 0a 09 5b 41 43  its.h>?])],..[AC
11660 5f 44 45 46 49 4e 45 28 4e 4f 5f 4c 49 4d 49 54  _DEFINE(NO_LIMIT
11670 53 5f 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68  S_H, 1, [Do we h
11680 61 76 65 20 3c 6c 69 6d 69 74 73 2e 68 3e 3f 5d  ave <limits.h>?]
11690 29 5d 29 0a 20 20 20 20 41 43 5f 43 48 45 43 4b  )]).    AC_CHECK
116a0 5f 48 45 41 44 45 52 28 73 74 64 6c 69 62 2e 68  _HEADER(stdlib.h
116b0 2c 20 74 63 6c 5f 6f 6b 3d 31 2c 20 74 63 6c 5f  , tcl_ok=1, tcl_
116c0 6f 6b 3d 30 29 0a 20 20 20 20 41 43 5f 45 47 52  ok=0).    AC_EGR
116d0 45 50 5f 48 45 41 44 45 52 28 73 74 72 74 6f 6c  EP_HEADER(strtol
116e0 2c 20 73 74 64 6c 69 62 2e 68 2c 20 2c 20 74 63  , stdlib.h, , tc
116f0 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 41 43 5f 45  l_ok=0).    AC_E
11700 47 52 45 50 5f 48 45 41 44 45 52 28 73 74 72 74  GREP_HEADER(strt
11710 6f 75 6c 2c 20 73 74 64 6c 69 62 2e 68 2c 20 2c  oul, stdlib.h, ,
11720 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 41   tcl_ok=0).    A
11730 43 5f 45 47 52 45 50 5f 48 45 41 44 45 52 28 73  C_EGREP_HEADER(s
11740 74 72 74 6f 64 2c 20 73 74 64 6c 69 62 2e 68 2c  trtod, stdlib.h,
11750 20 2c 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20   , tcl_ok=0).   
11760 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f 6f 6b   if test $tcl_ok
11770 20 3d 20 30 3b 20 74 68 65 6e 0a 09 41 43 5f 44   = 0; then..AC_D
11780 45 46 49 4e 45 28 4e 4f 5f 53 54 44 4c 49 42 5f  EFINE(NO_STDLIB_
11790 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68 61 76  H, 1, [Do we hav
117a0 65 20 3c 73 74 64 6c 69 62 2e 68 3e 3f 5d 29 0a  e <stdlib.h>?]).
117b0 20 20 20 20 66 69 0a 20 20 20 20 41 43 5f 43 48      fi.    AC_CH
117c0 45 43 4b 5f 48 45 41 44 45 52 28 73 74 72 69 6e  ECK_HEADER(strin
117d0 67 2e 68 2c 20 74 63 6c 5f 6f 6b 3d 31 2c 20 74  g.h, tcl_ok=1, t
117e0 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 41 43 5f  cl_ok=0).    AC_
117f0 45 47 52 45 50 5f 48 45 41 44 45 52 28 73 74 72  EGREP_HEADER(str
11800 73 74 72 2c 20 73 74 72 69 6e 67 2e 68 2c 20 2c  str, string.h, ,
11810 20 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 41   tcl_ok=0).    A
11820 43 5f 45 47 52 45 50 5f 48 45 41 44 45 52 28 73  C_EGREP_HEADER(s
11830 74 72 65 72 72 6f 72 2c 20 73 74 72 69 6e 67 2e  trerror, string.
11840 68 2c 20 2c 20 74 63 6c 5f 6f 6b 3d 30 29 0a 0a  h, , tcl_ok=0)..
11850 20 20 20 20 23 20 53 65 65 20 61 6c 73 6f 20 6d      # See also m
11860 65 6d 6d 6f 76 65 20 63 68 65 63 6b 20 62 65 6c  emmove check bel
11870 6f 77 20 66 6f 72 20 61 20 70 6c 61 63 65 20 77  ow for a place w
11880 68 65 72 65 20 4e 4f 5f 53 54 52 49 4e 47 5f 48  here NO_STRING_H
11890 20 63 61 6e 20 62 65 0a 20 20 20 20 23 20 73 65   can be.    # se
118a0 74 20 61 6e 64 20 77 68 79 2e 0a 0a 20 20 20 20  t and why...    
118b0 69 66 20 74 65 73 74 20 24 74 63 6c 5f 6f 6b 20  if test $tcl_ok 
118c0 3d 20 30 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45  = 0; then..AC_DE
118d0 46 49 4e 45 28 4e 4f 5f 53 54 52 49 4e 47 5f 48  FINE(NO_STRING_H
118e0 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68 61 76 65  , 1, [Do we have
118f0 20 3c 73 74 72 69 6e 67 2e 68 3e 3f 5d 29 0a 20   <string.h>?]). 
11900 20 20 20 66 69 0a 0a 20 20 20 20 41 43 5f 43 48     fi..    AC_CH
11910 45 43 4b 5f 48 45 41 44 45 52 28 73 79 73 2f 77  ECK_HEADER(sys/w
11920 61 69 74 2e 68 2c 20 2c 20 5b 41 43 5f 44 45 46  ait.h, , [AC_DEF
11930 49 4e 45 28 4e 4f 5f 53 59 53 5f 57 41 49 54 5f  INE(NO_SYS_WAIT_
11940 48 2c 20 31 2c 20 5b 44 6f 20 77 65 20 68 61 76  H, 1, [Do we hav
11950 65 20 3c 73 79 73 2f 77 61 69 74 2e 68 3e 3f 5d  e <sys/wait.h>?]
11960 29 5d 29 0a 20 20 20 20 41 43 5f 43 48 45 43 4b  )]).    AC_CHECK
11970 5f 48 45 41 44 45 52 28 64 6c 66 63 6e 2e 68 2c  _HEADER(dlfcn.h,
11980 20 2c 20 5b 41 43 5f 44 45 46 49 4e 45 28 4e 4f   , [AC_DEFINE(NO
11990 5f 44 4c 46 43 4e 5f 48 2c 20 31 2c 20 5b 44 6f  _DLFCN_H, 1, [Do
119a0 20 77 65 20 68 61 76 65 20 3c 64 6c 66 63 6e 2e   we have <dlfcn.
119b0 68 3e 3f 5d 29 5d 29 0a 0a 20 20 20 20 23 20 4f  h>?])])..    # O
119c0 53 2f 33 39 30 20 6c 61 63 6b 73 20 73 79 73 2f  S/390 lacks sys/
119d0 70 61 72 61 6d 2e 68 20 28 61 6e 64 20 64 6f 65  param.h (and doe
119e0 73 6e 27 74 20 6e 65 65 64 20 69 74 2c 20 62 79  sn't need it, by
119f0 20 63 68 61 6e 63 65 29 2e 0a 20 20 20 20 41 43   chance)..    AC
11a00 5f 48 41 56 45 5f 48 45 41 44 45 52 53 28 73 79  _HAVE_HEADERS(sy
11a10 73 2f 70 61 72 61 6d 2e 68 29 0a 5d 29 0a 0a 23  s/param.h).])..#
11a20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11a30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11a40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11a50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11a60 2d 2d 2d 2d 0a 23 20 53 43 5f 50 41 54 48 5f 58  ----.# SC_PATH_X
11a70 0a 23 0a 23 09 4c 6f 63 61 74 65 20 74 68 65 20  .#.#.Locate the 
11a80 58 31 31 20 68 65 61 64 65 72 20 66 69 6c 65 73  X11 header files
11a90 20 61 6e 64 20 74 68 65 20 58 31 31 20 6c 69 62   and the X11 lib
11aa0 72 61 72 79 20 61 72 63 68 69 76 65 2e 20 20 54  rary archive.  T
11ab0 72 79 0a 23 09 74 68 65 20 61 63 5f 70 61 74 68  ry.#.the ac_path
11ac0 5f 78 20 6d 61 63 72 6f 20 66 69 72 73 74 2c 20  _x macro first, 
11ad0 62 75 74 20 69 66 20 69 74 20 64 6f 65 73 6e 27  but if it doesn'
11ae0 74 20 66 69 6e 64 20 74 68 65 20 58 20 73 74 75  t find the X stu
11af0 66 66 0a 23 09 28 65 2e 67 2e 20 62 65 63 61 75  ff.#.(e.g. becau
11b00 73 65 20 74 68 65 72 65 27 73 20 6e 6f 20 78 6d  se there's no xm
11b10 6b 6d 66 20 70 72 6f 67 72 61 6d 29 20 74 68 65  kmf program) the
11b20 6e 20 63 68 65 63 6b 20 74 68 72 6f 75 67 68 0a  n check through.
11b30 23 09 61 20 6c 69 73 74 20 6f 66 20 70 6f 73 73  #.a list of poss
11b40 69 62 6c 65 20 64 69 72 65 63 74 6f 72 69 65 73  ible directories
11b50 2e 20 20 55 6e 64 65 72 20 73 6f 6d 65 20 63 6f  .  Under some co
11b60 6e 64 69 74 69 6f 6e 73 20 74 68 65 0a 23 09 61  nditions the.#.a
11b70 75 74 6f 63 6f 6e 66 20 6d 61 63 72 6f 20 77 69  utoconf macro wi
11b80 6c 6c 20 72 65 74 75 72 6e 20 61 6e 20 69 6e 63  ll return an inc
11b90 6c 75 64 65 20 64 69 72 65 63 74 6f 72 79 20 74  lude directory t
11ba0 68 61 74 20 63 6f 6e 74 61 69 6e 73 0a 23 09 6e  hat contains.#.n
11bb0 6f 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 73 2c  o include files,
11bc0 20 73 6f 20 64 6f 75 62 6c 65 2d 63 68 65 63 6b   so double-check
11bd0 20 69 74 73 20 72 65 73 75 6c 74 20 6a 75 73 74   its result just
11be0 20 74 6f 20 62 65 20 73 61 66 65 2e 0a 23 0a 23   to be safe..#.#
11bf0 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f   Arguments:.#.no
11c00 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a  ne.#.# Results:.
11c10 23 0a 23 09 53 65 74 73 20 74 68 65 20 66 6f 6c  #.#.Sets the fol
11c20 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
11c30 58 49 4e 43 4c 55 44 45 53 0a 23 09 09 58 4c 49  XINCLUDES.#..XLI
11c40 42 53 57 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  BSW.#.#---------
11c50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11c60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11c70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11c80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f  -----------..AC_
11c90 44 45 46 55 4e 28 5b 53 43 5f 50 41 54 48 5f 58  DEFUN([SC_PATH_X
11ca0 5d 2c 20 5b 0a 20 20 20 20 41 43 5f 50 41 54 48  ], [.    AC_PATH
11cb0 5f 58 0a 20 20 20 20 6e 6f 74 5f 72 65 61 6c 6c  _X.    not_reall
11cc0 79 5f 74 68 65 72 65 3d 22 22 0a 20 20 20 20 69  y_there="".    i
11cd0 66 20 74 65 73 74 20 22 24 6e 6f 5f 78 22 20 3d  f test "$no_x" =
11ce0 20 22 22 3b 20 74 68 65 6e 0a 09 69 66 20 74 65   ""; then..if te
11cf0 73 74 20 22 24 78 5f 69 6e 63 6c 75 64 65 73 22  st "$x_includes"
11d00 20 3d 20 22 22 3b 20 74 68 65 6e 0a 09 20 20 20   = ""; then..   
11d10 20 41 43 5f 54 52 59 5f 43 50 50 28 5b 23 69 6e   AC_TRY_CPP([#in
11d20 63 6c 75 64 65 20 3c 58 31 31 2f 58 6c 69 62 2e  clude <X11/Xlib.
11d30 68 3e 5d 2c 20 2c 20 6e 6f 74 5f 72 65 61 6c 6c  h>], , not_reall
11d40 79 5f 74 68 65 72 65 3d 22 79 65 73 22 29 0a 09  y_there="yes")..
11d50 65 6c 73 65 0a 09 20 20 20 20 69 66 20 74 65 73  else..    if tes
11d60 74 20 21 20 2d 72 20 24 78 5f 69 6e 63 6c 75 64  t ! -r $x_includ
11d70 65 73 2f 58 31 31 2f 58 6c 69 62 2e 68 3b 20 74  es/X11/Xlib.h; t
11d80 68 65 6e 0a 09 09 6e 6f 74 5f 72 65 61 6c 6c 79  hen...not_really
11d90 5f 74 68 65 72 65 3d 22 79 65 73 22 0a 09 20 20  _there="yes"..  
11da0 20 20 66 69 0a 09 66 69 0a 20 20 20 20 66 69 0a    fi..fi.    fi.
11db0 20 20 20 20 69 66 20 74 65 73 74 20 22 24 6e 6f      if test "$no
11dc0 5f 78 22 20 3d 20 22 79 65 73 22 20 2d 6f 20 22  _x" = "yes" -o "
11dd0 24 6e 6f 74 5f 72 65 61 6c 6c 79 5f 74 68 65 72  $not_really_ther
11de0 65 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e  e" = "yes"; then
11df0 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e  ..AC_MSG_CHECKIN
11e00 47 28 5b 66 6f 72 20 58 31 31 20 68 65 61 64 65  G([for X11 heade
11e10 72 20 66 69 6c 65 73 5d 29 0a 09 66 6f 75 6e 64  r files])..found
11e20 5f 78 69 6e 63 6c 75 64 65 73 3d 22 6e 6f 22 0a  _xincludes="no".
11e30 09 41 43 5f 54 52 59 5f 43 50 50 28 5b 23 69 6e  .AC_TRY_CPP([#in
11e40 63 6c 75 64 65 20 3c 58 31 31 2f 58 6c 69 62 2e  clude <X11/Xlib.
11e50 68 3e 5d 2c 20 66 6f 75 6e 64 5f 78 69 6e 63 6c  h>], found_xincl
11e60 75 64 65 73 3d 22 79 65 73 22 2c 20 66 6f 75 6e  udes="yes", foun
11e70 64 5f 78 69 6e 63 6c 75 64 65 73 3d 22 6e 6f 22  d_xincludes="no"
11e80 29 0a 09 69 66 20 74 65 73 74 20 22 24 66 6f 75  )..if test "$fou
11e90 6e 64 5f 78 69 6e 63 6c 75 64 65 73 22 20 3d 20  nd_xincludes" = 
11ea0 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 20 20 20 20  "no"; then..    
11eb0 64 69 72 73 3d 22 2f 75 73 72 2f 75 6e 73 75 70  dirs="/usr/unsup
11ec0 70 6f 72 74 65 64 2f 69 6e 63 6c 75 64 65 20 2f  ported/include /
11ed0 75 73 72 2f 6c 6f 63 61 6c 2f 69 6e 63 6c 75 64  usr/local/includ
11ee0 65 20 2f 75 73 72 2f 58 33 38 36 2f 69 6e 63 6c  e /usr/X386/incl
11ef0 75 64 65 20 2f 75 73 72 2f 58 31 31 52 36 2f 69  ude /usr/X11R6/i
11f00 6e 63 6c 75 64 65 20 2f 75 73 72 2f 58 31 31 52  nclude /usr/X11R
11f10 35 2f 69 6e 63 6c 75 64 65 20 2f 75 73 72 2f 69  5/include /usr/i
11f20 6e 63 6c 75 64 65 2f 58 31 31 52 35 20 2f 75 73  nclude/X11R5 /us
11f30 72 2f 69 6e 63 6c 75 64 65 2f 58 31 31 52 34 20  r/include/X11R4 
11f40 2f 75 73 72 2f 6f 70 65 6e 77 69 6e 2f 69 6e 63  /usr/openwin/inc
11f50 6c 75 64 65 20 2f 75 73 72 2f 58 31 31 2f 69 6e  lude /usr/X11/in
11f60 63 6c 75 64 65 20 2f 75 73 72 2f 73 77 77 2f 69  clude /usr/sww/i
11f70 6e 63 6c 75 64 65 22 0a 09 20 20 20 20 66 6f 72  nclude"..    for
11f80 20 69 20 69 6e 20 24 64 69 72 73 20 3b 20 64 6f   i in $dirs ; do
11f90 0a 09 09 69 66 20 74 65 73 74 20 2d 72 20 24 69  ...if test -r $i
11fa0 2f 58 31 31 2f 58 6c 69 62 2e 68 3b 20 74 68 65  /X11/Xlib.h; the
11fb0 6e 0a 09 09 20 20 20 20 41 43 5f 4d 53 47 5f 52  n...    AC_MSG_R
11fc0 45 53 55 4c 54 28 5b 24 69 5d 29 0a 09 09 20 20  ESULT([$i])...  
11fd0 20 20 58 49 4e 43 4c 55 44 45 53 3d 22 20 2d 49    XINCLUDES=" -I
11fe0 24 69 22 0a 09 09 20 20 20 20 66 6f 75 6e 64 5f  $i"...    found_
11ff0 78 69 6e 63 6c 75 64 65 73 3d 22 79 65 73 22 0a  xincludes="yes".
12000 09 09 20 20 20 20 62 72 65 61 6b 0a 09 09 66 69  ..    break...fi
12010 0a 09 20 20 20 20 64 6f 6e 65 0a 09 66 69 0a 20  ..    done..fi. 
12020 20 20 20 65 6c 73 65 0a 09 69 66 20 74 65 73 74     else..if test
12030 20 22 24 78 5f 69 6e 63 6c 75 64 65 73 22 20 21   "$x_includes" !
12040 3d 20 22 22 3b 20 74 68 65 6e 0a 09 20 20 20 20  = ""; then..    
12050 58 49 4e 43 4c 55 44 45 53 3d 22 2d 49 24 78 5f  XINCLUDES="-I$x_
12060 69 6e 63 6c 75 64 65 73 22 0a 09 20 20 20 20 66  includes"..    f
12070 6f 75 6e 64 5f 78 69 6e 63 6c 75 64 65 73 3d 22  ound_xincludes="
12080 79 65 73 22 0a 09 66 69 0a 20 20 20 20 66 69 0a  yes"..fi.    fi.
12090 20 20 20 20 69 66 20 74 65 73 74 20 22 24 66 6f      if test "$fo
120a0 75 6e 64 5f 78 69 6e 63 6c 75 64 65 73 22 20 3d  und_xincludes" =
120b0 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 41 43 5f   "no"; then..AC_
120c0 4d 53 47 5f 52 45 53 55 4c 54 28 5b 63 6f 75 6c  MSG_RESULT([coul
120d0 64 6e 27 74 20 66 69 6e 64 20 61 6e 79 21 5d 29  dn't find any!])
120e0 0a 20 20 20 20 66 69 0a 0a 20 20 20 20 69 66 20  .    fi..    if 
120f0 74 65 73 74 20 22 24 6e 6f 5f 78 22 20 3d 20 79  test "$no_x" = y
12100 65 73 3b 20 74 68 65 6e 0a 09 41 43 5f 4d 53 47  es; then..AC_MSG
12110 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 58  _CHECKING([for X
12120 31 31 20 6c 69 62 72 61 72 69 65 73 5d 29 0a 09  11 libraries])..
12130 58 4c 49 42 53 57 3d 6e 6f 70 65 0a 09 64 69 72  XLIBSW=nope..dir
12140 73 3d 22 2f 75 73 72 2f 75 6e 73 75 70 70 6f 72  s="/usr/unsuppor
12150 74 65 64 2f 6c 69 62 20 2f 75 73 72 2f 6c 6f 63  ted/lib /usr/loc
12160 61 6c 2f 6c 69 62 20 2f 75 73 72 2f 58 33 38 36  al/lib /usr/X386
12170 2f 6c 69 62 20 2f 75 73 72 2f 58 31 31 52 36 2f  /lib /usr/X11R6/
12180 6c 69 62 20 2f 75 73 72 2f 58 31 31 52 35 2f 6c  lib /usr/X11R5/l
12190 69 62 20 2f 75 73 72 2f 6c 69 62 2f 58 31 31 52  ib /usr/lib/X11R
121a0 35 20 2f 75 73 72 2f 6c 69 62 2f 58 31 31 52 34  5 /usr/lib/X11R4
121b0 20 2f 75 73 72 2f 6f 70 65 6e 77 69 6e 2f 6c 69   /usr/openwin/li
121c0 62 20 2f 75 73 72 2f 58 31 31 2f 6c 69 62 20 2f  b /usr/X11/lib /
121d0 75 73 72 2f 73 77 77 2f 58 31 31 2f 6c 69 62 22  usr/sww/X11/lib"
121e0 0a 09 66 6f 72 20 69 20 69 6e 20 24 64 69 72 73  ..for i in $dirs
121f0 20 3b 20 64 6f 0a 09 20 20 20 20 69 66 20 74 65   ; do..    if te
12200 73 74 20 2d 72 20 24 69 2f 6c 69 62 58 31 31 2e  st -r $i/libX11.
12210 61 20 2d 6f 20 2d 72 20 24 69 2f 6c 69 62 58 31  a -o -r $i/libX1
12220 31 2e 73 6f 20 2d 6f 20 2d 72 20 24 69 2f 6c 69  1.so -o -r $i/li
12230 62 58 31 31 2e 73 6c 20 2d 6f 20 2d 72 20 24 69  bX11.sl -o -r $i
12240 2f 6c 69 62 58 31 31 2e 64 79 6c 69 62 3b 20 74  /libX11.dylib; t
12250 68 65 6e 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53  hen...AC_MSG_RES
12260 55 4c 54 28 5b 24 69 5d 29 0a 09 09 58 4c 49 42  ULT([$i])...XLIB
12270 53 57 3d 22 2d 4c 24 69 20 2d 6c 58 31 31 22 0a  SW="-L$i -lX11".
12280 09 09 78 5f 6c 69 62 72 61 72 69 65 73 3d 22 24  ..x_libraries="$
12290 69 22 0a 09 09 62 72 65 61 6b 0a 09 20 20 20 20  i"...break..    
122a0 66 69 0a 09 64 6f 6e 65 0a 20 20 20 20 65 6c 73  fi..done.    els
122b0 65 0a 09 69 66 20 74 65 73 74 20 22 24 78 5f 6c  e..if test "$x_l
122c0 69 62 72 61 72 69 65 73 22 20 3d 20 22 22 3b 20  ibraries" = ""; 
122d0 74 68 65 6e 0a 09 20 20 20 20 58 4c 49 42 53 57  then..    XLIBSW
122e0 3d 2d 6c 58 31 31 0a 09 65 6c 73 65 0a 09 20 20  =-lX11..else..  
122f0 20 20 58 4c 49 42 53 57 3d 22 2d 4c 24 78 5f 6c    XLIBSW="-L$x_l
12300 69 62 72 61 72 69 65 73 20 2d 6c 58 31 31 22 0a  ibraries -lX11".
12310 09 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 69  .fi.    fi.    i
12320 66 20 74 65 73 74 20 22 24 58 4c 49 42 53 57 22  f test "$XLIBSW"
12330 20 3d 20 6e 6f 70 65 20 3b 20 74 68 65 6e 0a 09   = nope ; then..
12340 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 58 77 69  AC_CHECK_LIB(Xwi
12350 6e 64 6f 77 2c 20 58 43 72 65 61 74 65 57 69 6e  ndow, XCreateWin
12360 64 6f 77 2c 20 58 4c 49 42 53 57 3d 2d 6c 58 77  dow, XLIBSW=-lXw
12370 69 6e 64 6f 77 29 0a 20 20 20 20 66 69 0a 20 20  indow).    fi.  
12380 20 20 69 66 20 74 65 73 74 20 22 24 58 4c 49 42    if test "$XLIB
12390 53 57 22 20 3d 20 6e 6f 70 65 20 3b 20 74 68 65  SW" = nope ; the
123a0 6e 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  n..AC_MSG_RESULT
123b0 28 5b 63 6f 75 6c 64 20 6e 6f 74 20 66 69 6e 64  ([could not find
123c0 20 61 6e 79 21 20 20 55 73 69 6e 67 20 2d 6c 58   any!  Using -lX
123d0 31 31 2e 5d 29 0a 09 58 4c 49 42 53 57 3d 2d 6c  11.])..XLIBSW=-l
123e0 58 31 31 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23  X11.    fi.])..#
123f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12410 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12420 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12430 2d 2d 2d 2d 0a 23 20 53 43 5f 42 4c 4f 43 4b 49  ----.# SC_BLOCKI
12440 4e 47 5f 53 54 59 4c 45 0a 23 0a 23 09 54 68 65  NG_STYLE.#.#.The
12450 20 73 74 61 74 65 6d 65 6e 74 73 20 62 65 6c 6f   statements belo
12460 77 20 63 68 65 63 6b 20 66 6f 72 20 73 79 73 74  w check for syst
12470 65 6d 73 20 77 68 65 72 65 20 50 4f 53 49 58 2d  ems where POSIX-
12480 73 74 79 6c 65 0a 23 09 6e 6f 6e 2d 62 6c 6f 63  style.#.non-bloc
12490 6b 69 6e 67 20 49 2f 4f 20 28 4f 5f 4e 4f 4e 42  king I/O (O_NONB
124a0 4c 4f 43 4b 29 20 64 6f 65 73 6e 27 74 20 77 6f  LOCK) doesn't wo
124b0 72 6b 20 6f 72 20 69 73 20 75 6e 69 6d 70 6c 65  rk or is unimple
124c0 6d 65 6e 74 65 64 2e 0a 23 09 4f 6e 20 74 68 65  mented..#.On the
124d0 73 65 20 73 79 73 74 65 6d 73 20 28 6d 6f 73 74  se systems (most
124e0 6c 79 20 6f 6c 64 65 72 20 6f 6e 65 73 29 2c 20  ly older ones), 
124f0 75 73 65 20 74 68 65 20 6f 6c 64 20 42 53 44 2d  use the old BSD-
12500 73 74 79 6c 65 0a 23 09 46 49 4f 4e 42 49 4f 20  style.#.FIONBIO 
12510 61 70 70 72 6f 61 63 68 20 69 6e 73 74 65 61 64  approach instead
12520 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a  ..#.# Arguments:
12530 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52 65 73 75  .#.none.#.# Resu
12540 6c 74 73 3a 0a 23 0a 23 09 44 65 66 69 6e 65 73  lts:.#.#.Defines
12550 20 73 6f 6d 65 20 6f 66 20 74 68 65 20 66 6f 6c   some of the fol
12560 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09  lowing vars:.#..
12570 48 41 56 45 5f 53 59 53 5f 49 4f 43 54 4c 5f 48  HAVE_SYS_IOCTL_H
12580 0a 23 09 09 48 41 56 45 5f 53 59 53 5f 46 49 4c  .#..HAVE_SYS_FIL
12590 49 4f 5f 48 0a 23 09 09 55 53 45 5f 46 49 4f 4e  IO_H.#..USE_FION
125a0 42 49 4f 0a 23 09 09 4f 5f 4e 4f 4e 42 4c 4f 43  BIO.#..O_NONBLOC
125b0 4b 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  K.#.#-----------
125c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
125d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
125e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
125f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
12600 46 55 4e 28 5b 53 43 5f 42 4c 4f 43 4b 49 4e 47  FUN([SC_BLOCKING
12610 5f 53 54 59 4c 45 5d 2c 20 5b 0a 20 20 20 20 41  _STYLE], [.    A
12620 43 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 53 28  C_CHECK_HEADERS(
12630 73 79 73 2f 69 6f 63 74 6c 2e 68 29 0a 20 20 20  sys/ioctl.h).   
12640 20 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 45 52   AC_CHECK_HEADER
12650 53 28 73 79 73 2f 66 69 6c 69 6f 2e 68 29 0a 20  S(sys/filio.h). 
12660 20 20 20 53 43 5f 43 4f 4e 46 49 47 5f 53 59 53     SC_CONFIG_SYS
12670 54 45 4d 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43  TEM.    AC_MSG_C
12680 48 45 43 4b 49 4e 47 28 5b 46 49 4f 4e 42 49 4f  HECKING([FIONBIO
12690 20 76 73 2e 20 4f 5f 4e 4f 4e 42 4c 4f 43 4b 20   vs. O_NONBLOCK 
126a0 66 6f 72 20 6e 6f 6e 62 6c 6f 63 6b 69 6e 67 20  for nonblocking 
126b0 49 2f 4f 5d 29 0a 20 20 20 20 63 61 73 65 20 24  I/O]).    case $
126c0 73 79 73 74 65 6d 20 69 6e 0a 09 4f 53 46 2a 29  system in..OSF*)
126d0 0a 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28  ..    AC_DEFINE(
126e0 55 53 45 5f 46 49 4f 4e 42 49 4f 2c 20 31 2c 20  USE_FIONBIO, 1, 
126f0 5b 53 68 6f 75 6c 64 20 77 65 20 75 73 65 20 46  [Should we use F
12700 49 4f 4e 42 49 4f 3f 5d 29 0a 09 20 20 20 20 41  IONBIO?])..    A
12710 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 46 49  C_MSG_RESULT([FI
12720 4f 4e 42 49 4f 5d 29 0a 09 20 20 20 20 3b 3b 0a  ONBIO])..    ;;.
12730 09 53 75 6e 4f 53 2d 34 2a 29 0a 09 20 20 20 20  .SunOS-4*)..    
12740 41 43 5f 44 45 46 49 4e 45 28 55 53 45 5f 46 49  AC_DEFINE(USE_FI
12750 4f 4e 42 49 4f 2c 20 31 2c 20 5b 53 68 6f 75 6c  ONBIO, 1, [Shoul
12760 64 20 77 65 20 75 73 65 20 46 49 4f 4e 42 49 4f  d we use FIONBIO
12770 3f 5d 29 0a 09 20 20 20 20 41 43 5f 4d 53 47 5f  ?])..    AC_MSG_
12780 52 45 53 55 4c 54 28 5b 46 49 4f 4e 42 49 4f 5d  RESULT([FIONBIO]
12790 29 0a 09 20 20 20 20 3b 3b 0a 09 2a 29 0a 09 20  )..    ;;..*).. 
127a0 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54     AC_MSG_RESULT
127b0 28 5b 4f 5f 4e 4f 4e 42 4c 4f 43 4b 5d 29 0a 09  ([O_NONBLOCK])..
127c0 20 20 20 20 3b 3b 0a 20 20 20 20 65 73 61 63 0a      ;;.    esac.
127d0 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ])..#-----------
127e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
127f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12800 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12810 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 54  ---------.# SC_T
12820 49 4d 45 5f 48 41 4e 4c 44 45 52 0a 23 0a 23 09  IME_HANLDER.#.#.
12830 43 68 65 63 6b 73 20 68 6f 77 20 74 68 65 20 73  Checks how the s
12840 79 73 74 65 6d 20 64 65 61 6c 73 20 77 69 74 68  ystem deals with
12850 20 74 69 6d 65 2e 68 2c 20 77 68 61 74 20 74 69   time.h, what ti
12860 6d 65 20 73 74 72 75 63 74 75 72 65 73 0a 23 09  me structures.#.
12870 61 72 65 20 75 73 65 64 20 6f 6e 20 74 68 65 20  are used on the 
12880 73 79 73 74 65 6d 2c 20 61 6e 64 20 77 68 61 74  system, and what
12890 20 66 69 65 6c 64 73 20 74 68 65 20 73 74 72 75   fields the stru
128a0 63 74 75 72 65 73 20 68 61 76 65 2e 0a 23 0a 23  ctures have..#.#
128b0 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09 6e 6f   Arguments:.#.no
128c0 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a  ne.#.# Results:.
128d0 23 0a 23 09 44 65 66 69 6e 65 73 20 73 6f 6d 65  #.#.Defines some
128e0 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e   of the followin
128f0 67 20 76 61 72 73 3a 0a 23 09 09 55 53 45 5f 44  g vars:.#..USE_D
12900 45 4c 54 41 5f 46 4f 52 5f 54 5a 0a 23 09 09 48  ELTA_FOR_TZ.#..H
12910 41 56 45 5f 54 4d 5f 47 4d 54 4f 46 46 0a 23 09  AVE_TM_GMTOFF.#.
12920 09 48 41 56 45 5f 54 4d 5f 54 5a 41 44 4a 0a 23  .HAVE_TM_TZADJ.#
12930 09 09 48 41 56 45 5f 54 49 4d 45 5a 4f 4e 45 5f  ..HAVE_TIMEZONE_
12940 56 41 52 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  VAR.#.#---------
12950 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12960 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12970 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12980 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f  -----------..AC_
12990 44 45 46 55 4e 28 5b 53 43 5f 54 49 4d 45 5f 48  DEFUN([SC_TIME_H
129a0 41 4e 44 4c 45 52 5d 2c 20 5b 0a 20 20 20 20 41  ANDLER], [.    A
129b0 43 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 53 28  C_CHECK_HEADERS(
129c0 73 79 73 2f 74 69 6d 65 2e 68 29 0a 20 20 20 20  sys/time.h).    
129d0 41 43 5f 48 45 41 44 45 52 5f 54 49 4d 45 0a 0a  AC_HEADER_TIME..
129e0 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 46 55 4e      AC_CHECK_FUN
129f0 43 53 28 67 6d 74 69 6d 65 5f 72 20 6c 6f 63 61  CS(gmtime_r loca
12a00 6c 74 69 6d 65 5f 72 20 6d 6b 74 69 6d 65 29 0a  ltime_r mktime).
12a10 0a 20 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48  .    AC_CACHE_CH
12a20 45 43 4b 28 5b 74 6d 5f 74 7a 61 64 6a 20 69 6e  ECK([tm_tzadj in
12a30 20 73 74 72 75 63 74 20 74 6d 5d 2c 20 74 63 6c   struct tm], tcl
12a40 5f 63 76 5f 6d 65 6d 62 65 72 5f 74 6d 5f 74 7a  _cv_member_tm_tz
12a50 61 64 6a 2c 20 5b 0a 09 41 43 5f 54 52 59 5f 43  adj, [..AC_TRY_C
12a60 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c 75 64 65  OMPILE([#include
12a70 20 3c 74 69 6d 65 2e 68 3e 5d 2c 20 5b 73 74 72   <time.h>], [str
12a80 75 63 74 20 74 6d 20 74 6d 3b 20 74 6d 2e 74 6d  uct tm tm; tm.tm
12a90 5f 74 7a 61 64 6a 3b 5d 2c 0a 09 20 20 20 20 74  _tzadj;],..    t
12aa0 63 6c 5f 63 76 5f 6d 65 6d 62 65 72 5f 74 6d 5f  cl_cv_member_tm_
12ab0 74 7a 61 64 6a 3d 79 65 73 2c 20 74 63 6c 5f 63  tzadj=yes, tcl_c
12ac0 76 5f 6d 65 6d 62 65 72 5f 74 6d 5f 74 7a 61 64  v_member_tm_tzad
12ad0 6a 3d 6e 6f 29 5d 29 0a 20 20 20 20 69 66 20 74  j=no)]).    if t
12ae0 65 73 74 20 24 74 63 6c 5f 63 76 5f 6d 65 6d 62  est $tcl_cv_memb
12af0 65 72 5f 74 6d 5f 74 7a 61 64 6a 20 3d 20 79 65  er_tm_tzadj = ye
12b00 73 20 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46  s ; then..AC_DEF
12b10 49 4e 45 28 48 41 56 45 5f 54 4d 5f 54 5a 41 44  INE(HAVE_TM_TZAD
12b20 4a 2c 20 31 2c 20 5b 53 68 6f 75 6c 64 20 77 65  J, 1, [Should we
12b30 20 75 73 65 20 74 68 65 20 74 6d 5f 74 7a 61 64   use the tm_tzad
12b40 6a 20 66 69 65 6c 64 20 6f 66 20 73 74 72 75 63  j field of struc
12b50 74 20 74 6d 3f 5d 29 0a 20 20 20 20 66 69 0a 0a  t tm?]).    fi..
12b60 20 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45      AC_CACHE_CHE
12b70 43 4b 28 5b 74 6d 5f 67 6d 74 6f 66 66 20 69 6e  CK([tm_gmtoff in
12b80 20 73 74 72 75 63 74 20 74 6d 5d 2c 20 74 63 6c   struct tm], tcl
12b90 5f 63 76 5f 6d 65 6d 62 65 72 5f 74 6d 5f 67 6d  _cv_member_tm_gm
12ba0 74 6f 66 66 2c 20 5b 0a 09 41 43 5f 54 52 59 5f  toff, [..AC_TRY_
12bb0 43 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c 75 64  COMPILE([#includ
12bc0 65 20 3c 74 69 6d 65 2e 68 3e 5d 2c 20 5b 73 74  e <time.h>], [st
12bd0 72 75 63 74 20 74 6d 20 74 6d 3b 20 74 6d 2e 74  ruct tm tm; tm.t
12be0 6d 5f 67 6d 74 6f 66 66 3b 5d 2c 0a 09 20 20 20  m_gmtoff;],..   
12bf0 20 74 63 6c 5f 63 76 5f 6d 65 6d 62 65 72 5f 74   tcl_cv_member_t
12c00 6d 5f 67 6d 74 6f 66 66 3d 79 65 73 2c 20 74 63  m_gmtoff=yes, tc
12c10 6c 5f 63 76 5f 6d 65 6d 62 65 72 5f 74 6d 5f 67  l_cv_member_tm_g
12c20 6d 74 6f 66 66 3d 6e 6f 29 5d 29 0a 20 20 20 20  mtoff=no)]).    
12c30 69 66 20 74 65 73 74 20 24 74 63 6c 5f 63 76 5f  if test $tcl_cv_
12c40 6d 65 6d 62 65 72 5f 74 6d 5f 67 6d 74 6f 66 66  member_tm_gmtoff
12c50 20 3d 20 79 65 73 20 3b 20 74 68 65 6e 0a 09 41   = yes ; then..A
12c60 43 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 54 4d  C_DEFINE(HAVE_TM
12c70 5f 47 4d 54 4f 46 46 2c 20 31 2c 20 5b 53 68 6f  _GMTOFF, 1, [Sho
12c80 75 6c 64 20 77 65 20 75 73 65 20 74 68 65 20 74  uld we use the t
12c90 6d 5f 67 6d 74 6f 66 66 20 66 69 65 6c 64 20 6f  m_gmtoff field o
12ca0 66 20 73 74 72 75 63 74 20 74 6d 3f 5d 29 0a 20  f struct tm?]). 
12cb0 20 20 20 66 69 0a 0a 20 20 20 20 23 0a 20 20 20     fi..    #.   
12cc0 20 23 20 49 74 73 20 69 6d 70 6f 72 74 61 6e 74   # Its important
12cd0 20 74 6f 20 69 6e 63 6c 75 64 65 20 74 69 6d 65   to include time
12ce0 2e 68 20 69 6e 20 74 68 69 73 20 63 68 65 63 6b  .h in this check
12cf0 2c 20 61 73 20 73 6f 6d 65 20 73 79 73 74 65 6d  , as some system
12d00 73 0a 20 20 20 20 23 20 28 6c 69 6b 65 20 63 6f  s.    # (like co
12d10 6e 76 65 78 29 20 68 61 76 65 20 74 69 6d 65 7a  nvex) have timez
12d20 6f 6e 65 20 66 75 6e 63 74 69 6f 6e 73 2c 20 65  one functions, e
12d30 74 63 2e 0a 20 20 20 20 23 0a 20 20 20 20 41 43  tc..    #.    AC
12d40 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 6c 6f  _CACHE_CHECK([lo
12d50 6e 67 20 74 69 6d 65 7a 6f 6e 65 20 76 61 72 69  ng timezone vari
12d60 61 62 6c 65 5d 2c 20 74 63 6c 5f 63 76 5f 74 69  able], tcl_cv_ti
12d70 6d 65 7a 6f 6e 65 5f 6c 6f 6e 67 2c 20 5b 0a 09  mezone_long, [..
12d80 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b  AC_TRY_COMPILE([
12d90 23 69 6e 63 6c 75 64 65 20 3c 74 69 6d 65 2e 68  #include <time.h
12da0 3e 5d 2c 0a 09 20 20 20 20 5b 65 78 74 65 72 6e  >],..    [extern
12db0 20 6c 6f 6e 67 20 74 69 6d 65 7a 6f 6e 65 3b 0a   long timezone;.
12dc0 09 20 20 20 20 74 69 6d 65 7a 6f 6e 65 20 2b 3d  .    timezone +=
12dd0 20 31 3b 0a 09 20 20 20 20 65 78 69 74 20 28 30   1;..    exit (0
12de0 29 3b 5d 2c 0a 09 20 20 20 20 74 63 6c 5f 63 76  );],..    tcl_cv
12df0 5f 74 69 6d 65 7a 6f 6e 65 5f 6c 6f 6e 67 3d 79  _timezone_long=y
12e00 65 73 2c 20 74 63 6c 5f 63 76 5f 74 69 6d 65 7a  es, tcl_cv_timez
12e10 6f 6e 65 5f 6c 6f 6e 67 3d 6e 6f 29 5d 29 0a 20  one_long=no)]). 
12e20 20 20 20 69 66 20 74 65 73 74 20 24 74 63 6c 5f     if test $tcl_
12e30 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f 6c 6f 6e 67  cv_timezone_long
12e40 20 3d 20 79 65 73 20 3b 20 74 68 65 6e 0a 09 41   = yes ; then..A
12e50 43 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 54 49  C_DEFINE(HAVE_TI
12e60 4d 45 5a 4f 4e 45 5f 56 41 52 2c 20 31 2c 20 5b  MEZONE_VAR, 1, [
12e70 53 68 6f 75 6c 64 20 77 65 20 75 73 65 20 74 68  Should we use th
12e80 65 20 67 6c 6f 62 61 6c 20 74 69 6d 65 7a 6f 6e  e global timezon
12e90 65 20 76 61 72 69 61 62 6c 65 3f 5d 29 0a 20 20  e variable?]).  
12ea0 20 20 65 6c 73 65 0a 09 23 0a 09 23 20 4f 6e 20    else..#..# On 
12eb0 73 6f 6d 65 20 73 79 73 74 65 6d 73 20 28 65 67  some systems (eg
12ec0 20 49 52 49 58 20 36 2e 32 29 2c 20 74 69 6d 65   IRIX 6.2), time
12ed0 7a 6f 6e 65 20 69 73 20 61 20 74 69 6d 65 5f 74  zone is a time_t
12ee0 20 61 6e 64 20 6e 6f 74 20 61 20 6c 6f 6e 67 2e   and not a long.
12ef0 0a 09 23 0a 09 41 43 5f 43 41 43 48 45 5f 43 48  ..#..AC_CACHE_CH
12f00 45 43 4b 28 5b 74 69 6d 65 5f 74 20 74 69 6d 65  ECK([time_t time
12f10 7a 6f 6e 65 20 76 61 72 69 61 62 6c 65 5d 2c 20  zone variable], 
12f20 74 63 6c 5f 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f  tcl_cv_timezone_
12f30 74 69 6d 65 2c 20 5b 0a 09 20 20 20 20 41 43 5f  time, [..    AC_
12f40 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 23 69 6e  TRY_COMPILE([#in
12f50 63 6c 75 64 65 20 3c 74 69 6d 65 2e 68 3e 5d 2c  clude <time.h>],
12f60 0a 09 09 5b 65 78 74 65 72 6e 20 74 69 6d 65 5f  ...[extern time_
12f70 74 20 74 69 6d 65 7a 6f 6e 65 3b 0a 09 09 74 69  t timezone;...ti
12f80 6d 65 7a 6f 6e 65 20 2b 3d 20 31 3b 0a 09 09 65  mezone += 1;...e
12f90 78 69 74 20 28 30 29 3b 5d 2c 0a 09 09 74 63 6c  xit (0);],...tcl
12fa0 5f 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f 74 69 6d  _cv_timezone_tim
12fb0 65 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f 74 69  e=yes, tcl_cv_ti
12fc0 6d 65 7a 6f 6e 65 5f 74 69 6d 65 3d 6e 6f 29 5d  mezone_time=no)]
12fd0 29 0a 09 69 66 20 74 65 73 74 20 24 74 63 6c 5f  )..if test $tcl_
12fe0 63 76 5f 74 69 6d 65 7a 6f 6e 65 5f 74 69 6d 65  cv_timezone_time
12ff0 20 3d 20 79 65 73 20 3b 20 74 68 65 6e 0a 09 20   = yes ; then.. 
13000 20 20 20 41 43 5f 44 45 46 49 4e 45 28 48 41 56     AC_DEFINE(HAV
13010 45 5f 54 49 4d 45 5a 4f 4e 45 5f 56 41 52 2c 20  E_TIMEZONE_VAR, 
13020 31 2c 20 5b 53 68 6f 75 6c 64 20 77 65 20 75 73  1, [Should we us
13030 65 20 74 68 65 20 67 6c 6f 62 61 6c 20 74 69 6d  e the global tim
13040 65 7a 6f 6e 65 20 76 61 72 69 61 62 6c 65 3f 5d  ezone variable?]
13050 29 0a 09 66 69 0a 20 20 20 20 66 69 0a 5d 29 0a  )..fi.    fi.]).
13060 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
13070 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13080 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13090 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
130a0 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 42 55 47 47  ------.# SC_BUGG
130b0 59 5f 53 54 52 54 4f 44 0a 23 0a 23 09 55 6e 64  Y_STRTOD.#.#.Und
130c0 65 72 20 53 6f 6c 61 72 69 73 20 32 2e 34 2c 20  er Solaris 2.4, 
130d0 73 74 72 74 6f 64 20 72 65 74 75 72 6e 73 20 74  strtod returns t
130e0 68 65 20 77 72 6f 6e 67 20 76 61 6c 75 65 20 66  he wrong value f
130f0 6f 72 20 74 68 65 0a 23 09 74 65 72 6d 69 6e 61  or the.#.termina
13100 74 69 6e 67 20 63 68 61 72 61 63 74 65 72 20 75  ting character u
13110 6e 64 65 72 20 73 6f 6d 65 20 63 6f 6e 64 69 74  nder some condit
13120 69 6f 6e 73 2e 20 20 43 68 65 63 6b 20 66 6f 72  ions.  Check for
13130 20 74 68 69 73 0a 23 09 61 6e 64 20 69 66 20 74   this.#.and if t
13140 68 65 20 70 72 6f 62 6c 65 6d 20 65 78 69 73 74  he problem exist
13150 73 20 75 73 65 20 61 20 73 75 62 73 74 69 74 75  s use a substitu
13160 74 65 20 70 72 6f 63 65 64 75 72 65 0a 23 09 22  te procedure.#."
13170 66 69 78 73 74 72 74 6f 64 22 20 28 70 72 6f 76  fixstrtod" (prov
13180 69 64 65 64 20 62 79 20 54 63 6c 29 20 74 68 61  ided by Tcl) tha
13190 74 20 63 6f 72 72 65 63 74 73 20 74 68 65 20 65  t corrects the e
131a0 72 72 6f 72 2e 0a 23 09 41 6c 73 6f 2c 20 6f 6e  rror..#.Also, on
131b0 20 43 6f 6d 70 61 71 27 73 20 54 72 75 36 34 20   Compaq's Tru64 
131c0 55 6e 69 78 20 35 2e 30 2c 0a 23 09 73 74 72 74  Unix 5.0,.#.strt
131d0 6f 64 28 22 20 22 29 20 72 65 74 75 72 6e 73 20  od(" ") returns 
131e0 30 2e 30 20 69 6e 73 74 65 61 64 20 6f 66 20 61  0.0 instead of a
131f0 20 66 61 69 6c 75 72 65 20 74 6f 20 63 6f 6e 76   failure to conv
13200 65 72 74 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e  ert..#.# Argumen
13210 74 73 3a 0a 23 09 6e 6f 6e 65 0a 23 0a 23 20 52  ts:.#.none.#.# R
13220 65 73 75 6c 74 73 3a 0a 23 0a 23 09 4d 69 67 68  esults:.#.#.Migh
13230 74 20 64 65 66 69 6e 65 73 20 73 6f 6d 65 20 6f  t defines some o
13240 66 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  f the following 
13250 76 61 72 73 3a 0a 23 09 09 73 74 72 74 6f 64 20  vars:.#..strtod 
13260 28 3d 66 69 78 73 74 72 74 6f 64 29 0a 23 0a 23  (=fixstrtod).#.#
13270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
132a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
132b0 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b  ----..AC_DEFUN([
132c0 53 43 5f 42 55 47 47 59 5f 53 54 52 54 4f 44 5d  SC_BUGGY_STRTOD]
132d0 2c 20 5b 0a 20 20 20 20 41 43 5f 43 48 45 43 4b  , [.    AC_CHECK
132e0 5f 46 55 4e 43 28 73 74 72 74 6f 64 2c 20 74 63  _FUNC(strtod, tc
132f0 6c 5f 73 74 72 74 6f 64 3d 31 2c 20 74 63 6c 5f  l_strtod=1, tcl_
13300 73 74 72 74 6f 64 3d 30 29 0a 20 20 20 20 69 66  strtod=0).    if
13310 20 74 65 73 74 20 22 24 74 63 6c 5f 73 74 72 74   test "$tcl_strt
13320 6f 64 22 20 3d 20 31 3b 20 74 68 65 6e 0a 09 41  od" = 1; then..A
13330 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66  C_CACHE_CHECK([f
13340 6f 72 20 53 6f 6c 61 72 69 73 32 2e 34 2f 54 72  or Solaris2.4/Tr
13350 75 36 34 20 73 74 72 74 6f 64 20 62 75 67 73 5d  u64 strtod bugs]
13360 2c 20 74 63 6c 5f 63 76 5f 73 74 72 74 6f 64 5f  , tcl_cv_strtod_
13370 62 75 67 67 79 2c 5b 0a 09 20 20 20 20 41 43 5f  buggy,[..    AC_
13380 54 52 59 5f 52 55 4e 28 5b 0a 09 09 65 78 74 65  TRY_RUN([...exte
13390 72 6e 20 64 6f 75 62 6c 65 20 73 74 72 74 6f 64  rn double strtod
133a0 28 29 3b 0a 09 09 69 6e 74 20 6d 61 69 6e 28 29  ();...int main()
133b0 20 7b 0a 09 09 20 20 20 20 63 68 61 72 20 2a 69   {...    char *i
133c0 6e 66 53 74 72 69 6e 67 3d 22 49 6e 66 22 2c 20  nfString="Inf", 
133d0 2a 6e 61 6e 53 74 72 69 6e 67 3d 22 4e 61 4e 22  *nanString="NaN"
133e0 2c 20 2a 73 70 61 63 65 53 74 72 69 6e 67 3d 22  , *spaceString="
133f0 20 22 3b 0a 09 09 20 20 20 20 63 68 61 72 20 2a   ";...    char *
13400 74 65 72 6d 3b 0a 09 09 20 20 20 20 64 6f 75 62  term;...    doub
13410 6c 65 20 76 61 6c 75 65 3b 0a 09 09 20 20 20 20  le value;...    
13420 76 61 6c 75 65 20 3d 20 73 74 72 74 6f 64 28 69  value = strtod(i
13430 6e 66 53 74 72 69 6e 67 2c 20 26 74 65 72 6d 29  nfString, &term)
13440 3b 0a 09 09 20 20 20 20 69 66 20 28 28 74 65 72  ;...    if ((ter
13450 6d 20 21 3d 20 69 6e 66 53 74 72 69 6e 67 29 20  m != infString) 
13460 26 26 20 28 74 65 72 6d 5b 2d 31 5d 20 3d 3d 20  && (term[-1] == 
13470 30 29 29 20 7b 0a 09 09 09 65 78 69 74 28 31 29  0)) {....exit(1)
13480 3b 0a 09 09 20 20 20 20 7d 0a 09 09 20 20 20 20  ;...    }...    
13490 76 61 6c 75 65 20 3d 20 73 74 72 74 6f 64 28 6e  value = strtod(n
134a0 61 6e 53 74 72 69 6e 67 2c 20 26 74 65 72 6d 29  anString, &term)
134b0 3b 0a 09 09 20 20 20 20 69 66 20 28 28 74 65 72  ;...    if ((ter
134c0 6d 20 21 3d 20 6e 61 6e 53 74 72 69 6e 67 29 20  m != nanString) 
134d0 26 26 20 28 74 65 72 6d 5b 2d 31 5d 20 3d 3d 20  && (term[-1] == 
134e0 30 29 29 20 7b 0a 09 09 09 65 78 69 74 28 31 29  0)) {....exit(1)
134f0 3b 0a 09 09 20 20 20 20 7d 0a 09 09 20 20 20 20  ;...    }...    
13500 76 61 6c 75 65 20 3d 20 73 74 72 74 6f 64 28 73  value = strtod(s
13510 70 61 63 65 53 74 72 69 6e 67 2c 20 26 74 65 72  paceString, &ter
13520 6d 29 3b 0a 09 09 20 20 20 20 69 66 20 28 74 65  m);...    if (te
13530 72 6d 20 3d 3d 20 28 73 70 61 63 65 53 74 72 69  rm == (spaceStri
13540 6e 67 2b 31 29 29 20 7b 0a 09 09 09 65 78 69 74  ng+1)) {....exit
13550 28 31 29 3b 0a 09 09 20 20 20 20 7d 0a 09 09 20  (1);...    }... 
13560 20 20 20 65 78 69 74 28 30 29 3b 0a 09 09 7d 5d     exit(0);...}]
13570 2c 20 74 63 6c 5f 63 76 5f 73 74 72 74 6f 64 5f  , tcl_cv_strtod_
13580 62 75 67 67 79 3d 6f 6b 2c 20 74 63 6c 5f 63 76  buggy=ok, tcl_cv
13590 5f 73 74 72 74 6f 64 5f 62 75 67 67 79 3d 62 75  _strtod_buggy=bu
135a0 67 67 79 2c 0a 09 09 20 20 20 20 74 63 6c 5f 63  ggy,...    tcl_c
135b0 76 5f 73 74 72 74 6f 64 5f 62 75 67 67 79 3d 62  v_strtod_buggy=b
135c0 75 67 67 79 29 5d 29 0a 09 69 66 20 74 65 73 74  uggy)])..if test
135d0 20 22 24 74 63 6c 5f 63 76 5f 73 74 72 74 6f 64   "$tcl_cv_strtod
135e0 5f 62 75 67 67 79 22 20 3d 20 62 75 67 67 79 3b  _buggy" = buggy;
135f0 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 4c 49   then..    AC_LI
13600 42 4f 42 4a 28 5b 66 69 78 73 74 72 74 6f 64 5d  BOBJ([fixstrtod]
13610 29 0a 09 20 20 20 20 55 53 45 5f 43 4f 4d 50 41  )..    USE_COMPA
13620 54 3d 31 0a 09 20 20 20 20 41 43 5f 44 45 46 49  T=1..    AC_DEFI
13630 4e 45 28 73 74 72 74 6f 64 2c 20 66 69 78 73 74  NE(strtod, fixst
13640 72 74 6f 64 2c 20 5b 44 6f 20 77 65 20 77 61 6e  rtod, [Do we wan
13650 74 20 74 6f 20 75 73 65 20 74 68 65 20 73 74 72  t to use the str
13660 74 6f 64 28 29 20 69 6e 20 63 6f 6d 70 61 74 3f  tod() in compat?
13670 5d 29 0a 09 66 69 0a 20 20 20 20 66 69 0a 5d 29  ])..fi.    fi.])
13680 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#-------------
13690 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
136a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
136b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
136c0 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 54 43 4c  -------.# SC_TCL
136d0 5f 4c 49 4e 4b 5f 4c 49 42 53 0a 23 0a 23 09 53  _LINK_LIBS.#.#.S
136e0 65 61 72 63 68 20 66 6f 72 20 74 68 65 20 6c 69  earch for the li
136f0 62 72 61 72 69 65 73 20 6e 65 65 64 65 64 20 74  braries needed t
13700 6f 20 6c 69 6e 6b 20 74 68 65 20 54 63 6c 20 73  o link the Tcl s
13710 68 65 6c 6c 2e 0a 23 09 54 68 69 6e 67 73 20 6c  hell..#.Things l
13720 69 6b 65 20 74 68 65 20 6d 61 74 68 20 6c 69 62  ike the math lib
13730 72 61 72 79 20 28 2d 6c 6d 29 20 61 6e 64 20 73  rary (-lm) and s
13740 6f 63 6b 65 74 20 73 74 75 66 66 20 28 2d 6c 73  ocket stuff (-ls
13750 6f 63 6b 65 74 20 76 73 2e 0a 23 09 2d 6c 6e 73  ocket vs..#.-lns
13760 6c 29 20 61 72 65 20 64 65 61 6c 74 20 77 69 74  l) are dealt wit
13770 68 20 68 65 72 65 2e 0a 23 0a 23 20 41 72 67 75  h here..#.# Argu
13780 6d 65 6e 74 73 3a 0a 23 09 4e 6f 6e 65 2e 0a 23  ments:.#.None..#
13790 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09  .# Results:.#.#.
137a0 4d 69 67 68 74 20 61 70 70 65 6e 64 20 74 6f 20  Might append to 
137b0 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76 61  the following va
137c0 72 73 3a 0a 23 09 09 4c 49 42 53 0a 23 09 09 4d  rs:.#..LIBS.#..M
137d0 41 54 48 5f 4c 49 42 53 0a 23 0a 23 09 4d 69 67  ATH_LIBS.#.#.Mig
137e0 68 74 20 64 65 66 69 6e 65 20 74 68 65 20 66 6f  ht define the fo
137f0 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09  llowing vars:.#.
13800 09 48 41 56 45 5f 4e 45 54 5f 45 52 52 4e 4f 5f  .HAVE_NET_ERRNO_
13810 48 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  H.#.#-----------
13820 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13840 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13850 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45  ---------..AC_DE
13860 46 55 4e 28 5b 53 43 5f 54 43 4c 5f 4c 49 4e 4b  FUN([SC_TCL_LINK
13870 5f 4c 49 42 53 5d 2c 20 5b 0a 20 20 20 20 23 2d  _LIBS], [.    #-
13880 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
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 0a 20 20 20 20 23 20 4f 6e 20 61 20 66  ---.    # On a f
138d0 65 77 20 76 65 72 79 20 72 61 72 65 20 73 79 73  ew very rare sys
138e0 74 65 6d 73 2c 20 61 6c 6c 20 6f 66 20 74 68 65  tems, all of the
138f0 20 6c 69 62 6d 2e 61 20 73 74 75 66 66 20 69 73   libm.a stuff is
13900 0a 20 20 20 20 23 20 61 6c 72 65 61 64 79 20 69  .    # already i
13910 6e 20 6c 69 62 63 2e 61 2e 20 20 53 65 74 20 63  n libc.a.  Set c
13920 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 20 61 63  ompiler flags ac
13930 63 6f 72 64 69 6e 67 6c 79 2e 0a 20 20 20 20 23  cordingly..    #
13940 20 41 6c 73 6f 2c 20 4c 69 6e 75 78 20 72 65 71   Also, Linux req
13950 75 69 72 65 73 20 74 68 65 20 22 69 65 65 65 22  uires the "ieee"
13960 20 6c 69 62 72 61 72 79 20 66 6f 72 20 6d 61 74   library for mat
13970 68 20 74 6f 20 77 6f 72 6b 0a 20 20 20 20 23 20  h to work.    # 
13980 72 69 67 68 74 20 28 61 6e 64 20 69 74 20 6d 75  right (and it mu
13990 73 74 20 61 70 70 65 61 72 20 62 65 66 6f 72 65  st appear before
139a0 20 22 2d 6c 6d 22 29 2e 0a 20 20 20 20 23 2d 2d   "-lm")..    #--
139b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
139c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
139d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
139e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
139f0 2d 2d 0a 0a 20 20 20 20 41 43 5f 43 48 45 43 4b  --..    AC_CHECK
13a00 5f 46 55 4e 43 28 73 69 6e 2c 20 4d 41 54 48 5f  _FUNC(sin, MATH_
13a10 4c 49 42 53 3d 22 22 2c 20 4d 41 54 48 5f 4c 49  LIBS="", MATH_LI
13a20 42 53 3d 22 2d 6c 6d 22 29 0a 20 20 20 20 41 43  BS="-lm").    AC
13a30 5f 43 48 45 43 4b 5f 4c 49 42 28 69 65 65 65 2c  _CHECK_LIB(ieee,
13a40 20 6d 61 69 6e 2c 20 5b 4d 41 54 48 5f 4c 49 42   main, [MATH_LIB
13a50 53 3d 22 2d 6c 69 65 65 65 20 24 4d 41 54 48 5f  S="-lieee $MATH_
13a60 4c 49 42 53 22 5d 29 0a 0a 20 20 20 20 23 2d 2d  LIBS"])..    #--
13a70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13a80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13a90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13aa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13ab0 2d 2d 0a 20 20 20 20 23 20 49 6e 74 65 72 61 63  --.    # Interac
13ac0 74 69 76 65 20 55 4e 49 58 20 72 65 71 75 69 72  tive UNIX requir
13ad0 65 73 20 2d 6c 69 6e 65 74 20 69 6e 73 74 65 61  es -linet instea
13ae0 64 20 6f 66 20 2d 6c 73 6f 63 6b 65 74 2c 20 70  d of -lsocket, p
13af0 6c 75 73 20 69 74 0a 20 20 20 20 23 20 6e 65 65  lus it.    # nee
13b00 64 73 20 6e 65 74 2f 65 72 72 6e 6f 2e 68 20 74  ds net/errno.h t
13b10 6f 20 64 65 66 69 6e 65 20 74 68 65 20 73 6f 63  o define the soc
13b20 6b 65 74 2d 72 65 6c 61 74 65 64 20 65 72 72 6f  ket-related erro
13b30 72 20 63 6f 64 65 73 2e 0a 20 20 20 20 23 2d 2d  r codes..    #--
13b40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13b50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13b60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13b70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13b80 2d 2d 0a 0a 20 20 20 20 41 43 5f 43 48 45 43 4b  --..    AC_CHECK
13b90 5f 4c 49 42 28 69 6e 65 74 2c 20 6d 61 69 6e 2c  _LIB(inet, main,
13ba0 20 5b 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d 6c   [LIBS="$LIBS -l
13bb0 69 6e 65 74 22 5d 29 0a 20 20 20 20 41 43 5f 43  inet"]).    AC_C
13bc0 48 45 43 4b 5f 48 45 41 44 45 52 28 6e 65 74 2f  HECK_HEADER(net/
13bd0 65 72 72 6e 6f 2e 68 2c 20 5b 0a 09 41 43 5f 44  errno.h, [..AC_D
13be0 45 46 49 4e 45 28 48 41 56 45 5f 4e 45 54 5f 45  EFINE(HAVE_NET_E
13bf0 52 52 4e 4f 5f 48 2c 20 31 2c 20 5b 44 6f 20 77  RRNO_H, 1, [Do w
13c00 65 20 68 61 76 65 20 3c 6e 65 74 2f 65 72 72 6e  e have <net/errn
13c10 6f 2e 68 3e 3f 5d 29 5d 29 0a 0a 20 20 20 20 23  o.h>?])])..    #
13c20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13c30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13c40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13c50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13c60 2d 2d 2d 2d 0a 20 20 20 20 23 09 43 68 65 63 6b  ----.    #.Check
13c70 20 66 6f 72 20 74 68 65 20 65 78 69 73 74 65 6e   for the existen
13c80 63 65 20 6f 66 20 74 68 65 20 2d 6c 73 6f 63 6b  ce of the -lsock
13c90 65 74 20 61 6e 64 20 2d 6c 6e 73 6c 20 6c 69 62  et and -lnsl lib
13ca0 72 61 72 69 65 73 2e 0a 20 20 20 20 23 09 54 68  raries..    #.Th
13cb0 65 20 6f 72 64 65 72 20 68 65 72 65 20 69 73 20  e order here is 
13cc0 69 6d 70 6f 72 74 61 6e 74 2c 20 73 6f 20 74 68  important, so th
13cd0 61 74 20 74 68 65 79 20 65 6e 64 20 75 70 20 69  at they end up i
13ce0 6e 20 74 68 65 20 72 69 67 68 74 0a 20 20 20 20  n the right.    
13cf0 23 09 6f 72 64 65 72 20 69 6e 20 74 68 65 20 63  #.order in the c
13d00 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 67 65 6e 65  ommand line gene
13d10 72 61 74 65 64 20 62 79 20 6d 61 6b 65 2e 20 20  rated by make.  
13d20 48 65 72 65 20 61 72 65 20 73 6f 6d 65 0a 20 20  Here are some.  
13d30 20 20 23 09 73 70 65 63 69 61 6c 20 63 6f 6e 73    #.special cons
13d40 69 64 65 72 61 74 69 6f 6e 73 3a 0a 20 20 20 20  iderations:.    
13d50 23 09 31 2e 20 55 73 65 20 22 63 6f 6e 6e 65 63  #.1. Use "connec
13d60 74 22 20 61 6e 64 20 22 61 63 63 65 70 74 22 20  t" and "accept" 
13d70 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 2d 6c 73  to check for -ls
13d80 6f 63 6b 65 74 2c 20 61 6e 64 0a 20 20 20 20 23  ocket, and.    #
13d90 09 20 20 20 22 67 65 74 68 6f 73 74 62 79 6e 61  .   "gethostbyna
13da0 6d 65 22 20 74 6f 20 63 68 65 63 6b 20 66 6f 72  me" to check for
13db0 20 2d 6c 6e 73 6c 2e 0a 20 20 20 20 23 09 32 2e   -lnsl..    #.2.
13dc0 20 55 73 65 20 65 61 63 68 20 66 75 6e 63 74 69   Use each functi
13dd0 6f 6e 20 6e 61 6d 65 20 6f 6e 6c 79 20 6f 6e 63  on name only onc
13de0 65 3a 20 20 63 61 6e 27 74 20 72 65 64 6f 20 61  e:  can't redo a
13df0 20 63 68 65 63 6b 20 62 65 63 61 75 73 65 0a 20   check because. 
13e00 20 20 20 23 09 20 20 20 61 75 74 6f 63 6f 6e 66     #.   autoconf
13e10 20 63 61 63 68 65 73 20 74 68 65 20 72 65 73 75   caches the resu
13e20 6c 74 73 20 6f 66 20 74 68 65 20 6c 61 73 74 20  lts of the last 
13e30 63 68 65 63 6b 20 61 6e 64 20 77 6f 6e 27 74 20  check and won't 
13e40 72 65 64 6f 20 69 74 2e 0a 20 20 20 20 23 09 33  redo it..    #.3
13e50 2e 20 55 73 65 20 2d 6c 6e 73 6c 20 61 6e 64 20  . Use -lnsl and 
13e60 2d 6c 73 6f 63 6b 65 74 20 6f 6e 6c 79 20 69 66  -lsocket only if
13e70 20 74 68 65 79 20 73 75 70 70 6c 79 20 70 72 6f   they supply pro
13e80 63 65 64 75 72 65 73 20 74 68 61 74 0a 20 20 20  cedures that.   
13e90 20 23 09 20 20 20 61 72 65 6e 27 74 20 61 6c 72   #.   aren't alr
13ea0 65 61 64 79 20 70 72 65 73 65 6e 74 20 69 6e 20  eady present in 
13eb0 74 68 65 20 6e 6f 72 6d 61 6c 20 6c 69 62 72 61  the normal libra
13ec0 72 69 65 73 2e 20 20 54 68 69 73 20 69 73 20 62  ries.  This is b
13ed0 65 63 61 75 73 65 0a 20 20 20 20 23 09 20 20 20  ecause.    #.   
13ee0 49 52 49 58 20 35 2e 32 20 68 61 73 20 6c 69 62  IRIX 5.2 has lib
13ef0 72 61 72 69 65 73 2c 20 62 75 74 20 74 68 65 79  raries, but they
13f00 20 61 72 65 6e 27 74 20 6e 65 65 64 65 64 20 61   aren't needed a
13f10 6e 64 20 74 68 65 79 27 72 65 0a 20 20 20 20 23  nd they're.    #
13f20 09 20 20 20 62 6f 67 75 73 3a 20 20 74 68 65 79  .   bogus:  they
13f30 20 67 6f 6f 66 20 75 70 20 6e 61 6d 65 20 72 65   goof up name re
13f40 73 6f 6c 75 74 69 6f 6e 20 69 66 20 75 73 65 64  solution if used
13f50 2e 0a 20 20 20 20 23 09 34 2e 20 4f 6e 20 73 6f  ..    #.4. On so
13f60 6d 65 20 53 56 52 34 20 73 79 73 74 65 6d 73 2c  me SVR4 systems,
13f70 20 63 61 6e 27 74 20 75 73 65 20 2d 6c 73 6f 63   can't use -lsoc
13f80 6b 65 74 20 77 69 74 68 6f 75 74 20 2d 6c 6e 73  ket without -lns
13f90 6c 20 74 6f 6f 2e 0a 20 20 20 20 23 09 20 20 20  l too..    #.   
13fa0 54 6f 20 67 65 74 20 61 72 6f 75 6e 64 20 74 68  To get around th
13fb0 69 73 20 70 72 6f 62 6c 65 6d 2c 20 63 68 65 63  is problem, chec
13fc0 6b 20 66 6f 72 20 62 6f 74 68 20 6c 69 62 72 61  k for both libra
13fd0 72 69 65 73 20 74 6f 67 65 74 68 65 72 0a 20 20  ries together.  
13fe0 20 20 23 09 20 20 20 69 66 20 2d 6c 73 6f 63 6b    #.   if -lsock
13ff0 65 74 20 64 6f 65 73 6e 27 74 20 77 6f 72 6b 20  et doesn't work 
14000 62 79 20 69 74 73 65 6c 66 2e 0a 20 20 20 20 23  by itself..    #
14010 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14020 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14030 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14050 2d 2d 2d 2d 0a 0a 20 20 20 20 74 63 6c 5f 63 68  ----..    tcl_ch
14060 65 63 6b 42 6f 74 68 3d 30 0a 20 20 20 20 41 43  eckBoth=0.    AC
14070 5f 43 48 45 43 4b 5f 46 55 4e 43 28 63 6f 6e 6e  _CHECK_FUNC(conn
14080 65 63 74 2c 20 74 63 6c 5f 63 68 65 63 6b 53 6f  ect, tcl_checkSo
14090 63 6b 65 74 3d 30 2c 20 74 63 6c 5f 63 68 65 63  cket=0, tcl_chec
140a0 6b 53 6f 63 6b 65 74 3d 31 29 0a 20 20 20 20 69  kSocket=1).    i
140b0 66 20 74 65 73 74 20 22 24 74 63 6c 5f 63 68 65  f test "$tcl_che
140c0 63 6b 53 6f 63 6b 65 74 22 20 3d 20 31 3b 20 74  ckSocket" = 1; t
140d0 68 65 6e 0a 09 41 43 5f 43 48 45 43 4b 5f 46 55  hen..AC_CHECK_FU
140e0 4e 43 28 73 65 74 73 6f 63 6b 6f 70 74 2c 20 2c  NC(setsockopt, ,
140f0 20 5b 41 43 5f 43 48 45 43 4b 5f 4c 49 42 28 73   [AC_CHECK_LIB(s
14100 6f 63 6b 65 74 2c 20 73 65 74 73 6f 63 6b 6f 70  ocket, setsockop
14110 74 2c 0a 09 20 20 20 20 4c 49 42 53 3d 22 24 4c  t,..    LIBS="$L
14120 49 42 53 20 2d 6c 73 6f 63 6b 65 74 22 2c 20 74  IBS -lsocket", t
14130 63 6c 5f 63 68 65 63 6b 42 6f 74 68 3d 31 29 5d  cl_checkBoth=1)]
14140 29 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  ).    fi.    if 
14150 74 65 73 74 20 22 24 74 63 6c 5f 63 68 65 63 6b  test "$tcl_check
14160 42 6f 74 68 22 20 3d 20 31 3b 20 74 68 65 6e 0a  Both" = 1; then.
14170 09 74 6b 5f 6f 6c 64 4c 69 62 73 3d 24 4c 49 42  .tk_oldLibs=$LIB
14180 53 0a 09 4c 49 42 53 3d 22 24 4c 49 42 53 20 2d  S..LIBS="$LIBS -
14190 6c 73 6f 63 6b 65 74 20 2d 6c 6e 73 6c 22 0a 09  lsocket -lnsl"..
141a0 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 61 63  AC_CHECK_FUNC(ac
141b0 63 65 70 74 2c 20 74 63 6c 5f 63 68 65 63 6b 4e  cept, tcl_checkN
141c0 73 6c 3d 30 2c 20 5b 4c 49 42 53 3d 24 74 6b 5f  sl=0, [LIBS=$tk_
141d0 6f 6c 64 4c 69 62 73 5d 29 0a 20 20 20 20 66 69  oldLibs]).    fi
141e0 0a 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 46 55  .    AC_CHECK_FU
141f0 4e 43 28 67 65 74 68 6f 73 74 62 79 6e 61 6d 65  NC(gethostbyname
14200 2c 20 2c 20 5b 41 43 5f 43 48 45 43 4b 5f 4c 49  , , [AC_CHECK_LI
14210 42 28 6e 73 6c 2c 20 67 65 74 68 6f 73 74 62 79  B(nsl, gethostby
14220 6e 61 6d 65 2c 0a 09 20 20 20 20 5b 4c 49 42 53  name,..    [LIBS
14230 3d 22 24 4c 49 42 53 20 2d 6c 6e 73 6c 22 5d 29  ="$LIBS -lnsl"])
14240 5d 29 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  ]).])..#--------
14250 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14260 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53  ------------.# S
14290 43 5f 54 43 4c 5f 45 41 52 4c 59 5f 46 4c 41 47  C_TCL_EARLY_FLAG
142a0 53 0a 23 0a 23 09 43 68 65 63 6b 20 66 6f 72 20  S.#.#.Check for 
142b0 77 68 61 74 20 66 6c 61 67 73 20 61 72 65 20 6e  what flags are n
142c0 65 65 64 65 64 20 74 6f 20 62 65 20 70 61 73 73  eeded to be pass
142d0 65 64 20 73 6f 20 74 68 65 20 63 6f 72 72 65 63  ed so the correc
142e0 74 20 4f 53 0a 23 09 66 65 61 74 75 72 65 73 20  t OS.#.features 
142f0 61 72 65 20 61 76 61 69 6c 61 62 6c 65 2e 0a 23  are available..#
14300 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
14310 4e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73  None.#.# Results
14320 3a 0a 23 0a 23 09 4d 69 67 68 74 20 64 65 66 69  :.#.#.Might defi
14330 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ne the following
14340 20 76 61 72 73 3a 0a 23 09 09 5f 49 53 4f 43 39   vars:.#.._ISOC9
14350 39 5f 53 4f 55 52 43 45 0a 23 09 09 5f 4c 41 52  9_SOURCE.#.._LAR
14360 47 45 46 49 4c 45 36 34 5f 53 4f 55 52 43 45 0a  GEFILE64_SOURCE.
14370 23 09 09 5f 4c 41 52 47 45 46 49 4c 45 5f 53 4f  #.._LARGEFILE_SO
14380 55 52 43 45 36 34 0a 23 0a 23 2d 2d 2d 2d 2d 2d  URCE64.#.#------
14390 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
143a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
143b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
143c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
143d0 41 43 5f 44 45 46 55 4e 28 5b 53 43 5f 54 43 4c  AC_DEFUN([SC_TCL
143e0 5f 45 41 52 4c 59 5f 46 4c 41 47 5d 2c 5b 0a 20  _EARLY_FLAG],[. 
143f0 20 20 20 41 43 5f 43 41 43 48 45 5f 56 41 4c 28     AC_CACHE_VAL(
14400 5b 74 63 6c 5f 63 76 5f 66 6c 61 67 5f 5d 74 72  [tcl_cv_flag_]tr
14410 61 6e 73 6c 69 74 28 24 31 2c 5b 41 2d 5a 5d 2c  anslit($1,[A-Z],
14420 5b 61 2d 7a 5d 29 2c 0a 09 41 43 5f 54 52 59 5f  [a-z]),..AC_TRY_
14430 43 4f 4d 50 49 4c 45 28 5b 24 32 5d 2c 20 24 33  COMPILE([$2], $3
14440 2c 20 5b 74 63 6c 5f 63 76 5f 66 6c 61 67 5f 5d  , [tcl_cv_flag_]
14450 74 72 61 6e 73 6c 69 74 28 24 31 2c 5b 41 2d 5a  translit($1,[A-Z
14460 5d 2c 5b 61 2d 7a 5d 29 3d 6e 6f 2c 0a 09 20 20  ],[a-z])=no,..  
14470 20 20 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45    AC_TRY_COMPILE
14480 28 5b 5b 23 64 65 66 69 6e 65 20 5d 24 31 5b 20  ([[#define ]$1[ 
14490 31 0a 5d 24 32 5d 2c 20 24 33 2c 0a 09 09 5b 74  1.]$2], $3,...[t
144a0 63 6c 5f 63 76 5f 66 6c 61 67 5f 5d 74 72 61 6e  cl_cv_flag_]tran
144b0 73 6c 69 74 28 24 31 2c 5b 41 2d 5a 5d 2c 5b 61  slit($1,[A-Z],[a
144c0 2d 7a 5d 29 3d 79 65 73 2c 0a 09 09 5b 74 63 6c  -z])=yes,...[tcl
144d0 5f 63 76 5f 66 6c 61 67 5f 5d 74 72 61 6e 73 6c  _cv_flag_]transl
144e0 69 74 28 24 31 2c 5b 41 2d 5a 5d 2c 5b 61 2d 7a  it($1,[A-Z],[a-z
144f0 5d 29 3d 6e 6f 29 29 29 0a 20 20 20 20 69 66 20  ])=no))).    if 
14500 74 65 73 74 20 5b 22 78 24 7b 74 63 6c 5f 63 76  test ["x${tcl_cv
14510 5f 66 6c 61 67 5f 5d 74 72 61 6e 73 6c 69 74 28  _flag_]translit(
14520 24 31 2c 5b 41 2d 5a 5d 2c 5b 61 2d 7a 5d 29 5b  $1,[A-Z],[a-z])[
14530 7d 22 20 3d 20 22 78 79 65 73 22 5d 20 3b 20 74  }" = "xyes"] ; t
14540 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 24  hen..AC_DEFINE($
14550 31 2c 20 31 2c 20 5b 41 64 64 20 74 68 65 20 5d  1, 1, [Add the ]
14560 24 31 5b 20 66 6c 61 67 20 77 68 65 6e 20 62 75  $1[ flag when bu
14570 69 6c 64 69 6e 67 5d 29 0a 09 74 63 6c 5f 66 6c  ilding])..tcl_fl
14580 61 67 73 3d 22 24 74 63 6c 5f 66 6c 61 67 73 20  ags="$tcl_flags 
14590 24 31 22 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 41  $1".    fi.])..A
145a0 43 5f 44 45 46 55 4e 28 5b 53 43 5f 54 43 4c 5f  C_DEFUN([SC_TCL_
145b0 45 41 52 4c 59 5f 46 4c 41 47 53 5d 2c 5b 0a 20  EARLY_FLAGS],[. 
145c0 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49     AC_MSG_CHECKI
145d0 4e 47 28 5b 66 6f 72 20 72 65 71 75 69 72 65 64  NG([for required
145e0 20 65 61 72 6c 79 20 63 6f 6d 70 69 6c 65 72 20   early compiler 
145f0 66 6c 61 67 73 5d 29 0a 20 20 20 20 74 63 6c 5f  flags]).    tcl_
14600 66 6c 61 67 73 3d 22 22 0a 20 20 20 20 53 43 5f  flags="".    SC_
14610 54 43 4c 5f 45 41 52 4c 59 5f 46 4c 41 47 28 5f  TCL_EARLY_FLAG(_
14620 49 53 4f 43 39 39 5f 53 4f 55 52 43 45 2c 5b 23  ISOC99_SOURCE,[#
14630 69 6e 63 6c 75 64 65 20 3c 73 74 64 6c 69 62 2e  include <stdlib.
14640 68 3e 5d 2c 0a 09 5b 63 68 61 72 20 2a 70 20 3d  h>],..[char *p =
14650 20 28 63 68 61 72 20 2a 29 73 74 72 74 6f 6c 6c   (char *)strtoll
14660 3b 20 63 68 61 72 20 2a 71 20 3d 20 28 63 68 61  ; char *q = (cha
14670 72 20 2a 29 73 74 72 74 6f 75 6c 6c 3b 5d 29 0a  r *)strtoull;]).
14680 20 20 20 20 53 43 5f 54 43 4c 5f 45 41 52 4c 59      SC_TCL_EARLY
14690 5f 46 4c 41 47 28 5f 4c 41 52 47 45 46 49 4c 45  _FLAG(_LARGEFILE
146a0 36 34 5f 53 4f 55 52 43 45 2c 5b 23 69 6e 63 6c  64_SOURCE,[#incl
146b0 75 64 65 20 3c 73 79 73 2f 73 74 61 74 2e 68 3e  ude <sys/stat.h>
146c0 5d 2c 0a 09 5b 73 74 72 75 63 74 20 73 74 61 74  ],..[struct stat
146d0 36 34 20 62 75 66 3b 20 69 6e 74 20 69 20 3d 20  64 buf; int i = 
146e0 73 74 61 74 36 34 28 22 2f 22 2c 20 26 62 75 66  stat64("/", &buf
146f0 29 3b 5d 29 0a 20 20 20 20 53 43 5f 54 43 4c 5f  );]).    SC_TCL_
14700 45 41 52 4c 59 5f 46 4c 41 47 28 5f 4c 41 52 47  EARLY_FLAG(_LARG
14710 45 46 49 4c 45 5f 53 4f 55 52 43 45 36 34 2c 5b  EFILE_SOURCE64,[
14720 23 69 6e 63 6c 75 64 65 20 3c 73 79 73 2f 73 74  #include <sys/st
14730 61 74 2e 68 3e 5d 2c 0a 09 5b 63 68 61 72 20 2a  at.h>],..[char *
14740 70 20 3d 20 28 63 68 61 72 20 2a 29 6f 70 65 6e  p = (char *)open
14750 36 34 3b 5d 29 0a 20 20 20 20 69 66 20 74 65 73  64;]).    if tes
14760 74 20 22 78 24 7b 74 63 6c 5f 66 6c 61 67 73 7d  t "x${tcl_flags}
14770 22 20 3d 20 22 78 22 20 3b 20 74 68 65 6e 0a 09  " = "x" ; then..
14780 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e  AC_MSG_RESULT([n
14790 6f 6e 65 5d 29 0a 20 20 20 20 65 6c 73 65 0a 09  one]).    else..
147a0 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24  AC_MSG_RESULT([$
147b0 7b 74 63 6c 5f 66 6c 61 67 73 7d 5d 29 0a 20 20  {tcl_flags}]).  
147c0 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d    fi.])..#------
147d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
147e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
147f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14800 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
14810 20 53 43 5f 54 43 4c 5f 36 34 42 49 54 5f 46 4c   SC_TCL_64BIT_FL
14820 41 47 53 0a 23 0a 23 09 43 68 65 63 6b 20 66 6f  AGS.#.#.Check fo
14830 72 20 77 68 61 74 20 69 73 20 64 65 66 69 6e 65  r what is define
14840 64 20 69 6e 20 74 68 65 20 77 61 79 20 6f 66 20  d in the way of 
14850 36 34 2d 62 69 74 20 66 65 61 74 75 72 65 73 2e  64-bit features.
14860 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a  .#.# Arguments:.
14870 23 09 4e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c  #.None.#.# Resul
14880 74 73 3a 0a 23 0a 23 09 4d 69 67 68 74 20 64 65  ts:.#.#.Might de
14890 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69  fine the followi
148a0 6e 67 20 76 61 72 73 3a 0a 23 09 09 54 43 4c 5f  ng vars:.#..TCL_
148b0 57 49 44 45 5f 49 4e 54 5f 49 53 5f 4c 4f 4e 47  WIDE_INT_IS_LONG
148c0 0a 23 09 09 54 43 4c 5f 57 49 44 45 5f 49 4e 54  .#..TCL_WIDE_INT
148d0 5f 54 59 50 45 0a 23 09 09 48 41 56 45 5f 53 54  _TYPE.#..HAVE_ST
148e0 52 55 43 54 5f 44 49 52 45 4e 54 36 34 0a 23 09  RUCT_DIRENT64.#.
148f0 09 48 41 56 45 5f 53 54 52 55 43 54 5f 53 54 41  .HAVE_STRUCT_STA
14900 54 36 34 0a 23 09 09 48 41 56 45 5f 54 59 50 45  T64.#..HAVE_TYPE
14910 5f 4f 46 46 36 34 5f 54 0a 23 0a 23 2d 2d 2d 2d  _OFF64_T.#.#----
14920 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14930 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14940 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14950 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14960 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 53 43 5f 54  ..AC_DEFUN([SC_T
14970 43 4c 5f 36 34 42 49 54 5f 46 4c 41 47 53 5d 2c  CL_64BIT_FLAGS],
14980 20 5b 0a 20 20 20 20 41 43 5f 4d 53 47 5f 43 48   [.    AC_MSG_CH
14990 45 43 4b 49 4e 47 28 5b 66 6f 72 20 36 34 2d 62  ECKING([for 64-b
149a0 69 74 20 69 6e 74 65 67 65 72 20 74 79 70 65 5d  it integer type]
149b0 29 0a 20 20 20 20 41 43 5f 43 41 43 48 45 5f 56  ).    AC_CACHE_V
149c0 41 4c 28 74 63 6c 5f 63 76 5f 74 79 70 65 5f 36  AL(tcl_cv_type_6
149d0 34 62 69 74 2c 5b 0a 09 74 63 6c 5f 63 76 5f 74  4bit,[..tcl_cv_t
149e0 79 70 65 5f 36 34 62 69 74 3d 6e 6f 6e 65 0a 09  ype_64bit=none..
149f0 23 20 53 65 65 20 69 66 20 74 68 65 20 63 6f 6d  # See if the com
14a00 70 69 6c 65 72 20 6b 6e 6f 77 73 20 6e 61 74 69  piler knows nati
14a10 76 65 6c 79 20 61 62 6f 75 74 20 5f 5f 69 6e 74  vely about __int
14a20 36 34 0a 09 41 43 5f 54 52 59 5f 43 4f 4d 50 49  64..AC_TRY_COMPI
14a30 4c 45 28 2c 5b 5f 5f 69 6e 74 36 34 20 76 61 6c  LE(,[__int64 val
14a40 75 65 20 3d 20 28 5f 5f 69 6e 74 36 34 29 20 30  ue = (__int64) 0
14a50 3b 5d 2c 0a 09 20 20 20 20 74 63 6c 5f 74 79 70  ;],..    tcl_typ
14a60 65 5f 36 34 62 69 74 3d 5f 5f 69 6e 74 36 34 2c  e_64bit=__int64,
14a70 20 74 63 6c 5f 74 79 70 65 5f 36 34 62 69 74 3d   tcl_type_64bit=
14a80 22 6c 6f 6e 67 20 6c 6f 6e 67 22 29 0a 09 23 20  "long long")..# 
14a90 53 65 65 20 69 66 20 77 65 20 73 68 6f 75 6c 64  See if we should
14aa0 20 75 73 65 20 6c 6f 6e 67 20 61 6e 79 77 61 79   use long anyway
14ab0 20 20 4e 6f 74 65 20 74 68 61 74 20 77 65 20 73    Note that we s
14ac0 75 62 73 74 69 74 75 74 65 20 69 6e 20 74 68 65  ubstitute in the
14ad0 0a 09 23 20 74 79 70 65 20 74 68 61 74 20 69 73  ..# type that is
14ae0 20 6f 75 72 20 63 75 72 72 65 6e 74 20 67 75 65   our current gue
14af0 73 73 20 66 6f 72 20 61 20 36 34 2d 62 69 74 20  ss for a 64-bit 
14b00 74 79 70 65 20 69 6e 73 69 64 65 20 74 68 69 73  type inside this
14b10 20 63 68 65 63 6b 0a 09 23 20 70 72 6f 67 72 61   check..# progra
14b20 6d 2c 20 73 6f 20 69 74 20 73 68 6f 75 6c 64 20  m, so it should 
14b30 62 65 20 6d 6f 64 69 66 69 65 64 20 6f 6e 6c 79  be modified only
14b40 20 63 61 72 65 66 75 6c 6c 79 2e 2e 2e 0a 20 20   carefully....  
14b50 20 20 20 20 20 20 41 43 5f 54 52 59 5f 43 4f 4d        AC_TRY_COM
14b60 50 49 4c 45 28 2c 5b 73 77 69 74 63 68 20 28 30  PILE(,[switch (0
14b70 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20  ) {.            
14b80 63 61 73 65 20 31 3a 20 63 61 73 65 20 28 73 69  case 1: case (si
14b90 7a 65 6f 66 28 5d 24 7b 74 63 6c 5f 74 79 70 65  zeof(]${tcl_type
14ba0 5f 36 34 62 69 74 7d 5b 29 3d 3d 73 69 7a 65 6f  _64bit}[)==sizeo
14bb0 66 28 6c 6f 6e 67 29 29 3a 20 3b 0a 20 20 20 20  f(long)): ;.    
14bc0 20 20 20 20 7d 5d 2c 74 63 6c 5f 63 76 5f 74 79      }],tcl_cv_ty
14bd0 70 65 5f 36 34 62 69 74 3d 24 7b 74 63 6c 5f 74  pe_64bit=${tcl_t
14be0 79 70 65 5f 36 34 62 69 74 7d 29 5d 29 0a 20 20  ype_64bit})]).  
14bf0 20 20 69 66 20 74 65 73 74 20 22 24 7b 74 63 6c    if test "${tcl
14c00 5f 63 76 5f 74 79 70 65 5f 36 34 62 69 74 7d 22  _cv_type_64bit}"
14c10 20 3d 20 6e 6f 6e 65 20 3b 20 74 68 65 6e 0a 09   = none ; then..
14c20 41 43 5f 44 45 46 49 4e 45 28 54 43 4c 5f 57 49  AC_DEFINE(TCL_WI
14c30 44 45 5f 49 4e 54 5f 49 53 5f 4c 4f 4e 47 2c 20  DE_INT_IS_LONG, 
14c40 31 2c 20 5b 41 72 65 20 77 69 64 65 20 69 6e 74  1, [Are wide int
14c50 65 67 65 72 73 20 74 6f 20 62 65 20 69 6d 70 6c  egers to be impl
14c60 65 6d 65 6e 74 65 64 20 77 69 74 68 20 43 20 27  emented with C '
14c70 6c 6f 6e 67 27 73 3f 5d 29 0a 09 41 43 5f 4d 53  long's?])..AC_MS
14c80 47 5f 52 45 53 55 4c 54 28 5b 75 73 69 6e 67 20  G_RESULT([using 
14c90 6c 6f 6e 67 5d 29 0a 20 20 20 20 65 6c 73 65 0a  long]).    else.
14ca0 09 41 43 5f 44 45 46 49 4e 45 5f 55 4e 51 55 4f  .AC_DEFINE_UNQUO
14cb0 54 45 44 28 54 43 4c 5f 57 49 44 45 5f 49 4e 54  TED(TCL_WIDE_INT
14cc0 5f 54 59 50 45 2c 24 7b 74 63 6c 5f 63 76 5f 74  _TYPE,${tcl_cv_t
14cd0 79 70 65 5f 36 34 62 69 74 7d 2c 0a 09 20 20 20  ype_64bit},..   
14ce0 20 5b 57 68 61 74 20 74 79 70 65 20 73 68 6f 75   [What type shou
14cf0 6c 64 20 62 65 20 75 73 65 64 20 74 6f 20 64 65  ld be used to de
14d00 66 69 6e 65 20 77 69 64 65 20 69 6e 74 65 67 65  fine wide intege
14d10 72 73 3f 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45  rs?])..AC_MSG_RE
14d20 53 55 4c 54 28 5b 24 7b 74 63 6c 5f 63 76 5f 74  SULT([${tcl_cv_t
14d30 79 70 65 5f 36 34 62 69 74 7d 5d 29 0a 0a 09 23  ype_64bit}])...#
14d40 20 4e 6f 77 20 63 68 65 63 6b 20 66 6f 72 20 61   Now check for a
14d50 75 78 69 6c 69 61 72 79 20 64 65 63 6c 61 72 61  uxiliary declara
14d60 74 69 6f 6e 73 0a 09 41 43 5f 43 41 43 48 45 5f  tions..AC_CACHE_
14d70 43 48 45 43 4b 28 5b 66 6f 72 20 73 74 72 75 63  CHECK([for struc
14d80 74 20 64 69 72 65 6e 74 36 34 5d 2c 20 74 63 6c  t dirent64], tcl
14d90 5f 63 76 5f 73 74 72 75 63 74 5f 64 69 72 65 6e  _cv_struct_diren
14da0 74 36 34 2c 5b 0a 09 20 20 20 20 41 43 5f 54 52  t64,[..    AC_TR
14db0 59 5f 43 4f 4d 50 49 4c 45 28 5b 23 69 6e 63 6c  Y_COMPILE([#incl
14dc0 75 64 65 20 3c 73 79 73 2f 74 79 70 65 73 2e 68  ude <sys/types.h
14dd0 3e 0a 23 69 6e 63 6c 75 64 65 20 3c 64 69 72 65  >.#include <dire
14de0 6e 74 2e 68 3e 5d 2c 5b 73 74 72 75 63 74 20 64  nt.h>],[struct d
14df0 69 72 65 6e 74 36 34 20 70 3b 5d 2c 0a 09 09 74  irent64 p;],...t
14e00 63 6c 5f 63 76 5f 73 74 72 75 63 74 5f 64 69 72  cl_cv_struct_dir
14e10 65 6e 74 36 34 3d 79 65 73 2c 74 63 6c 5f 63 76  ent64=yes,tcl_cv
14e20 5f 73 74 72 75 63 74 5f 64 69 72 65 6e 74 36 34  _struct_dirent64
14e30 3d 6e 6f 29 5d 29 0a 09 69 66 20 74 65 73 74 20  =no)])..if test 
14e40 22 78 24 7b 74 63 6c 5f 63 76 5f 73 74 72 75 63  "x${tcl_cv_struc
14e50 74 5f 64 69 72 65 6e 74 36 34 7d 22 20 3d 20 22  t_dirent64}" = "
14e60 78 79 65 73 22 20 3b 20 74 68 65 6e 0a 09 20 20  xyes" ; then..  
14e70 20 20 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45    AC_DEFINE(HAVE
14e80 5f 53 54 52 55 43 54 5f 44 49 52 45 4e 54 36 34  _STRUCT_DIRENT64
14e90 2c 20 31 2c 20 5b 49 73 20 27 73 74 72 75 63 74  , 1, [Is 'struct
14ea0 20 64 69 72 65 6e 74 36 34 27 20 69 6e 20 3c 73   dirent64' in <s
14eb0 79 73 2f 74 79 70 65 73 2e 68 3e 3f 5d 29 0a 09  ys/types.h>?])..
14ec0 66 69 0a 0a 09 41 43 5f 43 41 43 48 45 5f 43 48  fi...AC_CACHE_CH
14ed0 45 43 4b 28 5b 66 6f 72 20 73 74 72 75 63 74 20  ECK([for struct 
14ee0 73 74 61 74 36 34 5d 2c 20 74 63 6c 5f 63 76 5f  stat64], tcl_cv_
14ef0 73 74 72 75 63 74 5f 73 74 61 74 36 34 2c 5b 0a  struct_stat64,[.
14f00 09 20 20 20 20 41 43 5f 54 52 59 5f 43 4f 4d 50  .    AC_TRY_COMP
14f10 49 4c 45 28 5b 23 69 6e 63 6c 75 64 65 20 3c 73  ILE([#include <s
14f20 79 73 2f 73 74 61 74 2e 68 3e 5d 2c 5b 73 74 72  ys/stat.h>],[str
14f30 75 63 74 20 73 74 61 74 36 34 20 70 3b 0a 5d 2c  uct stat64 p;.],
14f40 0a 09 09 74 63 6c 5f 63 76 5f 73 74 72 75 63 74  ...tcl_cv_struct
14f50 5f 73 74 61 74 36 34 3d 79 65 73 2c 74 63 6c 5f  _stat64=yes,tcl_
14f60 63 76 5f 73 74 72 75 63 74 5f 73 74 61 74 36 34  cv_struct_stat64
14f70 3d 6e 6f 29 5d 29 0a 09 69 66 20 74 65 73 74 20  =no)])..if test 
14f80 22 78 24 7b 74 63 6c 5f 63 76 5f 73 74 72 75 63  "x${tcl_cv_struc
14f90 74 5f 73 74 61 74 36 34 7d 22 20 3d 20 22 78 79  t_stat64}" = "xy
14fa0 65 73 22 20 3b 20 74 68 65 6e 0a 09 20 20 20 20  es" ; then..    
14fb0 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 53  AC_DEFINE(HAVE_S
14fc0 54 52 55 43 54 5f 53 54 41 54 36 34 2c 20 31 2c  TRUCT_STAT64, 1,
14fd0 20 5b 49 73 20 27 73 74 72 75 63 74 20 73 74 61   [Is 'struct sta
14fe0 74 36 34 27 20 69 6e 20 3c 73 79 73 2f 73 74 61  t64' in <sys/sta
14ff0 74 2e 68 3e 3f 5d 29 0a 09 66 69 0a 0a 09 41 43  t.h>?])..fi...AC
15000 5f 43 48 45 43 4b 5f 46 55 4e 43 53 28 6f 70 65  _CHECK_FUNCS(ope
15010 6e 36 34 20 6c 73 65 65 6b 36 34 29 0a 09 41 43  n64 lseek64)..AC
15020 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66  _MSG_CHECKING([f
15030 6f 72 20 6f 66 66 36 34 5f 74 5d 29 0a 09 41 43  or off64_t])..AC
15040 5f 43 41 43 48 45 5f 56 41 4c 28 74 63 6c 5f 63  _CACHE_VAL(tcl_c
15050 76 5f 74 79 70 65 5f 6f 66 66 36 34 5f 74 2c 5b  v_type_off64_t,[
15060 0a 09 20 20 20 20 41 43 5f 54 52 59 5f 43 4f 4d  ..    AC_TRY_COM
15070 50 49 4c 45 28 5b 23 69 6e 63 6c 75 64 65 20 3c  PILE([#include <
15080 73 79 73 2f 74 79 70 65 73 2e 68 3e 5d 2c 5b 6f  sys/types.h>],[o
15090 66 66 36 34 5f 74 20 6f 66 66 73 65 74 3b 0a 5d  ff64_t offset;.]
150a0 2c 0a 09 09 74 63 6c 5f 63 76 5f 74 79 70 65 5f  ,...tcl_cv_type_
150b0 6f 66 66 36 34 5f 74 3d 79 65 73 2c 74 63 6c 5f  off64_t=yes,tcl_
150c0 63 76 5f 74 79 70 65 5f 6f 66 66 36 34 5f 74 3d  cv_type_off64_t=
150d0 6e 6f 29 5d 29 0a 09 64 6e 6c 20 44 65 66 69 6e  no)])..dnl Defin
150e0 65 20 48 41 56 45 5f 54 59 50 45 5f 4f 46 46 36  e HAVE_TYPE_OFF6
150f0 34 5f 54 20 6f 6e 6c 79 20 77 68 65 6e 20 74 68  4_T only when th
15100 65 20 6f 66 66 36 34 5f 74 20 74 79 70 65 20 61  e off64_t type a
15110 6e 64 20 74 68 65 0a 09 64 6e 6c 20 66 75 6e 63  nd the..dnl func
15120 74 69 6f 6e 73 20 6c 73 65 65 6b 36 34 20 61 6e  tions lseek64 an
15130 64 20 6f 70 65 6e 36 34 20 61 72 65 20 64 65 66  d open64 are def
15140 69 6e 65 64 2e 0a 09 69 66 20 74 65 73 74 20 22  ined...if test "
15150 78 24 7b 74 63 6c 5f 63 76 5f 74 79 70 65 5f 6f  x${tcl_cv_type_o
15160 66 66 36 34 5f 74 7d 22 20 3d 20 22 78 79 65 73  ff64_t}" = "xyes
15170 22 20 26 26 20 5c 0a 09 20 20 20 20 20 20 20 20  " && \..        
15180 74 65 73 74 20 22 78 24 7b 61 63 5f 63 76 5f 66  test "x${ac_cv_f
15190 75 6e 63 5f 6c 73 65 65 6b 36 34 7d 22 20 3d 20  unc_lseek64}" = 
151a0 22 78 79 65 73 22 20 26 26 20 5c 0a 09 20 20 20  "xyes" && \..   
151b0 20 20 20 20 20 74 65 73 74 20 22 78 24 7b 61 63       test "x${ac
151c0 5f 63 76 5f 66 75 6e 63 5f 6f 70 65 6e 36 34 7d  _cv_func_open64}
151d0 22 20 3d 20 22 78 79 65 73 22 20 3b 20 74 68 65  " = "xyes" ; the
151e0 6e 0a 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45  n..    AC_DEFINE
151f0 28 48 41 56 45 5f 54 59 50 45 5f 4f 46 46 36 34  (HAVE_TYPE_OFF64
15200 5f 54 2c 20 31 2c 20 5b 49 73 20 6f 66 66 36 34  _T, 1, [Is off64
15210 5f 74 20 69 6e 20 3c 73 79 73 2f 74 79 70 65 73  _t in <sys/types
15220 2e 68 3e 3f 5d 29 0a 09 20 20 20 20 41 43 5f 4d  .h>?])..    AC_M
15230 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29  SG_RESULT([yes])
15240 0a 09 65 6c 73 65 0a 09 20 20 20 20 41 43 5f 4d  ..else..    AC_M
15250 53 47 5f 52 45 53 55 4c 54 28 5b 6e 6f 5d 29 0a  SG_RESULT([no]).
15260 09 66 69 0a 20 20 20 20 66 69 0a 5d 29 0a 0a 23  .fi.    fi.])..#
15270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
152a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
152b0 2d 2d 2d 2d 0a 23 20 53 43 5f 54 43 4c 5f 43 46  ----.# SC_TCL_CF
152c0 47 5f 45 4e 43 4f 44 49 4e 47 09 54 49 50 20 23  G_ENCODING.TIP #
152d0 35 39 0a 23 0a 23 09 44 65 63 6c 61 72 65 20 74  59.#.#.Declare t
152e0 68 65 20 65 6e 63 6f 64 69 6e 67 20 74 6f 20 75  he encoding to u
152f0 73 65 20 66 6f 72 20 65 6d 62 65 64 64 65 64 20  se for embedded 
15300 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 69 6e  configuration in
15310 66 6f 72 6d 61 74 69 6f 6e 2e 0a 23 0a 23 20 41  formation..#.# A
15320 72 67 75 6d 65 6e 74 73 3a 0a 23 09 4e 6f 6e 65  rguments:.#.None
15330 2e 0a 23 0a 23 20 52 65 73 75 6c 74 73 3a 0a 23  ..#.# Results:.#
15340 09 4d 69 67 68 74 20 61 70 70 65 6e 64 20 74 6f  .Might append to
15350 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 76   the following v
15360 61 72 73 3a 0a 23 09 09 44 45 46 53 09 28 69 6d  ars:.#..DEFS.(im
15370 70 6c 69 63 69 74 29 0a 23 0a 23 09 57 69 6c 6c  plicit).#.#.Will
15380 20 64 65 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c   define the foll
15390 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 54  owing vars:.#..T
153a0 43 4c 5f 43 46 47 56 41 4c 5f 45 4e 43 4f 44 49  CL_CFGVAL_ENCODI
153b0 4e 47 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  NG.#.#----------
153c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
153d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
153e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
153f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44  ----------..AC_D
15400 45 46 55 4e 28 5b 53 43 5f 54 43 4c 5f 43 46 47  EFUN([SC_TCL_CFG
15410 5f 45 4e 43 4f 44 49 4e 47 5d 2c 20 5b 0a 20 20  _ENCODING], [.  
15420 20 20 41 43 5f 41 52 47 5f 57 49 54 48 28 65 6e    AC_ARG_WITH(en
15430 63 6f 64 69 6e 67 2c 0a 09 41 43 5f 48 45 4c 50  coding,..AC_HELP
15440 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68 2d  _STRING([--with-
15450 65 6e 63 6f 64 69 6e 67 5d 2c 0a 09 20 20 20 20  encoding],..    
15460 5b 65 6e 63 6f 64 69 6e 67 20 66 6f 72 20 63 6f  [encoding for co
15470 6e 66 69 67 75 72 61 74 69 6f 6e 20 76 61 6c 75  nfiguration valu
15480 65 73 20 28 64 65 66 61 75 6c 74 3a 20 69 73 6f  es (default: iso
15490 38 38 35 39 2d 31 29 5d 29 2c 0a 09 77 69 74 68  8859-1)]),..with
154a0 5f 74 63 65 6e 63 6f 64 69 6e 67 3d 24 7b 77 69  _tcencoding=${wi
154b0 74 68 76 61 6c 7d 29 0a 0a 20 20 20 20 69 66 20  thval})..    if 
154c0 74 65 73 74 20 78 22 24 7b 77 69 74 68 5f 74 63  test x"${with_tc
154d0 65 6e 63 6f 64 69 6e 67 7d 22 20 21 3d 20 78 20  encoding}" != x 
154e0 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e  ; then..AC_DEFIN
154f0 45 5f 55 4e 51 55 4f 54 45 44 28 54 43 4c 5f 43  E_UNQUOTED(TCL_C
15500 46 47 56 41 4c 5f 45 4e 43 4f 44 49 4e 47 2c 22  FGVAL_ENCODING,"
15510 24 7b 77 69 74 68 5f 74 63 65 6e 63 6f 64 69 6e  ${with_tcencodin
15520 67 7d 22 2c 0a 09 20 20 20 20 5b 57 68 61 74 20  g}",..    [What 
15530 65 6e 63 6f 64 69 6e 67 20 73 68 6f 75 6c 64 20  encoding should 
15540 62 65 20 75 73 65 64 20 66 6f 72 20 65 6d 62 65  be used for embe
15550 64 64 65 64 20 63 6f 6e 66 69 67 75 72 61 74 69  dded configurati
15560 6f 6e 20 69 6e 66 6f 3f 5d 29 0a 20 20 20 20 65  on info?]).    e
15570 6c 73 65 0a 09 41 43 5f 44 45 46 49 4e 45 28 54  lse..AC_DEFINE(T
15580 43 4c 5f 43 46 47 56 41 4c 5f 45 4e 43 4f 44 49  CL_CFGVAL_ENCODI
15590 4e 47 2c 22 69 73 6f 38 38 35 39 2d 31 22 2c 0a  NG,"iso8859-1",.
155a0 09 20 20 20 20 5b 57 68 61 74 20 65 6e 63 6f 64  .    [What encod
155b0 69 6e 67 20 73 68 6f 75 6c 64 20 62 65 20 75 73  ing should be us
155c0 65 64 20 66 6f 72 20 65 6d 62 65 64 64 65 64 20  ed for embedded 
155d0 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 69 6e  configuration in
155e0 66 6f 3f 5d 29 0a 20 20 20 20 66 69 0a 5d 29 0a  fo?]).    fi.]).
155f0 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
15600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15610 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15620 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15630 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 54 43 4c 5f  ------.# SC_TCL_
15640 43 48 45 43 4b 5f 42 52 4f 4b 45 4e 5f 46 55 4e  CHECK_BROKEN_FUN
15650 43 0a 23 0a 23 09 43 68 65 63 6b 20 66 6f 72 20  C.#.#.Check for 
15660 62 72 6f 6b 65 6e 20 66 75 6e 63 74 69 6f 6e 2e  broken function.
15670 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a  .#.# Arguments:.
15680 23 09 66 75 6e 63 4e 61 6d 65 20 2d 20 66 75 6e  #.funcName - fun
15690 63 74 69 6f 6e 20 74 6f 20 74 65 73 74 20 66 6f  ction to test fo
156a0 72 0a 23 09 61 64 76 61 6e 63 65 64 54 65 73 74  r.#.advancedTest
156b0 20 2d 20 74 68 65 20 61 64 76 61 6e 63 65 64 20   - the advanced 
156c0 74 65 73 74 20 74 6f 20 72 75 6e 20 69 66 20 74  test to run if t
156d0 68 65 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 70  he function is p
156e0 72 65 73 65 6e 74 0a 23 0a 23 20 52 65 73 75 6c  resent.#.# Resul
156f0 74 73 3a 0a 23 09 4d 69 67 68 74 20 63 61 75 73  ts:.#.Might caus
15700 65 20 63 6f 6d 70 61 74 61 62 69 6c 69 74 79 20  e compatability 
15710 76 65 72 73 69 6f 6e 73 20 6f 66 20 74 68 65 20  versions of the 
15720 66 75 6e 63 74 69 6f 6e 20 74 6f 20 62 65 20 75  function to be u
15730 73 65 64 2e 0a 23 09 4d 69 67 68 74 20 61 66 66  sed..#.Might aff
15740 65 63 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e  ect the followin
15750 67 20 76 61 72 73 3a 0a 23 09 09 55 53 45 5f 43  g vars:.#..USE_C
15760 4f 4d 50 41 54 09 28 69 6d 70 6c 69 63 69 74 29  OMPAT.(implicit)
15770 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#.#------------
15780 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15790 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
157a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
157b0 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46  --------..AC_DEF
157c0 55 4e 28 5b 53 43 5f 54 43 4c 5f 43 48 45 43 4b  UN([SC_TCL_CHECK
157d0 5f 42 52 4f 4b 45 4e 5f 46 55 4e 43 5d 2c 5b 0a  _BROKEN_FUNC],[.
157e0 20 20 20 20 41 43 5f 43 48 45 43 4b 5f 46 55 4e      AC_CHECK_FUN
157f0 43 28 24 31 2c 20 74 63 6c 5f 6f 6b 3d 31 2c 20  C($1, tcl_ok=1, 
15800 74 63 6c 5f 6f 6b 3d 30 29 0a 20 20 20 20 69 66  tcl_ok=0).    if
15810 20 74 65 73 74 20 5b 22 24 74 63 6c 5f 6f 6b 22   test ["$tcl_ok"
15820 5d 20 3d 20 31 3b 20 74 68 65 6e 0a 09 41 43 5f  ] = 1; then..AC_
15830 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 70 72 6f  CACHE_CHECK([pro
15840 70 65 72 20 5d 24 31 5b 20 69 6d 70 6c 65 6d 65  per ]$1[ impleme
15850 6e 74 61 74 69 6f 6e 5d 2c 20 5b 74 63 6c 5f 63  ntation], [tcl_c
15860 76 5f 5d 24 31 5b 5f 75 6e 62 72 6f 6b 65 6e 5d  v_]$1[_unbroken]
15870 2c 0a 09 20 20 20 20 41 43 5f 54 52 59 5f 52 55  ,..    AC_TRY_RU
15880 4e 28 5b 5b 69 6e 74 20 6d 61 69 6e 28 29 20 7b  N([[int main() {
15890 5d 24 32 5b 7d 5d 5d 2c 5b 74 63 6c 5f 63 76 5f  ]$2[}]],[tcl_cv_
158a0 5d 24 31 5b 5f 75 6e 62 72 6f 6b 65 6e 5d 3d 6f  ]$1[_unbroken]=o
158b0 6b 2c 0a 09 09 5b 74 63 6c 5f 63 76 5f 5d 24 31  k,...[tcl_cv_]$1
158c0 5b 5f 75 6e 62 72 6f 6b 65 6e 5d 3d 62 72 6f 6b  [_unbroken]=brok
158d0 65 6e 2c 5b 74 63 6c 5f 63 76 5f 5d 24 31 5b 5f  en,[tcl_cv_]$1[_
158e0 75 6e 62 72 6f 6b 65 6e 5d 3d 75 6e 6b 6e 6f 77  unbroken]=unknow
158f0 6e 29 29 0a 09 69 66 20 74 65 73 74 20 5b 22 24  n))..if test ["$
15900 74 63 6c 5f 63 76 5f 5d 24 31 5b 5f 75 6e 62 72  tcl_cv_]$1[_unbr
15910 6f 6b 65 6e 22 5d 20 3d 20 22 6f 6b 22 3b 20 74  oken"] = "ok"; t
15920 68 65 6e 0a 09 20 20 20 20 74 63 6c 5f 6f 6b 3d  hen..    tcl_ok=
15930 31 0a 09 65 6c 73 65 0a 09 20 20 20 20 74 63 6c  1..else..    tcl
15940 5f 6f 6b 3d 30 0a 09 66 69 0a 20 20 20 20 66 69  _ok=0..fi.    fi
15950 0a 20 20 20 20 69 66 20 74 65 73 74 20 5b 22 24  .    if test ["$
15960 74 63 6c 5f 6f 6b 22 5d 20 3d 20 30 3b 20 74 68  tcl_ok"] = 0; th
15970 65 6e 0a 09 41 43 5f 4c 49 42 4f 42 4a 28 24 31  en..AC_LIBOBJ($1
15980 29 0a 09 55 53 45 5f 43 4f 4d 50 41 54 3d 31 0a  )..USE_COMPAT=1.
15990 20 20 20 20 66 69 0a 5d 29 0a 0a 23 2d 2d 2d 2d      fi.])..#----
159a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
159b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
159c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
159d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
159e0 0a 23 20 53 43 5f 54 43 4c 5f 47 45 54 48 4f 53  .# SC_TCL_GETHOS
159f0 54 42 59 41 44 44 52 5f 52 0a 23 0a 23 09 43 68  TBYADDR_R.#.#.Ch
15a00 65 63 6b 20 69 66 20 77 65 20 68 61 76 65 20 4d  eck if we have M
15a10 54 2d 73 61 66 65 20 76 61 72 69 61 6e 74 20 6f  T-safe variant o
15a20 66 20 67 65 74 68 6f 73 74 62 79 61 64 64 72 28  f gethostbyaddr(
15a30 29 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73  )..#.# Arguments
15a40 3a 0a 23 09 4e 6f 6e 65 0a 23 0a 23 20 52 65 73  :.#.None.#.# Res
15a50 75 6c 74 73 3a 0a 23 0a 23 09 4d 69 67 68 74 20  ults:.#.#.Might 
15a60 64 65 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c 6f  define the follo
15a70 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 48 41  wing vars:.#..HA
15a80 56 45 5f 47 45 54 48 4f 53 54 42 59 41 44 44 52  VE_GETHOSTBYADDR
15a90 5f 52 0a 23 09 09 48 41 56 45 5f 47 45 54 48 4f  _R.#..HAVE_GETHO
15aa0 53 54 42 59 41 44 44 52 5f 52 5f 37 0a 23 09 09  STBYADDR_R_7.#..
15ab0 48 41 56 45 5f 47 45 54 48 4f 53 54 42 59 41 44  HAVE_GETHOSTBYAD
15ac0 44 52 5f 52 5f 38 0a 23 0a 23 2d 2d 2d 2d 2d 2d  DR_R_8.#.#------
15ad0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15ae0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15af0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15b00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
15b10 41 43 5f 44 45 46 55 4e 28 5b 53 43 5f 54 43 4c  AC_DEFUN([SC_TCL
15b20 5f 47 45 54 48 4f 53 54 42 59 41 44 44 52 5f 52  _GETHOSTBYADDR_R
15b30 5d 2c 20 5b 41 43 5f 43 48 45 43 4b 5f 46 55 4e  ], [AC_CHECK_FUN
15b40 43 28 67 65 74 68 6f 73 74 62 79 61 64 64 72 5f  C(gethostbyaddr_
15b50 72 2c 20 5b 0a 20 20 20 20 41 43 5f 43 41 43 48  r, [.    AC_CACH
15b60 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20 67 65 74  E_CHECK([for get
15b70 68 6f 73 74 62 79 61 64 64 72 5f 72 20 77 69 74  hostbyaddr_r wit
15b80 68 20 37 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63  h 7 args], tcl_c
15b90 76 5f 61 70 69 5f 67 65 74 68 6f 73 74 62 79 61  v_api_gethostbya
15ba0 64 64 72 5f 72 5f 37 2c 20 5b 0a 20 20 20 20 41  ddr_r_7, [.    A
15bb0 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 0a  C_TRY_COMPILE([.
15bc0 09 23 69 6e 63 6c 75 64 65 20 3c 6e 65 74 64 62  .#include <netdb
15bd0 2e 68 3e 0a 20 20 20 20 5d 2c 20 5b 0a 09 63 68  .h>.    ], [..ch
15be0 61 72 20 2a 61 64 64 72 3b 0a 09 69 6e 74 20 6c  ar *addr;..int l
15bf0 65 6e 67 74 68 3b 0a 09 69 6e 74 20 74 79 70 65  ength;..int type
15c00 3b 0a 09 73 74 72 75 63 74 20 68 6f 73 74 65 6e  ;..struct hosten
15c10 74 20 2a 72 65 73 75 6c 74 3b 0a 09 63 68 61 72  t *result;..char
15c20 20 62 75 66 66 65 72 5b 32 30 34 38 5d 3b 0a 09   buffer[2048];..
15c30 69 6e 74 20 62 75 66 6c 65 6e 20 3d 20 32 30 34  int buflen = 204
15c40 38 3b 0a 09 69 6e 74 20 68 5f 65 72 72 6e 6f 70  8;..int h_errnop
15c50 3b 0a 0a 09 28 76 6f 69 64 29 20 67 65 74 68 6f  ;...(void) getho
15c60 73 74 62 79 61 64 64 72 5f 72 28 61 64 64 72 2c  stbyaddr_r(addr,
15c70 20 6c 65 6e 67 74 68 2c 20 74 79 70 65 2c 20 72   length, type, r
15c80 65 73 75 6c 74 2c 20 62 75 66 66 65 72 2c 20 62  esult, buffer, b
15c90 75 66 6c 65 6e 2c 0a 09 09 09 20 20 20 20 20 20  uflen,....      
15ca0 20 26 68 5f 65 72 72 6e 6f 70 29 3b 0a 20 20 20   &h_errnop);.   
15cb0 20 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67   ], tcl_cv_api_g
15cc0 65 74 68 6f 73 74 62 79 61 64 64 72 5f 72 5f 37  ethostbyaddr_r_7
15cd0 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f 61 70 69  =yes, tcl_cv_api
15ce0 5f 67 65 74 68 6f 73 74 62 79 61 64 64 72 5f 72  _gethostbyaddr_r
15cf0 5f 37 3d 6e 6f 29 5d 29 0a 20 20 20 20 74 63 6c  _7=no)]).    tcl
15d00 5f 6f 6b 3d 24 74 63 6c 5f 63 76 5f 61 70 69 5f  _ok=$tcl_cv_api_
15d10 67 65 74 68 6f 73 74 62 79 61 64 64 72 5f 72 5f  gethostbyaddr_r_
15d20 37 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24  7.    if test "$
15d30 74 63 6c 5f 6f 6b 22 20 3d 20 79 65 73 3b 20 74  tcl_ok" = yes; t
15d40 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 48  hen..AC_DEFINE(H
15d50 41 56 45 5f 47 45 54 48 4f 53 54 42 59 41 44 44  AVE_GETHOSTBYADD
15d60 52 5f 52 5f 37 2c 20 31 2c 0a 09 20 20 20 20 5b  R_R_7, 1,..    [
15d70 44 65 66 69 6e 65 20 74 6f 20 31 20 69 66 20 67  Define to 1 if g
15d80 65 74 68 6f 73 74 62 79 61 64 64 72 5f 72 20 74  ethostbyaddr_r t
15d90 61 6b 65 73 20 37 20 61 72 67 73 2e 5d 29 0a 20  akes 7 args.]). 
15da0 20 20 20 65 6c 73 65 0a 09 41 43 5f 43 41 43 48     else..AC_CACH
15db0 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20 67 65 74  E_CHECK([for get
15dc0 68 6f 73 74 62 79 61 64 64 72 5f 72 20 77 69 74  hostbyaddr_r wit
15dd0 68 20 38 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63  h 8 args], tcl_c
15de0 76 5f 61 70 69 5f 67 65 74 68 6f 73 74 62 79 61  v_api_gethostbya
15df0 64 64 72 5f 72 5f 38 2c 20 5b 0a 09 41 43 5f 54  ddr_r_8, [..AC_T
15e00 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 0a 09 20 20  RY_COMPILE([..  
15e10 20 20 23 69 6e 63 6c 75 64 65 20 3c 6e 65 74 64    #include <netd
15e20 62 2e 68 3e 0a 09 5d 2c 20 5b 0a 09 20 20 20 20  b.h>..], [..    
15e30 63 68 61 72 20 2a 61 64 64 72 3b 0a 09 20 20 20  char *addr;..   
15e40 20 69 6e 74 20 6c 65 6e 67 74 68 3b 0a 09 20 20   int length;..  
15e50 20 20 69 6e 74 20 74 79 70 65 3b 0a 09 20 20 20    int type;..   
15e60 20 73 74 72 75 63 74 20 68 6f 73 74 65 6e 74 20   struct hostent 
15e70 2a 72 65 73 75 6c 74 2c 20 2a 72 65 73 75 6c 74  *result, *result
15e80 70 3b 0a 09 20 20 20 20 63 68 61 72 20 62 75 66  p;..    char buf
15e90 66 65 72 5b 32 30 34 38 5d 3b 0a 09 20 20 20 20  fer[2048];..    
15ea0 69 6e 74 20 62 75 66 6c 65 6e 20 3d 20 32 30 34  int buflen = 204
15eb0 38 3b 0a 09 20 20 20 20 69 6e 74 20 68 5f 65 72  8;..    int h_er
15ec0 72 6e 6f 70 3b 0a 0a 09 20 20 20 20 28 76 6f 69  rnop;...    (voi
15ed0 64 29 20 67 65 74 68 6f 73 74 62 79 61 64 64 72  d) gethostbyaddr
15ee0 5f 72 28 61 64 64 72 2c 20 6c 65 6e 67 74 68 2c  _r(addr, length,
15ef0 20 74 79 70 65 2c 20 72 65 73 75 6c 74 2c 20 62   type, result, b
15f00 75 66 66 65 72 2c 20 62 75 66 6c 65 6e 2c 0a 09  uffer, buflen,..
15f10 09 09 09 20 20 20 26 72 65 73 75 6c 74 70 2c 20  ...   &resultp, 
15f20 26 68 5f 65 72 72 6e 6f 70 29 3b 0a 09 5d 2c 20  &h_errnop);..], 
15f30 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 68 6f  tcl_cv_api_getho
15f40 73 74 62 79 61 64 64 72 5f 72 5f 38 3d 79 65 73  stbyaddr_r_8=yes
15f50 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74  , tcl_cv_api_get
15f60 68 6f 73 74 62 79 61 64 64 72 5f 72 5f 38 3d 6e  hostbyaddr_r_8=n
15f70 6f 29 5d 29 0a 09 74 63 6c 5f 6f 6b 3d 24 74 63  o)])..tcl_ok=$tc
15f80 6c 5f 63 76 5f 61 70 69 5f 67 65 74 68 6f 73 74  l_cv_api_gethost
15f90 62 79 61 64 64 72 5f 72 5f 38 0a 09 69 66 20 74  byaddr_r_8..if t
15fa0 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20  est "$tcl_ok" = 
15fb0 79 65 73 3b 20 74 68 65 6e 0a 09 20 20 20 20 41  yes; then..    A
15fc0 43 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 47 45  C_DEFINE(HAVE_GE
15fd0 54 48 4f 53 54 42 59 41 44 44 52 5f 52 5f 38 2c  THOSTBYADDR_R_8,
15fe0 20 31 2c 0a 09 09 5b 44 65 66 69 6e 65 20 74 6f   1,...[Define to
15ff0 20 31 20 69 66 20 67 65 74 68 6f 73 74 62 79 61   1 if gethostbya
16000 64 64 72 5f 72 20 74 61 6b 65 73 20 38 20 61 72  ddr_r takes 8 ar
16010 67 73 2e 5d 29 0a 09 66 69 0a 20 20 20 20 66 69  gs.])..fi.    fi
16020 0a 20 20 20 20 69 66 20 74 65 73 74 20 22 24 74  .    if test "$t
16030 63 6c 5f 6f 6b 22 20 3d 20 79 65 73 3b 20 74 68  cl_ok" = yes; th
16040 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 48 41  en..AC_DEFINE(HA
16050 56 45 5f 47 45 54 48 4f 53 54 42 59 41 44 44 52  VE_GETHOSTBYADDR
16060 5f 52 2c 20 31 2c 0a 09 20 20 20 20 5b 44 65 66  _R, 1,..    [Def
16070 69 6e 65 20 74 6f 20 31 20 69 66 20 67 65 74 68  ine to 1 if geth
16080 6f 73 74 62 79 61 64 64 72 5f 72 20 69 73 20 61  ostbyaddr_r is a
16090 76 61 69 6c 61 62 6c 65 2e 5d 29 0a 20 20 20 20  vailable.]).    
160a0 66 69 0a 5d 29 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d  fi.])])..#------
160b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
160c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
160d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
160e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
160f0 20 53 43 5f 54 43 4c 5f 47 45 54 48 4f 53 54 42   SC_TCL_GETHOSTB
16100 59 4e 41 4d 45 5f 52 0a 23 0a 23 09 43 68 65 63  YNAME_R.#.#.Chec
16110 6b 20 74 6f 20 73 65 65 20 77 68 61 74 20 76 61  k to see what va
16120 72 69 61 6e 74 20 6f 66 20 67 65 74 68 6f 73 74  riant of gethost
16130 62 79 6e 61 6d 65 5f 72 28 29 20 77 65 20 68 61  byname_r() we ha
16140 76 65 2e 0a 23 09 42 61 73 65 64 20 6f 6e 20 44  ve..#.Based on D
16150 61 76 69 64 20 41 72 6e 6f 6c 64 27 73 20 65 78  avid Arnold's ex
16160 61 6d 70 6c 65 20 66 72 6f 6d 20 74 68 65 20 63  ample from the c
16170 6f 6d 70 2e 70 72 6f 67 72 61 6d 6d 69 6e 67 2e  omp.programming.
16180 74 68 72 65 61 64 73 0a 23 09 46 41 51 20 51 32  threads.#.FAQ Q2
16190 31 33 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73  13.#.# Arguments
161a0 3a 0a 23 09 4e 6f 6e 65 0a 23 0a 23 20 52 65 73  :.#.None.#.# Res
161b0 75 6c 74 73 3a 0a 23 0a 23 09 4d 69 67 68 74 20  ults:.#.#.Might 
161c0 64 65 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c 6f  define the follo
161d0 77 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 48 41  wing vars:.#..HA
161e0 56 45 5f 47 45 54 48 4f 53 54 42 59 41 44 44 52  VE_GETHOSTBYADDR
161f0 5f 52 0a 23 09 09 48 41 56 45 5f 47 45 54 48 4f  _R.#..HAVE_GETHO
16200 53 54 42 59 41 44 44 52 5f 52 5f 33 0a 23 09 09  STBYADDR_R_3.#..
16210 48 41 56 45 5f 47 45 54 48 4f 53 54 42 59 41 44  HAVE_GETHOSTBYAD
16220 44 52 5f 52 5f 35 0a 23 09 09 48 41 56 45 5f 47  DR_R_5.#..HAVE_G
16230 45 54 48 4f 53 54 42 59 41 44 44 52 5f 52 5f 36  ETHOSTBYADDR_R_6
16240 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#.#------------
16250 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16260 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16280 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f 44 45 46  --------..AC_DEF
16290 55 4e 28 5b 53 43 5f 54 43 4c 5f 47 45 54 48 4f  UN([SC_TCL_GETHO
162a0 53 54 42 59 4e 41 4d 45 5f 52 5d 2c 20 5b 41 43  STBYNAME_R], [AC
162b0 5f 43 48 45 43 4b 5f 46 55 4e 43 28 67 65 74 68  _CHECK_FUNC(geth
162c0 6f 73 74 62 79 6e 61 6d 65 5f 72 2c 20 5b 0a 20  ostbyname_r, [. 
162d0 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45 43     AC_CACHE_CHEC
162e0 4b 28 5b 66 6f 72 20 67 65 74 68 6f 73 74 62 79  K([for gethostby
162f0 6e 61 6d 65 5f 72 20 77 69 74 68 20 36 20 61 72  name_r with 6 ar
16300 67 73 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f  gs], tcl_cv_api_
16310 67 65 74 68 6f 73 74 62 79 6e 61 6d 65 5f 72 5f  gethostbyname_r_
16320 36 2c 20 5b 0a 20 20 20 20 41 43 5f 54 52 59 5f  6, [.    AC_TRY_
16330 43 4f 4d 50 49 4c 45 28 5b 0a 09 23 69 6e 63 6c  COMPILE([..#incl
16340 75 64 65 20 3c 6e 65 74 64 62 2e 68 3e 0a 20 20  ude <netdb.h>.  
16350 20 20 5d 2c 20 5b 0a 09 63 68 61 72 20 2a 6e 61    ], [..char *na
16360 6d 65 3b 0a 09 73 74 72 75 63 74 20 68 6f 73 74  me;..struct host
16370 65 6e 74 20 2a 68 65 2c 20 2a 72 65 73 3b 0a 09  ent *he, *res;..
16380 63 68 61 72 20 62 75 66 66 65 72 5b 32 30 34 38  char buffer[2048
16390 5d 3b 0a 09 69 6e 74 20 62 75 66 6c 65 6e 20 3d  ];..int buflen =
163a0 20 32 30 34 38 3b 0a 09 69 6e 74 20 68 5f 65 72   2048;..int h_er
163b0 72 6e 6f 70 3b 0a 0a 09 28 76 6f 69 64 29 20 67  rnop;...(void) g
163c0 65 74 68 6f 73 74 62 79 6e 61 6d 65 5f 72 28 6e  ethostbyname_r(n
163d0 61 6d 65 2c 20 68 65 2c 20 62 75 66 66 65 72 2c  ame, he, buffer,
163e0 20 62 75 66 6c 65 6e 2c 20 26 72 65 73 2c 20 26   buflen, &res, &
163f0 68 5f 65 72 72 6e 6f 70 29 3b 0a 20 20 20 20 5d  h_errnop);.    ]
16400 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74  , tcl_cv_api_get
16410 68 6f 73 74 62 79 6e 61 6d 65 5f 72 5f 36 3d 79  hostbyname_r_6=y
16420 65 73 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67  es, tcl_cv_api_g
16430 65 74 68 6f 73 74 62 79 6e 61 6d 65 5f 72 5f 36  ethostbyname_r_6
16440 3d 6e 6f 29 5d 29 0a 20 20 20 20 74 63 6c 5f 6f  =no)]).    tcl_o
16450 6b 3d 24 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65  k=$tcl_cv_api_ge
16460 74 68 6f 73 74 62 79 6e 61 6d 65 5f 72 5f 36 0a  thostbyname_r_6.
16470 20 20 20 20 69 66 20 74 65 73 74 20 22 24 74 63      if test "$tc
16480 6c 5f 6f 6b 22 20 3d 20 79 65 73 3b 20 74 68 65  l_ok" = yes; the
16490 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 48 41 56  n..AC_DEFINE(HAV
164a0 45 5f 47 45 54 48 4f 53 54 42 59 4e 41 4d 45 5f  E_GETHOSTBYNAME_
164b0 52 5f 36 2c 20 31 2c 0a 09 20 20 20 20 5b 44 65  R_6, 1,..    [De
164c0 66 69 6e 65 20 74 6f 20 31 20 69 66 20 67 65 74  fine to 1 if get
164d0 68 6f 73 74 62 79 6e 61 6d 65 5f 72 20 74 61 6b  hostbyname_r tak
164e0 65 73 20 36 20 61 72 67 73 2e 5d 29 0a 20 20 20  es 6 args.]).   
164f0 20 65 6c 73 65 0a 09 41 43 5f 43 41 43 48 45 5f   else..AC_CACHE_
16500 43 48 45 43 4b 28 5b 66 6f 72 20 67 65 74 68 6f  CHECK([for getho
16510 73 74 62 79 6e 61 6d 65 5f 72 20 77 69 74 68 20  stbyname_r with 
16520 35 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63 76 5f  5 args], tcl_cv_
16530 61 70 69 5f 67 65 74 68 6f 73 74 62 79 6e 61 6d  api_gethostbynam
16540 65 5f 72 5f 35 2c 20 5b 0a 09 41 43 5f 54 52 59  e_r_5, [..AC_TRY
16550 5f 43 4f 4d 50 49 4c 45 28 5b 0a 09 20 20 20 20  _COMPILE([..    
16560 23 69 6e 63 6c 75 64 65 20 3c 6e 65 74 64 62 2e  #include <netdb.
16570 68 3e 0a 09 5d 2c 20 5b 0a 09 20 20 20 20 63 68  h>..], [..    ch
16580 61 72 20 2a 6e 61 6d 65 3b 0a 09 20 20 20 20 73  ar *name;..    s
16590 74 72 75 63 74 20 68 6f 73 74 65 6e 74 20 2a 68  truct hostent *h
165a0 65 3b 0a 09 20 20 20 20 63 68 61 72 20 62 75 66  e;..    char buf
165b0 66 65 72 5b 32 30 34 38 5d 3b 0a 09 20 20 20 20  fer[2048];..    
165c0 69 6e 74 20 62 75 66 6c 65 6e 20 3d 20 32 30 34  int buflen = 204
165d0 38 3b 0a 09 20 20 20 20 69 6e 74 20 68 5f 65 72  8;..    int h_er
165e0 72 6e 6f 70 3b 0a 0a 09 20 20 20 20 28 76 6f 69  rnop;...    (voi
165f0 64 29 20 67 65 74 68 6f 73 74 62 79 6e 61 6d 65  d) gethostbyname
16600 5f 72 28 6e 61 6d 65 2c 20 68 65 2c 20 62 75 66  _r(name, he, buf
16610 66 65 72 2c 20 62 75 66 6c 65 6e 2c 20 26 68 5f  fer, buflen, &h_
16620 65 72 72 6e 6f 70 29 3b 0a 09 5d 2c 20 74 63 6c  errnop);..], tcl
16630 5f 63 76 5f 61 70 69 5f 67 65 74 68 6f 73 74 62  _cv_api_gethostb
16640 79 6e 61 6d 65 5f 72 5f 35 3d 79 65 73 2c 20 74  yname_r_5=yes, t
16650 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 68 6f 73  cl_cv_api_gethos
16660 74 62 79 6e 61 6d 65 5f 72 5f 35 3d 6e 6f 29 5d  tbyname_r_5=no)]
16670 29 0a 09 74 63 6c 5f 6f 6b 3d 24 74 63 6c 5f 63  )..tcl_ok=$tcl_c
16680 76 5f 61 70 69 5f 67 65 74 68 6f 73 74 62 79 6e  v_api_gethostbyn
16690 61 6d 65 5f 72 5f 35 0a 09 69 66 20 74 65 73 74  ame_r_5..if test
166a0 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 79 65 73   "$tcl_ok" = yes
166b0 3b 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 44  ; then..    AC_D
166c0 45 46 49 4e 45 28 48 41 56 45 5f 47 45 54 48 4f  EFINE(HAVE_GETHO
166d0 53 54 42 59 4e 41 4d 45 5f 52 5f 35 2c 20 31 2c  STBYNAME_R_5, 1,
166e0 0a 09 09 5b 44 65 66 69 6e 65 20 74 6f 20 31 20  ...[Define to 1 
166f0 69 66 20 67 65 74 68 6f 73 74 62 79 6e 61 6d 65  if gethostbyname
16700 5f 72 20 74 61 6b 65 73 20 35 20 61 72 67 73 2e  _r takes 5 args.
16710 5d 29 0a 09 65 6c 73 65 0a 09 20 20 20 20 41 43  ])..else..    AC
16720 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f  _CACHE_CHECK([fo
16730 72 20 67 65 74 68 6f 73 74 62 79 6e 61 6d 65 5f  r gethostbyname_
16740 72 20 77 69 74 68 20 33 20 61 72 67 73 5d 2c 20  r with 3 args], 
16750 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 68 6f  tcl_cv_api_getho
16760 73 74 62 79 6e 61 6d 65 5f 72 5f 33 2c 20 5b 0a  stbyname_r_3, [.
16770 09 20 20 20 20 41 43 5f 54 52 59 5f 43 4f 4d 50  .    AC_TRY_COMP
16780 49 4c 45 28 5b 0a 09 09 23 69 6e 63 6c 75 64 65  ILE([...#include
16790 20 3c 6e 65 74 64 62 2e 68 3e 0a 09 20 20 20 20   <netdb.h>..    
167a0 5d 2c 20 5b 0a 09 09 63 68 61 72 20 2a 6e 61 6d  ], [...char *nam
167b0 65 3b 0a 09 09 73 74 72 75 63 74 20 68 6f 73 74  e;...struct host
167c0 65 6e 74 20 2a 68 65 3b 0a 09 09 73 74 72 75 63  ent *he;...struc
167d0 74 20 68 6f 73 74 65 6e 74 5f 64 61 74 61 20 64  t hostent_data d
167e0 61 74 61 3b 0a 0a 09 09 28 76 6f 69 64 29 20 67  ata;....(void) g
167f0 65 74 68 6f 73 74 62 79 6e 61 6d 65 5f 72 28 6e  ethostbyname_r(n
16800 61 6d 65 2c 20 68 65 2c 20 26 64 61 74 61 29 3b  ame, he, &data);
16810 0a 09 20 20 20 20 5d 2c 20 74 63 6c 5f 63 76 5f  ..    ], tcl_cv_
16820 61 70 69 5f 67 65 74 68 6f 73 74 62 79 6e 61 6d  api_gethostbynam
16830 65 5f 72 5f 33 3d 79 65 73 2c 20 74 63 6c 5f 63  e_r_3=yes, tcl_c
16840 76 5f 61 70 69 5f 67 65 74 68 6f 73 74 62 79 6e  v_api_gethostbyn
16850 61 6d 65 5f 72 5f 33 3d 6e 6f 29 5d 29 0a 09 20  ame_r_3=no)]).. 
16860 20 20 20 74 63 6c 5f 6f 6b 3d 24 74 63 6c 5f 63     tcl_ok=$tcl_c
16870 76 5f 61 70 69 5f 67 65 74 68 6f 73 74 62 79 6e  v_api_gethostbyn
16880 61 6d 65 5f 72 5f 33 0a 09 20 20 20 20 69 66 20  ame_r_3..    if 
16890 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d  test "$tcl_ok" =
168a0 20 79 65 73 3b 20 74 68 65 6e 0a 09 09 41 43 5f   yes; then...AC_
168b0 44 45 46 49 4e 45 28 48 41 56 45 5f 47 45 54 48  DEFINE(HAVE_GETH
168c0 4f 53 54 42 59 4e 41 4d 45 5f 52 5f 33 2c 20 31  OSTBYNAME_R_3, 1
168d0 2c 0a 09 09 20 20 20 20 5b 44 65 66 69 6e 65 20  ,...    [Define 
168e0 74 6f 20 31 20 69 66 20 67 65 74 68 6f 73 74 62  to 1 if gethostb
168f0 79 6e 61 6d 65 5f 72 20 74 61 6b 65 73 20 33 20  yname_r takes 3 
16900 61 72 67 73 2e 5d 29 0a 09 20 20 20 20 66 69 0a  args.])..    fi.
16910 09 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 69  .fi.    fi.    i
16920 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22  f test "$tcl_ok"
16930 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a 09 41 43   = yes; then..AC
16940 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 47 45 54  _DEFINE(HAVE_GET
16950 48 4f 53 54 42 59 4e 41 4d 45 5f 52 2c 20 31 2c  HOSTBYNAME_R, 1,
16960 0a 09 20 20 20 20 5b 44 65 66 69 6e 65 20 74 6f  ..    [Define to
16970 20 31 20 69 66 20 67 65 74 68 6f 73 74 62 79 6e   1 if gethostbyn
16980 61 6d 65 5f 72 20 69 73 20 61 76 61 69 6c 61 62  ame_r is availab
16990 6c 65 2e 5d 29 0a 20 20 20 20 66 69 0a 5d 29 5d  le.]).    fi.])]
169a0 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  )..#------------
169b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
169c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
169d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
169e0 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 54 43  --------.# SC_TC
169f0 4c 5f 47 45 54 50 57 55 49 44 5f 52 0a 23 0a 23  L_GETPWUID_R.#.#
16a00 09 43 68 65 63 6b 20 69 66 20 77 65 20 68 61 76  .Check if we hav
16a10 65 20 4d 54 2d 73 61 66 65 20 76 61 72 69 61 6e  e MT-safe varian
16a20 74 20 6f 66 20 67 65 74 70 77 75 69 64 28 29 20  t of getpwuid() 
16a30 61 6e 64 20 69 66 20 79 65 73 2c 0a 23 09 77 68  and if yes,.#.wh
16a40 69 63 68 20 6f 6e 65 20 65 78 61 63 74 6c 79 2e  ich one exactly.
16a50 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a  .#.# Arguments:.
16a60 23 09 4e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c  #.None.#.# Resul
16a70 74 73 3a 0a 23 0a 23 09 4d 69 67 68 74 20 64 65  ts:.#.#.Might de
16a80 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69  fine the followi
16a90 6e 67 20 76 61 72 73 3a 0a 23 09 09 48 41 56 45  ng vars:.#..HAVE
16aa0 5f 47 45 54 50 57 55 49 44 5f 52 0a 23 09 09 48  _GETPWUID_R.#..H
16ab0 41 56 45 5f 47 45 54 50 57 55 49 44 5f 52 5f 34  AVE_GETPWUID_R_4
16ac0 0a 23 09 09 48 41 56 45 5f 47 45 54 50 57 55 49  .#..HAVE_GETPWUI
16ad0 44 5f 52 5f 35 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d  D_R_5.#.#-------
16ae0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16af0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16b00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16b10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41  -------------..A
16b20 43 5f 44 45 46 55 4e 28 5b 53 43 5f 54 43 4c 5f  C_DEFUN([SC_TCL_
16b30 47 45 54 50 57 55 49 44 5f 52 5d 2c 20 5b 41 43  GETPWUID_R], [AC
16b40 5f 43 48 45 43 4b 5f 46 55 4e 43 28 67 65 74 70  _CHECK_FUNC(getp
16b50 77 75 69 64 5f 72 2c 20 5b 0a 20 20 20 20 41 43  wuid_r, [.    AC
16b60 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f  _CACHE_CHECK([fo
16b70 72 20 67 65 74 70 77 75 69 64 5f 72 20 77 69 74  r getpwuid_r wit
16b80 68 20 35 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63  h 5 args], tcl_c
16b90 76 5f 61 70 69 5f 67 65 74 70 77 75 69 64 5f 72  v_api_getpwuid_r
16ba0 5f 35 2c 20 5b 0a 20 20 20 20 41 43 5f 54 52 59  _5, [.    AC_TRY
16bb0 5f 43 4f 4d 50 49 4c 45 28 5b 0a 09 23 69 6e 63  _COMPILE([..#inc
16bc0 6c 75 64 65 20 3c 73 79 73 2f 74 79 70 65 73 2e  lude <sys/types.
16bd0 68 3e 0a 09 23 69 6e 63 6c 75 64 65 20 3c 70 77  h>..#include <pw
16be0 64 2e 68 3e 0a 20 20 20 20 5d 2c 20 5b 0a 09 75  d.h>.    ], [..u
16bf0 69 64 5f 74 20 75 69 64 3b 0a 09 73 74 72 75 63  id_t uid;..struc
16c00 74 20 70 61 73 73 77 64 20 70 77 2c 20 2a 70 77  t passwd pw, *pw
16c10 70 3b 0a 09 63 68 61 72 20 62 75 66 5b 35 31 32  p;..char buf[512
16c20 5d 3b 0a 09 69 6e 74 20 62 75 66 6c 65 6e 20 3d  ];..int buflen =
16c30 20 35 31 32 3b 0a 0a 09 28 76 6f 69 64 29 20 67   512;...(void) g
16c40 65 74 70 77 75 69 64 5f 72 28 75 69 64 2c 20 26  etpwuid_r(uid, &
16c50 70 77 2c 20 62 75 66 2c 20 62 75 66 6c 65 6e 2c  pw, buf, buflen,
16c60 20 26 70 77 70 29 3b 0a 20 20 20 20 5d 2c 20 74   &pwp);.    ], t
16c70 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 70 77 75  cl_cv_api_getpwu
16c80 69 64 5f 72 5f 35 3d 79 65 73 2c 20 74 63 6c 5f  id_r_5=yes, tcl_
16c90 63 76 5f 61 70 69 5f 67 65 74 70 77 75 69 64 5f  cv_api_getpwuid_
16ca0 72 5f 35 3d 6e 6f 29 5d 29 0a 20 20 20 20 74 63  r_5=no)]).    tc
16cb0 6c 5f 6f 6b 3d 24 74 63 6c 5f 63 76 5f 61 70 69  l_ok=$tcl_cv_api
16cc0 5f 67 65 74 70 77 75 69 64 5f 72 5f 35 0a 20 20  _getpwuid_r_5.  
16cd0 20 20 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f    if test "$tcl_
16ce0 6f 6b 22 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a  ok" = yes; then.
16cf0 09 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45 5f  .AC_DEFINE(HAVE_
16d00 47 45 54 50 57 55 49 44 5f 52 5f 35 2c 20 31 2c  GETPWUID_R_5, 1,
16d10 0a 09 20 20 20 20 5b 44 65 66 69 6e 65 20 74 6f  ..    [Define to
16d20 20 31 20 69 66 20 67 65 74 70 77 75 69 64 5f 72   1 if getpwuid_r
16d30 20 74 61 6b 65 73 20 35 20 61 72 67 73 2e 5d 29   takes 5 args.])
16d40 0a 20 20 20 20 65 6c 73 65 0a 09 41 43 5f 43 41  .    else..AC_CA
16d50 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20 67  CHE_CHECK([for g
16d60 65 74 70 77 75 69 64 5f 72 20 77 69 74 68 20 34  etpwuid_r with 4
16d70 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63 76 5f 61   args], tcl_cv_a
16d80 70 69 5f 67 65 74 70 77 75 69 64 5f 72 5f 34 2c  pi_getpwuid_r_4,
16d90 20 5b 0a 09 41 43 5f 54 52 59 5f 43 4f 4d 50 49   [..AC_TRY_COMPI
16da0 4c 45 28 5b 0a 09 20 20 20 20 23 69 6e 63 6c 75  LE([..    #inclu
16db0 64 65 20 3c 73 79 73 2f 74 79 70 65 73 2e 68 3e  de <sys/types.h>
16dc0 0a 09 20 20 20 20 23 69 6e 63 6c 75 64 65 20 3c  ..    #include <
16dd0 70 77 64 2e 68 3e 0a 09 5d 2c 20 5b 0a 09 20 20  pwd.h>..], [..  
16de0 20 20 75 69 64 5f 74 20 75 69 64 3b 0a 09 20 20    uid_t uid;..  
16df0 20 20 73 74 72 75 63 74 20 70 61 73 73 77 64 20    struct passwd 
16e00 70 77 3b 0a 09 20 20 20 20 63 68 61 72 20 62 75  pw;..    char bu
16e10 66 5b 35 31 32 5d 3b 0a 09 20 20 20 20 69 6e 74  f[512];..    int
16e20 20 62 75 66 6c 65 6e 20 3d 20 35 31 32 3b 0a 0a   buflen = 512;..
16e30 09 20 20 20 20 28 76 6f 69 64 29 67 65 74 70 77  .    (void)getpw
16e40 6e 61 6d 5f 72 28 75 69 64 2c 20 26 70 77 2c 20  nam_r(uid, &pw, 
16e50 62 75 66 2c 20 62 75 66 6c 65 6e 29 3b 0a 09 5d  buf, buflen);..]
16e60 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74  , tcl_cv_api_get
16e70 70 77 75 69 64 5f 72 5f 34 3d 79 65 73 2c 20 74  pwuid_r_4=yes, t
16e80 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 70 77 75  cl_cv_api_getpwu
16e90 69 64 5f 72 5f 34 3d 6e 6f 29 5d 29 0a 09 74 63  id_r_4=no)])..tc
16ea0 6c 5f 6f 6b 3d 24 74 63 6c 5f 63 76 5f 61 70 69  l_ok=$tcl_cv_api
16eb0 5f 67 65 74 70 77 75 69 64 5f 72 5f 34 0a 09 69  _getpwuid_r_4..i
16ec0 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22  f test "$tcl_ok"
16ed0 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a 09 20 20   = yes; then..  
16ee0 20 20 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45    AC_DEFINE(HAVE
16ef0 5f 47 45 54 50 57 55 49 44 5f 52 5f 34 2c 20 31  _GETPWUID_R_4, 1
16f00 2c 0a 09 09 5b 44 65 66 69 6e 65 20 74 6f 20 31  ,...[Define to 1
16f10 20 69 66 20 67 65 74 70 77 75 69 64 5f 72 20 74   if getpwuid_r t
16f20 61 6b 65 73 20 34 20 61 72 67 73 2e 5d 29 0a 09  akes 4 args.])..
16f30 66 69 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  fi.    fi.    if
16f40 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20   test "$tcl_ok" 
16f50 3d 20 79 65 73 3b 20 74 68 65 6e 0a 09 41 43 5f  = yes; then..AC_
16f60 44 45 46 49 4e 45 28 48 41 56 45 5f 47 45 54 50  DEFINE(HAVE_GETP
16f70 57 55 49 44 5f 52 2c 20 31 2c 0a 09 20 20 20 20  WUID_R, 1,..    
16f80 5b 44 65 66 69 6e 65 20 74 6f 20 31 20 69 66 20  [Define to 1 if 
16f90 67 65 74 70 77 75 69 64 5f 72 20 69 73 20 61 76  getpwuid_r is av
16fa0 61 69 6c 61 62 6c 65 2e 5d 29 0a 20 20 20 20 66  ailable.]).    f
16fb0 69 0a 5d 29 5d 29 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  i.])])..#-------
16fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16fd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16fe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16ff0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
17000 53 43 5f 54 43 4c 5f 47 45 54 50 57 4e 41 4d 5f  SC_TCL_GETPWNAM_
17010 52 0a 23 0a 23 09 43 68 65 63 6b 20 69 66 20 77  R.#.#.Check if w
17020 65 20 68 61 76 65 20 4d 54 2d 73 61 66 65 20 76  e have MT-safe v
17030 61 72 69 61 6e 74 20 6f 66 20 67 65 74 70 77 6e  ariant of getpwn
17040 61 6d 28 29 20 61 6e 64 20 69 66 20 79 65 73 2c  am() and if yes,
17050 0a 23 09 77 68 69 63 68 20 6f 6e 65 20 65 78 61  .#.which one exa
17060 63 74 6c 79 2e 0a 23 0a 23 20 41 72 67 75 6d 65  ctly..#.# Argume
17070 6e 74 73 3a 0a 23 09 4e 6f 6e 65 0a 23 0a 23 20  nts:.#.None.#.# 
17080 52 65 73 75 6c 74 73 3a 0a 23 0a 23 09 4d 69 67  Results:.#.#.Mig
17090 68 74 20 64 65 66 69 6e 65 20 74 68 65 20 66 6f  ht define the fo
170a0 6c 6c 6f 77 69 6e 67 20 76 61 72 73 3a 0a 23 09  llowing vars:.#.
170b0 09 48 41 56 45 5f 47 45 54 50 57 4e 41 4d 5f 52  .HAVE_GETPWNAM_R
170c0 0a 23 09 09 48 41 56 45 5f 47 45 54 50 57 4e 41  .#..HAVE_GETPWNA
170d0 4d 5f 52 5f 34 0a 23 09 09 48 41 56 45 5f 47 45  M_R_4.#..HAVE_GE
170e0 54 50 57 4e 41 4d 5f 52 5f 35 0a 23 0a 23 2d 2d  TPWNAM_R_5.#.#--
170f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17100 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17110 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17120 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17130 2d 2d 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 53 43  --..AC_DEFUN([SC
17140 5f 54 43 4c 5f 47 45 54 50 57 4e 41 4d 5f 52 5d  _TCL_GETPWNAM_R]
17150 2c 20 5b 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43  , [AC_CHECK_FUNC
17160 28 67 65 74 70 77 6e 61 6d 5f 72 2c 20 5b 0a 20  (getpwnam_r, [. 
17170 20 20 20 41 43 5f 43 41 43 48 45 5f 43 48 45 43     AC_CACHE_CHEC
17180 4b 28 5b 66 6f 72 20 67 65 74 70 77 6e 61 6d 5f  K([for getpwnam_
17190 72 20 77 69 74 68 20 35 20 61 72 67 73 5d 2c 20  r with 5 args], 
171a0 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 70 77  tcl_cv_api_getpw
171b0 6e 61 6d 5f 72 5f 35 2c 20 5b 0a 20 20 20 20 41  nam_r_5, [.    A
171c0 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28 5b 0a  C_TRY_COMPILE([.
171d0 09 23 69 6e 63 6c 75 64 65 20 3c 73 79 73 2f 74  .#include <sys/t
171e0 79 70 65 73 2e 68 3e 0a 09 23 69 6e 63 6c 75 64  ypes.h>..#includ
171f0 65 20 3c 70 77 64 2e 68 3e 0a 20 20 20 20 5d 2c  e <pwd.h>.    ],
17200 20 5b 0a 09 63 68 61 72 20 2a 6e 61 6d 65 3b 0a   [..char *name;.
17210 09 73 74 72 75 63 74 20 70 61 73 73 77 64 20 70  .struct passwd p
17220 77 2c 20 2a 70 77 70 3b 0a 09 63 68 61 72 20 62  w, *pwp;..char b
17230 75 66 5b 35 31 32 5d 3b 0a 09 69 6e 74 20 62 75  uf[512];..int bu
17240 66 6c 65 6e 20 3d 20 35 31 32 3b 0a 0a 09 28 76  flen = 512;...(v
17250 6f 69 64 29 20 67 65 74 70 77 6e 61 6d 5f 72 28  oid) getpwnam_r(
17260 6e 61 6d 65 2c 20 26 70 77 2c 20 62 75 66 2c 20  name, &pw, buf, 
17270 62 75 66 6c 65 6e 2c 20 26 70 77 70 29 3b 0a 20  buflen, &pwp);. 
17280 20 20 20 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69     ], tcl_cv_api
17290 5f 67 65 74 70 77 6e 61 6d 5f 72 5f 35 3d 79 65  _getpwnam_r_5=ye
172a0 73 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65  s, tcl_cv_api_ge
172b0 74 70 77 6e 61 6d 5f 72 5f 35 3d 6e 6f 29 5d 29  tpwnam_r_5=no)])
172c0 0a 20 20 20 20 74 63 6c 5f 6f 6b 3d 24 74 63 6c  .    tcl_ok=$tcl
172d0 5f 63 76 5f 61 70 69 5f 67 65 74 70 77 6e 61 6d  _cv_api_getpwnam
172e0 5f 72 5f 35 0a 20 20 20 20 69 66 20 74 65 73 74  _r_5.    if test
172f0 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 79 65 73   "$tcl_ok" = yes
17300 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e  ; then..AC_DEFIN
17310 45 28 48 41 56 45 5f 47 45 54 50 57 4e 41 4d 5f  E(HAVE_GETPWNAM_
17320 52 5f 35 2c 20 31 2c 0a 09 20 20 20 20 5b 44 65  R_5, 1,..    [De
17330 66 69 6e 65 20 74 6f 20 31 20 69 66 20 67 65 74  fine to 1 if get
17340 70 77 6e 61 6d 5f 72 20 74 61 6b 65 73 20 35 20  pwnam_r takes 5 
17350 61 72 67 73 2e 5d 29 0a 20 20 20 20 65 6c 73 65  args.]).    else
17360 0a 09 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b  ..AC_CACHE_CHECK
17370 28 5b 66 6f 72 20 67 65 74 70 77 6e 61 6d 5f 72  ([for getpwnam_r
17380 20 77 69 74 68 20 34 20 61 72 67 73 5d 2c 20 74   with 4 args], t
17390 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 70 77 6e  cl_cv_api_getpwn
173a0 61 6d 5f 72 5f 34 2c 20 5b 0a 09 41 43 5f 54 52  am_r_4, [..AC_TR
173b0 59 5f 43 4f 4d 50 49 4c 45 28 5b 0a 09 20 20 20  Y_COMPILE([..   
173c0 20 23 69 6e 63 6c 75 64 65 20 3c 73 79 73 2f 74   #include <sys/t
173d0 79 70 65 73 2e 68 3e 0a 09 20 20 20 20 23 69 6e  ypes.h>..    #in
173e0 63 6c 75 64 65 20 3c 70 77 64 2e 68 3e 0a 09 5d  clude <pwd.h>..]
173f0 2c 20 5b 0a 09 20 20 20 20 63 68 61 72 20 2a 6e  , [..    char *n
17400 61 6d 65 3b 0a 09 20 20 20 20 73 74 72 75 63 74  ame;..    struct
17410 20 70 61 73 73 77 64 20 70 77 3b 0a 09 20 20 20   passwd pw;..   
17420 20 63 68 61 72 20 62 75 66 5b 35 31 32 5d 3b 0a   char buf[512];.
17430 09 20 20 20 20 69 6e 74 20 62 75 66 6c 65 6e 20  .    int buflen 
17440 3d 20 35 31 32 3b 0a 0a 09 20 20 20 20 28 76 6f  = 512;...    (vo
17450 69 64 29 67 65 74 70 77 6e 61 6d 5f 72 28 6e 61  id)getpwnam_r(na
17460 6d 65 2c 20 26 70 77 2c 20 62 75 66 2c 20 62 75  me, &pw, buf, bu
17470 66 6c 65 6e 29 3b 0a 09 5d 2c 20 74 63 6c 5f 63  flen);..], tcl_c
17480 76 5f 61 70 69 5f 67 65 74 70 77 6e 61 6d 5f 72  v_api_getpwnam_r
17490 5f 34 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f 61  _4=yes, tcl_cv_a
174a0 70 69 5f 67 65 74 70 77 6e 61 6d 5f 72 5f 34 3d  pi_getpwnam_r_4=
174b0 6e 6f 29 5d 29 0a 09 74 63 6c 5f 6f 6b 3d 24 74  no)])..tcl_ok=$t
174c0 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 70 77 6e  cl_cv_api_getpwn
174d0 61 6d 5f 72 5f 34 0a 09 69 66 20 74 65 73 74 20  am_r_4..if test 
174e0 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 79 65 73 3b  "$tcl_ok" = yes;
174f0 20 74 68 65 6e 0a 09 20 20 20 20 41 43 5f 44 45   then..    AC_DE
17500 46 49 4e 45 28 48 41 56 45 5f 47 45 54 50 57 4e  FINE(HAVE_GETPWN
17510 41 4d 5f 52 5f 34 2c 20 31 2c 0a 09 09 5b 44 65  AM_R_4, 1,...[De
17520 66 69 6e 65 20 74 6f 20 31 20 69 66 20 67 65 74  fine to 1 if get
17530 70 77 6e 61 6d 5f 72 20 74 61 6b 65 73 20 34 20  pwnam_r takes 4 
17540 61 72 67 73 2e 5d 29 0a 09 66 69 0a 20 20 20 20  args.])..fi.    
17550 66 69 0a 20 20 20 20 69 66 20 74 65 73 74 20 22  fi.    if test "
17560 24 74 63 6c 5f 6f 6b 22 20 3d 20 79 65 73 3b 20  $tcl_ok" = yes; 
17570 74 68 65 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28  then..AC_DEFINE(
17580 48 41 56 45 5f 47 45 54 50 57 4e 41 4d 5f 52 2c  HAVE_GETPWNAM_R,
17590 20 31 2c 0a 09 20 20 20 20 5b 44 65 66 69 6e 65   1,..    [Define
175a0 20 74 6f 20 31 20 69 66 20 67 65 74 70 77 6e 61   to 1 if getpwna
175b0 6d 5f 72 20 69 73 20 61 76 61 69 6c 61 62 6c 65  m_r is available
175c0 2e 5d 29 0a 20 20 20 20 66 69 0a 5d 29 5d 29 0a  .]).    fi.])]).
175d0 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
175e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
175f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17610 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 54 43 4c 5f  ------.# SC_TCL_
17620 47 45 54 47 52 47 49 44 5f 52 0a 23 0a 23 09 43  GETGRGID_R.#.#.C
17630 68 65 63 6b 20 69 66 20 77 65 20 68 61 76 65 20  heck if we have 
17640 4d 54 2d 73 61 66 65 20 76 61 72 69 61 6e 74 20  MT-safe variant 
17650 6f 66 20 67 65 74 67 72 67 69 64 28 29 20 61 6e  of getgrgid() an
17660 64 20 69 66 20 79 65 73 2c 0a 23 09 77 68 69 63  d if yes,.#.whic
17670 68 20 6f 6e 65 20 65 78 61 63 74 6c 79 2e 0a 23  h one exactly..#
17680 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a 0a 23 09  .# Arguments:.#.
17690 4e 6f 6e 65 0a 23 0a 23 20 52 65 73 75 6c 74 73  None.#.# Results
176a0 3a 0a 23 0a 23 09 4d 69 67 68 74 20 64 65 66 69  :.#.#.Might defi
176b0 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  ne the following
176c0 20 76 61 72 73 3a 0a 23 09 09 48 41 56 45 5f 47   vars:.#..HAVE_G
176d0 45 54 47 52 47 49 44 5f 52 0a 23 09 09 48 41 56  ETGRGID_R.#..HAV
176e0 45 5f 47 45 54 47 52 47 49 44 5f 52 5f 34 0a 23  E_GETGRGID_R_4.#
176f0 09 09 48 41 56 45 5f 47 45 54 47 52 47 49 44 5f  ..HAVE_GETGRGID_
17700 52 5f 35 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  R_5.#.#---------
17710 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17720 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17730 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
17740 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 41 43 5f  -----------..AC_
17750 44 45 46 55 4e 28 5b 53 43 5f 54 43 4c 5f 47 45  DEFUN([SC_TCL_GE
17760 54 47 52 47 49 44 5f 52 5d 2c 20 5b 41 43 5f 43  TGRGID_R], [AC_C
17770 48 45 43 4b 5f 46 55 4e 43 28 67 65 74 67 72 67  HECK_FUNC(getgrg
17780 69 64 5f 72 2c 20 5b 0a 20 20 20 20 41 43 5f 43  id_r, [.    AC_C
17790 41 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f 72 20  ACHE_CHECK([for 
177a0 67 65 74 67 72 67 69 64 5f 72 20 77 69 74 68 20  getgrgid_r with 
177b0 35 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63 76 5f  5 args], tcl_cv_
177c0 61 70 69 5f 67 65 74 67 72 67 69 64 5f 72 5f 35  api_getgrgid_r_5
177d0 2c 20 5b 0a 20 20 20 20 41 43 5f 54 52 59 5f 43  , [.    AC_TRY_C
177e0 4f 4d 50 49 4c 45 28 5b 0a 09 23 69 6e 63 6c 75  OMPILE([..#inclu
177f0 64 65 20 3c 73 79 73 2f 74 79 70 65 73 2e 68 3e  de <sys/types.h>
17800 0a 09 23 69 6e 63 6c 75 64 65 20 3c 67 72 70 2e  ..#include <grp.
17810 68 3e 0a 20 20 20 20 5d 2c 20 5b 0a 09 67 69 64  h>.    ], [..gid
17820 5f 74 20 67 69 64 3b 0a 09 73 74 72 75 63 74 20  _t gid;..struct 
17830 67 72 6f 75 70 20 67 72 2c 20 2a 67 72 70 3b 0a  group gr, *grp;.
17840 09 63 68 61 72 20 62 75 66 5b 35 31 32 5d 3b 0a  .char buf[512];.
17850 09 69 6e 74 20 62 75 66 6c 65 6e 20 3d 20 35 31  .int buflen = 51
17860 32 3b 0a 0a 09 28 76 6f 69 64 29 20 67 65 74 67  2;...(void) getg
17870 72 67 69 64 5f 72 28 67 69 64 2c 20 26 67 72 2c  rgid_r(gid, &gr,
17880 20 62 75 66 2c 20 62 75 66 6c 65 6e 2c 20 26 67   buf, buflen, &g
17890 72 70 29 3b 0a 20 20 20 20 5d 2c 20 74 63 6c 5f  rp);.    ], tcl_
178a0 63 76 5f 61 70 69 5f 67 65 74 67 72 67 69 64 5f  cv_api_getgrgid_
178b0 72 5f 35 3d 79 65 73 2c 20 74 63 6c 5f 63 76 5f  r_5=yes, tcl_cv_
178c0 61 70 69 5f 67 65 74 67 72 67 69 64 5f 72 5f 35  api_getgrgid_r_5
178d0 3d 6e 6f 29 5d 29 0a 20 20 20 20 74 63 6c 5f 6f  =no)]).    tcl_o
178e0 6b 3d 24 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65  k=$tcl_cv_api_ge
178f0 74 67 72 67 69 64 5f 72 5f 35 0a 20 20 20 20 69  tgrgid_r_5.    i
17900 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f 6b 22  f test "$tcl_ok"
17910 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a 09 41 43   = yes; then..AC
17920 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 47 45 54  _DEFINE(HAVE_GET
17930 47 52 47 49 44 5f 52 5f 35 2c 20 31 2c 0a 09 20  GRGID_R_5, 1,.. 
17940 20 20 20 5b 44 65 66 69 6e 65 20 74 6f 20 31 20     [Define to 1 
17950 69 66 20 67 65 74 67 72 67 69 64 5f 72 20 74 61  if getgrgid_r ta
17960 6b 65 73 20 35 20 61 72 67 73 2e 5d 29 0a 20 20  kes 5 args.]).  
17970 20 20 65 6c 73 65 0a 09 41 43 5f 43 41 43 48 45    else..AC_CACHE
17980 5f 43 48 45 43 4b 28 5b 66 6f 72 20 67 65 74 67  _CHECK([for getg
17990 72 67 69 64 5f 72 20 77 69 74 68 20 34 20 61 72  rgid_r with 4 ar
179a0 67 73 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f  gs], tcl_cv_api_
179b0 67 65 74 67 72 67 69 64 5f 72 5f 34 2c 20 5b 0a  getgrgid_r_4, [.
179c0 09 41 43 5f 54 52 59 5f 43 4f 4d 50 49 4c 45 28  .AC_TRY_COMPILE(
179d0 5b 0a 09 20 20 20 20 23 69 6e 63 6c 75 64 65 20  [..    #include 
179e0 3c 73 79 73 2f 74 79 70 65 73 2e 68 3e 0a 09 20  <sys/types.h>.. 
179f0 20 20 20 23 69 6e 63 6c 75 64 65 20 3c 67 72 70     #include <grp
17a00 2e 68 3e 0a 09 5d 2c 20 5b 0a 09 20 20 20 20 67  .h>..], [..    g
17a10 69 64 5f 74 20 67 69 64 3b 0a 09 20 20 20 20 73  id_t gid;..    s
17a20 74 72 75 63 74 20 67 72 6f 75 70 20 67 72 3b 0a  truct group gr;.
17a30 09 20 20 20 20 63 68 61 72 20 62 75 66 5b 35 31  .    char buf[51
17a40 32 5d 3b 0a 09 20 20 20 20 69 6e 74 20 62 75 66  2];..    int buf
17a50 6c 65 6e 20 3d 20 35 31 32 3b 0a 0a 09 20 20 20  len = 512;...   
17a60 20 28 76 6f 69 64 29 67 65 74 67 72 67 69 64 5f   (void)getgrgid_
17a70 72 28 67 69 64 2c 20 26 67 72 2c 20 62 75 66 2c  r(gid, &gr, buf,
17a80 20 62 75 66 6c 65 6e 29 3b 0a 09 5d 2c 20 74 63   buflen);..], tc
17a90 6c 5f 63 76 5f 61 70 69 5f 67 65 74 67 72 67 69  l_cv_api_getgrgi
17aa0 64 5f 72 5f 34 3d 79 65 73 2c 20 74 63 6c 5f 63  d_r_4=yes, tcl_c
17ab0 76 5f 61 70 69 5f 67 65 74 67 72 67 69 64 5f 72  v_api_getgrgid_r
17ac0 5f 34 3d 6e 6f 29 5d 29 0a 09 74 63 6c 5f 6f 6b  _4=no)])..tcl_ok
17ad0 3d 24 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74  =$tcl_cv_api_get
17ae0 67 72 67 69 64 5f 72 5f 34 0a 09 69 66 20 74 65  grgid_r_4..if te
17af0 73 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 79  st "$tcl_ok" = y
17b00 65 73 3b 20 74 68 65 6e 0a 09 20 20 20 20 41 43  es; then..    AC
17b10 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 47 45 54  _DEFINE(HAVE_GET
17b20 47 52 47 49 44 5f 52 5f 34 2c 20 31 2c 0a 09 09  GRGID_R_4, 1,...
17b30 5b 44 65 66 69 6e 65 20 74 6f 20 31 20 69 66 20  [Define to 1 if 
17b40 67 65 74 67 72 67 69 64 5f 72 20 74 61 6b 65 73  getgrgid_r takes
17b50 20 34 20 61 72 67 73 2e 5d 29 0a 09 66 69 0a 20   4 args.])..fi. 
17b60 20 20 20 66 69 0a 20 20 20 20 69 66 20 74 65 73     fi.    if tes
17b70 74 20 22 24 74 63 6c 5f 6f 6b 22 20 3d 20 79 65  t "$tcl_ok" = ye
17b80 73 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49  s; then..AC_DEFI
17b90 4e 45 28 48 41 56 45 5f 47 45 54 47 52 47 49 44  NE(HAVE_GETGRGID
17ba0 5f 52 2c 20 31 2c 0a 09 20 20 20 20 5b 44 65 66  _R, 1,..    [Def
17bb0 69 6e 65 20 74 6f 20 31 20 69 66 20 67 65 74 67  ine to 1 if getg
17bc0 72 67 69 64 5f 72 20 69 73 20 61 76 61 69 6c 61  rgid_r is availa
17bd0 62 6c 65 2e 5d 29 0a 20 20 20 20 66 69 0a 5d 29  ble.]).    fi.])
17be0 5d 29 0a 0a 23 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 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 53 43 5f 54  ---------.# SC_T
17c30 43 4c 5f 47 45 54 47 52 4e 41 4d 5f 52 0a 23 0a  CL_GETGRNAM_R.#.
17c40 23 09 43 68 65 63 6b 20 69 66 20 77 65 20 68 61  #.Check if we ha
17c50 76 65 20 4d 54 2d 73 61 66 65 20 76 61 72 69 61  ve MT-safe varia
17c60 6e 74 20 6f 66 20 67 65 74 67 72 6e 61 6d 28 29  nt of getgrnam()
17c70 20 61 6e 64 20 69 66 20 79 65 73 2c 0a 23 09 77   and if yes,.#.w
17c80 68 69 63 68 20 6f 6e 65 20 65 78 61 63 74 6c 79  hich one exactly
17c90 2e 0a 23 0a 23 20 41 72 67 75 6d 65 6e 74 73 3a  ..#.# Arguments:
17ca0 0a 23 09 4e 6f 6e 65 0a 23 0a 23 20 52 65 73 75  .#.None.#.# Resu
17cb0 6c 74 73 3a 0a 23 0a 23 09 4d 69 67 68 74 20 64  lts:.#.#.Might d
17cc0 65 66 69 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77  efine the follow
17cd0 69 6e 67 20 76 61 72 73 3a 0a 23 09 09 48 41 56  ing vars:.#..HAV
17ce0 45 5f 47 45 54 47 52 4e 41 4d 5f 52 0a 23 09 09  E_GETGRNAM_R.#..
17cf0 48 41 56 45 5f 47 45 54 47 52 4e 41 4d 5f 52 5f  HAVE_GETGRNAM_R_
17d00 34 0a 23 09 09 48 41 56 45 5f 47 45 54 47 52 4e  4.#..HAVE_GETGRN
17d10 41 4d 5f 52 5f 35 0a 23 0a 23 2d 2d 2d 2d 2d 2d  AM_R_5.#.#------
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 2d 2d 2d 2d 2d 2d 2d 0a 0a  --------------..
17d60 41 43 5f 44 45 46 55 4e 28 5b 53 43 5f 54 43 4c  AC_DEFUN([SC_TCL
17d70 5f 47 45 54 47 52 4e 41 4d 5f 52 5d 2c 20 5b 41  _GETGRNAM_R], [A
17d80 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 67 65 74  C_CHECK_FUNC(get
17d90 67 72 6e 61 6d 5f 72 2c 20 5b 0a 20 20 20 20 41  grnam_r, [.    A
17da0 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66  C_CACHE_CHECK([f
17db0 6f 72 20 67 65 74 67 72 6e 61 6d 5f 72 20 77 69  or getgrnam_r wi
17dc0 74 68 20 35 20 61 72 67 73 5d 2c 20 74 63 6c 5f  th 5 args], tcl_
17dd0 63 76 5f 61 70 69 5f 67 65 74 67 72 6e 61 6d 5f  cv_api_getgrnam_
17de0 72 5f 35 2c 20 5b 0a 20 20 20 20 41 43 5f 54 52  r_5, [.    AC_TR
17df0 59 5f 43 4f 4d 50 49 4c 45 28 5b 0a 09 23 69 6e  Y_COMPILE([..#in
17e00 63 6c 75 64 65 20 3c 73 79 73 2f 74 79 70 65 73  clude <sys/types
17e10 2e 68 3e 0a 09 23 69 6e 63 6c 75 64 65 20 3c 67  .h>..#include <g
17e20 72 70 2e 68 3e 0a 20 20 20 20 5d 2c 20 5b 0a 09  rp.h>.    ], [..
17e30 63 68 61 72 20 2a 6e 61 6d 65 3b 0a 09 73 74 72  char *name;..str
17e40 75 63 74 20 67 72 6f 75 70 20 67 72 2c 20 2a 67  uct group gr, *g
17e50 72 70 3b 0a 09 63 68 61 72 20 62 75 66 5b 35 31  rp;..char buf[51
17e60 32 5d 3b 0a 09 69 6e 74 20 62 75 66 6c 65 6e 20  2];..int buflen 
17e70 3d 20 35 31 32 3b 0a 0a 09 28 76 6f 69 64 29 20  = 512;...(void) 
17e80 67 65 74 67 72 6e 61 6d 5f 72 28 6e 61 6d 65 2c  getgrnam_r(name,
17e90 20 26 67 72 2c 20 62 75 66 2c 20 62 75 66 6c 65   &gr, buf, bufle
17ea0 6e 2c 20 26 67 72 70 29 3b 0a 20 20 20 20 5d 2c  n, &grp);.    ],
17eb0 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74 67   tcl_cv_api_getg
17ec0 72 6e 61 6d 5f 72 5f 35 3d 79 65 73 2c 20 74 63  rnam_r_5=yes, tc
17ed0 6c 5f 63 76 5f 61 70 69 5f 67 65 74 67 72 6e 61  l_cv_api_getgrna
17ee0 6d 5f 72 5f 35 3d 6e 6f 29 5d 29 0a 20 20 20 20  m_r_5=no)]).    
17ef0 74 63 6c 5f 6f 6b 3d 24 74 63 6c 5f 63 76 5f 61  tcl_ok=$tcl_cv_a
17f00 70 69 5f 67 65 74 67 72 6e 61 6d 5f 72 5f 35 0a  pi_getgrnam_r_5.
17f10 20 20 20 20 69 66 20 74 65 73 74 20 22 24 74 63      if test "$tc
17f20 6c 5f 6f 6b 22 20 3d 20 79 65 73 3b 20 74 68 65  l_ok" = yes; the
17f30 6e 0a 09 41 43 5f 44 45 46 49 4e 45 28 48 41 56  n..AC_DEFINE(HAV
17f40 45 5f 47 45 54 47 52 4e 41 4d 5f 52 5f 35 2c 20  E_GETGRNAM_R_5, 
17f50 31 2c 0a 09 20 20 20 20 5b 44 65 66 69 6e 65 20  1,..    [Define 
17f60 74 6f 20 31 20 69 66 20 67 65 74 67 72 6e 61 6d  to 1 if getgrnam
17f70 5f 72 20 74 61 6b 65 73 20 35 20 61 72 67 73 2e  _r takes 5 args.
17f80 5d 29 0a 20 20 20 20 65 6c 73 65 0a 09 41 43 5f  ]).    else..AC_
17f90 43 41 43 48 45 5f 43 48 45 43 4b 28 5b 66 6f 72  CACHE_CHECK([for
17fa0 20 67 65 74 67 72 6e 61 6d 5f 72 20 77 69 74 68   getgrnam_r with
17fb0 20 34 20 61 72 67 73 5d 2c 20 74 63 6c 5f 63 76   4 args], tcl_cv
17fc0 5f 61 70 69 5f 67 65 74 67 72 6e 61 6d 5f 72 5f  _api_getgrnam_r_
17fd0 34 2c 20 5b 0a 09 41 43 5f 54 52 59 5f 43 4f 4d  4, [..AC_TRY_COM
17fe0 50 49 4c 45 28 5b 0a 09 20 20 20 20 23 69 6e 63  PILE([..    #inc
17ff0 6c 75 64 65 20 3c 73 79 73 2f 74 79 70 65 73 2e  lude <sys/types.
18000 68 3e 0a 09 20 20 20 20 23 69 6e 63 6c 75 64 65  h>..    #include
18010 20 3c 67 72 70 2e 68 3e 0a 09 5d 2c 20 5b 0a 09   <grp.h>..], [..
18020 20 20 20 20 63 68 61 72 20 2a 6e 61 6d 65 3b 0a      char *name;.
18030 09 20 20 20 20 73 74 72 75 63 74 20 67 72 6f 75  .    struct grou
18040 70 20 67 72 3b 0a 09 20 20 20 20 63 68 61 72 20  p gr;..    char 
18050 62 75 66 5b 35 31 32 5d 3b 0a 09 20 20 20 20 69  buf[512];..    i
18060 6e 74 20 62 75 66 6c 65 6e 20 3d 20 35 31 32 3b  nt buflen = 512;
18070 0a 0a 09 20 20 20 20 28 76 6f 69 64 29 67 65 74  ...    (void)get
18080 67 72 6e 61 6d 5f 72 28 6e 61 6d 65 2c 20 26 67  grnam_r(name, &g
18090 72 2c 20 62 75 66 2c 20 62 75 66 6c 65 6e 29 3b  r, buf, buflen);
180a0 0a 09 5d 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f  ..], tcl_cv_api_
180b0 67 65 74 67 72 6e 61 6d 5f 72 5f 34 3d 79 65 73  getgrnam_r_4=yes
180c0 2c 20 74 63 6c 5f 63 76 5f 61 70 69 5f 67 65 74  , tcl_cv_api_get
180d0 67 72 6e 61 6d 5f 72 5f 34 3d 6e 6f 29 5d 29 0a  grnam_r_4=no)]).
180e0 09 74 63 6c 5f 6f 6b 3d 24 74 63 6c 5f 63 76 5f  .tcl_ok=$tcl_cv_
180f0 61 70 69 5f 67 65 74 67 72 6e 61 6d 5f 72 5f 34  api_getgrnam_r_4
18100 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f  ..if test "$tcl_
18110 6f 6b 22 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a  ok" = yes; then.
18120 09 20 20 20 20 41 43 5f 44 45 46 49 4e 45 28 48  .    AC_DEFINE(H
18130 41 56 45 5f 47 45 54 47 52 4e 41 4d 5f 52 5f 34  AVE_GETGRNAM_R_4
18140 2c 20 31 2c 0a 09 09 5b 44 65 66 69 6e 65 20 74  , 1,...[Define t
18150 6f 20 31 20 69 66 20 67 65 74 67 72 6e 61 6d 5f  o 1 if getgrnam_
18160 72 20 74 61 6b 65 73 20 34 20 61 72 67 73 2e 5d  r takes 4 args.]
18170 29 0a 09 66 69 0a 20 20 20 20 66 69 0a 20 20 20  )..fi.    fi.   
18180 20 69 66 20 74 65 73 74 20 22 24 74 63 6c 5f 6f   if test "$tcl_o
18190 6b 22 20 3d 20 79 65 73 3b 20 74 68 65 6e 0a 09  k" = yes; then..
181a0 41 43 5f 44 45 46 49 4e 45 28 48 41 56 45 5f 47  AC_DEFINE(HAVE_G
181b0 45 54 47 52 4e 41 4d 5f 52 2c 20 31 2c 0a 09 20  ETGRNAM_R, 1,.. 
181c0 20 20 20 5b 44 65 66 69 6e 65 20 74 6f 20 31 20     [Define to 1 
181d0 69 66 20 67 65 74 67 72 6e 61 6d 5f 72 20 69 73  if getgrnam_r is
181e0 20 61 76 61 69 6c 61 62 6c 65 2e 5d 29 0a 20 20   available.]).  
181f0 20 20 66 69 0a 5d 29 5d 29 0a 0a 41 43 5f 44 45    fi.])])..AC_DE
18200 46 55 4e 28 5b 53 43 5f 54 43 4c 5f 49 50 56 36  FUN([SC_TCL_IPV6
18210 5d 2c 5b 0a 09 4e 45 45 44 5f 46 41 4b 45 5f 52  ],[..NEED_FAKE_R
18220 46 43 32 35 35 33 3d 30 0a 09 41 43 5f 43 48 45  FC2553=0..AC_CHE
18230 43 4b 5f 46 55 4e 43 53 28 67 65 74 6e 61 6d 65  CK_FUNCS(getname
18240 69 6e 66 6f 20 67 65 74 61 64 64 72 69 6e 66 6f  info getaddrinfo
18250 20 66 72 65 65 61 64 64 72 69 6e 66 6f 20 67 61   freeaddrinfo ga
18260 69 5f 73 74 72 65 72 72 6f 72 2c 2c 5b 4e 45 45  i_strerror,,[NEE
18270 44 5f 46 41 4b 45 5f 52 46 43 32 35 35 33 3d 31  D_FAKE_RFC2553=1
18280 5d 29 0a 09 41 43 5f 43 48 45 43 4b 5f 54 59 50  ])..AC_CHECK_TYP
18290 45 53 28 5b 0a 09 09 73 74 72 75 63 74 20 61 64  ES([...struct ad
182a0 64 72 69 6e 66 6f 2c 0a 09 09 73 74 72 75 63 74  drinfo,...struct
182b0 20 69 6e 36 5f 61 64 64 72 2c 0a 09 09 73 74 72   in6_addr,...str
182c0 75 63 74 20 73 6f 63 6b 61 64 64 72 5f 69 6e 36  uct sockaddr_in6
182d0 2c 0a 09 09 73 74 72 75 63 74 20 73 6f 63 6b 61  ,...struct socka
182e0 64 64 72 5f 73 74 6f 72 61 67 65 5d 2c 2c 5b 4e  ddr_storage],,[N
182f0 45 45 44 5f 46 41 4b 45 5f 52 46 43 32 35 35 33  EED_FAKE_RFC2553
18300 3d 31 5d 2c 5b 5b 0a 23 69 6e 63 6c 75 64 65 20  =1],[[.#include 
18310 3c 73 79 73 2f 74 79 70 65 73 2e 68 3e 0a 23 69  <sys/types.h>.#i
18320 6e 63 6c 75 64 65 20 3c 73 79 73 2f 73 6f 63 6b  nclude <sys/sock
18330 65 74 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c  et.h>.#include <
18340 6e 65 74 69 6e 65 74 2f 69 6e 2e 68 3e 0a 23 69  netinet/in.h>.#i
18350 6e 63 6c 75 64 65 20 3c 6e 65 74 64 62 2e 68 3e  nclude <netdb.h>
18360 0a 5d 5d 29 0a 69 66 20 74 65 73 74 20 22 78 24  .]]).if test "x$
18370 4e 45 45 44 5f 46 41 4b 45 5f 52 46 43 32 35 35  NEED_FAKE_RFC255
18380 33 22 20 3d 20 22 78 31 22 3b 20 74 68 65 6e 0a  3" = "x1"; then.
18390 20 20 20 41 43 5f 44 45 46 49 4e 45 28 5b 4e 45     AC_DEFINE([NE
183a0 45 44 5f 46 41 4b 45 5f 52 46 43 32 35 35 33 5d  ED_FAKE_RFC2553]
183b0 2c 20 31 2c 0a 20 20 20 20 20 20 20 20 5b 55 73  , 1,.        [Us
183c0 65 20 63 6f 6d 70 61 74 20 69 6d 70 6c 65 6d 65  e compat impleme
183d0 6e 74 61 74 69 6f 6e 20 6f 66 20 67 65 74 61 64  ntation of getad
183e0 64 72 69 6e 66 6f 28 29 20 61 6e 64 20 66 72 69  drinfo() and fri
183f0 65 6e 64 73 5d 29 0a 20 20 20 41 43 5f 4c 49 42  ends]).   AC_LIB
18400 4f 42 4a 28 5b 66 61 6b 65 2d 72 66 63 32 35 35  OBJ([fake-rfc255
18410 33 5d 29 0a 20 20 20 41 43 5f 43 48 45 43 4b 5f  3]).   AC_CHECK_
18420 46 55 4e 43 28 73 74 72 6c 63 70 79 29 0a 66 69  FUNC(strlcpy).fi
18430 0a 5d 29 0a 23 20 4c 6f 63 61 6c 20 56 61 72 69  .]).# Local Vari
18440 61 62 6c 65 73 3a 0a 23 20 6d 6f 64 65 3a 20 61  ables:.# mode: a
18450 75 74 6f 63 6f 6e 66 0a 23 20 45 6e 64 3a 0a     utoconf.# End:.