0000: 23 0a 23 20 54 68 65 20 62 75 69 6c 64 20 70 72 #.# The build pr
0010: 6f 63 65 73 73 20 61 6c 6c 6f 77 73 20 66 6f 72 ocess allows for
0020: 20 75 73 69 6e 67 20 61 20 63 72 6f 73 73 2d 63 using a cross-c
0030: 6f 6d 70 69 6c 65 72 2e 20 20 42 75 74 20 74 68 ompiler. But th
0040: 65 20 64 65 66 61 75 6c 74 0a 23 20 61 63 74 69 e default.# acti
0050: 6f 6e 20 69 73 20 74 6f 20 74 61 72 67 65 74 20 on is to target
0060: 74 68 65 20 73 61 6d 65 20 70 6c 61 74 66 6f 72 the same platfor
0070: 6d 20 74 68 61 74 20 77 65 20 61 72 65 20 72 75 m that we are ru
0080: 6e 6e 69 6e 67 20 6f 6e 2e 20 20 54 68 65 0a 23 nning on. The.#
0090: 20 63 6f 6e 66 69 67 75 72 65 20 73 63 72 69 70 configure scrip
00a0: 74 20 6e 65 65 64 73 20 74 6f 20 64 69 73 63 6f t needs to disco
00b0: 76 65 72 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e ver the followin
00c0: 67 20 70 72 6f 70 65 72 74 69 65 73 20 6f 66 20 g properties of
00d0: 74 68 65 20 0a 23 20 62 75 69 6c 64 20 61 6e 64 the .# build and
00e0: 20 74 61 72 67 65 74 20 73 79 73 74 65 6d 73 3a target systems:
00f0: 0a 23 0a 23 20 20 20 20 73 72 63 64 69 72 0a 23 .#.# srcdir.#
0100: 0a 23 20 20 20 20 20 20 20 20 54 68 65 20 69 73 .# The is
0110: 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 the name of the
0120: 20 64 69 72 65 63 74 6f 72 79 20 74 68 61 74 20 directory that
0130: 63 6f 6e 74 61 69 6e 73 20 74 68 65 0a 23 20 20 contains the.#
0140: 20 20 20 20 20 20 22 63 6f 6e 66 69 67 75 72 65 "configure
0150: 22 20 73 68 65 6c 6c 20 73 63 72 69 70 74 2e 20 " shell script.
0160: 20 41 6c 6c 20 73 6f 75 72 63 65 20 66 69 6c 65 All source file
0170: 73 20 61 72 65 0a 23 20 20 20 20 20 20 20 20 6c s are.# l
0180: 6f 63 61 74 65 64 20 72 65 6c 61 74 69 76 65 20 ocated relative
0190: 74 6f 20 74 68 69 73 20 64 69 72 65 63 74 6f 72 to this director
01a0: 79 2e 0a 23 0a 23 20 20 20 20 62 69 6e 64 69 72 y..#.# bindir
01b0: 0a 23 0a 23 20 20 20 20 20 20 20 20 54 68 65 20 .#.# The
01c0: 6e 61 6d 65 20 6f 66 20 74 68 65 20 64 69 72 65 name of the dire
01d0: 63 74 6f 72 79 20 77 68 65 72 65 20 65 78 65 63 ctory where exec
01e0: 75 74 61 62 6c 65 73 20 73 68 6f 75 6c 64 20 62 utables should b
01f0: 65 0a 23 20 20 20 20 20 20 20 20 77 72 69 74 74 e.# writt
0200: 65 6e 20 62 79 20 74 68 65 20 22 69 6e 73 74 61 en by the "insta
0210: 6c 6c 22 20 74 61 72 67 65 74 20 6f 66 20 74 68 ll" target of th
0220: 65 20 6d 61 6b 65 66 69 6c 65 2e 0a 23 0a 23 20 e makefile..#.#
0230: 20 20 20 70 72 6f 67 72 61 6d 5f 70 72 65 66 69 program_prefi
0240: 78 0a 23 0a 23 20 20 20 20 20 20 20 20 41 64 64 x.#.# Add
0250: 20 74 68 69 73 20 70 72 65 66 69 78 20 74 6f 20 this prefix to
0260: 74 68 65 20 6e 61 6d 65 73 20 6f 66 20 61 6c 6c the names of all
0270: 20 65 78 65 63 75 74 61 62 6c 65 73 20 74 68 61 executables tha
0280: 74 20 72 75 6e 0a 23 20 20 20 20 20 20 20 20 6f t run.# o
0290: 6e 20 74 68 65 20 74 61 72 67 65 74 20 6d 61 63 n the target mac
02a0: 68 69 6e 65 2e 20 20 44 65 66 61 75 6c 74 3a 20 hine. Default:
02b0: 22 22 0a 23 0a 23 20 20 20 20 45 4e 41 42 4c 45 "".#.# ENABLE
02c0: 5f 53 48 41 52 45 44 0a 23 0a 23 20 20 20 20 20 _SHARED.#.#
02d0: 20 20 20 54 72 75 65 20 69 66 20 73 68 61 72 65 True if share
02e0: 64 20 6c 69 62 72 61 72 69 65 73 20 73 68 6f 75 d libraries shou
02f0: 6c 64 20 62 65 20 67 65 6e 65 72 61 74 65 64 2e ld be generated.
0300: 0a 23 0a 23 20 20 20 20 42 55 49 4c 44 5f 43 43 .#.# BUILD_CC
0310: 0a 23 0a 23 20 20 20 20 20 20 20 20 54 68 65 20 .#.# The
0320: 6e 61 6d 65 20 6f 66 20 61 20 63 6f 6d 6d 61 6e name of a comman
0330: 64 20 74 68 61 74 20 69 73 20 75 73 65 64 20 74 d that is used t
0340: 6f 20 63 6f 6e 76 65 72 74 20 43 0a 23 20 20 20 o convert C.#
0350: 20 20 20 20 20 73 6f 75 72 63 65 20 66 69 6c 65 source file
0360: 73 20 69 6e 74 6f 20 65 78 65 63 75 74 61 62 6c s into executabl
0370: 65 73 20 74 68 61 74 20 72 75 6e 20 6f 6e 20 74 es that run on t
0380: 68 65 20 62 75 69 6c 64 0a 23 20 20 20 20 20 20 he build.#
0390: 20 20 70 6c 61 74 66 6f 72 6d 2e 0a 23 0a 23 20 platform..#.#
03a0: 20 20 20 42 55 49 4c 44 5f 43 46 4c 41 47 53 0a BUILD_CFLAGS.
03b0: 23 0a 23 20 20 20 20 20 20 20 20 53 77 69 74 63 #.# Switc
03c0: 68 65 73 20 74 68 61 74 20 74 68 65 20 62 75 69 hes that the bui
03d0: 6c 64 20 63 6f 6d 70 69 6c 65 72 20 6e 65 65 64 ld compiler need
03e0: 73 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 6f s in order to co
03f0: 6e 73 74 72 75 63 74 0a 23 20 20 20 20 20 20 20 nstruct.#
0400: 20 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 70 72 command-line pr
0410: 6f 67 72 61 6d 73 2e 0a 23 0a 23 20 20 20 20 42 ograms..#.# B
0420: 55 49 4c 44 5f 4c 49 42 53 0a 23 0a 23 20 20 20 UILD_LIBS.#.#
0430: 20 20 20 20 20 4c 69 62 72 61 72 69 65 73 20 74 Libraries t
0440: 68 61 74 20 74 68 65 20 62 75 69 6c 64 20 63 6f hat the build co
0450: 6d 70 69 6c 65 72 20 6e 65 65 64 73 20 69 6e 20 mpiler needs in
0460: 6f 72 64 65 72 20 74 6f 20 63 6f 6e 73 74 72 75 order to constru
0470: 63 74 0a 23 20 20 20 20 20 20 20 20 63 6f 6d 6d ct.# comm
0480: 61 6e 64 2d 6c 69 6e 65 20 70 72 6f 67 72 61 6d and-line program
0490: 73 2e 0a 23 0a 23 20 20 20 20 42 55 49 4c 44 5f s..#.# BUILD_
04a0: 45 58 45 45 58 54 0a 23 0a 23 20 20 20 20 20 20 EXEEXT.#.#
04b0: 20 20 54 68 65 20 66 69 6c 65 6e 61 6d 65 20 65 The filename e
04c0: 78 74 65 6e 73 69 6f 6e 20 66 6f 72 20 65 78 65 xtension for exe
04d0: 63 75 74 61 62 6c 65 73 20 6f 6e 20 74 68 65 20 cutables on the
04e0: 62 75 69 6c 64 0a 23 20 20 20 20 20 20 20 20 70 build.# p
04f0: 6c 61 74 66 6f 72 6d 2e 20 20 22 22 20 66 6f 72 latform. "" for
0500: 20 55 6e 69 78 20 61 6e 64 20 22 2e 65 78 65 22 Unix and ".exe"
0510: 20 66 6f 72 20 57 69 6e 64 6f 77 73 2e 0a 23 0a for Windows..#.
0520: 23 20 20 20 20 54 43 4c 5f 2a 0a 23 0a 23 20 20 # TCL_*.#.#
0530: 20 20 20 20 20 20 4c 6f 74 73 20 6f 66 20 76 61 Lots of va
0540: 6c 75 65 73 20 61 72 65 20 72 65 61 64 20 69 6e lues are read in
0550: 20 66 72 6f 6d 20 74 68 65 20 74 63 6c 43 6f 6e from the tclCon
0560: 66 69 67 2e 73 68 20 73 63 72 69 70 74 2c 0a 23 fig.sh script,.#
0570: 20 20 20 20 20 20 20 20 69 66 20 74 68 61 74 20 if that
0580: 73 63 72 69 70 74 20 69 73 20 61 76 61 69 6c 61 script is availa
0590: 62 6c 65 2e 20 20 54 68 69 73 20 76 61 6c 75 65 ble. This value
05a0: 73 20 61 72 65 20 75 73 65 64 20 66 6f 72 0a 23 s are used for.#
05b0: 20 20 20 20 20 20 20 20 63 6f 6e 73 74 72 75 63 construc
05c0: 74 69 6e 67 20 61 6e 64 20 69 6e 73 74 61 6c 6c ting and install
05d0: 69 6e 67 20 74 68 65 20 54 43 4c 20 65 78 74 65 ing the TCL exte
05e0: 6e 73 69 6f 6e 2e 0a 23 0a 23 20 20 20 20 54 41 nsion..#.# TA
05f0: 52 47 45 54 5f 52 45 41 44 4c 49 4e 45 5f 4c 49 RGET_READLINE_LI
0600: 42 53 0a 23 0a 23 20 20 20 20 20 20 20 20 54 68 BS.#.# Th
0610: 69 73 20 69 73 20 74 68 65 20 6c 69 62 72 61 72 is is the librar
0620: 79 20 64 69 72 65 63 74 69 76 65 73 20 70 61 73 y directives pas
0630: 73 65 64 20 74 6f 20 74 68 65 20 74 61 72 67 65 sed to the targe
0640: 74 20 6c 69 6e 6b 65 72 0a 23 20 20 20 20 20 20 t linker.#
0650: 20 20 74 68 61 74 20 63 61 75 73 65 20 74 68 65 that cause the
0660: 20 65 78 65 63 75 74 61 62 6c 65 20 74 6f 20 6c executable to l
0670: 69 6e 6b 20 61 67 61 69 6e 73 74 20 74 68 65 20 ink against the
0680: 72 65 61 64 6c 69 6e 65 20 6c 69 62 72 61 72 79 readline library
0690: 2e 0a 23 20 20 20 20 20 20 20 20 54 68 69 73 20 ..# This
06a0: 6d 69 67 68 74 20 62 65 20 61 20 73 77 69 74 63 might be a switc
06b0: 68 20 6c 69 6b 65 20 22 2d 6c 72 65 61 64 6c 69 h like "-lreadli
06c0: 6e 65 22 20 6f 72 20 70 61 74 68 6e 61 6d 65 73 ne" or pathnames
06d0: 20 6f 66 20 6c 69 62 72 61 72 79 0a 23 20 20 20 of library.#
06e0: 20 20 20 20 20 66 69 6c 65 20 6c 69 6b 65 20 22 file like "
06f0: 2e 2e 2f 2e 2e 2f 73 72 63 2f 6c 69 62 72 65 61 ../../src/librea
0700: 64 6c 69 6e 65 2e 61 22 2e 0a 23 0a 23 20 20 20 dline.a"..#.#
0710: 20 54 41 52 47 45 54 5f 52 45 41 44 4c 49 4e 45 TARGET_READLINE
0720: 5f 49 4e 43 0a 23 0a 23 20 20 20 20 20 20 20 20 _INC.#.#
0730: 54 68 69 73 20 76 61 72 69 61 62 6c 65 73 20 64 This variables d
0740: 65 66 69 6e 65 20 74 68 65 20 64 69 72 65 63 74 efine the direct
0750: 6f 72 79 20 74 68 61 74 20 63 6f 6e 74 61 69 6e ory that contain
0760: 20 68 65 61 64 65 72 0a 23 20 20 20 20 20 20 20 header.#
0770: 20 66 69 6c 65 73 20 66 6f 72 20 74 68 65 20 72 files for the r
0780: 65 61 64 6c 69 6e 65 20 6c 69 62 72 61 72 79 2e eadline library.
0790: 20 20 49 66 20 74 68 65 20 63 6f 6d 70 69 6c 65 If the compile
07a0: 72 20 69 73 20 61 62 6c 65 20 0a 23 20 20 20 20 r is able .#
07b0: 20 20 20 20 74 6f 20 66 69 6e 64 20 3c 72 65 61 to find <rea
07c0: 64 6c 69 6e 65 2e 68 3e 20 6f 6e 20 69 74 73 20 dline.h> on its
07d0: 6f 77 6e 2c 20 74 68 65 6e 20 74 68 69 73 20 63 own, then this c
07e0: 61 6e 20 62 65 20 62 6c 61 6e 6b 2e 0a 23 0a 23 an be blank..#.#
07f0: 20 20 20 20 54 41 52 47 45 54 5f 45 58 45 45 58 TARGET_EXEEX
0800: 54 0a 23 0a 23 20 20 20 20 20 20 20 20 54 68 65 T.#.# The
0810: 20 66 69 6c 65 6e 61 6d 65 20 65 78 74 65 6e 73 filename extens
0820: 69 6f 6e 20 66 6f 72 20 65 78 65 63 75 74 61 62 ion for executab
0830: 6c 65 73 20 6f 6e 20 74 68 65 0a 23 20 20 20 20 les on the.#
0840: 20 20 20 20 74 61 72 67 65 74 20 70 6c 61 74 66 target platf
0850: 6f 72 6d 2e 20 20 22 22 20 66 6f 72 20 55 6e 69 orm. "" for Uni
0860: 78 20 61 6e 64 20 22 2e 65 78 65 22 20 66 6f 72 x and ".exe" for
0870: 20 77 69 6e 64 6f 77 73 2e 0a 23 0a 23 20 54 68 windows..#.# Th
0880: 69 73 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 20 is configure.in
0890: 66 69 6c 65 20 69 73 20 65 61 73 79 20 74 6f 20 file is easy to
08a0: 72 65 75 73 65 20 6f 6e 20 6f 74 68 65 72 20 70 reuse on other p
08b0: 72 6f 6a 65 63 74 73 2e 20 20 4a 75 73 74 0a 23 rojects. Just.#
08c0: 20 63 68 61 6e 67 65 20 74 68 65 20 61 72 67 75 change the argu
08d0: 6d 65 6e 74 20 74 6f 20 41 43 5f 49 4e 49 54 28 ment to AC_INIT(
08e0: 29 2e 20 20 41 6e 64 20 64 69 73 61 62 6c 65 20 ). And disable
08f0: 61 6e 79 20 66 65 61 74 75 72 65 73 20 74 68 61 any features tha
0900: 74 0a 23 20 79 6f 75 20 64 6f 6e 27 74 20 6e 65 t.# you don't ne
0910: 65 64 20 28 66 6f 72 20 65 78 61 6d 70 6c 65 20 ed (for example
0920: 42 4c 54 29 20 62 79 20 65 72 61 73 69 6e 67 20 BLT) by erasing
0930: 6f 72 20 63 6f 6d 6d 65 6e 74 69 6e 67 20 6f 75 or commenting ou
0940: 74 0a 23 20 74 68 65 20 63 6f 72 72 65 73 70 6f t.# the correspo
0950: 6e 64 69 6e 67 20 63 6f 64 65 2e 0a 23 0a 41 43 nding code..#.AC
0960: 5f 49 4e 49 54 28 73 71 6c 69 74 65 2c 20 6d 34 _INIT(sqlite, m4
0970: 5f 65 73 79 73 63 6d 64 28 5b 63 61 74 20 56 45 _esyscmd([cat VE
0980: 52 53 49 4f 4e 20 7c 20 74 72 20 2d 64 20 27 5c RSION | tr -d '\
0990: 6e 27 5d 29 29 0a 0a 64 6e 6c 20 4d 61 6b 65 20 n']))..dnl Make
09a0: 73 75 72 65 20 74 68 65 20 6c 6f 63 61 6c 20 56 sure the local V
09b0: 45 52 53 49 4f 4e 20 66 69 6c 65 20 6d 61 74 63 ERSION file matc
09c0: 68 65 73 20 74 68 69 73 20 63 6f 6e 66 69 67 75 hes this configu
09d0: 72 65 20 73 63 72 69 70 74 0a 73 71 6c 69 74 65 re script.sqlite
09e0: 5f 76 65 72 73 69 6f 6e 5f 73 61 6e 69 74 79 5f _version_sanity_
09f0: 63 68 65 63 6b 3d 60 63 61 74 20 24 73 72 63 64 check=`cat $srcd
0a00: 69 72 2f 56 45 52 53 49 4f 4e 20 7c 20 74 72 20 ir/VERSION | tr
0a10: 2d 64 20 27 5c 6e 27 60 0a 69 66 20 74 65 73 74 -d '\n'`.if test
0a20: 20 22 24 50 41 43 4b 41 47 45 5f 56 45 52 53 49 "$PACKAGE_VERSI
0a30: 4f 4e 22 20 21 3d 20 22 24 73 71 6c 69 74 65 5f ON" != "$sqlite_
0a40: 76 65 72 73 69 6f 6e 5f 73 61 6e 69 74 79 5f 63 version_sanity_c
0a50: 68 65 63 6b 22 20 3b 20 74 68 65 6e 0a 41 43 5f heck" ; then.AC_
0a60: 4d 53 47 5f 45 52 52 4f 52 28 5b 63 6f 6e 66 69 MSG_ERROR([confi
0a70: 67 75 72 65 20 73 63 72 69 70 74 20 69 73 20 6f gure script is o
0a80: 75 74 20 6f 66 20 64 61 74 65 3a 0a 20 63 6f 6e ut of date:. con
0a90: 66 69 67 75 72 65 20 5c 24 50 41 43 4b 41 47 45 figure \$PACKAGE
0aa0: 5f 56 45 52 53 49 4f 4e 20 3d 20 24 50 41 43 4b _VERSION = $PACK
0ab0: 41 47 45 5f 56 45 52 53 49 4f 4e 0a 20 74 6f 70 AGE_VERSION. top
0ac0: 20 6c 65 76 65 6c 20 56 45 52 53 49 4f 4e 20 66 level VERSION f
0ad0: 69 6c 65 20 20 20 20 20 3d 20 24 73 71 6c 69 74 ile = $sqlit
0ae0: 65 5f 76 65 72 73 69 6f 6e 5f 73 61 6e 69 74 79 e_version_sanity
0af0: 5f 63 68 65 63 6b 0a 70 6c 65 61 73 65 20 72 65 _check.please re
0b00: 67 65 6e 20 77 69 74 68 20 61 75 74 6f 63 6f 6e gen with autocon
0b10: 66 5d 29 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 f]).fi..########
0b20: 23 0a 23 20 50 72 6f 67 72 61 6d 73 20 6e 65 65 #.# Programs nee
0b30: 64 65 64 0a 23 0a 41 43 5f 50 52 4f 47 5f 4c 49 ded.#.AC_PROG_LI
0b40: 42 54 4f 4f 4c 0a 41 43 5f 50 52 4f 47 5f 49 4e BTOOL.AC_PROG_IN
0b50: 53 54 41 4c 4c 0a 0a 23 23 23 23 23 23 23 23 23 STALL..#########
0b60: 0a 23 20 45 6e 61 62 6c 65 20 6c 61 72 67 65 20 .# Enable large
0b70: 66 69 6c 65 20 73 75 70 70 6f 72 74 20 28 69 66 file support (if
0b80: 20 73 70 65 63 69 61 6c 20 66 6c 61 67 73 20 61 special flags a
0b90: 72 65 20 6e 65 63 65 73 73 61 72 79 29 0a 23 0a re necessary).#.
0ba0: 41 43 5f 53 59 53 5f 4c 41 52 47 45 46 49 4c 45 AC_SYS_LARGEFILE
0bb0: 0a 0a 23 23 23 23 23 23 23 23 23 0a 23 20 43 68 ..#########.# Ch
0bc0: 65 63 6b 20 66 6f 72 20 6e 65 65 64 65 64 2f 77 eck for needed/w
0bd0: 61 6e 74 65 64 20 64 61 74 61 20 74 79 70 65 73 anted data types
0be0: 0a 41 43 5f 43 48 45 43 4b 5f 54 59 50 45 53 28 .AC_CHECK_TYPES(
0bf0: 5b 69 6e 74 38 5f 74 2c 20 69 6e 74 31 36 5f 74 [int8_t, int16_t
0c00: 2c 20 69 6e 74 33 32 5f 74 2c 20 69 6e 74 36 34 , int32_t, int64
0c10: 5f 74 2c 20 69 6e 74 70 74 72 5f 74 2c 20 75 69 _t, intptr_t, ui
0c20: 6e 74 38 5f 74 2c 0a 20 20 20 20 20 20 20 20 20 nt8_t,.
0c30: 20 20 20 20 20 20 20 75 69 6e 74 31 36 5f 74 2c uint16_t,
0c40: 20 75 69 6e 74 33 32 5f 74 2c 20 75 69 6e 74 36 uint32_t, uint6
0c50: 34 5f 74 2c 20 75 69 6e 74 70 74 72 5f 74 5d 29 4_t, uintptr_t])
0c60: 0a 0a 23 23 23 23 23 23 23 23 23 0a 23 20 43 68 ..#########.# Ch
0c70: 65 63 6b 20 66 6f 72 20 6e 65 65 64 65 64 2f 77 eck for needed/w
0c80: 61 6e 74 65 64 20 68 65 61 64 65 72 73 0a 41 43 anted headers.AC
0c90: 5f 43 48 45 43 4b 5f 48 45 41 44 45 52 53 28 5b _CHECK_HEADERS([
0ca0: 73 79 73 2f 74 79 70 65 73 2e 68 20 73 74 64 6c sys/types.h stdl
0cb0: 69 62 2e 68 20 73 74 64 69 6e 74 2e 68 20 69 6e ib.h stdint.h in
0cc0: 74 74 79 70 65 73 2e 68 20 6d 61 6c 6c 6f 63 2e ttypes.h malloc.
0cd0: 68 5d 29 0a 0a 23 23 23 23 23 23 23 23 23 0a 23 h])..#########.#
0ce0: 20 46 69 67 75 72 65 20 6f 75 74 20 77 68 65 74 Figure out whet
0cf0: 68 65 72 20 6f 72 20 6e 6f 74 20 77 65 20 68 61 her or not we ha
0d00: 76 65 20 74 68 65 73 65 20 66 75 6e 63 74 69 6f ve these functio
0d10: 6e 73 0a 23 0a 41 43 5f 43 48 45 43 4b 5f 46 55 ns.#.AC_CHECK_FU
0d20: 4e 43 53 28 5b 66 64 61 74 61 73 79 6e 63 20 67 NCS([fdatasync g
0d30: 6d 74 69 6d 65 5f 72 20 69 73 6e 61 6e 20 6c 6f mtime_r isnan lo
0d40: 63 61 6c 74 69 6d 65 5f 72 20 6c 6f 63 61 6c 74 caltime_r localt
0d50: 69 6d 65 5f 73 20 6d 61 6c 6c 6f 63 5f 75 73 61 ime_s malloc_usa
0d60: 62 6c 65 5f 73 69 7a 65 20 73 74 72 63 68 72 6e ble_size strchrn
0d70: 75 6c 20 75 73 6c 65 65 70 20 75 74 69 6d 65 20 ul usleep utime
0d80: 70 72 65 61 64 20 70 72 65 61 64 36 34 20 70 77 pread pread64 pw
0d90: 72 69 74 65 20 70 77 72 69 74 65 36 34 5d 29 0a rite pwrite64]).
0da0: 0a 23 23 23 23 23 23 23 23 23 0a 23 20 42 79 20 .#########.# By
0db0: 64 65 66 61 75 6c 74 2c 20 77 65 20 75 73 65 20 default, we use
0dc0: 74 68 65 20 61 6d 61 6c 67 61 6d 61 74 69 6f 6e the amalgamation
0dd0: 20 28 74 68 69 73 20 6d 61 79 20 62 65 20 63 68 (this may be ch
0de0: 61 6e 67 65 64 20 62 65 6c 6f 77 2e 2e 2e 29 0a anged below...).
0df0: 23 0a 55 53 45 5f 41 4d 41 4c 47 41 4d 41 54 49 #.USE_AMALGAMATI
0e00: 4f 4e 3d 31 0a 0a 23 23 23 23 23 23 23 23 23 0a ON=1..#########.
0e10: 23 20 53 65 65 20 77 68 65 74 68 65 72 20 77 65 # See whether we
0e20: 20 63 61 6e 20 72 75 6e 20 73 70 65 63 69 66 69 can run specifi
0e30: 63 20 74 63 6c 73 68 20 76 65 72 73 69 6f 6e 73 c tclsh versions
0e40: 20 6b 6e 6f 77 6e 20 74 6f 20 77 6f 72 6b 20 77 known to work w
0e50: 65 6c 6c 3b 0a 23 20 69 66 20 6e 6f 74 2c 20 74 ell;.# if not, t
0e60: 68 65 6e 20 77 65 20 66 61 6c 6c 20 62 61 63 6b hen we fall back
0e70: 20 74 6f 20 70 6c 61 69 6e 20 74 63 6c 73 68 2e to plain tclsh.
0e80: 0a 23 20 54 4f 44 4f 3a 20 74 72 79 20 6f 74 68 .# TODO: try oth
0e90: 65 72 20 76 65 72 73 69 6f 6e 73 20 62 65 66 6f er versions befo
0ea0: 72 65 20 66 61 6c 6c 69 6e 67 20 62 61 63 6b 3f re falling back?
0eb0: 0a 23 20 0a 41 43 5f 43 48 45 43 4b 5f 50 52 4f .# .AC_CHECK_PRO
0ec0: 47 53 28 54 43 4c 53 48 5f 43 4d 44 2c 20 5b 74 GS(TCLSH_CMD, [t
0ed0: 63 6c 73 68 38 2e 37 20 74 63 6c 73 68 38 2e 36 clsh8.7 tclsh8.6
0ee0: 20 74 63 6c 73 68 38 2e 35 20 74 63 6c 73 68 5d tclsh8.5 tclsh]
0ef0: 2c 20 6e 6f 6e 65 29 0a 69 66 20 74 65 73 74 20 , none).if test
0f00: 22 24 54 43 4c 53 48 5f 43 4d 44 22 20 3d 20 22 "$TCLSH_CMD" = "
0f10: 6e 6f 6e 65 22 3b 20 74 68 65 6e 0a 20 20 23 20 none"; then. #
0f20: 49 66 20 77 65 20 63 61 6e 27 74 20 66 69 6e 64 If we can't find
0f30: 20 61 20 6c 6f 63 61 6c 20 74 63 6c 73 68 2c 20 a local tclsh,
0f40: 74 68 65 6e 20 62 75 69 6c 64 69 6e 67 20 74 68 then building th
0f50: 65 20 61 6d 61 6c 67 61 6d 61 74 69 6f 6e 20 77 e amalgamation w
0f60: 69 6c 6c 20 66 61 69 6c 2e 0a 20 20 23 20 57 65 ill fail.. # We
0f70: 20 61 63 74 20 61 73 20 74 68 6f 75 67 68 20 2d act as though -
0f80: 2d 64 69 73 61 62 6c 65 2d 61 6d 61 6c 67 61 6d -disable-amalgam
0f90: 61 74 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 75 ation has been u
0fa0: 73 65 64 2e 0a 20 20 65 63 68 6f 20 22 57 61 72 sed.. echo "War
0fb0: 6e 69 6e 67 3a 20 63 61 6e 27 74 20 66 69 6e 64 ning: can't find
0fc0: 20 74 63 6c 73 68 20 2d 20 64 65 66 61 75 6c 74 tclsh - default
0fd0: 69 6e 67 20 74 6f 20 6e 6f 6e 2d 61 6d 61 6c 67 ing to non-amalg
0fe0: 61 6d 61 74 69 6f 6e 20 62 75 69 6c 64 2e 22 0a amation build.".
0ff0: 20 20 55 53 45 5f 41 4d 41 4c 47 41 4d 41 54 49 USE_AMALGAMATI
1000: 4f 4e 3d 30 0a 20 20 54 43 4c 53 48 5f 43 4d 44 ON=0. TCLSH_CMD
1010: 3d 22 74 63 6c 73 68 22 0a 66 69 0a 41 43 5f 53 ="tclsh".fi.AC_S
1020: 55 42 53 54 28 54 43 4c 53 48 5f 43 4d 44 29 0a UBST(TCLSH_CMD).
1030: 0a 41 43 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c .AC_ARG_VAR([TCL
1040: 4c 49 42 44 49 52 5d 2c 20 5b 57 68 65 72 65 20 LIBDIR], [Where
1050: 74 6f 20 69 6e 73 74 61 6c 6c 20 74 63 6c 20 70 to install tcl p
1060: 6c 75 67 69 6e 5d 29 0a 69 66 20 74 65 73 74 20 lugin]).if test
1070: 22 78 24 7b 54 43 4c 4c 49 42 44 49 52 2b 73 65 "x${TCLLIBDIR+se
1080: 74 7d 22 20 21 3d 20 22 78 73 65 74 22 20 3b 20 t}" != "xset" ;
1090: 74 68 65 6e 0a 20 20 54 43 4c 4c 49 42 44 49 52 then. TCLLIBDIR
10a0: 3d 27 24 28 6c 69 62 64 69 72 29 27 0a 20 20 66 ='$(libdir)'. f
10b0: 6f 72 20 69 20 69 6e 20 60 65 63 68 6f 20 27 70 or i in `echo 'p
10c0: 75 74 73 20 73 74 64 6f 75 74 20 24 61 75 74 6f uts stdout $auto
10d0: 5f 70 61 74 68 27 20 7c 20 24 7b 54 43 4c 53 48 _path' | ${TCLSH
10e0: 5f 43 4d 44 7d 60 20 3b 20 64 6f 0a 20 20 20 20 _CMD}` ; do.
10f0: 54 43 4c 4c 49 42 44 49 52 3d 24 69 0a 20 20 20 TCLLIBDIR=$i.
1100: 20 62 72 65 61 6b 0a 20 20 64 6f 6e 65 0a 20 20 break. done.
1110: 54 43 4c 4c 49 42 44 49 52 3d 22 24 7b 54 43 4c TCLLIBDIR="${TCL
1120: 4c 49 42 44 49 52 7d 2f 73 71 6c 69 74 65 33 22 LIBDIR}/sqlite3"
1130: 0a 66 69 0a 0a 0a 23 23 23 23 23 23 23 23 23 0a .fi...#########.
1140: 23 20 53 65 74 20 75 70 20 61 6e 20 61 70 70 72 # Set up an appr
1150: 6f 70 72 69 61 74 65 20 70 72 6f 67 72 61 6d 20 opriate program
1160: 70 72 65 66 69 78 0a 23 0a 69 66 20 74 65 73 74 prefix.#.if test
1170: 20 22 24 70 72 6f 67 72 61 6d 5f 70 72 65 66 69 "$program_prefi
1180: 78 22 20 3d 20 22 4e 4f 4e 45 22 3b 20 74 68 65 x" = "NONE"; the
1190: 6e 0a 20 20 70 72 6f 67 72 61 6d 5f 70 72 65 66 n. program_pref
11a0: 69 78 3d 22 22 0a 66 69 0a 41 43 5f 53 55 42 53 ix="".fi.AC_SUBS
11b0: 54 28 70 72 6f 67 72 61 6d 5f 70 72 65 66 69 78 T(program_prefix
11c0: 29 0a 0a 56 45 52 53 49 4f 4e 3d 5b 60 63 61 74 )..VERSION=[`cat
11d0: 20 24 73 72 63 64 69 72 2f 56 45 52 53 49 4f 4e $srcdir/VERSION
11e0: 20 7c 20 73 65 64 20 27 73 2f 5e 5c 28 5b 30 2d | sed 's/^\([0-
11f0: 39 5d 2a 5c 2e 2a 5b 30 2d 39 5d 2a 5c 29 2e 2a 9]*\.*[0-9]*\).*
1200: 2f 5c 31 2f 27 60 5d 0a 41 43 5f 4d 53 47 5f 4e /\1/'`].AC_MSG_N
1210: 4f 54 49 43 45 28 56 65 72 73 69 6f 6e 20 73 65 OTICE(Version se
1220: 74 20 74 6f 20 24 56 45 52 53 49 4f 4e 29 0a 41 t to $VERSION).A
1230: 43 5f 53 55 42 53 54 28 56 45 52 53 49 4f 4e 29 C_SUBST(VERSION)
1240: 0a 52 45 4c 45 41 53 45 3d 60 63 61 74 20 24 73 .RELEASE=`cat $s
1250: 72 63 64 69 72 2f 56 45 52 53 49 4f 4e 60 0a 41 rcdir/VERSION`.A
1260: 43 5f 4d 53 47 5f 4e 4f 54 49 43 45 28 52 65 6c C_MSG_NOTICE(Rel
1270: 65 61 73 65 20 73 65 74 20 74 6f 20 24 52 45 4c ease set to $REL
1280: 45 41 53 45 29 0a 41 43 5f 53 55 42 53 54 28 52 EASE).AC_SUBST(R
1290: 45 4c 45 41 53 45 29 0a 56 45 52 53 49 4f 4e 5f ELEASE).VERSION_
12a0: 4e 55 4d 42 45 52 3d 5b 60 63 61 74 20 24 73 72 NUMBER=[`cat $sr
12b0: 63 64 69 72 2f 56 45 52 53 49 4f 4e 20 5c 0a 20 cdir/VERSION \.
12c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
12d0: 20 20 20 20 20 20 20 20 20 20 7c 20 73 65 64 20 | sed
12e0: 27 73 2f 5b 5e 30 2d 39 5d 2f 20 2f 67 27 20 5c 's/[^0-9]/ /g' \
12f0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
1300: 20 7c 20 61 77 6b 20 27 7b 70 72 69 6e 74 66 20 | awk '{printf
1310: 22 25 64 25 30 33 64 25 30 33 64 22 2c 24 31 2c "%d%03d%03d",$1,
1320: 24 32 2c 24 33 7d 27 60 5d 0a 41 43 5f 4d 53 47 $2,$3}'`].AC_MSG
1330: 5f 4e 4f 54 49 43 45 28 56 65 72 73 69 6f 6e 20 _NOTICE(Version
1340: 6e 75 6d 62 65 72 20 73 65 74 20 74 6f 20 24 56 number set to $V
1350: 45 52 53 49 4f 4e 5f 4e 55 4d 42 45 52 29 0a 41 ERSION_NUMBER).A
1360: 43 5f 53 55 42 53 54 28 56 45 52 53 49 4f 4e 5f C_SUBST(VERSION_
1370: 4e 55 4d 42 45 52 29 0a 0a 23 23 23 23 23 23 23 NUMBER)..#######
1380: 23 23 0a 23 20 4c 6f 63 61 74 65 20 61 20 63 6f ##.# Locate a co
1390: 6d 70 69 6c 65 72 20 66 6f 72 20 74 68 65 20 62 mpiler for the b
13a0: 75 69 6c 64 20 6d 61 63 68 69 6e 65 2e 20 20 54 uild machine. T
13b0: 68 69 73 20 63 6f 6d 70 69 6c 65 72 20 73 68 6f his compiler sho
13c0: 75 6c 64 0a 23 20 67 65 6e 65 72 61 74 65 20 63 uld.# generate c
13d0: 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 70 72 6f 67 ommand-line prog
13e0: 72 61 6d 73 20 74 68 61 74 20 72 75 6e 20 6f 6e rams that run on
13f0: 20 74 68 65 20 62 75 69 6c 64 20 6d 61 63 68 69 the build machi
1400: 6e 65 2e 0a 23 0a 69 66 20 74 65 73 74 20 78 22 ne..#.if test x"
1410: 24 63 72 6f 73 73 5f 63 6f 6d 70 69 6c 69 6e 67 $cross_compiling
1420: 22 20 3d 20 78 6e 6f 3b 20 74 68 65 6e 0a 09 42 " = xno; then..B
1430: 55 49 4c 44 5f 43 43 3d 24 43 43 0a 09 42 55 49 UILD_CC=$CC..BUI
1440: 4c 44 5f 43 46 4c 41 47 53 3d 24 43 46 4c 41 47 LD_CFLAGS=$CFLAG
1450: 53 0a 65 6c 73 65 0a 09 69 66 20 74 65 73 74 20 S.else..if test
1460: 22 24 7b 42 55 49 4c 44 5f 43 43 2b 73 65 74 7d "${BUILD_CC+set}
1470: 22 20 21 3d 20 73 65 74 3b 20 74 68 65 6e 0a 09 " != set; then..
1480: 09 41 43 5f 43 48 45 43 4b 5f 50 52 4f 47 53 28 .AC_CHECK_PROGS(
1490: 42 55 49 4c 44 5f 43 43 2c 20 67 63 63 20 63 63 BUILD_CC, gcc cc
14a0: 20 63 6c 29 0a 09 66 69 0a 09 69 66 20 74 65 73 cl)..fi..if tes
14b0: 74 20 22 24 7b 42 55 49 4c 44 5f 43 46 4c 41 47 t "${BUILD_CFLAG
14c0: 53 2b 73 65 74 7d 22 20 21 3d 20 73 65 74 3b 20 S+set}" != set;
14d0: 74 68 65 6e 0a 09 09 42 55 49 4c 44 5f 43 46 4c then...BUILD_CFL
14e0: 41 47 53 3d 22 2d 67 22 0a 09 66 69 0a 66 69 0a AGS="-g"..fi.fi.
14f0: 41 43 5f 53 55 42 53 54 28 42 55 49 4c 44 5f 43 AC_SUBST(BUILD_C
1500: 43 29 0a 0a 23 23 23 23 23 23 23 23 23 23 0a 23 C)..##########.#
1510: 20 44 6f 20 77 65 20 77 61 6e 74 20 74 6f 20 73 Do we want to s
1520: 75 70 70 6f 72 74 20 6d 75 6c 74 69 74 68 72 65 upport multithre
1530: 61 64 65 64 20 75 73 65 20 6f 66 20 73 71 6c 69 aded use of sqli
1540: 74 65 0a 23 0a 41 43 5f 41 52 47 5f 45 4e 41 42 te.#.AC_ARG_ENAB
1550: 4c 45 28 74 68 72 65 61 64 73 61 66 65 2c 20 0a LE(threadsafe, .
1560: 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b AC_HELP_STRING([
1570: 2d 2d 64 69 73 61 62 6c 65 2d 74 68 72 65 61 64 --disable-thread
1580: 73 61 66 65 5d 2c 5b 44 69 73 61 62 6c 65 20 6d safe],[Disable m
1590: 75 74 65 78 69 6e 67 5d 29 29 0a 41 43 5f 4d 53 utexing])).AC_MS
15a0: 47 5f 43 48 45 43 4b 49 4e 47 28 5b 77 68 65 74 G_CHECKING([whet
15b0: 68 65 72 20 74 6f 20 73 75 70 70 6f 72 74 20 74 her to support t
15c0: 68 72 65 61 64 73 61 66 65 20 6f 70 65 72 61 74 hreadsafe operat
15d0: 69 6f 6e 5d 29 0a 69 66 20 74 65 73 74 20 22 24 ion]).if test "$
15e0: 65 6e 61 62 6c 65 5f 74 68 72 65 61 64 73 61 66 enable_threadsaf
15f0: 65 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a e" = "no"; then.
1600: 20 20 53 51 4c 49 54 45 5f 54 48 52 45 41 44 53 SQLITE_THREADS
1610: 41 46 45 3d 30 0a 20 20 41 43 5f 4d 53 47 5f 52 AFE=0. AC_MSG_R
1620: 45 53 55 4c 54 28 5b 6e 6f 5d 29 0a 65 6c 73 65 ESULT([no]).else
1630: 0a 20 20 53 51 4c 49 54 45 5f 54 48 52 45 41 44 . SQLITE_THREAD
1640: 53 41 46 45 3d 31 0a 20 20 41 43 5f 4d 53 47 5f SAFE=1. AC_MSG_
1650: 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 66 69 RESULT([yes]).fi
1660: 0a 41 43 5f 53 55 42 53 54 28 53 51 4c 49 54 45 .AC_SUBST(SQLITE
1670: 5f 54 48 52 45 41 44 53 41 46 45 29 0a 0a 69 66 _THREADSAFE)..if
1680: 20 74 65 73 74 20 22 24 53 51 4c 49 54 45 5f 54 test "$SQLITE_T
1690: 48 52 45 41 44 53 41 46 45 22 20 3d 20 22 31 22 HREADSAFE" = "1"
16a0: 3b 20 74 68 65 6e 0a 20 20 41 43 5f 53 45 41 52 ; then. AC_SEAR
16b0: 43 48 5f 4c 49 42 53 28 70 74 68 72 65 61 64 5f CH_LIBS(pthread_
16c0: 63 72 65 61 74 65 2c 20 70 74 68 72 65 61 64 29 create, pthread)
16d0: 0a 20 20 41 43 5f 53 45 41 52 43 48 5f 4c 49 42 . AC_SEARCH_LIB
16e0: 53 28 70 74 68 72 65 61 64 5f 6d 75 74 65 78 61 S(pthread_mutexa
16f0: 74 74 72 5f 69 6e 69 74 2c 20 70 74 68 72 65 61 ttr_init, pthrea
1700: 64 29 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 23 d).fi..#########
1710: 23 0a 23 20 44 6f 20 77 65 20 77 61 6e 74 20 74 #.# Do we want t
1720: 6f 20 73 75 70 70 6f 72 74 20 72 65 6c 65 61 73 o support releas
1730: 65 0a 23 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c e.#.AC_ARG_ENABL
1740: 45 28 72 65 6c 65 61 73 65 6d 6f 64 65 2c 20 0a E(releasemode, .
1750: 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b AC_HELP_STRING([
1760: 2d 2d 65 6e 61 62 6c 65 2d 72 65 6c 65 61 73 65 --enable-release
1770: 6d 6f 64 65 5d 2c 5b 53 75 70 70 6f 72 74 20 6c mode],[Support l
1780: 69 62 74 6f 6f 6c 20 6c 69 6e 6b 20 74 6f 20 72 ibtool link to r
1790: 65 6c 65 61 73 65 20 6d 6f 64 65 5d 29 2c 2c 65 elease mode]),,e
17a0: 6e 61 62 6c 65 5f 72 65 6c 65 61 73 65 6d 6f 64 nable_releasemod
17b0: 65 3d 6e 6f 29 0a 41 43 5f 4d 53 47 5f 43 48 45 e=no).AC_MSG_CHE
17c0: 43 4b 49 4e 47 28 5b 77 68 65 74 68 65 72 20 74 CKING([whether t
17d0: 6f 20 73 75 70 70 6f 72 74 20 73 68 61 72 65 64 o support shared
17e0: 20 6c 69 62 72 61 72 79 20 6c 69 6e 6b 65 64 20 library linked
17f0: 61 73 20 72 65 6c 65 61 73 65 20 6d 6f 64 65 20 as release mode
1800: 6f 72 20 6e 6f 74 5d 29 0a 69 66 20 74 65 73 74 or not]).if test
1810: 20 22 24 65 6e 61 62 6c 65 5f 72 65 6c 65 61 73 "$enable_releas
1820: 65 6d 6f 64 65 22 20 3d 20 22 6e 6f 22 3b 20 74 emode" = "no"; t
1830: 68 65 6e 0a 20 20 41 4c 4c 4f 57 52 45 4c 45 41 hen. ALLOWRELEA
1840: 53 45 3d 22 22 0a 20 20 41 43 5f 4d 53 47 5f 52 SE="". AC_MSG_R
1850: 45 53 55 4c 54 28 5b 6e 6f 5d 29 0a 65 6c 73 65 ESULT([no]).else
1860: 0a 20 20 41 4c 4c 4f 57 52 45 4c 45 41 53 45 3d . ALLOWRELEASE=
1870: 22 2d 72 65 6c 65 61 73 65 20 60 63 61 74 20 24 "-release `cat $
1880: 73 72 63 64 69 72 2f 56 45 52 53 49 4f 4e 60 22 srcdir/VERSION`"
1890: 0a 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 . AC_MSG_RESULT
18a0: 28 5b 79 65 73 5d 29 0a 66 69 0a 41 43 5f 53 55 ([yes]).fi.AC_SU
18b0: 42 53 54 28 41 4c 4c 4f 57 52 45 4c 45 41 53 45 BST(ALLOWRELEASE
18c0: 29 0a 0a 23 23 23 23 23 23 23 23 23 23 0a 23 20 )..##########.#
18d0: 44 6f 20 77 65 20 77 61 6e 74 20 74 65 6d 70 6f Do we want tempo
18e0: 72 61 72 79 20 64 61 74 61 62 61 73 65 73 20 69 rary databases i
18f0: 6e 20 6d 65 6d 6f 72 79 0a 23 0a 41 43 5f 41 52 n memory.#.AC_AR
1900: 47 5f 45 4e 41 42 4c 45 28 74 65 6d 70 73 74 6f G_ENABLE(tempsto
1910: 72 65 2c 20 0a 41 43 5f 48 45 4c 50 5f 53 54 52 re, .AC_HELP_STR
1920: 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 74 65 ING([--enable-te
1930: 6d 70 73 74 6f 72 65 5d 2c 5b 55 73 65 20 61 6e mpstore],[Use an
1940: 20 69 6e 2d 72 61 6d 20 64 61 74 61 62 61 73 65 in-ram database
1950: 20 66 6f 72 20 74 65 6d 70 6f 72 61 72 79 20 74 for temporary t
1960: 61 62 6c 65 73 20 28 6e 65 76 65 72 2c 6e 6f 2c ables (never,no,
1970: 79 65 73 2c 61 6c 77 61 79 73 29 5d 29 2c 2c 65 yes,always)]),,e
1980: 6e 61 62 6c 65 5f 74 65 6d 70 73 74 6f 72 65 3d nable_tempstore=
1990: 6e 6f 29 0a 41 43 5f 4d 53 47 5f 43 48 45 43 4b no).AC_MSG_CHECK
19a0: 49 4e 47 28 5b 77 68 65 74 68 65 72 20 74 6f 20 ING([whether to
19b0: 75 73 65 20 61 6e 20 69 6e 2d 72 61 6d 20 64 61 use an in-ram da
19c0: 74 61 62 61 73 65 20 66 6f 72 20 74 65 6d 70 6f tabase for tempo
19d0: 72 61 72 79 20 74 61 62 6c 65 73 5d 29 0a 63 61 rary tables]).ca
19e0: 73 65 20 22 24 65 6e 61 62 6c 65 5f 74 65 6d 70 se "$enable_temp
19f0: 73 74 6f 72 65 22 20 69 6e 0a 20 20 6e 65 76 65 store" in. neve
1a00: 72 20 29 20 0a 20 20 20 20 54 45 4d 50 5f 53 54 r ) . TEMP_ST
1a10: 4f 52 45 3d 30 0a 20 20 20 20 41 43 5f 4d 53 47 ORE=0. AC_MSG
1a20: 5f 52 45 53 55 4c 54 28 5b 6e 65 76 65 72 5d 29 _RESULT([never])
1a30: 0a 20 20 3b 3b 0a 20 20 6e 6f 20 29 20 0a 20 20 . ;;. no ) .
1a40: 20 20 54 45 4d 50 5f 53 54 4f 52 45 3d 31 0a 20 TEMP_STORE=1.
1a50: 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 AC_MSG_RESULT
1a60: 28 5b 6e 6f 5d 29 0a 20 20 3b 3b 0a 20 20 79 65 ([no]). ;;. ye
1a70: 73 20 29 20 0a 20 20 20 20 20 54 45 4d 50 5f 53 s ) . TEMP_S
1a80: 54 4f 52 45 3d 32 0a 20 20 20 20 41 43 5f 4d 53 TORE=2. AC_MS
1a90: 47 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a G_RESULT([yes]).
1aa0: 20 20 3b 3b 0a 20 20 61 6c 77 61 79 73 20 29 20 ;;. always )
1ab0: 0a 20 20 20 20 20 54 45 4d 50 5f 53 54 4f 52 45 . TEMP_STORE
1ac0: 3d 33 0a 20 20 20 20 41 43 5f 4d 53 47 5f 52 45 =3. AC_MSG_RE
1ad0: 53 55 4c 54 28 5b 61 6c 77 61 79 73 5d 29 0a 20 SULT([always]).
1ae0: 20 3b 3b 0a 20 20 2a 20 29 20 0a 20 20 20 20 54 ;;. * ) . T
1af0: 45 4d 50 5f 53 54 4f 52 45 3d 31 0a 20 20 20 20 EMP_STORE=1.
1b00: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e AC_MSG_RESULT([n
1b10: 6f 5d 29 0a 20 20 3b 3b 0a 65 73 61 63 0a 0a 41 o]). ;;.esac..A
1b20: 43 5f 53 55 42 53 54 28 54 45 4d 50 5f 53 54 4f C_SUBST(TEMP_STO
1b30: 52 45 29 0a 0a 23 23 23 23 23 23 23 23 23 23 23 RE)..###########
1b40: 0a 23 20 4c 6f 74 73 20 6f 66 20 74 68 69 6e 67 .# Lots of thing
1b50: 73 20 61 72 65 20 64 69 66 66 65 72 65 6e 74 20 s are different
1b60: 69 66 20 77 65 20 61 72 65 20 63 6f 6d 70 69 6c if we are compil
1b70: 69 6e 67 20 66 6f 72 20 57 69 6e 64 6f 77 73 20 ing for Windows
1b80: 75 73 69 6e 67 0a 23 20 74 68 65 20 43 59 47 57 using.# the CYGW
1b90: 49 4e 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e 20 IN environment.
1ba0: 20 53 6f 20 63 68 65 63 6b 20 66 6f 72 20 74 68 So check for th
1bb0: 61 74 20 73 70 65 63 69 61 6c 20 63 61 73 65 20 at special case
1bc0: 61 6e 64 20 68 61 6e 64 6c 65 0a 23 20 74 68 69 and handle.# thi
1bd0: 6e 67 73 20 61 63 63 6f 72 64 69 6e 67 6c 79 2e ngs accordingly.
1be0: 0a 23 0a 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 .#.AC_MSG_CHECKI
1bf0: 4e 47 28 5b 69 66 20 65 78 65 63 75 74 61 62 6c NG([if executabl
1c00: 65 73 20 68 61 76 65 20 74 68 65 20 2e 65 78 65 es have the .exe
1c10: 20 73 75 66 66 69 78 5d 29 0a 69 66 20 74 65 73 suffix]).if tes
1c20: 74 20 22 24 63 6f 6e 66 69 67 5f 42 55 49 4c 44 t "$config_BUILD
1c30: 5f 45 58 45 45 58 54 22 20 3d 20 22 2e 65 78 65 _EXEEXT" = ".exe
1c40: 22 3b 20 74 68 65 6e 0a 20 20 43 59 47 57 49 4e "; then. CYGWIN
1c50: 3d 79 65 73 0a 20 20 41 43 5f 4d 53 47 5f 52 45 =yes. AC_MSG_RE
1c60: 53 55 4c 54 28 79 65 73 29 0a 65 6c 73 65 0a 20 SULT(yes).else.
1c70: 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 75 AC_MSG_RESULT(u
1c80: 6e 6b 6e 6f 77 6e 29 0a 66 69 0a 69 66 20 74 65 nknown).fi.if te
1c90: 73 74 20 22 24 43 59 47 57 49 4e 22 20 21 3d 20 st "$CYGWIN" !=
1ca0: 22 79 65 73 22 3b 20 74 68 65 6e 0a 20 20 41 43 "yes"; then. AC
1cb0: 5f 43 59 47 57 49 4e 0a 66 69 0a 69 66 20 74 65 _CYGWIN.fi.if te
1cc0: 73 74 20 22 24 43 59 47 57 49 4e 22 20 3d 20 22 st "$CYGWIN" = "
1cd0: 79 65 73 22 3b 20 74 68 65 6e 0a 20 20 42 55 49 yes"; then. BUI
1ce0: 4c 44 5f 45 58 45 45 58 54 3d 2e 65 78 65 0a 65 LD_EXEEXT=.exe.e
1cf0: 6c 73 65 0a 20 20 42 55 49 4c 44 5f 45 58 45 45 lse. BUILD_EXEE
1d00: 58 54 3d 24 45 58 45 45 58 54 0a 66 69 0a 69 66 XT=$EXEEXT.fi.if
1d10: 20 74 65 73 74 20 78 22 24 63 72 6f 73 73 5f 63 test x"$cross_c
1d20: 6f 6d 70 69 6c 69 6e 67 22 20 3d 20 78 6e 6f 3b ompiling" = xno;
1d30: 20 74 68 65 6e 0a 20 20 54 41 52 47 45 54 5f 45 then. TARGET_E
1d40: 58 45 45 58 54 3d 24 42 55 49 4c 44 5f 45 58 45 XEEXT=$BUILD_EXE
1d50: 45 58 54 0a 65 6c 73 65 0a 20 20 54 41 52 47 45 EXT.else. TARGE
1d60: 54 5f 45 58 45 45 58 54 3d 24 63 6f 6e 66 69 67 T_EXEEXT=$config
1d70: 5f 54 41 52 47 45 54 5f 45 58 45 45 58 54 0a 66 _TARGET_EXEEXT.f
1d80: 69 0a 69 66 20 74 65 73 74 20 22 24 54 41 52 47 i.if test "$TARG
1d90: 45 54 5f 45 58 45 45 58 54 22 20 3d 20 22 2e 65 ET_EXEEXT" = ".e
1da0: 78 65 22 3b 20 74 68 65 6e 0a 20 20 53 51 4c 49 xe"; then. SQLI
1db0: 54 45 5f 4f 53 5f 55 4e 49 58 3d 30 0a 20 20 53 TE_OS_UNIX=0. S
1dc0: 51 4c 49 54 45 5f 4f 53 5f 57 49 4e 3d 31 0a 20 QLITE_OS_WIN=1.
1dd0: 20 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 CFLAGS="$CFLAGS
1de0: 20 2d 44 53 51 4c 49 54 45 5f 4f 53 5f 57 49 4e -DSQLITE_OS_WIN
1df0: 3d 31 22 0a 65 6c 73 65 0a 20 20 53 51 4c 49 54 =1".else. SQLIT
1e00: 45 5f 4f 53 5f 55 4e 49 58 3d 31 0a 20 20 53 51 E_OS_UNIX=1. SQ
1e10: 4c 49 54 45 5f 4f 53 5f 57 49 4e 3d 30 0a 20 20 LITE_OS_WIN=0.
1e20: 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 CFLAGS="$CFLAGS
1e30: 2d 44 53 51 4c 49 54 45 5f 4f 53 5f 55 4e 49 58 -DSQLITE_OS_UNIX
1e40: 3d 31 22 0a 66 69 0a 0a 41 43 5f 53 55 42 53 54 =1".fi..AC_SUBST
1e50: 28 42 55 49 4c 44 5f 45 58 45 45 58 54 29 0a 41 (BUILD_EXEEXT).A
1e60: 43 5f 53 55 42 53 54 28 53 51 4c 49 54 45 5f 4f C_SUBST(SQLITE_O
1e70: 53 5f 55 4e 49 58 29 0a 41 43 5f 53 55 42 53 54 S_UNIX).AC_SUBST
1e80: 28 53 51 4c 49 54 45 5f 4f 53 5f 57 49 4e 29 0a (SQLITE_OS_WIN).
1e90: 41 43 5f 53 55 42 53 54 28 54 41 52 47 45 54 5f AC_SUBST(TARGET_
1ea0: 45 58 45 45 58 54 29 0a 0a 23 23 23 23 23 23 23 EXEEXT)..#######
1eb0: 23 23 23 0a 23 20 46 69 67 75 72 65 20 6f 75 74 ###.# Figure out
1ec0: 20 61 6c 6c 20 74 68 65 20 70 61 72 61 6d 65 74 all the paramet
1ed0: 65 72 73 20 6e 65 65 64 65 64 20 74 6f 20 63 6f ers needed to co
1ee0: 6d 70 69 6c 65 20 61 67 61 69 6e 73 74 20 54 63 mpile against Tc
1ef0: 6c 2e 0a 23 0a 23 20 54 68 69 73 20 63 6f 64 65 l..#.# This code
1f00: 20 69 73 20 64 65 72 69 76 65 64 20 66 72 6f 6d is derived from
1f10: 20 74 68 65 20 53 43 5f 50 41 54 48 5f 54 43 4c the SC_PATH_TCL
1f20: 43 4f 4e 46 49 47 20 61 6e 64 20 53 43 5f 4c 4f CONFIG and SC_LO
1f30: 41 44 5f 54 43 4c 43 4f 4e 46 49 47 0a 23 20 6d AD_TCLCONFIG.# m
1f40: 61 63 72 6f 73 20 69 6e 20 74 68 65 20 69 6e 20 acros in the in
1f50: 74 68 65 20 74 63 6c 2e 6d 34 20 66 69 6c 65 20 the tcl.m4 file
1f60: 6f 66 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 of the standard
1f70: 54 43 4c 20 64 69 73 74 72 69 62 75 74 69 6f 6e TCL distribution
1f80: 2e 0a 23 20 54 68 6f 73 65 20 6d 61 63 72 6f 73 ..# Those macros
1f90: 20 63 6f 75 6c 64 20 6e 6f 74 20 62 65 20 75 73 could not be us
1fa0: 65 64 20 64 69 72 65 63 74 6c 79 20 73 69 6e 63 ed directly sinc
1fb0: 65 20 77 65 20 68 61 76 65 20 74 6f 20 6d 61 6b e we have to mak
1fc0: 65 20 73 6f 6d 65 0a 23 20 6d 69 6e 6f 72 20 63 e some.# minor c
1fd0: 68 61 6e 67 65 73 20 74 6f 20 61 63 63 6f 6d 6f hanges to accomo
1fe0: 64 61 74 65 20 73 79 73 74 65 6d 73 20 74 68 61 date systems tha
1ff0: 74 20 64 6f 20 6e 6f 74 20 68 61 76 65 20 54 43 t do not have TC
2000: 4c 20 69 6e 73 74 61 6c 6c 65 64 2e 0a 23 0a 41 L installed..#.A
2010: 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 74 63 6c C_ARG_ENABLE(tcl
2020: 2c 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 , AC_HELP_STRING
2030: 28 5b 2d 2d 64 69 73 61 62 6c 65 2d 74 63 6c 5d ([--disable-tcl]
2040: 2c 5b 64 6f 20 6e 6f 74 20 62 75 69 6c 64 20 54 ,[do not build T
2050: 43 4c 20 65 78 74 65 6e 73 69 6f 6e 5d 29 2c 0a CL extension]),.
2060: 20 20 20 20 20 20 5b 75 73 65 5f 74 63 6c 3d 24 [use_tcl=$
2070: 65 6e 61 62 6c 65 76 61 6c 5d 2c 5b 75 73 65 5f enableval],[use_
2080: 74 63 6c 3d 79 65 73 5d 29 0a 69 66 20 74 65 73 tcl=yes]).if tes
2090: 74 20 22 24 7b 75 73 65 5f 74 63 6c 7d 22 20 3d t "${use_tcl}" =
20a0: 20 22 79 65 73 22 20 3b 20 74 68 65 6e 0a 20 20 "yes" ; then.
20b0: 41 43 5f 41 52 47 5f 57 49 54 48 28 74 63 6c 2c AC_ARG_WITH(tcl,
20c0: 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 AC_HELP_STRING(
20d0: 5b 2d 2d 77 69 74 68 2d 74 63 6c 3d 44 49 52 5d [--with-tcl=DIR]
20e0: 2c 5b 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 ,[directory cont
20f0: 61 69 6e 69 6e 67 20 74 63 6c 20 63 6f 6e 66 69 aining tcl confi
2100: 67 75 72 61 74 69 6f 6e 20 28 74 63 6c 43 6f 6e guration (tclCon
2110: 66 69 67 2e 73 68 29 5d 29 2c 20 77 69 74 68 5f fig.sh)]), with_
2120: 74 63 6c 63 6f 6e 66 69 67 3d 24 7b 77 69 74 68 tclconfig=${with
2130: 76 61 6c 7d 29 0a 20 20 41 43 5f 4d 53 47 5f 43 val}). AC_MSG_C
2140: 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 54 63 6c HECKING([for Tcl
2150: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29 configuration])
2160: 0a 20 20 41 43 5f 43 41 43 48 45 5f 56 41 4c 28 . AC_CACHE_VAL(
2170: 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 ac_cv_c_tclconfi
2180: 67 2c 5b 0a 20 20 20 20 23 20 46 69 72 73 74 20 g,[. # First
2190: 63 68 65 63 6b 20 74 6f 20 73 65 65 20 69 66 20 check to see if
21a0: 2d 2d 77 69 74 68 2d 74 63 6c 20 77 61 73 20 73 --with-tcl was s
21b0: 70 65 63 69 66 69 65 64 2e 0a 20 20 20 20 69 66 pecified.. if
21c0: 20 74 65 73 74 20 78 22 24 7b 77 69 74 68 5f 74 test x"${with_t
21d0: 63 6c 63 6f 6e 66 69 67 7d 22 20 21 3d 20 78 20 clconfig}" != x
21e0: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 69 66 20 ; then. if
21f0: 74 65 73 74 20 2d 66 20 22 24 7b 77 69 74 68 5f test -f "${with_
2200: 74 63 6c 63 6f 6e 66 69 67 7d 2f 74 63 6c 43 6f tclconfig}/tclCo
2210: 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a nfig.sh" ; then.
2220: 20 20 20 20 20 20 20 20 61 63 5f 63 76 5f 63 5f ac_cv_c_
2230: 74 63 6c 63 6f 6e 66 69 67 3d 60 28 63 64 20 24 tclconfig=`(cd $
2240: 7b 77 69 74 68 5f 74 63 6c 63 6f 6e 66 69 67 7d {with_tclconfig}
2250: 3b 20 70 77 64 29 60 0a 20 20 20 20 20 20 65 6c ; pwd)`. el
2260: 73 65 0a 20 20 20 20 20 20 20 20 41 43 5f 4d 53 se. AC_MS
2270: 47 5f 45 52 52 4f 52 28 5b 24 7b 77 69 74 68 5f G_ERROR([${with_
2280: 74 63 6c 63 6f 6e 66 69 67 7d 20 64 69 72 65 63 tclconfig} direc
2290: 74 6f 72 79 20 64 6f 65 73 6e 27 74 20 63 6f 6e tory doesn't con
22a0: 74 61 69 6e 20 74 63 6c 43 6f 6e 66 69 67 2e 73 tain tclConfig.s
22b0: 68 5d 29 0a 20 20 20 20 20 20 66 69 0a 20 20 20 h]). fi.
22c0: 20 66 69 0a 0a 20 20 20 20 23 20 53 74 61 72 74 fi.. # Start
22d0: 20 61 75 74 6f 73 65 61 72 63 68 20 62 79 20 61 autosearch by a
22e0: 73 6b 69 6e 67 20 74 63 6c 73 68 0a 20 20 20 20 sking tclsh.
22f0: 69 66 20 74 65 73 74 20 78 22 24 7b 61 63 5f 63 if test x"${ac_c
2300: 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20 v_c_tclconfig}"
2310: 3d 20 78 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 = x ; then.
2320: 20 69 66 20 74 65 73 74 20 78 22 24 63 72 6f 73 if test x"$cros
2330: 73 5f 63 6f 6d 70 69 6c 69 6e 67 22 20 3d 20 78 s_compiling" = x
2340: 6e 6f 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 no; then.
2350: 20 66 6f 72 20 69 20 69 6e 20 60 65 63 68 6f 20 for i in `echo
2360: 27 70 75 74 73 20 73 74 64 6f 75 74 20 24 61 75 'puts stdout $au
2370: 74 6f 5f 70 61 74 68 27 20 7c 20 24 7b 54 43 4c to_path' | ${TCL
2380: 53 48 5f 43 4d 44 7d 60 0a 20 20 20 20 20 20 20 SH_CMD}`.
2390: 20 64 6f 0a 20 20 20 20 20 20 20 20 20 20 69 66 do. if
23a0: 20 74 65 73 74 20 2d 66 20 22 24 69 2f 74 63 6c test -f "$i/tcl
23b0: 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 Config.sh" ; the
23c0: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 63 n. ac
23d0: 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 3d _cv_c_tclconfig=
23e0: 22 24 69 22 0a 20 20 20 20 20 20 20 20 20 20 20 "$i".
23f0: 20 62 72 65 61 6b 0a 20 20 20 20 20 20 20 20 20 break.
2400: 20 66 69 0a 20 20 20 20 20 20 20 20 64 6f 6e 65 fi. done
2410: 0a 20 20 20 20 20 20 66 69 0a 20 20 20 20 66 69 . fi. fi
2420: 0a 0a 20 20 20 20 23 20 4f 6e 20 75 62 75 6e 74 .. # On ubunt
2430: 75 20 31 34 2e 31 30 2c 20 24 61 75 74 6f 5f 70 u 14.10, $auto_p
2440: 61 74 68 20 6f 6e 20 74 63 6c 73 68 20 69 73 20 ath on tclsh is
2450: 6e 6f 74 20 71 75 69 74 65 20 63 6f 72 72 65 63 not quite correc
2460: 74 2e 0a 20 20 20 20 23 20 53 6f 20 74 72 79 20 t.. # So try
2470: 61 67 61 69 6e 20 61 66 74 65 72 20 61 70 70 6c again after appl
2480: 79 69 6e 67 20 63 6f 72 72 65 63 74 69 6f 6e 73 ying corrections
2490: 2e 0a 20 20 20 20 69 66 20 74 65 73 74 20 78 22 .. if test x"
24a0: 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e ${ac_cv_c_tclcon
24b0: 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e fig}" = x ; then
24c0: 0a 20 20 20 20 20 20 69 66 20 74 65 73 74 20 78 . if test x
24d0: 22 24 63 72 6f 73 73 5f 63 6f 6d 70 69 6c 69 6e "$cross_compilin
24e0: 67 22 20 3d 20 78 6e 6f 3b 20 74 68 65 6e 0a 20 g" = xno; then.
24f0: 20 20 20 20 20 20 20 66 6f 72 20 69 20 69 6e 20 for i in
2500: 60 65 63 68 6f 20 27 70 75 74 73 20 73 74 64 6f `echo 'puts stdo
2510: 75 74 20 24 61 75 74 6f 5f 70 61 74 68 27 20 7c ut $auto_path' |
2520: 20 24 7b 54 43 4c 53 48 5f 43 4d 44 7d 20 7c 20 ${TCLSH_CMD} |
2530: 73 65 64 20 27 73 2c 2f 74 63 6c 74 6b 2f 74 63 sed 's,/tcltk/tc
2540: 6c 2c 2f 74 63 6c 2c 67 27 60 0a 20 20 20 20 20 l,/tcl,g'`.
2550: 20 20 20 64 6f 0a 20 20 20 20 20 20 20 20 20 20 do.
2560: 69 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 74 if test -f "$i/t
2570: 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 clConfig.sh" ; t
2580: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 hen.
2590: 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 ac_cv_c_tclconfi
25a0: 67 3d 22 24 69 22 0a 20 20 20 20 20 20 20 20 20 g="$i".
25b0: 20 20 20 62 72 65 61 6b 0a 20 20 20 20 20 20 20 break.
25c0: 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 64 6f fi. do
25d0: 6e 65 0a 20 20 20 20 20 20 66 69 0a 20 20 20 20 ne. fi.
25e0: 66 69 0a 0a 20 20 20 20 23 20 52 65 63 65 6e 74 fi.. # Recent
25f0: 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 58 63 6f versions of Xco
2600: 64 65 20 6f 6e 20 4d 61 63 73 20 68 69 64 20 74 de on Macs hid t
2610: 68 65 20 74 63 6c 43 6f 6e 66 69 67 2e 73 68 20 he tclConfig.sh
2620: 66 69 6c 65 0a 20 20 20 20 23 20 69 6e 20 61 20 file. # in a
2630: 73 74 72 61 6e 67 65 20 70 6c 61 63 65 2e 0a 20 strange place..
2640: 20 20 20 69 66 20 74 65 73 74 20 78 22 24 7b 61 if test x"${a
2650: 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 c_cv_c_tclconfig
2660: 7d 22 20 3d 20 78 20 3b 20 74 68 65 6e 0a 20 20 }" = x ; then.
2670: 20 20 20 20 69 66 20 74 65 73 74 20 78 22 24 63 if test x"$c
2680: 72 6f 73 73 5f 63 6f 6d 70 69 6c 69 6e 67 22 20 ross_compiling"
2690: 3d 20 78 6e 6f 3b 20 74 68 65 6e 0a 20 20 20 20 = xno; then.
26a0: 20 20 20 20 66 6f 72 20 69 20 69 6e 20 2f 41 70 for i in /Ap
26b0: 70 6c 69 63 61 74 69 6f 6e 73 2f 58 63 6f 64 65 plications/Xcode
26c0: 2e 61 70 70 2f 43 6f 6e 74 65 6e 74 73 2f 44 65 .app/Contents/De
26d0: 76 65 6c 6f 70 65 72 2f 50 6c 61 74 66 6f 72 6d veloper/Platform
26e0: 73 2f 4d 61 63 4f 53 58 2e 70 6c 61 74 66 6f 72 s/MacOSX.platfor
26f0: 6d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 m/Developer/SDKs
2700: 2f 4d 61 63 4f 53 58 2a 2e 73 64 6b 2f 75 73 72 /MacOSX*.sdk/usr
2710: 2f 6c 69 62 0a 20 20 20 20 20 20 20 20 64 6f 0a /lib. do.
2720: 20 20 20 20 20 20 20 20 20 20 69 66 20 74 65 73 if tes
2730: 74 20 2d 66 20 22 24 69 2f 74 63 6c 43 6f 6e 66 t -f "$i/tclConf
2740: 69 67 2e 73 68 22 20 3b 20 74 68 65 6e 0a 20 20 ig.sh" ; then.
2750: 20 20 20 20 20 20 20 20 20 20 61 63 5f 63 76 5f ac_cv_
2760: 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 22 24 69 22 c_tclconfig="$i"
2770: 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 . bre
2780: 61 6b 0a 20 20 20 20 20 20 20 20 20 20 66 69 0a ak. fi.
2790: 20 20 20 20 20 20 20 20 64 6f 6e 65 0a 20 20 20 done.
27a0: 20 20 20 66 69 0a 20 20 20 20 66 69 0a 0a 20 20 fi. fi..
27b0: 20 20 23 20 74 68 65 6e 20 63 68 65 63 6b 20 66 # then check f
27c0: 6f 72 20 61 20 70 72 69 76 61 74 65 20 54 63 6c or a private Tcl
27d0: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 0a 20 20 installation.
27e0: 20 20 69 66 20 74 65 73 74 20 78 22 24 7b 61 63 if test x"${ac
27f0: 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 7d _cv_c_tclconfig}
2800: 22 20 3d 20 78 20 3b 20 74 68 65 6e 0a 20 20 20 " = x ; then.
2810: 20 20 20 66 6f 72 20 69 20 69 6e 20 5c 0a 20 20 for i in \.
2820: 20 20 20 20 20 20 20 20 20 20 2e 2e 2f 74 63 6c ../tcl
2830: 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 60 \. `
2840: 6c 73 20 2d 64 72 20 2e 2e 2f 74 63 6c 5b 5b 38 ls -dr ../tcl[[8
2850: 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 -9]].[[0-9]].[[0
2860: 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c -9]]* 2>/dev/nul
2870: 6c 60 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 l` \.
2880: 20 60 6c 73 20 2d 64 72 20 2e 2e 2f 74 63 6c 5b `ls -dr ../tcl[
2890: 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 32 [8-9]].[[0-9]] 2
28a0: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 20 20 >/dev/null` \.
28b0: 20 20 20 20 20 20 20 20 20 20 60 6c 73 20 2d 64 `ls -d
28c0: 72 20 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e r ../tcl[[8-9]].
28d0: 5b 5b 30 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f [[0-9]]* 2>/dev/
28e0: 6e 75 6c 6c 60 20 5c 0a 20 20 20 20 20 20 20 20 null` \.
28f0: 20 20 20 20 2e 2e 2f 2e 2e 2f 74 63 6c 20 5c 0a ../../tcl \.
2900: 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 20 `ls
2910: 2d 64 72 20 2e 2e 2f 2e 2e 2f 74 63 6c 5b 5b 38 -dr ../../tcl[[8
2920: 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 -9]].[[0-9]].[[0
2930: 2d 39 5d 5d 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c -9]]* 2>/dev/nul
2940: 6c 60 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 l` \.
2950: 20 60 6c 73 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 74 `ls -dr ../../t
2960: 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d cl[[8-9]].[[0-9]
2970: 5d 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c ] 2>/dev/null` \
2980: 0a 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 . `ls
2990: 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 74 63 6c 5b 5b -dr ../../tcl[[
29a0: 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 32 8-9]].[[0-9]]* 2
29b0: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 20 20 >/dev/null` \.
29c0: 20 20 20 20 20 20 20 20 20 20 2e 2e 2f 2e 2e 2f ../../
29d0: 2e 2e 2f 74 63 6c 20 5c 0a 20 20 20 20 20 20 20 ../tcl \.
29e0: 20 20 20 20 20 60 6c 73 20 2d 64 72 20 2e 2e 2f `ls -dr ../
29f0: 2e 2e 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d ../../tcl[[8-9]]
2a00: 2e 5b 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d .[[0-9]].[[0-9]]
2a10: 2a 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c * 2>/dev/null` \
2a20: 0a 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 . `ls
2a30: 20 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 63 -dr ../../../tc
2a40: 6c 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d l[[8-9]].[[0-9]]
2a50: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 2>/dev/null` \.
2a60: 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 20 `ls
2a70: 2d 64 72 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 74 63 6c -dr ../../../tcl
2a80: 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a [[8-9]].[[0-9]]*
2a90: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 0a 20 20 2>/dev/null`.
2aa0: 20 20 20 20 64 6f 0a 20 20 20 20 20 20 20 20 69 do. i
2ab0: 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 75 6e f test -f "$i/un
2ac0: 69 78 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 ix/tclConfig.sh"
2ad0: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 ; then.
2ae0: 20 20 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e ac_cv_c_tclcon
2af0: 66 69 67 3d 60 28 63 64 20 24 69 2f 75 6e 69 78 fig=`(cd $i/unix
2b00: 3b 20 70 77 64 29 60 0a 20 20 20 20 20 20 20 20 ; pwd)`.
2b10: 20 20 62 72 65 61 6b 0a 20 20 20 20 20 20 20 20 break.
2b20: 66 69 0a 20 20 20 20 20 20 64 6f 6e 65 0a 20 20 fi. done.
2b30: 20 20 66 69 0a 0a 20 20 20 20 23 20 63 68 65 63 fi.. # chec
2b40: 6b 20 69 6e 20 61 20 66 65 77 20 63 6f 6d 6d 6f k in a few commo
2b50: 6e 20 69 6e 73 74 61 6c 6c 20 6c 6f 63 61 74 69 n install locati
2b60: 6f 6e 73 0a 20 20 20 20 69 66 20 74 65 73 74 20 ons. if test
2b70: 78 22 24 7b 61 63 5f 63 76 5f 63 5f 74 63 6c 63 x"${ac_cv_c_tclc
2b80: 6f 6e 66 69 67 7d 22 20 3d 20 78 20 3b 20 74 68 onfig}" = x ; th
2b90: 65 6e 0a 20 20 20 20 20 20 66 6f 72 20 69 20 69 en. for i i
2ba0: 6e 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 n \.
2bb0: 60 6c 73 20 2d 64 20 24 7b 6c 69 62 64 69 72 7d `ls -d ${libdir}
2bc0: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 2>/dev/null` \.
2bd0: 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 20 `ls
2be0: 2d 64 20 2f 75 73 72 2f 6c 6f 63 61 6c 2f 6c 69 -d /usr/local/li
2bf0: 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c b 2>/dev/null` \
2c00: 0a 20 20 20 20 20 20 20 20 20 20 20 20 60 6c 73 . `ls
2c10: 20 2d 64 20 2f 75 73 72 2f 63 6f 6e 74 72 69 62 -d /usr/contrib
2c20: 2f 6c 69 62 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c /lib 2>/dev/null
2c30: 60 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 ` \.
2c40: 60 6c 73 20 2d 64 20 2f 75 73 72 2f 6c 69 62 20 `ls -d /usr/lib
2c50: 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 0a 20 20 20 2>/dev/null`.
2c60: 20 20 20 64 6f 0a 20 20 20 20 20 20 20 20 69 66 do. if
2c70: 20 74 65 73 74 20 2d 66 20 22 24 69 2f 74 63 6c test -f "$i/tcl
2c80: 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 65 Config.sh" ; the
2c90: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 61 63 5f n. ac_
2ca0: 63 76 5f 63 5f 74 63 6c 63 6f 6e 66 69 67 3d 60 cv_c_tclconfig=`
2cb0: 28 63 64 20 24 69 3b 20 70 77 64 29 60 0a 20 20 (cd $i; pwd)`.
2cc0: 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 0a 20 break.
2cd0: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 fi.
2ce0: 64 6f 6e 65 0a 20 20 20 20 66 69 0a 0a 20 20 20 done. fi..
2cf0: 20 23 20 63 68 65 63 6b 20 69 6e 20 61 20 66 65 # check in a fe
2d00: 77 20 6f 74 68 65 72 20 70 72 69 76 61 74 65 20 w other private
2d10: 6c 6f 63 61 74 69 6f 6e 73 0a 20 20 20 20 69 66 locations. if
2d20: 20 74 65 73 74 20 78 22 24 7b 61 63 5f 63 76 5f test x"${ac_cv_
2d30: 63 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20 3d 20 c_tclconfig}" =
2d40: 78 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 66 x ; then. f
2d50: 6f 72 20 69 20 69 6e 20 5c 0a 20 20 20 20 20 20 or i in \.
2d60: 20 20 20 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f ${srcdir}/../
2d70: 74 63 6c 20 5c 0a 20 20 20 20 20 20 20 20 20 60 tcl \. `
2d80: 6c 73 20 2d 64 72 20 24 7b 73 72 63 64 69 72 7d ls -dr ${srcdir}
2d90: 2f 2e 2e 2f 74 63 6c 5b 5b 38 2d 39 5d 5d 2e 5b /../tcl[[8-9]].[
2da0: 5b 30 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a 20 [0-9]].[[0-9]]*
2db0: 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 20 2>/dev/null` \.
2dc0: 20 20 20 20 20 20 20 20 60 6c 73 20 2d 64 72 20 `ls -dr
2dd0: 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f 74 63 6c ${srcdir}/../tcl
2de0: 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 20 [[8-9]].[[0-9]]
2df0: 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 20 5c 0a 20 2>/dev/null` \.
2e00: 20 20 20 20 20 20 20 20 60 6c 73 20 2d 64 72 20 `ls -dr
2e10: 24 7b 73 72 63 64 69 72 7d 2f 2e 2e 2f 74 63 6c ${srcdir}/../tcl
2e20: 5b 5b 38 2d 39 5d 5d 2e 5b 5b 30 2d 39 5d 5d 2a [[8-9]].[[0-9]]*
2e30: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 0a 20 20 2>/dev/null`.
2e40: 20 20 20 20 64 6f 0a 20 20 20 20 20 20 20 20 69 do. i
2e50: 66 20 74 65 73 74 20 2d 66 20 22 24 69 2f 75 6e f test -f "$i/un
2e60: 69 78 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 22 ix/tclConfig.sh"
2e70: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 ; then.
2e80: 20 20 61 63 5f 63 76 5f 63 5f 74 63 6c 63 6f 6e ac_cv_c_tclcon
2e90: 66 69 67 3d 60 28 63 64 20 24 69 2f 75 6e 69 78 fig=`(cd $i/unix
2ea0: 3b 20 70 77 64 29 60 0a 20 20 20 20 20 20 20 20 ; pwd)`.
2eb0: 20 20 62 72 65 61 6b 0a 20 20 20 20 20 20 20 20 break.
2ec0: 66 69 0a 20 20 20 20 20 20 64 6f 6e 65 0a 20 20 fi. done.
2ed0: 20 20 66 69 0a 20 20 5d 29 0a 0a 20 20 69 66 20 fi. ]).. if
2ee0: 74 65 73 74 20 78 22 24 7b 61 63 5f 63 76 5f 63 test x"${ac_cv_c
2ef0: 5f 74 63 6c 63 6f 6e 66 69 67 7d 22 20 3d 20 78 _tclconfig}" = x
2f00: 20 3b 20 74 68 65 6e 0a 20 20 20 20 75 73 65 5f ; then. use_
2f10: 74 63 6c 3d 6e 6f 0a 20 20 20 20 41 43 5f 4d 53 tcl=no. AC_MS
2f20: 47 5f 57 41 52 4e 28 43 61 6e 27 74 20 66 69 6e G_WARN(Can't fin
2f30: 64 20 54 63 6c 20 63 6f 6e 66 69 67 75 72 61 74 d Tcl configurat
2f40: 69 6f 6e 20 64 65 66 69 6e 69 74 69 6f 6e 73 29 ion definitions)
2f50: 0a 20 20 20 20 41 43 5f 4d 53 47 5f 57 41 52 4e . AC_MSG_WARN
2f60: 28 2a 2a 2a 20 57 69 74 68 6f 75 74 20 54 63 6c (*** Without Tcl
2f70: 20 74 68 65 20 72 65 67 72 65 73 73 69 6f 6e 20 the regression
2f80: 74 65 73 74 73 20 63 61 6e 6e 6f 74 20 62 65 20 tests cannot be
2f90: 65 78 65 63 75 74 65 64 20 2a 2a 2a 29 0a 20 20 executed ***).
2fa0: 20 20 41 43 5f 4d 53 47 5f 57 41 52 4e 28 2a 2a AC_MSG_WARN(**
2fb0: 2a 20 43 6f 6e 73 69 64 65 72 20 75 73 69 6e 67 * Consider using
2fc0: 20 2d 2d 77 69 74 68 2d 74 63 6c 3d 2e 2e 2e 20 --with-tcl=...
2fd0: 74 6f 20 64 65 66 69 6e 65 20 6c 6f 63 61 74 69 to define locati
2fe0: 6f 6e 20 6f 66 20 54 63 6c 20 2a 2a 2a 29 0a 20 on of Tcl ***).
2ff0: 20 65 6c 73 65 0a 20 20 20 20 54 43 4c 5f 42 49 else. TCL_BI
3000: 4e 5f 44 49 52 3d 24 7b 61 63 5f 63 76 5f 63 5f N_DIR=${ac_cv_c_
3010: 74 63 6c 63 6f 6e 66 69 67 7d 0a 20 20 20 20 41 tclconfig}. A
3020: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 66 6f 75 C_MSG_RESULT(fou
3030: 6e 64 20 24 54 43 4c 5f 42 49 4e 5f 44 49 52 2f nd $TCL_BIN_DIR/
3040: 74 63 6c 43 6f 6e 66 69 67 2e 73 68 29 0a 0a 20 tclConfig.sh)..
3050: 20 20 20 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 AC_MSG_CHECKI
3060: 4e 47 28 5b 66 6f 72 20 65 78 69 73 74 65 6e 63 NG([for existenc
3070: 65 20 6f 66 20 24 54 43 4c 5f 42 49 4e 5f 44 49 e of $TCL_BIN_DI
3080: 52 2f 74 63 6c 43 6f 6e 66 69 67 2e 73 68 5d 29 R/tclConfig.sh])
3090: 0a 20 20 20 20 69 66 20 74 65 73 74 20 2d 66 20 . if test -f
30a0: 22 24 54 43 4c 5f 42 49 4e 5f 44 49 52 2f 74 63 "$TCL_BIN_DIR/tc
30b0: 6c 43 6f 6e 66 69 67 2e 73 68 22 20 3b 20 74 68 lConfig.sh" ; th
30c0: 65 6e 0a 20 20 20 20 20 20 41 43 5f 4d 53 47 5f en. AC_MSG_
30d0: 52 45 53 55 4c 54 28 5b 6c 6f 61 64 69 6e 67 5d RESULT([loading]
30e0: 29 0a 20 20 20 20 20 20 2e 20 24 54 43 4c 5f 42 ). . $TCL_B
30f0: 49 4e 5f 44 49 52 2f 74 63 6c 43 6f 6e 66 69 67 IN_DIR/tclConfig
3100: 2e 73 68 0a 20 20 20 20 65 6c 73 65 0a 20 20 20 .sh. else.
3110: 20 20 20 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 AC_MSG_RESULT
3120: 28 5b 66 69 6c 65 20 6e 6f 74 20 66 6f 75 6e 64 ([file not found
3130: 5d 29 0a 20 20 20 20 66 69 0a 20 20 20 20 0a 20 ]). fi. .
3140: 20 20 20 23 0a 20 20 20 20 23 20 49 66 20 74 68 #. # If th
3150: 65 20 54 43 4c 5f 42 49 4e 5f 44 49 52 20 69 73 e TCL_BIN_DIR is
3160: 20 74 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 the build direc
3170: 74 6f 72 79 20 28 6e 6f 74 20 74 68 65 20 69 6e tory (not the in
3180: 73 74 61 6c 6c 20 64 69 72 65 63 74 6f 72 79 29 stall directory)
3190: 2c 0a 20 20 20 20 23 20 74 68 65 6e 20 73 65 74 ,. # then set
31a0: 20 74 68 65 20 63 6f 6d 6d 6f 6e 20 76 61 72 69 the common vari
31b0: 61 62 6c 65 20 6e 61 6d 65 20 74 6f 20 74 68 65 able name to the
31c0: 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 62 75 value of the bu
31d0: 69 6c 64 20 76 61 72 69 61 62 6c 65 73 2e 0a 20 ild variables..
31e0: 20 20 20 23 20 46 6f 72 20 65 78 61 6d 70 6c 65 # For example
31f0: 2c 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 54 , the variable T
3200: 43 4c 5f 4c 49 42 5f 53 50 45 43 20 77 69 6c 6c CL_LIB_SPEC will
3210: 20 62 65 20 73 65 74 20 74 6f 20 74 68 65 20 76 be set to the v
3220: 61 6c 75 65 0a 20 20 20 20 23 20 6f 66 20 54 43 alue. # of TC
3230: 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 43 L_BUILD_LIB_SPEC
3240: 2e 20 41 6e 20 65 78 74 65 6e 73 69 6f 6e 20 73 . An extension s
3250: 68 6f 75 6c 64 20 6d 61 6b 65 20 75 73 65 20 6f hould make use o
3260: 66 20 54 43 4c 5f 4c 49 42 5f 53 50 45 43 0a 20 f TCL_LIB_SPEC.
3270: 20 20 20 23 20 69 6e 73 74 65 61 64 20 6f 66 20 # instead of
3280: 54 43 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 TCL_BUILD_LIB_SP
3290: 45 43 20 73 69 6e 63 65 20 69 74 20 77 69 6c 6c EC since it will
32a0: 20 77 6f 72 6b 20 77 69 74 68 20 62 6f 74 68 20 work with both
32b0: 61 6e 0a 20 20 20 20 23 20 69 6e 73 74 61 6c 6c an. # install
32c0: 65 64 20 61 6e 64 20 75 6e 69 6e 73 74 61 6c 6c ed and uninstall
32d0: 65 64 20 76 65 72 73 69 6f 6e 20 6f 66 20 54 63 ed version of Tc
32e0: 6c 2e 0a 20 20 20 20 23 0a 20 20 20 20 0a 20 20 l.. #. .
32f0: 20 20 69 66 20 74 65 73 74 20 2d 66 20 24 54 43 if test -f $TC
3300: 4c 5f 42 49 4e 5f 44 49 52 2f 4d 61 6b 65 66 69 L_BIN_DIR/Makefi
3310: 6c 65 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 le ; then.
3320: 54 43 4c 5f 4c 49 42 5f 53 50 45 43 3d 24 7b 54 TCL_LIB_SPEC=${T
3330: 43 4c 5f 42 55 49 4c 44 5f 4c 49 42 5f 53 50 45 CL_BUILD_LIB_SPE
3340: 43 7d 0a 20 20 20 20 20 20 54 43 4c 5f 53 54 55 C}. TCL_STU
3350: 42 5f 4c 49 42 5f 53 50 45 43 3d 24 7b 54 43 4c B_LIB_SPEC=${TCL
3360: 5f 42 55 49 4c 44 5f 53 54 55 42 5f 4c 49 42 5f _BUILD_STUB_LIB_
3370: 53 50 45 43 7d 0a 20 20 20 20 20 20 54 43 4c 5f SPEC}. TCL_
3380: 53 54 55 42 5f 4c 49 42 5f 50 41 54 48 3d 24 7b STUB_LIB_PATH=${
3390: 54 43 4c 5f 42 55 49 4c 44 5f 53 54 55 42 5f 4c TCL_BUILD_STUB_L
33a0: 49 42 5f 50 41 54 48 7d 0a 20 20 20 20 66 69 0a IB_PATH}. fi.
33b0: 20 20 20 20 0a 20 20 20 20 23 0a 20 20 20 20 23 . #. #
33c0: 20 65 76 61 6c 20 69 73 20 72 65 71 75 69 72 65 eval is require
33d0: 64 20 74 6f 20 64 6f 20 74 68 65 20 54 43 4c 5f d to do the TCL_
33e0: 44 42 47 58 20 73 75 62 73 74 69 74 75 74 69 6f DBGX substitutio
33f0: 6e 0a 20 20 20 20 23 0a 20 20 20 20 0a 20 20 20 n. #. .
3400: 20 65 76 61 6c 20 22 54 43 4c 5f 4c 49 42 5f 46 eval "TCL_LIB_F
3410: 49 4c 45 3d 5c 22 24 7b 54 43 4c 5f 4c 49 42 5f ILE=\"${TCL_LIB_
3420: 46 49 4c 45 7d 5c 22 22 0a 20 20 20 20 65 76 61 FILE}\"". eva
3430: 6c 20 22 54 43 4c 5f 4c 49 42 5f 46 4c 41 47 3d l "TCL_LIB_FLAG=
3440: 5c 22 24 7b 54 43 4c 5f 4c 49 42 5f 46 4c 41 47 \"${TCL_LIB_FLAG
3450: 7d 5c 22 22 0a 20 20 20 20 65 76 61 6c 20 22 54 }\"". eval "T
3460: 43 4c 5f 4c 49 42 5f 53 50 45 43 3d 5c 22 24 7b CL_LIB_SPEC=\"${
3470: 54 43 4c 5f 4c 49 42 5f 53 50 45 43 7d 5c 22 22 TCL_LIB_SPEC}\""
3480: 0a 20 20 20 20 0a 20 20 20 20 65 76 61 6c 20 22 . . eval "
3490: 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46 49 4c TCL_STUB_LIB_FIL
34a0: 45 3d 5c 22 24 7b 54 43 4c 5f 53 54 55 42 5f 4c E=\"${TCL_STUB_L
34b0: 49 42 5f 46 49 4c 45 7d 5c 22 22 0a 20 20 20 20 IB_FILE}\"".
34c0: 65 76 61 6c 20 22 54 43 4c 5f 53 54 55 42 5f 4c eval "TCL_STUB_L
34d0: 49 42 5f 46 4c 41 47 3d 5c 22 24 7b 54 43 4c 5f IB_FLAG=\"${TCL_
34e0: 53 54 55 42 5f 4c 49 42 5f 46 4c 41 47 7d 5c 22 STUB_LIB_FLAG}\"
34f0: 22 0a 20 20 20 20 65 76 61 6c 20 22 54 43 4c 5f ". eval "TCL_
3500: 53 54 55 42 5f 4c 49 42 5f 53 50 45 43 3d 5c 22 STUB_LIB_SPEC=\"
3510: 24 7b 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 53 ${TCL_STUB_LIB_S
3520: 50 45 43 7d 5c 22 22 0a 20 20 20 20 0a 20 20 20 PEC}\"". .
3530: 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f 56 45 AC_SUBST(TCL_VE
3540: 52 53 49 4f 4e 29 0a 20 20 20 20 41 43 5f 53 55 RSION). AC_SU
3550: 42 53 54 28 54 43 4c 5f 42 49 4e 5f 44 49 52 29 BST(TCL_BIN_DIR)
3560: 0a 20 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 . AC_SUBST(TC
3570: 4c 5f 53 52 43 5f 44 49 52 29 0a 20 20 20 20 41 L_SRC_DIR). A
3580: 43 5f 53 55 42 53 54 28 54 43 4c 5f 49 4e 43 4c C_SUBST(TCL_INCL
3590: 55 44 45 5f 53 50 45 43 29 0a 20 20 20 20 0a 20 UDE_SPEC). .
35a0: 20 20 20 41 43 5f 53 55 42 53 54 28 54 43 4c 5f AC_SUBST(TCL_
35b0: 4c 49 42 5f 46 49 4c 45 29 0a 20 20 20 20 41 43 LIB_FILE). AC
35c0: 5f 53 55 42 53 54 28 54 43 4c 5f 4c 49 42 5f 46 _SUBST(TCL_LIB_F
35d0: 4c 41 47 29 0a 20 20 20 20 41 43 5f 53 55 42 53 LAG). AC_SUBS
35e0: 54 28 54 43 4c 5f 4c 49 42 5f 53 50 45 43 29 0a T(TCL_LIB_SPEC).
35f0: 20 20 20 20 0a 20 20 20 20 41 43 5f 53 55 42 53 . AC_SUBS
3600: 54 28 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46 T(TCL_STUB_LIB_F
3610: 49 4c 45 29 0a 20 20 20 20 41 43 5f 53 55 42 53 ILE). AC_SUBS
3620: 54 28 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 46 T(TCL_STUB_LIB_F
3630: 4c 41 47 29 0a 20 20 20 20 41 43 5f 53 55 42 53 LAG). AC_SUBS
3640: 54 28 54 43 4c 5f 53 54 55 42 5f 4c 49 42 5f 53 T(TCL_STUB_LIB_S
3650: 50 45 43 29 0a 20 20 20 20 41 43 5f 53 55 42 53 PEC). AC_SUBS
3660: 54 28 54 43 4c 5f 53 48 4c 49 42 5f 53 55 46 46 T(TCL_SHLIB_SUFF
3670: 49 58 29 0a 20 20 66 69 0a 66 69 0a 69 66 20 74 IX). fi.fi.if t
3680: 65 73 74 20 22 24 7b 75 73 65 5f 74 63 6c 7d 22 est "${use_tcl}"
3690: 20 3d 20 22 6e 6f 22 20 3b 20 74 68 65 6e 0a 20 = "no" ; then.
36a0: 20 48 41 56 45 5f 54 43 4c 3d 22 22 0a 65 6c 73 HAVE_TCL="".els
36b0: 65 0a 20 20 48 41 56 45 5f 54 43 4c 3d 31 0a 66 e. HAVE_TCL=1.f
36c0: 69 0a 41 43 5f 53 55 42 53 54 28 48 41 56 45 5f i.AC_SUBST(HAVE_
36d0: 54 43 4c 29 0a 0a 23 23 23 23 23 23 23 23 23 23 TCL)..##########
36e0: 0a 23 20 46 69 67 75 72 65 20 6f 75 74 20 77 68 .# Figure out wh
36f0: 61 74 20 43 20 6c 69 62 72 61 72 69 65 73 20 61 at C libraries a
3700: 72 65 20 72 65 71 75 69 72 65 64 20 74 6f 20 63 re required to c
3710: 6f 6d 70 69 6c 65 20 70 72 6f 67 72 61 6d 73 0a ompile programs.
3720: 23 20 74 68 61 74 20 75 73 65 20 22 72 65 61 64 # that use "read
3730: 6c 69 6e 65 28 29 22 20 6c 69 62 72 61 72 79 2e line()" library.
3740: 0a 23 0a 54 41 52 47 45 54 5f 52 45 41 44 4c 49 .#.TARGET_READLI
3750: 4e 45 5f 4c 49 42 53 3d 22 22 0a 54 41 52 47 45 NE_LIBS="".TARGE
3760: 54 5f 52 45 41 44 4c 49 4e 45 5f 49 4e 43 3d 22 T_READLINE_INC="
3770: 22 0a 54 41 52 47 45 54 5f 48 41 56 45 5f 52 45 ".TARGET_HAVE_RE
3780: 41 44 4c 49 4e 45 3d 30 0a 54 41 52 47 45 54 5f ADLINE=0.TARGET_
3790: 48 41 56 45 5f 45 44 49 54 4c 49 4e 45 3d 30 0a HAVE_EDITLINE=0.
37a0: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 65 AC_ARG_ENABLE([e
37b0: 64 69 74 6c 69 6e 65 5d 2c 0a 09 5b 41 43 5f 48 ditline],..[AC_H
37c0: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e ELP_STRING([--en
37d0: 61 62 6c 65 2d 65 64 69 74 6c 69 6e 65 5d 2c 5b able-editline],[
37e0: 65 6e 61 62 6c 65 20 42 53 44 20 65 64 69 74 6c enable BSD editl
37f0: 69 6e 65 20 73 75 70 70 6f 72 74 5d 29 5d 2c 0a ine support])],.
3800: 09 5b 77 69 74 68 5f 65 64 69 74 6c 69 6e 65 3d .[with_editline=
3810: 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 0a 09 5b 77 $enableval],..[w
3820: 69 74 68 5f 65 64 69 74 6c 69 6e 65 3d 61 75 74 ith_editline=aut
3830: 6f 5d 29 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c o]).AC_ARG_ENABL
3840: 45 28 5b 72 65 61 64 6c 69 6e 65 5d 2c 0a 09 5b E([readline],..[
3850: 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b AC_HELP_STRING([
3860: 2d 2d 64 69 73 61 62 6c 65 2d 72 65 61 64 6c 69 --disable-readli
3870: 6e 65 5d 2c 5b 64 69 73 61 62 6c 65 20 72 65 61 ne],[disable rea
3880: 64 6c 69 6e 65 20 73 75 70 70 6f 72 74 5d 29 5d dline support])]
3890: 2c 0a 09 5b 77 69 74 68 5f 72 65 61 64 6c 69 6e ,..[with_readlin
38a0: 65 3d 24 65 6e 61 62 6c 65 76 61 6c 5d 2c 0a 09 e=$enableval],..
38b0: 5b 77 69 74 68 5f 72 65 61 64 6c 69 6e 65 3d 61 [with_readline=a
38c0: 75 74 6f 5d 29 0a 0a 69 66 20 74 65 73 74 20 78 uto])..if test x
38d0: 22 24 77 69 74 68 5f 65 64 69 74 6c 69 6e 65 22 "$with_editline"
38e0: 20 21 3d 20 78 6e 6f 3b 20 74 68 65 6e 0a 20 20 != xno; then.
38f0: 20 20 20 20 20 20 73 4c 49 42 53 3d 24 4c 49 42 sLIBS=$LIB
3900: 53 0a 20 20 20 20 20 20 20 20 4c 49 42 53 3d 22 S. LIBS="
3910: 22 0a 09 54 41 52 47 45 54 5f 48 41 56 45 5f 45 "..TARGET_HAVE_E
3920: 44 49 54 4c 49 4e 45 3d 31 0a 09 41 43 5f 53 45 DITLINE=1..AC_SE
3930: 41 52 43 48 5f 4c 49 42 53 28 72 65 61 64 6c 69 ARCH_LIBS(readli
3940: 6e 65 2c 65 64 69 74 2c 5b 77 69 74 68 5f 72 65 ne,edit,[with_re
3950: 61 64 6c 69 6e 65 3d 6e 6f 5d 2c 5b 54 41 52 47 adline=no],[TARG
3960: 45 54 5f 48 41 56 45 5f 45 44 49 54 4c 49 4e 45 ET_HAVE_EDITLINE
3970: 3d 30 5d 29 0a 20 20 20 20 20 20 20 20 54 41 52 =0]). TAR
3980: 47 45 54 5f 52 45 41 44 4c 49 4e 45 5f 4c 49 42 GET_READLINE_LIB
3990: 53 3d 24 4c 49 42 53 0a 20 20 20 20 20 20 20 20 S=$LIBS.
39a0: 4c 49 42 53 3d 24 73 4c 49 42 53 0a 66 69 0a 69 LIBS=$sLIBS.fi.i
39b0: 66 20 74 65 73 74 20 78 22 24 77 69 74 68 5f 72 f test x"$with_r
39c0: 65 61 64 6c 69 6e 65 22 20 21 3d 20 78 6e 6f 3b eadline" != xno;
39d0: 20 74 68 65 6e 0a 09 66 6f 75 6e 64 3d 22 79 65 then..found="ye
39e0: 73 22 0a 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 s"...AC_ARG_WITH
39f0: 28 5b 72 65 61 64 6c 69 6e 65 2d 6c 69 62 5d 2c ([readline-lib],
3a00: 0a 09 09 5b 41 43 5f 48 45 4c 50 5f 53 54 52 49 ...[AC_HELP_STRI
3a10: 4e 47 28 5b 2d 2d 77 69 74 68 2d 72 65 61 64 6c NG([--with-readl
3a20: 69 6e 65 2d 6c 69 62 5d 2c 5b 73 70 65 63 69 66 ine-lib],[specif
3a30: 79 20 72 65 61 64 6c 69 6e 65 20 6c 69 62 72 61 y readline libra
3a40: 72 79 5d 29 5d 2c 0a 09 09 5b 77 69 74 68 5f 72 ry])],...[with_r
3a50: 65 61 64 6c 69 6e 65 5f 6c 69 62 3d 24 77 69 74 eadline_lib=$wit
3a60: 68 76 61 6c 5d 2c 0a 09 09 5b 77 69 74 68 5f 72 hval],...[with_r
3a70: 65 61 64 6c 69 6e 65 5f 6c 69 62 3d 22 61 75 74 eadline_lib="aut
3a80: 6f 22 5d 29 0a 09 69 66 20 74 65 73 74 20 22 78 o"])..if test "x
3a90: 24 77 69 74 68 5f 72 65 61 64 6c 69 6e 65 5f 6c $with_readline_l
3aa0: 69 62 22 20 3d 20 78 61 75 74 6f 3b 20 74 68 65 ib" = xauto; the
3ab0: 6e 0a 09 09 73 61 76 65 5f 4c 49 42 53 3d 22 24 n...save_LIBS="$
3ac0: 4c 49 42 53 22 0a 09 09 4c 49 42 53 3d 22 22 0a LIBS"...LIBS="".
3ad0: 09 09 41 43 5f 53 45 41 52 43 48 5f 4c 49 42 53 ..AC_SEARCH_LIBS
3ae0: 28 74 67 65 74 65 6e 74 2c 20 5b 72 65 61 64 6c (tgetent, [readl
3af0: 69 6e 65 20 6e 63 75 72 73 65 73 20 63 75 72 73 ine ncurses curs
3b00: 65 73 20 74 65 72 6d 63 61 70 5d 2c 20 5b 74 65 es termcap], [te
3b10: 72 6d 5f 4c 49 42 53 3d 22 24 4c 49 42 53 22 5d rm_LIBS="$LIBS"]
3b20: 2c 20 5b 74 65 72 6d 5f 4c 49 42 53 3d 22 22 5d , [term_LIBS=""]
3b30: 29 0a 09 09 41 43 5f 43 48 45 43 4b 5f 4c 49 42 )...AC_CHECK_LIB
3b40: 28 5b 72 65 61 64 6c 69 6e 65 5d 2c 20 5b 72 65 ([readline], [re
3b50: 61 64 6c 69 6e 65 5d 2c 20 5b 54 41 52 47 45 54 adline], [TARGET
3b60: 5f 52 45 41 44 4c 49 4e 45 5f 4c 49 42 53 3d 22 _READLINE_LIBS="
3b70: 2d 6c 72 65 61 64 6c 69 6e 65 22 5d 2c 20 5b 66 -lreadline"], [f
3b80: 6f 75 6e 64 3d 22 6e 6f 22 5d 29 0a 09 09 54 41 ound="no"])...TA
3b90: 52 47 45 54 5f 52 45 41 44 4c 49 4e 45 5f 4c 49 RGET_READLINE_LI
3ba0: 42 53 3d 22 24 54 41 52 47 45 54 5f 52 45 41 44 BS="$TARGET_READ
3bb0: 4c 49 4e 45 5f 4c 49 42 53 20 24 74 65 72 6d 5f LINE_LIBS $term_
3bc0: 4c 49 42 53 22 0a 09 09 4c 49 42 53 3d 22 24 73 LIBS"...LIBS="$s
3bd0: 61 76 65 5f 4c 49 42 53 22 0a 09 65 6c 73 65 0a ave_LIBS"..else.
3be0: 09 09 54 41 52 47 45 54 5f 52 45 41 44 4c 49 4e ..TARGET_READLIN
3bf0: 45 5f 4c 49 42 53 3d 22 24 77 69 74 68 5f 72 65 E_LIBS="$with_re
3c00: 61 64 6c 69 6e 65 5f 6c 69 62 22 0a 09 66 69 0a adline_lib"..fi.
3c10: 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 72 ..AC_ARG_WITH([r
3c20: 65 61 64 6c 69 6e 65 2d 69 6e 63 5d 2c 0a 09 09 eadline-inc],...
3c30: 5b 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 [AC_HELP_STRING(
3c40: 5b 2d 2d 77 69 74 68 2d 72 65 61 64 6c 69 6e 65 [--with-readline
3c50: 2d 69 6e 63 5d 2c 5b 73 70 65 63 69 66 79 20 72 -inc],[specify r
3c60: 65 61 64 6c 69 6e 65 20 69 6e 63 6c 75 64 65 20 eadline include
3c70: 70 61 74 68 73 5d 29 5d 2c 0a 09 09 5b 77 69 74 paths])],...[wit
3c80: 68 5f 72 65 61 64 6c 69 6e 65 5f 69 6e 63 3d 24 h_readline_inc=$
3c90: 77 69 74 68 76 61 6c 5d 2c 0a 09 09 5b 77 69 74 withval],...[wit
3ca0: 68 5f 72 65 61 64 6c 69 6e 65 5f 69 6e 63 3d 22 h_readline_inc="
3cb0: 61 75 74 6f 22 5d 29 0a 09 69 66 20 74 65 73 74 auto"])..if test
3cc0: 20 22 78 24 77 69 74 68 5f 72 65 61 64 6c 69 6e "x$with_readlin
3cd0: 65 5f 69 6e 63 22 20 3d 20 78 61 75 74 6f 3b 20 e_inc" = xauto;
3ce0: 74 68 65 6e 0a 09 09 41 43 5f 43 48 45 43 4b 5f then...AC_CHECK_
3cf0: 48 45 41 44 45 52 28 72 65 61 64 6c 69 6e 65 2e HEADER(readline.
3d00: 68 2c 20 5b 66 6f 75 6e 64 3d 22 79 65 73 22 5d h, [found="yes"]
3d10: 2c 20 5b 0a 09 09 09 66 6f 75 6e 64 3d 22 6e 6f , [....found="no
3d20: 22 0a 09 09 09 69 66 20 74 65 73 74 20 22 24 63 "....if test "$c
3d30: 72 6f 73 73 5f 63 6f 6d 70 69 6c 69 6e 67 22 20 ross_compiling"
3d40: 21 3d 20 79 65 73 3b 20 74 68 65 6e 0a 09 09 09 != yes; then....
3d50: 09 66 6f 72 20 64 69 72 20 69 6e 20 2f 75 73 72 .for dir in /usr
3d60: 20 2f 75 73 72 2f 6c 6f 63 61 6c 20 2f 75 73 72 /usr/local /usr
3d70: 2f 6c 6f 63 61 6c 2f 72 65 61 64 6c 69 6e 65 20 /local/readline
3d80: 2f 75 73 72 2f 63 6f 6e 74 72 69 62 20 2f 6d 69 /usr/contrib /mi
3d90: 6e 67 77 3b 20 64 6f 0a 09 09 09 09 09 66 6f 72 ngw; do......for
3da0: 20 73 75 62 64 69 72 20 69 6e 20 69 6e 63 6c 75 subdir in inclu
3db0: 64 65 20 69 6e 63 6c 75 64 65 2f 72 65 61 64 6c de include/readl
3dc0: 69 6e 65 3b 20 64 6f 0a 09 09 09 09 09 09 41 43 ine; do.......AC
3dd0: 5f 43 48 45 43 4b 5f 46 49 4c 45 28 24 64 69 72 _CHECK_FILE($dir
3de0: 2f 24 73 75 62 64 69 72 2f 72 65 61 64 6c 69 6e /$subdir/readlin
3df0: 65 2e 68 2c 20 66 6f 75 6e 64 3d 79 65 73 29 0a e.h, found=yes).
3e00: 09 09 09 09 09 09 69 66 20 74 65 73 74 20 22 24 ......if test "$
3e10: 66 6f 75 6e 64 22 20 3d 20 22 79 65 73 22 3b 20 found" = "yes";
3e20: 74 68 65 6e 0a 09 09 09 09 09 09 09 54 41 52 47 then........TARG
3e30: 45 54 5f 52 45 41 44 4c 49 4e 45 5f 49 4e 43 3d ET_READLINE_INC=
3e40: 22 2d 49 24 64 69 72 2f 24 73 75 62 64 69 72 22 "-I$dir/$subdir"
3e50: 0a 09 09 09 09 09 09 09 62 72 65 61 6b 0a 09 09 ........break...
3e60: 09 09 09 09 66 69 0a 09 09 09 09 09 64 6f 6e 65 ....fi......done
3e70: 0a 09 09 09 09 09 74 65 73 74 20 22 24 66 6f 75 ......test "$fou
3e80: 6e 64 22 20 3d 20 22 79 65 73 22 20 26 26 20 62 nd" = "yes" && b
3e90: 72 65 61 6b 0a 09 09 09 09 64 6f 6e 65 0a 09 09 reak.....done...
3ea0: 09 66 69 0a 09 09 5d 29 0a 09 65 6c 73 65 0a 09 .fi...])..else..
3eb0: 09 54 41 52 47 45 54 5f 52 45 41 44 4c 49 4e 45 .TARGET_READLINE
3ec0: 5f 49 4e 43 3d 22 24 77 69 74 68 5f 72 65 61 64 _INC="$with_read
3ed0: 6c 69 6e 65 5f 69 6e 63 22 0a 09 66 69 0a 0a 09 line_inc"..fi...
3ee0: 69 66 20 74 65 73 74 20 78 22 24 66 6f 75 6e 64 if test x"$found
3ef0: 22 20 3d 20 78 6e 6f 3b 20 74 68 65 6e 0a 09 09 " = xno; then...
3f00: 54 41 52 47 45 54 5f 52 45 41 44 4c 49 4e 45 5f TARGET_READLINE_
3f10: 4c 49 42 53 3d 22 22 0a 09 09 54 41 52 47 45 54 LIBS=""...TARGET
3f20: 5f 52 45 41 44 4c 49 4e 45 5f 49 4e 43 3d 22 22 _READLINE_INC=""
3f30: 0a 09 09 54 41 52 47 45 54 5f 48 41 56 45 5f 52 ...TARGET_HAVE_R
3f40: 45 41 44 4c 49 4e 45 3d 30 0a 09 65 6c 73 65 0a EADLINE=0..else.
3f50: 09 09 54 41 52 47 45 54 5f 48 41 56 45 5f 52 45 ..TARGET_HAVE_RE
3f60: 41 44 4c 49 4e 45 3d 31 0a 09 66 69 0a 66 69 0a ADLINE=1..fi.fi.
3f70: 0a 41 43 5f 53 55 42 53 54 28 54 41 52 47 45 54 .AC_SUBST(TARGET
3f80: 5f 52 45 41 44 4c 49 4e 45 5f 4c 49 42 53 29 0a _READLINE_LIBS).
3f90: 41 43 5f 53 55 42 53 54 28 54 41 52 47 45 54 5f AC_SUBST(TARGET_
3fa0: 52 45 41 44 4c 49 4e 45 5f 49 4e 43 29 0a 41 43 READLINE_INC).AC
3fb0: 5f 53 55 42 53 54 28 54 41 52 47 45 54 5f 48 41 _SUBST(TARGET_HA
3fc0: 56 45 5f 52 45 41 44 4c 49 4e 45 29 0a 41 43 5f VE_READLINE).AC_
3fd0: 53 55 42 53 54 28 54 41 52 47 45 54 5f 48 41 56 SUBST(TARGET_HAV
3fe0: 45 5f 45 44 49 54 4c 49 4e 45 29 0a 0a 23 23 23 E_EDITLINE)..###
3ff0: 23 23 23 23 23 23 23 0a 23 20 46 69 67 75 72 65 #######.# Figure
4000: 20 6f 75 74 20 77 68 61 74 20 43 20 6c 69 62 72 out what C libr
4010: 61 72 69 65 73 20 61 72 65 20 72 65 71 75 69 72 aries are requir
4020: 65 64 20 74 6f 20 63 6f 6d 70 69 6c 65 20 70 72 ed to compile pr
4030: 6f 67 72 61 6d 73 0a 23 20 74 68 61 74 20 75 73 ograms.# that us
4040: 65 20 22 66 64 61 74 61 73 79 6e 63 28 29 22 20 e "fdatasync()"
4050: 66 75 6e 63 74 69 6f 6e 2e 0a 23 0a 41 43 5f 53 function..#.AC_S
4060: 45 41 52 43 48 5f 4c 49 42 53 28 66 64 61 74 61 EARCH_LIBS(fdata
4070: 73 79 6e 63 2c 20 5b 72 74 5d 29 0a 0a 23 23 23 sync, [rt])..###
4080: 23 23 23 23 23 23 0a 23 20 63 68 65 63 6b 20 66 ######.# check f
4090: 6f 72 20 64 65 62 75 67 20 65 6e 61 62 6c 65 64 or debug enabled
40a0: 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 64 .AC_ARG_ENABLE(d
40b0: 65 62 75 67 2c 20 41 43 5f 48 45 4c 50 5f 53 54 ebug, AC_HELP_ST
40c0: 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 64 RING([--enable-d
40d0: 65 62 75 67 5d 2c 5b 65 6e 61 62 6c 65 20 64 65 ebug],[enable de
40e0: 62 75 67 67 69 6e 67 20 26 20 76 65 72 62 6f 73 bugging & verbos
40f0: 65 20 65 78 70 6c 61 69 6e 5d 29 29 0a 69 66 20 e explain])).if
4100: 74 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 5f 64 test "${enable_d
4110: 65 62 75 67 7d 22 20 3d 20 22 79 65 73 22 20 3b ebug}" = "yes" ;
4120: 20 74 68 65 6e 0a 20 20 54 41 52 47 45 54 5f 44 then. TARGET_D
4130: 45 42 55 47 3d 22 2d 44 53 51 4c 49 54 45 5f 44 EBUG="-DSQLITE_D
4140: 45 42 55 47 3d 31 20 2d 44 53 51 4c 49 54 45 5f EBUG=1 -DSQLITE_
4150: 45 4e 41 42 4c 45 5f 53 45 4c 45 43 54 54 52 41 ENABLE_SELECTTRA
4160: 43 45 20 2d 44 53 51 4c 49 54 45 5f 45 4e 41 42 CE -DSQLITE_ENAB
4170: 4c 45 5f 57 48 45 52 45 54 52 41 43 45 20 2d 4f LE_WHERETRACE -O
4180: 30 22 0a 65 6c 73 65 0a 20 20 54 41 52 47 45 54 0".else. TARGET
4190: 5f 44 45 42 55 47 3d 22 2d 44 4e 44 45 42 55 47 _DEBUG="-DNDEBUG
41a0: 22 0a 66 69 0a 41 43 5f 53 55 42 53 54 28 54 41 ".fi.AC_SUBST(TA
41b0: 52 47 45 54 5f 44 45 42 55 47 29 0a 0a 23 23 23 RGET_DEBUG)..###
41c0: 23 23 23 23 23 23 0a 23 20 53 65 65 20 77 68 65 ######.# See whe
41d0: 74 68 65 72 20 77 65 20 73 68 6f 75 6c 64 20 75 ther we should u
41e0: 73 65 20 74 68 65 20 61 6d 61 6c 67 61 6d 61 74 se the amalgamat
41f0: 69 6f 6e 20 74 6f 20 62 75 69 6c 64 0a 41 43 5f ion to build.AC_
4200: 41 52 47 5f 45 4e 41 42 4c 45 28 61 6d 61 6c 67 ARG_ENABLE(amalg
4210: 61 6d 61 74 69 6f 6e 2c 20 41 43 5f 48 45 4c 50 amation, AC_HELP
4220: 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 62 _STRING([--disab
4230: 6c 65 2d 61 6d 61 6c 67 61 6d 61 74 69 6f 6e 5d le-amalgamation]
4240: 2c 0a 20 20 20 20 20 20 5b 44 69 73 61 62 6c 65 ,. [Disable
4250: 20 74 68 65 20 61 6d 61 6c 67 61 6d 61 74 69 6f the amalgamatio
4260: 6e 20 61 6e 64 20 69 6e 73 74 65 61 64 20 62 75 n and instead bu
4270: 69 6c 64 20 61 6c 6c 20 66 69 6c 65 73 20 73 65 ild all files se
4280: 70 61 72 61 74 65 6c 79 5d 29 29 0a 69 66 20 74 parately])).if t
4290: 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 5f 61 6d est "${enable_am
42a0: 61 6c 67 61 6d 61 74 69 6f 6e 7d 22 20 3d 3d 20 algamation}" ==
42b0: 22 6e 6f 22 20 3b 20 74 68 65 6e 0a 20 20 55 53 "no" ; then. US
42c0: 45 5f 41 4d 41 4c 47 41 4d 41 54 49 4f 4e 3d 30 E_AMALGAMATION=0
42d0: 0a 66 69 0a 41 43 5f 53 55 42 53 54 28 55 53 45 .fi.AC_SUBST(USE
42e0: 5f 41 4d 41 4c 47 41 4d 41 54 49 4f 4e 29 0a 0a _AMALGAMATION)..
42f0: 23 23 23 23 23 23 23 23 23 0a 23 20 4c 6f 6f 6b #########.# Look
4300: 20 66 6f 72 20 7a 6c 69 62 2e 20 20 4f 6e 6c 79 for zlib. Only
4310: 20 6e 65 65 64 65 64 20 62 79 20 65 78 74 65 6e needed by exten
4320: 73 69 6f 6e 73 20 61 6e 64 20 62 79 20 74 68 65 sions and by the
4330: 20 73 71 6c 69 74 65 33 2e 65 78 65 20 73 68 65 sqlite3.exe she
4340: 6c 6c 0a 41 43 5f 43 48 45 43 4b 5f 48 45 41 44 ll.AC_CHECK_HEAD
4350: 45 52 53 28 7a 6c 69 62 2e 68 29 0a 41 43 5f 53 ERS(zlib.h).AC_S
4360: 45 41 52 43 48 5f 4c 49 42 53 28 64 65 66 6c 61 EARCH_LIBS(defla
4370: 74 65 2c 20 7a 2c 20 5b 48 41 56 45 5f 5a 4c 49 te, z, [HAVE_ZLI
4380: 42 3d 22 2d 44 53 51 4c 49 54 45 5f 48 41 56 45 B="-DSQLITE_HAVE
4390: 5f 5a 4c 49 42 3d 31 22 5d 2c 20 5b 48 41 56 45 _ZLIB=1"], [HAVE
43a0: 5f 5a 4c 49 42 3d 22 22 5d 29 0a 41 43 5f 53 55 _ZLIB=""]).AC_SU
43b0: 42 53 54 28 48 41 56 45 5f 5a 4c 49 42 29 0a 0a BST(HAVE_ZLIB)..
43c0: 23 23 23 23 23 23 23 23 23 0a 23 20 53 65 65 20 #########.# See
43d0: 77 68 65 74 68 65 72 20 77 65 20 73 68 6f 75 6c whether we shoul
43e0: 64 20 61 6c 6c 6f 77 20 6c 6f 61 64 61 62 6c 65 d allow loadable
43f0: 20 65 78 74 65 6e 73 69 6f 6e 73 0a 41 43 5f 41 extensions.AC_A
4400: 52 47 5f 45 4e 41 42 4c 45 28 6c 6f 61 64 2d 65 RG_ENABLE(load-e
4410: 78 74 65 6e 73 69 6f 6e 2c 20 41 43 5f 48 45 4c xtension, AC_HEL
4420: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 P_STRING([--disa
4430: 62 6c 65 2d 6c 6f 61 64 2d 65 78 74 65 6e 73 69 ble-load-extensi
4440: 6f 6e 5d 2c 0a 20 20 20 20 20 20 5b 44 69 73 61 on],. [Disa
4450: 62 6c 65 20 6c 6f 61 64 69 6e 67 20 6f 66 20 65 ble loading of e
4460: 78 74 65 72 6e 61 6c 20 65 78 74 65 6e 73 69 6f xternal extensio
4470: 6e 73 5d 29 2c 2c 5b 65 6e 61 62 6c 65 5f 6c 6f ns]),,[enable_lo
4480: 61 64 5f 65 78 74 65 6e 73 69 6f 6e 3d 79 65 73 ad_extension=yes
4490: 5d 29 0a 69 66 20 74 65 73 74 20 22 24 7b 65 6e ]).if test "${en
44a0: 61 62 6c 65 5f 6c 6f 61 64 5f 65 78 74 65 6e 73 able_load_extens
44b0: 69 6f 6e 7d 22 20 3d 20 22 79 65 73 22 20 3b 20 ion}" = "yes" ;
44c0: 74 68 65 6e 0a 20 20 4f 50 54 5f 46 45 41 54 55 then. OPT_FEATU
44d0: 52 45 5f 46 4c 41 47 53 3d 22 22 0a 20 20 41 43 RE_FLAGS="". AC
44e0: 5f 53 45 41 52 43 48 5f 4c 49 42 53 28 64 6c 6f _SEARCH_LIBS(dlo
44f0: 70 65 6e 2c 20 64 6c 29 0a 65 6c 73 65 0a 20 20 pen, dl).else.
4500: 4f 50 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 47 OPT_FEATURE_FLAG
4510: 53 3d 22 2d 44 53 51 4c 49 54 45 5f 4f 4d 49 54 S="-DSQLITE_OMIT
4520: 5f 4c 4f 41 44 5f 45 58 54 45 4e 53 49 4f 4e 3d _LOAD_EXTENSION=
4530: 31 22 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 23 1".fi..#########
4540: 23 0a 23 20 44 6f 20 77 65 20 77 61 6e 74 20 74 #.# Do we want t
4550: 6f 20 73 75 70 70 6f 72 74 20 6d 65 6d 73 79 73 o support memsys
4560: 33 20 61 6e 64 2f 6f 72 20 6d 65 6d 73 79 73 35 3 and/or memsys5
4570: 0a 23 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 .#.AC_ARG_ENABLE
4580: 28 6d 65 6d 73 79 73 35 2c 20 0a 20 20 41 43 5f (memsys5, . AC_
4590: 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 HELP_STRING([--e
45a0: 6e 61 62 6c 65 2d 6d 65 6d 73 79 73 35 5d 2c 5b nable-memsys5],[
45b0: 45 6e 61 62 6c 65 20 4d 45 4d 53 59 53 35 5d 29 Enable MEMSYS5])
45c0: 29 0a 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e ).AC_MSG_CHECKIN
45d0: 47 28 5b 77 68 65 74 68 65 72 20 74 6f 20 73 75 G([whether to su
45e0: 70 70 6f 72 74 20 4d 45 4d 53 59 53 35 5d 29 0a pport MEMSYS5]).
45f0: 69 66 20 74 65 73 74 20 22 24 7b 65 6e 61 62 6c if test "${enabl
4600: 65 5f 6d 65 6d 73 79 73 35 7d 22 20 3d 20 22 79 e_memsys5}" = "y
4610: 65 73 22 3b 20 74 68 65 6e 0a 20 20 4f 50 54 5f es"; then. OPT_
4620: 46 45 41 54 55 52 45 5f 46 4c 41 47 53 3d 22 24 FEATURE_FLAGS="$
4630: 7b 4f 50 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 {OPT_FEATURE_FLA
4640: 47 53 7d 20 2d 44 53 51 4c 49 54 45 5f 45 4e 41 GS} -DSQLITE_ENA
4650: 42 4c 45 5f 4d 45 4d 53 59 53 35 22 0a 20 20 41 BLE_MEMSYS5". A
4660: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 C_MSG_RESULT([ye
4670: 73 5d 29 0a 65 6c 73 65 0a 20 20 41 43 5f 4d 53 s]).else. AC_MS
4680: 47 5f 52 45 53 55 4c 54 28 5b 6e 6f 5d 29 0a 66 G_RESULT([no]).f
4690: 69 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 i.AC_ARG_ENABLE(
46a0: 6d 65 6d 73 79 73 33 2c 20 0a 20 20 41 43 5f 48 memsys3, . AC_H
46b0: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e ELP_STRING([--en
46c0: 61 62 6c 65 2d 6d 65 6d 73 79 73 33 5d 2c 5b 45 able-memsys3],[E
46d0: 6e 61 62 6c 65 20 4d 45 4d 53 59 53 33 5d 29 29 nable MEMSYS3]))
46e0: 0a 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 .AC_MSG_CHECKING
46f0: 28 5b 77 68 65 74 68 65 72 20 74 6f 20 73 75 70 ([whether to sup
4700: 70 6f 72 74 20 4d 45 4d 53 59 53 33 5d 29 0a 69 port MEMSYS3]).i
4710: 66 20 74 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 f test "${enable
4720: 5f 6d 65 6d 73 79 73 33 7d 22 20 3d 20 22 79 65 _memsys3}" = "ye
4730: 73 22 20 2d 61 20 22 24 7b 65 6e 61 62 6c 65 5f s" -a "${enable_
4740: 6d 65 6d 73 79 73 35 7d 22 20 3d 20 22 6e 6f 22 memsys5}" = "no"
4750: 3b 20 74 68 65 6e 0a 20 20 4f 50 54 5f 46 45 41 ; then. OPT_FEA
4760: 54 55 52 45 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 TURE_FLAGS="${OP
4770: 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 47 53 7d T_FEATURE_FLAGS}
4780: 20 2d 44 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 -DSQLITE_ENABLE
4790: 5f 4d 45 4d 53 59 53 33 22 0a 20 20 41 43 5f 4d _MEMSYS3". AC_M
47a0: 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 SG_RESULT([yes])
47b0: 0a 65 6c 73 65 0a 20 20 41 43 5f 4d 53 47 5f 52 .else. AC_MSG_R
47c0: 45 53 55 4c 54 28 5b 6e 6f 5d 29 0a 66 69 0a 0a ESULT([no]).fi..
47d0: 23 23 23 23 23 23 23 23 23 0a 23 20 53 65 65 20 #########.# See
47e0: 77 68 65 74 68 65 72 20 77 65 20 73 68 6f 75 6c whether we shoul
47f0: 64 20 65 6e 61 62 6c 65 20 46 75 6c 6c 20 54 65 d enable Full Te
4800: 78 74 20 53 65 61 72 63 68 20 65 78 74 65 6e 73 xt Search extens
4810: 69 6f 6e 73 0a 41 43 5f 41 52 47 5f 45 4e 41 42 ions.AC_ARG_ENAB
4820: 4c 45 28 66 74 73 33 2c 20 41 43 5f 48 45 4c 50 LE(fts3, AC_HELP
4830: 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c _STRING([--enabl
4840: 65 2d 66 74 73 33 5d 2c 0a 20 20 20 20 20 20 5b e-fts3],. [
4850: 45 6e 61 62 6c 65 20 74 68 65 20 46 54 53 33 20 Enable the FTS3
4860: 65 78 74 65 6e 73 69 6f 6e 5d 29 29 0a 69 66 20 extension])).if
4870: 74 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 5f 66 test "${enable_f
4880: 74 73 33 7d 22 20 3d 20 22 79 65 73 22 20 3b 20 ts3}" = "yes" ;
4890: 74 68 65 6e 0a 20 20 4f 50 54 5f 46 45 41 54 55 then. OPT_FEATU
48a0: 52 45 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 54 5f RE_FLAGS="${OPT_
48b0: 46 45 41 54 55 52 45 5f 46 4c 41 47 53 7d 20 2d FEATURE_FLAGS} -
48c0: 44 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 5f 46 DSQLITE_ENABLE_F
48d0: 54 53 33 22 0a 66 69 0a 41 43 5f 41 52 47 5f 45 TS3".fi.AC_ARG_E
48e0: 4e 41 42 4c 45 28 66 74 73 34 2c 20 41 43 5f 48 NABLE(fts4, AC_H
48f0: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e ELP_STRING([--en
4900: 61 62 6c 65 2d 66 74 73 34 5d 2c 0a 20 20 20 20 able-fts4],.
4910: 20 20 5b 45 6e 61 62 6c 65 20 74 68 65 20 46 54 [Enable the FT
4920: 53 34 20 65 78 74 65 6e 73 69 6f 6e 5d 29 29 0a S4 extension])).
4930: 69 66 20 74 65 73 74 20 22 24 7b 65 6e 61 62 6c if test "${enabl
4940: 65 5f 66 74 73 34 7d 22 20 3d 20 22 79 65 73 22 e_fts4}" = "yes"
4950: 20 3b 20 74 68 65 6e 0a 20 20 4f 50 54 5f 46 45 ; then. OPT_FE
4960: 41 54 55 52 45 5f 46 4c 41 47 53 3d 22 24 7b 4f ATURE_FLAGS="${O
4970: 50 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 47 53 PT_FEATURE_FLAGS
4980: 7d 20 2d 44 53 51 4c 49 54 45 5f 45 4e 41 42 4c } -DSQLITE_ENABL
4990: 45 5f 46 54 53 34 22 0a 20 20 41 43 5f 53 45 41 E_FTS4". AC_SEA
49a0: 52 43 48 5f 4c 49 42 53 28 5b 6c 6f 67 5d 2c 5b RCH_LIBS([log],[
49b0: 6d 5d 29 0a 66 69 0a 41 43 5f 41 52 47 5f 45 4e m]).fi.AC_ARG_EN
49c0: 41 42 4c 45 28 66 74 73 35 2c 20 41 43 5f 48 45 ABLE(fts5, AC_HE
49d0: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 LP_STRING([--ena
49e0: 62 6c 65 2d 66 74 73 35 5d 2c 0a 20 20 20 20 20 ble-fts5],.
49f0: 20 5b 45 6e 61 62 6c 65 20 74 68 65 20 46 54 53 [Enable the FTS
4a00: 35 20 65 78 74 65 6e 73 69 6f 6e 5d 29 29 0a 69 5 extension])).i
4a10: 66 20 74 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 f test "${enable
4a20: 5f 66 74 73 35 7d 22 20 3d 20 22 79 65 73 22 20 _fts5}" = "yes"
4a30: 3b 20 74 68 65 6e 0a 20 20 4f 50 54 5f 46 45 41 ; then. OPT_FEA
4a40: 54 55 52 45 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 TURE_FLAGS="${OP
4a50: 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 47 53 7d T_FEATURE_FLAGS}
4a60: 20 2d 44 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 -DSQLITE_ENABLE
4a70: 5f 46 54 53 35 22 0a 20 20 41 43 5f 53 45 41 52 _FTS5". AC_SEAR
4a80: 43 48 5f 4c 49 42 53 28 5b 6c 6f 67 5d 2c 5b 6d CH_LIBS([log],[m
4a90: 5d 29 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 23 ]).fi..#########
4aa0: 0a 23 20 53 65 65 20 77 68 65 74 68 65 72 20 77 .# See whether w
4ab0: 65 20 73 68 6f 75 6c 64 20 65 6e 61 62 6c 65 20 e should enable
4ac0: 4a 53 4f 4e 31 0a 41 43 5f 41 52 47 5f 45 4e 41 JSON1.AC_ARG_ENA
4ad0: 42 4c 45 28 6a 73 6f 6e 31 2c 20 41 43 5f 48 45 BLE(json1, AC_HE
4ae0: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 LP_STRING([--ena
4af0: 62 6c 65 2d 6a 73 6f 6e 31 5d 2c 5b 45 6e 61 62 ble-json1],[Enab
4b00: 6c 65 20 74 68 65 20 4a 53 4f 4e 31 20 65 78 74 le the JSON1 ext
4b10: 65 6e 73 69 6f 6e 5d 29 29 0a 69 66 20 74 65 73 ension])).if tes
4b20: 74 20 22 24 7b 65 6e 61 62 6c 65 5f 6a 73 6f 6e t "${enable_json
4b30: 31 7d 22 20 3d 20 22 79 65 73 22 20 3b 20 74 68 1}" = "yes" ; th
4b40: 65 6e 0a 20 20 4f 50 54 5f 46 45 41 54 55 52 45 en. OPT_FEATURE
4b50: 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 54 5f 46 45 _FLAGS="${OPT_FE
4b60: 41 54 55 52 45 5f 46 4c 41 47 53 7d 20 2d 44 53 ATURE_FLAGS} -DS
4b70: 51 4c 49 54 45 5f 45 4e 41 42 4c 45 5f 4a 53 4f QLITE_ENABLE_JSO
4b80: 4e 31 22 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 N1".fi..########
4b90: 23 0a 23 20 53 65 65 20 77 68 65 74 68 65 72 20 #.# See whether
4ba0: 77 65 20 73 68 6f 75 6c 64 20 65 6e 61 62 6c 65 we should enable
4bb0: 20 74 68 65 20 4c 49 4d 49 54 20 63 6c 61 75 73 the LIMIT claus
4bc0: 65 20 6f 6e 20 55 50 44 41 54 45 20 61 6e 64 20 e on UPDATE and
4bd0: 44 45 4c 45 54 45 0a 23 20 73 74 61 74 65 6d 65 DELETE.# stateme
4be0: 6e 74 73 2e 0a 41 43 5f 41 52 47 5f 45 4e 41 42 nts..AC_ARG_ENAB
4bf0: 4c 45 28 75 70 64 61 74 65 2d 6c 69 6d 69 74 2c LE(update-limit,
4c00: 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 AC_HELP_STRING(
4c10: 5b 2d 2d 65 6e 61 62 6c 65 2d 75 70 64 61 74 65 [--enable-update
4c20: 2d 6c 69 6d 69 74 5d 2c 0a 20 20 20 20 20 20 5b -limit],. [
4c30: 45 6e 61 62 6c 65 20 74 68 65 20 55 50 44 41 54 Enable the UPDAT
4c40: 45 2f 44 45 4c 45 54 45 20 4c 49 4d 49 54 20 63 E/DELETE LIMIT c
4c50: 6c 61 75 73 65 5d 29 29 0a 69 66 20 74 65 73 74 lause])).if test
4c60: 20 22 24 7b 65 6e 61 62 6c 65 5f 75 64 6c 69 6d "${enable_udlim
4c70: 69 74 7d 22 20 3d 20 22 79 65 73 22 20 3b 20 74 it}" = "yes" ; t
4c80: 68 65 6e 0a 20 20 4f 50 54 5f 46 45 41 54 55 52 hen. OPT_FEATUR
4c90: 45 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 54 5f 46 E_FLAGS="${OPT_F
4ca0: 45 41 54 55 52 45 5f 46 4c 41 47 53 7d 20 2d 44 EATURE_FLAGS} -D
4cb0: 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 5f 55 50 SQLITE_ENABLE_UP
4cc0: 44 41 54 45 5f 44 45 4c 45 54 45 5f 4c 49 4d 49 DATE_DELETE_LIMI
4cd0: 54 22 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 23 T".fi..#########
4ce0: 0a 23 20 53 65 65 20 77 68 65 74 68 65 72 20 77 .# See whether w
4cf0: 65 20 73 68 6f 75 6c 64 20 65 6e 61 62 6c 65 20 e should enable
4d00: 47 45 4f 50 4f 4c 59 0a 41 43 5f 41 52 47 5f 45 GEOPOLY.AC_ARG_E
4d10: 4e 41 42 4c 45 28 67 65 6f 70 6f 6c 79 2c 20 41 NABLE(geopoly, A
4d20: 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d C_HELP_STRING([-
4d30: 2d 65 6e 61 62 6c 65 2d 67 65 6f 70 6f 6c 79 5d -enable-geopoly]
4d40: 2c 0a 20 20 20 20 20 20 5b 45 6e 61 62 6c 65 20 ,. [Enable
4d50: 74 68 65 20 47 45 4f 50 4f 4c 59 20 65 78 74 65 the GEOPOLY exte
4d60: 6e 73 69 6f 6e 5d 29 2c 0a 20 20 20 20 20 20 5b nsion]),. [
4d70: 65 6e 61 62 6c 65 5f 67 65 6f 70 6f 6c 79 3d 79 enable_geopoly=y
4d80: 65 73 5d 2c 5b 65 6e 61 62 6c 65 5f 67 65 6f 70 es],[enable_geop
4d90: 6f 6c 79 3d 6e 6f 5d 29 0a 69 66 20 74 65 73 74 oly=no]).if test
4da0: 20 22 24 7b 65 6e 61 62 6c 65 5f 67 65 6f 70 6f "${enable_geopo
4db0: 6c 79 7d 22 20 3d 20 22 79 65 73 22 20 3b 20 74 ly}" = "yes" ; t
4dc0: 68 65 6e 0a 20 20 4f 50 54 5f 46 45 41 54 55 52 hen. OPT_FEATUR
4dd0: 45 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 54 5f 46 E_FLAGS="${OPT_F
4de0: 45 41 54 55 52 45 5f 46 4c 41 47 53 7d 20 2d 44 EATURE_FLAGS} -D
4df0: 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 5f 47 45 SQLITE_ENABLE_GE
4e00: 4f 50 4f 4c 59 22 0a 20 20 65 6e 61 62 6c 65 5f OPOLY". enable_
4e10: 72 74 72 65 65 3d 79 65 73 0a 66 69 0a 0a 23 23 rtree=yes.fi..##
4e20: 23 23 23 23 23 23 23 0a 23 20 53 65 65 20 77 68 #######.# See wh
4e30: 65 74 68 65 72 20 77 65 20 73 68 6f 75 6c 64 20 ether we should
4e40: 65 6e 61 62 6c 65 20 52 54 52 45 45 0a 41 43 5f enable RTREE.AC_
4e50: 41 52 47 5f 45 4e 41 42 4c 45 28 72 74 72 65 65 ARG_ENABLE(rtree
4e60: 2c 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 4e 47 , AC_HELP_STRING
4e70: 28 5b 2d 2d 65 6e 61 62 6c 65 2d 72 74 72 65 65 ([--enable-rtree
4e80: 5d 2c 0a 20 20 20 20 20 20 5b 45 6e 61 62 6c 65 ],. [Enable
4e90: 20 74 68 65 20 52 54 52 45 45 20 65 78 74 65 6e the RTREE exten
4ea0: 73 69 6f 6e 5d 29 29 0a 69 66 20 74 65 73 74 20 sion])).if test
4eb0: 22 24 7b 65 6e 61 62 6c 65 5f 72 74 72 65 65 7d "${enable_rtree}
4ec0: 22 20 3d 20 22 79 65 73 22 20 3b 20 74 68 65 6e " = "yes" ; then
4ed0: 0a 20 20 4f 50 54 5f 46 45 41 54 55 52 45 5f 46 . OPT_FEATURE_F
4ee0: 4c 41 47 53 3d 22 24 7b 4f 50 54 5f 46 45 41 54 LAGS="${OPT_FEAT
4ef0: 55 52 45 5f 46 4c 41 47 53 7d 20 2d 44 53 51 4c URE_FLAGS} -DSQL
4f00: 49 54 45 5f 45 4e 41 42 4c 45 5f 52 54 52 45 45 ITE_ENABLE_RTREE
4f10: 22 0a 66 69 0a 0a 23 23 23 23 23 23 23 23 23 0a ".fi..#########.
4f20: 23 20 53 65 65 20 77 68 65 74 68 65 72 20 77 65 # See whether we
4f30: 20 73 68 6f 75 6c 64 20 65 6e 61 62 6c 65 20 74 should enable t
4f40: 68 65 20 53 45 53 53 49 4f 4e 20 65 78 74 65 6e he SESSION exten
4f50: 73 69 6f 6e 0a 41 43 5f 41 52 47 5f 45 4e 41 42 sion.AC_ARG_ENAB
4f60: 4c 45 28 73 65 73 73 69 6f 6e 2c 20 41 43 5f 48 LE(session, AC_H
4f70: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e ELP_STRING([--en
4f80: 61 62 6c 65 2d 73 65 73 73 69 6f 6e 5d 2c 0a 20 able-session],.
4f90: 20 20 20 20 20 5b 45 6e 61 62 6c 65 20 74 68 65 [Enable the
4fa0: 20 53 45 53 53 49 4f 4e 20 65 78 74 65 6e 73 69 SESSION extensi
4fb0: 6f 6e 5d 29 29 0a 69 66 20 74 65 73 74 20 22 24 on])).if test "$
4fc0: 7b 65 6e 61 62 6c 65 5f 73 65 73 73 69 6f 6e 7d {enable_session}
4fd0: 22 20 3d 20 22 79 65 73 22 20 3b 20 74 68 65 6e " = "yes" ; then
4fe0: 0a 20 20 4f 50 54 5f 46 45 41 54 55 52 45 5f 46 . OPT_FEATURE_F
4ff0: 4c 41 47 53 3d 22 24 7b 4f 50 54 5f 46 45 41 54 LAGS="${OPT_FEAT
5000: 55 52 45 5f 46 4c 41 47 53 7d 20 2d 44 53 51 4c URE_FLAGS} -DSQL
5010: 49 54 45 5f 45 4e 41 42 4c 45 5f 53 45 53 53 49 ITE_ENABLE_SESSI
5020: 4f 4e 22 0a 20 20 4f 50 54 5f 46 45 41 54 55 52 ON". OPT_FEATUR
5030: 45 5f 46 4c 41 47 53 3d 22 24 7b 4f 50 54 5f 46 E_FLAGS="${OPT_F
5040: 45 41 54 55 52 45 5f 46 4c 41 47 53 7d 20 2d 44 EATURE_FLAGS} -D
5050: 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 5f 50 52 SQLITE_ENABLE_PR
5060: 45 55 50 44 41 54 45 5f 48 4f 4f 4b 22 0a 66 69 EUPDATE_HOOK".fi
5070: 0a 0a 23 23 23 23 23 23 23 23 23 0a 23 20 61 74 ..#########.# at
5080: 74 65 6d 70 74 20 74 6f 20 64 75 70 6c 69 63 61 tempt to duplica
5090: 74 65 20 61 6e 79 20 4f 4d 49 54 53 20 61 6e 64 te any OMITS and
50a0: 20 45 4e 41 42 4c 45 53 20 69 6e 74 6f 20 74 68 ENABLES into th
50b0: 65 20 24 7b 4f 50 54 5f 46 45 41 54 55 52 45 5f e ${OPT_FEATURE_
50c0: 46 4c 41 47 53 7d 20 70 61 72 61 6d 65 74 65 72 FLAGS} parameter
50d0: 0a 66 6f 72 20 6f 70 74 69 6f 6e 20 69 6e 20 24 .for option in $
50e0: 43 46 4c 41 47 53 20 24 43 50 50 46 4c 41 47 53 CFLAGS $CPPFLAGS
50f0: 0a 64 6f 0a 20 20 63 61 73 65 20 24 6f 70 74 69 .do. case $opti
5100: 6f 6e 20 69 6e 0a 20 20 20 20 2d 44 53 51 4c 49 on in. -DSQLI
5110: 54 45 5f 4f 4d 49 54 2a 29 20 4f 50 54 5f 46 45 TE_OMIT*) OPT_FE
5120: 41 54 55 52 45 5f 46 4c 41 47 53 3d 22 24 4f 50 ATURE_FLAGS="$OP
5130: 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 47 53 20 T_FEATURE_FLAGS
5140: 24 6f 70 74 69 6f 6e 22 3b 3b 0a 20 20 20 20 2d $option";;. -
5150: 44 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 2a 29 DSQLITE_ENABLE*)
5160: 20 4f 50 54 5f 46 45 41 54 55 52 45 5f 46 4c 41 OPT_FEATURE_FLA
5170: 47 53 3d 22 24 4f 50 54 5f 46 45 41 54 55 52 45 GS="$OPT_FEATURE
5180: 5f 46 4c 41 47 53 20 24 6f 70 74 69 6f 6e 22 3b _FLAGS $option";
5190: 3b 0a 20 20 65 73 61 63 0a 64 6f 6e 65 0a 41 43 ;. esac.done.AC
51a0: 5f 53 55 42 53 54 28 4f 50 54 5f 46 45 41 54 55 _SUBST(OPT_FEATU
51b0: 52 45 5f 46 4c 41 47 53 29 0a 0a 0a 23 20 61 74 RE_FLAGS)...# at
51c0: 74 65 6d 70 74 20 74 6f 20 72 65 6d 6f 76 65 20 tempt to remove
51d0: 61 6e 79 20 4f 4d 49 54 53 20 61 6e 64 20 45 4e any OMITS and EN
51e0: 41 42 4c 45 53 20 66 72 6f 6d 20 74 68 65 20 24 ABLES from the $
51f0: 28 43 46 4c 41 47 53 29 20 70 61 72 61 6d 65 74 (CFLAGS) paramet
5200: 65 72 0a 61 63 5f 74 65 6d 70 5f 43 46 4c 41 47 er.ac_temp_CFLAG
5210: 53 3d 22 22 0a 66 6f 72 20 6f 70 74 69 6f 6e 20 S="".for option
5220: 69 6e 20 24 43 46 4c 41 47 53 0a 64 6f 0a 20 20 in $CFLAGS.do.
5230: 63 61 73 65 20 24 6f 70 74 69 6f 6e 20 69 6e 0a case $option in.
5240: 20 20 20 20 2d 44 53 51 4c 49 54 45 5f 4f 4d 49 -DSQLITE_OMI
5250: 54 2a 29 20 3b 3b 0a 20 20 20 20 2d 44 53 51 4c T*) ;;. -DSQL
5260: 49 54 45 5f 45 4e 41 42 4c 45 2a 29 20 3b 3b 0a ITE_ENABLE*) ;;.
5270: 20 20 20 20 2a 29 20 61 63 5f 74 65 6d 70 5f 43 *) ac_temp_C
5280: 46 4c 41 47 53 3d 22 24 61 63 5f 74 65 6d 70 5f FLAGS="$ac_temp_
5290: 43 46 4c 41 47 53 20 24 6f 70 74 69 6f 6e 22 3b CFLAGS $option";
52a0: 3b 0a 20 20 65 73 61 63 0a 64 6f 6e 65 0a 43 46 ;. esac.done.CF
52b0: 4c 41 47 53 3d 24 61 63 5f 74 65 6d 70 5f 43 46 LAGS=$ac_temp_CF
52c0: 4c 41 47 53 0a 0a 0a 23 20 61 74 74 65 6d 70 74 LAGS...# attempt
52d0: 20 74 6f 20 72 65 6d 6f 76 65 20 61 6e 79 20 4f to remove any O
52e0: 4d 49 54 53 20 61 6e 64 20 45 4e 41 42 4c 45 53 MITS and ENABLES
52f0: 20 66 72 6f 6d 20 74 68 65 20 24 28 43 50 50 46 from the $(CPPF
5300: 4c 41 47 53 29 20 70 61 72 61 6d 65 74 65 72 0a LAGS) parameter.
5310: 61 63 5f 74 65 6d 70 5f 43 50 50 46 4c 41 47 53 ac_temp_CPPFLAGS
5320: 3d 22 22 0a 66 6f 72 20 6f 70 74 69 6f 6e 20 69 ="".for option i
5330: 6e 20 24 43 50 50 46 4c 41 47 53 0a 64 6f 0a 20 n $CPPFLAGS.do.
5340: 20 63 61 73 65 20 24 6f 70 74 69 6f 6e 20 69 6e case $option in
5350: 0a 20 20 20 20 2d 44 53 51 4c 49 54 45 5f 4f 4d . -DSQLITE_OM
5360: 49 54 2a 29 20 3b 3b 0a 20 20 20 20 2d 44 53 51 IT*) ;;. -DSQ
5370: 4c 49 54 45 5f 45 4e 41 42 4c 45 2a 29 20 3b 3b LITE_ENABLE*) ;;
5380: 0a 20 20 20 20 2a 29 20 61 63 5f 74 65 6d 70 5f . *) ac_temp_
5390: 43 50 50 46 4c 41 47 53 3d 22 24 61 63 5f 74 65 CPPFLAGS="$ac_te
53a0: 6d 70 5f 43 50 50 46 4c 41 47 53 20 24 6f 70 74 mp_CPPFLAGS $opt
53b0: 69 6f 6e 22 3b 3b 0a 20 20 65 73 61 63 0a 64 6f ion";;. esac.do
53c0: 6e 65 0a 43 50 50 46 4c 41 47 53 3d 24 61 63 5f ne.CPPFLAGS=$ac_
53d0: 74 65 6d 70 5f 43 50 50 46 4c 41 47 53 0a 0a 0a temp_CPPFLAGS...
53e0: 23 20 61 74 74 65 6d 70 74 20 74 6f 20 72 65 6d # attempt to rem
53f0: 6f 76 65 20 61 6e 79 20 4f 4d 49 54 53 20 61 6e ove any OMITS an
5400: 64 20 45 4e 41 42 4c 45 53 20 66 72 6f 6d 20 74 d ENABLES from t
5410: 68 65 20 24 28 42 55 49 4c 44 5f 43 46 4c 41 47 he $(BUILD_CFLAG
5420: 53 29 20 70 61 72 61 6d 65 74 65 72 0a 61 63 5f S) parameter.ac_
5430: 74 65 6d 70 5f 42 55 49 4c 44 5f 43 46 4c 41 47 temp_BUILD_CFLAG
5440: 53 3d 22 22 0a 66 6f 72 20 6f 70 74 69 6f 6e 20 S="".for option
5450: 69 6e 20 24 42 55 49 4c 44 5f 43 46 4c 41 47 53 in $BUILD_CFLAGS
5460: 0a 64 6f 0a 20 20 63 61 73 65 20 24 6f 70 74 69 .do. case $opti
5470: 6f 6e 20 69 6e 0a 20 20 20 20 2d 44 53 51 4c 49 on in. -DSQLI
5480: 54 45 5f 4f 4d 49 54 2a 29 20 3b 3b 0a 20 20 20 TE_OMIT*) ;;.
5490: 20 2d 44 53 51 4c 49 54 45 5f 45 4e 41 42 4c 45 -DSQLITE_ENABLE
54a0: 2a 29 20 3b 3b 0a 20 20 20 20 2a 29 20 61 63 5f *) ;;. *) ac_
54b0: 74 65 6d 70 5f 42 55 49 4c 44 5f 43 46 4c 41 47 temp_BUILD_CFLAG
54c0: 53 3d 22 24 61 63 5f 74 65 6d 70 5f 42 55 49 4c S="$ac_temp_BUIL
54d0: 44 5f 43 46 4c 41 47 53 20 24 6f 70 74 69 6f 6e D_CFLAGS $option
54e0: 22 3b 3b 0a 20 20 65 73 61 63 0a 64 6f 6e 65 0a ";;. esac.done.
54f0: 42 55 49 4c 44 5f 43 46 4c 41 47 53 3d 24 61 63 BUILD_CFLAGS=$ac
5500: 5f 74 65 6d 70 5f 42 55 49 4c 44 5f 43 46 4c 41 _temp_BUILD_CFLA
5510: 47 53 0a 0a 0a 23 23 23 23 23 23 23 23 23 0a 23 GS...#########.#
5520: 20 53 65 65 20 77 68 65 74 68 65 72 20 77 65 20 See whether we
5530: 73 68 6f 75 6c 64 20 75 73 65 20 47 43 4f 56 0a should use GCOV.
5540: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 67 63 AC_ARG_ENABLE(gc
5550: 6f 76 2c 20 41 43 5f 48 45 4c 50 5f 53 54 52 49 ov, AC_HELP_STRI
5560: 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 67 63 6f NG([--enable-gco
5570: 76 5d 2c 0a 20 20 20 20 20 20 5b 45 6e 61 62 6c v],. [Enabl
5580: 65 20 63 6f 76 65 72 61 67 65 20 74 65 73 74 69 e coverage testi
5590: 6e 67 20 75 73 69 6e 67 20 67 63 6f 76 5d 29 29 ng using gcov]))
55a0: 0a 69 66 20 74 65 73 74 20 22 24 7b 75 73 65 5f .if test "${use_
55b0: 67 63 6f 76 7d 22 20 3d 20 22 79 65 73 22 20 3b gcov}" = "yes" ;
55c0: 20 74 68 65 6e 0a 20 20 55 53 45 5f 47 43 4f 56 then. USE_GCOV
55d0: 3d 31 0a 65 6c 73 65 0a 20 20 55 53 45 5f 47 43 =1.else. USE_GC
55e0: 4f 56 3d 30 0a 66 69 0a 41 43 5f 53 55 42 53 54 OV=0.fi.AC_SUBST
55f0: 28 55 53 45 5f 47 43 4f 56 29 0a 0a 0a 23 23 23 (USE_GCOV)...###
5600: 23 23 23 23 23 23 0a 23 20 4f 75 74 70 75 74 20 ######.# Output
5610: 74 68 65 20 63 6f 6e 66 69 67 20 68 65 61 64 65 the config heade
5620: 72 0a 41 43 5f 43 4f 4e 46 49 47 5f 48 45 41 44 r.AC_CONFIG_HEAD
5630: 45 52 53 28 63 6f 6e 66 69 67 2e 68 29 0a 0a 23 ERS(config.h)..#
5640: 23 23 23 23 23 23 23 23 0a 23 20 47 65 6e 65 72 ########.# Gener
5650: 61 74 65 20 74 68 65 20 6f 75 74 70 75 74 20 66 ate the output f
5660: 69 6c 65 73 2e 0a 23 0a 41 43 5f 53 55 42 53 54 iles..#.AC_SUBST
5670: 28 42 55 49 4c 44 5f 43 46 4c 41 47 53 29 0a 41 (BUILD_CFLAGS).A
5680: 43 5f 4f 55 54 50 55 54 28 5b 0a 4d 61 6b 65 66 C_OUTPUT([.Makef
5690: 69 6c 65 0a 73 71 6c 69 74 65 33 2e 70 63 0a 5d ile.sqlite3.pc.]
56a0: 29 0a ).