/ Check-in [c1d96fb6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge the version 3.9.0 changes and the incorporation of JSON1 and FTS5 into the amalgamation from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1:c1d96fb654b2c0f66d586aa39d80ea0468186690
User & Date: drh 2015-10-09 15:29:24
Context
2015-10-10
20:35
Pull in the latest 3.9.0 tweaks from trunk. check-in: ed174ccf user: drh tags: sessions
2015-10-09
15:29
Merge the version 3.9.0 changes and the incorporation of JSON1 and FTS5 into the amalgamation from trunk. check-in: c1d96fb6 user: drh tags: sessions
14:37
Add --enable-fts5 and --enable-json1 options to the amalgamation autoconf package. check-in: 8a4e1988 user: dan tags: trunk
2015-10-08
14:55
Merge the 3.8.12 beta changes from trunk. check-in: 35b1b8d4 user: drh tags: sessions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

    62     62   
    63     63   # Should the database engine be compiled threadsafe
    64     64   #
    65     65   TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
    66     66   
    67     67   # Any target libraries which libsqlite must be linked against
    68     68   # 
    69         -TLIBS = @LIBS@
           69  +TLIBS = @LIBS@ $(LIBS)
    70     70   
    71     71   # Flags controlling use of the in memory btree implementation
    72     72   #
    73     73   # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
    74     74   # default to file, 2 to default to memory, and 3 to force temporary
    75     75   # tables to always be in memory.
    76     76   #
................................................................................
   173    173            expr.lo fault.lo fkey.lo \
   174    174            fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
   175    175            fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
   176    176            fts3_tokenize_vtab.lo \
   177    177            fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
   178    178   	 fts5.lo \
   179    179            func.lo global.lo hash.lo \
   180         -         icu.lo insert.lo journal.lo legacy.lo loadext.lo \
          180  +         icu.lo insert.lo journal.lo json1.lo legacy.lo loadext.lo \
   181    181            main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
   182    182            memjournal.lo \
   183    183            mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
   184    184            notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
   185    185            pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
   186    186            random.lo resolve.lo rowset.lo rtree.lo \
   187    187            sqlite3session.lo select.lo status.lo \
................................................................................
   271    271     $(TOP)/src/status.c \
   272    272     $(TOP)/src/shell.c \
   273    273     $(TOP)/src/sqlite.h.in \
   274    274     $(TOP)/src/sqlite3ext.h \
   275    275     $(TOP)/src/sqliteInt.h \
   276    276     $(TOP)/src/sqliteLimit.h \
   277    277     $(TOP)/src/table.c \
   278         -  $(TOP)/src/threads.c \
   279    278     $(TOP)/src/tclsqlite.c \
          279  +  $(TOP)/src/threads.c \
   280    280     $(TOP)/src/tokenize.c \
   281    281     $(TOP)/src/treeview.c \
   282    282     $(TOP)/src/trigger.c \
   283    283     $(TOP)/src/utf.c \
   284    284     $(TOP)/src/update.c \
   285    285     $(TOP)/src/util.c \
   286    286     $(TOP)/src/vacuum.c \
................................................................................
   349    349     $(TOP)/ext/rtree/rtree.c
   350    350   SRC += \
   351    351     $(TOP)/ext/session/sqlite3session.c \
   352    352     $(TOP)/ext/session/sqlite3session.h
   353    353   SRC += \
   354    354     $(TOP)/ext/rbu/sqlite3rbu.h \
   355    355     $(TOP)/ext/rbu/sqlite3rbu.c
          356  +SRC += \
          357  +  $(TOP)/ext/misc/json1.c
   356    358   
   357    359   # Generated source code files
   358    360   #
   359    361   SRC += \
   360    362     keywordhash.h \
   361    363     opcodes.c \
   362    364     opcodes.h \
................................................................................
   419    421     $(TOP)/ext/misc/closure.c \
   420    422     $(TOP)/ext/misc/eval.c \
   421    423     $(TOP)/ext/misc/fileio.c \
   422    424     $(TOP)/ext/misc/fuzzer.c \
   423    425     $(TOP)/ext/fts5/fts5_tcl.c \
   424    426     $(TOP)/ext/fts5/fts5_test_mi.c \
   425    427     $(TOP)/ext/misc/ieee754.c \
   426         -  $(TOP)/ext/misc/json1.c \
   427    428     $(TOP)/ext/misc/nextchar.c \
   428    429     $(TOP)/ext/misc/percentile.c \
   429    430     $(TOP)/ext/misc/regexp.c \
   430    431     $(TOP)/ext/misc/series.c \
   431    432     $(TOP)/ext/misc/spellfix.c \
   432    433     $(TOP)/ext/misc/totype.c \
   433    434     $(TOP)/ext/misc/wholenumber.c
................................................................................
   544    545   #
   545    546   FUZZDATA = \
   546    547     $(TOP)/test/fuzzdata1.db \
   547    548     $(TOP)/test/fuzzdata2.db \
   548    549     $(TOP)/test/fuzzdata3.db \
   549    550     $(TOP)/test/fuzzdata4.db
   550    551   
   551         -# Extra arguments for including json1 in the build of tools
   552         -#
   553         -JSON1_DEP = $(TOP)/ext/misc/json1.c sqlite3ext.h
   554         -JSON1_OPT = -DSQLITE_SHELL_JSON1 -DSQLITE_CORE
   555         -JSON1_SRC = $(TOP)/ext/misc/json1.c
   556         -
   557    552   # Standard options to testfixture
   558    553   #
   559    554   TESTOPTS = --verbose=file --output=test-out.txt
          555  +
          556  +# Extra compiler options for various shell tools
          557  +#
          558  +SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
          559  +FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
          560  +FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1
   560    561   
   561    562   # This is the default Makefile target.  The objects listed here
   562    563   # are what get build when you type just "make" with no arguments.
   563    564   #
   564    565   all:	sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
   565    566   
   566    567   Makefile: $(TOP)/Makefile.in
................................................................................
   576    577   libtclsqlite3.la:	tclsqlite.lo libsqlite3.la
   577    578   	$(LTLINK) -no-undefined -o $@ tclsqlite.lo \
   578    579   		libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
   579    580   		-rpath "$(TCLLIBDIR)" \
   580    581   		-version-info "8:6:8" \
   581    582   		-avoid-version
   582    583   
   583         -sqlite3$(TEXE):	$(TOP)/src/shell.c libsqlite3.la sqlite3.h $(JSON1_DEP)
   584         -	$(LTLINK) $(READLINE_FLAGS) $(JSON1_OPT) -o $@ \
   585         -		$(TOP)/src/shell.c $(JSON1_SRC) libsqlite3.la \
          584  +sqlite3$(TEXE):	$(TOP)/src/shell.c libsqlite3.la sqlite3.h
          585  +	$(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
          586  +		$(TOP)/src/shell.c libsqlite3.la \
   586    587   		$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
   587    588   
   588    589   sqldiff$(TEXE):	$(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
   589    590   	$(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS)
   590    591   
   591         -fuzzershell$(TEXE):	$(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h $(JSON1_DEP)
   592         -	$(LTLINK) -o $@ $(JSON1_OPT) \
   593         -	  $(TOP)/tool/fuzzershell.c $(JSON1_SRC) sqlite3.c $(TLIBS)
          592  +fuzzershell$(TEXE):	$(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
          593  +	$(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
          594  +	  $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS)
   594    595   
   595         -fuzzcheck$(TEXE):	$(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h $(JSON1_DEP)
   596         -	$(LTLINK) -o $@ $(JSON1_OPT) $(TOP)/test/fuzzcheck.c $(JSON1_SRC) sqlite3.c $(TLIBS)
          596  +fuzzcheck$(TEXE):	$(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h
          597  +	$(LTLINK) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/fuzzcheck.c sqlite3.c $(TLIBS)
   597    598   
   598    599   mptester$(TEXE):	sqlite3.c $(TOP)/mptest/mptest.c
   599    600   	$(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
   600    601   		$(TLIBS) -rpath "$(libdir)"
   601    602   
   602    603   MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
   603    604   MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
................................................................................
   615    616   
   616    617   # This target creates a directory named "tsrc" and fills it with
   617    618   # copies of all of the C source code and header files needed to
   618    619   # build on the target system.  Some of the C source code and header
   619    620   # files are automatically generated.  This target takes care of
   620    621   # all that automatic generation.
   621    622   #
   622         -.target_source:	$(SRC) $(TOP)/tool/vdbe-compress.tcl
          623  +.target_source:	$(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
   623    624   	rm -rf tsrc
   624    625   	mkdir tsrc
   625    626   	cp -f $(SRC) tsrc
   626    627   	rm tsrc/sqlite.h.in tsrc/parse.y
   627    628   	$(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
   628    629   	mv vdbe.new tsrc/vdbe.c
          630  +	cp fts5.c fts5.h tsrc
   629    631   	touch .target_source
   630    632   
   631    633   sqlite3.c:	.target_source $(TOP)/tool/mksqlite3c.tcl
   632    634   	$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
   633    635   	cp tsrc/shell.c tsrc/sqlite3ext.h .
   634    636   	cp $(TOP)/ext/session/sqlite3session.h .
   635    637   
................................................................................
   997    999   
   998   1000   rtree.lo:	$(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
   999   1001   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
  1000   1002   
  1001   1003   sqlite3session.lo:	$(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
  1002   1004   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
  1003   1005   
         1006  +json1.lo:	$(TOP)/ext/misc/json1.c
         1007  +	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
         1008  +
  1004   1009   # FTS5 things
  1005   1010   #
  1006   1011   FTS5_SRC = \
  1007   1012      $(TOP)/ext/fts5/fts5.h \
  1008   1013      $(TOP)/ext/fts5/fts5Int.h \
  1009   1014      $(TOP)/ext/fts5/fts5_aux.c \
  1010   1015      $(TOP)/ext/fts5/fts5_buffer.c \

Changes to Makefile.msc.

  1017   1017     $(TOP)\ext\icu\sqliteicu.h \
  1018   1018     $(TOP)\ext\icu\icu.c \
  1019   1019     $(TOP)\ext\rtree\rtree.h \
  1020   1020     $(TOP)\ext\rtree\rtree.c \
  1021   1021     $(TOP)\ext\session\sqlite3session.h \
  1022   1022     $(TOP)\ext\session\sqlite3session.c \
  1023   1023     $(TOP)\ext\rbu\sqlite3rbu.h \
  1024         -  $(TOP)\ext\rbu\sqlite3rbu.c
         1024  +  $(TOP)\ext\rbu\sqlite3rbu.c \
         1025  +  $(TOP)\ext\misc\json1.c
  1025   1026   
  1026   1027   
  1027   1028   # Generated source code files
  1028   1029   #
  1029   1030   SRC5 = \
  1030   1031     keywordhash.h \
  1031   1032     opcodes.c \
................................................................................
  1230   1231   #
  1231   1232   FUZZDATA = \
  1232   1233     $(TOP)\test\fuzzdata1.db \
  1233   1234     $(TOP)\test\fuzzdata2.db \
  1234   1235     $(TOP)\test\fuzzdata3.db \
  1235   1236     $(TOP)\test\fuzzdata4.db
  1236   1237   
  1237         -# Extra arguments for including json1 in the build of tools
         1238  +# Extra compiler options for various shell tools
  1238   1239   #
  1239         -JSON1_DEP = sqlite3ext.h $(TOP)\ext\misc\json1.c
  1240         -JSON1_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_CORE
  1241         -JSON1_SRC = $(TOP)\ext\misc\json1.c
         1240  +SHELL_COMPILE_OPTS = -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
         1241  +FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
         1242  +FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
  1242   1243   
  1243   1244   # Standard options to testfixture
  1244   1245   #
  1245   1246   TESTOPTS = --verbose=file --output=test-out.txt
  1246   1247   
  1247   1248   # This is the default Makefile target.  The objects listed here
  1248   1249   # are what get build when you type just "make" with no arguments.
................................................................................
  1251   1252   
  1252   1253   libsqlite3.lib:	$(LIBOBJ)
  1253   1254   	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
  1254   1255   
  1255   1256   libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
  1256   1257   	$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
  1257   1258   
  1258         -sqlite3.exe:	$(TOP)\src\shell.c $(JSON1_DEP) $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
  1259         -	$(LTLINK) $(SHELL_COMPILE_OPTS) $(JSON1_OPT) $(READLINE_FLAGS) $(TOP)\src\shell.c $(JSON1_SRC) \
         1259  +sqlite3.exe:	$(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
         1260  +	$(LTLINK) $(SHELL_COMPILE_OPTS) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c \
  1260   1261   		/link /pdb:sqlite3sh.pdb $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  1261   1262   
  1262   1263   sqldiff.exe:	$(TOP)\tool\sqldiff.c sqlite3.c sqlite3.h
  1263   1264   	$(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c sqlite3.c
  1264   1265   
  1265         -fuzzershell.exe:	$(TOP)\tool\fuzzershell.c sqlite3.c sqlite3.h $(JSON1_DEP)
  1266         -	$(LTLINK) $(NO_WARN) $(JSON1_OPT) \
  1267         -	  $(TOP)\tool\fuzzershell.c $(JSON1_SRC) sqlite3.c
         1266  +fuzzershell.exe:	$(TOP)\tool\fuzzershell.c sqlite3.c sqlite3.h
         1267  +	$(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) \
         1268  +	  $(TOP)\tool\fuzzershell.c sqlite3.c
  1268   1269   
  1269         -fuzzcheck.exe:	$(TOP)\test\fuzzcheck.c sqlite3.c sqlite3.h $(JSON1_DEP)
  1270         -	$(LTLINK) $(NO_WARN) $(JSON1_OPT) $(TOP)\test\fuzzcheck.c $(JSON1_SRC) sqlite3.c
         1270  +fuzzcheck.exe:	$(TOP)\test\fuzzcheck.c sqlite3.c sqlite3.h
         1271  +	$(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(TOP)\test\fuzzcheck.c sqlite3.c
  1271   1272   
  1272   1273   mptester.exe:	$(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
  1273   1274   	$(LTLINK) $(NO_WARN) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
  1274   1275   		/link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  1275   1276   
  1276   1277   MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
  1277   1278   MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
................................................................................
  1289   1290   
  1290   1291   # This target creates a directory named "tsrc" and fills it with
  1291   1292   # copies of all of the C source code and header files needed to
  1292   1293   # build on the target system.  Some of the C source code and header
  1293   1294   # files are automatically generated.  This target takes care of
  1294   1295   # all that automatic generation.
  1295   1296   #
  1296         -.target_source:	$(SRC) $(TOP)\tool\vdbe-compress.tcl
         1297  +.target_source:	$(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c
  1297   1298   	-rmdir /Q/S tsrc 2>NUL
  1298   1299   	-mkdir tsrc
  1299   1300   	for %i in ($(SRC1)) do copy /Y %i tsrc
  1300   1301   	for %i in ($(SRC2)) do copy /Y %i tsrc
  1301   1302   	for %i in ($(SRC3)) do copy /Y %i tsrc
  1302   1303   	for %i in ($(SRC4)) do copy /Y %i tsrc
  1303   1304   	for %i in ($(SRC5)) do copy /Y %i tsrc
         1305  +	copy /Y fts5.c tsrc
         1306  +	copy /Y fts5.h tsrc
  1304   1307   	del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
  1305   1308   	$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
  1306   1309   	move vdbe.new tsrc\vdbe.c
  1307   1310   	echo > .target_source
  1308   1311   
  1309   1312   sqlite3.c:	.target_source sqlite3ext.h $(TOP)\tool\mksqlite3c.tcl
  1310   1313   	$(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl $(MKSQLITE3C_ARGS)

Changes to VERSION.

     1         -3.8.12
            1  +3.9.0

Changes to autoconf/Makefile.am.

     1      1   
     2         -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE
            2  +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE
     3      3   
     4      4   lib_LTLIBRARIES = libsqlite3.la
     5      5   libsqlite3_la_SOURCES = sqlite3.c
     6      6   libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
     7      7   
     8      8   bin_PROGRAMS = sqlite3
     9      9   sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h

Changes to autoconf/configure.ac.

    73     73   else
    74     74     DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
    75     75   fi
    76     76   AC_MSG_CHECKING([for whether to support dynamic extensions])
    77     77   AC_MSG_RESULT($enable_dynamic_extensions)
    78     78   AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
    79     79   #-----------------------------------------------------------------------
           80  +
           81  +#-----------------------------------------------------------------------
           82  +#   --enable-fts5
           83  +#
           84  +AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
           85  +  [--enable-fts5], [include fts5 support [default=no]])], 
           86  +  [], [enable_fts5=no])
           87  +if test x"$enable_fts5" == "xyes"; then
           88  +  AC_SEARCH_LIBS(log, m)
           89  +  FTS5_FLAGS=-DSQLITE_ENABLE_FTS5
           90  +fi
           91  +AC_SUBST(FTS5_FLAGS)
           92  +#-----------------------------------------------------------------------
           93  +
           94  +#-----------------------------------------------------------------------
           95  +#   --enable-json1
           96  +#
           97  +AC_ARG_ENABLE(json1, [AS_HELP_STRING(
           98  +  [--enable-json1], [include json1 support [default=no]])], 
           99  +  [], [enable_json1=no])
          100  +if test x"$enable_json1" == "xyes"; then
          101  +  JSON1_FLAGS=-DSQLITE_ENABLE_JSON1
          102  +fi
          103  +AC_SUBST(JSON1_FLAGS)
          104  +#-----------------------------------------------------------------------
    80    105   
    81    106   AC_CHECK_FUNCS(posix_fallocate)
    82    107   
    83    108   #-----------------------------------------------------------------------
    84    109   # UPDATE: Maybe it's better if users just set CFLAGS before invoking
    85    110   # configure. This option doesn't really add much...
    86    111   #

Changes to configure.

     1      1   #! /bin/sh
     2      2   # Guess values for system-dependent variables and create Makefiles.
     3         -# Generated by GNU Autoconf 2.69 for sqlite 3.8.12.
            3  +# Generated by GNU Autoconf 2.69 for sqlite 3.9.0.
     4      4   #
     5      5   #
     6      6   # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
     7      7   #
     8      8   #
     9      9   # This configure script is free software; the Free Software Foundation
    10     10   # gives unlimited permission to copy, distribute and modify it.
................................................................................
   722    722   subdirs=
   723    723   MFLAGS=
   724    724   MAKEFLAGS=
   725    725   
   726    726   # Identity of this package.
   727    727   PACKAGE_NAME='sqlite'
   728    728   PACKAGE_TARNAME='sqlite'
   729         -PACKAGE_VERSION='3.8.12'
   730         -PACKAGE_STRING='sqlite 3.8.12'
          729  +PACKAGE_VERSION='3.9.0'
          730  +PACKAGE_STRING='sqlite 3.9.0'
   731    731   PACKAGE_BUGREPORT=''
   732    732   PACKAGE_URL=''
   733    733   
   734    734   # Factoring default headers for most tests.
   735    735   ac_includes_default="\
   736    736   #include <stdio.h>
   737    737   #ifdef HAVE_SYS_TYPES_H
................................................................................
   898    898   with_tcl
   899    899   enable_readline
   900    900   with_readline_lib
   901    901   with_readline_inc
   902    902   enable_debug
   903    903   enable_amalgamation
   904    904   enable_load_extension
          905  +enable_fts3
          906  +enable_fts4
          907  +enable_fts5
          908  +enable_json1
          909  +enable_rtree
   905    910   enable_gcov
   906    911   '
   907    912         ac_precious_vars='build_alias
   908    913   host_alias
   909    914   target_alias
   910    915   CC
   911    916   CFLAGS
................................................................................
  1450   1455   #
  1451   1456   # Report the --help message.
  1452   1457   #
  1453   1458   if test "$ac_init_help" = "long"; then
  1454   1459     # Omit some internal or obsolete options to make the list less imposing.
  1455   1460     # This message is too long to be a string in the A/UX 3.1 sh.
  1456   1461     cat <<_ACEOF
  1457         -\`configure' configures sqlite 3.8.12 to adapt to many kinds of systems.
         1462  +\`configure' configures sqlite 3.9.0 to adapt to many kinds of systems.
  1458   1463   
  1459   1464   Usage: $0 [OPTION]... [VAR=VALUE]...
  1460   1465   
  1461   1466   To assign environment variables (e.g., CC, CFLAGS...), specify them as
  1462   1467   VAR=VALUE.  See below for descriptions of some of the useful variables.
  1463   1468   
  1464   1469   Defaults for the options are specified in brackets.
................................................................................
  1515   1520     --build=BUILD     configure for building on BUILD [guessed]
  1516   1521     --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  1517   1522   _ACEOF
  1518   1523   fi
  1519   1524   
  1520   1525   if test -n "$ac_init_help"; then
  1521   1526     case $ac_init_help in
  1522         -     short | recursive ) echo "Configuration of sqlite 3.8.12:";;
         1527  +     short | recursive ) echo "Configuration of sqlite 3.9.0:";;
  1523   1528      esac
  1524   1529     cat <<\_ACEOF
  1525   1530   
  1526   1531   Optional Features:
  1527   1532     --disable-option-checking  ignore unrecognized --enable/--with options
  1528   1533     --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  1529   1534     --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
................................................................................
  1540   1545     --disable-tcl           do not build TCL extension
  1541   1546     --disable-readline      disable readline support [default=detect]
  1542   1547     --enable-debug          enable debugging & verbose explain
  1543   1548     --disable-amalgamation  Disable the amalgamation and instead build all files
  1544   1549                             separately
  1545   1550     --disable-load-extension
  1546   1551                             Disable loading of external extensions
         1552  +  --enable-fts3           Enable the FTS3 extension
         1553  +  --enable-fts4           Enable the FTS4 extension
         1554  +  --enable-fts5           Enable the FTS5 extension
         1555  +  --enable-json1          Enable the JSON1 extension
         1556  +  --enable-rtree          Enable the RTREE extension
  1547   1557     --enable-gcov           Enable coverage testing using gcov
  1548   1558   
  1549   1559   Optional Packages:
  1550   1560     --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  1551   1561     --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  1552   1562     --with-pic              try to use only PIC/non-PIC objects [default=use
  1553   1563                             both]
................................................................................
  1630   1640       cd "$ac_pwd" || { ac_status=$?; break; }
  1631   1641     done
  1632   1642   fi
  1633   1643   
  1634   1644   test -n "$ac_init_help" && exit $ac_status
  1635   1645   if $ac_init_version; then
  1636   1646     cat <<\_ACEOF
  1637         -sqlite configure 3.8.12
         1647  +sqlite configure 3.9.0
  1638   1648   generated by GNU Autoconf 2.69
  1639   1649   
  1640   1650   Copyright (C) 2012 Free Software Foundation, Inc.
  1641   1651   This configure script is free software; the Free Software Foundation
  1642   1652   gives unlimited permission to copy, distribute and modify it.
  1643   1653   _ACEOF
  1644   1654     exit
................................................................................
  2049   2059     eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  2050   2060   
  2051   2061   } # ac_fn_c_check_header_mongrel
  2052   2062   cat >config.log <<_ACEOF
  2053   2063   This file contains any messages produced by compilers while
  2054   2064   running configure, to aid debugging if configure makes a mistake.
  2055   2065   
  2056         -It was created by sqlite $as_me 3.8.12, which was
         2066  +It was created by sqlite $as_me 3.9.0, which was
  2057   2067   generated by GNU Autoconf 2.69.  Invocation command line was
  2058   2068   
  2059   2069     $ $0 $@
  2060   2070   
  2061   2071   _ACEOF
  2062   2072   exec 5>>config.log
  2063   2073   {
................................................................................
  3907   3917   { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
  3908   3918   $as_echo_n "checking the name lister ($NM) interface... " >&6; }
  3909   3919   if ${lt_cv_nm_interface+:} false; then :
  3910   3920     $as_echo_n "(cached) " >&6
  3911   3921   else
  3912   3922     lt_cv_nm_interface="BSD nm"
  3913   3923     echo "int some_variable = 0;" > conftest.$ac_ext
  3914         -  (eval echo "\"\$as_me:3914: $ac_compile\"" >&5)
         3924  +  (eval echo "\"\$as_me:3924: $ac_compile\"" >&5)
  3915   3925     (eval "$ac_compile" 2>conftest.err)
  3916   3926     cat conftest.err >&5
  3917         -  (eval echo "\"\$as_me:3917: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
         3927  +  (eval echo "\"\$as_me:3927: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
  3918   3928     (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
  3919   3929     cat conftest.err >&5
  3920         -  (eval echo "\"\$as_me:3920: output\"" >&5)
         3930  +  (eval echo "\"\$as_me:3930: output\"" >&5)
  3921   3931     cat conftest.out >&5
  3922   3932     if $GREP 'External.*some_variable' conftest.out > /dev/null; then
  3923   3933       lt_cv_nm_interface="MS dumpbin"
  3924   3934     fi
  3925   3935     rm -f conftest*
  3926   3936   fi
  3927   3937   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
................................................................................
  5119   5129   	;;
  5120   5130       esac
  5121   5131     fi
  5122   5132     rm -rf conftest*
  5123   5133     ;;
  5124   5134   *-*-irix6*)
  5125   5135     # Find out which ABI we are using.
  5126         -  echo '#line 5126 "configure"' > conftest.$ac_ext
         5136  +  echo '#line 5136 "configure"' > conftest.$ac_ext
  5127   5137     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  5128   5138     (eval $ac_compile) 2>&5
  5129   5139     ac_status=$?
  5130   5140     $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  5131   5141     test $ac_status = 0; }; then
  5132   5142       if test "$lt_cv_prog_gnu_ld" = yes; then
  5133   5143         case `/usr/bin/file conftest.$ac_objext` in
................................................................................
  6644   6654      # Note that $ac_compile itself does not contain backslashes and begins
  6645   6655      # with a dollar sign (not a hyphen), so the echo should work correctly.
  6646   6656      # The option is referenced via a variable to avoid confusing sed.
  6647   6657      lt_compile=`echo "$ac_compile" | $SED \
  6648   6658      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6649   6659      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  6650   6660      -e 's:$: $lt_compiler_flag:'`
  6651         -   (eval echo "\"\$as_me:6651: $lt_compile\"" >&5)
         6661  +   (eval echo "\"\$as_me:6661: $lt_compile\"" >&5)
  6652   6662      (eval "$lt_compile" 2>conftest.err)
  6653   6663      ac_status=$?
  6654   6664      cat conftest.err >&5
  6655         -   echo "$as_me:6655: \$? = $ac_status" >&5
         6665  +   echo "$as_me:6665: \$? = $ac_status" >&5
  6656   6666      if (exit $ac_status) && test -s "$ac_outfile"; then
  6657   6667        # The compiler can only warn and ignore the option if not recognized
  6658   6668        # So say no if there are warnings other than the usual output.
  6659   6669        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  6660   6670        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  6661   6671        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  6662   6672          lt_cv_prog_compiler_rtti_exceptions=yes
................................................................................
  6983   6993      # Note that $ac_compile itself does not contain backslashes and begins
  6984   6994      # with a dollar sign (not a hyphen), so the echo should work correctly.
  6985   6995      # The option is referenced via a variable to avoid confusing sed.
  6986   6996      lt_compile=`echo "$ac_compile" | $SED \
  6987   6997      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6988   6998      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  6989   6999      -e 's:$: $lt_compiler_flag:'`
  6990         -   (eval echo "\"\$as_me:6990: $lt_compile\"" >&5)
         7000  +   (eval echo "\"\$as_me:7000: $lt_compile\"" >&5)
  6991   7001      (eval "$lt_compile" 2>conftest.err)
  6992   7002      ac_status=$?
  6993   7003      cat conftest.err >&5
  6994         -   echo "$as_me:6994: \$? = $ac_status" >&5
         7004  +   echo "$as_me:7004: \$? = $ac_status" >&5
  6995   7005      if (exit $ac_status) && test -s "$ac_outfile"; then
  6996   7006        # The compiler can only warn and ignore the option if not recognized
  6997   7007        # So say no if there are warnings other than the usual output.
  6998   7008        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  6999   7009        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  7000   7010        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  7001   7011          lt_cv_prog_compiler_pic_works=yes
................................................................................
  7088   7098      # (2) before a word containing "conftest.", or (3) at the end.
  7089   7099      # Note that $ac_compile itself does not contain backslashes and begins
  7090   7100      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7091   7101      lt_compile=`echo "$ac_compile" | $SED \
  7092   7102      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7093   7103      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7094   7104      -e 's:$: $lt_compiler_flag:'`
  7095         -   (eval echo "\"\$as_me:7095: $lt_compile\"" >&5)
         7105  +   (eval echo "\"\$as_me:7105: $lt_compile\"" >&5)
  7096   7106      (eval "$lt_compile" 2>out/conftest.err)
  7097   7107      ac_status=$?
  7098   7108      cat out/conftest.err >&5
  7099         -   echo "$as_me:7099: \$? = $ac_status" >&5
         7109  +   echo "$as_me:7109: \$? = $ac_status" >&5
  7100   7110      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  7101   7111      then
  7102   7112        # The compiler can only warn and ignore the option if not recognized
  7103   7113        # So say no if there are warnings
  7104   7114        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  7105   7115        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  7106   7116        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
................................................................................
  7143   7153      # (2) before a word containing "conftest.", or (3) at the end.
  7144   7154      # Note that $ac_compile itself does not contain backslashes and begins
  7145   7155      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7146   7156      lt_compile=`echo "$ac_compile" | $SED \
  7147   7157      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7148   7158      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7149   7159      -e 's:$: $lt_compiler_flag:'`
  7150         -   (eval echo "\"\$as_me:7150: $lt_compile\"" >&5)
         7160  +   (eval echo "\"\$as_me:7160: $lt_compile\"" >&5)
  7151   7161      (eval "$lt_compile" 2>out/conftest.err)
  7152   7162      ac_status=$?
  7153   7163      cat out/conftest.err >&5
  7154         -   echo "$as_me:7154: \$? = $ac_status" >&5
         7164  +   echo "$as_me:7164: \$? = $ac_status" >&5
  7155   7165      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  7156   7166      then
  7157   7167        # The compiler can only warn and ignore the option if not recognized
  7158   7168        # So say no if there are warnings
  7159   7169        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  7160   7170        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  7161   7171        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
................................................................................
  9523   9533   else
  9524   9534     	  if test "$cross_compiling" = yes; then :
  9525   9535     lt_cv_dlopen_self=cross
  9526   9536   else
  9527   9537     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  9528   9538     lt_status=$lt_dlunknown
  9529   9539     cat > conftest.$ac_ext <<_LT_EOF
  9530         -#line 9530 "configure"
         9540  +#line 9540 "configure"
  9531   9541   #include "confdefs.h"
  9532   9542   
  9533   9543   #if HAVE_DLFCN_H
  9534   9544   #include <dlfcn.h>
  9535   9545   #endif
  9536   9546   
  9537   9547   #include <stdio.h>
................................................................................
  9619   9629   else
  9620   9630     	  if test "$cross_compiling" = yes; then :
  9621   9631     lt_cv_dlopen_self_static=cross
  9622   9632   else
  9623   9633     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  9624   9634     lt_status=$lt_dlunknown
  9625   9635     cat > conftest.$ac_ext <<_LT_EOF
  9626         -#line 9626 "configure"
         9636  +#line 9636 "configure"
  9627   9637   #include "confdefs.h"
  9628   9638   
  9629   9639   #if HAVE_DLFCN_H
  9630   9640   #include <dlfcn.h>
  9631   9641   #endif
  9632   9642   
  9633   9643   #include <stdio.h>
................................................................................
 11218  11228     test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 11219  11229   
 11220  11230   fi
 11221  11231   
 11222  11232   else
 11223  11233     OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
 11224  11234   fi
        11235  +
        11236  +#########
        11237  +# See whether we should enable Full Text Search extensions
        11238  +# Check whether --enable-fts3 was given.
        11239  +if test "${enable_fts3+set}" = set; then :
        11240  +  enableval=$enable_fts3; enable_fts3=yes
        11241  +else
        11242  +  enable_fts3=no
        11243  +fi
        11244  +
        11245  +if test "${enable_fts3}" = "yes" ; then
        11246  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS3"
        11247  +fi
        11248  +# Check whether --enable-fts4 was given.
        11249  +if test "${enable_fts4+set}" = set; then :
        11250  +  enableval=$enable_fts4; enable_fts4=yes
        11251  +else
        11252  +  enable_fts4=no
        11253  +fi
        11254  +
        11255  +if test "${enable_fts4}" = "yes" ; then
        11256  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS4"
        11257  +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5
        11258  +$as_echo_n "checking for library containing log... " >&6; }
        11259  +if ${ac_cv_search_log+:} false; then :
        11260  +  $as_echo_n "(cached) " >&6
        11261  +else
        11262  +  ac_func_search_save_LIBS=$LIBS
        11263  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
        11264  +/* end confdefs.h.  */
        11265  +
        11266  +/* Override any GCC internal prototype to avoid an error.
        11267  +   Use char because int might match the return type of a GCC
        11268  +   builtin and then its argument prototype would still apply.  */
        11269  +#ifdef __cplusplus
        11270  +extern "C"
        11271  +#endif
        11272  +char log ();
        11273  +int
        11274  +main ()
        11275  +{
        11276  +return log ();
        11277  +  ;
        11278  +  return 0;
        11279  +}
        11280  +_ACEOF
        11281  +for ac_lib in '' m; do
        11282  +  if test -z "$ac_lib"; then
        11283  +    ac_res="none required"
        11284  +  else
        11285  +    ac_res=-l$ac_lib
        11286  +    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
        11287  +  fi
        11288  +  if ac_fn_c_try_link "$LINENO"; then :
        11289  +  ac_cv_search_log=$ac_res
        11290  +fi
        11291  +rm -f core conftest.err conftest.$ac_objext \
        11292  +    conftest$ac_exeext
        11293  +  if ${ac_cv_search_log+:} false; then :
        11294  +  break
        11295  +fi
        11296  +done
        11297  +if ${ac_cv_search_log+:} false; then :
        11298  +
        11299  +else
        11300  +  ac_cv_search_log=no
        11301  +fi
        11302  +rm conftest.$ac_ext
        11303  +LIBS=$ac_func_search_save_LIBS
        11304  +fi
        11305  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_log" >&5
        11306  +$as_echo "$ac_cv_search_log" >&6; }
        11307  +ac_res=$ac_cv_search_log
        11308  +if test "$ac_res" != no; then :
        11309  +  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
        11310  +
        11311  +fi
        11312  +
        11313  +fi
        11314  +# Check whether --enable-fts5 was given.
        11315  +if test "${enable_fts5+set}" = set; then :
        11316  +  enableval=$enable_fts5; enable_fts5=yes
        11317  +else
        11318  +  enable_fts5=no
        11319  +fi
        11320  +
        11321  +if test "${enable_fts5}" = "yes" ; then
        11322  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS5"
        11323  +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5
        11324  +$as_echo_n "checking for library containing log... " >&6; }
        11325  +if ${ac_cv_search_log+:} false; then :
        11326  +  $as_echo_n "(cached) " >&6
        11327  +else
        11328  +  ac_func_search_save_LIBS=$LIBS
        11329  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
        11330  +/* end confdefs.h.  */
        11331  +
        11332  +/* Override any GCC internal prototype to avoid an error.
        11333  +   Use char because int might match the return type of a GCC
        11334  +   builtin and then its argument prototype would still apply.  */
        11335  +#ifdef __cplusplus
        11336  +extern "C"
        11337  +#endif
        11338  +char log ();
        11339  +int
        11340  +main ()
        11341  +{
        11342  +return log ();
        11343  +  ;
        11344  +  return 0;
        11345  +}
        11346  +_ACEOF
        11347  +for ac_lib in '' m; do
        11348  +  if test -z "$ac_lib"; then
        11349  +    ac_res="none required"
        11350  +  else
        11351  +    ac_res=-l$ac_lib
        11352  +    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
        11353  +  fi
        11354  +  if ac_fn_c_try_link "$LINENO"; then :
        11355  +  ac_cv_search_log=$ac_res
        11356  +fi
        11357  +rm -f core conftest.err conftest.$ac_objext \
        11358  +    conftest$ac_exeext
        11359  +  if ${ac_cv_search_log+:} false; then :
        11360  +  break
        11361  +fi
        11362  +done
        11363  +if ${ac_cv_search_log+:} false; then :
        11364  +
        11365  +else
        11366  +  ac_cv_search_log=no
        11367  +fi
        11368  +rm conftest.$ac_ext
        11369  +LIBS=$ac_func_search_save_LIBS
        11370  +fi
        11371  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_log" >&5
        11372  +$as_echo "$ac_cv_search_log" >&6; }
        11373  +ac_res=$ac_cv_search_log
        11374  +if test "$ac_res" != no; then :
        11375  +  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
        11376  +
        11377  +fi
        11378  +
        11379  +fi
        11380  +
        11381  +#########
        11382  +# See whether we should enable JSON1
        11383  +# Check whether --enable-json1 was given.
        11384  +if test "${enable_json1+set}" = set; then :
        11385  +  enableval=$enable_json1; enable_json1=yes
        11386  +else
        11387  +  enable_json1=no
        11388  +fi
        11389  +
        11390  +if test "${enable_json1}" = "yes" ; then
        11391  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_JSON1"
        11392  +fi
        11393  +
        11394  +#########
        11395  +# See whether we should enable RTREE
        11396  +# Check whether --enable-rtree was given.
        11397  +if test "${enable_rtree+set}" = set; then :
        11398  +  enableval=$enable_rtree; enable_rtree=yes
        11399  +else
        11400  +  enable_rtree=no
        11401  +fi
        11402  +
        11403  +if test "${enable_rtree}" = "yes" ; then
        11404  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_RTREE"
        11405  +fi
 11225  11406   
 11226  11407   #########
 11227  11408   # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter
 11228  11409   for option in $CFLAGS $CPPFLAGS
 11229  11410   do
 11230  11411     case $option in
 11231  11412       -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
................................................................................
 11804  11985   test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 11805  11986   
 11806  11987   cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 11807  11988   # Save the log message, to keep $0 and so on meaningful, and to
 11808  11989   # report actual input values of CONFIG_FILES etc. instead of their
 11809  11990   # values after options handling.
 11810  11991   ac_log="
 11811         -This file was extended by sqlite $as_me 3.8.12, which was
        11992  +This file was extended by sqlite $as_me 3.9.0, which was
 11812  11993   generated by GNU Autoconf 2.69.  Invocation command line was
 11813  11994   
 11814  11995     CONFIG_FILES    = $CONFIG_FILES
 11815  11996     CONFIG_HEADERS  = $CONFIG_HEADERS
 11816  11997     CONFIG_LINKS    = $CONFIG_LINKS
 11817  11998     CONFIG_COMMANDS = $CONFIG_COMMANDS
 11818  11999     $ $0 $@
................................................................................
 11870  12051   
 11871  12052   Report bugs to the package provider."
 11872  12053   
 11873  12054   _ACEOF
 11874  12055   cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 11875  12056   ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 11876  12057   ac_cs_version="\\
 11877         -sqlite config.status 3.8.12
        12058  +sqlite config.status 3.9.0
 11878  12059   configured by $0, generated by GNU Autoconf 2.69,
 11879  12060     with options \\"\$ac_cs_config\\"
 11880  12061   
 11881  12062   Copyright (C) 2012 Free Software Foundation, Inc.
 11882  12063   This config.status script is free software; the Free Software Foundation
 11883  12064   gives unlimited permission to copy, distribute and modify it."
 11884  12065   

Changes to configure.ac.

   555    555         [use_loadextension=$enableval],[use_loadextension=yes])
   556    556   if test "${use_loadextension}" = "yes" ; then
   557    557     OPT_FEATURE_FLAGS=""
   558    558     AC_SEARCH_LIBS(dlopen, dl)
   559    559   else
   560    560     OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
   561    561   fi
          562  +
          563  +#########
          564  +# See whether we should enable Full Text Search extensions
          565  +AC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3],
          566  +      [Enable the FTS3 extension]),
          567  +      [enable_fts3=yes],[enable_fts3=no])
          568  +if test "${enable_fts3}" = "yes" ; then
          569  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS3"
          570  +fi
          571  +AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4],
          572  +      [Enable the FTS4 extension]),
          573  +      [enable_fts4=yes],[enable_fts4=no])
          574  +if test "${enable_fts4}" = "yes" ; then
          575  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS4"
          576  +  AC_SEARCH_LIBS([log],[m])
          577  +fi
          578  +AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5],
          579  +      [Enable the FTS5 extension]),
          580  +      [enable_fts5=yes],[enable_fts5=no])
          581  +if test "${enable_fts5}" = "yes" ; then
          582  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS5"
          583  +  AC_SEARCH_LIBS([log],[m])
          584  +fi
          585  +
          586  +#########
          587  +# See whether we should enable JSON1
          588  +AC_ARG_ENABLE(json1, AC_HELP_STRING([--enable-json1],
          589  +      [Enable the JSON1 extension]),
          590  +      [enable_json1=yes],[enable_json1=no])
          591  +if test "${enable_json1}" = "yes" ; then
          592  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_JSON1"
          593  +fi
          594  +
          595  +#########
          596  +# See whether we should enable RTREE
          597  +AC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree],
          598  +      [Enable the RTREE extension]),
          599  +      [enable_rtree=yes],[enable_rtree=no])
          600  +if test "${enable_rtree}" = "yes" ; then
          601  +  OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_RTREE"
          602  +fi
   562    603   
   563    604   #########
   564    605   # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter
   565    606   for option in $CFLAGS $CPPFLAGS
   566    607   do
   567    608     case $option in
   568    609       -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;

Changes to ext/fts5/fts5_aux.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   */
    13     13   
    14     14   
    15     15   #include "fts5Int.h"
    16         -#include <math.h>
           16  +#include <math.h>                 /* amalgamator: keep */
    17     17   
    18     18   /*
    19     19   ** Object used to iterate through all "coalesced phrase instances" in 
    20     20   ** a single column of the current row. If the phrase instances in the
    21     21   ** column being considered do not overlap, this object simply iterates
    22     22   ** through them. Or, if they do overlap (share one or more tokens in
    23     23   ** common), each set of overlapping instances is treated as a single

Changes to ext/fts5/fts5_expr.c.

    28     28   
    29     29   /*
    30     30   ** Functions generated by lemon from fts5parse.y.
    31     31   */
    32     32   void *sqlite3Fts5ParserAlloc(void *(*mallocProc)(u64));
    33     33   void sqlite3Fts5ParserFree(void*, void (*freeProc)(void*));
    34     34   void sqlite3Fts5Parser(void*, int, Fts5Token, Fts5Parse*);
           35  +#ifndef NDEBUG
           36  +#include <stdio.h>
           37  +void sqlite3Fts5ParserTrace(FILE*, char*);
           38  +#endif
           39  +
    35     40   
    36     41   struct Fts5Expr {
    37     42     Fts5Index *pIndex;
    38     43     Fts5ExprNode *pRoot;
    39     44     int bDesc;                      /* Iterate in descending rowid order */
    40     45     int nPhrase;                    /* Number of phrases in expression */
    41     46     Fts5ExprPhrase **apExprPhrase;  /* Pointers to phrase objects */
................................................................................
  2271   2276     int rc = SQLITE_OK;
  2272   2277     void *pCtx = (void*)pGlobal;
  2273   2278   
  2274   2279     for(i=0; rc==SQLITE_OK && i<(sizeof(aFunc) / sizeof(aFunc[0])); i++){
  2275   2280       struct Fts5ExprFunc *p = &aFunc[i];
  2276   2281       rc = sqlite3_create_function(db, p->z, -1, SQLITE_UTF8, pCtx, p->x, 0, 0);
  2277   2282     }
         2283  +
         2284  +  /* Avoid a warning indicating that sqlite3Fts5ParserTrace() is unused */
         2285  +#ifndef NDEBUG
         2286  +  (void)sqlite3Fts5ParserTrace;
         2287  +#endif
  2278   2288   
  2279   2289     return rc;
  2280   2290   }
  2281   2291   
  2282   2292   /*
  2283   2293   ** Return the number of phrases in expression pExpr.
  2284   2294   */

Changes to ext/fts5/fts5_main.c.

  2389   2389     int nArg,                       /* Number of args */
  2390   2390     sqlite3_value **apVal           /* Function arguments */
  2391   2391   ){
  2392   2392     assert( nArg==0 );
  2393   2393     sqlite3_result_text(pCtx, "--FTS5-SOURCE-ID--", -1, SQLITE_TRANSIENT);
  2394   2394   }
  2395   2395   
  2396         -#ifdef _WIN32
  2397         -__declspec(dllexport)
  2398         -#endif
  2399         -int sqlite3_fts5_init(
  2400         -  sqlite3 *db,
  2401         -  char **pzErrMsg,
  2402         -  const sqlite3_api_routines *pApi
  2403         -){
         2396  +static int fts5Init(sqlite3 *db){
  2404   2397     static const sqlite3_module fts5Mod = {
  2405   2398       /* iVersion      */ 2,
  2406   2399       /* xCreate       */ fts5CreateMethod,
  2407   2400       /* xConnect      */ fts5ConnectMethod,
  2408   2401       /* xBestIndex    */ fts5BestIndexMethod,
  2409   2402       /* xDisconnect   */ fts5DisconnectMethod,
  2410   2403       /* xDestroy      */ fts5DestroyMethod,
................................................................................
  2426   2419       /* xRelease      */ fts5ReleaseMethod,
  2427   2420       /* xRollbackTo   */ fts5RollbackToMethod,
  2428   2421     };
  2429   2422   
  2430   2423     int rc;
  2431   2424     Fts5Global *pGlobal = 0;
  2432   2425   
  2433         -  SQLITE_EXTENSION_INIT2(pApi);
  2434         -
  2435   2426     pGlobal = (Fts5Global*)sqlite3_malloc(sizeof(Fts5Global));
  2436   2427     if( pGlobal==0 ){
  2437   2428       rc = SQLITE_NOMEM;
  2438   2429     }else{
  2439   2430       void *p = (void*)pGlobal;
  2440   2431       memset(pGlobal, 0, sizeof(Fts5Global));
  2441   2432       pGlobal->db = db;
................................................................................
  2459   2450             db, "fts5_source_id", 0, SQLITE_UTF8, p, fts5SourceIdFunc, 0, 0
  2460   2451         );
  2461   2452       }
  2462   2453     }
  2463   2454     return rc;
  2464   2455   }
  2465   2456   
         2457  +/*
         2458  +** The following functions are used to register the module with SQLite. If
         2459  +** this module is being built as part of the SQLite core (SQLITE_CORE is
         2460  +** defined), then sqlite3_open() will call sqlite3Fts5Init() directly.
         2461  +**
         2462  +** Or, if this module is being built as a loadable extension, 
         2463  +** sqlite3Fts5Init() is omitted and the two standard entry points
         2464  +** sqlite3_fts_init() and sqlite3_fts5_init() defined instead.
         2465  +*/
         2466  +#ifndef SQLITE_CORE
  2466   2467   #ifdef _WIN32
  2467   2468   __declspec(dllexport)
  2468   2469   #endif
  2469   2470   int sqlite3_fts_init(
  2470   2471     sqlite3 *db,
  2471   2472     char **pzErrMsg,
  2472   2473     const sqlite3_api_routines *pApi
  2473   2474   ){
  2474         -  return sqlite3_fts5_init(db, pzErrMsg, pApi);
         2475  +  SQLITE_EXTENSION_INIT2(pApi);
         2476  +  (void)pzErrMsg;  /* Unused parameter */
         2477  +  return fts5Init(db);
  2475   2478   }
  2476   2479   
         2480  +#ifdef _WIN32
         2481  +__declspec(dllexport)
         2482  +#endif
         2483  +int sqlite3_fts5_init(
         2484  +  sqlite3 *db,
         2485  +  char **pzErrMsg,
         2486  +  const sqlite3_api_routines *pApi
         2487  +){
         2488  +  SQLITE_EXTENSION_INIT2(pApi);
         2489  +  (void)pzErrMsg;  /* Unused parameter */
         2490  +  return fts5Init(db);
         2491  +}
         2492  +#else
         2493  +int sqlite3Fts5Init(sqlite3 *db){
         2494  +  return fts5Init(db);
         2495  +}
         2496  +#endif
  2477   2497   

Changes to ext/fts5/fts5_tcl.c.

   972    972   
   973    973   static int f5tTokenHash(
   974    974     void * clientData,
   975    975     Tcl_Interp *interp,
   976    976     int objc,
   977    977     Tcl_Obj *CONST objv[]
   978    978   ){
   979         -  int bOld = sqlite3_fts5_may_be_corrupt;
   980    979     char *z;
   981    980     int n;
   982    981     unsigned int iVal;
   983    982     int nSlot;
   984    983   
   985    984     if( objc!=3 ){
   986    985       Tcl_WrongNumArgs(interp, 1, objv, "NSLOT TOKEN");

Changes to ext/fts5/fts5parse.y.

    63     63   %left OR.
    64     64   %left AND.
    65     65   %left NOT.
    66     66   %left TERM.
    67     67   %left COLON.
    68     68   
    69     69   input ::= expr(X). { sqlite3Fts5ParseFinished(pParse, X); }
           70  +%destructor input { (void)pParse; }
    70     71   
    71     72   %type cnearset    {Fts5ExprNode*}
    72     73   %type expr        {Fts5ExprNode*}
    73     74   %type exprlist    {Fts5ExprNode*}
    74     75   %destructor cnearset { sqlite3Fts5ParseNodeFree($$); }
    75     76   %destructor expr     { sqlite3Fts5ParseNodeFree($$); }
    76     77   %destructor exprlist { sqlite3Fts5ParseNodeFree($$); }

Changes to ext/fts5/test/fts5_common.tcl.

    13     13   if {![info exists testdir]} {
    14     14     set testdir [file join [file dirname [info script]] .. .. .. test]
    15     15   }
    16     16   source $testdir/tester.tcl
    17     17   
    18     18   catch { 
    19     19     sqlite3_fts5_may_be_corrupt 0 
    20         -  append G(perm:dbconfig) "; load_static_extension \$::dbhandle fts5"
    21     20     reset_db
    22     21   }
    23     22   
    24     23   proc fts5_test_poslist {cmd} {
    25     24     set res [list]
    26     25     for {set i 0} {$i < [$cmd xInstCount]} {incr i} {
    27     26       lappend res [string map {{ } .} [$cmd xInst $i]]

Changes to ext/fts5/test/fts5fault6.test.

   280    280   
   281    281   #-------------------------------------------------------------------------
   282    282   catch { db close }
   283    283   breakpoint
   284    284   do_faultsim_test 6 -faults oom* -prep {
   285    285     sqlite_orig db test.db
   286    286     sqlite3_db_config_lookaside db 0 0 0
   287         -} -body {
   288         -  load_static_extension db fts5
   289    287   } -test {
   290    288     faultsim_test_result {0 {}} {1 {initialization of fts5 failed: }}
   291    289     if {$testrc==0} {
   292    290       db eval { CREATE VIRTUAL TABLE temp.t1 USING fts5(x) }
   293    291     }
   294    292     db close
   295    293   }
   296    294   finish_test
   297    295   

Changes to ext/fts5/tool/mkfts5c.tcl.

     3      3   exec tclsh "$0" "$@"
     4      4   
     5      5   set srcdir [file dirname [file dirname [info script]]]
     6      6   set G(src) [string map [list %dir% $srcdir] {
     7      7     %dir%/fts5.h
     8      8     %dir%/fts5Int.h
     9      9     fts5parse.h
           10  +  fts5parse.c
    10     11     %dir%/fts5_aux.c
    11     12     %dir%/fts5_buffer.c
    12     13     %dir%/fts5_config.c
    13     14     %dir%/fts5_expr.c
    14     15     %dir%/fts5_hash.c
    15     16     %dir%/fts5_index.c
    16     17     %dir%/fts5_main.c
    17     18     %dir%/fts5_storage.c
    18     19     %dir%/fts5_tokenize.c
    19     20     %dir%/fts5_unicode2.c
    20     21     %dir%/fts5_varint.c
    21     22     %dir%/fts5_vocab.c
    22         -  fts5parse.c
    23     23   }]
    24     24   
    25     25   set G(hdr) {
    26     26   
    27         -#if !defined(SQLITE_TEST) || defined(SQLITE_ENABLE_FTS5) 
           27  +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) 
    28     28   
    29     29   #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) 
    30     30   # define NDEBUG 1
    31     31   #endif
    32     32   #if defined(NDEBUG) && defined(SQLITE_DEBUG)
    33     33   # undef NDEBUG
    34     34   #endif
    35     35   
    36     36   }
    37     37   
    38     38   set G(footer) {
    39     39       
    40         -#endif /* !defined(SQLITE_TEST) || defined(SQLITE_ENABLE_FTS5) */
           40  +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */
    41     41   }
    42     42   
    43     43   #-------------------------------------------------------------------------
    44     44   # Read and return the entire contents of text file $zFile from disk.
    45     45   #
    46     46   proc readfile {zFile} {
    47     47     set fd [open $zFile]
................................................................................
    83     83     set sub_map [list --FTS5-SOURCE-ID-- [fts5_source_id $::srcdir]]
    84     84     if {$zTail=="fts5parse.c"} {
    85     85       lappend sub_map yy fts5yy YY fts5YY TOKEN FTS5TOKEN
    86     86     }
    87     87   
    88     88     foreach line [split $data "\n"] {
    89     89       if {[regexp {^#include.*fts5} $line]} continue
    90         -    if {[regexp {^(const )?[a-zA-Z][a-zA-Z0-9]* [*]?sqlite3Fts5} $line]} {
           90  +    if { ![regexp { sqlite3Fts5Init\(} $line] 
           91  +       && [regexp {^(const )?[a-zA-Z][a-zA-Z0-9]* [*]?sqlite3Fts5} $line]
           92  +    } {
    91     93         set line "static $line"
    92     94       }
    93     95       set line [string map $sub_map $line]
    94     96       puts $G(fd) $line
    95     97     }
    96     98   }
    97     99   
................................................................................
   103    105     }
   104    106   }
   105    107   
   106    108   
   107    109   fts5c_init fts5.c
   108    110   foreach f $G(src) { fts5c_printfile $f }
   109    111   fts5c_close
   110         -
   111         -
   112         -
   113         -

Changes to ext/misc/json1.c.

    17     17   **
    18     18   ** For the time being, all JSON is stored as pure text.  (We might add
    19     19   ** a JSONB type in the future which stores a binary encoding of JSON in
    20     20   ** a BLOB, but there is no support for JSONB in the current implementation.
    21     21   ** This implementation parses JSON text at 250 MB/s, so it is hard to see
    22     22   ** how JSONB might improve on that.)
    23     23   */
           24  +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1)
    24     25   #if !defined(_SQLITEINT_H_)
    25     26   #include "sqlite3ext.h"
    26     27   #endif
    27     28   SQLITE_EXTENSION_INIT1
    28     29   #include <assert.h>
    29     30   #include <string.h>
    30     31   #include <ctype.h>
................................................................................
  2003   2004     char **pzErrMsg, 
  2004   2005     const sqlite3_api_routines *pApi
  2005   2006   ){
  2006   2007     SQLITE_EXTENSION_INIT2(pApi);
  2007   2008     (void)pzErrMsg;  /* Unused parameter */
  2008   2009     return sqlite3Json1Init(db);
  2009   2010   }
         2011  +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1) */

Changes to ext/rbu/sqlite3rbu.c.

    84     84   #include <string.h>
    85     85   #include <stdio.h>
    86     86   
    87     87   #include "sqlite3.h"
    88     88   
    89     89   #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
    90     90   #include "sqlite3rbu.h"
           91  +
           92  +#if defined(_WIN32_WCE)
           93  +#include "windows.h"
           94  +#endif
    91     95   
    92     96   /* Maximum number of prepared UPDATE statements held by this module */
    93     97   #define SQLITE_RBU_UPDATE_CACHESIZE 16
    94     98   
    95     99   /*
    96    100   ** Swap two objects of type TYPE.
    97    101   */
................................................................................
  2378   2382     assert( p->rc==SQLITE_OK );
  2379   2383     p->rc = pReal->pMethods->xLock(pReal, SQLITE_LOCK_SHARED);
  2380   2384     if( p->rc==SQLITE_OK ){
  2381   2385       p->rc = pReal->pMethods->xLock(pReal, SQLITE_LOCK_EXCLUSIVE);
  2382   2386     }
  2383   2387   }
  2384   2388   
         2389  +#if defined(_WIN32_WCE)
         2390  +static LPWSTR rbuWinUtf8ToUnicode(const char *zFilename){
         2391  +  int nChar;
         2392  +  LPWSTR zWideFilename;
         2393  +
         2394  +  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0);
         2395  +  if( nChar==0 ){
         2396  +    return 0;
         2397  +  }
         2398  +  zWideFilename = sqlite3_malloc( nChar*sizeof(zWideFilename[0]) );
         2399  +  if( zWideFilename==0 ){
         2400  +    return 0;
         2401  +  }
         2402  +  memset(zWideFilename, 0, nChar*sizeof(zWideFilename[0]));
         2403  +  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename,
         2404  +                                nChar);
         2405  +  if( nChar==0 ){
         2406  +    sqlite3_free(zWideFilename);
         2407  +    zWideFilename = 0;
         2408  +  }
         2409  +  return zWideFilename;
         2410  +}
         2411  +#endif
         2412  +
  2385   2413   /*
  2386   2414   ** The RBU handle is currently in RBU_STAGE_OAL state, with a SHARED lock
  2387   2415   ** on the database file. This proc moves the *-oal file to the *-wal path,
  2388   2416   ** then reopens the database file (this time in vanilla, non-oal, WAL mode).
  2389   2417   ** If an error occurs, leave an error code and error message in the rbu 
  2390   2418   ** handle.
  2391   2419   */
................................................................................
  2412   2440         rbuFileSuffix3(zBase, zWal);
  2413   2441         rbuFileSuffix3(zBase, zOal);
  2414   2442   
  2415   2443         /* Re-open the databases. */
  2416   2444         rbuObjIterFinalize(&p->objiter);
  2417   2445         sqlite3_close(p->dbMain);
  2418   2446         sqlite3_close(p->dbRbu);
         2447  +      p->dbMain = 0;
         2448  +      p->dbRbu = 0;
         2449  +
         2450  +#if defined(_WIN32_WCE)
         2451  +      {
         2452  +        LPWSTR zWideOal;
         2453  +        LPWSTR zWideWal;
         2454  +
         2455  +        zWideOal = rbuWinUtf8ToUnicode(zOal);
         2456  +        if( zWideOal ){
         2457  +          zWideWal = rbuWinUtf8ToUnicode(zWal);
         2458  +          if( zWideWal ){
         2459  +            if( MoveFileW(zWideOal, zWideWal) ){
         2460  +              p->rc = SQLITE_OK;
         2461  +            }else{
         2462  +              p->rc = SQLITE_IOERR;
         2463  +            }
         2464  +            sqlite3_free(zWideWal);
         2465  +          }else{
         2466  +            p->rc = SQLITE_IOERR_NOMEM;
         2467  +          }
         2468  +          sqlite3_free(zWideOal);
         2469  +        }else{
         2470  +          p->rc = SQLITE_IOERR_NOMEM;
         2471  +        }
         2472  +      }
         2473  +#else
  2419   2474         p->rc = rename(zOal, zWal) ? SQLITE_IOERR : SQLITE_OK;
         2475  +#endif
         2476  +
  2420   2477         if( p->rc==SQLITE_OK ){
  2421         -        p->dbMain = 0;
  2422         -        p->dbRbu = 0;
  2423   2478           rbuOpenDatabase(p);
  2424   2479           rbuSetupCheckpoint(p, 0);
  2425   2480         }
  2426   2481       }
  2427   2482     }
  2428   2483   
  2429   2484     sqlite3_free(zWal);

Changes to main.mk.

     7      7   #                  "configure.in" script.
     8      8   #
     9      9   # BCC              C Compiler and options for use in building executables that
    10     10   #                  will run on the platform that is doing the build.
    11     11   #
    12     12   # THREADLIB        Specify any extra linker options needed to make the library
    13     13   #                  thread safe
           14  +#
           15  +# LIBS             Extra libraries options
    14     16   #
    15     17   # OPTS             Extra compiler command-line options.
    16     18   #
    17     19   # EXE              The suffix to add to executable files.  ".exe" for windows
    18     20   #                  and "" for Unix.
    19     21   #
    20     22   # TCC              C Compiler and options for use in building executables that 
................................................................................
    45     47   # This is how we compile
    46     48   #
    47     49   TCCX =  $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) 
    48     50   TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3
    49     51   TCCX += -I$(TOP)/ext/async -I$(TOP)/ext/userauth
    50     52   TCCX += -I$(TOP)/ext/session
    51     53   TCCX += -I$(TOP)/ext/fts5
           54  +THREADLIB += $(LIBS)
    52     55   
    53     56   # Object files for the SQLite library.
    54     57   #
    55     58   LIBOBJ+= vdbe.o parse.o \
    56     59            alter.o analyze.o attach.o auth.o \
    57     60            backup.o bitvec.o btmutex.o btree.o build.o \
    58         -         callback.o complete.o ctime.o date.o dbstat.o delete.o expr.o fault.o fkey.o \
           61  +         callback.o complete.o ctime.o date.o dbstat.o delete.o expr.o \
           62  +	 fault.o fkey.o \
    59     63            fts3.o fts3_aux.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \
    60     64            fts3_snippet.o fts3_tokenizer.o fts3_tokenizer1.o \
    61     65            fts3_tokenize_vtab.o \
    62     66   	 fts3_unicode.o fts3_unicode2.o \
    63         -         fts3_write.o func.o global.o hash.o \
    64         -         icu.o insert.o journal.o legacy.o loadext.o \
           67  +         fts3_write.o fts5.o func.o global.o hash.o \
           68  +         icu.o insert.o journal.o json1.o legacy.o loadext.o \
    65     69            main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
    66     70            memjournal.o \
    67     71            mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
    68     72            notify.o opcodes.o os.o os_unix.o os_win.o \
    69     73            pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
    70     74            random.o resolve.o rowset.o rtree.o select.o sqlite3rbu.o status.o \
    71     75            table.o threads.o tokenize.o treeview.o trigger.o \
................................................................................
   226    230     $(TOP)/ext/rtree/rtree.c
   227    231   SRC += \
   228    232     $(TOP)/ext/session/sqlite3session.c \
   229    233     $(TOP)/ext/session/sqlite3session.h
   230    234   SRC += \
   231    235     $(TOP)/ext/userauth/userauth.c \
   232    236     $(TOP)/ext/userauth/sqlite3userauth.h 
   233         -
   234    237   SRC += \
   235    238     $(TOP)/ext/rbu/sqlite3rbu.c \
   236    239     $(TOP)/ext/rbu/sqlite3rbu.h
          240  +SRC += \
          241  +  $(TOP)/ext/misc/json1.c
   237    242   
   238    243   
   239    244   # FTS5 things
   240    245   #
   241    246   FTS5_HDR = \
   242    247      $(TOP)/ext/fts5/fts5.h \
   243    248      $(TOP)/ext/fts5/fts5Int.h \
................................................................................
   322    327   TESTSRC += \
   323    328     $(TOP)/ext/misc/amatch.c \
   324    329     $(TOP)/ext/misc/closure.c \
   325    330     $(TOP)/ext/misc/eval.c \
   326    331     $(TOP)/ext/misc/fileio.c \
   327    332     $(TOP)/ext/misc/fuzzer.c \
   328    333     $(TOP)/ext/misc/ieee754.c \
   329         -  $(TOP)/ext/misc/json1.c \
   330    334     $(TOP)/ext/misc/nextchar.c \
   331    335     $(TOP)/ext/misc/percentile.c \
   332    336     $(TOP)/ext/misc/regexp.c \
   333    337     $(TOP)/ext/misc/series.c \
   334    338     $(TOP)/ext/misc/spellfix.c \
   335    339     $(TOP)/ext/misc/totype.c \
   336    340     $(TOP)/ext/misc/wholenumber.c \
   337    341     $(TOP)/ext/misc/vfslog.c \
   338    342     $(TOP)/ext/fts5/fts5_tcl.c \
   339         -  $(TOP)/ext/fts5/fts5_test_mi.c \
   340         -  fts5.c
          343  +  $(TOP)/ext/fts5/fts5_test_mi.c
   341    344   
   342    345   
   343    346   #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
   344    347   #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
   345    348   
   346    349   TESTSRC2 = \
   347    350     $(TOP)/src/attach.c \
................................................................................
   382    385     $(TOP)/ext/fts3/fts3.c \
   383    386     $(TOP)/ext/fts3/fts3_aux.c \
   384    387     $(TOP)/ext/fts3/fts3_expr.c \
   385    388     $(TOP)/ext/fts3/fts3_tokenizer.c \
   386    389     $(TOP)/ext/fts3/fts3_write.c \
   387    390     $(TOP)/ext/async/sqlite3async.c \
   388    391     $(TOP)/ext/session/sqlite3session.c \
   389         -  $(TOP)/ext/session/test_session.c
          392  +  $(TOP)/ext/session/test_session.c \
          393  +  $(FTS5_SRC)
   390    394   
   391    395   # Header files used by all library source files.
   392    396   #
   393    397   HDR = \
   394    398      $(TOP)/src/btree.h \
   395    399      $(TOP)/src/btreeInt.h \
   396    400      $(TOP)/src/hash.h \
................................................................................
   454    458   #
   455    459   FUZZDATA = \
   456    460     $(TOP)/test/fuzzdata1.db \
   457    461     $(TOP)/test/fuzzdata2.db \
   458    462     $(TOP)/test/fuzzdata3.db \
   459    463     $(TOP)/test/fuzzdata4.db
   460    464   
   461         -# Extra arguments for including json1 in the build of tools
   462         -#
   463         -JSON1_DEP = $(TOP)/ext/misc/json1.c sqlite3ext.h
   464         -JSON1_OPT = -DSQLITE_SHELL_JSON1 -DSQLITE_CORE
   465         -JSON1_SRC = $(TOP)/ext/misc/json1.c
   466         -
   467    465   # Standard options to testfixture
   468    466   #
   469    467   TESTOPTS = --verbose=file --output=test-out.txt
          468  +
          469  +# Extra compiler options for various shell tools
          470  +#
          471  +SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
          472  +FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
          473  +FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1
   470    474   
   471    475   # This is the default Makefile target.  The objects listed here
   472    476   # are what get build when you type just "make" with no arguments.
   473    477   #
   474    478   all:	sqlite3.h libsqlite3.a sqlite3$(EXE)
   475    479   
   476    480   libsqlite3.a:	$(LIBOBJ)
   477    481   	$(AR) libsqlite3.a $(LIBOBJ)
   478    482   	$(RANLIB) libsqlite3.a
   479    483   
   480         -sqlite3$(EXE):	$(TOP)/src/shell.c libsqlite3.a sqlite3.h $(JSON1_DEP)
   481         -	$(TCCX) $(READLINE_FLAGS) $(JSON1_OPT) -o sqlite3$(EXE)  \
   482         -		$(TOP)/src/shell.c $(JSON1_SRC) \
   483         -		libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
          484  +sqlite3$(EXE):	$(TOP)/src/shell.c libsqlite3.a sqlite3.h
          485  +	$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
          486  +		$(TOP)/src/shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
   484    487   
   485    488   sqldiff$(EXE):	$(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
   486    489   	$(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
   487    490   		$(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
   488    491   
   489         -fuzzershell$(EXE):	$(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h $(JSON1_DEP)
          492  +fuzzershell$(EXE):	$(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
   490    493   	$(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
   491         -	  $(JSON1_OPT)	$(TOP)/tool/fuzzershell.c $(JSON1_SRC) sqlite3.c \
          494  +	  $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \
   492    495   	  $(TLIBS) $(THREADLIB)
   493    496   
   494         -fuzzcheck$(EXE):	$(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h $(JSON1_DEP)
          497  +fuzzcheck$(EXE):	$(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h
   495    498   	$(TCCX) -o fuzzcheck$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
   496         -		-DSQLITE_ENABLE_MEMSYS5 $(JSON1_OPT) \
   497         -		$(TOP)/test/fuzzcheck.c $(JSON1_SRC) sqlite3.c $(TLIBS) $(THREADLIB)
          499  +		-DSQLITE_ENABLE_MEMSYS5 $(FUZZCHECK_OPT) \
          500  +		$(TOP)/test/fuzzcheck.c sqlite3.c $(TLIBS) $(THREADLIB)
   498    501   
   499    502   mptester$(EXE):	sqlite3.c $(TOP)/mptest/mptest.c
   500    503   	$(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
   501    504   		$(TLIBS) $(THREADLIB)
   502    505   
   503    506   MPTEST1=./mptester$(EXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
   504    507   MPTEST2=./mptester$(EXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
................................................................................
   518    521   
   519    522   # This target creates a directory named "tsrc" and fills it with
   520    523   # copies of all of the C source code and header files needed to
   521    524   # build on the target system.  Some of the C source code and header
   522    525   # files are automatically generated.  This target takes care of
   523    526   # all that automatic generation.
   524    527   #
   525         -target_source:	$(SRC) $(TOP)/tool/vdbe-compress.tcl
          528  +target_source:	$(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
   526    529   	rm -rf tsrc
   527    530   	mkdir tsrc
   528    531   	cp -f $(SRC) tsrc
   529    532   	rm tsrc/sqlite.h.in tsrc/parse.y
   530    533   	tclsh $(TOP)/tool/vdbe-compress.tcl $(OPTS) <tsrc/vdbe.c >vdbe.new
   531    534   	mv vdbe.new tsrc/vdbe.c
          535  +	cp fts5.c fts5.h tsrc
   532    536   	touch target_source
   533    537   
   534    538   sqlite3.c:	target_source $(TOP)/tool/mksqlite3c.tcl
   535    539   	tclsh $(TOP)/tool/mksqlite3c.tcl
   536    540   	cp tsrc/shell.c tsrc/sqlite3ext.h .
   537    541   	cp $(TOP)/ext/session/sqlite3session.h .
   538    542   	echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
................................................................................
   672    676   
   673    677   fts3_unicode2.o:	$(TOP)/ext/fts3/fts3_unicode2.c $(HDR) $(EXTHDR)
   674    678   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_unicode2.c
   675    679   
   676    680   fts3_write.o:	$(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
   677    681   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
   678    682   
          683  +fts5.o:	fts5.c
          684  +	$(TCCX) -DSQLITE_CORE -c fts5.c
          685  +
          686  +json1.o:	$(TOP)/ext/misc/json1.c
          687  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
          688  +
   679    689   rtree.o:	$(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
   680    690   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
          691  +
          692  +
   681    693   
   682    694   fts5parse.c:	$(TOP)/ext/fts5/fts5parse.y lemon 
   683    695   	cp $(TOP)/ext/fts5/fts5parse.y .
   684    696   	rm -f fts5parse.h
   685    697   	./lemon $(OPTS) fts5parse.y
   686    698   
   687    699   fts5parse.h: fts5parse.c
................................................................................
   723    735   TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE 
   724    736   
   725    737   testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
   726    738   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
   727    739   		$(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c                \
   728    740   		-o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
   729    741   
   730         -amalgamation-testfixture$(EXE): sqlite3.c fts5.c $(TESTSRC) $(TOP)/src/tclsqlite.c  \
          742  +amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c  \
   731    743   				$(TOP)/ext/session/test_session.c
   732    744   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
   733         -		$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts5.c           \
          745  +		$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c                  \
   734    746   		$(TOP)/ext/session/test_session.c                            \
   735    747   		-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
   736    748   
   737    749   fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
   738    750   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
   739    751   	-DSQLITE_ENABLE_FTS3=1                                               \
   740    752   		$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c       \

Changes to src/ctime.c.

    91     91     "ENABLE_FTS3",
    92     92   #endif
    93     93   #if SQLITE_ENABLE_FTS3_PARENTHESIS
    94     94     "ENABLE_FTS3_PARENTHESIS",
    95     95   #endif
    96     96   #if SQLITE_ENABLE_FTS4
    97     97     "ENABLE_FTS4",
           98  +#endif
           99  +#if SQLITE_ENABLE_FTS5
          100  +  "ENABLE_FTS5",
    98    101   #endif
    99    102   #if SQLITE_ENABLE_ICU
   100    103     "ENABLE_ICU",
   101    104   #endif
   102    105   #if SQLITE_ENABLE_IOTRACE
   103    106     "ENABLE_IOTRACE",
          107  +#endif
          108  +#if SQLITE_ENABLE_JSON1
          109  +  "ENABLE_JSON1",
   104    110   #endif
   105    111   #if SQLITE_ENABLE_LOAD_EXTENSION
   106    112     "ENABLE_LOAD_EXTENSION",
   107    113   #endif
   108    114   #if SQLITE_ENABLE_LOCKING_STYLE
   109    115     "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE),
   110    116   #endif

Changes to src/main.c.

    21     21   #endif
    22     22   #ifdef SQLITE_ENABLE_RTREE
    23     23   # include "rtree.h"
    24     24   #endif
    25     25   #ifdef SQLITE_ENABLE_ICU
    26     26   # include "sqliteicu.h"
    27     27   #endif
           28  +#ifdef SQLITE_ENABLE_JSON1
           29  +int sqlite3Json1Init(sqlite3*);
           30  +#endif
           31  +#ifdef SQLITE_ENABLE_FTS5
           32  +int sqlite3Fts5Init(sqlite3*);
           33  +#endif
    28     34   
    29     35   #ifndef SQLITE_AMALGAMATION
    30     36   /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
    31     37   ** contains the text of SQLITE_VERSION macro. 
    32     38   */
    33     39   const char sqlite3_version[] = SQLITE_VERSION;
    34     40   #endif
................................................................................
  2889   2895   #ifdef SQLITE_ENABLE_FTS2
  2890   2896     if( !db->mallocFailed && rc==SQLITE_OK ){
  2891   2897       extern int sqlite3Fts2Init(sqlite3*);
  2892   2898       rc = sqlite3Fts2Init(db);
  2893   2899     }
  2894   2900   #endif
  2895   2901   
  2896         -#ifdef SQLITE_ENABLE_FTS3
         2902  +#ifdef SQLITE_ENABLE_FTS3 /* automatically defined by SQLITE_ENABLE_FTS4 */
  2897   2903     if( !db->mallocFailed && rc==SQLITE_OK ){
  2898   2904       rc = sqlite3Fts3Init(db);
  2899   2905     }
  2900   2906   #endif
         2907  +
         2908  +#ifdef SQLITE_ENABLE_FTS5
         2909  +  if( !db->mallocFailed && rc==SQLITE_OK ){
         2910  +    rc = sqlite3Fts5Init(db);
         2911  +  }
         2912  +#endif
  2901   2913   
  2902   2914   #ifdef SQLITE_ENABLE_ICU
  2903   2915     if( !db->mallocFailed && rc==SQLITE_OK ){
  2904   2916       rc = sqlite3IcuInit(db);
  2905   2917     }
  2906   2918   #endif
  2907   2919   
................................................................................
  2915   2927     if( !db->mallocFailed && rc==SQLITE_OK){
  2916   2928       rc = sqlite3DbstatRegister(db);
  2917   2929     }
  2918   2930   #endif
  2919   2931   
  2920   2932   #ifdef SQLITE_ENABLE_JSON1
  2921   2933     if( !db->mallocFailed && rc==SQLITE_OK){
  2922         -    extern int sqlite3Json1Init(sqlite3*);
  2923   2934       rc = sqlite3Json1Init(db);
  2924   2935     }
  2925   2936   #endif
  2926   2937   
  2927   2938     /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
  2928   2939     ** mode.  -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
  2929   2940     ** mode.  Doing nothing at all also makes NORMAL the default.

Changes to src/shell.c.

  4931   4931   #else
  4932   4932       fprintf(stderr,"%s: Error: no database filename specified\n", Argv0);
  4933   4933       return 1;
  4934   4934   #endif
  4935   4935     }
  4936   4936     data.out = stdout;
  4937   4937   
  4938         -#ifdef SQLITE_SHELL_JSON1
  4939         -  {
  4940         -    extern int sqlite3_json_init(sqlite3*);
  4941         -    sqlite3_auto_extension((void(*)(void))sqlite3_json_init);
  4942         -  }
  4943         -#endif
  4944         -
  4945   4938     /* Go ahead and open the database file if it already exists.  If the
  4946   4939     ** file does not exist, delay opening it.  This prevents empty database
  4947   4940     ** files from being created if a user mistypes the database name argument
  4948   4941     ** to the sqlite command-line tool.
  4949   4942     */
  4950   4943     if( access(data.zDbFilename, 0)==0 ){
  4951   4944       open_db(&data, 0);

Changes to src/test1.c.

  6373   6373   ){
  6374   6374     extern int sqlite3_amatch_init(sqlite3*,char**,const sqlite3_api_routines*);
  6375   6375     extern int sqlite3_closure_init(sqlite3*,char**,const sqlite3_api_routines*);
  6376   6376     extern int sqlite3_eval_init(sqlite3*,char**,const sqlite3_api_routines*);
  6377   6377     extern int sqlite3_fileio_init(sqlite3*,char**,const sqlite3_api_routines*);
  6378   6378     extern int sqlite3_fuzzer_init(sqlite3*,char**,const sqlite3_api_routines*);
  6379   6379     extern int sqlite3_ieee_init(sqlite3*,char**,const sqlite3_api_routines*);
  6380         -  extern int sqlite3_json_init(sqlite3*,char**,const sqlite3_api_routines*);
  6381   6380     extern int sqlite3_nextchar_init(sqlite3*,char**,const sqlite3_api_routines*);
  6382   6381     extern int sqlite3_percentile_init(sqlite3*,char**,const sqlite3_api_routines*);
  6383   6382     extern int sqlite3_regexp_init(sqlite3*,char**,const sqlite3_api_routines*);
  6384   6383     extern int sqlite3_series_init(sqlite3*,char**,const sqlite3_api_routines*);
  6385   6384     extern int sqlite3_spellfix_init(sqlite3*,char**,const sqlite3_api_routines*);
  6386   6385     extern int sqlite3_totype_init(sqlite3*,char**,const sqlite3_api_routines*);
  6387   6386     extern int sqlite3_wholenumber_init(sqlite3*,char**,const sqlite3_api_routines*);
  6388         -  extern int sqlite3_fts5_init(sqlite3*,char**,const sqlite3_api_routines*);
  6389   6387     static const struct {
  6390   6388       const char *zExtName;
  6391   6389       int (*pInit)(sqlite3*,char**,const sqlite3_api_routines*);
  6392   6390     } aExtension[] = {
  6393   6391       { "amatch",                sqlite3_amatch_init               },
  6394   6392       { "closure",               sqlite3_closure_init              },
  6395   6393       { "eval",                  sqlite3_eval_init                 },
  6396         -#ifdef SQLITE_ENABLE_FTS5
  6397         -    { "fts5",                  sqlite3_fts5_init                 },
  6398         -#endif
  6399   6394       { "fileio",                sqlite3_fileio_init               },
  6400   6395       { "fuzzer",                sqlite3_fuzzer_init               },
  6401   6396       { "ieee754",               sqlite3_ieee_init                 },
  6402         -    { "json",                  sqlite3_json_init                 },
  6403   6397       { "nextchar",              sqlite3_nextchar_init             },
  6404   6398       { "percentile",            sqlite3_percentile_init           },
  6405   6399       { "regexp",                sqlite3_regexp_init               },
  6406   6400       { "series",                sqlite3_series_init               },
  6407   6401       { "spellfix",              sqlite3_spellfix_init             },
  6408   6402       { "totype",                sqlite3_totype_init               },
  6409   6403       { "wholenumber",           sqlite3_wholenumber_init          },
................................................................................
  6422   6416       for(i=0; i<ArraySize(aExtension); i++){
  6423   6417         if( strcmp(zName, aExtension[i].zExtName)==0 ) break;
  6424   6418       }
  6425   6419       if( i>=ArraySize(aExtension) ){
  6426   6420         Tcl_AppendResult(interp, "no such extension: ", zName, (char*)0);
  6427   6421         return TCL_ERROR;
  6428   6422       }
  6429         -    rc = aExtension[i].pInit(db, &zErrMsg, 0);
         6423  +    if( aExtension[i].pInit ){
         6424  +      rc = aExtension[i].pInit(db, &zErrMsg, 0);
         6425  +    }else{
         6426  +      rc = SQLITE_OK;
         6427  +    }
  6430   6428       if( rc!=SQLITE_OK || zErrMsg ){
  6431   6429         Tcl_AppendResult(interp, "initialization of ", zName, " failed: ", zErrMsg,
  6432   6430                          (char*)0);
  6433   6431         sqlite3_free(zErrMsg);
  6434   6432         return TCL_ERROR;
  6435   6433       }
  6436   6434     }

Changes to src/test_config.c.

   168    168   #endif
   169    169   
   170    170   #ifdef SQLITE_ENABLE_ATOMIC_WRITE
   171    171     Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY);
   172    172   #else
   173    173     Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY);
   174    174   #endif
          175  +
          176  +#ifdef SQLITE_ENABLE_JSON1
          177  +  Tcl_SetVar2(interp, "sqlite_options", "json1", "1", TCL_GLOBAL_ONLY);
          178  +#else
          179  +  Tcl_SetVar2(interp, "sqlite_options", "json1", "0", TCL_GLOBAL_ONLY);
          180  +#endif
   175    181   
   176    182   #ifdef SQLITE_OMIT_ATTACH
   177    183     Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY);
   178    184   #else
   179    185     Tcl_SetVar2(interp, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY);
   180    186   #endif
   181    187   

Changes to test/json101.test.

    11     11   # This file implements tests for JSON SQL functions extension to the
    12     12   # SQLite library.
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   
    18         -load_static_extension db json
           18  +ifcapable !json1 {
           19  +  finish_test
           20  +  return
           21  +}
           22  +
    19     23   do_execsql_test json101-1.1.00 {
    20     24     SELECT json_array(1,2.5,null,'hello');
    21     25   } {[1,2.5,null,"hello"]}
    22     26   do_execsql_test json101-1.1.01 {
    23     27     SELECT json_array(1,'{"abc":2.5,"def":null,"ghi":hello}',99);
    24     28     -- the second term goes in as a string:
    25     29   } {[1,"{\\"abc\\":2.5,\\"def\\":null,\\"ghi\\":hello}",99]}

Changes to test/json102.test.

    14     14   # This file contains tests automatically generated from the json1
    15     15   # documentation.
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21         -load_static_extension db json
           21  +ifcapable !json1 {
           22  +  finish_test
           23  +  return
           24  +}
           25  +
    22     26   do_execsql_test json102-100 {
    23     27     SELECT json_object('ex','[52,3.14159]');
    24     28   } {{{"ex":"[52,3.14159]"}}}
    25     29   do_execsql_test json102-110 {
    26     30     SELECT json_object('ex',json('[52,3.14159]'));
    27     31   } {{{"ex":[52,3.14159]}}}
    28     32   do_execsql_test json102-120 {

Changes to test/releasetest.tcl.

    74     74       -DSQLITE_SOUNDEX=1
    75     75     }
    76     76     "Update-Delete-Limit" {
    77     77       -O2
    78     78       -DSQLITE_DEFAULT_FILE_FORMAT=4
    79     79       -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
    80     80       -DSQLITE_ENABLE_STMT_SCANSTATUS
           81  +    --enable-json1
    81     82     }
    82     83     "Check-Symbols" {
    83     84       -DSQLITE_MEMDEBUG=1
    84     85       -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
    85     86       -DSQLITE_ENABLE_FTS3=1
    86     87       -DSQLITE_ENABLE_RTREE=1
    87     88       -DSQLITE_ENABLE_MEMSYS5=1
................................................................................
    91     92       -DSQLITE_SECURE_DELETE=1
    92     93       -DSQLITE_SOUNDEX=1
    93     94       -DSQLITE_ENABLE_ATOMIC_WRITE=1
    94     95       -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
    95     96       -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
    96     97       -DSQLITE_ENABLE_STAT4
    97     98       -DSQLITE_ENABLE_STMT_SCANSTATUS
           99  +    --enable-json1 --enable-fts5
    98    100     }
    99    101     "Debug-One" {
   100    102       --disable-shared
   101    103       -O2
   102    104       -DSQLITE_DEBUG=1
   103    105       -DSQLITE_MEMDEBUG=1
   104    106       -DSQLITE_MUTEX_NOOP=1
................................................................................
   131    133       -DSQLITE_ENABLE_IOTRACE=1
   132    134       -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
   133    135       -DSQLITE_MAX_PAGE_SIZE=4096
   134    136       -DSQLITE_OMIT_LOAD_EXTENSION=1
   135    137       -DSQLITE_OMIT_PROGRESS_CALLBACK=1
   136    138       -DSQLITE_OMIT_VIRTUALTABLE=1
   137    139       -DSQLITE_TEMP_STORE=3
          140  +    --enable-json1
   138    141     }
   139    142     "Device-Two" {
   140    143       -DSQLITE_4_BYTE_ALIGNED_MALLOC=1
   141    144       -DSQLITE_DEFAULT_AUTOVACUUM=1
   142    145       -DSQLITE_DEFAULT_CACHE_SIZE=1000
   143    146       -DSQLITE_DEFAULT_LOCKING_MODE=0
   144    147       -DSQLITE_DEFAULT_PAGE_SIZE=1024
................................................................................
   148    151       -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
   149    152       -DSQLITE_ENABLE_RTREE=1
   150    153       -DSQLITE_MAX_COMPOUND_SELECT=50
   151    154       -DSQLITE_MAX_PAGE_SIZE=32768
   152    155       -DSQLITE_OMIT_TRACE=1
   153    156       -DSQLITE_TEMP_STORE=3
   154    157       -DSQLITE_THREADSAFE=2
          158  +    --enable-json1 --enable-fts5
   155    159     }
   156    160     "Locking-Style" {
   157    161       -O2
   158    162       -DSQLITE_ENABLE_LOCKING_STYLE=1
   159    163     }
   160    164     "OS-X" {
   161    165       -O1   # Avoid a compiler bug in gcc 4.2.1 build 5658
   162    166       -DSQLITE_OMIT_LOAD_EXTENSION=1
   163    167       -DSQLITE_DEFAULT_MEMSTATUS=0
   164    168       -DSQLITE_THREADSAFE=2
   165    169       -DSQLITE_OS_UNIX=1
          170  +    -DSQLITE_ENABLE_JSON1=1
   166    171       -DSQLITE_ENABLE_LOCKING_STYLE=1
   167    172       -DUSE_PREAD=1
   168    173       -DSQLITE_ENABLE_RTREE=1
   169    174       -DSQLITE_ENABLE_FTS3=1
   170    175       -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
   171    176       -DSQLITE_DEFAULT_CACHE_SIZE=1000
   172    177       -DSQLITE_MAX_LENGTH=2147483645
   173    178       -DSQLITE_MAX_VARIABLE_NUMBER=500000
   174    179       -DSQLITE_DEBUG=1
   175    180       -DSQLITE_PREFER_PROXY_LOCKING=1
   176    181       -DSQLITE_ENABLE_API_ARMOR=1
          182  +    --enable-json1 --enable-fts5
   177    183     }
   178    184     "Extra-Robustness" {
   179    185       -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
   180    186       -DSQLITE_MAX_ATTACHED=62
   181    187     }
   182    188     "Devkit" {
   183    189       -DSQLITE_DEFAULT_FILE_FORMAT=4
   184    190       -DSQLITE_MAX_ATTACHED=30
   185    191       -DSQLITE_ENABLE_COLUMN_METADATA
   186    192       -DSQLITE_ENABLE_FTS4
   187    193       -DSQLITE_ENABLE_FTS4_PARENTHESIS
   188    194       -DSQLITE_DISABLE_FTS4_DEFERRED
   189    195       -DSQLITE_ENABLE_RTREE
          196  +    --enable-json1 --enable-fts5
   190    197     }
   191    198     "No-lookaside" {
   192    199       -DSQLITE_TEST_REALLOC_STRESS=1
   193    200       -DSQLITE_OMIT_LOOKASIDE=1
   194    201       -DHAVE_USLEEP=1
   195    202     }
   196    203     "Valgrind" {
   197    204       -DSQLITE_ENABLE_STAT4
   198    205       -DSQLITE_ENABLE_FTS4
   199    206       -DSQLITE_ENABLE_RTREE
          207  +    --enable-json1
   200    208     }
   201    209   
   202    210     # The next group of configurations are used only by the
   203    211     # Failure-Detection platform.  They are all the same, but we need
   204    212     # different names for them all so that they results appear in separate
   205    213     # subdirectories.
   206    214     #

Changes to tool/mksqlite3c.tcl.

   210    210           # begin/end markers with the harmless substring "**".
   211    211           puts $out "/* [string map [list /* ** */ **] $line] */"
   212    212         }
   213    213       } elseif {[regexp {^#ifdef __cplusplus} $line]} {
   214    214         puts $out "#if 0"
   215    215       } elseif {!$linemacros && [regexp {^#line} $line]} {
   216    216         # Skip #line directives.
   217         -    } elseif {$addstatic && ![regexp {^(static|typedef)} $line]} {
          217  +    } elseif {$addstatic
          218  +               && ![regexp {^(static|typedef|SQLITE_PRIVATE)} $line]} {
   218    219         # Skip adding the SQLITE_PRIVATE or SQLITE_API keyword before
   219    220         # functions if this header file does not need it.
   220    221         if {![info exists varonly_hdr($tail)]
   221    222          && [regexp $declpattern $line all rettype funcname rest]} {
   222    223           regsub {^SQLITE_API } $line {} line
   223    224           # Add the SQLITE_PRIVATE or SQLITE_API keyword before functions.
   224    225           # so that linkage can be modified at compile-time.
................................................................................
   378    379   
   379    380      rtree.c
   380    381      icu.c
   381    382      fts3_icu.c
   382    383      sqlite3rbu.c
   383    384      dbstat.c
   384    385      sqlite3session.c
          386  +   json1.c
          387  +   fts5.c
   385    388   } {
   386    389     copy_file tsrc/$file
   387    390   }
   388    391   
   389    392   close $out

Changes to tool/mksqlite3h.tcl.

    68     68   # Force the output to use unix line endings, even on Windows.
    69     69   fconfigure stdout -translation lf
    70     70   
    71     71   set filelist [subst {
    72     72     $TOP/src/sqlite.h.in
    73     73     $TOP/ext/rtree/sqlite3rtree.h
    74     74     $TOP/ext/session/sqlite3session.h
           75  +  $TOP/ext/fts5/fts5.h
    75     76   }]
    76     77   
    77     78   # These are the functions that accept a variable number of arguments.  They
    78     79   # always need to use the "cdecl" calling convention even when another calling
    79     80   # convention (e.g. "stcall") is being used for the rest of the library.
    80     81   set cdecllist {
    81     82     sqlite3_config