Compare commits
195 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 42516b2ef9 | |||
| 8625bd64c2 | |||
| 4b4b5ff1d8 | |||
| 1a466a386e | |||
| de4fc707b5 | |||
| dfa64c5542 | |||
| 5f05a7c3c7 | |||
| ee0b5e9bed | |||
| 99438c843c | |||
| 5a6dc86df2 | |||
| 36cb4d03ac | |||
| 1682fedaa0 | |||
| e550d98bbf | |||
| 3a92a5c4b3 | |||
| 2005250d7f | |||
| 5be20f3927 | |||
| f6e86e38ac | |||
| 6bb44daae4 | |||
| 9905e7e22b | |||
| 6d05f9af81 | |||
| 346f1e0ed9 | |||
| 0064c43a88 | |||
| 5598a3f8da | |||
| 954c02b414 | |||
| 6c45a5d60e | |||
| b909f23581 | |||
| e2a4ec3921 | |||
| e34646b5dc | |||
| 68b0e8db05 | |||
| c9f16f6562 | |||
| ac1f151796 | |||
| 66fee051a6 | |||
| bad9725a29 | |||
| 1fa0ef3ae8 | |||
| 26068b7901 | |||
| ae50e509f5 | |||
| 784623d599 | |||
| 59b4f75e0f | |||
| 5ea8d1ed5a | |||
| 1c27c39396 | |||
| ccb1211b54 | |||
| 26d5652b56 | |||
| 8ee82c6202 | |||
| dac467890e | |||
| bf441f7575 | |||
| 56d46d9d38 | |||
| 65d83fa221 | |||
| a2d88f6a03 | |||
| d045b42854 | |||
| cbb182fef2 | |||
| 70188a66e0 | |||
| a2a875e3b8 | |||
| 895ad5f4af | |||
| 5460d5da8e | |||
| 043943c261 | |||
| 35660cb5a6 | |||
| d2cbc22dd5 | |||
| 4ccc5de98f | |||
| 4de88eb13e | |||
| f84060f2f8 | |||
| 14e4d9ad30 | |||
| 957209e7ac | |||
| 7ad582ad5a | |||
| a1bc2ad6ce | |||
| aa7c9050fa | |||
| 7db8d195c3 | |||
| 8ce6d66986 | |||
| 9bcfb2b694 | |||
| a734793b2f | |||
| 7796ee07c4 | |||
| ae5ef1e80f | |||
| 4f237f8def | |||
| ae07b98a3c | |||
| 72ef506925 | |||
| 542d1c923e | |||
| e3565d9424 | |||
| 936fa83402 | |||
| 8cfc6a7aed | |||
| 2ba8b9566f | |||
| b79997a7c0 | |||
| 3db85bf0d3 | |||
| 4cd85bda4a | |||
| 30b20563e4 | |||
| b3cff449f9 | |||
| caf8c28420 | |||
| ce236e031e | |||
| e74c738e55 | |||
| 8c97ad8834 | |||
| 4dadb531b0 | |||
| e615b73040 | |||
| 6d288e2408 | |||
| 18f6445aea | |||
| 8d69bd2a20 | |||
| a7d3d40e06 | |||
| 519fc4f8c2 | |||
| 264c691863 | |||
| 284e70b3a1 | |||
| 8a6ddc551e | |||
| 5d6c11b766 | |||
| 55fca9585c | |||
| fdcd599992 | |||
| 54e1dff24b | |||
| 591123eea9 | |||
| 198b72cfe8 | |||
| fa8a7f88ff | |||
| 4f72770b34 | |||
| 6ac6bedc80 | |||
| 1e38a9cc1a | |||
| 894bd83f52 | |||
| f4ab0ad8ee | |||
| 31465666ff | |||
| 744d986d17 | |||
| 7968c38540 | |||
| ad8e79ce53 | |||
| 5bae363b99 | |||
| b124098e51 | |||
| 59ac8f4c7f | |||
| d54bae947d | |||
| a3d219a794 | |||
| 84f952ba8f | |||
| ec5e611935 | |||
| 857bcb6035 | |||
| 8bdece9034 | |||
| f9c73ef7c5 | |||
| 003d304c9b | |||
| 25557128fe | |||
| abf470d7a3 | |||
| 816f4b9cc1 | |||
| a505d89bbe | |||
| 6d8ec2aed4 | |||
| 7abd86c4b8 | |||
| 49de624e41 | |||
| a1e6fbebdf | |||
| b08f1d5d97 | |||
| 83afc4c2b2 | |||
| 20755cef7d | |||
| d1068f8b73 | |||
| 2a1a3d6af5 | |||
| ead26840b8 | |||
| 883f35db10 | |||
| a60142fef5 | |||
| fa2770fec5 | |||
| 92860ade7a | |||
| c7b822082e | |||
| 49bb81844c | |||
| 114e0543af | |||
| f400f41fde | |||
| 10d1b0c5db | |||
| 59ded3ff14 | |||
| d5503d383b | |||
| d0be4a781e | |||
| ea63f48ec8 | |||
| 51e8287dde | |||
| 2e7c9ae473 | |||
| aca993423f | |||
| c4c951adbe | |||
| 0831b3a989 | |||
| 595a2532f3 | |||
| 5ff68db4f1 | |||
| 0be8482f96 | |||
| 3cb46bd929 | |||
| 05c5e76c94 | |||
| 1865e85e0b | |||
| c139ad34de | |||
| 8d2f6c13e3 | |||
| 3c6db6831d | |||
| 587256a634 | |||
| 474cdc54ef | |||
| 9ce9ee6819 | |||
| 69f2da0eed | |||
| 42aa26a607 | |||
| 02616ccf29 | |||
| 66cb9d0ec7 | |||
| 9a1b212f50 | |||
| c2da952f5d | |||
| 76bfcd13be | |||
| cda0d6fd74 | |||
| b1e1d9f3d4 | |||
| 1bc8f07f20 | |||
| bb12cdc11b | |||
| 220434abdd | |||
| ae49b334c2 | |||
| 2615879760 | |||
| 13aea08683 | |||
| aaef970446 | |||
| 2d0b1ae73b | |||
| cf9d95002e | |||
| 4e0208fd8e | |||
| bbd6ba04b9 | |||
| 4b5adfc6ba | |||
| dd5b962a15 | |||
| 63c4d89ae1 | |||
| e6b41c4641 | |||
| f4321fff36 | |||
| 6219872845 |
@@ -1,6 +1,91 @@
|
||||
License Information
|
||||
===================
|
||||
|
||||
SQLite Is Public Domain
|
||||
-----------------------
|
||||
|
||||
The SQLite source code, including all of the files in the directories
|
||||
listed in the bullets below are
|
||||
[Public Domain](https://sqlite.org/copyright.html).
|
||||
The authors have submitted written affidavits releasing their work to
|
||||
the public for any use. Every byte of the public-domain code can be
|
||||
traced back to the original authors. The files of this repository
|
||||
that are public domain include the following:
|
||||
|
||||
* All of the primary SQLite source code files found in the
|
||||
[src/ directory](https://sqlite.org/src/tree/src?type=tree&expand)
|
||||
* All of the test cases and testing code in the
|
||||
[test/ directory](https://sqlite.org/src/tree/test?type=tree&expand)
|
||||
* All of the SQLite extension source code and test cases in the
|
||||
[ext/ directory](https://sqlite.org/src/tree/ext?type=tree&expand)
|
||||
* All code that ends up in the "sqlite3.c" and "sqlite3.h" build products
|
||||
that actually implements the SQLite RDBMS.
|
||||
* All of the code used to compile the
|
||||
[command-line interface](https://sqlite.org/cli.html)
|
||||
* All of the code used to build various utility programs such as
|
||||
"sqldiff", "sqlite3_rsync", and "sqlite3_analyzer".
|
||||
|
||||
|
||||
The public domain source files usually contain a header comment
|
||||
similar to the following to make it clear that the software is
|
||||
public domain.
|
||||
|
||||
> ~~~
|
||||
The author disclaims copyright to this source code. In place of
|
||||
a legal notice, here is a blessing:
|
||||
|
||||
* May you do good and not evil.
|
||||
* May you find forgiveness for yourself and forgive others.
|
||||
* May you share freely, never taking more than you give.
|
||||
~~~
|
||||
|
||||
Almost every file you find in this source repository will be
|
||||
public domain. But there are a small number of exceptions:
|
||||
|
||||
Non-Public-Domain Code Included With This Source Repository AS A Convenience
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
This repository contains a (relatively) small amount of non-public-domain
|
||||
code used to help implement the configuration and build logic. In other
|
||||
words, there are some non-public-domain files used to implement:
|
||||
|
||||
> ~~~
|
||||
./configure && make
|
||||
~~~
|
||||
|
||||
In all cases, the non-public-domain files included with this
|
||||
repository have generous BSD-style licenses. So anyone is free to
|
||||
use any of the code in this source repository for any purpose, though
|
||||
attribution my be required to reuse or republish the configure and
|
||||
build scripts. None of the non-public-domain code ever actually reaches
|
||||
the build products, such as "sqlite3.c", however, so no attribution is
|
||||
required to use SQLite itself. The non-public-domain code consists of
|
||||
scripts used to help compile SQLite. The non-public-domain code is
|
||||
technically not part of SQLite. The non-public-domain code is
|
||||
included in this repository as a convenience to developers, so that those
|
||||
who want to build SQLite do not need to go download a bunch of
|
||||
third-party build scripts in order to compile SQLite.
|
||||
|
||||
Non-public-domain code included in this respository includes:
|
||||
|
||||
* The ["autosetup"](http://msteveb.github.io/autosetup/) configuration
|
||||
system that is contained (mostly) the autosetup/ directory, but also
|
||||
includes the "./configure" script at the top-level of this archive.
|
||||
Autosetup has a separate BSD-style license. See the
|
||||
[autosetup/LICENSE](http://msteveb.github.io/autosetup/license/)
|
||||
for details.
|
||||
|
||||
* There are BSD-style licenses on some of the configuration
|
||||
software found in the legacy autoconf/ directory and its
|
||||
subdirectories.
|
||||
|
||||
The following unix shell command is can be run from the top-level
|
||||
of this source repository in order to remove all non-public-domain
|
||||
code:
|
||||
|
||||
> ~~~
|
||||
rm -rf configure autosetup autoconf
|
||||
~~~
|
||||
|
||||
If you unpack this source repository and then run the command above, what
|
||||
is left will be 100% public domain.
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
#!/usr/make
|
||||
#
|
||||
# Makefile for SQLITE
|
||||
#
|
||||
# This is a template makefile for SQLite. Most people prefer to
|
||||
# use the autoconf generated "configure" script to generate the
|
||||
# makefile automatically. But that does not work for everybody
|
||||
# and in every situation. If you are having problems with the
|
||||
# "configure" script, you might want to try this makefile as an
|
||||
# alternative. Create a copy of this file, edit the parameters
|
||||
# below and type "make".
|
||||
#
|
||||
|
||||
#### The toplevel directory of the source tree. This is the directory
|
||||
# that contains this "Makefile.in" and the "configure.in" script.
|
||||
#
|
||||
TOP = ../sqlite
|
||||
|
||||
#### C Compiler and options for use in building executables that
|
||||
# will run on the platform that is doing the build.
|
||||
#
|
||||
BCC = gcc -g -O0
|
||||
#BCC = /opt/ancic/bin/c89 -0
|
||||
|
||||
#### If you want the SQLite library to be safe for use within a
|
||||
# multi-threaded program, then define the following macro
|
||||
# appropriately:
|
||||
#
|
||||
#THREADSAFE = -DTHREADSAFE=1
|
||||
THREADSAFE = -DTHREADSAFE=0
|
||||
|
||||
#### Specify any extra linker options needed to make the library
|
||||
# thread safe
|
||||
#
|
||||
THREADLIB = -lpthread -lm -ldl
|
||||
#THREADLIB =
|
||||
|
||||
#### Specify any extra libraries needed to access required functions.
|
||||
#
|
||||
#TLIBS = -lrt # fdatasync on Solaris 8
|
||||
TLIBS =
|
||||
|
||||
#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1
|
||||
# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all
|
||||
# malloc()s and free()s in order to track down memory leaks.
|
||||
#
|
||||
# SQLite uses some expensive assert() statements in the inner loop.
|
||||
# You can make the library go almost twice as fast if you compile
|
||||
# with -DNDEBUG=1
|
||||
#
|
||||
OPTS += -DSQLITE_DEBUG=1
|
||||
OPTS += -DSQLITE_ENABLE_WHERETRACE
|
||||
OPTS += -DSQLITE_ENABLE_SELECTTRACE
|
||||
|
||||
#### The suffix to add to executable files. ".exe" for windows.
|
||||
# Nothing for unix.
|
||||
#
|
||||
#EXE = .exe
|
||||
EXE =
|
||||
|
||||
#### C Compile and options for use in building executables that
|
||||
# will run on the target platform. This is usually the same
|
||||
# as BCC, unless you are cross-compiling.
|
||||
#
|
||||
TCC = gcc -O0
|
||||
#TCC = gcc -g -O0 -Wall
|
||||
#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
|
||||
#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
|
||||
#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive
|
||||
|
||||
#### Tools used to build a static library.
|
||||
#
|
||||
AR = ar cr
|
||||
#AR = /opt/mingw/bin/i386-mingw32-ar cr
|
||||
RANLIB = ranlib
|
||||
#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
|
||||
|
||||
MKSHLIB = gcc -shared
|
||||
SO = so
|
||||
SHPREFIX = lib
|
||||
# SO = dll
|
||||
# SHPREFIX =
|
||||
|
||||
#### Extra compiler options needed for programs that use the TCL library.
|
||||
#
|
||||
TCL_FLAGS = -I/home/drh/tcl/include/tcl8.6
|
||||
|
||||
#### Linker options needed to link against the TCL library.
|
||||
#
|
||||
#LIBTCL = -ltcl -lm -ldl
|
||||
LIBTCL = /home/drh/tcl/lib/libtcl8.6.a -lm -lpthread -ldl -lz
|
||||
|
||||
#### Additional objects for SQLite library when TCL support is enabled.
|
||||
#TCLOBJ =
|
||||
TCLOBJ = tclsqlite.o
|
||||
|
||||
#### Compiler options needed for programs that use the readline() library.
|
||||
#
|
||||
READLINE_FLAGS =
|
||||
#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline
|
||||
|
||||
#### Linker options needed by programs using readline() must link against.
|
||||
#
|
||||
LIBREADLINE =
|
||||
#LIBREADLINE = -static -lreadline -ltermcap
|
||||
|
||||
# You should not have to change anything below this line
|
||||
###############################################################################
|
||||
include $(TOP)/main.mk
|
||||
@@ -0,0 +1,59 @@
|
||||
#!/usr/make
|
||||
all:
|
||||
#
|
||||
# Makefile for SQLITE
|
||||
#
|
||||
# This is a template makefile for SQLite. Most people prefer to
|
||||
# use the autoconf generated "configure" script to generate the
|
||||
# makefile automatically. But that does not work for everybody
|
||||
# and in every situation. If you are having problems with the
|
||||
# "configure" script, you might want to try this makefile as an
|
||||
# alternative. Create a copy of this file, edit the parameters
|
||||
# below and type "make".
|
||||
#
|
||||
# Maintenance note: because this is the template for Linux systems, it
|
||||
# is assumed that the platform has GNU make and this file takes
|
||||
# advantage of that.
|
||||
#
|
||||
####
|
||||
#
|
||||
# $(TOP) = The toplevel directory of the source tree. This is the
|
||||
# directory that contains "Makefile.in" and "auto.def".
|
||||
#
|
||||
TOP ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
#
|
||||
# $(CFLAGS) will be used when compiling the library and most
|
||||
# utilities. It must normally contain -fPIC on Linux systems.
|
||||
#
|
||||
CFLAGS = -fPIC
|
||||
|
||||
#
|
||||
# $(SHELL_OPT) contains CFLAGS for building the sqlite3 CLI shell.
|
||||
# See main.mk for other potentially-relevant vars which may need
|
||||
# tweaking, like $(LDFLAGS_READLINE).
|
||||
#
|
||||
SHELL_OPT += -DHAVE_READLINE=1
|
||||
SHELL_OPT += -DSQLITE_HAVE_ZLIB=1
|
||||
LDFLAGS.readline = -lreadline # may need -lcurses etc, depending on the system
|
||||
CFLAGS.readline = # needs -I... if readline.h is in an unusual place.
|
||||
LDFLAGS.zlib = -lz
|
||||
|
||||
#
|
||||
# Library's version number.
|
||||
#
|
||||
PACKAGE_VERSION ?= $(shell cat $(TOP)/VERSION 2>/dev/null)
|
||||
|
||||
# sqlite_cfg.h is typically created by the configure script. It's
|
||||
# commonly not needed but main.mk does not know that so we have to
|
||||
# create a dummy if we don't already have one.
|
||||
sqlite_cfg.h:
|
||||
touch $@
|
||||
distclean-.:
|
||||
rm -f sqlite_cfg.h
|
||||
|
||||
#
|
||||
# With the above in place, we can now import the rules make use of
|
||||
# it...
|
||||
#
|
||||
include $(TOP)/main.mk
|
||||
@@ -1059,6 +1059,18 @@ TCLSH_CMD = $(TCLDIR)\bin\tclsh.exe
|
||||
TCLSH_CMD = tclsh
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# A light-weight TCLSH replacement that can be used for code generation
|
||||
# but which is not adequate for testing. This is "jimsh0" by default,
|
||||
# with source code in the repository. To force the whole build to use
|
||||
# the full, official tclsh, add WITHOUT_JIMSH=1 to the nmake command line.
|
||||
#
|
||||
!IFDEF WITHOUT_JIMSH
|
||||
JIM_TCLSH = $(TCLSH_CMD)
|
||||
!ENDIF
|
||||
!IFNDEF JIM_TCLSH
|
||||
JIM_TCLSH = jimsh0.exe
|
||||
!ENDIF
|
||||
# <</mark>>
|
||||
|
||||
# Compiler options needed for programs that use the readline() library.
|
||||
@@ -1573,7 +1585,6 @@ TESTSRC = \
|
||||
$(TOP)\src\test8.c \
|
||||
$(TOP)\src\test9.c \
|
||||
$(TOP)\src\test_autoext.c \
|
||||
$(TOP)\src\test_async.c \
|
||||
$(TOP)\src\test_backup.c \
|
||||
$(TOP)\src\test_bestindex.c \
|
||||
$(TOP)\src\test_blob.c \
|
||||
@@ -1670,7 +1681,6 @@ TESTSRC2 = \
|
||||
$(SRC01) \
|
||||
$(SRC07) \
|
||||
$(SRC10) \
|
||||
$(TOP)\ext\async\sqlite3async.c \
|
||||
fts5.c
|
||||
|
||||
# Header files used by all library source files.
|
||||
@@ -1849,6 +1859,11 @@ dll: $(SQLITE3DLL)
|
||||
#
|
||||
shell: $(SQLITE3EXE)
|
||||
|
||||
# jimsh0 - replacement for tclsh
|
||||
#
|
||||
jimsh0.exe: $(TOP)\autosetup\jimsh0.c
|
||||
cl -DHAVE__FULLPATH=1 $(TOP)\autosetup\jimsh0.c
|
||||
|
||||
# <<mark>>
|
||||
libsqlite3.lib: $(LIBOBJ)
|
||||
$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
|
||||
@@ -1889,10 +1904,10 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
|
||||
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
# <<block2>>
|
||||
sqlite3.def: libsqlite3.lib
|
||||
sqlite3.def: libsqlite3.lib $(JIM_TCLSH)
|
||||
echo EXPORTS > sqlite3.def
|
||||
dumpbin /all libsqlite3.lib \
|
||||
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
|
||||
| $(JIM_TCLSH) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
|
||||
| sort >> sqlite3.def
|
||||
# <</block2>>
|
||||
|
||||
@@ -1980,33 +1995,22 @@ mptest: mptester.exe
|
||||
# files are automatically generated. This target takes care of
|
||||
# all that automatic generation.
|
||||
#
|
||||
.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP)
|
||||
.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c $(SQLITE_TCL_DEP) $(JIM_TCLSH)
|
||||
-rmdir /Q/S tsrc 2>NUL
|
||||
-mkdir tsrc
|
||||
for %i in ($(SRC00)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC01)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC03)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC04)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC05)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC07)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC09)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC10)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC11)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC12)) do copy /Y %i tsrc
|
||||
copy /Y fts5.c tsrc
|
||||
$(JIM_TCLSH) $(TOP)\tool\cp.tcl $(SRC00) $(SRC01) $(SRC03) $(SRC04) $(SRC05) $(SRC07) $(SRC09) $(SRC10) $(SRC11) $(SRC12) fts5.c fts5.h tsrc
|
||||
copy /B tsrc\fts5.c +,,
|
||||
copy /Y fts5.h tsrc
|
||||
copy /B tsrc\fts5.h +,,
|
||||
del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
|
||||
$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
|
||||
$(JIM_TCLSH) $(TOP)\tool\vdbe-compress.tcl $(OPTS) < tsrc\vdbe.c > vdbe.new
|
||||
move vdbe.new tsrc\vdbe.c
|
||||
echo > .target_source
|
||||
|
||||
sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL) src-verify.exe
|
||||
$(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS) $(EXTRA_SRC)
|
||||
sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL) src-verify.exe $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS) $(EXTRA_SRC)
|
||||
|
||||
sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
|
||||
$(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
|
||||
sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(TOP)\tool\split-sqlite3c.tcl
|
||||
# <</mark>>
|
||||
|
||||
# Rule to build the amalgamation
|
||||
@@ -2048,11 +2052,11 @@ opcodes.lo: opcodes.c
|
||||
#
|
||||
!IF $(USE_RC)!=0
|
||||
# <<block1>>
|
||||
$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H) $(TOP)\VERSION
|
||||
$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H) $(TOP)\VERSION $(JIM_TCLSH)
|
||||
echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
|
||||
for /F %%V in ('type "$(TOP)\VERSION"') do ( \
|
||||
echo #define SQLITE_RESOURCE_VERSION %%V \
|
||||
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
|
||||
| $(JIM_TCLSH) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
|
||||
)
|
||||
echo #endif >> sqlite3rc.h
|
||||
$(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
|
||||
@@ -2313,11 +2317,11 @@ tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
|
||||
|
||||
# Rules to build opcodes.c and opcodes.h
|
||||
#
|
||||
opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl
|
||||
$(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
|
||||
opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
|
||||
|
||||
opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
|
||||
type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
|
||||
opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl $(JIM_TCLSH)
|
||||
type parse.h $(TOP)\src\vdbe.c | $(JIM_TCLSH) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
|
||||
|
||||
# Rules to build parse.c and parse.h - the outputs of lemon.
|
||||
#
|
||||
@@ -2329,8 +2333,8 @@ parse.c: $(TOP)\src\parse.y lemon.exe
|
||||
copy /B parse.y +,,
|
||||
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S parse.y
|
||||
|
||||
$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION
|
||||
$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
|
||||
$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(TOP)\tool\mksqlite3h.tcl "$(TOP:\=/)" > $(SQLITE3H) $(MKSQLITE3H_ARGS)
|
||||
|
||||
sqlite3ext.h: .target_source
|
||||
!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
|
||||
@@ -2393,8 +2397,8 @@ SHELL_DEP = $(SHELL_DEP) $(TOP)\ext\misc\sqlar.c
|
||||
SHELL_DEP = $(SHELL_DEP) $(TOP)\ext\misc\zipfile.c
|
||||
!ENDIF
|
||||
|
||||
shell.c: $(SHELL_DEP) $(TOP)\tool\mkshellc.tcl
|
||||
$(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl > shell.c
|
||||
shell.c: $(SHELL_DEP) $(TOP)\tool\mkshellc.tcl $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(TOP)\tool\mkshellc.tcl > shell.c
|
||||
|
||||
zlib:
|
||||
pushd $(ZLIBDIR) && $(MAKE) /f win32\Makefile.msc clean $(ZLIBLIB) && popd
|
||||
@@ -2497,13 +2501,13 @@ fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
|
||||
|
||||
fts5parse.h: fts5parse.c
|
||||
|
||||
fts5.c: $(FTS5_SRC)
|
||||
$(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
|
||||
fts5.c: $(FTS5_SRC) $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(TOP)\ext\fts5\tool\mkfts5c.tcl
|
||||
copy /Y $(TOP)\ext\fts5\fts5.h .
|
||||
copy /B fts5.h +,,
|
||||
|
||||
lsm1.c: $(LSM1_SRC)
|
||||
$(TCLSH_CMD) $(TOP)\ext\lsm1\tool\mklsm1c.tcl
|
||||
lsm1.c: $(LSM1_SRC) $(JIM_TCLSH)
|
||||
$(JIM_TCLSH) $(TOP)\ext\lsm1\tool\mklsm1c.tcl
|
||||
copy /Y $(TOP)\ext\lsm1\lsm.h .
|
||||
copy /B lsm.h +,,
|
||||
|
||||
|
||||
@@ -1039,6 +1039,11 @@ dll: $(SQLITE3DLL)
|
||||
#
|
||||
shell: $(SQLITE3EXE)
|
||||
|
||||
# jimsh0 - replacement for tclsh
|
||||
#
|
||||
jimsh0.exe: $(TOP)\autosetup\jimsh0.c
|
||||
cl -DHAVE__FULLPATH=1 $(TOP)\autosetup\jimsh0.c
|
||||
|
||||
|
||||
$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
|
||||
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
|
||||
# so that we create the export library with the dll.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
AC_INIT([sqlite],[3.47.0])
|
||||
AC_INIT([sqlite],[3.48.0])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
Unless explicitly stated, all files which form part of autosetup
|
||||
are released under the following license:
|
||||
|
||||
---------------------------------------------------------------------
|
||||
autosetup - A build environment "autoconfigurator"
|
||||
|
||||
Copyright (c) 2010-2011, WorkWare Systems <http://workware.net.au/>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE WORKWARE SYSTEMS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WORKWARE
|
||||
SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressed or implied, of WorkWare Systems.
|
||||
@@ -0,0 +1,11 @@
|
||||
README.autosetup created by autosetup v0.7.2
|
||||
|
||||
This is the autosetup directory for a local install of autosetup.
|
||||
It contains autosetup, support files and loadable modules.
|
||||
|
||||
*.tcl files in this directory are optional modules which
|
||||
can be loaded with the 'use' directive.
|
||||
|
||||
*.auto files in this directory are auto-loaded.
|
||||
|
||||
For more information, see https://msteveb.github.io/autosetup/
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Looks for a suitable tclsh or jimsh in the PATH
|
||||
# If not found, builds a bootstrap jimsh in current dir from source
|
||||
# Prefer $autosetup_tclsh if is set in the environment (unless ./jimsh0 works)
|
||||
# If an argument is given, use that as the test instead of autosetup-test-tclsh
|
||||
d="`dirname "$0"`"
|
||||
for tclsh in ./jimsh0 $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6 tclsh8.7; do
|
||||
{ $tclsh "$d/${1-autosetup-test-tclsh}"; } 2>/dev/null && exit 0
|
||||
done
|
||||
echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
|
||||
for cc in ${CC_FOR_BUILD:-cc} gcc; do
|
||||
{ $cc -o jimsh0 "$d/jimsh0.c"; } >/dev/null 2>&1 || continue
|
||||
./jimsh0 "$d/${1-autosetup-test-tclsh}" && exit 0
|
||||
done
|
||||
echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."
|
||||
echo false
|
||||
@@ -0,0 +1,20 @@
|
||||
# A small Tcl script to verify that the chosen
|
||||
# interpreter works. Sometimes we might e.g. pick up
|
||||
# an interpreter for a different arch.
|
||||
# Outputs the full path to the interpreter
|
||||
|
||||
if {[catch {info version} version] == 0} {
|
||||
# This is Jim Tcl
|
||||
if {$version >= 0.72} {
|
||||
# Ensure that regexp works
|
||||
regexp (a.*?) a
|
||||
puts [info nameofexecutable]
|
||||
exit 0
|
||||
}
|
||||
} elseif {[catch {info tclversion} version] == 0} {
|
||||
if {$version >= 8.5 && ![string match 8.5a* [info patchlevel]]} {
|
||||
puts [info nameofexecutable]
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
exit 1
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2011 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# The 'cc-db' module provides a knowledge-base of system idiosyncrasies.
|
||||
# In general, this module can always be included.
|
||||
|
||||
use cc
|
||||
|
||||
options {}
|
||||
|
||||
# openbsd needs sys/types.h to detect some system headers
|
||||
cc-include-needs sys/socket.h sys/types.h
|
||||
cc-include-needs netinet/in.h sys/types.h
|
||||
@@ -0,0 +1,187 @@
|
||||
# Copyright (c) 2011 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# Provides a library of common tests on top of the 'cc' module.
|
||||
|
||||
use cc
|
||||
|
||||
# @cc-check-lfs
|
||||
#
|
||||
# The equivalent of the 'AC_SYS_LARGEFILE' macro.
|
||||
#
|
||||
# defines 'HAVE_LFS' if LFS is available,
|
||||
# and defines '_FILE_OFFSET_BITS=64' if necessary
|
||||
#
|
||||
# Returns 1 if 'LFS' is available or 0 otherwise
|
||||
#
|
||||
proc cc-check-lfs {} {
|
||||
cc-check-includes sys/types.h
|
||||
msg-checking "Checking if -D_FILE_OFFSET_BITS=64 is needed..."
|
||||
set lfs 1
|
||||
if {[msg-quiet cc-with {-includes sys/types.h} {cc-check-sizeof off_t}] == 8} {
|
||||
msg-result no
|
||||
} elseif {[msg-quiet cc-with {-includes sys/types.h -cflags -D_FILE_OFFSET_BITS=64} {cc-check-sizeof off_t}] == 8} {
|
||||
define _FILE_OFFSET_BITS 64
|
||||
msg-result yes
|
||||
} else {
|
||||
set lfs 0
|
||||
msg-result none
|
||||
}
|
||||
define-feature lfs $lfs
|
||||
return $lfs
|
||||
}
|
||||
|
||||
# @cc-check-endian
|
||||
#
|
||||
# The equivalent of the 'AC_C_BIGENDIAN' macro.
|
||||
#
|
||||
# defines 'HAVE_BIG_ENDIAN' if endian is known to be big,
|
||||
# or 'HAVE_LITTLE_ENDIAN' if endian is known to be little.
|
||||
#
|
||||
# Returns 1 if determined, or 0 if not.
|
||||
#
|
||||
proc cc-check-endian {} {
|
||||
cc-check-includes sys/types.h sys/param.h
|
||||
set rc 0
|
||||
msg-checking "Checking endian..."
|
||||
cc-with {-includes {sys/types.h sys/param.h}} {
|
||||
if {[cctest -code {
|
||||
#if !defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
|
||||
#error unknown
|
||||
#elif BYTE_ORDER != BIG_ENDIAN
|
||||
#error little
|
||||
#endif
|
||||
}]} {
|
||||
define-feature big-endian
|
||||
msg-result "big"
|
||||
set rc 1
|
||||
} elseif {[cctest -code {
|
||||
#if !defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
|
||||
#error unknown
|
||||
#elif BYTE_ORDER != LITTLE_ENDIAN
|
||||
#error big
|
||||
#endif
|
||||
}]} {
|
||||
define-feature little-endian
|
||||
msg-result "little"
|
||||
set rc 1
|
||||
} else {
|
||||
msg-result "unknown"
|
||||
}
|
||||
}
|
||||
return $rc
|
||||
}
|
||||
|
||||
# @cc-check-flags flag ?...?
|
||||
#
|
||||
# Checks whether the given C/C++ compiler flags can be used. Defines feature
|
||||
# names prefixed with 'HAVE_CFLAG' and 'HAVE_CXXFLAG' respectively, and
|
||||
# appends working flags to '-cflags' and 'AS_CFLAGS' or 'AS_CXXFLAGS'.
|
||||
proc cc-check-flags {args} {
|
||||
set result 1
|
||||
array set opts [cc-get-settings]
|
||||
switch -exact -- $opts(-lang) {
|
||||
c++ {
|
||||
set lang C++
|
||||
set prefix CXXFLAG
|
||||
}
|
||||
c {
|
||||
set lang C
|
||||
set prefix CFLAG
|
||||
}
|
||||
default {
|
||||
autosetup-error "cc-check-flags failed with unknown language: $opts(-lang)"
|
||||
}
|
||||
}
|
||||
foreach flag $args {
|
||||
msg-checking "Checking whether the $lang compiler accepts $flag..."
|
||||
if {[cctest -cflags $flag]} {
|
||||
msg-result yes
|
||||
define-feature $prefix$flag
|
||||
cc-with [list -cflags [list $flag]]
|
||||
define-append AS_${prefix}S $flag
|
||||
} else {
|
||||
msg-result no
|
||||
set result 0
|
||||
}
|
||||
}
|
||||
return $result
|
||||
}
|
||||
|
||||
# @cc-check-standards ver ?...?
|
||||
#
|
||||
# Checks whether the C/C++ compiler accepts one of the specified '-std=$ver'
|
||||
# options, and appends the first working one to '-cflags' and 'AS_CFLAGS' or
|
||||
# 'AS_CXXFLAGS'.
|
||||
proc cc-check-standards {args} {
|
||||
array set opts [cc-get-settings]
|
||||
foreach std $args {
|
||||
if {[cc-check-flags -std=$std]} {
|
||||
return $std
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
# Checks whether $keyword is usable as alignof
|
||||
proc cctest_alignof {keyword} {
|
||||
msg-checking "Checking for $keyword..."
|
||||
if {[cctest -code "int x = ${keyword}(char), y = ${keyword}('x');"]} then {
|
||||
msg-result ok
|
||||
define-feature $keyword
|
||||
} else {
|
||||
msg-result "not found"
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-c11
|
||||
#
|
||||
# Checks for several C11/C++11 extensions and their alternatives. Currently
|
||||
# checks for '_Static_assert', '_Alignof', '__alignof__', '__alignof'.
|
||||
proc cc-check-c11 {} {
|
||||
msg-checking "Checking for _Static_assert..."
|
||||
if {[cctest -code {
|
||||
_Static_assert(1, "static assertions are available");
|
||||
}]} then {
|
||||
msg-result ok
|
||||
define-feature _Static_assert
|
||||
} else {
|
||||
msg-result "not found"
|
||||
}
|
||||
|
||||
cctest_alignof _Alignof
|
||||
cctest_alignof __alignof__
|
||||
cctest_alignof __alignof
|
||||
}
|
||||
|
||||
# @cc-check-alloca
|
||||
#
|
||||
# The equivalent of the 'AC_FUNC_ALLOCA' macro.
|
||||
#
|
||||
# Checks for the existence of 'alloca'
|
||||
# defines 'HAVE_ALLOCA' and returns 1 if it exists.
|
||||
proc cc-check-alloca {} {
|
||||
cc-check-some-feature alloca {
|
||||
cctest -includes alloca.h -code { alloca (2 * sizeof (int)); }
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-signal-return-type
|
||||
#
|
||||
# The equivalent of the 'AC_TYPE_SIGNAL' macro.
|
||||
#
|
||||
# defines 'RETSIGTYPE' to 'int' or 'void'.
|
||||
proc cc-signal-return-type {} {
|
||||
msg-checking "Checking return type of signal handlers..."
|
||||
cc-with {-includes {sys/types.h signal.h}} {
|
||||
if {[cctest -code {return *(signal (0, 0)) (0) == 1;}]} {
|
||||
set type int
|
||||
} else {
|
||||
set type void
|
||||
}
|
||||
define RETSIGTYPE $type
|
||||
msg-result $type
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
# Copyright (c) 2010 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# The 'cc-shared' module provides support for shared libraries and shared objects.
|
||||
# It defines the following variables:
|
||||
#
|
||||
## SH_CFLAGS Flags to use compiling sources destined for a shared library
|
||||
## SH_LDFLAGS Flags to use linking (creating) a shared library
|
||||
## SH_SOPREFIX Prefix to use to set the soname when creating a shared library
|
||||
## SH_SOFULLPATH Set to 1 if the shared library soname should include the full install path
|
||||
## SH_SOEXT Extension for shared libs
|
||||
## SH_SOEXTVER Format for versioned shared libs - %s = version
|
||||
## SHOBJ_CFLAGS Flags to use compiling sources destined for a shared object
|
||||
## SHOBJ_LDFLAGS Flags to use linking a shared object, undefined symbols allowed
|
||||
## SHOBJ_LDFLAGS_R - as above, but all symbols must be resolved
|
||||
## SH_LINKRPATH Format for setting the rpath when linking an executable, %s = path
|
||||
## SH_LINKFLAGS Flags to use linking an executable which will load shared objects
|
||||
## LD_LIBRARY_PATH Environment variable which specifies path to shared libraries
|
||||
## STRIPLIBFLAGS Arguments to strip a dynamic library
|
||||
|
||||
options {}
|
||||
|
||||
# Defaults: gcc on unix
|
||||
define SHOBJ_CFLAGS -fPIC
|
||||
define SHOBJ_LDFLAGS -shared
|
||||
define SH_CFLAGS -fPIC
|
||||
define SH_LDFLAGS -shared
|
||||
define SH_LINKFLAGS -rdynamic
|
||||
define SH_LINKRPATH "-Wl,-rpath -Wl,%s"
|
||||
define SH_SOEXT .so
|
||||
define SH_SOEXTVER .so.%s
|
||||
define SH_SOPREFIX -Wl,-soname,
|
||||
define LD_LIBRARY_PATH LD_LIBRARY_PATH
|
||||
define STRIPLIBFLAGS --strip-unneeded
|
||||
|
||||
# Note: This is a helpful reference for identifying the toolchain
|
||||
# http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
|
||||
|
||||
switch -glob -- [get-define host] {
|
||||
*-*-darwin* {
|
||||
define SHOBJ_CFLAGS "-dynamic -fno-common"
|
||||
define SHOBJ_LDFLAGS "-bundle -undefined dynamic_lookup"
|
||||
define SHOBJ_LDFLAGS_R -bundle
|
||||
define SH_CFLAGS -dynamic
|
||||
define SH_LDFLAGS -dynamiclib
|
||||
define SH_LINKFLAGS ""
|
||||
define SH_SOEXT .dylib
|
||||
define SH_SOEXTVER .%s.dylib
|
||||
define SH_SOPREFIX -Wl,-install_name,
|
||||
define SH_SOFULLPATH
|
||||
define LD_LIBRARY_PATH DYLD_LIBRARY_PATH
|
||||
define STRIPLIBFLAGS -x
|
||||
}
|
||||
*-*-ming* - *-*-cygwin - *-*-msys {
|
||||
define SHOBJ_CFLAGS ""
|
||||
define SHOBJ_LDFLAGS -shared
|
||||
define SH_CFLAGS ""
|
||||
define SH_LDFLAGS -shared
|
||||
define SH_LINKRPATH ""
|
||||
define SH_LINKFLAGS ""
|
||||
define SH_SOEXT .dll
|
||||
define SH_SOEXTVER .dll
|
||||
define SH_SOPREFIX ""
|
||||
define LD_LIBRARY_PATH PATH
|
||||
}
|
||||
sparc* {
|
||||
if {[msg-quiet cc-check-decls __SUNPRO_C]} {
|
||||
msg-result "Found sun stdio compiler"
|
||||
# sun stdio compiler
|
||||
# XXX: These haven't been fully tested.
|
||||
define SHOBJ_CFLAGS -KPIC
|
||||
define SHOBJ_LDFLAGS "-G"
|
||||
define SH_CFLAGS -KPIC
|
||||
define SH_LINKFLAGS -Wl,-export-dynamic
|
||||
define SH_SOPREFIX -Wl,-h,
|
||||
}
|
||||
}
|
||||
*-*-solaris* {
|
||||
if {[msg-quiet cc-check-decls __SUNPRO_C]} {
|
||||
msg-result "Found sun stdio compiler"
|
||||
# sun stdio compiler
|
||||
# XXX: These haven't been fully tested.
|
||||
define SHOBJ_CFLAGS -KPIC
|
||||
define SHOBJ_LDFLAGS "-G"
|
||||
define SH_CFLAGS -KPIC
|
||||
define SH_LINKFLAGS -Wl,-export-dynamic
|
||||
define SH_SOPREFIX -Wl,-h,
|
||||
}
|
||||
}
|
||||
*-*-hpux {
|
||||
# XXX: These haven't been tested
|
||||
define SHOBJ_CFLAGS "+O3 +z"
|
||||
define SHOBJ_LDFLAGS -b
|
||||
define SH_CFLAGS +z
|
||||
define SH_LINKFLAGS -Wl,+s
|
||||
define LD_LIBRARY_PATH SHLIB_PATH
|
||||
}
|
||||
*-*-haiku {
|
||||
define SHOBJ_CFLAGS ""
|
||||
define SHOBJ_LDFLAGS -shared
|
||||
define SH_CFLAGS ""
|
||||
define SH_LDFLAGS -shared
|
||||
define SH_LINKFLAGS ""
|
||||
define SH_SOPREFIX ""
|
||||
define LD_LIBRARY_PATH LIBRARY_PATH
|
||||
}
|
||||
}
|
||||
|
||||
if {![is-defined SHOBJ_LDFLAGS_R]} {
|
||||
define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
|
||||
}
|
||||
@@ -0,0 +1,756 @@
|
||||
# Copyright (c) 2010 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# The 'cc' module supports checking various 'features' of the C or C++
|
||||
# compiler/linker environment. Common commands are 'cc-check-includes',
|
||||
# 'cc-check-types', 'cc-check-functions', 'cc-with' and 'make-config-header'
|
||||
#
|
||||
# The following environment variables are used if set:
|
||||
#
|
||||
## CC - C compiler
|
||||
## CXX - C++ compiler
|
||||
## CPP - C preprocessor
|
||||
## CCACHE - Set to "none" to disable automatic use of ccache
|
||||
## CPPFLAGS - Additional C preprocessor compiler flags (C and C++), before CFLAGS, CXXFLAGS
|
||||
## CFLAGS - Additional C compiler flags
|
||||
## CXXFLAGS - Additional C++ compiler flags
|
||||
## LDFLAGS - Additional compiler flags during linking
|
||||
## LINKFLAGS - ?How is this different from LDFLAGS?
|
||||
## LIBS - Additional libraries to use (for all tests)
|
||||
## CROSS - Tool prefix for cross compilation
|
||||
#
|
||||
# The following variables are defined from the corresponding
|
||||
# environment variables if set.
|
||||
#
|
||||
## CC_FOR_BUILD
|
||||
## LD
|
||||
|
||||
use system
|
||||
|
||||
options {}
|
||||
|
||||
# Checks for the existence of the given function by linking
|
||||
#
|
||||
proc cctest_function {function} {
|
||||
cctest -link 1 -declare "extern void $function\(void);" -code "$function\();"
|
||||
}
|
||||
|
||||
# Checks for the existence of the given type by compiling
|
||||
proc cctest_type {type} {
|
||||
cctest -code "$type _x;"
|
||||
}
|
||||
|
||||
# Checks for the existence of the given type/structure member.
|
||||
# e.g. "struct stat.st_mtime"
|
||||
proc cctest_member {struct_member} {
|
||||
# split at the first dot
|
||||
regexp {^([^.]+)[.](.*)$} $struct_member -> struct member
|
||||
cctest -code "static $struct _s; return sizeof(_s.$member);"
|
||||
}
|
||||
|
||||
# Checks for the existence of the given define by compiling
|
||||
#
|
||||
proc cctest_define {name} {
|
||||
cctest -code "#ifndef $name\n#error not defined\n#endif"
|
||||
}
|
||||
|
||||
# Checks for the existence of the given name either as
|
||||
# a macro (#define) or an rvalue (such as an enum)
|
||||
#
|
||||
proc cctest_decl {name} {
|
||||
cctest -code "#ifndef $name\n(void)$name;\n#endif"
|
||||
}
|
||||
|
||||
# @cc-check-sizeof type ...
|
||||
#
|
||||
# Checks the size of the given types (between 1 and 32, inclusive).
|
||||
# Defines a variable with the size determined, or 'unknown' otherwise.
|
||||
# e.g. for type 'long long', defines 'SIZEOF_LONG_LONG'.
|
||||
# Returns the size of the last type.
|
||||
#
|
||||
proc cc-check-sizeof {args} {
|
||||
foreach type $args {
|
||||
msg-checking "Checking for sizeof $type..."
|
||||
set size unknown
|
||||
# Try the most common sizes first
|
||||
foreach i {4 8 1 2 16 32} {
|
||||
if {[cctest -code "static int _x\[sizeof($type) == $i ? 1 : -1\] = { 1 };"]} {
|
||||
set size $i
|
||||
break
|
||||
}
|
||||
}
|
||||
msg-result $size
|
||||
set define [feature-define-name $type SIZEOF_]
|
||||
define $define $size
|
||||
}
|
||||
# Return the last result
|
||||
get-define $define
|
||||
}
|
||||
|
||||
# Checks for each feature in $list by using the given script.
|
||||
#
|
||||
# When the script is evaluated, $each is set to the feature
|
||||
# being checked, and $extra is set to any additional cctest args.
|
||||
#
|
||||
# Returns 1 if all features were found, or 0 otherwise.
|
||||
proc cc-check-some-feature {list script} {
|
||||
set ret 1
|
||||
foreach each $list {
|
||||
if {![check-feature $each $script]} {
|
||||
set ret 0
|
||||
}
|
||||
}
|
||||
return $ret
|
||||
}
|
||||
|
||||
# @cc-check-includes includes ...
|
||||
#
|
||||
# Checks that the given include files can be used.
|
||||
proc cc-check-includes {args} {
|
||||
cc-check-some-feature $args {
|
||||
set with {}
|
||||
if {[dict exists $::autosetup(cc-include-deps) $each]} {
|
||||
set deps [dict keys [dict get $::autosetup(cc-include-deps) $each]]
|
||||
msg-quiet cc-check-includes {*}$deps
|
||||
foreach i $deps {
|
||||
if {[have-feature $i]} {
|
||||
lappend with $i
|
||||
}
|
||||
}
|
||||
}
|
||||
if {[llength $with]} {
|
||||
cc-with [list -includes $with] {
|
||||
cctest -includes $each
|
||||
}
|
||||
} else {
|
||||
cctest -includes $each
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-include-needs include required ...
|
||||
#
|
||||
# Ensures that when checking for '$include', a check is first
|
||||
# made for each '$required' file, and if found, it is included with '#include'.
|
||||
proc cc-include-needs {file args} {
|
||||
foreach depfile $args {
|
||||
dict set ::autosetup(cc-include-deps) $file $depfile 1
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-types type ...
|
||||
#
|
||||
# Checks that the types exist.
|
||||
proc cc-check-types {args} {
|
||||
cc-check-some-feature $args {
|
||||
cctest_type $each
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-defines define ...
|
||||
#
|
||||
# Checks that the given preprocessor symbols are defined.
|
||||
proc cc-check-defines {args} {
|
||||
cc-check-some-feature $args {
|
||||
cctest_define $each
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-decls name ...
|
||||
#
|
||||
# Checks that each given name is either a preprocessor symbol or rvalue
|
||||
# such as an enum. Note that the define used is 'HAVE_DECL_xxx'
|
||||
# rather than 'HAVE_xxx'.
|
||||
proc cc-check-decls {args} {
|
||||
set ret 1
|
||||
foreach name $args {
|
||||
msg-checking "Checking for $name..."
|
||||
set r [cctest_decl $name]
|
||||
define-feature "decl $name" $r
|
||||
if {$r} {
|
||||
msg-result "ok"
|
||||
} else {
|
||||
msg-result "not found"
|
||||
set ret 0
|
||||
}
|
||||
}
|
||||
return $ret
|
||||
}
|
||||
|
||||
# @cc-check-functions function ...
|
||||
#
|
||||
# Checks that the given functions exist (can be linked).
|
||||
proc cc-check-functions {args} {
|
||||
cc-check-some-feature $args {
|
||||
cctest_function $each
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-members type.member ...
|
||||
#
|
||||
# Checks that the given type/structure members exist.
|
||||
# A structure member is of the form 'struct stat.st_mtime'.
|
||||
proc cc-check-members {args} {
|
||||
cc-check-some-feature $args {
|
||||
cctest_member $each
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-function-in-lib function libs ?otherlibs?
|
||||
#
|
||||
# Checks that the given function can be found in one of the libs.
|
||||
#
|
||||
# First checks for no library required, then checks each of the libraries
|
||||
# in turn.
|
||||
#
|
||||
# If the function is found, the feature is defined and 'lib_$function' is defined
|
||||
# to '-l$lib' where the function was found, or "" if no library required.
|
||||
# In addition, '-l$lib' is prepended to the 'LIBS' define.
|
||||
#
|
||||
# If additional libraries may be needed for linking, they should be specified
|
||||
# with '$extralibs' as '-lotherlib1 -lotherlib2'.
|
||||
# These libraries are not automatically added to 'LIBS'.
|
||||
#
|
||||
# Returns 1 if found or 0 if not.
|
||||
#
|
||||
proc cc-check-function-in-lib {function libs {otherlibs {}}} {
|
||||
msg-checking "Checking libs for $function..."
|
||||
set found 0
|
||||
cc-with [list -libs $otherlibs] {
|
||||
if {[cctest_function $function]} {
|
||||
msg-result "none needed"
|
||||
define lib_$function ""
|
||||
incr found
|
||||
} else {
|
||||
foreach lib $libs {
|
||||
cc-with [list -libs -l$lib] {
|
||||
if {[cctest_function $function]} {
|
||||
msg-result -l$lib
|
||||
define lib_$function -l$lib
|
||||
# prepend to LIBS
|
||||
define LIBS "-l$lib [get-define LIBS]"
|
||||
incr found
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
define-feature $function $found
|
||||
if {!$found} {
|
||||
msg-result "no"
|
||||
}
|
||||
return $found
|
||||
}
|
||||
|
||||
# @cc-check-tools tool ...
|
||||
#
|
||||
# Checks for existence of the given compiler tools, taking
|
||||
# into account any cross compilation prefix.
|
||||
#
|
||||
# For example, when checking for 'ar', first 'AR' is checked on the command
|
||||
# line and then in the environment. If not found, '${host}-ar' or
|
||||
# simply 'ar' is assumed depending upon whether cross compiling.
|
||||
# The path is searched for this executable, and if found 'AR' is defined
|
||||
# to the executable name.
|
||||
# Note that even when cross compiling, the simple 'ar' is used as a fallback,
|
||||
# but a warning is generated. This is necessary for some toolchains.
|
||||
#
|
||||
# It is an error if the executable is not found.
|
||||
#
|
||||
proc cc-check-tools {args} {
|
||||
foreach tool $args {
|
||||
set TOOL [string toupper $tool]
|
||||
set exe [get-env $TOOL [get-define cross]$tool]
|
||||
if {[find-executable $exe]} {
|
||||
define $TOOL $exe
|
||||
continue
|
||||
}
|
||||
if {[find-executable $tool]} {
|
||||
msg-result "Warning: Failed to find $exe, falling back to $tool which may be incorrect"
|
||||
define $TOOL $tool
|
||||
continue
|
||||
}
|
||||
user-error "Failed to find $exe"
|
||||
}
|
||||
}
|
||||
|
||||
# @cc-check-progs prog ...
|
||||
#
|
||||
# Checks for existence of the given executables on the path.
|
||||
#
|
||||
# For example, when checking for 'grep', the path is searched for
|
||||
# the executable, 'grep', and if found 'GREP' is defined as 'grep'.
|
||||
#
|
||||
# If the executable is not found, the variable is defined as 'false'.
|
||||
# Returns 1 if all programs were found, or 0 otherwise.
|
||||
#
|
||||
proc cc-check-progs {args} {
|
||||
set failed 0
|
||||
foreach prog $args {
|
||||
set PROG [string toupper $prog]
|
||||
msg-checking "Checking for $prog..."
|
||||
if {![find-executable $prog]} {
|
||||
msg-result no
|
||||
define $PROG false
|
||||
incr failed
|
||||
} else {
|
||||
msg-result ok
|
||||
define $PROG $prog
|
||||
}
|
||||
}
|
||||
expr {!$failed}
|
||||
}
|
||||
|
||||
# @cc-path-progs prog ...
|
||||
#
|
||||
# Like cc-check-progs, but sets the define to the full path rather
|
||||
# than just the program name.
|
||||
#
|
||||
proc cc-path-progs {args} {
|
||||
set failed 0
|
||||
foreach prog $args {
|
||||
set PROG [string toupper $prog]
|
||||
msg-checking "Checking for $prog..."
|
||||
set path [find-executable-path $prog]
|
||||
if {$path eq ""} {
|
||||
msg-result no
|
||||
define $PROG false
|
||||
incr failed
|
||||
} else {
|
||||
msg-result $path
|
||||
define $PROG $path
|
||||
}
|
||||
}
|
||||
expr {!$failed}
|
||||
}
|
||||
|
||||
# Adds the given settings to $::autosetup(ccsettings) and
|
||||
# returns the old settings.
|
||||
#
|
||||
proc cc-add-settings {settings} {
|
||||
if {[llength $settings] % 2} {
|
||||
autosetup-error "settings list is missing a value: $settings"
|
||||
}
|
||||
|
||||
set prev [cc-get-settings]
|
||||
# workaround a bug in some versions of jimsh by forcing
|
||||
# conversion of $prev to a list
|
||||
llength $prev
|
||||
|
||||
array set new $prev
|
||||
|
||||
foreach {name value} $settings {
|
||||
switch -exact -- $name {
|
||||
-cflags - -includes {
|
||||
# These are given as lists
|
||||
lappend new($name) {*}[list-non-empty $value]
|
||||
}
|
||||
-declare {
|
||||
lappend new($name) $value
|
||||
}
|
||||
-libs {
|
||||
# Note that new libraries are added before previous libraries
|
||||
set new($name) [list {*}[list-non-empty $value] {*}$new($name)]
|
||||
}
|
||||
-link - -lang - -nooutput {
|
||||
set new($name) $value
|
||||
}
|
||||
-source - -sourcefile - -code {
|
||||
# XXX: These probably are only valid directly from cctest
|
||||
set new($name) $value
|
||||
}
|
||||
default {
|
||||
autosetup-error "unknown cctest setting: $name"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cc-store-settings [array get new]
|
||||
|
||||
return $prev
|
||||
}
|
||||
|
||||
proc cc-store-settings {new} {
|
||||
set ::autosetup(ccsettings) $new
|
||||
}
|
||||
|
||||
proc cc-get-settings {} {
|
||||
return $::autosetup(ccsettings)
|
||||
}
|
||||
|
||||
# Similar to cc-add-settings, but each given setting
|
||||
# simply replaces the existing value.
|
||||
#
|
||||
# Returns the previous settings
|
||||
proc cc-update-settings {args} {
|
||||
set prev [cc-get-settings]
|
||||
cc-store-settings [dict merge $prev $args]
|
||||
return $prev
|
||||
}
|
||||
|
||||
# @cc-with settings ?{ script }?
|
||||
#
|
||||
# Sets the given 'cctest' settings and then runs the tests in '$script'.
|
||||
# Note that settings such as '-lang' replace the current setting, while
|
||||
# those such as '-includes' are appended to the existing setting.
|
||||
#
|
||||
# If no script is given, the settings become the default for the remainder
|
||||
# of the 'auto.def' file.
|
||||
#
|
||||
## cc-with {-lang c++} {
|
||||
## # This will check with the C++ compiler
|
||||
## cc-check-types bool
|
||||
## cc-with {-includes signal.h} {
|
||||
## # This will check with the C++ compiler, signal.h and any existing includes.
|
||||
## ...
|
||||
## }
|
||||
## # back to just the C++ compiler
|
||||
## }
|
||||
#
|
||||
# The '-libs' setting is special in that newer values are added *before* earlier ones.
|
||||
#
|
||||
## cc-with {-libs {-lc -lm}} {
|
||||
## cc-with {-libs -ldl} {
|
||||
## cctest -libs -lsocket ...
|
||||
## # libs will be in this order: -lsocket -ldl -lc -lm
|
||||
## }
|
||||
## }
|
||||
#
|
||||
# If you wish to invoke something like cc-check-flags but not have -cflags updated,
|
||||
# use the following idiom:
|
||||
#
|
||||
## cc-with {} {
|
||||
## cc-check-flags ...
|
||||
## }
|
||||
proc cc-with {settings args} {
|
||||
if {[llength $args] == 0} {
|
||||
cc-add-settings $settings
|
||||
} elseif {[llength $args] > 1} {
|
||||
autosetup-error "usage: cc-with settings ?script?"
|
||||
} else {
|
||||
set save [cc-add-settings $settings]
|
||||
set rc [catch {uplevel 1 [lindex $args 0]} result info]
|
||||
cc-store-settings $save
|
||||
if {$rc != 0} {
|
||||
return -code [dict get $info -code] $result
|
||||
}
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
||||
# @cctest ?settings?
|
||||
#
|
||||
# Low level C/C++ compiler checker. Compiles and or links a small C program
|
||||
# according to the arguments and returns 1 if OK, or 0 if not.
|
||||
#
|
||||
# Supported settings are:
|
||||
#
|
||||
## -cflags cflags A list of flags to pass to the compiler
|
||||
## -includes list A list of includes, e.g. {stdlib.h stdio.h}
|
||||
## -declare code Code to declare before main()
|
||||
## -link 1 Don't just compile, link too
|
||||
## -lang c|c++ Use the C (default) or C++ compiler
|
||||
## -libs liblist List of libraries to link, e.g. {-ldl -lm}
|
||||
## -code code Code to compile in the body of main()
|
||||
## -source code Compile a complete program. Ignore -includes, -declare and -code
|
||||
## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
|
||||
## -nooutput 1 Treat any compiler output (e.g. a warning) as an error
|
||||
#
|
||||
# Unless '-source' or '-sourcefile' is specified, the C program looks like:
|
||||
#
|
||||
## #include <firstinclude> /* same for remaining includes in the list */
|
||||
## declare-code /* any code in -declare, verbatim */
|
||||
## int main(void) {
|
||||
## code /* any code in -code, verbatim */
|
||||
## return 0;
|
||||
## }
|
||||
#
|
||||
# And the command line looks like:
|
||||
#
|
||||
## CC -cflags CFLAGS CPPFLAGS conftest.c -o conftest.o
|
||||
## CXX -cflags CXXFLAGS CPPFLAGS conftest.cpp -o conftest.o
|
||||
#
|
||||
# And if linking:
|
||||
#
|
||||
## CC LDFLAGS -cflags CFLAGS conftest.c -o conftest -libs LIBS
|
||||
## CXX LDFLAGS -cflags CXXFLAGS conftest.c -o conftest -libs LIBS
|
||||
#
|
||||
# Any failures are recorded in 'config.log'
|
||||
#
|
||||
proc cctest {args} {
|
||||
set tmp conftest__
|
||||
|
||||
# Easiest way to merge in the settings
|
||||
cc-with $args {
|
||||
array set opts [cc-get-settings]
|
||||
}
|
||||
|
||||
if {[info exists opts(-sourcefile)]} {
|
||||
set opts(-source) [readfile [get-define srcdir]/$opts(-sourcefile) "#error can't find $opts(-sourcefile)"]
|
||||
}
|
||||
if {[info exists opts(-source)]} {
|
||||
set lines $opts(-source)
|
||||
} else {
|
||||
foreach i $opts(-includes) {
|
||||
if {$opts(-code) ne "" && ![feature-checked $i]} {
|
||||
# Compiling real code with an unchecked header file
|
||||
# Quickly (and silently) check for it now
|
||||
|
||||
# Remove all -includes from settings before checking
|
||||
set saveopts [cc-update-settings -includes {}]
|
||||
msg-quiet cc-check-includes $i
|
||||
cc-store-settings $saveopts
|
||||
}
|
||||
if {$opts(-code) eq "" || [have-feature $i]} {
|
||||
lappend source "#include <$i>"
|
||||
}
|
||||
}
|
||||
lappend source {*}$opts(-declare)
|
||||
lappend source "int main(void) {"
|
||||
lappend source $opts(-code)
|
||||
lappend source "return 0;"
|
||||
lappend source "}"
|
||||
|
||||
set lines [join $source \n]
|
||||
}
|
||||
|
||||
# Build the command line
|
||||
set cmdline {}
|
||||
lappend cmdline {*}[get-define CCACHE]
|
||||
switch -exact -- $opts(-lang) {
|
||||
c++ {
|
||||
set src conftest__.cpp
|
||||
lappend cmdline {*}[get-define CXX]
|
||||
set cflags [get-define CXXFLAGS]
|
||||
}
|
||||
c {
|
||||
set src conftest__.c
|
||||
lappend cmdline {*}[get-define CC]
|
||||
set cflags [get-define CFLAGS]
|
||||
}
|
||||
default {
|
||||
autosetup-error "cctest called with unknown language: $opts(-lang)"
|
||||
}
|
||||
}
|
||||
|
||||
if {$opts(-link)} {
|
||||
lappend cmdline {*}[get-define LDFLAGS]
|
||||
} else {
|
||||
lappend cflags {*}[get-define CPPFLAGS]
|
||||
set tmp conftest__.o
|
||||
lappend cmdline -c
|
||||
}
|
||||
lappend cmdline {*}$opts(-cflags) {*}[get-define cc-default-debug ""] {*}$cflags
|
||||
lappend cmdline $src -o $tmp
|
||||
if {$opts(-link)} {
|
||||
lappend cmdline {*}$opts(-libs) {*}[get-define LIBS]
|
||||
}
|
||||
|
||||
# At this point we have the complete command line and the
|
||||
# complete source to be compiled. Get the result from cache if
|
||||
# we can
|
||||
if {[info exists ::cc_cache($cmdline,$lines)]} {
|
||||
msg-checking "(cached) "
|
||||
set ok $::cc_cache($cmdline,$lines)
|
||||
if {$::autosetup(debug)} {
|
||||
configlog "From cache (ok=$ok): [join $cmdline]"
|
||||
configlog "============"
|
||||
configlog $lines
|
||||
configlog "============"
|
||||
}
|
||||
return $ok
|
||||
}
|
||||
|
||||
writefile $src $lines\n
|
||||
|
||||
set ok 1
|
||||
set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
|
||||
if {$err || ($opts(-nooutput) && [string length $result])} {
|
||||
configlog "Failed: [join $cmdline]"
|
||||
configlog $result
|
||||
configlog "============"
|
||||
configlog "The failed code was:"
|
||||
configlog $lines
|
||||
configlog "============"
|
||||
set ok 0
|
||||
} elseif {$::autosetup(debug)} {
|
||||
configlog "Compiled OK: [join $cmdline]"
|
||||
configlog "============"
|
||||
configlog $lines
|
||||
configlog "============"
|
||||
}
|
||||
file delete $src
|
||||
file delete $tmp
|
||||
|
||||
# cache it
|
||||
set ::cc_cache($cmdline,$lines) $ok
|
||||
|
||||
return $ok
|
||||
}
|
||||
|
||||
# @make-autoconf-h outfile ?auto-patterns=HAVE_*? ?bare-patterns=SIZEOF_*?
|
||||
#
|
||||
# Deprecated - see 'make-config-header'
|
||||
proc make-autoconf-h {file {autopatterns {HAVE_*}} {barepatterns {SIZEOF_* HAVE_DECL_*}}} {
|
||||
user-notice "*** make-autoconf-h is deprecated -- use make-config-header instead"
|
||||
make-config-header $file -auto $autopatterns -bare $barepatterns
|
||||
}
|
||||
|
||||
# @make-config-header outfile ?-auto patternlist? ?-bare patternlist? ?-none patternlist? ?-str patternlist? ...
|
||||
#
|
||||
# Examines all defined variables which match the given patterns
|
||||
# and writes an include file, '$file', which defines each of these.
|
||||
# Variables which match '-auto' are output as follows:
|
||||
# - defines which have the value '0' are ignored.
|
||||
# - defines which have integer values are defined as the integer value.
|
||||
# - any other value is defined as a string, e.g. '"value"'
|
||||
# Variables which match '-bare' are defined as-is.
|
||||
# Variables which match '-str' are defined as a string, e.g. '"value"'
|
||||
# Variables which match '-none' are omitted.
|
||||
#
|
||||
# Note that order is important. The first pattern that matches is selected.
|
||||
# Default behaviour is:
|
||||
#
|
||||
## -bare {SIZEOF_* HAVE_DECL_*} -auto HAVE_* -none *
|
||||
#
|
||||
# If the file would be unchanged, it is not written.
|
||||
proc make-config-header {file args} {
|
||||
set guard _[string toupper [regsub -all {[^a-zA-Z0-9]} [file tail $file] _]]
|
||||
file mkdir [file dirname $file]
|
||||
set lines {}
|
||||
lappend lines "#ifndef $guard"
|
||||
lappend lines "#define $guard"
|
||||
|
||||
# Add some defaults
|
||||
lappend args -bare {SIZEOF_* HAVE_DECL_*} -auto HAVE_*
|
||||
|
||||
foreach n [lsort [dict keys [all-defines]]] {
|
||||
set value [get-define $n]
|
||||
set type [calc-define-output-type $n $args]
|
||||
switch -exact -- $type {
|
||||
-bare {
|
||||
# Just output the value unchanged
|
||||
}
|
||||
-none {
|
||||
continue
|
||||
}
|
||||
-str {
|
||||
set value \"[string map [list \\ \\\\ \" \\\"] $value]\"
|
||||
}
|
||||
-auto {
|
||||
# Automatically determine the type
|
||||
if {$value eq "0"} {
|
||||
lappend lines "/* #undef $n */"
|
||||
continue
|
||||
}
|
||||
if {![string is integer -strict $value]} {
|
||||
set value \"[string map [list \\ \\\\ \" \\\"] $value]\"
|
||||
}
|
||||
}
|
||||
"" {
|
||||
continue
|
||||
}
|
||||
default {
|
||||
autosetup-error "Unknown type in make-config-header: $type"
|
||||
}
|
||||
}
|
||||
lappend lines "#define $n $value"
|
||||
}
|
||||
lappend lines "#endif"
|
||||
set buf [join $lines \n]
|
||||
write-if-changed $file $buf {
|
||||
msg-result "Created $file"
|
||||
}
|
||||
}
|
||||
|
||||
proc calc-define-output-type {name spec} {
|
||||
foreach {type patterns} $spec {
|
||||
foreach pattern $patterns {
|
||||
if {[string match $pattern $name]} {
|
||||
return $type
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
# Initialise some values from the environment or commandline or default settings
|
||||
foreach i {LDFLAGS LIBS CPPFLAGS LINKFLAGS CFLAGS} {
|
||||
lassign $i var default
|
||||
define $var [get-env $var $default]
|
||||
}
|
||||
|
||||
if {[env-is-set CC]} {
|
||||
# Set by the user, so don't try anything else
|
||||
set try [list [get-env CC ""]]
|
||||
} else {
|
||||
# Try some reasonable options
|
||||
set try [list [get-define cross]cc [get-define cross]gcc]
|
||||
}
|
||||
define CC [find-an-executable {*}$try]
|
||||
if {[get-define CC] eq ""} {
|
||||
user-error "Could not find a C compiler. Tried: [join $try ", "]"
|
||||
}
|
||||
|
||||
define CPP [get-env CPP "[get-define CC] -E"]
|
||||
|
||||
# XXX: Could avoid looking for a C++ compiler until requested
|
||||
# If CXX isn't found, it is set to the empty string.
|
||||
if {[env-is-set CXX]} {
|
||||
define CXX [find-an-executable -required [get-env CXX ""]]
|
||||
} else {
|
||||
define CXX [find-an-executable [get-define cross]c++ [get-define cross]g++]
|
||||
}
|
||||
|
||||
# CXXFLAGS default to CFLAGS if not specified
|
||||
define CXXFLAGS [get-env CXXFLAGS [get-define CFLAGS]]
|
||||
|
||||
# May need a CC_FOR_BUILD, so look for one
|
||||
define CC_FOR_BUILD [find-an-executable [get-env CC_FOR_BUILD ""] cc gcc false]
|
||||
|
||||
if {[get-define CC] eq ""} {
|
||||
user-error "Could not find a C compiler. Tried: [join $try ", "]"
|
||||
}
|
||||
|
||||
# These start empty and never come from the user or environment
|
||||
define AS_CFLAGS ""
|
||||
define AS_CPPFLAGS ""
|
||||
define AS_CXXFLAGS ""
|
||||
|
||||
define CCACHE [find-an-executable [get-env CCACHE ccache]]
|
||||
|
||||
# If any of these are set in the environment, propagate them to the AUTOREMAKE commandline
|
||||
foreach i {CC CXX CCACHE CPP CFLAGS CXXFLAGS CXXFLAGS LDFLAGS LIBS CROSS CPPFLAGS LINKFLAGS CC_FOR_BUILD LD} {
|
||||
if {[env-is-set $i]} {
|
||||
# Note: If the variable is set on the command line, get-env will return that value
|
||||
# so the command line will continue to override the environment
|
||||
define-append-argv AUTOREMAKE $i=[get-env $i ""]
|
||||
}
|
||||
}
|
||||
|
||||
# Initial cctest settings
|
||||
cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0}
|
||||
set autosetup(cc-include-deps) {}
|
||||
|
||||
msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS] [get-define CPPFLAGS]"
|
||||
if {[get-define CXX] ne "false"} {
|
||||
msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS] [get-define CPPFLAGS]"
|
||||
}
|
||||
msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
|
||||
|
||||
# On Darwin, we prefer to use -g0 to avoid creating .dSYM directories
|
||||
# but some compilers may not support it, so test here.
|
||||
switch -glob -- [get-define host] {
|
||||
*-*-darwin* {
|
||||
if {[cctest -cflags {-g0}]} {
|
||||
define cc-default-debug -g0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {![cc-check-includes stdlib.h]} {
|
||||
user-error "Compiler does not work. See config.log"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
# Copyright (c) 2012 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# Auto-load module for 'make' build system integration
|
||||
|
||||
use init
|
||||
|
||||
autosetup_add_init_type make {Simple "make" build system} {
|
||||
autosetup_check_create auto.def \
|
||||
{# Initial auto.def created by 'autosetup --init=make'
|
||||
|
||||
use cc
|
||||
|
||||
# Add any user options here
|
||||
options {
|
||||
}
|
||||
|
||||
make-config-header config.h
|
||||
make-template Makefile.in
|
||||
}
|
||||
|
||||
if {![file exists Makefile.in]} {
|
||||
puts "Note: I don't see Makefile.in. You will probably need to create one."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
# Copyright (c) 2016 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# The 'pkg-config' module allows package information to be found via 'pkg-config'.
|
||||
#
|
||||
# If not cross-compiling, the package path should be determined automatically
|
||||
# by 'pkg-config'.
|
||||
# If cross-compiling, the default package path is the compiler sysroot.
|
||||
# If the C compiler doesn't support '-print-sysroot', the path can be supplied
|
||||
# by the '--sysroot' option or by defining 'SYSROOT'.
|
||||
#
|
||||
# 'PKG_CONFIG' may be set to use an alternative to 'pkg-config'.
|
||||
|
||||
use cc
|
||||
|
||||
options {
|
||||
sysroot:dir => "Override compiler sysroot for pkg-config search path"
|
||||
}
|
||||
|
||||
# @pkg-config-init ?required?
|
||||
#
|
||||
# Initialises the 'pkg-config' system. Unless '$required' is set to 0,
|
||||
# it is a fatal error if a usable 'pkg-config' is not found .
|
||||
#
|
||||
# This command will normally be called automatically as required,
|
||||
# but it may be invoked explicitly if lack of 'pkg-config' is acceptable.
|
||||
#
|
||||
# Returns 1 if ok, or 0 if 'pkg-config' not found/usable (only if '$required' is 0).
|
||||
#
|
||||
proc pkg-config-init {{required 1}} {
|
||||
if {[is-defined HAVE_PKG_CONFIG]} {
|
||||
return [get-define HAVE_PKG_CONFIG]
|
||||
}
|
||||
set found 0
|
||||
|
||||
define PKG_CONFIG [get-env PKG_CONFIG pkg-config]
|
||||
msg-checking "Checking for pkg-config..."
|
||||
|
||||
if {[catch {exec [get-define PKG_CONFIG] --version} version]} {
|
||||
msg-result "[get-define PKG_CONFIG] (not found)"
|
||||
if {$required} {
|
||||
user-error "No usable pkg-config"
|
||||
}
|
||||
} else {
|
||||
msg-result $version
|
||||
define PKG_CONFIG_VERSION $version
|
||||
|
||||
set found 1
|
||||
|
||||
if {[opt-str sysroot o]} {
|
||||
define SYSROOT [file-normalize $o]
|
||||
msg-result "Using specified sysroot [get-define SYSROOT]"
|
||||
} elseif {[get-define build] ne [get-define host]} {
|
||||
if {[catch {exec-with-stderr {*}[get-define CC] -print-sysroot} result errinfo] == 0} {
|
||||
# Use the compiler sysroot, if there is one
|
||||
define SYSROOT $result
|
||||
msg-result "Found compiler sysroot $result"
|
||||
} else {
|
||||
configlog "[get-define CC] -print-sysroot: $result"
|
||||
set msg "pkg-config: Cross compiling, but no compiler sysroot and no --sysroot supplied"
|
||||
if {$required} {
|
||||
user-error $msg
|
||||
} else {
|
||||
msg-result $msg
|
||||
}
|
||||
set found 0
|
||||
}
|
||||
}
|
||||
if {[is-defined SYSROOT]} {
|
||||
set sysroot [get-define SYSROOT]
|
||||
|
||||
# XXX: It's possible that these should be set only when invoking pkg-config
|
||||
global env
|
||||
set env(PKG_CONFIG_DIR) ""
|
||||
# Supposedly setting PKG_CONFIG_LIBDIR means that PKG_CONFIG_PATH is ignored,
|
||||
# but it doesn't seem to work that way in practice
|
||||
set env(PKG_CONFIG_PATH) ""
|
||||
# Do we need to try /usr/local as well or instead?
|
||||
set env(PKG_CONFIG_LIBDIR) $sysroot/usr/lib/pkgconfig:$sysroot/usr/share/pkgconfig
|
||||
set env(PKG_CONFIG_SYSROOT_DIR) $sysroot
|
||||
}
|
||||
}
|
||||
define HAVE_PKG_CONFIG $found
|
||||
return $found
|
||||
}
|
||||
|
||||
# @pkg-config module ?requirements?
|
||||
#
|
||||
# Use 'pkg-config' to find the given module meeting the given requirements.
|
||||
# e.g.
|
||||
#
|
||||
## pkg-config pango >= 1.37.0
|
||||
#
|
||||
# If found, returns 1 and sets 'HAVE_PKG_PANGO' to 1 along with:
|
||||
#
|
||||
## PKG_PANGO_VERSION to the found version
|
||||
## PKG_PANGO_LIBS to the required libs (--libs-only-l)
|
||||
## PKG_PANGO_LDFLAGS to the required linker flags (--libs-only-L)
|
||||
## PKG_PANGO_CFLAGS to the required compiler flags (--cflags)
|
||||
#
|
||||
# If not found, returns 0.
|
||||
#
|
||||
proc pkg-config {module args} {
|
||||
set ok [pkg-config-init]
|
||||
|
||||
msg-checking "Checking for $module $args..."
|
||||
|
||||
if {!$ok} {
|
||||
msg-result "no pkg-config"
|
||||
return 0
|
||||
}
|
||||
|
||||
set pkgconfig [get-define PKG_CONFIG]
|
||||
|
||||
set ret [catch {exec $pkgconfig --modversion "$module $args"} version]
|
||||
configlog "$pkgconfig --modversion $module $args: $version"
|
||||
if {$ret} {
|
||||
msg-result "not found"
|
||||
return 0
|
||||
}
|
||||
# Sometimes --modversion succeeds but because of dependencies it isn't usable
|
||||
# This seems to show up with --cflags
|
||||
set ret [catch {exec $pkgconfig --cflags $module} cflags]
|
||||
if {$ret} {
|
||||
msg-result "unusable ($version - see config.log)"
|
||||
configlog "$pkgconfig --cflags $module"
|
||||
configlog $cflags
|
||||
return 0
|
||||
}
|
||||
msg-result $version
|
||||
set prefix [feature-define-name $module PKG_]
|
||||
define HAVE_${prefix}
|
||||
define ${prefix}_VERSION $version
|
||||
define ${prefix}_CFLAGS $cflags
|
||||
define ${prefix}_LIBS [exec $pkgconfig --libs-only-l $module]
|
||||
define ${prefix}_LDFLAGS [exec $pkgconfig --libs-only-L $module]
|
||||
return 1
|
||||
}
|
||||
|
||||
# @pkg-config-get module setting
|
||||
#
|
||||
# Convenience access to the results of 'pkg-config'.
|
||||
#
|
||||
# For example, '[pkg-config-get pango CFLAGS]' returns
|
||||
# the value of 'PKG_PANGO_CFLAGS', or '""' if not defined.
|
||||
proc pkg-config-get {module name} {
|
||||
set prefix [feature-define-name $module PKG_]
|
||||
get-define ${prefix}_${name} ""
|
||||
}
|
||||
|
||||
# @pkg-config-get-var module variable
|
||||
#
|
||||
# Return the value of the given variable from the given pkg-config module.
|
||||
# The module must already have been successfully detected with pkg-config.
|
||||
# e.g.
|
||||
#
|
||||
## if {[pkg-config harfbuzz >= 2.5]} {
|
||||
## define harfbuzz_libdir [pkg-config-get-var harfbuzz libdir]
|
||||
## }
|
||||
#
|
||||
# Returns the empty string if the variable isn't defined.
|
||||
proc pkg-config-get-var {module variable} {
|
||||
set pkgconfig [get-define PKG_CONFIG]
|
||||
set prefix [feature-define-name $module HAVE_PKG_]
|
||||
exec $pkgconfig $module --variable $variable
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
# Copyright (c) 2010 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# This module supports common system interrogation and options
|
||||
# such as '--host', '--build', '--prefix', and setting 'srcdir', 'builddir', and 'EXEEXT'.
|
||||
#
|
||||
# It also support the "feature" naming convention, where searching
|
||||
# for a feature such as 'sys/type.h' defines 'HAVE_SYS_TYPES_H'.
|
||||
#
|
||||
# It defines the following variables, based on '--prefix' unless overridden by the user:
|
||||
#
|
||||
## datadir
|
||||
## sysconfdir
|
||||
## sharedstatedir
|
||||
## localstatedir
|
||||
## infodir
|
||||
## mandir
|
||||
## includedir
|
||||
#
|
||||
# If '--prefix' is not supplied, it defaults to '/usr/local' unless 'options-defaults { prefix ... }' is used *before*
|
||||
# including the 'system' module.
|
||||
|
||||
if {[is-defined defaultprefix]} {
|
||||
user-notice "Note: defaultprefix is deprecated. Use options-defaults to set default options"
|
||||
options-defaults [list prefix [get-define defaultprefix]]
|
||||
}
|
||||
|
||||
options {
|
||||
host:host-alias => {a complete or partial cpu-vendor-opsys for the system where
|
||||
the application will run (defaults to the same value as --build)}
|
||||
build:build-alias => {a complete or partial cpu-vendor-opsys for the system
|
||||
where the application will be built (defaults to the
|
||||
result of running config.guess)}
|
||||
prefix:dir=/usr/local => {the target directory for the build (default: '@default@')}
|
||||
|
||||
# These (hidden) options are supported for autoconf/automake compatibility
|
||||
exec-prefix:
|
||||
bindir:
|
||||
sbindir:
|
||||
includedir:
|
||||
mandir:
|
||||
infodir:
|
||||
libexecdir:
|
||||
datadir:
|
||||
libdir:
|
||||
sysconfdir:
|
||||
sharedstatedir:
|
||||
localstatedir:
|
||||
runstatedir:
|
||||
maintainer-mode=0
|
||||
dependency-tracking=0
|
||||
silent-rules=0
|
||||
program-prefix:
|
||||
program-suffix:
|
||||
program-transform-name:
|
||||
}
|
||||
|
||||
# @check-feature name { script }
|
||||
#
|
||||
# defines feature '$name' to the return value of '$script',
|
||||
# which should be 1 if found or 0 if not found.
|
||||
#
|
||||
# e.g. the following will define 'HAVE_CONST' to 0 or 1.
|
||||
#
|
||||
## check-feature const {
|
||||
## cctest -code {const int _x = 0;}
|
||||
## }
|
||||
proc check-feature {name code} {
|
||||
msg-checking "Checking for $name..."
|
||||
set r [uplevel 1 $code]
|
||||
define-feature $name $r
|
||||
if {$r} {
|
||||
msg-result "ok"
|
||||
} else {
|
||||
msg-result "not found"
|
||||
}
|
||||
return $r
|
||||
}
|
||||
|
||||
# @have-feature name ?default=0?
|
||||
#
|
||||
# Returns the value of feature '$name' if defined, or '$default' if not.
|
||||
#
|
||||
# See 'feature-define-name' for how the "feature" name
|
||||
# is translated into the "define" name.
|
||||
#
|
||||
proc have-feature {name {default 0}} {
|
||||
get-define [feature-define-name $name] $default
|
||||
}
|
||||
|
||||
# @define-feature name ?value=1?
|
||||
#
|
||||
# Sets the feature 'define' to '$value'.
|
||||
#
|
||||
# See 'feature-define-name' for how the "feature" name
|
||||
# is translated into the "define" name.
|
||||
#
|
||||
proc define-feature {name {value 1}} {
|
||||
define [feature-define-name $name] $value
|
||||
}
|
||||
|
||||
# @feature-checked name
|
||||
#
|
||||
# Returns 1 if feature '$name' has been checked, whether true or not.
|
||||
#
|
||||
proc feature-checked {name} {
|
||||
is-defined [feature-define-name $name]
|
||||
}
|
||||
|
||||
# @feature-define-name name ?prefix=HAVE_?
|
||||
#
|
||||
# Converts a "feature" name to the corresponding "define",
|
||||
# e.g. 'sys/stat.h' becomes 'HAVE_SYS_STAT_H'.
|
||||
#
|
||||
# Converts '*' to 'P' and all non-alphanumeric to underscore.
|
||||
#
|
||||
proc feature-define-name {name {prefix HAVE_}} {
|
||||
string toupper $prefix[regsub -all {[^a-zA-Z0-9]} [regsub -all {[*]} $name p] _]
|
||||
}
|
||||
|
||||
# @write-if-changed filename contents ?script?
|
||||
#
|
||||
# If '$filename' doesn't exist, or it's contents are different to '$contents',
|
||||
# the file is written and '$script' is evaluated.
|
||||
#
|
||||
# Otherwise a "file is unchanged" message is displayed.
|
||||
proc write-if-changed {file buf {script {}}} {
|
||||
set old [readfile $file ""]
|
||||
if {$old eq $buf && [file exists $file]} {
|
||||
msg-result "$file is unchanged"
|
||||
} else {
|
||||
writefile $file $buf\n
|
||||
uplevel 1 $script
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# @include-file infile mapping
|
||||
#
|
||||
# The core of make-template, called recursively for each @include
|
||||
# directive found within that template so that this proc's result
|
||||
# is the fully-expanded template.
|
||||
#
|
||||
# The mapping parameter is how we expand @varname@ within the template.
|
||||
# We do that inline within this step only for @include directives which
|
||||
# can have variables in the filename arg. A separate substitution pass
|
||||
# happens when this recursive function returns, expanding the rest of
|
||||
# the variables.
|
||||
#
|
||||
proc include-file {infile mapping} {
|
||||
# A stack of true/false conditions, one for each nested conditional
|
||||
# starting with "true"
|
||||
set condstack {1}
|
||||
set result {}
|
||||
set linenum 0
|
||||
foreach line [split [readfile $infile] \n] {
|
||||
incr linenum
|
||||
if {[regexp {^@(if|else|endif)(\s*)(.*)} $line -> condtype condspace condargs]} {
|
||||
if {$condtype eq "if"} {
|
||||
if {[string length $condspace] == 0} {
|
||||
autosetup-error "$infile:$linenum: Invalid expression: $line"
|
||||
}
|
||||
if {[llength $condargs] == 1} {
|
||||
# ABC => [get-define ABC] ni {0 ""}
|
||||
# !ABC => [get-define ABC] in {0 ""}
|
||||
lassign $condargs condvar
|
||||
if {[regexp {^!(.*)} $condvar -> condvar]} {
|
||||
set op in
|
||||
} else {
|
||||
set op ni
|
||||
}
|
||||
set condexpr "\[[list get-define $condvar]\] $op {0 {}}"
|
||||
} else {
|
||||
# Translate alphanumeric ABC into [get-define ABC] and leave the
|
||||
# rest of the expression untouched
|
||||
regsub -all {([A-Z][[:alnum:]_]*)} $condargs {[get-define \1]} condexpr
|
||||
}
|
||||
if {[catch [list expr $condexpr] condval]} {
|
||||
dputs $condval
|
||||
autosetup-error "$infile:$linenum: Invalid expression: $line"
|
||||
}
|
||||
dputs "@$condtype: $condexpr => $condval"
|
||||
}
|
||||
if {$condtype ne "if"} {
|
||||
if {[llength $condstack] <= 1} {
|
||||
autosetup-error "$infile:$linenum: Error: @$condtype missing @if"
|
||||
} elseif {[string length $condargs] && [string index $condargs 0] ne "#"} {
|
||||
autosetup-error "$infile:$linenum: Error: Extra arguments after @$condtype"
|
||||
}
|
||||
}
|
||||
switch -exact $condtype {
|
||||
if {
|
||||
# push condval
|
||||
lappend condstack $condval
|
||||
}
|
||||
else {
|
||||
# Toggle the last entry
|
||||
set condval [lpop condstack]
|
||||
set condval [expr {!$condval}]
|
||||
lappend condstack $condval
|
||||
}
|
||||
endif {
|
||||
if {[llength $condstack] == 0} {
|
||||
user-notice "$infile:$linenum: Error: @endif missing @if"
|
||||
}
|
||||
lpop condstack
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
# Only continue if the stack contains all "true"
|
||||
if {"0" in $condstack} {
|
||||
continue
|
||||
}
|
||||
if {[regexp {^@include\s+(.*)} $line -> filearg]} {
|
||||
set incfile [string map $mapping $filearg]
|
||||
if {[file exists $incfile]} {
|
||||
lappend ::autosetup(deps) [file-normalize $incfile]
|
||||
lappend result {*}[include-file $incfile $mapping]
|
||||
} else {
|
||||
user-error "$infile:$linenum: Include file $incfile is missing"
|
||||
}
|
||||
continue
|
||||
}
|
||||
if {[regexp {^@define\s+(\w+)\s+(.*)} $line -> var val]} {
|
||||
define $var $val
|
||||
continue
|
||||
}
|
||||
lappend result $line
|
||||
}
|
||||
return $result
|
||||
}
|
||||
|
||||
|
||||
# @make-template template ?outfile?
|
||||
#
|
||||
# Reads the input file '<srcdir>/$template' and writes the output file '$outfile'
|
||||
# (unless unchanged).
|
||||
# If '$outfile' is blank/omitted, '$template' should end with '.in' which
|
||||
# is removed to create the output file name.
|
||||
#
|
||||
# Each pattern of the form '@define@' is replaced with the corresponding
|
||||
# "define", if it exists, or left unchanged if not.
|
||||
#
|
||||
# The special value '@srcdir@' is substituted with the relative
|
||||
# path to the source directory from the directory where the output
|
||||
# file is created, while the special value '@top_srcdir@' is substituted
|
||||
# with the relative path to the top level source directory.
|
||||
#
|
||||
# Conditional sections may be specified as follows:
|
||||
## @if NAME eq "value"
|
||||
## lines
|
||||
## @else
|
||||
## lines
|
||||
## @endif
|
||||
#
|
||||
# Where 'NAME' is a defined variable name and '@else' is optional.
|
||||
# Note that variables names *must* start with an uppercase letter.
|
||||
# If the expression does not match, all lines through '@endif' are ignored.
|
||||
#
|
||||
# The alternative forms may also be used:
|
||||
## @if NAME (true if the variable is defined, but not empty and not "0")
|
||||
## @if !NAME (opposite of the form above)
|
||||
## @if <general-tcl-expression>
|
||||
#
|
||||
# In the general Tcl expression, any words beginning with an uppercase letter
|
||||
# are translated into [get-define NAME]
|
||||
#
|
||||
# Expressions may be nested
|
||||
#
|
||||
proc make-template {template {out {}}} {
|
||||
set infile [file join $::autosetup(srcdir) $template]
|
||||
|
||||
if {![file exists $infile]} {
|
||||
user-error "Template $template is missing"
|
||||
}
|
||||
|
||||
# Define this as late as possible
|
||||
define AUTODEPS $::autosetup(deps)
|
||||
|
||||
if {$out eq ""} {
|
||||
if {[file ext $template] ne ".in"} {
|
||||
autosetup-error "make_template $template has no target file and can't guess"
|
||||
}
|
||||
set out [file rootname $template]
|
||||
}
|
||||
|
||||
set outdir [file dirname $out]
|
||||
|
||||
# Make sure the directory exists
|
||||
file mkdir $outdir
|
||||
|
||||
# Set up srcdir and top_srcdir to be relative to the target dir
|
||||
define srcdir [relative-path [file join $::autosetup(srcdir) $outdir] $outdir]
|
||||
define top_srcdir [relative-path $::autosetup(srcdir) $outdir]
|
||||
|
||||
# Build map from global defines to their values so they can be
|
||||
# substituted into @include file names.
|
||||
proc build-define-mapping {} {
|
||||
set mapping {}
|
||||
foreach {n v} [array get ::define] {
|
||||
lappend mapping @$n@ $v
|
||||
}
|
||||
return $mapping
|
||||
}
|
||||
set mapping [build-define-mapping]
|
||||
|
||||
set result [include-file $infile $mapping]
|
||||
|
||||
# Rebuild the define mapping in case we ran across @define
|
||||
# directives in the template or a file it @included, then
|
||||
# apply that mapping to the expanded template.
|
||||
set mapping [build-define-mapping]
|
||||
write-if-changed $out [string map $mapping [join $result \n]] {
|
||||
msg-result "Created [relative-path $out] from [relative-path $template]"
|
||||
}
|
||||
}
|
||||
|
||||
# build/host tuples and cross-compilation prefix
|
||||
opt-str build build ""
|
||||
define build_alias $build
|
||||
if {$build eq ""} {
|
||||
define build [config_guess]
|
||||
} else {
|
||||
define build [config_sub $build]
|
||||
}
|
||||
|
||||
opt-str host host ""
|
||||
define host_alias $host
|
||||
if {$host eq ""} {
|
||||
define host [get-define build]
|
||||
set cross ""
|
||||
} else {
|
||||
define host [config_sub $host]
|
||||
set cross $host-
|
||||
}
|
||||
define cross [get-env CROSS $cross]
|
||||
|
||||
# build/host _cpu, _vendor and _os
|
||||
foreach type {build host} {
|
||||
set v [get-define $type]
|
||||
if {![regexp {^([^-]+)-([^-]+)-(.*)$} $v -> cpu vendor os]} {
|
||||
user-error "Invalid canonical $type: $v"
|
||||
}
|
||||
define ${type}_cpu $cpu
|
||||
define ${type}_vendor $vendor
|
||||
define ${type}_os $os
|
||||
}
|
||||
|
||||
opt-str prefix prefix /usr/local
|
||||
|
||||
# These are for compatibility with autoconf
|
||||
define target [get-define host]
|
||||
define prefix $prefix
|
||||
define builddir $autosetup(builddir)
|
||||
define srcdir $autosetup(srcdir)
|
||||
define top_srcdir $autosetup(srcdir)
|
||||
define abs_top_srcdir [file-normalize $autosetup(srcdir)]
|
||||
define abs_top_builddir [file-normalize $autosetup(builddir)]
|
||||
|
||||
# autoconf supports all of these
|
||||
define exec_prefix [opt-str exec-prefix exec_prefix $prefix]
|
||||
foreach {name defpath} {
|
||||
bindir /bin
|
||||
sbindir /sbin
|
||||
libexecdir /libexec
|
||||
libdir /lib
|
||||
} {
|
||||
define $name [opt-str $name o $exec_prefix$defpath]
|
||||
}
|
||||
foreach {name defpath} {
|
||||
datadir /share
|
||||
sharedstatedir /com
|
||||
infodir /share/info
|
||||
mandir /share/man
|
||||
includedir /include
|
||||
} {
|
||||
define $name [opt-str $name o $prefix$defpath]
|
||||
}
|
||||
if {$prefix ne {/usr}} {
|
||||
opt-str sysconfdir sysconfdir $prefix/etc
|
||||
} else {
|
||||
opt-str sysconfdir sysconfdir /etc
|
||||
}
|
||||
define sysconfdir $sysconfdir
|
||||
|
||||
define localstatedir [opt-str localstatedir o /var]
|
||||
define runstatedir [opt-str runstatedir o /run]
|
||||
|
||||
define SHELL [get-env SHELL [find-an-executable sh bash ksh]]
|
||||
|
||||
# These could be used to generate Makefiles following some automake conventions
|
||||
define AM_SILENT_RULES [opt-bool silent-rules]
|
||||
define AM_MAINTAINER_MODE [opt-bool maintainer-mode]
|
||||
define AM_DEPENDENCY_TRACKING [opt-bool dependency-tracking]
|
||||
|
||||
# Windows vs. non-Windows
|
||||
switch -glob -- [get-define host] {
|
||||
*-*-ming* - *-*-cygwin - *-*-msys {
|
||||
define-feature windows
|
||||
define EXEEXT .exe
|
||||
}
|
||||
default {
|
||||
define EXEEXT ""
|
||||
}
|
||||
}
|
||||
|
||||
# Display
|
||||
msg-result "Host System...[get-define host]"
|
||||
msg-result "Build System...[get-define build]"
|
||||
@@ -0,0 +1,73 @@
|
||||
# Copyright (c) 2016 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# Auto-load module for 'tmake' build system integration
|
||||
|
||||
use init
|
||||
|
||||
autosetup_add_init_type tmake "Tcl-based tmake build system" {
|
||||
autosetup_check_create auto.def \
|
||||
{# Initial auto.def created by 'autosetup --init=tmake'
|
||||
# vim:set syntax=tcl:
|
||||
|
||||
use cc cc-lib cc-db cc-shared
|
||||
use tmake
|
||||
|
||||
# Add any user options here
|
||||
# Really want a --configure that takes over the rest of the command line
|
||||
options {
|
||||
}
|
||||
|
||||
cc-check-tools ar ranlib
|
||||
|
||||
set objdir [get-env BUILDDIR objdir]
|
||||
|
||||
make-config-header $objdir/include/autoconf.h
|
||||
make-tmake-settings $objdir/settings.conf {[A-Z]*} *dir lib_*
|
||||
}
|
||||
|
||||
autosetup_check_create project.spec \
|
||||
{# Initial project.spec created by 'autosetup --init=tmake'
|
||||
|
||||
tmake-require-version 0.7.3
|
||||
|
||||
# vim:set syntax=tcl:
|
||||
define? DESTDIR _install
|
||||
|
||||
# XXX If configure creates additional/different files than include/autoconf.h
|
||||
# that should be reflected here
|
||||
Autosetup include/autoconf.h
|
||||
|
||||
# e.g. for autoconf.h
|
||||
IncludePaths include
|
||||
|
||||
ifconfig !CONFIGURED {
|
||||
# Not configured, so don't process subdirs
|
||||
AutoSubDirs off
|
||||
# And don't process this file any further
|
||||
ifconfig false
|
||||
}
|
||||
}
|
||||
|
||||
set configure [readfile configure]
|
||||
# XXX Do we need also need to support a system install of tmake?
|
||||
if {[string first {#@TMAKEUPDATED@} $configure] < 0} {
|
||||
if {[regsub {#@@INITCHECK@@#} $configure \
|
||||
{test -z "$TMAKE" -a -x "$dir/tmake" \&\& exec "$dir/tmake" --force --configure "$@"; #@TMAKEUPDATED@} configure]} {
|
||||
writefile configure $configure\n
|
||||
exec chmod +x configure
|
||||
puts "Updated configure to invoke local tmake."
|
||||
if {![file exec autosetup/tmake]} {
|
||||
puts "Warning: autosetup/tmake is missing."
|
||||
puts " Install it with: tmake --install=autosetup"
|
||||
}
|
||||
} else {
|
||||
puts "Warning: configure isn't created by a recent autosetup, not updating."
|
||||
}
|
||||
} else {
|
||||
puts "I see configure for tmake already exists."
|
||||
}
|
||||
if {![file exists build.spec]} {
|
||||
puts "Note: I don't see build.spec. Try running: tmake --genie"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
# Copyright (c) 2011 WorkWare Systems http://www.workware.net.au/
|
||||
# All rights reserved
|
||||
|
||||
# @synopsis:
|
||||
#
|
||||
# The 'tmake' module makes it easy to support the tmake build system.
|
||||
#
|
||||
# The following variables are set:
|
||||
#
|
||||
## CONFIGURED - to indicate that the project is configured
|
||||
|
||||
use system
|
||||
|
||||
options {}
|
||||
|
||||
define CONFIGURED
|
||||
|
||||
# @make-tmake-settings outfile patterns ...
|
||||
#
|
||||
# Examines all defined variables which match the given patterns (defaults to '*')
|
||||
# and writes a tmake-compatible .conf file defining those variables.
|
||||
# For example, if 'ABC' is '"3 monkeys"' and 'ABC' matches a pattern, then the file will include:
|
||||
#
|
||||
## define ABC {3 monkeys}
|
||||
#
|
||||
# If the file would be unchanged, it is not written.
|
||||
#
|
||||
# Typical usage is:
|
||||
#
|
||||
## make-tmake-settings [get-env BUILDDIR objdir]/settings.conf {[A-Z]*}
|
||||
proc make-tmake-settings {file args} {
|
||||
file mkdir [file dirname $file]
|
||||
set lines {}
|
||||
|
||||
if {[llength $args] == 0} {
|
||||
set args *
|
||||
}
|
||||
|
||||
foreach n [lsort [dict keys [all-defines]]] {
|
||||
foreach p $args {
|
||||
if {[string match $p $n]} {
|
||||
set value [get-define $n]
|
||||
lappend lines "define $n [list $value]"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
set buf [join $lines \n]
|
||||
write-if-changed $file $buf {
|
||||
msg-result "Created $file"
|
||||
}
|
||||
}
|
||||
@@ -1,808 +0,0 @@
|
||||
#
|
||||
# The build process allows for using a cross-compiler. But the default
|
||||
# action is to target the same platform that we are running on. The
|
||||
# configure script needs to discover the following properties of the
|
||||
# build and target systems:
|
||||
#
|
||||
# srcdir
|
||||
#
|
||||
# The is the name of the directory that contains the
|
||||
# "configure" shell script. All source files are
|
||||
# located relative to this directory.
|
||||
#
|
||||
# bindir
|
||||
#
|
||||
# The name of the directory where executables should be
|
||||
# written by the "install" target of the makefile.
|
||||
#
|
||||
# program_prefix
|
||||
#
|
||||
# Add this prefix to the names of all executables that run
|
||||
# on the target machine. Default: ""
|
||||
#
|
||||
# ENABLE_SHARED
|
||||
#
|
||||
# True if shared libraries should be generated.
|
||||
#
|
||||
# BUILD_CC
|
||||
#
|
||||
# The name of a command that is used to convert C
|
||||
# source files into executables that run on the build
|
||||
# platform.
|
||||
#
|
||||
# BUILD_CFLAGS
|
||||
#
|
||||
# Switches that the build compiler needs in order to construct
|
||||
# command-line programs.
|
||||
#
|
||||
# BUILD_LIBS
|
||||
#
|
||||
# Libraries that the build compiler needs in order to construct
|
||||
# command-line programs.
|
||||
#
|
||||
# BUILD_EXEEXT
|
||||
#
|
||||
# The filename extension for executables on the build
|
||||
# platform. "" for Unix and ".exe" for Windows.
|
||||
#
|
||||
# TCL_*
|
||||
#
|
||||
# Lots of values are read in from the tclConfig.sh script,
|
||||
# if that script is available. This values are used for
|
||||
# constructing and installing the TCL extension.
|
||||
#
|
||||
# TARGET_READLINE_LIBS
|
||||
#
|
||||
# This is the library directives passed to the target linker
|
||||
# that cause the executable to link against the readline library.
|
||||
# This might be a switch like "-lreadline" or pathnames of library
|
||||
# file like "../../src/libreadline.a".
|
||||
#
|
||||
# TARGET_READLINE_INC
|
||||
#
|
||||
# This variables define the directory that contain header
|
||||
# files for the readline library. If the compiler is able
|
||||
# to find <readline.h> on its own, then this can be blank.
|
||||
#
|
||||
# TARGET_EXEEXT
|
||||
#
|
||||
# The filename extension for executables on the
|
||||
# target platform. "" for Unix and ".exe" for windows.
|
||||
#
|
||||
# This configure.in file is easy to reuse on other projects. Just
|
||||
# change the argument to AC_INIT. And disable any features that
|
||||
# you don't need (for example BLT) by erasing or commenting out
|
||||
# the corresponding code.
|
||||
#
|
||||
AC_INIT([sqlite],m4_esyscmd(cat VERSION | tr -d '\n'))
|
||||
|
||||
dnl Make sure the local VERSION file matches this configure script
|
||||
sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'`
|
||||
if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then
|
||||
AC_MSG_ERROR([configure script is out of date:
|
||||
configure \$PACKAGE_VERSION = $PACKAGE_VERSION
|
||||
top level VERSION file = $sqlite_version_sanity_check
|
||||
please regen with autoconf])
|
||||
fi
|
||||
|
||||
#########
|
||||
# Programs needed
|
||||
#
|
||||
LT_INIT
|
||||
AC_PROG_INSTALL
|
||||
|
||||
#########
|
||||
# Enable large file support (if special flags are necessary)
|
||||
#
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
#########
|
||||
# Check for needed/wanted data types
|
||||
AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t,
|
||||
uint16_t, uint32_t, uint64_t, uintptr_t])
|
||||
|
||||
#########
|
||||
# Check for needed/wanted headers
|
||||
AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h])
|
||||
|
||||
#########
|
||||
# Figure out whether or not we have these functions
|
||||
#
|
||||
AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64])
|
||||
|
||||
#########
|
||||
# By default, we use the amalgamation (this may be changed below...)
|
||||
#
|
||||
USE_AMALGAMATION=1
|
||||
|
||||
#########
|
||||
# Figure out all the name of a working tclsh and parameters needed to compile against Tcl.
|
||||
# The --with-tcl= and/or --with-tclsh= configuration arguments might be useful for this.
|
||||
#
|
||||
AC_ARG_WITH(tclsh, AS_HELP_STRING([--with-tclsh=PATHNAME],[full pathname of a tclsh to use]))
|
||||
AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl=DIR],[directory containing (tclConfig.sh)]))
|
||||
AC_ARG_ENABLE(tcl, AS_HELP_STRING([--disable-tcl],[omit building accessory programs that require TCL-dev]),
|
||||
[use_tcl=$enableval],[use_tcl=yes])
|
||||
original_use_tcl=${use_tcl}
|
||||
if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then
|
||||
AC_CHECK_PROGS(TCLSH_CMD, [tclsh9.0 tclsh8.6 tclsh],none)
|
||||
with_tclsh=${TCLSH_CMD}
|
||||
fi
|
||||
if test x"${with_tclsh}" != x -a x"${with_tclsh}" != xnone; then
|
||||
TCLSH_CMD=${with_tclsh}
|
||||
AC_MSG_RESULT([using tclsh at "$TCLSH_CMD"])
|
||||
if test x"${use_tcl}" = "xyes"; then
|
||||
with_tcl=`${with_tclsh} <${srcdir}/tool/find_tclconfig.tcl`
|
||||
if test x"${with_tcl}" != x; then
|
||||
AC_MSG_RESULT([$TCLSH_CMD recommends the tclConfig.sh at ${with_tcl}])
|
||||
else
|
||||
AC_MSG_WARN([$TCLSH_CMD is unable to recommend a tclConfig.sh])
|
||||
use_tcl=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test x"${use_tcl}" = "xyes"; then
|
||||
if test x"${with_tcl}" != x; then
|
||||
if test -r ${with_tcl}/tclConfig.sh; then
|
||||
tclconfig="${with_tcl}/tclConfig.sh"
|
||||
else
|
||||
for i in tcl8.6 tcl9.0 lib; do
|
||||
if test -r ${with_tcl}/$i/tclConfig.sh; then
|
||||
tclconfig=${with_tcl}/$i/tclConfig.sh
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test ! -r "${tclconfig}"; then
|
||||
AC_MSG_ERROR([no tclConfig.sh file found under ${with_tcl}])
|
||||
fi
|
||||
else
|
||||
# If we have not yet found a tclConfig.sh file, look in $libdir whic is
|
||||
# set automatically by autoconf or by the --prefix command-line option.
|
||||
# See https://sqlite.org/forum/forumpost/e04e693439a22457
|
||||
libdir=${prefix}/lib
|
||||
if test -r ${libdir}/tclConfig.sh; then
|
||||
tclconfig=${libdir}/tclConfig.sh
|
||||
else
|
||||
for i in tcl8.6 tcl9.0 lib; do
|
||||
if test -r ${libdir}/$i/tclConfig.sh; then
|
||||
tclconfig=${libdir}/$i/tclConfig.sh
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test ! -r "${tclconfig}"; then
|
||||
AC_MSG_ERROR([cannot find a usable tclConfig.sh file.
|
||||
Use --with-tcl=DIR to specify a directory where tclConfig.sh can be found.
|
||||
SQLite does not use TCL internally, but TCL is required to build SQLite
|
||||
from canonical sources and TCL is required for testing.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([loading TCL configuration from ${tclconfig}])
|
||||
. ${tclconfig}
|
||||
AC_SUBST(TCL_INCLUDE_SPEC)
|
||||
AC_SUBST(TCL_LIB_SPEC)
|
||||
AC_SUBST(TCL_STUB_LIB_SPEC)
|
||||
# There are lots of other configuration variables that are provided by the
|
||||
# tclConfig.sh file and that could be included here. But as of right now,
|
||||
# TCL_LIB_SPEC is the only what that the Makefile uses.
|
||||
HAVE_TCL=1
|
||||
elif test x"${original_use_tcl}" = "xno"; then
|
||||
AC_MSG_RESULT([unable to run tests because of --disable-tcl])
|
||||
HAVE_TCL=0
|
||||
else
|
||||
AC_MSG_RESULT([unable to run tests because no tclConfig.sh file could be located])
|
||||
HAVE_TCL=0
|
||||
fi
|
||||
AC_SUBST(HAVE_TCL)
|
||||
if test x"$TCLSH_CMD" == x; then
|
||||
TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
|
||||
if test ! -x ${TCLSH_CMD}; then
|
||||
TCLSH_CMD_2=${TCL_EXEC_PREFIX}/bin/tclsh
|
||||
if test ! -x ${TCLSH_CMD_2}; then
|
||||
AC_MSG_WARN([cannot find a usable tclsh at either ${TCLSH_CMD} or ${TCLSH_CMD_2}])
|
||||
TCLSH_CMD=none
|
||||
else
|
||||
TCLSH_CMD=${TCLSH_CMD_2}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$TCLSH_CMD" = "none"; then
|
||||
# If we can't find a local tclsh, then building the amalgamation will fail.
|
||||
# We act as though --disable-amalgamation has been used.
|
||||
AC_MSG_WARN([Warning: can't find tclsh - defaulting to non-amalgamation build.])
|
||||
USE_AMALGAMATION=0
|
||||
TCLSH_CMD="tclsh"
|
||||
fi
|
||||
AC_SUBST(TCLSH_CMD)
|
||||
|
||||
AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin])
|
||||
if test "x${TCLLIBDIR+set}" != "xset" ; then
|
||||
for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do
|
||||
if test -d $i ; then
|
||||
TCLLIBDIR=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
TCLLIBDIR="${TCLLIBDIR}/sqlite3"
|
||||
fi
|
||||
|
||||
#########
|
||||
# Set up options for running tests.
|
||||
#
|
||||
AC_ARG_ENABLE(test-status, AS_HELP_STRING([--enable-test-status],[Full-screen status of tests]),
|
||||
[use_vt100=$enableval],[use_vt100=no])
|
||||
if test $use_vt100 != no; then
|
||||
TSTRNNR_OPTS=--status
|
||||
else
|
||||
TSTRNNR_OPTS=
|
||||
fi
|
||||
AC_SUBST(TSTRNNR_OPTS)
|
||||
|
||||
|
||||
#########
|
||||
# Set up an appropriate program prefix
|
||||
#
|
||||
if test "$program_prefix" = "NONE"; then
|
||||
program_prefix=""
|
||||
fi
|
||||
AC_SUBST(program_prefix)
|
||||
|
||||
VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`]
|
||||
AC_MSG_NOTICE(Version set to $VERSION)
|
||||
AC_SUBST(VERSION)
|
||||
RELEASE=`cat $srcdir/VERSION`
|
||||
AC_MSG_NOTICE(Release set to $RELEASE)
|
||||
AC_SUBST(RELEASE)
|
||||
|
||||
##########
|
||||
# Handle --with-wasi-sdk=DIR
|
||||
#
|
||||
# This must be early because it changes the toolchain.
|
||||
#
|
||||
AC_ARG_WITH(wasi-sdk,
|
||||
AS_HELP_STRING([--with-wasi-sdk=DIR],
|
||||
[directory containing the WASI SDK. Triggers cross-compile to WASM.]), with_wasisdk=${withval})
|
||||
AC_MSG_CHECKING([for WASI SDK directory])
|
||||
AC_CACHE_VAL(ac_cv_c_wasi_sdk,[
|
||||
# First check to see if --with-tcl was specified.
|
||||
if test x"${with_wasi_sdk}" != x ; then
|
||||
if ! test -d "${with_wasi_sdk}" ; then
|
||||
AC_MSG_ERROR([${with_wasi_sdk} directory doesn't exist])
|
||||
fi
|
||||
AC_MSG_RESULT([${with_wasi_sdk}: using wasi-sdk clang, disabling: tcl, CLI shell, DLL])
|
||||
use_wasi_sdk=yes
|
||||
else
|
||||
use_wasi_sdk=no
|
||||
fi
|
||||
])
|
||||
if test "${use_wasi_sdk}" = "no" ; then
|
||||
HAVE_WASI_SDK=""
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
HAVE_WASI_SDK=1
|
||||
# Changing --host and --target have no effect here except to possibly
|
||||
# cause confusion. autoconf has finished processing them by this
|
||||
# point.
|
||||
#
|
||||
# host_alias=wasm32-wasi
|
||||
# target=wasm32-wasi
|
||||
#
|
||||
# Merely changing CC and LD to the wasi-sdk's is enough to get
|
||||
# sqlite3.o building in WASM format.
|
||||
CC="${with_wasi_sdk}/bin/clang"
|
||||
LD="${with_wasi_sdk}/bin/wasm-ld"
|
||||
RANLIB="${with_wasi_sdk}/bin/llvm-ranlib"
|
||||
cross_compiling=yes
|
||||
enable_threadsafe=no
|
||||
use_tcl=no
|
||||
enable_tcl=no
|
||||
# libtool is apparently hard-coded to use gcc for linking DLLs, so
|
||||
# we disable the DLL build...
|
||||
enable_shared=no
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
AC_SUBST(HAVE_WASI_SDK)
|
||||
|
||||
|
||||
#########
|
||||
# Locate a compiler for the build machine. This compiler should
|
||||
# generate command-line programs that run on the build machine.
|
||||
#
|
||||
if test x"$cross_compiling" = xno; then
|
||||
BUILD_CC=$CC
|
||||
BUILD_CFLAGS=$CFLAGS
|
||||
else
|
||||
if test "${BUILD_CC+set}" != set; then
|
||||
AC_CHECK_PROGS(BUILD_CC, gcc cc cl)
|
||||
fi
|
||||
if test "${BUILD_CFLAGS+set}" != set; then
|
||||
BUILD_CFLAGS="-g"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(BUILD_CC)
|
||||
|
||||
##########
|
||||
# Do we want to support multithreaded use of sqlite
|
||||
#
|
||||
AC_ARG_ENABLE(threadsafe,
|
||||
AS_HELP_STRING([--disable-threadsafe],[Disable mutexing]))
|
||||
AC_MSG_CHECKING([whether to support threadsafe operation])
|
||||
if test "$enable_threadsafe" = "no"; then
|
||||
SQLITE_THREADSAFE=0
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
SQLITE_THREADSAFE=1
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
AC_SUBST(SQLITE_THREADSAFE)
|
||||
|
||||
if test "$SQLITE_THREADSAFE" = "1"; then
|
||||
AC_SEARCH_LIBS(pthread_create, pthread)
|
||||
AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
|
||||
fi
|
||||
|
||||
##########
|
||||
# Do we want to support release
|
||||
#
|
||||
AC_ARG_ENABLE(releasemode,
|
||||
AS_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no)
|
||||
AC_MSG_CHECKING([whether to support shared library linked as release mode or not])
|
||||
if test "$enable_releasemode" = "no"; then
|
||||
ALLOWRELEASE=""
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
ALLOWRELEASE="-release `cat $srcdir/VERSION`"
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
AC_SUBST(ALLOWRELEASE)
|
||||
|
||||
##########
|
||||
# Do we want temporary databases in memory
|
||||
#
|
||||
AC_ARG_ENABLE(tempstore,
|
||||
AS_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no)
|
||||
AC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
|
||||
case "$enable_tempstore" in
|
||||
never )
|
||||
TEMP_STORE=0
|
||||
AC_MSG_RESULT([never])
|
||||
;;
|
||||
no )
|
||||
TEMP_STORE=1
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
yes )
|
||||
TEMP_STORE=2
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
always )
|
||||
TEMP_STORE=3
|
||||
AC_MSG_RESULT([always])
|
||||
;;
|
||||
* )
|
||||
TEMP_STORE=1
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(TEMP_STORE)
|
||||
|
||||
###########
|
||||
# Lots of things are different if we are compiling for Windows using
|
||||
# the CYGWIN environment. So check for that special case and handle
|
||||
# things accordingly.
|
||||
#
|
||||
AC_MSG_CHECKING([if executables have the .exe suffix])
|
||||
if test "$config_BUILD_EXEEXT" = ".exe"; then
|
||||
CYGWIN=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(unknown)
|
||||
fi
|
||||
if test "$CYGWIN" != "yes"; then
|
||||
m4_warn([obsolete],
|
||||
[AC_CYGWIN is obsolete: use AC_CANONICAL_HOST and check if $host_os
|
||||
matches *cygwin*])dnl
|
||||
AC_CANONICAL_HOST
|
||||
case $host_os in
|
||||
*cygwin* ) CYGWIN=yes;;
|
||||
* ) CYGWIN=no;;
|
||||
esac
|
||||
|
||||
fi
|
||||
if test "$CYGWIN" = "yes"; then
|
||||
BUILD_EXEEXT=.exe
|
||||
else
|
||||
BUILD_EXEEXT=$EXEEXT
|
||||
fi
|
||||
if test x"$cross_compiling" = xno; then
|
||||
TARGET_EXEEXT=$BUILD_EXEEXT
|
||||
else
|
||||
TARGET_EXEEXT=$config_TARGET_EXEEXT
|
||||
fi
|
||||
if test "$TARGET_EXEEXT" = ".exe"; then
|
||||
SQLITE_OS_UNIX=0
|
||||
SQLITE_OS_WIN=1
|
||||
CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1"
|
||||
else
|
||||
SQLITE_OS_UNIX=1
|
||||
SQLITE_OS_WIN=0
|
||||
CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1"
|
||||
fi
|
||||
|
||||
AC_SUBST(BUILD_EXEEXT)
|
||||
AC_SUBST(SQLITE_OS_UNIX)
|
||||
AC_SUBST(SQLITE_OS_WIN)
|
||||
AC_SUBST(TARGET_EXEEXT)
|
||||
|
||||
##########
|
||||
# Figure out what C libraries are required to compile programs
|
||||
# that use "readline()" library.
|
||||
#
|
||||
TARGET_READLINE_LIBS=""
|
||||
TARGET_READLINE_INC=""
|
||||
TARGET_HAVE_READLINE=0
|
||||
TARGET_HAVE_EDITLINE=0
|
||||
AC_ARG_ENABLE([editline],
|
||||
[AS_HELP_STRING([--enable-editline],[enable BSD editline support])],
|
||||
[with_editline=$enableval],
|
||||
[with_editline=auto])
|
||||
AC_ARG_ENABLE([readline],
|
||||
[AS_HELP_STRING([--disable-readline],[disable readline support])],
|
||||
[with_readline=$enableval],
|
||||
[with_readline=auto])
|
||||
|
||||
if test x"$with_editline" != xno; then
|
||||
sLIBS=$LIBS
|
||||
LIBS=""
|
||||
TARGET_HAVE_EDITLINE=1
|
||||
AC_SEARCH_LIBS(readline,edit,[with_readline=no],[TARGET_HAVE_EDITLINE=0])
|
||||
TARGET_READLINE_LIBS=$LIBS
|
||||
LIBS=$sLIBS
|
||||
fi
|
||||
if test x"$with_readline" != xno; then
|
||||
found="yes"
|
||||
|
||||
AC_ARG_WITH([readline-lib],
|
||||
[AS_HELP_STRING([--with-readline-lib],[specify readline library])],
|
||||
[with_readline_lib=$withval],
|
||||
[with_readline_lib="auto"])
|
||||
if test "x$with_readline_lib" = xauto; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""])
|
||||
AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"])
|
||||
TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS"
|
||||
LIBS="$save_LIBS"
|
||||
else
|
||||
TARGET_READLINE_LIBS="$with_readline_lib"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([readline-inc],
|
||||
[AS_HELP_STRING([--with-readline-inc],[specify readline include paths])],
|
||||
[with_readline_inc=$withval],
|
||||
[with_readline_inc="auto"])
|
||||
if test "x$with_readline_inc" = xauto; then
|
||||
AC_CHECK_HEADER(readline.h, [found="yes"], [
|
||||
found="no"
|
||||
if test "$cross_compiling" != yes; then
|
||||
for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
|
||||
for subdir in include include/readline; do
|
||||
AC_CHECK_FILE($dir/$subdir/readline.h, found=yes)
|
||||
if test "$found" = "yes"; then
|
||||
TARGET_READLINE_INC="-I$dir/$subdir"
|
||||
break
|
||||
fi
|
||||
done
|
||||
test "$found" = "yes" && break
|
||||
done
|
||||
fi
|
||||
])
|
||||
else
|
||||
TARGET_READLINE_INC="$with_readline_inc"
|
||||
fi
|
||||
|
||||
if test x"$found" = xno; then
|
||||
TARGET_READLINE_LIBS=""
|
||||
TARGET_READLINE_INC=""
|
||||
TARGET_HAVE_READLINE=0
|
||||
else
|
||||
TARGET_HAVE_READLINE=1
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH([linenoise],
|
||||
[AS_HELP_STRING([--with-linenoise=DIR],[source directory for linenoise library])],
|
||||
[with_linenoise=$withval],
|
||||
[with_linenoise="no"])
|
||||
if test "x$with_linenoise" != "xno"; then
|
||||
TARGET_HAVE_READLINE=0
|
||||
TARGET_HAVE_EDITLINE=0
|
||||
TARGET_HAVE_LINENOISE=1
|
||||
TARGET_READLINE_INC="-I${with_linenoise}"
|
||||
TARGET_READLINE_LIBS="${with_linenoise}/linenoise.c"
|
||||
echo "using linenoise source code at ${with_linenoise}"
|
||||
else
|
||||
TARGET_HAVE_LINENOISE=0
|
||||
echo "not using linenoise"
|
||||
fi
|
||||
|
||||
AC_SUBST(TARGET_READLINE_LIBS)
|
||||
AC_SUBST(TARGET_READLINE_INC)
|
||||
AC_SUBST(TARGET_HAVE_READLINE)
|
||||
AC_SUBST(TARGET_HAVE_EDITLINE)
|
||||
AC_SUBST(TARGET_HAVE_LINENOISE)
|
||||
|
||||
|
||||
##########
|
||||
# Figure out what C libraries are required to compile programs
|
||||
# that use "fdatasync()" function.
|
||||
#
|
||||
AC_SEARCH_LIBS(fdatasync, [rt])
|
||||
|
||||
#########
|
||||
# check for debug enabled
|
||||
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging & verbose explain]))
|
||||
AC_MSG_CHECKING([build type])
|
||||
if test "${enable_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0 -Wall"
|
||||
AC_MSG_RESULT([debug])
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
AC_MSG_RESULT([release])
|
||||
fi
|
||||
AC_SUBST(TARGET_DEBUG)
|
||||
|
||||
#########
|
||||
# See whether we should use the amalgamation to build
|
||||
|
||||
AC_ARG_ENABLE(amalgamation, AS_HELP_STRING([--disable-amalgamation],
|
||||
[Disable the amalgamation and instead build all files separately]))
|
||||
if test "${enable_amalgamation}" = "no" ; then
|
||||
USE_AMALGAMATION=0
|
||||
fi
|
||||
AC_SUBST(USE_AMALGAMATION)
|
||||
|
||||
#########
|
||||
# Look for zlib. Only needed by extensions and by the sqlite3.exe shell
|
||||
AC_CHECK_HEADERS(zlib.h)
|
||||
AC_SEARCH_LIBS(deflate, z, [HAVE_ZLIB="-DSQLITE_HAVE_ZLIB=1"], [HAVE_ZLIB=""])
|
||||
AC_SUBST(HAVE_ZLIB)
|
||||
|
||||
#########
|
||||
# See whether we should allow loadable extensions
|
||||
AC_ARG_ENABLE(load-extension, AS_HELP_STRING([--disable-load-extension],
|
||||
[Disable loading of external extensions]),,[enable_load_extension=yes])
|
||||
if test "${enable_load_extension}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS=""
|
||||
AC_SEARCH_LIBS(dlopen, dl)
|
||||
else
|
||||
OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
|
||||
fi
|
||||
|
||||
##########
|
||||
# Do we want to support math functions
|
||||
#
|
||||
AC_ARG_ENABLE(math,
|
||||
AS_HELP_STRING([--disable-math],[Disable math functions]))
|
||||
AC_MSG_CHECKING([whether to support math functions])
|
||||
if test "$enable_math" = "no"; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MATH_FUNCTIONS"
|
||||
AC_SEARCH_LIBS(ceil, m)
|
||||
fi
|
||||
|
||||
##########
|
||||
# Do we want to support JSON functions
|
||||
#
|
||||
AC_ARG_ENABLE(json,
|
||||
AS_HELP_STRING([--disable-json],[Disable JSON functions]))
|
||||
AC_MSG_CHECKING([whether to support JSON functions])
|
||||
if test "$enable_json" = "no"; then
|
||||
AC_MSG_RESULT([no])
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_OMIT_JSON"
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
########
|
||||
# The --enable-all argument is short-hand to enable
|
||||
# multiple extensions.
|
||||
AC_ARG_ENABLE(all, AS_HELP_STRING([--enable-all],
|
||||
[Enable FTS4, FTS5, Geopoly, RTree, Sessions]))
|
||||
|
||||
##########
|
||||
# Do we want to support memsys3 and/or memsys5
|
||||
#
|
||||
AC_ARG_ENABLE(memsys5,
|
||||
AS_HELP_STRING([--enable-memsys5],[Enable MEMSYS5]))
|
||||
AC_MSG_CHECKING([whether to support MEMSYS5])
|
||||
if test "${enable_memsys5}" = "yes"; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS5"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_ARG_ENABLE(memsys3,
|
||||
AS_HELP_STRING([--enable-memsys3],[Enable MEMSYS3]))
|
||||
AC_MSG_CHECKING([whether to support MEMSYS3])
|
||||
if test "${enable_memsys3}" = "yes" -a "${enable_memsys5}" = "no"; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS3"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable Full Text Search extensions
|
||||
AC_ARG_ENABLE(fts3, AS_HELP_STRING([--enable-fts3],
|
||||
[Enable the FTS3 extension]))
|
||||
AC_MSG_CHECKING([whether to support FTS3])
|
||||
if test "${enable_fts3}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS3"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_ARG_ENABLE(fts4, AS_HELP_STRING([--enable-fts4],
|
||||
[Enable the FTS4 extension]))
|
||||
AC_MSG_CHECKING([whether to support FTS4])
|
||||
if test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS4"
|
||||
AC_SEARCH_LIBS([log],[m])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_ARG_ENABLE(fts5, AS_HELP_STRING([--enable-fts5],
|
||||
[Enable the FTS5 extension]))
|
||||
AC_MSG_CHECKING([whether to support FTS5])
|
||||
if test "${enable_fts5}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS5"
|
||||
AC_SEARCH_LIBS([log],[m])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable the LIMIT clause on UPDATE and DELETE
|
||||
# statements.
|
||||
AC_ARG_ENABLE(update-limit, AS_HELP_STRING([--enable-update-limit],
|
||||
[Enable the UPDATE/DELETE LIMIT clause]))
|
||||
AC_MSG_CHECKING([whether to support LIMIT on UPDATE and DELETE statements])
|
||||
if test "${enable_update_limit}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable GEOPOLY
|
||||
AC_ARG_ENABLE(geopoly, AS_HELP_STRING([--enable-geopoly],
|
||||
[Enable the GEOPOLY extension]),
|
||||
[enable_geopoly=yes],[enable_geopoly=no])
|
||||
AC_MSG_CHECKING([whether to support GEOPOLY])
|
||||
if test "${enable_geopoly}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_GEOPOLY"
|
||||
enable_rtree=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable RTREE
|
||||
AC_ARG_ENABLE(rtree, AS_HELP_STRING([--enable-rtree],
|
||||
[Enable the RTREE extension]))
|
||||
AC_MSG_CHECKING([whether to support RTREE])
|
||||
if test "${enable_rtree}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_RTREE"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable the SESSION extension
|
||||
AC_ARG_ENABLE(session, AS_HELP_STRING([--enable-session],
|
||||
[Enable the SESSION extension]))
|
||||
AC_MSG_CHECKING([whether to support SESSION])
|
||||
if test "${enable_session}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_SESSION"
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_PREUPDATE_HOOK"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# attempt to duplicate any OMITS and ENABLES into the ${OPT_FEATURE_FLAGS} parameter
|
||||
for option in $CFLAGS $CPPFLAGS
|
||||
do
|
||||
case $option in
|
||||
-DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
|
||||
-DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
|
||||
esac
|
||||
done
|
||||
AC_SUBST(OPT_FEATURE_FLAGS)
|
||||
|
||||
|
||||
# attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter
|
||||
ac_temp_CFLAGS=""
|
||||
for option in $CFLAGS
|
||||
do
|
||||
case $option in
|
||||
-DSQLITE_OMIT*) ;;
|
||||
-DSQLITE_ENABLE*) ;;
|
||||
*) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";;
|
||||
esac
|
||||
done
|
||||
CFLAGS=$ac_temp_CFLAGS
|
||||
|
||||
|
||||
# attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter
|
||||
ac_temp_CPPFLAGS=""
|
||||
for option in $CPPFLAGS
|
||||
do
|
||||
case $option in
|
||||
-DSQLITE_OMIT*) ;;
|
||||
-DSQLITE_ENABLE*) ;;
|
||||
*) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";;
|
||||
esac
|
||||
done
|
||||
CPPFLAGS=$ac_temp_CPPFLAGS
|
||||
|
||||
|
||||
# attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter
|
||||
ac_temp_BUILD_CFLAGS=""
|
||||
for option in $BUILD_CFLAGS
|
||||
do
|
||||
case $option in
|
||||
-DSQLITE_OMIT*) ;;
|
||||
-DSQLITE_ENABLE*) ;;
|
||||
*) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";;
|
||||
esac
|
||||
done
|
||||
BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS
|
||||
|
||||
|
||||
#########
|
||||
# See whether we should use GCOV
|
||||
AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],
|
||||
[Enable coverage testing using gcov]))
|
||||
if test "${use_gcov}" = "yes" ; then
|
||||
USE_GCOV=1
|
||||
else
|
||||
USE_GCOV=0
|
||||
fi
|
||||
AC_SUBST(USE_GCOV)
|
||||
|
||||
#########
|
||||
# Enable/disabled amalagamation line macros
|
||||
########
|
||||
AMALGAMATION_LINE_MACROS=--linemacros=0
|
||||
if test "${amalgamation_line_macros}" = "yes" ; then
|
||||
AMALGAMATION_LINE_MACROS=--linemacros=1
|
||||
fi
|
||||
if test "${amalgamation_line_macros}" = "no" ; then
|
||||
AMALGAMATION_LINE_MACROS=--linemacros=0
|
||||
fi
|
||||
AC_SUBST(AMALGAMATION_LINE_MACROS)
|
||||
|
||||
#########
|
||||
# Output the config header
|
||||
AC_CONFIG_HEADERS(sqlite_cfg.h)
|
||||
|
||||
#########
|
||||
# Generate the output files.
|
||||
#
|
||||
AC_SUBST(BUILD_CFLAGS)
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
sqlite3.pc
|
||||
])
|
||||
AC_OUTPUT
|
||||
@@ -8,11 +8,10 @@ are general and should work on most any modern unix platform.
|
||||
1. Install a C-compiler. GCC or Clang both work fine. If you are
|
||||
reading this document, you've probably already done that.
|
||||
|
||||
2. Install TCL9 development libraries. In this note, we'll do a
|
||||
private install in the $HOME/local directory, but you can make
|
||||
adjustments to install TCL9 wherever you like.
|
||||
<p>
|
||||
This document assumes you are working with <b>TCL version 9.0</b>.
|
||||
2. *(Optional):* Install TCL development libraries. In this note,
|
||||
we'll do a private install in the $HOME/local directory,
|
||||
but you can make adjustments to install TCL wherever you like.
|
||||
This document assumes you are working with TCL version 9.0.
|
||||
<ol type="a">
|
||||
<li>Get the TCL source archive, perhaps from
|
||||
<https://www.tcl.tk/software/tcltk/download.html>
|
||||
@@ -23,6 +22,12 @@ are general and should work on most any modern unix platform.
|
||||
<li>Run: `./configure --prefix=$HOME/local`
|
||||
<li>Run: `make install`
|
||||
</ol>
|
||||
<p>
|
||||
As of 2024-10-25, TCL is not longer required for many
|
||||
common build targets, such as "sqlite3.c" or the "sqlite3"
|
||||
command-line tool. So you can skip this step if that is all
|
||||
you want to build. TCL is still required to run "make test"
|
||||
and similar, or to build the TCL extension, of course.
|
||||
|
||||
4. Download the SQLite source tree and unpack it. CD into the
|
||||
toplevel directory of the source tree.
|
||||
@@ -30,7 +35,7 @@ are general and should work on most any modern unix platform.
|
||||
5. Run: `./configure --enable-all --with-tclsh=$HOME/local/bin/tclsh9.0`
|
||||
|
||||
You do not need to use --with-tclsh if the tclsh you want to use is the
|
||||
first one on your PATH.
|
||||
first one on your PATH or if you are building without TCL.
|
||||
|
||||
6. Run the "`Makefile`" makefile with an appropriate target.
|
||||
Examples:
|
||||
@@ -39,6 +44,10 @@ are general and should work on most any modern unix platform.
|
||||
<li> `make sqlite3`
|
||||
<li> `make sqldiff`
|
||||
<li> `make sqlite3_rsync`
|
||||
</ul>
|
||||
<p>None of the targets above require TCL. TCL is only needed
|
||||
for the following targets:
|
||||
<ul>
|
||||
<li> `make tclextension-install`
|
||||
<li> `make devtest`
|
||||
<li> `make releasetest`
|
||||
@@ -54,4 +63,4 @@ are general and should work on most any modern unix platform.
|
||||
|
||||
|
||||
7. For a debugging build of the CLI, where the ".treetrace" and ".wheretrace"
|
||||
commands work, add the the --enable-debug argument to configure.
|
||||
commands work, add the the --with-debug argument to configure.
|
||||
|
||||
@@ -16,13 +16,14 @@ canonical source on a new Windows 11 PC, as of 2024-10-09:
|
||||
a 32-bit build.) The subsequent steps will not work in a vanilla
|
||||
DOS prompt. Nor will they work in PowerShell.
|
||||
|
||||
3. Install TCL development libraries. This note assumes that you will
|
||||
3. *(Optional):* Install TCL development libraries.
|
||||
This note assumes that you will
|
||||
install the TCL development libraries in the "`c:\Tcl`" directory.
|
||||
Make adjustments
|
||||
if you want TCL installed somewhere else. SQLite needs both the
|
||||
"tclsh90.exe" command-line tool as part of the build process, and
|
||||
the "tcl90.lib" and "tclstub.lib" libraries in order to run tests.
|
||||
This document assumes you are working with <b>TCL version 9.0</b>.
|
||||
This document assumes you are working with TCL version 9.0.
|
||||
See versions of this document from prior to 2024-10-10 for
|
||||
instructions on how to build using TCL version 8.6.
|
||||
<ol type="a">
|
||||
@@ -43,22 +44,16 @@ canonical source on a new Windows 11 PC, as of 2024-10-09:
|
||||
making this change.
|
||||
</ol>
|
||||
|
||||
As of 2024-10-25, TCL is not longer required for many
|
||||
common build targets, such as "sqlite3.c" or the "sqlite3.exe"
|
||||
command-line tool. So you can skip this step if that is all
|
||||
you want to build. TCL is still required to run "make test"
|
||||
and similar, or to build the TCL extension, of course.
|
||||
|
||||
4. Download the SQLite source tree and unpack it. CD into the
|
||||
toplevel directory of the source tree.
|
||||
|
||||
5. Set the TCLDIR environment variable to point to your TCL installation.
|
||||
Like this:
|
||||
<ul>
|
||||
<li> `set TCLDIR=c:\Tcl`
|
||||
</ul>
|
||||
|
||||
If you install TCL in the "`c:\Tcl`" directory (as recommended
|
||||
in step 3 above), then this step is optional because
|
||||
"`c:\Tcl`" is the default value for TCLDIR. You can also skip this
|
||||
step by specifying "`TCLDIR=c:\Tcl`" as an argument to the nmake
|
||||
commands in step 6 below.
|
||||
|
||||
6. Run the "`Makefile.msc`" makefile with an appropriate target.
|
||||
5. Run the "`Makefile.msc`" makefile with an appropriate target.
|
||||
Examples:
|
||||
<ul>
|
||||
<li> `nmake /f makefile.msc`
|
||||
@@ -66,6 +61,13 @@ canonical source on a new Windows 11 PC, as of 2024-10-09:
|
||||
<li> `nmake /f makefile.msc sqlite3.exe`
|
||||
<li> `nmake /f makefile.msc sqldiff.exe`
|
||||
<li> `nmake /f makefile.msc sqlite3_rsync.exe`
|
||||
</ul>
|
||||
<p>No TCL is required for the nmake targets above. But for the ones
|
||||
that follow, you will need a TCL installation, as described in step 3
|
||||
above. If you install TCL in some directory other than C:\\Tcl, then
|
||||
you will also need to add the "TCLDIR=<i><dir></i>" option on the
|
||||
nmake command line to tell nmake where your TCL is installed.
|
||||
<ul>
|
||||
<li> `nmake /f makefile.msc tclextension-install`
|
||||
<li> `nmake /f makefile.msc devtest`
|
||||
<li> `nmake /f makefile.msc releasetest`
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
NOTE (2012-11-29):
|
||||
|
||||
The functionality implemented by this extension has been superseded
|
||||
by WAL-mode. This module is no longer supported or maintained. The
|
||||
code is retained for historical reference only.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Normally, when SQLite writes to a database file, it waits until the write
|
||||
operation is finished before returning control to the calling application.
|
||||
Since writing to the file-system is usually very slow compared with CPU
|
||||
bound operations, this can be a performance bottleneck. This directory
|
||||
contains an extension that causes SQLite to perform all write requests
|
||||
using a separate thread running in the background. Although this does not
|
||||
reduce the overall system resources (CPU, disk bandwidth etc.) at all, it
|
||||
allows SQLite to return control to the caller quickly even when writing to
|
||||
the database, eliminating the bottleneck.
|
||||
|
||||
1. Functionality
|
||||
|
||||
1.1 How it Works
|
||||
1.2 Limitations
|
||||
1.3 Locking and Concurrency
|
||||
|
||||
2. Compilation and Usage
|
||||
|
||||
3. Porting
|
||||
|
||||
|
||||
|
||||
1. FUNCTIONALITY
|
||||
|
||||
With asynchronous I/O, write requests are handled by a separate thread
|
||||
running in the background. This means that the thread that initiates
|
||||
a database write does not have to wait for (sometimes slow) disk I/O
|
||||
to occur. The write seems to happen very quickly, though in reality
|
||||
it is happening at its usual slow pace in the background.
|
||||
|
||||
Asynchronous I/O appears to give better responsiveness, but at a price.
|
||||
You lose the Durable property. With the default I/O backend of SQLite,
|
||||
once a write completes, you know that the information you wrote is
|
||||
safely on disk. With the asynchronous I/O, this is not the case. If
|
||||
your program crashes or if a power loss occurs after the database
|
||||
write but before the asynchronous write thread has completed, then the
|
||||
database change might never make it to disk and the next user of the
|
||||
database might not see your change.
|
||||
|
||||
You lose Durability with asynchronous I/O, but you still retain the
|
||||
other parts of ACID: Atomic, Consistent, and Isolated. Many
|
||||
appliations get along fine without the Durablity.
|
||||
|
||||
1.1 How it Works
|
||||
|
||||
Asynchronous I/O works by creating a special SQLite "vfs" structure
|
||||
and registering it with sqlite3_vfs_register(). When files opened via
|
||||
this vfs are written to (using the vfs xWrite() method), the data is not
|
||||
written directly to disk, but is placed in the "write-queue" to be
|
||||
handled by the background thread.
|
||||
|
||||
When files opened with the asynchronous vfs are read from
|
||||
(using the vfs xRead() method), the data is read from the file on
|
||||
disk and the write-queue, so that from the point of view of
|
||||
the vfs reader the xWrite() appears to have already completed.
|
||||
|
||||
The special vfs is registered (and unregistered) by calls to the
|
||||
API functions sqlite3async_initialize() and sqlite3async_shutdown().
|
||||
See section "Compilation and Usage" below for details.
|
||||
|
||||
1.2 Limitations
|
||||
|
||||
In order to gain experience with the main ideas surrounding asynchronous
|
||||
IO, this implementation is deliberately kept simple. Additional
|
||||
capabilities may be added in the future.
|
||||
|
||||
For example, as currently implemented, if writes are happening at a
|
||||
steady stream that exceeds the I/O capability of the background writer
|
||||
thread, the queue of pending write operations will grow without bound.
|
||||
If this goes on for long enough, the host system could run out of memory.
|
||||
A more sophisticated module could to keep track of the quantity of
|
||||
pending writes and stop accepting new write requests when the queue of
|
||||
pending writes grows too large.
|
||||
|
||||
1.3 Locking and Concurrency
|
||||
|
||||
Multiple connections from within a single process that use this
|
||||
implementation of asynchronous IO may access a single database
|
||||
file concurrently. From the point of view of the user, if all
|
||||
connections are from within a single process, there is no difference
|
||||
between the concurrency offered by "normal" SQLite and SQLite
|
||||
using the asynchronous backend.
|
||||
|
||||
If file-locking is enabled (it is enabled by default), then connections
|
||||
from multiple processes may also read and write the database file.
|
||||
However concurrency is reduced as follows:
|
||||
|
||||
* When a connection using asynchronous IO begins a database
|
||||
transaction, the database is locked immediately. However the
|
||||
lock is not released until after all relevant operations
|
||||
in the write-queue have been flushed to disk. This means
|
||||
(for example) that the database may remain locked for some
|
||||
time after a "COMMIT" or "ROLLBACK" is issued.
|
||||
|
||||
* If an application using asynchronous IO executes transactions
|
||||
in quick succession, other database users may be effectively
|
||||
locked out of the database. This is because when a BEGIN
|
||||
is executed, a database lock is established immediately. But
|
||||
when the corresponding COMMIT or ROLLBACK occurs, the lock
|
||||
is not released until the relevant part of the write-queue
|
||||
has been flushed through. As a result, if a COMMIT is followed
|
||||
by a BEGIN before the write-queue is flushed through, the database
|
||||
is never unlocked,preventing other processes from accessing
|
||||
the database.
|
||||
|
||||
File-locking may be disabled at runtime using the sqlite3async_control()
|
||||
API (see below). This may improve performance when an NFS or other
|
||||
network file-system, as the synchronous round-trips to the server be
|
||||
required to establish file locks are avoided. However, if multiple
|
||||
connections attempt to access the same database file when file-locking
|
||||
is disabled, application crashes and database corruption is a likely
|
||||
outcome.
|
||||
|
||||
|
||||
2. COMPILATION AND USAGE
|
||||
|
||||
The asynchronous IO extension consists of a single file of C code
|
||||
(sqlite3async.c), and a header file (sqlite3async.h) that defines the
|
||||
C API used by applications to activate and control the modules
|
||||
functionality.
|
||||
|
||||
To use the asynchronous IO extension, compile sqlite3async.c as
|
||||
part of the application that uses SQLite. Then use the API defined
|
||||
in sqlite3async.h to initialize and configure the module.
|
||||
|
||||
The asynchronous IO VFS API is described in detail in comments in
|
||||
sqlite3async.h. Using the API usually consists of the following steps:
|
||||
|
||||
1. Register the asynchronous IO VFS with SQLite by calling the
|
||||
sqlite3async_initialize() function.
|
||||
|
||||
2. Create a background thread to perform write operations and call
|
||||
sqlite3async_run().
|
||||
|
||||
3. Use the normal SQLite API to read and write to databases via
|
||||
the asynchronous IO VFS.
|
||||
|
||||
Refer to sqlite3async.h for details.
|
||||
|
||||
|
||||
3. PORTING
|
||||
|
||||
Currently the asynchronous IO extension is compatible with win32 systems
|
||||
and systems that support the pthreads interface, including Mac OSX, Linux,
|
||||
and other varieties of Unix.
|
||||
|
||||
To port the asynchronous IO extension to another platform, the user must
|
||||
implement mutex and condition variable primitives for the new platform.
|
||||
Currently there is no externally available interface to allow this, but
|
||||
modifying the code within sqlite3async.c to include the new platforms
|
||||
concurrency primitives is relatively easy. Search within sqlite3async.c
|
||||
for the comment string "PORTING FUNCTIONS" for details. Then implement
|
||||
new versions of each of the following:
|
||||
|
||||
static void async_mutex_enter(int eMutex);
|
||||
static void async_mutex_leave(int eMutex);
|
||||
static void async_cond_wait(int eCond, int eMutex);
|
||||
static void async_cond_signal(int eCond);
|
||||
static void async_sched_yield(void);
|
||||
|
||||
The functionality required of each of the above functions is described
|
||||
in comments in sqlite3async.c.
|
||||
@@ -1,222 +0,0 @@
|
||||
|
||||
#ifndef __SQLITEASYNC_H_
|
||||
#define __SQLITEASYNC_H_ 1
|
||||
|
||||
/*
|
||||
** Make sure we can call this stuff from C++.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SQLITEASYNC_VFSNAME "sqlite3async"
|
||||
|
||||
/*
|
||||
** THREAD SAFETY NOTES:
|
||||
**
|
||||
** Of the four API functions in this file, the following are not threadsafe:
|
||||
**
|
||||
** sqlite3async_initialize()
|
||||
** sqlite3async_shutdown()
|
||||
**
|
||||
** Care must be taken that neither of these functions is called while
|
||||
** another thread may be calling either any sqlite3async_XXX() function
|
||||
** or an sqlite3_XXX() API function related to a database handle that
|
||||
** is using the asynchronous IO VFS.
|
||||
**
|
||||
** These functions:
|
||||
**
|
||||
** sqlite3async_run()
|
||||
** sqlite3async_control()
|
||||
**
|
||||
** are threadsafe. It is quite safe to call either of these functions even
|
||||
** if another thread may also be calling one of them or an sqlite3_XXX()
|
||||
** function related to a database handle that uses the asynchronous IO VFS.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Initialize the asynchronous IO VFS and register it with SQLite using
|
||||
** sqlite3_vfs_register(). If the asynchronous VFS is already initialized
|
||||
** and registered, this function is a no-op. The asynchronous IO VFS
|
||||
** is registered as "sqlite3async".
|
||||
**
|
||||
** The asynchronous IO VFS does not make operating system IO requests
|
||||
** directly. Instead, it uses an existing VFS implementation for all
|
||||
** required file-system operations. If the first parameter to this function
|
||||
** is NULL, then the current default VFS is used for IO. If it is not
|
||||
** NULL, then it must be the name of an existing VFS. In other words, the
|
||||
** first argument to this function is passed to sqlite3_vfs_find() to
|
||||
** locate the VFS to use for all real IO operations. This VFS is known
|
||||
** as the "parent VFS".
|
||||
**
|
||||
** If the second parameter to this function is non-zero, then the
|
||||
** asynchronous IO VFS is registered as the default VFS for all SQLite
|
||||
** database connections within the process. Otherwise, the asynchronous IO
|
||||
** VFS is only used by connections opened using sqlite3_open_v2() that
|
||||
** specifically request VFS "sqlite3async".
|
||||
**
|
||||
** If a parent VFS cannot be located, then SQLITE_ERROR is returned.
|
||||
** In the unlikely event that operating system specific initialization
|
||||
** fails (win32 systems create the required critical section and event
|
||||
** objects within this function), then SQLITE_ERROR is also returned.
|
||||
** Finally, if the call to sqlite3_vfs_register() returns an error, then
|
||||
** the error code is returned to the user by this function. In all three
|
||||
** of these cases, intialization has failed and the asynchronous IO VFS
|
||||
** is not registered with SQLite.
|
||||
**
|
||||
** Otherwise, if no error occurs, SQLITE_OK is returned.
|
||||
*/
|
||||
int sqlite3async_initialize(const char *zParent, int isDefault);
|
||||
|
||||
/*
|
||||
** This function unregisters the asynchronous IO VFS using
|
||||
** sqlite3_vfs_unregister().
|
||||
**
|
||||
** On win32 platforms, this function also releases the small number of
|
||||
** critical section and event objects created by sqlite3async_initialize().
|
||||
*/
|
||||
void sqlite3async_shutdown(void);
|
||||
|
||||
/*
|
||||
** This function may only be called when the asynchronous IO VFS is
|
||||
** installed (after a call to sqlite3async_initialize()). It processes
|
||||
** zero or more queued write operations before returning. It is expected
|
||||
** (but not required) that this function will be called by a different
|
||||
** thread than those threads that use SQLite. The "background thread"
|
||||
** that performs IO.
|
||||
**
|
||||
** How many queued write operations are performed before returning
|
||||
** depends on the global setting configured by passing the SQLITEASYNC_HALT
|
||||
** verb to sqlite3async_control() (see below for details). By default
|
||||
** this function never returns - it processes all pending operations and
|
||||
** then blocks waiting for new ones.
|
||||
**
|
||||
** If multiple simultaneous calls are made to sqlite3async_run() from two
|
||||
** or more threads, then the calls are serialized internally.
|
||||
*/
|
||||
void sqlite3async_run(void);
|
||||
|
||||
/*
|
||||
** This function may only be called when the asynchronous IO VFS is
|
||||
** installed (after a call to sqlite3async_initialize()). It is used
|
||||
** to query or configure various parameters that affect the operation
|
||||
** of the asynchronous IO VFS. At present there are three parameters
|
||||
** supported:
|
||||
**
|
||||
** * The "halt" parameter, which configures the circumstances under
|
||||
** which the sqlite3async_run() parameter is configured.
|
||||
**
|
||||
** * The "delay" parameter. Setting the delay parameter to a non-zero
|
||||
** value causes the sqlite3async_run() function to sleep for the
|
||||
** configured number of milliseconds between each queued write
|
||||
** operation.
|
||||
**
|
||||
** * The "lockfiles" parameter. This parameter determines whether or
|
||||
** not the asynchronous IO VFS locks the database files it operates
|
||||
** on. Disabling file locking can improve throughput.
|
||||
**
|
||||
** This function is always passed two arguments. When setting the value
|
||||
** of a parameter, the first argument must be one of SQLITEASYNC_HALT,
|
||||
** SQLITEASYNC_DELAY or SQLITEASYNC_LOCKFILES. The second argument must
|
||||
** be passed the new value for the parameter as type "int".
|
||||
**
|
||||
** When querying the current value of a paramter, the first argument must
|
||||
** be one of SQLITEASYNC_GET_HALT, GET_DELAY or GET_LOCKFILES. The second
|
||||
** argument to this function must be of type (int *). The current value
|
||||
** of the queried parameter is copied to the memory pointed to by the
|
||||
** second argument. For example:
|
||||
**
|
||||
** int eCurrentHalt;
|
||||
** int eNewHalt = SQLITEASYNC_HALT_IDLE;
|
||||
**
|
||||
** sqlite3async_control(SQLITEASYNC_HALT, eNewHalt);
|
||||
** sqlite3async_control(SQLITEASYNC_GET_HALT, &eCurrentHalt);
|
||||
** assert( eNewHalt==eCurrentHalt );
|
||||
**
|
||||
** See below for more detail on each configuration parameter.
|
||||
**
|
||||
** SQLITEASYNC_HALT:
|
||||
**
|
||||
** This is used to set the value of the "halt" parameter. The second
|
||||
** argument must be one of the SQLITEASYNC_HALT_XXX symbols defined
|
||||
** below (either NEVER, IDLE and NOW).
|
||||
**
|
||||
** If the parameter is set to NEVER, then calls to sqlite3async_run()
|
||||
** never return. This is the default setting. If the parameter is set
|
||||
** to IDLE, then calls to sqlite3async_run() return as soon as the
|
||||
** queue of pending write operations is empty. If the parameter is set
|
||||
** to NOW, then calls to sqlite3async_run() return as quickly as
|
||||
** possible, without processing any pending write requests.
|
||||
**
|
||||
** If an attempt is made to set this parameter to an integer value other
|
||||
** than SQLITEASYNC_HALT_NEVER, IDLE or NOW, then sqlite3async_control()
|
||||
** returns SQLITE_MISUSE and the current value of the parameter is not
|
||||
** modified.
|
||||
**
|
||||
** Modifying the "halt" parameter affects calls to sqlite3async_run()
|
||||
** made by other threads that are currently in progress.
|
||||
**
|
||||
** SQLITEASYNC_DELAY:
|
||||
**
|
||||
** This is used to set the value of the "delay" parameter. If set to
|
||||
** a non-zero value, then after completing a pending write request, the
|
||||
** sqlite3async_run() function sleeps for the configured number of
|
||||
** milliseconds.
|
||||
**
|
||||
** If an attempt is made to set this parameter to a negative value,
|
||||
** sqlite3async_control() returns SQLITE_MISUSE and the current value
|
||||
** of the parameter is not modified.
|
||||
**
|
||||
** Modifying the "delay" parameter affects calls to sqlite3async_run()
|
||||
** made by other threads that are currently in progress.
|
||||
**
|
||||
** SQLITEASYNC_LOCKFILES:
|
||||
**
|
||||
** This is used to set the value of the "lockfiles" parameter. This
|
||||
** parameter must be set to either 0 or 1. If set to 1, then the
|
||||
** asynchronous IO VFS uses the xLock() and xUnlock() methods of the
|
||||
** parent VFS to lock database files being read and/or written. If
|
||||
** the parameter is set to 0, then these locks are omitted.
|
||||
**
|
||||
** This parameter may only be set when there are no open database
|
||||
** connections using the VFS and the queue of pending write requests
|
||||
** is empty. Attempting to set it when this is not true, or to set it
|
||||
** to a value other than 0 or 1 causes sqlite3async_control() to return
|
||||
** SQLITE_MISUSE and the value of the parameter to remain unchanged.
|
||||
**
|
||||
** If this parameter is set to zero, then it is only safe to access the
|
||||
** database via the asynchronous IO VFS from within a single process. If
|
||||
** while writing to the database via the asynchronous IO VFS the database
|
||||
** is also read or written from within another process, or via another
|
||||
** connection that does not use the asynchronous IO VFS within the same
|
||||
** process, the results are undefined (and may include crashes or database
|
||||
** corruption).
|
||||
**
|
||||
** Alternatively, if this parameter is set to 1, then it is safe to access
|
||||
** the database from multiple connections within multiple processes using
|
||||
** either the asynchronous IO VFS or the parent VFS directly.
|
||||
*/
|
||||
int sqlite3async_control(int op, ...);
|
||||
|
||||
/*
|
||||
** Values that can be used as the first argument to sqlite3async_control().
|
||||
*/
|
||||
#define SQLITEASYNC_HALT 1
|
||||
#define SQLITEASYNC_GET_HALT 2
|
||||
#define SQLITEASYNC_DELAY 3
|
||||
#define SQLITEASYNC_GET_DELAY 4
|
||||
#define SQLITEASYNC_LOCKFILES 5
|
||||
#define SQLITEASYNC_GET_LOCKFILES 6
|
||||
|
||||
/*
|
||||
** If the first argument to sqlite3async_control() is SQLITEASYNC_HALT,
|
||||
** the second argument should be one of the following.
|
||||
*/
|
||||
#define SQLITEASYNC_HALT_NEVER 0 /* Never halt (default value) */
|
||||
#define SQLITEASYNC_HALT_NOW 1 /* Halt as soon as possible */
|
||||
#define SQLITEASYNC_HALT_IDLE 2 /* Halt when write-queue is empty */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* End of the 'extern "C"' block */
|
||||
#endif
|
||||
#endif /* ifndef __SQLITEASYNC_H_ */
|
||||
@@ -1,773 +0,0 @@
|
||||
/*
|
||||
** 2023 November 4
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
********************************************************************************
|
||||
** This file implements various interfaces used for console and stream I/O
|
||||
** by the SQLite project command-line tools, as explained in console_io.h .
|
||||
** Functions prefixed by "SQLITE_INTERNAL_LINKAGE" behave as described there.
|
||||
*/
|
||||
|
||||
#ifndef SQLITE_CDECL
|
||||
# define SQLITE_CDECL
|
||||
#endif
|
||||
|
||||
#ifndef SHELL_NO_SYSINC
|
||||
# include <stdarg.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
# include <limits.h>
|
||||
# include <assert.h>
|
||||
# include "sqlite3.h"
|
||||
#endif
|
||||
#ifndef HAVE_CONSOLE_IO_H
|
||||
# include "console_io.h"
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(disable : 4204)
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_CIO_NO_TRANSLATE
|
||||
# if (defined(_WIN32) || defined(WIN32)) && !SQLITE_OS_WINRT
|
||||
# ifndef SHELL_NO_SYSINC
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# endif
|
||||
# define CIO_WIN_WC_XLATE 1 /* Use WCHAR Windows APIs for console I/O */
|
||||
# else
|
||||
# ifndef SHELL_NO_SYSINC
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
# define CIO_WIN_WC_XLATE 0 /* Use plain C library stream I/O at console */
|
||||
# endif
|
||||
#else
|
||||
# define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */
|
||||
#endif
|
||||
|
||||
#if CIO_WIN_WC_XLATE
|
||||
static HANDLE handleOfFile(FILE *pf){
|
||||
int fileDesc = _fileno(pf);
|
||||
union { intptr_t osfh; HANDLE fh; } fid = {
|
||||
(fileDesc>=0)? _get_osfhandle(fileDesc) : (intptr_t)INVALID_HANDLE_VALUE
|
||||
};
|
||||
return fid.fh;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_CIO_NO_TRANSLATE
|
||||
typedef struct PerStreamTags {
|
||||
# if CIO_WIN_WC_XLATE
|
||||
HANDLE hx;
|
||||
DWORD consMode;
|
||||
char acIncomplete[4];
|
||||
# else
|
||||
short reachesConsole;
|
||||
# endif
|
||||
FILE *pf;
|
||||
} PerStreamTags;
|
||||
|
||||
/* Define NULL-like value for things which can validly be 0. */
|
||||
# define SHELL_INVALID_FILE_PTR ((FILE *)~0)
|
||||
# if CIO_WIN_WC_XLATE
|
||||
# define SHELL_INVALID_CONS_MODE 0xFFFF0000
|
||||
# endif
|
||||
|
||||
# if CIO_WIN_WC_XLATE
|
||||
# define PST_INITIALIZER { INVALID_HANDLE_VALUE, SHELL_INVALID_CONS_MODE, \
|
||||
{0,0,0,0}, SHELL_INVALID_FILE_PTR }
|
||||
# else
|
||||
# define PST_INITIALIZER { 0, SHELL_INVALID_FILE_PTR }
|
||||
# endif
|
||||
|
||||
/* Quickly say whether a known output is going to the console. */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
static short pstReachesConsole(PerStreamTags *ppst){
|
||||
return (ppst->hx != INVALID_HANDLE_VALUE);
|
||||
}
|
||||
# else
|
||||
# define pstReachesConsole(ppst) 0
|
||||
# endif
|
||||
|
||||
# if CIO_WIN_WC_XLATE
|
||||
static void restoreConsoleArb(PerStreamTags *ppst){
|
||||
if( pstReachesConsole(ppst) ) SetConsoleMode(ppst->hx, ppst->consMode);
|
||||
}
|
||||
# else
|
||||
# define restoreConsoleArb(ppst)
|
||||
# endif
|
||||
|
||||
/* Say whether FILE* appears to be a console, collect associated info. */
|
||||
static short streamOfConsole(FILE *pf, /* out */ PerStreamTags *ppst){
|
||||
# if CIO_WIN_WC_XLATE
|
||||
short rv = 0;
|
||||
DWORD dwCM = SHELL_INVALID_CONS_MODE;
|
||||
HANDLE fh = handleOfFile(pf);
|
||||
ppst->pf = pf;
|
||||
if( INVALID_HANDLE_VALUE != fh ){
|
||||
rv = (GetFileType(fh) == FILE_TYPE_CHAR && GetConsoleMode(fh,&dwCM));
|
||||
}
|
||||
ppst->hx = (rv)? fh : INVALID_HANDLE_VALUE;
|
||||
ppst->consMode = dwCM;
|
||||
return rv;
|
||||
# else
|
||||
ppst->pf = pf;
|
||||
ppst->reachesConsole = ( (short)isatty(fileno(pf)) );
|
||||
return ppst->reachesConsole;
|
||||
# endif
|
||||
}
|
||||
|
||||
# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING (0x4)
|
||||
# endif
|
||||
|
||||
# if CIO_WIN_WC_XLATE
|
||||
/* Define console modes for use with the Windows Console API. */
|
||||
# define SHELL_CONI_MODE \
|
||||
(ENABLE_ECHO_INPUT | ENABLE_INSERT_MODE | ENABLE_LINE_INPUT | 0x80 \
|
||||
| ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS | ENABLE_PROCESSED_INPUT)
|
||||
# define SHELL_CONO_MODE (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT \
|
||||
| ENABLE_VIRTUAL_TERMINAL_PROCESSING)
|
||||
# endif
|
||||
|
||||
typedef struct ConsoleInfo {
|
||||
PerStreamTags pstSetup[3];
|
||||
PerStreamTags pstDesignated[3];
|
||||
StreamsAreConsole sacSetup;
|
||||
} ConsoleInfo;
|
||||
|
||||
static short isValidStreamInfo(PerStreamTags *ppst){
|
||||
return (ppst->pf != SHELL_INVALID_FILE_PTR);
|
||||
}
|
||||
|
||||
static ConsoleInfo consoleInfo = {
|
||||
{ /* pstSetup */ PST_INITIALIZER, PST_INITIALIZER, PST_INITIALIZER },
|
||||
{ /* pstDesignated[] */ PST_INITIALIZER, PST_INITIALIZER, PST_INITIALIZER },
|
||||
SAC_NoConsole /* sacSetup */
|
||||
};
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE FILE* invalidFileStream = (FILE *)~0;
|
||||
|
||||
# if CIO_WIN_WC_XLATE
|
||||
static void maybeSetupAsConsole(PerStreamTags *ppst, short odir){
|
||||
if( pstReachesConsole(ppst) ){
|
||||
DWORD cm = odir? SHELL_CONO_MODE : SHELL_CONI_MODE;
|
||||
SetConsoleMode(ppst->hx, cm);
|
||||
}
|
||||
}
|
||||
# else
|
||||
# define maybeSetupAsConsole(ppst,odir)
|
||||
# endif
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE void consoleRenewSetup(void){
|
||||
# if CIO_WIN_WC_XLATE
|
||||
int ix = 0;
|
||||
while( ix < 6 ){
|
||||
PerStreamTags *ppst = (ix<3)?
|
||||
&consoleInfo.pstSetup[ix] : &consoleInfo.pstDesignated[ix-3];
|
||||
maybeSetupAsConsole(ppst, (ix % 3)>0);
|
||||
++ix;
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE StreamsAreConsole
|
||||
consoleClassifySetup( FILE *pfIn, FILE *pfOut, FILE *pfErr ){
|
||||
StreamsAreConsole rv = SAC_NoConsole;
|
||||
FILE* apf[3] = { pfIn, pfOut, pfErr };
|
||||
int ix;
|
||||
for( ix = 2; ix >= 0; --ix ){
|
||||
PerStreamTags *ppst = &consoleInfo.pstSetup[ix];
|
||||
if( streamOfConsole(apf[ix], ppst) ){
|
||||
rv |= (SAC_InConsole<<ix);
|
||||
}
|
||||
consoleInfo.pstDesignated[ix] = *ppst;
|
||||
if( ix > 0 ) fflush(apf[ix]);
|
||||
}
|
||||
consoleInfo.sacSetup = rv;
|
||||
consoleRenewSetup();
|
||||
return rv;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE void SQLITE_CDECL consoleRestore( void ){
|
||||
# if CIO_WIN_WC_XLATE
|
||||
static ConsoleInfo *pci = &consoleInfo;
|
||||
if( pci->sacSetup ){
|
||||
int ix;
|
||||
for( ix=0; ix<3; ++ix ){
|
||||
if( pci->sacSetup & (SAC_InConsole<<ix) ){
|
||||
PerStreamTags *ppst = &pci->pstSetup[ix];
|
||||
SetConsoleMode(ppst->hx, ppst->consMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#endif /* !defined(SQLITE_CIO_NO_TRANSLATE) */
|
||||
|
||||
#ifdef SQLITE_CIO_INPUT_REDIR
|
||||
/* Say whether given FILE* is among those known, via either
|
||||
** consoleClassifySetup() or set{Output,Error}Stream, as
|
||||
** readable, and return an associated PerStreamTags pointer
|
||||
** if so. Otherwise, return 0.
|
||||
*/
|
||||
static PerStreamTags * isKnownReadable(FILE *pf){
|
||||
static PerStreamTags *apst[] = {
|
||||
&consoleInfo.pstDesignated[0], &consoleInfo.pstSetup[0], 0
|
||||
};
|
||||
int ix = 0;
|
||||
do {
|
||||
if( apst[ix]->pf == pf ) break;
|
||||
} while( apst[++ix] != 0 );
|
||||
return apst[ix];
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_CIO_NO_TRANSLATE
|
||||
/* Say whether given FILE* is among those known, via either
|
||||
** consoleClassifySetup() or set{Output,Error}Stream, as
|
||||
** writable, and return an associated PerStreamTags pointer
|
||||
** if so. Otherwise, return 0.
|
||||
*/
|
||||
static PerStreamTags * isKnownWritable(FILE *pf){
|
||||
static PerStreamTags *apst[] = {
|
||||
&consoleInfo.pstDesignated[1], &consoleInfo.pstDesignated[2],
|
||||
&consoleInfo.pstSetup[1], &consoleInfo.pstSetup[2], 0
|
||||
};
|
||||
int ix = 0;
|
||||
do {
|
||||
if( apst[ix]->pf == pf ) break;
|
||||
} while( apst[++ix] != 0 );
|
||||
return apst[ix];
|
||||
}
|
||||
|
||||
static FILE *designateEmitStream(FILE *pf, unsigned chix){
|
||||
FILE *rv = consoleInfo.pstDesignated[chix].pf;
|
||||
if( pf == invalidFileStream ) return rv;
|
||||
else{
|
||||
/* Setting a possibly new output stream. */
|
||||
PerStreamTags *ppst = isKnownWritable(pf);
|
||||
if( ppst != 0 ){
|
||||
PerStreamTags pst = *ppst;
|
||||
consoleInfo.pstDesignated[chix] = pst;
|
||||
}else streamOfConsole(pf, &consoleInfo.pstDesignated[chix]);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE FILE *setOutputStream(FILE *pf){
|
||||
return designateEmitStream(pf, 1);
|
||||
}
|
||||
# ifdef CONSIO_SET_ERROR_STREAM
|
||||
SQLITE_INTERNAL_LINKAGE FILE *setErrorStream(FILE *pf){
|
||||
return designateEmitStream(pf, 2);
|
||||
}
|
||||
# endif
|
||||
#endif /* !defined(SQLITE_CIO_NO_TRANSLATE) */
|
||||
|
||||
#ifndef SQLITE_CIO_NO_SETMODE
|
||||
# if CIO_WIN_WC_XLATE
|
||||
static void setModeFlushQ(FILE *pf, short bFlush, int mode){
|
||||
if( bFlush ) fflush(pf);
|
||||
_setmode(_fileno(pf), mode);
|
||||
}
|
||||
# else
|
||||
# define setModeFlushQ(f, b, m) if(b) fflush(f)
|
||||
# endif
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE void setBinaryMode(FILE *pf, short bFlush){
|
||||
setModeFlushQ(pf, bFlush, _O_BINARY);
|
||||
}
|
||||
SQLITE_INTERNAL_LINKAGE void setTextMode(FILE *pf, short bFlush){
|
||||
setModeFlushQ(pf, bFlush, _O_TEXT);
|
||||
}
|
||||
# undef setModeFlushQ
|
||||
|
||||
#else /* defined(SQLITE_CIO_NO_SETMODE) */
|
||||
# define setBinaryMode(f, bFlush) do{ if((bFlush)) fflush(f); }while(0)
|
||||
# define setTextMode(f, bFlush) do{ if((bFlush)) fflush(f); }while(0)
|
||||
#endif /* defined(SQLITE_CIO_NO_SETMODE) */
|
||||
|
||||
#ifndef SQLITE_CIO_NO_TRANSLATE
|
||||
# if CIO_WIN_WC_XLATE
|
||||
/* Write buffer cBuf as output to stream known to reach console,
|
||||
** limited to ncTake char's. Return ncTake on success, else 0. */
|
||||
static int conZstrEmit(PerStreamTags *ppst, const char *z, int ncTake){
|
||||
int rv = 0;
|
||||
if( z!=NULL ){
|
||||
int nwc = MultiByteToWideChar(CP_UTF8,0, z,ncTake, 0,0);
|
||||
if( nwc > 0 ){
|
||||
WCHAR *zw = sqlite3_malloc64(nwc*sizeof(WCHAR));
|
||||
if( zw!=NULL ){
|
||||
nwc = MultiByteToWideChar(CP_UTF8,0, z,ncTake, zw,nwc);
|
||||
if( nwc > 0 ){
|
||||
/* Translation from UTF-8 to UTF-16, then WCHARs out. */
|
||||
if( WriteConsoleW(ppst->hx, zw,nwc, 0, NULL) ){
|
||||
rv = ncTake;
|
||||
}
|
||||
}
|
||||
sqlite3_free(zw);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* For {f,o,e}PrintfUtf8() when stream is known to reach console. */
|
||||
static int conioVmPrintf(PerStreamTags *ppst, const char *zFormat, va_list ap){
|
||||
char *z = sqlite3_vmprintf(zFormat, ap);
|
||||
if( z ){
|
||||
int rv = conZstrEmit(ppst, z, (int)strlen(z));
|
||||
sqlite3_free(z);
|
||||
return rv;
|
||||
}else return 0;
|
||||
}
|
||||
# endif /* CIO_WIN_WC_XLATE */
|
||||
|
||||
# ifdef CONSIO_GET_EMIT_STREAM
|
||||
static PerStreamTags * getDesignatedEmitStream(FILE *pf, unsigned chix,
|
||||
PerStreamTags *ppst){
|
||||
PerStreamTags *rv = isKnownWritable(pf);
|
||||
short isValid = (rv!=0)? isValidStreamInfo(rv) : 0;
|
||||
if( rv != 0 && isValid ) return rv;
|
||||
streamOfConsole(pf, ppst);
|
||||
return ppst;
|
||||
}
|
||||
# endif
|
||||
|
||||
/* Get stream info, either for designated output or error stream when
|
||||
** chix equals 1 or 2, or for an arbitrary stream when chix == 0.
|
||||
** In either case, ppst references a caller-owned PerStreamTags
|
||||
** struct which may be filled in if none of the known writable
|
||||
** streams is being held by consoleInfo. The ppf parameter is a
|
||||
** byref output when chix!=0 and a byref input when chix==0.
|
||||
*/
|
||||
static PerStreamTags *
|
||||
getEmitStreamInfo(unsigned chix, PerStreamTags *ppst,
|
||||
/* in/out */ FILE **ppf){
|
||||
PerStreamTags *ppstTry;
|
||||
FILE *pfEmit;
|
||||
if( chix > 0 ){
|
||||
ppstTry = &consoleInfo.pstDesignated[chix];
|
||||
if( !isValidStreamInfo(ppstTry) ){
|
||||
ppstTry = &consoleInfo.pstSetup[chix];
|
||||
pfEmit = ppst->pf;
|
||||
}else pfEmit = ppstTry->pf;
|
||||
if( !isValidStreamInfo(ppstTry) ){
|
||||
pfEmit = (chix > 1)? stderr : stdout;
|
||||
ppstTry = ppst;
|
||||
streamOfConsole(pfEmit, ppstTry);
|
||||
}
|
||||
*ppf = pfEmit;
|
||||
}else{
|
||||
ppstTry = isKnownWritable(*ppf);
|
||||
if( ppstTry != 0 ) return ppstTry;
|
||||
streamOfConsole(*ppf, ppst);
|
||||
return ppst;
|
||||
}
|
||||
return ppstTry;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int oPrintfUtf8(const char *zFormat, ...){
|
||||
va_list ap;
|
||||
int rv;
|
||||
FILE *pfOut;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(1, &pst, &pfOut);
|
||||
# else
|
||||
getEmitStreamInfo(1, &pst, &pfOut);
|
||||
# endif
|
||||
assert(zFormat!=0);
|
||||
va_start(ap, zFormat);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ){
|
||||
rv = conioVmPrintf(ppst, zFormat, ap);
|
||||
}else{
|
||||
# endif
|
||||
rv = vfprintf(pfOut, zFormat, ap);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
va_end(ap);
|
||||
return rv;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int ePrintfUtf8(const char *zFormat, ...){
|
||||
va_list ap;
|
||||
int rv;
|
||||
FILE *pfErr;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(2, &pst, &pfErr);
|
||||
# else
|
||||
getEmitStreamInfo(2, &pst, &pfErr);
|
||||
# endif
|
||||
assert(zFormat!=0);
|
||||
va_start(ap, zFormat);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ){
|
||||
rv = conioVmPrintf(ppst, zFormat, ap);
|
||||
}else{
|
||||
# endif
|
||||
rv = vfprintf(pfErr, zFormat, ap);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
va_end(ap);
|
||||
return rv;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int fPrintfUtf8(FILE *pfO, const char *zFormat, ...){
|
||||
va_list ap;
|
||||
int rv;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(0, &pst, &pfO);
|
||||
# else
|
||||
getEmitStreamInfo(0, &pst, &pfO);
|
||||
# endif
|
||||
assert(zFormat!=0);
|
||||
va_start(ap, zFormat);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ){
|
||||
maybeSetupAsConsole(ppst, 1);
|
||||
rv = conioVmPrintf(ppst, zFormat, ap);
|
||||
if( 0 == isKnownWritable(ppst->pf) ) restoreConsoleArb(ppst);
|
||||
}else{
|
||||
# endif
|
||||
rv = vfprintf(pfO, zFormat, ap);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
va_end(ap);
|
||||
return rv;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int fPutsUtf8(const char *z, FILE *pfO){
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(0, &pst, &pfO);
|
||||
# else
|
||||
getEmitStreamInfo(0, &pst, &pfO);
|
||||
# endif
|
||||
assert(z!=0);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ){
|
||||
int rv;
|
||||
maybeSetupAsConsole(ppst, 1);
|
||||
rv = conZstrEmit(ppst, z, (int)strlen(z));
|
||||
if( 0 == isKnownWritable(ppst->pf) ) restoreConsoleArb(ppst);
|
||||
return rv;
|
||||
}else {
|
||||
# endif
|
||||
return (fputs(z, pfO)<0)? 0 : (int)strlen(z);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int ePutsUtf8(const char *z){
|
||||
FILE *pfErr;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(2, &pst, &pfErr);
|
||||
# else
|
||||
getEmitStreamInfo(2, &pst, &pfErr);
|
||||
# endif
|
||||
assert(z!=0);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ) return conZstrEmit(ppst, z, (int)strlen(z));
|
||||
else {
|
||||
# endif
|
||||
return (fputs(z, pfErr)<0)? 0 : (int)strlen(z);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int oPutsUtf8(const char *z){
|
||||
FILE *pfOut;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(1, &pst, &pfOut);
|
||||
# else
|
||||
getEmitStreamInfo(1, &pst, &pfOut);
|
||||
# endif
|
||||
assert(z!=0);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ) return conZstrEmit(ppst, z, (int)strlen(z));
|
||||
else {
|
||||
# endif
|
||||
return (fputs(z, pfOut)<0)? 0 : (int)strlen(z);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif /* !defined(SQLITE_CIO_NO_TRANSLATE) */
|
||||
|
||||
#if !(defined(SQLITE_CIO_NO_UTF8SCAN) && defined(SQLITE_CIO_NO_TRANSLATE))
|
||||
/* Skip over as much z[] input char sequence as is valid UTF-8,
|
||||
** limited per nAccept char's or whole characters and containing
|
||||
** no char cn such that ((1<<cn) & ccm)!=0. On return, the
|
||||
** sequence z:return (inclusive:exclusive) is validated UTF-8.
|
||||
** Limit: nAccept>=0 => char count, nAccept<0 => character
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE const char*
|
||||
zSkipValidUtf8(const char *z, int nAccept, long ccm){
|
||||
int ng = (nAccept<0)? -nAccept : 0;
|
||||
const char *pcLimit = (nAccept>=0)? z+nAccept : 0;
|
||||
assert(z!=0);
|
||||
while( (pcLimit)? (z<pcLimit) : (ng-- != 0) ){
|
||||
char c = *z;
|
||||
if( (c & 0x80) == 0 ){
|
||||
if( ccm != 0L && c < 0x20 && ((1L<<c) & ccm) != 0 ) return z;
|
||||
++z; /* ASCII */
|
||||
}else if( (c & 0xC0) != 0xC0 ) return z; /* not a lead byte */
|
||||
else{
|
||||
const char *zt = z+1; /* Got lead byte, look at trail bytes.*/
|
||||
do{
|
||||
if( pcLimit && zt >= pcLimit ) return z;
|
||||
else{
|
||||
char ct = *zt++;
|
||||
if( ct==0 || (zt-z)>4 || (ct & 0xC0)!=0x80 ){
|
||||
/* Trailing bytes are too few, too many, or invalid. */
|
||||
return z;
|
||||
}
|
||||
}
|
||||
} while( ((c <<= 1) & 0x40) == 0x40 ); /* Eat lead byte's count. */
|
||||
z = zt;
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
#endif /*!(defined(SQLITE_CIO_NO_UTF8SCAN)&&defined(SQLITE_CIO_NO_TRANSLATE))*/
|
||||
|
||||
#ifndef SQLITE_CIO_NO_TRANSLATE
|
||||
# ifdef CONSIO_SPUTB
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
fPutbUtf8(FILE *pfO, const char *cBuf, int nAccept){
|
||||
assert(pfO!=0);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
PerStreamTags *ppst = getEmitStreamInfo(0, &pst, &pfO);
|
||||
if( pstReachesConsole(ppst) ){
|
||||
int rv;
|
||||
maybeSetupAsConsole(ppst, 1);
|
||||
rv = conZstrEmit(ppst, cBuf, nAccept);
|
||||
if( 0 == isKnownWritable(ppst->pf) ) restoreConsoleArb(ppst);
|
||||
return rv;
|
||||
}else {
|
||||
# endif
|
||||
return (int)fwrite(cBuf, 1, nAccept, pfO);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
oPutbUtf8(const char *cBuf, int nAccept){
|
||||
FILE *pfOut;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
# if CIO_WIN_WC_XLATE
|
||||
PerStreamTags *ppst = getEmitStreamInfo(1, &pst, &pfOut);
|
||||
# else
|
||||
getEmitStreamInfo(1, &pst, &pfOut);
|
||||
# endif
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ){
|
||||
return conZstrEmit(ppst, cBuf, nAccept);
|
||||
}else {
|
||||
# endif
|
||||
return (int)fwrite(cBuf, 1, nAccept, pfOut);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
** Flush the given output stream. Return non-zero for success, else 0.
|
||||
*/
|
||||
#if !defined(SQLITE_CIO_NO_FLUSH) && !defined(SQLITE_CIO_NO_SETMODE)
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
fFlushBuffer(FILE *pfOut){
|
||||
# if CIO_WIN_WC_XLATE && !defined(SHELL_OMIT_FIO_DUPE)
|
||||
return FlushFileBuffers(handleOfFile(pfOut))? 1 : 0;
|
||||
# else
|
||||
return fflush(pfOut);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CIO_WIN_WC_XLATE \
|
||||
&& !defined(SHELL_OMIT_FIO_DUPE) \
|
||||
&& defined(SQLITE_USE_ONLY_WIN32)
|
||||
static struct FileAltIds {
|
||||
int fd;
|
||||
HANDLE fh;
|
||||
} altIdsOfFile(FILE *pf){
|
||||
struct FileAltIds rv = { _fileno(pf) };
|
||||
union { intptr_t osfh; HANDLE fh; } fid = {
|
||||
(rv.fd>=0)? _get_osfhandle(rv.fd) : (intptr_t)INVALID_HANDLE_VALUE
|
||||
};
|
||||
rv.fh = fid.fh;
|
||||
return rv;
|
||||
}
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE size_t
|
||||
cfWrite(const void *buf, size_t osz, size_t ocnt, FILE *pf){
|
||||
size_t rv = 0;
|
||||
struct FileAltIds fai = altIdsOfFile(pf);
|
||||
int fmode = _setmode(fai.fd, _O_BINARY);
|
||||
_setmode(fai.fd, fmode);
|
||||
while( rv < ocnt ){
|
||||
size_t nbo = osz;
|
||||
while( nbo > 0 ){
|
||||
DWORD dwno = (nbo>(1L<<24))? 1L<<24 : (DWORD)nbo;
|
||||
BOOL wrc = TRUE;
|
||||
BOOL genCR = (fmode & _O_TEXT)!=0;
|
||||
if( genCR ){
|
||||
const char *pnl = (const char*)memchr(buf, '\n', nbo);
|
||||
if( pnl ) nbo = pnl - (const char*)buf;
|
||||
else genCR = 0;
|
||||
}
|
||||
if( dwno>0 ) wrc = WriteFile(fai.fh, buf, dwno, 0,0);
|
||||
if( genCR && wrc ){
|
||||
wrc = WriteFile(fai.fh, "\r\n", 2, 0,0);
|
||||
++dwno; /* Skip over the LF */
|
||||
}
|
||||
if( !wrc ) return rv;
|
||||
buf = (const char*)buf + dwno;
|
||||
nbo += dwno;
|
||||
}
|
||||
++rv;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* An fgets() equivalent, using Win32 file API for actual input.
|
||||
** Input ends when given buffer is filled or a newline is read.
|
||||
** If the FILE object is in text mode, swallows 0x0D. (ASCII CR)
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE char *
|
||||
cfGets(char *cBuf, int n, FILE *pf){
|
||||
int nci = 0;
|
||||
struct FileAltIds fai = altIdsOfFile(pf);
|
||||
int fmode = _setmode(fai.fd, _O_BINARY);
|
||||
BOOL eatCR = (fmode & _O_TEXT)!=0;
|
||||
_setmode(fai.fd, fmode);
|
||||
while( nci < n-1 ){
|
||||
DWORD nr;
|
||||
if( !ReadFile(fai.fh, cBuf+nci, 1, &nr, 0) || nr==0 ) break;
|
||||
if( nr>0 && (!eatCR || cBuf[nci]!='\r') ){
|
||||
nci += nr;
|
||||
if( cBuf[nci-nr]=='\n' ) break;
|
||||
}
|
||||
}
|
||||
if( nci < n ) cBuf[nci] = 0;
|
||||
return (nci>0)? cBuf : 0;
|
||||
}
|
||||
# else
|
||||
# define cfWrite(b,os,no,f) fwrite(b,os,no,f)
|
||||
# define cfGets(b,n,f) fgets(b,n,f)
|
||||
# endif
|
||||
|
||||
# ifdef CONSIO_EPUTB
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
ePutbUtf8(const char *cBuf, int nAccept){
|
||||
FILE *pfErr;
|
||||
PerStreamTags pst = PST_INITIALIZER; /* for unknown streams */
|
||||
PerStreamTags *ppst = getEmitStreamInfo(2, &pst, &pfErr);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pstReachesConsole(ppst) ){
|
||||
return conZstrEmit(ppst, cBuf, nAccept);
|
||||
}else {
|
||||
# endif
|
||||
return (int)cfWrite(cBuf, 1, nAccept, pfErr);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
# endif /* defined(CONSIO_EPUTB) */
|
||||
|
||||
SQLITE_INTERNAL_LINKAGE char* fGetsUtf8(char *cBuf, int ncMax, FILE *pfIn){
|
||||
if( pfIn==0 ) pfIn = stdin;
|
||||
# if CIO_WIN_WC_XLATE
|
||||
if( pfIn == consoleInfo.pstSetup[0].pf
|
||||
&& (consoleInfo.sacSetup & SAC_InConsole)!=0 ){
|
||||
# if CIO_WIN_WC_XLATE==1
|
||||
# define SHELL_GULP 150 /* Count of WCHARS to be gulped at a time */
|
||||
WCHAR wcBuf[SHELL_GULP+1];
|
||||
int lend = 0, noc = 0;
|
||||
if( ncMax > 0 ) cBuf[0] = 0;
|
||||
while( noc < ncMax-8-1 && !lend ){
|
||||
/* There is room for at least 2 more characters and a 0-terminator. */
|
||||
int na = (ncMax > SHELL_GULP*4+1 + noc)? SHELL_GULP : (ncMax-1 - noc)/4;
|
||||
# undef SHELL_GULP
|
||||
DWORD nbr = 0;
|
||||
BOOL bRC = ReadConsoleW(consoleInfo.pstSetup[0].hx, wcBuf, na, &nbr, 0);
|
||||
if( bRC && nbr>0 && (wcBuf[nbr-1]&0xF800)==0xD800 ){
|
||||
/* Last WHAR read is first of a UTF-16 surrogate pair. Grab its mate. */
|
||||
DWORD nbrx;
|
||||
bRC &= ReadConsoleW(consoleInfo.pstSetup[0].hx, wcBuf+nbr, 1, &nbrx, 0);
|
||||
if( bRC ) nbr += nbrx;
|
||||
}
|
||||
if( !bRC || (noc==0 && nbr==0) ) return 0;
|
||||
if( nbr > 0 ){
|
||||
int nmb = WideCharToMultiByte(CP_UTF8, 0, wcBuf,nbr,0,0,0,0);
|
||||
if( nmb != 0 && noc+nmb <= ncMax ){
|
||||
int iseg = noc;
|
||||
nmb = WideCharToMultiByte(CP_UTF8, 0, wcBuf,nbr,cBuf+noc,nmb,0,0);
|
||||
noc += nmb;
|
||||
/* Fixup line-ends as coded by Windows for CR (or "Enter".)
|
||||
** This is done without regard for any setMode{Text,Binary}()
|
||||
** call that might have been done on the interactive input.
|
||||
*/
|
||||
if( noc > 0 ){
|
||||
if( cBuf[noc-1]=='\n' ){
|
||||
lend = 1;
|
||||
if( noc > 1 && cBuf[noc-2]=='\r' ) cBuf[--noc-1] = '\n';
|
||||
}
|
||||
}
|
||||
/* Check for ^Z (anywhere in line) too, to act as EOF. */
|
||||
while( iseg < noc ){
|
||||
if( cBuf[iseg]=='\x1a' ){
|
||||
noc = iseg; /* Chop ^Z and anything following. */
|
||||
lend = 1; /* Counts as end of line too. */
|
||||
break;
|
||||
}
|
||||
++iseg;
|
||||
}
|
||||
}else break; /* Drop apparent garbage in. (Could assert.) */
|
||||
}else break;
|
||||
}
|
||||
/* If got nothing, (after ^Z chop), must be at end-of-file. */
|
||||
if( noc > 0 ){
|
||||
cBuf[noc] = 0;
|
||||
return cBuf;
|
||||
}else return 0;
|
||||
# endif
|
||||
}else{
|
||||
# endif
|
||||
return cfGets(cBuf, ncMax, pfIn);
|
||||
# if CIO_WIN_WC_XLATE
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#endif /* !defined(SQLITE_CIO_NO_TRANSLATE) */
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(default : 4204)
|
||||
#endif
|
||||
|
||||
#undef SHELL_INVALID_FILE_PTR
|
||||
@@ -1,287 +0,0 @@
|
||||
/*
|
||||
** 2023 November 1
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
********************************************************************************
|
||||
** This file exposes various interfaces used for console and other I/O
|
||||
** by the SQLite project command-line tools. These interfaces are used
|
||||
** at either source conglomeration time, compilation time, or run time.
|
||||
** This source provides for either inclusion into conglomerated,
|
||||
** "single-source" forms or separate compilation then linking.
|
||||
**
|
||||
** Platform dependencies are "hidden" here by various stratagems so
|
||||
** that, provided certain conditions are met, the programs using this
|
||||
** source or object code compiled from it need no explicit conditional
|
||||
** compilation in their source for their console and stream I/O.
|
||||
**
|
||||
** The symbols and functionality exposed here are not a public API.
|
||||
** This code may change in tandem with other project code as needed.
|
||||
**
|
||||
** When this .h file and its companion .c are directly incorporated into
|
||||
** a source conglomeration (such as shell.c), the preprocessor symbol
|
||||
** CIO_WIN_WC_XLATE is defined as 0 or 1, reflecting whether console I/O
|
||||
** translation for Windows is effected for the build.
|
||||
*/
|
||||
#define HAVE_CONSOLE_IO_H 1
|
||||
#ifndef SQLITE_INTERNAL_LINKAGE
|
||||
# define SQLITE_INTERNAL_LINKAGE extern /* external to translation unit */
|
||||
# include <stdio.h>
|
||||
#else
|
||||
# define SHELL_NO_SYSINC /* Better yet, modify mkshellc.tcl for this. */
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE3_H
|
||||
# include "sqlite3.h"
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_CIO_NO_CLASSIFY
|
||||
|
||||
/* Define enum for use with following function. */
|
||||
typedef enum StreamsAreConsole {
|
||||
SAC_NoConsole = 0,
|
||||
SAC_InConsole = 1, SAC_OutConsole = 2, SAC_ErrConsole = 4,
|
||||
SAC_AnyConsole = 0x7
|
||||
} StreamsAreConsole;
|
||||
|
||||
/*
|
||||
** Classify the three standard I/O streams according to whether
|
||||
** they are connected to a console attached to the process.
|
||||
**
|
||||
** Returns the bit-wise OR of SAC_{In,Out,Err}Console values,
|
||||
** or SAC_NoConsole if none of the streams reaches a console.
|
||||
**
|
||||
** This function should be called before any I/O is done with
|
||||
** the given streams. As a side-effect, the given inputs are
|
||||
** recorded so that later I/O operations on them may be done
|
||||
** differently than the C library FILE* I/O would be done,
|
||||
** iff the stream is used for the I/O functions that follow,
|
||||
** and to support the ones that use an implicit stream.
|
||||
**
|
||||
** On some platforms, stream or console mode alteration (aka
|
||||
** "Setup") may be made which is undone by consoleRestore().
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE StreamsAreConsole
|
||||
consoleClassifySetup( FILE *pfIn, FILE *pfOut, FILE *pfErr );
|
||||
/* A usual call for convenience: */
|
||||
#define SQLITE_STD_CONSOLE_INIT() consoleClassifySetup(stdin,stdout,stderr)
|
||||
|
||||
/*
|
||||
** After an initial call to consoleClassifySetup(...), renew
|
||||
** the same setup it effected. (A call not after is an error.)
|
||||
** This will restore state altered by consoleRestore();
|
||||
**
|
||||
** Applications which run an inferior (child) process which
|
||||
** inherits the same I/O streams may call this function after
|
||||
** such a process exits to guard against console mode changes.
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE void consoleRenewSetup(void);
|
||||
|
||||
/*
|
||||
** Undo any side-effects left by consoleClassifySetup(...).
|
||||
**
|
||||
** This should be called after consoleClassifySetup() and
|
||||
** before the process terminates normally. It is suitable
|
||||
** for use with the atexit() C library procedure. After
|
||||
** this call, no console I/O should be done until one of
|
||||
** console{Classify or Renew}Setup(...) is called again.
|
||||
**
|
||||
** Applications which run an inferior (child) process that
|
||||
** inherits the same I/O streams might call this procedure
|
||||
** before so that said process will have a console setup
|
||||
** however users have configured it or come to expect.
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE void SQLITE_CDECL consoleRestore( void );
|
||||
|
||||
#else /* defined(SQLITE_CIO_NO_CLASSIFY) */
|
||||
# define consoleClassifySetup(i,o,e)
|
||||
# define consoleRenewSetup()
|
||||
# define consoleRestore()
|
||||
#endif /* defined(SQLITE_CIO_NO_CLASSIFY) */
|
||||
|
||||
#ifndef SQLITE_CIO_NO_REDIRECT
|
||||
/*
|
||||
** Set stream to be used for the functions below which write
|
||||
** to "the designated X stream", where X is Output or Error.
|
||||
** Returns the previous value.
|
||||
**
|
||||
** Alternatively, pass the special value, invalidFileStream,
|
||||
** to get the designated stream value without setting it.
|
||||
**
|
||||
** Before the designated streams are set, they default to
|
||||
** those passed to consoleClassifySetup(...), and before
|
||||
** that is called they default to stdout and stderr.
|
||||
**
|
||||
** It is error to close a stream so designated, then, without
|
||||
** designating another, use the corresponding {o,e}Emit(...).
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE FILE *invalidFileStream;
|
||||
SQLITE_INTERNAL_LINKAGE FILE *setOutputStream(FILE *pf);
|
||||
# ifdef CONSIO_SET_ERROR_STREAM
|
||||
SQLITE_INTERNAL_LINKAGE FILE *setErrorStream(FILE *pf);
|
||||
# endif
|
||||
#else
|
||||
# define setOutputStream(pf)
|
||||
# define setErrorStream(pf)
|
||||
#endif /* !defined(SQLITE_CIO_NO_REDIRECT) */
|
||||
|
||||
#ifndef SQLITE_CIO_NO_TRANSLATE
|
||||
/*
|
||||
** Emit output like fprintf(). If the output is going to the
|
||||
** console and translation from UTF-8 is necessary, perform
|
||||
** the needed translation. Otherwise, write formatted output
|
||||
** to the provided stream almost as-is, possibly with newline
|
||||
** translation as specified by set{Binary,Text}Mode().
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE int fPrintfUtf8(FILE *pfO, const char *zFormat, ...);
|
||||
/* Like fPrintfUtf8 except stream is always the designated output. */
|
||||
SQLITE_INTERNAL_LINKAGE int oPrintfUtf8(const char *zFormat, ...);
|
||||
/* Like fPrintfUtf8 except stream is always the designated error. */
|
||||
SQLITE_INTERNAL_LINKAGE int ePrintfUtf8(const char *zFormat, ...);
|
||||
|
||||
/*
|
||||
** Emit output like fputs(). If the output is going to the
|
||||
** console and translation from UTF-8 is necessary, perform
|
||||
** the needed translation. Otherwise, write given text to the
|
||||
** provided stream almost as-is, possibly with newline
|
||||
** translation as specified by set{Binary,Text}Mode().
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE int fPutsUtf8(const char *z, FILE *pfO);
|
||||
/* Like fPutsUtf8 except stream is always the designated output. */
|
||||
SQLITE_INTERNAL_LINKAGE int oPutsUtf8(const char *z);
|
||||
/* Like fPutsUtf8 except stream is always the designated error. */
|
||||
SQLITE_INTERNAL_LINKAGE int ePutsUtf8(const char *z);
|
||||
|
||||
/*
|
||||
** Emit output like fPutsUtf8(), except that the length of the
|
||||
** accepted char or character sequence is limited by nAccept.
|
||||
**
|
||||
** Returns the number of accepted char values.
|
||||
*/
|
||||
#ifdef CONSIO_SPUTB
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
fPutbUtf8(FILE *pfOut, const char *cBuf, int nAccept);
|
||||
/* Like fPutbUtf8 except stream is always the designated output. */
|
||||
#endif
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
oPutbUtf8(const char *cBuf, int nAccept);
|
||||
/* Like fPutbUtf8 except stream is always the designated error. */
|
||||
#ifdef CONSIO_EPUTB
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
ePutbUtf8(const char *cBuf, int nAccept);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Flush the given output stream. Return non-zero for success, else 0.
|
||||
*/
|
||||
#if !defined(SQLITE_CIO_NO_FLUSH) && !defined(SQLITE_CIO_NO_SETMODE)
|
||||
SQLITE_INTERNAL_LINKAGE int
|
||||
fFlushBuffer(FILE *pfOut);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Collect input like fgets(...) with special provisions for input
|
||||
** from the console on such platforms as require same. Newline
|
||||
** translation may be done as set by set{Binary,Text}Mode().
|
||||
** As a convenience, pfIn==NULL is treated as stdin.
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE char* fGetsUtf8(char *cBuf, int ncMax, FILE *pfIn);
|
||||
/* Like fGetsUtf8 except stream is always the designated input. */
|
||||
/* SQLITE_INTERNAL_LINKAGE char* iGetsUtf8(char *cBuf, int ncMax); */
|
||||
|
||||
#endif /* !defined(SQLITE_CIO_NO_TRANSLATE) */
|
||||
|
||||
#ifndef SQLITE_CIO_NO_SETMODE
|
||||
/*
|
||||
** Set given stream for binary mode, where newline translation is
|
||||
** not done, or for text mode where, for some platforms, newlines
|
||||
** are translated to the platform's conventional char sequence.
|
||||
** If bFlush true, flush the stream.
|
||||
**
|
||||
** An additional side-effect is that if the stream is one passed
|
||||
** to consoleClassifySetup() as an output, it is flushed first.
|
||||
**
|
||||
** Note that binary/text mode has no effect on console I/O
|
||||
** translation. On all platforms, newline to the console starts
|
||||
** a new line and CR,LF chars from the console become a newline.
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE void setBinaryMode(FILE *, short bFlush);
|
||||
SQLITE_INTERNAL_LINKAGE void setTextMode(FILE *, short bFlush);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_CIO_PROMPTED_IN
|
||||
typedef struct Prompts {
|
||||
int numPrompts;
|
||||
const char **azPrompts;
|
||||
} Prompts;
|
||||
|
||||
/*
|
||||
** Macros for use of a line editor.
|
||||
**
|
||||
** The following macros define operations involving use of a
|
||||
** line-editing library or simple console interaction.
|
||||
** A "T" argument is a text (char *) buffer or filename.
|
||||
** A "N" argument is an integer.
|
||||
**
|
||||
** SHELL_ADD_HISTORY(T) // Record text as line(s) of history.
|
||||
** SHELL_READ_HISTORY(T) // Read history from file named by T.
|
||||
** SHELL_WRITE_HISTORY(T) // Write history to file named by T.
|
||||
** SHELL_STIFLE_HISTORY(N) // Limit history to N entries.
|
||||
**
|
||||
** A console program which does interactive console input is
|
||||
** expected to call:
|
||||
** SHELL_READ_HISTORY(T) before collecting such input;
|
||||
** SHELL_ADD_HISTORY(T) as record-worthy input is taken;
|
||||
** SHELL_STIFLE_HISTORY(N) after console input ceases; then
|
||||
** SHELL_WRITE_HISTORY(T) before the program exits.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Retrieve a single line of input text from an input stream.
|
||||
**
|
||||
** If pfIn is the input stream passed to consoleClassifySetup(),
|
||||
** and azPrompt is not NULL, then a prompt is issued before the
|
||||
** line is collected, as selected by the isContinuation flag.
|
||||
** Array azPrompt[{0,1}] holds the {main,continuation} prompt.
|
||||
**
|
||||
** If zBufPrior is not NULL then it is a buffer from a prior
|
||||
** call to this routine that can be reused, or will be freed.
|
||||
**
|
||||
** The result is stored in space obtained from malloc() and
|
||||
** must either be freed by the caller or else passed back to
|
||||
** this function as zBufPrior for reuse.
|
||||
**
|
||||
** This function may call upon services of a line-editing
|
||||
** library to interactively collect line edited input.
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE char *
|
||||
shellGetLine(FILE *pfIn, char *zBufPrior, int nLen,
|
||||
short isContinuation, Prompts azPrompt);
|
||||
#endif /* defined(SQLITE_CIO_PROMPTED_IN) */
|
||||
/*
|
||||
** TBD: Define an interface for application(s) to generate
|
||||
** completion candidates for use by the line-editor.
|
||||
**
|
||||
** This may be premature; the CLI is the only application
|
||||
** that does this. Yet, getting line-editing melded into
|
||||
** console I/O is desirable because a line-editing library
|
||||
** may have to establish console operating mode, possibly
|
||||
** in a way that interferes with the above functionality.
|
||||
*/
|
||||
|
||||
#if !(defined(SQLITE_CIO_NO_UTF8SCAN)&&defined(SQLITE_CIO_NO_TRANSLATE))
|
||||
/* Skip over as much z[] input char sequence as is valid UTF-8,
|
||||
** limited per nAccept char's or whole characters and containing
|
||||
** no char cn such that ((1<<cn) & ccm)!=0. On return, the
|
||||
** sequence z:return (inclusive:exclusive) is validated UTF-8.
|
||||
** Limit: nAccept>=0 => char count, nAccept<0 => character
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE const char*
|
||||
zSkipValidUtf8(const char *z, int nAccept, long ccm);
|
||||
|
||||
#endif
|
||||
@@ -6169,7 +6169,7 @@ int sqlite3Fts3Corrupt(){
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SQLITE_CORE
|
||||
#if !defined(SQLITE_CORE)
|
||||
/*
|
||||
** Initialize API pointer table, if required.
|
||||
*/
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "fts5.h"
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
extern int sqlite3_fts5_may_be_corrupt;
|
||||
@@ -1626,6 +1627,64 @@ static int SQLITE_TCLAPI f5tDropCorruptTable(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Free a buffer returned to SQLite by the str() function.
|
||||
*/
|
||||
void f5tFree(void *p){
|
||||
char *x = (char *)p;
|
||||
ckfree(&x[-8]);
|
||||
}
|
||||
|
||||
/*
|
||||
** Implementation of str().
|
||||
*/
|
||||
void f5tStrFunc(sqlite3_context *pCtx, int nArg, sqlite3_value **apArg){
|
||||
const char *zText = 0;
|
||||
assert( nArg==1 );
|
||||
|
||||
zText = sqlite3_value_text(apArg[0]);
|
||||
if( zText ){
|
||||
sqlite3_int64 nText = strlen(zText);
|
||||
char *zCopy = (char*)ckalloc(nText+8);
|
||||
if( zCopy==0 ){
|
||||
sqlite3_result_error_nomem(pCtx);
|
||||
}else{
|
||||
zCopy += 8;
|
||||
memcpy(zCopy, zText, nText);
|
||||
sqlite3_result_text64(pCtx, zCopy, nText, f5tFree, SQLITE_UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** sqlite3_fts5_register_str DB
|
||||
**
|
||||
** Register the str() function with database handle DB. str() interprets
|
||||
** its only argument as text and returns a copy of the value in a
|
||||
** non-nul-terminated buffer.
|
||||
*/
|
||||
static int SQLITE_TCLAPI f5tRegisterStr(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
sqlite3 *db = 0;
|
||||
int rc;
|
||||
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DB");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( f5tDbPointer(interp, objv[1], &db) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
sqlite3_create_function(db, "str", 1, SQLITE_UTF8, 0, f5tStrFunc, 0, 0);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Entry point.
|
||||
*/
|
||||
@@ -1645,7 +1704,8 @@ int Fts5tcl_Init(Tcl_Interp *interp){
|
||||
{ "sqlite3_fts5_register_matchinfo", f5tRegisterMatchinfo, 0 },
|
||||
{ "sqlite3_fts5_register_fts5tokenize", f5tRegisterTok, 0 },
|
||||
{ "sqlite3_fts5_register_origintext",f5tRegisterOriginText, 0 },
|
||||
{ "sqlite3_fts5_drop_corrupt_table", f5tDropCorruptTable, 0 }
|
||||
{ "sqlite3_fts5_drop_corrupt_table", f5tDropCorruptTable, 0 },
|
||||
{ "sqlite3_fts5_register_str", f5tRegisterStr, 0 }
|
||||
};
|
||||
int i;
|
||||
F5tTokenizerContext *pContext;
|
||||
|
||||
@@ -342,6 +342,13 @@ do_test 10.3 {
|
||||
}
|
||||
} {}
|
||||
|
||||
|
||||
do_execsql_test 11.0 {
|
||||
CREATE VIRTUAL TABLE t4 USING fts5(y, tokenize=trigram);
|
||||
}
|
||||
sqlite3_fts5_register_str db
|
||||
do_execsql_test 11.1 {
|
||||
INSERT INTO t4 VALUES( str('') );
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# restart with tclsh \
|
||||
exec tclsh "$0" "$@"
|
||||
|
||||
set srcdir [file dirname [file dirname [info script]]]
|
||||
set srcdir [file dirname [file dirname [file normalize [info script]]]]
|
||||
set G(src) [string map [list %dir% $srcdir] {
|
||||
%dir%/fts5.h
|
||||
%dir%/fts5Int.h
|
||||
|
||||
@@ -571,7 +571,7 @@ int sqlite3IcuInit(sqlite3 *db){
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
#if !SQLITE_CORE
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
|
||||
@@ -4449,7 +4449,7 @@ int sqlite3_rtree_query_callback(
|
||||
);
|
||||
}
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
#if !SQLITE_CORE
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
########################################################################
|
||||
default: all
|
||||
#default: quick
|
||||
SHELL := $(firstword $(wildcard /usr/local/bin/bash /usr/bin/bash /bin/bash))
|
||||
SHELL := $(firstword $(shell which bash) $(wildcard /usr/local/bin/bash /usr/bin/bash /bin/bash))
|
||||
ifeq (,$(SHELL))
|
||||
$(error Cannot find the bash shell)
|
||||
endif
|
||||
@@ -174,14 +174,9 @@ ifeq (1,$(MAKING_CLEAN))
|
||||
emcc.bin := echo
|
||||
emcc.version := unknown
|
||||
else
|
||||
emcc.bin := $(shell which emcc 2>/dev/null)
|
||||
ifeq (,$(emcc.bin))
|
||||
ifneq (,$(EMSDK_HOME))
|
||||
emcc.bin := $(wildcard $(EMSDK_HOME)/upstream/emscripten/emcc)
|
||||
endif
|
||||
ifeq (,$(emcc.bin))
|
||||
$(error Cannot find emcc in path.)
|
||||
endif
|
||||
emcc.bin := $(dir.tool)/emcc.sh
|
||||
ifeq (,$(wildcard $(emcc.bin)))
|
||||
$(error Configure script did not find emcc.)
|
||||
endif
|
||||
emcc.version := $(shell $(emcc.bin) --version | sed -n 1p | sed -e 's/^.* \([3-9][^ ]*\) .*$$/\1/;')
|
||||
$(info using emcc version [$(emcc.version)])
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
C Add\smissing\sZERO_ARGUMENT_GENERATE_SERIES\schecks\sto\sext/misc/series.c,\sas\sreported\svia\ssupport\smail.
|
||||
D 2024-10-24T15:57:29.106
|
||||
C Omit\sthe\santiquated\sand\slong-unsupport\sasync\sextension\ssince\sit\shas\sbeen\nsuperseded\sby\sWAL\smode\sfor\sover\sa\sdecade.
|
||||
D 2024-10-28T15:38:53.409
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
F Makefile.in 1376a160cd98a14d118a9f8c2db88f0f906586234a0b0f49f2af13e95c1ebbcd
|
||||
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
|
||||
F Makefile.msc 58b69eda1faad5d475092b8aeffab9156ee4901a82db089b166607f2ec907ee4
|
||||
F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2
|
||||
F Makefile.in 02ea00ff433902dba369d4a55b3aeb6bb1ffe2d82f777194984b8cdd7ed7c3ad
|
||||
F Makefile.linux-generic 69b54c58ab2424a0d30f340d9defd7e87c25690a55b77acb9bdc657bd9a223f1
|
||||
F Makefile.msc a92237976eb92c5efaa0dd2524746aec12c196e12df8d4dbff9543a4648c3312
|
||||
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
|
||||
F VERSION 0db40f92c04378404eb45bff93e9e42c148c7e54fd3da99469ed21e22411f5a6
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F VERSION 8dc0c3df15fd5ff0622f88fc483533fce990b1cbb2f5fb9fdfb4dbd71eef2889
|
||||
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
|
||||
F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d87031
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
|
||||
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
|
||||
F auto.def 537d9e3cd85ed5a454ee6055585a4eadedde921fbb686fcb40c8446933be2b5a
|
||||
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
|
||||
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
|
||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||
F autoconf/Makefile.msc 0a1fdef1f2c618815cf7c82c817a7369c1e07b3cfed490803db16fb43326d506
|
||||
F autoconf/Makefile.msc 1162ef7b7937ba6927b038f824b050855784d417e785fe35ab71d20afd18022b
|
||||
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
|
||||
F autoconf/README.txt 5e946ffb6fbdbb114c81e1bdc862df27fce8beab557d7b0421820b0fe8fc048f
|
||||
F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d5893b277
|
||||
F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e
|
||||
F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3
|
||||
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
|
||||
F autoconf/tea/configure.ac a73dff08c9aee25cb65bb5f83f511ac71760a7a288c59cfcea6504c1ac0f7ced
|
||||
F autoconf/tea/configure.ac ff2d745f88e493080810b67958d88b4f7a7d79f19e2ee8e7f72ffd6fc04eabc7
|
||||
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
|
||||
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
|
||||
F autoconf/tea/pkgIndex.tcl.in 55aec3c6d7e9a1de9b8d2fdc9c27fd055da3ac3a51b572195e2ae7300bcfd3a2
|
||||
@@ -35,14 +35,29 @@ F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea0034
|
||||
F autoconf/tea/win/rules-ext.vc fd5740d97aac8c41c97eaa0fbcc0c15a41b6f7075d5f9f593e147d7a284a247a
|
||||
F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0999d66484f4c
|
||||
F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd
|
||||
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
|
||||
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
|
||||
F configure 135e050689ea244477582e6d77cc7867dfcfe6e0f82e3eab3e47655a67035f8f x
|
||||
F configure.ac aca8ebf47b7644c473e11e599ea986eeb23860a8732a8812039ad961ef52a713
|
||||
F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
|
||||
F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e
|
||||
F autosetup/autosetup 9416ffdcdd6e2dbf7f6d1e5c890078518930f8af7722a950eacc28c7f151d2d6 x
|
||||
F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x
|
||||
F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x
|
||||
F autosetup/autosetup-find-tclsh 38dc4ac03c061d5ee53ecd1ec2fc3d5f0bbf4e84a7123d3160e01d26b5858f36 x
|
||||
F autosetup/autosetup-test-tclsh 749d20defee533a3842139df47d700fc7a334a5da7bdbd444ae5331744b06c5f
|
||||
F autosetup/cc-db.tcl 6e0ed90146197a5a05b245e649975c07c548e30926b218ca3e1d4dc034b10a7b
|
||||
F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795facf7360
|
||||
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
|
||||
F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
|
||||
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
|
||||
F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6
|
||||
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
|
||||
F autosetup/proj.tcl b01940e6b2e9c24f2c50f0e180d308a0a4f88d2e2b00c6902edd5980d221becf
|
||||
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
|
||||
F autosetup/tmake.auto eaebc74ad538dfdd3c817c27eefc31930c20510c4f3a3704071f6cb0629ed71f
|
||||
F autosetup/tmake.tcl a275793ec1b6f8708179af0acef1f6f10d46c2920739743f7a8720c6d700c7a9
|
||||
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
|
||||
F doc/compile-for-unix.md 343fe9334260d8695c36b465f55221f0187c8e7abaaa4d5afb4d564ed1d22dc1
|
||||
F doc/compile-for-windows.md 90f97b9e6bbf27470e825711064bca409d26355f8f31416631a1722bcddf0612
|
||||
F doc/compile-for-unix.md 7d6a5770611ea0643de456b385581923dac7c0a7c3758825dda810d12fc3e5b2
|
||||
F doc/compile-for-windows.md 17e1491897a117ff0247531a61671b26d487bc1dad25c3894c04ad4fca936a7f
|
||||
F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
|
||||
F doc/jsonb.md 5fab4b8613aa9153fbeb6259297bd4697988af8b3d23900deba588fa7841456b
|
||||
F doc/lemon.html 8b266ff711d2ec7f867c3dca37634963f48a630329908cc282beebfa8c708706
|
||||
@@ -53,11 +68,6 @@ F doc/vdbesort-memory.md 4da2639c14cd24a31e0af694b1a8dd37eaf277aff3867e9a8cc1404
|
||||
F doc/vfs-shm.txt e101f27ea02a8387ce46a05be2b1a902a021d37a
|
||||
F doc/wal-lock.md 781726aaba20bafeceb7ba9f91d5c98c6731691b30c954e37cf0b49a053d461d
|
||||
F ext/README.md fd5f78013b0a2bc6f0067afb19e6ad040e89a10179b4f6f03eee58fac5f169bd
|
||||
F ext/async/README.txt e12275968f6fde133a80e04387d0e839b0c51f91
|
||||
F ext/async/sqlite3async.c 6f247666b495c477628dd19364d279c78ea48cd90c72d9f9b98ad1aff3294f94
|
||||
F ext/async/sqlite3async.h 46b47c79357b97ad85d20d2795942c0020dc20c532114a49808287f04aa5309a
|
||||
F ext/consio/console_io.c d2b74afae8d301de2e8447b1045fcd33eb59df13bf581d906d99c74fe5d2b13f x
|
||||
F ext/consio/console_io.h b5ebe34aa15b357621ebbea3d3f2e2b24750d4280b5802516409e23947fd9ee5
|
||||
F ext/expert/README.md b321c2762bb93c18ea102d5a5f7753a4b8bac646cb392b3b437f633caf2020c3
|
||||
F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3f086a4
|
||||
F ext/expert/expert1.test 1d2da6606623b57bb47064e02140823ce1daecd4cacbf402c73ad3473d7f000c
|
||||
@@ -68,7 +78,7 @@ F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c c922380b62bd15bce953dae3350337acbd0fff07c10cdc805819409791eb480a
|
||||
F ext/fts3/fts3.c 59ae8c42ed3c39478faa6d122687e467ac34c98a63282e834f7df9cb5076c450
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h 968f7d7cae541a6926146e9fd3fb2b2ccbd3845b7890a8ed03de0c06ac776682
|
||||
F ext/fts3/fts3_aux.c 7eab82a9cf0830f6551ba3abfdbe73ed39e322a4d3940ee82fbf723674ecd9f3
|
||||
@@ -105,7 +115,7 @@ F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a
|
||||
F ext/fts5/fts5_index.c 368a968570ce12ba40223e284a588d9f93ee23a0133727f0df1fcd64086b1fb6
|
||||
F ext/fts5/fts5_main.c 50eb059e51d730e8e0c77df4e568b018079e112a755c094488b0d5b1aa06afbb
|
||||
F ext/fts5/fts5_storage.c 337b05e4c66fc822d031e264d65bde807ec2fab08665ca2cc8aaf9c5fa06792c
|
||||
F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe
|
||||
F ext/fts5/fts5_tcl.c 5b16a249962809b2aaaab964bf58838ea72f30b8b12373cafe612f8cc71e2a40
|
||||
F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee
|
||||
F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b
|
||||
F ext/fts5/fts5_tokenize.c 033e2e43b8e852c0ef6cecc611266d61e2346e52ec7dcfb76a428fe56a07efa9
|
||||
@@ -240,7 +250,7 @@ F ext/fts5/test/fts5tok2.test dcacb32d4a2a3f0dd3215d4a3987f78ae4be21a2
|
||||
F ext/fts5/test/fts5tokenizer.test 7937cec672b148223fff8746d21d3e7ed0965fd7caf35ccdc888a005bb452f98
|
||||
F ext/fts5/test/fts5tokenizer2.test ddb8b10fbe4b84b2a75812671f127774c1d2e3e2bf82d2e0e4f0bb1cd8a2b2d6
|
||||
F ext/fts5/test/fts5tokenizer3.test eea778f7bb7024c3e904e28915f9d53286141671b138722148be22a9c758bdc3
|
||||
F ext/fts5/test/fts5trigram.test fb9ee982edd76280ce979905a2251081cd04ae4c470248bd5d391b2d096430ab
|
||||
F ext/fts5/test/fts5trigram.test 9927c9e9b35116ea00748c8e41d9cbc2b95a6c90845cd82a59c11fedfd16404a
|
||||
F ext/fts5/test/fts5trigram2.test 6fde9de7f63a6b4aa18dc731be56dbd6be4e755c9b13dcd55479e200d1df0e61
|
||||
F ext/fts5/test/fts5ubsan.test 9a2dcf399dc8d0e0de661f0d93884d1d27e5b7f0693cfceb97dd24d818df5dd2
|
||||
F ext/fts5/test/fts5umlaut.test a42fe2fe6387c40c49ab27ccbd070e1ae38e07f38d05926482cc0bccac9ad602
|
||||
@@ -258,10 +268,10 @@ F ext/fts5/test/fts5vocab2.test bbba149c254375d00055930c1a501c9a51e80b0d20bf7b98
|
||||
F ext/fts5/tool/fts5speed.tcl b0056f91a55b2d1a3684ec05729de92b042e2f85
|
||||
F ext/fts5/tool/fts5txt2db.tcl c0d43c8590656f8240e622b00957b3a0facc49482411a9fdc2870b45c0c82f9f
|
||||
F ext/fts5/tool/loadfts5.tcl 95b03429ee6b138645703c6ca192c3ac96eaf093
|
||||
F ext/fts5/tool/mkfts5c.tcl 6649ed963a9135e36866f7cc9f8de5c8dcec85b5df089388274cee6381702cb7
|
||||
F ext/fts5/tool/mkfts5c.tcl 135b9e160f8e10211c10c5873d5e8c3eaebd3da9ec56a12ae4db157d4738ffe4
|
||||
F ext/fts5/tool/showfts5.tcl d54da0e067306663e2d5d523965ca487698e722c
|
||||
F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f400fc9
|
||||
F ext/icu/icu.c 9837f4611915baad1edbe38222f3ee7d1b5e118ab16fec9ba603720f72c78b2a
|
||||
F ext/icu/icu.c 3add8197e0a86c1761771a39500ebae749438bcf1836160b407a56b4eaa8721c
|
||||
F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a32075a8
|
||||
F ext/intck/intck1.test f3a3cba14b6aeff145ffa5515546dd22f7510dad91512e519f43b92b56514012
|
||||
F ext/intck/intck2.test d2457c7e5e5b688046d15ebe08a1e1427cc5e7a6dc8d6af215f42e8bcaf67304
|
||||
@@ -525,7 +535,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
|
||||
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/geopoly.c 0dd4775e896cee6067979d67aff7c998e75c2c9d9cd8d62a1a790c09cde7adca
|
||||
F ext/rtree/rtree.c e002d8c58bf128d812db662ecc72b61c00ff14408ec807e103d5312a6d29817a
|
||||
F ext/rtree/rtree.c b6133dba5ae331fa6c1fc34df6aa623eba951b05ac35116f954a0bf7ab550436
|
||||
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
|
||||
F ext/rtree/rtree1.test e0608db762b2aadca0ecb6f97396cf66244490adc3ba88f2a292b27be3e1da3e
|
||||
F ext/rtree/rtree2.test 9d9deddbb16fd0c30c36e6b4fdc3ee3132d765567f0f9432ee71e1303d32603d
|
||||
@@ -608,7 +618,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
|
||||
F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c
|
||||
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
|
||||
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
|
||||
F ext/wasm/GNUmakefile 128f8e9830dd8c50c14558649a6f13a2742e9d48223cc67485779baeebbc7391
|
||||
F ext/wasm/GNUmakefile 311aa0d5edc7006409962cc77cc26560d92f9be69c2c4302e8bbc68189fd02db
|
||||
F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576
|
||||
F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193
|
||||
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
|
||||
@@ -692,7 +702,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk c6501abe2d915ed1a2ec3d074e652c096177f93c50ac91f815c831e3417f9019
|
||||
F main.mk c5e17513c0f68b514d0f1b5afabcc0aabfedf8ebba0e6314435df1edcb7e8fd4
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@@ -702,8 +712,8 @@ F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d
|
||||
F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F sqlite_cfg.h.in baf2e409c63d4e7a765e17769b6ff17c5a82bbd9cbf1e284fd2e4cefaff3fcf2
|
||||
F sqlite3.pc.in 0977c03a4da7c4204bd60e784a0efb8d51a190448aba78a4e973fe7192bdaf03
|
||||
F sqlite_cfg.h.in be1d075cf77134d53fdf5cc2c0919842e7e02a648c66a56e735af25ccdcaff91
|
||||
F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532
|
||||
F src/analyze.c 9a8b67239d899ac12289db5db3f5bfe7f7a0ad1277f80f87ead1d048085876eb
|
||||
F src/attach.c 08235ab62ed5ccc93c22bf36e640d19effcd632319615851bccf724ec9341333
|
||||
@@ -773,7 +783,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
|
||||
F src/shell.c.in 0662f9bcf0725461778d0254a06150e5d61c08c5a87a7281ccdf45552050c79d
|
||||
F src/shell.c.in 2fb0947424944f8baa1b4efdfd9eca70dc0691bbc1cb4d283db7fc142937fa3a
|
||||
F src/sqlite.h.in 29fc900a58f394c7488d093fd7a8dcb14d3fa6399d5178cb20adcf88dbedfe39
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
@@ -782,8 +792,8 @@ F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee
|
||||
F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c 47d4bb6eb06aab48d643eeb8c4f65b5fa9529fa5526fdcbf223ea32277ed1b56
|
||||
F src/tclsqlite.h 529047feec49e7f463374749147f64d3f17505b0ebd84b3477a364c6f46a9de1
|
||||
F src/test1.c 8bf8b74145b768f42386787f93f6d6dad7bc400a4ee2d50e4ad5a06a20a97ef1
|
||||
F src/tclsqlite.h 65e2c761446e1c9fa0342b7d2612a703483643c8b6a316d12a65b745a4727395
|
||||
F src/test1.c 370668f1832dc7bc2ab0212d807d880b6cdb0d5949550489593ce0cdb4a61012
|
||||
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
|
||||
F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b
|
||||
F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d
|
||||
@@ -791,7 +801,6 @@ F src/test5.c bb87279ed12e199486894e6c83e58dc8cd1de9524ace171d59219d3ab696a0c1
|
||||
F src/test6.c 763b92489f11f4a77b773f0d3b8369ab0edd5292ac794043062c337019f12d8a
|
||||
F src/test8.c 206d8f3cc73950d252906656e2646b5de0d580b07187b635fcb3edd8c2c5fbc0
|
||||
F src/test9.c 7a708ad27f8fda79113e5e15de66632710958c401e64c2f22bc04e2f5a7a1b62
|
||||
F src/test_async.c 0101173cf8137ba5473a84a695281fa9dedc2a1d155998c68623f2978017ad98
|
||||
F src/test_autoext.c 14d4bbd3d0bd1eec0f6d16b29e28cf1e2d0b020d454835f0721a5f68121ac10f
|
||||
F src/test_backup.c bd901e3c116c7f3b3bbbd4aae4ce87d99b400c9cbb0a9e7b4610af451d9719a7
|
||||
F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6
|
||||
@@ -824,7 +833,7 @@ F src/test_schema.c b06d3ddc3edc173c143878f3edb869dd200d57d918ae2f38820534f9a5e3
|
||||
F src/test_sqllog.c 540feaea7280cd5f926168aee9deb1065ae136d0bbbe7361e2ef3541783e187a
|
||||
F src/test_superlock.c 18355ca274746aa6909e3744163e5deb1196a85d5bc64b9cd377273cef626da7
|
||||
F src/test_syscall.c 9ad7ab39910c16d29411678d91b0d27a7a996a718df5ee93dcd635e846d0275c
|
||||
F src/test_tclsh.c 6077f2bdc6b4ea2bace2a0cd6ea48e0a4651007ae7382c13efc0c495eb0c6956
|
||||
F src/test_tclsh.c c01706ac60bd3176754d3ccd37da74c6ad97c2e14489f8ed71b497c1c0ac0dd4
|
||||
F src/test_tclvar.c ae873248a0188459b1c16ca7cc431265dacce524399e8b46725c2b3b7e048424
|
||||
F src/test_thread.c d7a8bcea7445f37cc2a1f7f81dd6059634f45e0c61bfe80182b02872fb0328bb
|
||||
F src/test_vdbecov.c 5c426d9cd2b351f5f9ceb30cabf8c64a63bfcad644c507e0bd9ce2f6ae1a3bf3
|
||||
@@ -906,11 +915,6 @@ F test/analyzeE.test d2ec7921c162cdc33ac8e7eb01f9ebf78100610af7c94c8552bbf551de1
|
||||
F test/analyzeF.test 40b5cc3ad7b10e81020d7ca86f1417647ecfae7477cfd88acc5aa7ae1068f949
|
||||
F test/analyzeG.test 623be33038c49648872746c8dd8b23b5792c08fef173c55e82f1b12fca259852
|
||||
F test/analyzer1.test 459fa02c445ddbf0101a3bad47b34290a35f2e49
|
||||
F test/async.test 1d0e056ba1bb9729283a0f22718d3a25e82c277b
|
||||
F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b
|
||||
F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
|
||||
F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a
|
||||
F test/async5.test 383ab533fdb9f7ad228cc99ee66e1acb34cc0dc0
|
||||
F test/atof1.test 7ec56debc04b32e8f9dc87239f4bbb07d84550fb83dd7475b0ead9e83beb35da
|
||||
F test/atomic.test 065a453dde33c77ff586d91ccaa6ed419829d492dbb1a5694b8a09f3f9d7d061
|
||||
F test/atomic2.test b6863b4aa552543874f80b42fb3063f1c8c2e3d8e56b6562f00a3cc347b5c1da
|
||||
@@ -1404,7 +1408,7 @@ F test/literal2.tcl 1499037beaf661aeecdbe48801220a181d805372a64c6128d5f26bb6a4a8
|
||||
F test/literal2.test b149e16b5fc9ee6249069a8858ed41052f222014fe0ba7ad43c2fb989c2dada2
|
||||
F test/loadext.test faa4f6eed07a5aac35d57fdd7bc07f8fc82464cfd327567c10cf0ba3c86cde04
|
||||
F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
|
||||
F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db
|
||||
F test/lock.test 05f346b65040b9a27c032c984e1e509dfef1661135b4f26a3ab6d21358277803
|
||||
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
|
||||
F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00
|
||||
F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8
|
||||
@@ -1413,7 +1417,7 @@ F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
|
||||
F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431
|
||||
F test/lock_common.tcl 2f3f7f2e9637f93ccf609df48ef5b27a50278b6b1cd752b445d52262e5841413
|
||||
F test/lookaside.test 5a828e7256f1ee4da8e1bdaa03373a3ccdb0f1ff98dfa82e9b76cb41a45b1083
|
||||
F test/main.test 6bbb3999fd461eb8fb335cbab97409a3d7f91bbb8da60635e8be3e4a04a77772
|
||||
F test/main.test e8752d76233b1c8906cd2c98ad920dba868bd63c87d51d8a2ea5e9cba55dd496
|
||||
F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9
|
||||
F test/malloc.test 18dd1c4188c81ca79cf123527c71b19ee0c31feb9947fdffb0dc6ceb1436816a
|
||||
F test/malloc3.test 6e88bae6312854a4adb4ecc2a6a5ea8c59b4db778b724ba718e1c43fc8c3c136
|
||||
@@ -1446,7 +1450,7 @@ F test/memdb1.test c737ac9aa5895092332b1dde24fae7ae494b7fcbcd346d22d600891096a38
|
||||
F test/memdb2.test 4ba1fc09e2f51df80d148a540e4a3fa66d0462e91167b27497084de4d1f6b5b4
|
||||
F test/memjournal.test 70f3a00c7f84ee2978ad14e831231caa1e7f23915a2c54b4f775a021d5740c6c
|
||||
F test/memjournal2.test dbc2c5cb5f7b38950f4f6dc3e73fcecf0fcbed3fc32c7ce913bba164d288da1e
|
||||
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
|
||||
F test/memleak.test c7478f1195d64887dd1c677edc39fa03b5bf29024e6dcc5b5cc554d7ed00b01f
|
||||
F test/memsubsys1.test 86b8158752af9188ed5b32a30674a1ef71183e6bc4e6808e815cd658ca9058a6
|
||||
F test/memsubsys2.test 774b93cb09ca50d1b759bb7c645baa2a9ce172edc3a3da67d5150a26a9fc2a08
|
||||
F test/merge1.test 7dd9dc6838bcd0623a069485fe3a8dd498a051c16e1877cf84f506c0d6a29b43
|
||||
@@ -1525,7 +1529,7 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
|
||||
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
|
||||
F test/pendingrace.test e99efc5ab3584da3dfc8cd6a0ec4e5a42214820574f5ea24ee93f1d84655f463
|
||||
F test/percentile.test 52ba89d6ee6b65f770972b67dace358bab7cdbd532803d3db157845268e789cd
|
||||
F test/permutations.test 405542f1d659942994a6b38a9e024cf5cfd23eaa68c806aeb24a72d7c9186e80
|
||||
F test/permutations.test 37650c5286f7d6f322af95cad876b69c6c2c79c28dc649f09de07d3312b1213c
|
||||
F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f
|
||||
F test/pragma.test 11cb9310c42f921918f7f563e3c0b6e70f9f9c3a6a1cf12af8fccb6c574f3882
|
||||
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
|
||||
@@ -1721,8 +1725,8 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl 7b44f1a9b9a2de8112695b908afc21dd9a68cd2d44e84b73f1b27b53492c0d59
|
||||
F test/testrunner.tcl bc1a8d21a1aa3a5cf7c4883cbee4b6748790fe960fad06ca5db74ec914bd6525 x
|
||||
F test/testrunner_data.tcl c7b3b911e44f7e8c01cc6bc7571e16115cdc2e4db46630bd2acd7a931a46380e
|
||||
F test/testrunner.tcl 4e764b0da245add9670d1010a69a3ac5474a5dfe15e1d3183294c23cca43ef13 x
|
||||
F test/testrunner_data.tcl ba4aeea28aa03cfa6fe7e57782ddecb7a7b91c3a0b3251583cb4f0ee002de6a6
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502
|
||||
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
|
||||
@@ -1771,7 +1775,6 @@ F test/tkt-8454a207b9.test ead80b7a01438ca1436cee029694a96c821346cf1e24f06de12f8
|
||||
F test/tkt-868145d012.test a5f941107ece6a64410ca4755c6329b7eb57a356
|
||||
F test/tkt-8c63ff0ec.test 258b7fc8d7e4e1cb5362c7d65c143528b9c4cbed
|
||||
F test/tkt-91e2e8ba6f.test 08c4f94ae07696b05c9b822da0b4e5337a2f54c5
|
||||
F test/tkt-94c04eaadb.test f738c57c7f68ab8be1c054415af7774617cb6223
|
||||
F test/tkt-99378177930f87bd.test 9d6cff39b50d062c813ae1cb0ebbd1b7acf81ecc23ae5d5215e5bb05667dc137
|
||||
F test/tkt-9a8b09f8e6.test b2ef151d0984b2ebf237760dbeaa50724e5a0667
|
||||
F test/tkt-9d68c883.test 16f7cb96781ba579bc2e19bb14b4ad609d9774b6
|
||||
@@ -2113,10 +2116,12 @@ F tool/buildtclext.tcl b64d250517b148e644d26fcbc097851867a0df52cd4bafe9bcd94b842
|
||||
F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x
|
||||
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
|
||||
F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca
|
||||
F tool/cp.tcl 9a0d663ad45828de13763ee7ca0200f31f56c6d742cf104a56ae80e027c242d8
|
||||
F tool/custom.txt 24ed55e71c5edae0067ba159bbf09240d58b160331f7716e95816cd3aa0ba5c4
|
||||
F tool/dbhash.c 5da0c61032d23d74f2ab84ffc5740f0e8abec94f2c45c0b4306be7eb3ae96df0
|
||||
F tool/dbtotxt.c ca48d34eaca6d6b6e4bd6a7be2b72caf34475869054240244c60fa7e69a518d6
|
||||
F tool/dbtotxt.md c9a57af8739957ef36d2cfad5c4b1443ff3688ed33e4901ee200c8b651f43f3c
|
||||
F tool/emcc.sh.in 5a3534af8d437747cf4141abaab3db558756f4a1ac8f3ebf28a16ffa26209921
|
||||
F tool/enlargedb.c 3e8b2612b985cfa7e3e8800031ee191b43ae80de96abb5abbd5eada62651ee21
|
||||
F tool/extract-sqlite3h.tcl 069ceab0cee26cba99952bfa08c0b23e35941c837acabe143f0c355d96c9e2eb x
|
||||
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
|
||||
@@ -2137,7 +2142,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669
|
||||
F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439
|
||||
F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176
|
||||
F tool/mkautoconfamal.sh cbdcf993fa83dccbef7fb77b39cdeb31ef9f77d9d88c9e343b58d35ca3898a6a
|
||||
F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x
|
||||
F tool/mkccode.tcl 4cb8ad7e7330aaed052b0657a1bfacbc67103c400e41860aff643a482cfc2d3e x
|
||||
F tool/mkctimec.tcl e3af51acc2ef92062fe6d622de010a27a34b497258a248dada04388b916c61c6 x
|
||||
F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559
|
||||
F tool/mkmsvcmin.tcl d76c45efda1cce2d4005bcea7b8a22bb752e3256009f331120fb4fecb14ebb7a
|
||||
@@ -2145,12 +2150,12 @@ F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61
|
||||
F tool/mkopcodeh.tcl 2b4e6967a670ef21bf53a164964c35c6163277d002a4c6f56fa231d68c88d023
|
||||
F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa
|
||||
F tool/mkpragmatab.tcl 32e359ccb21011958a821955254bd7a5fa7915d01a8c16fed91ffc8b40cb4adf
|
||||
F tool/mkshellc.tcl b7adf08b82de60811d2cb6af05ff59fc17e5cd6f3e98743c14eaaa3f8971fed0
|
||||
F tool/mkshellc.tcl 2bc29c201933ae72a16a79070fe80aded80c24ea487ecd2f8df20c2973c87bfc
|
||||
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
|
||||
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
|
||||
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
|
||||
F tool/mksqlite3c.tcl c6acfdf4e4ef93478ff3ce3cd593e17abb03f446036ce710c3156bcfa18665e0
|
||||
F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
|
||||
F tool/mksqlite3c.tcl 98a250d6f2ea60343268e32e2997790e678205ce128aa0d0a67a3f70811615af
|
||||
F tool/mksqlite3h.tcl 2a6ba8955adf9cfabd0617ee5949760e531e0b75b703b5faf8d1150657b5628f
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mktoolzip.tcl 34b4e92be544f820e2cc26f143f7d5aec511e826ec394cc82969a5dcf7c7a27c
|
||||
F tool/mkvsix.tcl 67b40996a50f985a573278eea32fc5a5eb6110bdf14d33f1d8086e48c69e540a
|
||||
@@ -2186,41 +2191,24 @@ F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaa
|
||||
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
|
||||
F tool/src-verify.c d00f93263aa2fa6ba0cba0106d95458e6effb94fdb5fc634f56834f90c05bbb4
|
||||
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
|
||||
F tool/srctree-check.tcl c15f860a3c97d5f7b4c14b60392d9466af29dd006c4ef18127f502641e2977a8
|
||||
F tool/srctree-check.tcl 1f1f505835a4beca64c1751a7ebec5c41a1ddf22b1e80481345b95059eef6583
|
||||
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
|
||||
F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37
|
||||
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
|
||||
F tool/symbols.sh 1612bd947750e21e7b47befad5f6b3825b06cce0705441f903bf35ced65ae9b9
|
||||
F tool/tclConfigShToTcl.sh 44ec55046d86a3febb2cb3e099399b41794e80e9cd138eee7b9b016f819e882b x
|
||||
F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003
|
||||
F tool/vdbe-compress.tcl 1dcb7632e57cf57105248029e6e162fddaf6c0fccb3bb9e6215603752c5a2d4a
|
||||
F tool/vdbe-compress.tcl fa2f37ab39b2a0087fafb6a7f3ce19503e25e624ffa8ed9951717ab72920c088
|
||||
F tool/vdbe_profile.tcl 3ac5a4a9449f4baf77059358ea050db3e34395ccf59c5464d29b91746d5b961e
|
||||
F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd72273503ae7d5
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
F vsixtest/App.xaml b76d3b48860e7454775c47ea38ffea9c4abe3e85
|
||||
F vsixtest/App.xaml.cpp 41158ee43269820136fa3bba00c0bd91b26cc38b650ee392aec2a8d823e54318
|
||||
F vsixtest/App.xaml.h 4a9768e2983d05600ad1e1c2f1b00a132967da9f
|
||||
F vsixtest/Assets/LockScreenLogo.scale-200.png e820c9a3deb909197081b0bf3216c06e13905f0a
|
||||
F vsixtest/Assets/SplashScreen.scale-200.png cab70988ca71bebec7bfeb3b6dbafe17b9ab0b4a
|
||||
F vsixtest/Assets/Square150x150Logo.scale-200.png e17b40817db7a239fc239d83efcc951fb824e3ff
|
||||
F vsixtest/Assets/Square44x44Logo.scale-200.png 2f166237094dea94d952d10b9eeae81806844f1c
|
||||
F vsixtest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png 5f6a6d391b95a3061ccca6e6fdd6955ede63b4ed
|
||||
F vsixtest/Assets/StoreLogo.png 0828b7257db74a4ecd5eeb6b7b4971f0fdc4d9d1
|
||||
F vsixtest/Assets/Wide310x150Logo.scale-200.png 04ddefe5bc5f43ae12a7433f6f236ddab101ac42
|
||||
F vsixtest/MainPage.xaml 34f49897e3ca533a7e74506ba0759b66eebce151
|
||||
F vsixtest/MainPage.xaml.cpp 7f31fc6de751b64676c0924c97a5485d950a91d7
|
||||
F vsixtest/MainPage.xaml.h cc05cca10d50a003f6c6e4448b701cdd07f52f29
|
||||
F vsixtest/Package.appxmanifest 6b6db1eb7df3a315c5d681059754d5f0e0c47a93
|
||||
F vsixtest/pch.cpp cb823cfac36f1a39a7eb0acbd7e9a0b0de8f23af
|
||||
F vsixtest/pch.h 9cab7980f2ac4baa40807d8b5e52af32a21cf78c
|
||||
F vsixtest/vsixtest.sln 77cadbe4e96c1fe1bf51cd77de9e9b0a12ada547
|
||||
F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080bb302912
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 58d91abf0c5a7712f27783640ef628681de18be5007020d6d8b362dd5a392eda
|
||||
R 03696d3fcf9d4a87c6a7add90a199e32
|
||||
U stephan
|
||||
Z 544a28ed9fdb6c5e441dfb7f96432068
|
||||
P 1ce8507f732a26508a9b336cb27756a0a8638e14395efdd59b5faef40526ede5
|
||||
R b9b93d2e2084015bc7fa1134ed3eba38
|
||||
T *branch * omit-async
|
||||
T *sym-omit-async *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z e51dfe59488ba774ddcef48ab38dfbd3
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
@@ -1 +1 @@
|
||||
cd82e4c0f5f8ff16468b909d84dd5545c0456f624db61a4d112467a7cafed2fc
|
||||
10b1b86821bfc21377e7ccceb31146ab01aa6eaf418b85a204abcab5b793958e
|
||||
|
||||
@@ -9,5 +9,5 @@ Name: SQLite
|
||||
Description: SQL database engine
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -lsqlite3
|
||||
Libs.private: @LIBS@
|
||||
Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_ICU@
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -1,134 +1,179 @@
|
||||
/* sqlite_cfg.h.in. Generated from configure.ac by autoheader. */
|
||||
/* sqlite_cfg.h.in - autosetup input template for sqlite_cfg.h. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
/*#undef HAVE_DLFCN_H*/
|
||||
@if HAVE_DLFCN_H
|
||||
#define HAVE_DLFCN_H @HAVE_DLFCN_H@
|
||||
@endif
|
||||
|
||||
/* Define to 1 if you have the `fdatasync' function. */
|
||||
#undef HAVE_FDATASYNC
|
||||
/*#undef HAVE_FDATASYNC*/
|
||||
#define HAVE_FDATASYNC @HAVE_FDATASYNC@
|
||||
|
||||
/* Define to 1 if you have the `gmtime_r' function. */
|
||||
#undef HAVE_GMTIME_R
|
||||
/*#undef HAVE_GMTIME_R*/
|
||||
#define HAVE_GMTIME_R @HAVE_GMTIME_R@
|
||||
|
||||
/* Define to 1 if the system has the type `int16_t'. */
|
||||
#undef HAVE_INT16_T
|
||||
/*#undef HAVE_INT16_T*/
|
||||
#define HAVE_INT16_T @HAVE_INT16_T@
|
||||
|
||||
/* Define to 1 if the system has the type `int32_t'. */
|
||||
#undef HAVE_INT32_T
|
||||
/*#undef HAVE_INT32_T*/
|
||||
#define HAVE_INT32_T @HAVE_INT32_T@
|
||||
|
||||
/* Define to 1 if the system has the type `int64_t'. */
|
||||
#undef HAVE_INT64_T
|
||||
/*#undef HAVE_INT64_T*/
|
||||
#define HAVE_INT64_T @HAVE_INT64_T@
|
||||
|
||||
/* Define to 1 if the system has the type `int8_t'. */
|
||||
#undef HAVE_INT8_T
|
||||
/*#undef HAVE_INT8_T*/
|
||||
#define HAVE_INT8_T @HAVE_INT8_T@
|
||||
|
||||
/* Define to 1 if the system has the type `intptr_t'. */
|
||||
#undef HAVE_INTPTR_T
|
||||
/*#undef HAVE_INTPTR_T*/
|
||||
#define HAVE_INTPTR_T @HAVE_INTPTR_T@
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
/*#undef HAVE_INTTYPES_H*/
|
||||
#define HAVE_INTTYPES_H @HAVE_INTTYPES_H@
|
||||
|
||||
/* Define to 1 if you have the `isnan' function. */
|
||||
#undef HAVE_ISNAN
|
||||
/*#undef HAVE_ISNAN*/
|
||||
#define HAVE_ISNAN @HAVE_ISNAN@
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
/*#undef HAVE_LOCALTIME_R*/
|
||||
#define HAVE_LOCALTIME_R @HAVE_LOCALTIME_R@
|
||||
|
||||
/* Define to 1 if you have the `localtime_s' function. */
|
||||
#undef HAVE_LOCALTIME_S
|
||||
/*#undef HAVE_LOCALTIME_S*/
|
||||
#define HAVE_LOCALTIME_S @HAVE_LOCALTIME_S@
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
/*#undef HAVE_MALLOC_H*/
|
||||
#define HAVE_MALLOC_H @HAVE_MALLOC_H@
|
||||
|
||||
/* Define to 1 if you have the `malloc_usable_size' function. */
|
||||
#undef HAVE_MALLOC_USABLE_SIZE
|
||||
/*#undef HAVE_MALLOC_USABLE_SIZE*/
|
||||
#define HAVE_MALLOC_USABLE_SIZE @HAVE_MALLOC_USABLE_SIZE@
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
/*#undef HAVE_MEMORY_H*/
|
||||
#define HAVE_MEMORY_H @HAVE_MEMORY_H@
|
||||
|
||||
/* Define to 1 if you have the `pread' function. */
|
||||
#undef HAVE_PREAD
|
||||
/*#undef HAVE_PREAD*/
|
||||
#define HAVE_PREAD @HAVE_PREAD@
|
||||
|
||||
/* Define to 1 if you have the `pread64' function. */
|
||||
#undef HAVE_PREAD64
|
||||
/*#undef HAVE_PREAD64*/
|
||||
#define HAVE_PREAD64 @HAVE_PREAD64@
|
||||
|
||||
/* Define to 1 if you have the `pwrite' function. */
|
||||
#undef HAVE_PWRITE
|
||||
/*#undef HAVE_PWRITE*/
|
||||
#define HAVE_PWRITE @HAVE_PWRITE@
|
||||
|
||||
/* Define to 1 if you have the `pwrite64' function. */
|
||||
#undef HAVE_PWRITE64
|
||||
/*#undef HAVE_PWRITE64*/
|
||||
#define HAVE_PWRITE64 @HAVE_PWRITE64@
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
/*#undef HAVE_STDINT_H*/
|
||||
#define HAVE_STDINT_H @HAVE_STDINT_H@
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
/*#undef HAVE_STDLIB_H*/
|
||||
#define HAVE_STDLIB_H @HAVE_STDLIB_H@
|
||||
|
||||
/* Define to 1 if you have the `strchrnul' function. */
|
||||
#undef HAVE_STRCHRNUL
|
||||
/*#undef HAVE_STRCHRNUL*/
|
||||
#define HAVE_STRCHRNUL @HAVE_STRCHRNUL@
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
/*#undef HAVE_STRINGS_H*/
|
||||
#define HAVE_STRINGS_H @HAVE_STRINGS_H@
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
/*#undef HAVE_STRING_H*/
|
||||
#define HAVE_STRING_H @HAVE_STRING_H@
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
/*#undef HAVE_SYS_STAT_H*/
|
||||
#define HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
/*#undef HAVE_SYS_TYPES_H*/
|
||||
#define HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
|
||||
|
||||
/* Define to 1 if the system has the type `uint16_t'. */
|
||||
#undef HAVE_UINT16_T
|
||||
/*#undef HAVE_UINT16_T*/
|
||||
#define HAVE_UINT16_T @HAVE_UINT16_T@
|
||||
|
||||
/* Define to 1 if the system has the type `uint32_t'. */
|
||||
#undef HAVE_UINT32_T
|
||||
/*#undef HAVE_UINT32_T*/
|
||||
#define HAVE_UINT32_T @HAVE_UINT32_T@
|
||||
|
||||
/* Define to 1 if the system has the type `uint64_t'. */
|
||||
#undef HAVE_UINT64_T
|
||||
/*#undef HAVE_UINT64_T*/
|
||||
#define HAVE_UINT64_T @HAVE_UINT64_T@
|
||||
|
||||
/* Define to 1 if the system has the type `uint8_t'. */
|
||||
#undef HAVE_UINT8_T
|
||||
/*#undef HAVE_UINT8_T*/
|
||||
#define HAVE_UINT8_T @HAVE_UINT8_T@
|
||||
|
||||
/* Define to 1 if the system has the type `uintptr_t'. */
|
||||
#undef HAVE_UINTPTR_T
|
||||
/*#undef HAVE_UINTPTR_T*/
|
||||
#define HAVE_UINTPTR_T @HAVE_UINTPTR_T@
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
/*#undef HAVE_UNISTD_H*/
|
||||
#define HAVE_UNISTD_H @HAVE_UNISTD_H@
|
||||
|
||||
/* Define to 1 if you have the `usleep' function. */
|
||||
#undef HAVE_USLEEP
|
||||
/*#undef HAVE_USLEEP*/
|
||||
#define HAVE_USLEEP @HAVE_USLEEP@
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#undef HAVE_UTIME
|
||||
/*#undef HAVE_UTIME*/
|
||||
#define HAVE_UTIME @HAVE_UTIME@
|
||||
|
||||
/* Define to 1 if you have the <zlib.h> header file. */
|
||||
#undef HAVE_ZLIB_H
|
||||
/*#undef HAVE_ZLIB_H*/
|
||||
#define HAVE_ZLIB_H @HAVE_ZLIB_H@
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
/*#undef LT_OBJDIR*/
|
||||
/*#define LT_OBJDIR @LT_OBJDIR@*/
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
/*#undef PACKAGE_BUGREPORT*/
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
/*#undef PACKAGE_NAME*/
|
||||
#define PACKAGE_NAME "sqlite"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
/*#undef PACKAGE_STRING*/
|
||||
#define PACKAGE_STRING "sqlite @RELEASE@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
/*#undef PACKAGE_TARNAME*/
|
||||
#define PACKAGE_TARNAME "sqlite"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
/*#undef PACKAGE_URL*/
|
||||
#define PACKAGE_URL @PACKAGE_URL@
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
/*#undef PACKAGE_VERSION*/
|
||||
#define PACKAGE_VERSION @VERSION@
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
/*#undef STDC_HEADERS*/
|
||||
#define STDC_HEADERS 1 /* @STDC_HEADERS@ */
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
@@ -136,7 +181,14 @@
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
/*#undef _FILE_OFFSET_BITS*/
|
||||
/*#define _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@*/
|
||||
/*@if _FILE_OFFSET_BITS != ""*/
|
||||
/*#define _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@*/
|
||||
/*@endif*/
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
/*#undef _LARGE_FILES*/
|
||||
/*@if _LARGE_FILES*/
|
||||
/*#define _LARGE_FILES @_LARGE_FILES@*/
|
||||
/*@endif*/
|
||||
|
||||
@@ -5759,7 +5759,8 @@ void close_db(sqlite3 *db){
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_READLINE || HAVE_EDITLINE
|
||||
#if (HAVE_READLINE || HAVE_EDITLINE) \
|
||||
&& !defined(SQLITE_OMIT_READLINE_COMPLETION)
|
||||
/*
|
||||
** Readline completion callbacks
|
||||
*/
|
||||
@@ -13259,7 +13260,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
}
|
||||
}
|
||||
if( zHistory ){ shell_read_history(zHistory); }
|
||||
#if HAVE_READLINE || HAVE_EDITLINE
|
||||
#if (HAVE_READLINE || HAVE_EDITLINE) && !defined(SQLITE_OMIT_READLINE_COMPLETION)
|
||||
rl_attempted_completion_function = readline_completion;
|
||||
#elif HAVE_LINENOISE
|
||||
linenoiseSetCompletionCallback(linenoise_completion, NULL);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#if TCL_MAJOR_VERSION==9
|
||||
# define CONST const
|
||||
#elif !defined(Tcl_Size)
|
||||
typedef int Tcl_Size;
|
||||
# define Tcl_Size int
|
||||
#endif
|
||||
|
||||
/****** Any edits to this file must mirrored in tclsqlite.c ***********/
|
||||
|
||||
@@ -5023,8 +5023,8 @@ static int SQLITE_TCLAPI test_prepare_v3(
|
||||
}
|
||||
pzTail = objc>=6 ? &zTail : 0;
|
||||
rc = sqlite3_prepare_v3(db, zCopy, bytes, (unsigned int)flags,&pStmt,pzTail);
|
||||
free(zCopy);
|
||||
zTail = &zSql[(zTail - zCopy)];
|
||||
free(zCopy);
|
||||
|
||||
assert(rc==SQLITE_OK || pStmt==0);
|
||||
Tcl_ResetResult(interp);
|
||||
@@ -8450,64 +8450,6 @@ static int SQLITE_TCLAPI test_user_delete(
|
||||
}
|
||||
#endif /* SQLITE_USER_AUTHENTICATION */
|
||||
|
||||
/*
|
||||
** tclcmd: bad_behavior TYPE
|
||||
**
|
||||
** Do some things that should trigger a valgrind or -fsanitize=undefined
|
||||
** warning. This is used to verify that errors and warnings output by those
|
||||
** tools are detected by the test scripts.
|
||||
**
|
||||
** TYPE BEHAVIOR
|
||||
** 1 Overflow a signed integer
|
||||
** 2 Jump based on an uninitialized variable
|
||||
** 3 Read after free
|
||||
** 4 Panic
|
||||
*/
|
||||
static int SQLITE_TCLAPI test_bad_behavior(
|
||||
ClientData clientData, /* Pointer to an integer containing zero */
|
||||
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *CONST objv[] /* Command arguments */
|
||||
){
|
||||
int iType;
|
||||
int xyz;
|
||||
int i = *(int*)clientData;
|
||||
int j;
|
||||
int w[10];
|
||||
int *a;
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "TYPE");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( Tcl_GetIntFromObj(interp, objv[1], &iType) ) return TCL_ERROR;
|
||||
switch( iType ){
|
||||
case 1: {
|
||||
xyz = 0x7fffff00 - i;
|
||||
xyz += 0x100;
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(xyz));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
w[1] = 5;
|
||||
if( w[i]>0 ) w[1]++;
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(w[1]));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
a = malloc( sizeof(int)*10 );
|
||||
for(j=0; j<10; j++) a[j] = j;
|
||||
free(a);
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(a[i]));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
Tcl_Panic("Deliberate panic");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** tclcmd: register_dbstat_vtab DB
|
||||
**
|
||||
@@ -9034,7 +8976,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
} aObjCmd[] = {
|
||||
{ "sqlite3_db_config", test_sqlite3_db_config, 0 },
|
||||
{ "sqlite3_txn_state", test_sqlite3_txn_state, 0 },
|
||||
{ "bad_behavior", test_bad_behavior, (void*)&iZero },
|
||||
{ "register_dbstat_vtab", test_register_dbstat_vtab },
|
||||
{ "sqlite3_connection_pointer", get_sqlite_pointer, 0 },
|
||||
{ "intarray_addr", test_intarray_addr, 0 },
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
/*
|
||||
** 2005 December 14
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
**
|
||||
** This file contains a binding of the asynchronous IO extension interface
|
||||
** (defined in ext/async/sqlite3async.h) to Tcl.
|
||||
*/
|
||||
|
||||
#define TCL_THREADS
|
||||
#include "tclsqlite.h"
|
||||
|
||||
#ifdef SQLITE_ENABLE_ASYNCIO
|
||||
|
||||
#include "sqlite3async.h"
|
||||
#include "sqlite3.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* From main.c */
|
||||
extern const char *sqlite3ErrName(int);
|
||||
|
||||
|
||||
struct TestAsyncGlobal {
|
||||
int isInstalled; /* True when async VFS is installed */
|
||||
} testasync_g = { 0 };
|
||||
|
||||
TCL_DECLARE_MUTEX(testasync_g_writerMutex);
|
||||
|
||||
/*
|
||||
** sqlite3async_initialize PARENT-VFS ISDEFAULT
|
||||
*/
|
||||
static int SQLITE_TCLAPI testAsyncInit(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
const char *zParent;
|
||||
int isDefault;
|
||||
int rc;
|
||||
|
||||
if( objc!=3 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "PARENT-VFS ISDEFAULT");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
zParent = Tcl_GetString(objv[1]);
|
||||
if( !*zParent ) {
|
||||
zParent = 0;
|
||||
}
|
||||
if( Tcl_GetBooleanFromObj(interp, objv[2], &isDefault) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
rc = sqlite3async_initialize(zParent, isDefault);
|
||||
if( rc!=SQLITE_OK ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** sqlite3async_shutdown
|
||||
*/
|
||||
static int SQLITE_TCLAPI testAsyncShutdown(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
sqlite3async_shutdown();
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
static Tcl_ThreadCreateType tclWriterThread(ClientData pIsStarted){
|
||||
Tcl_MutexLock(&testasync_g_writerMutex);
|
||||
*((int *)pIsStarted) = 1;
|
||||
sqlite3async_run();
|
||||
Tcl_MutexUnlock(&testasync_g_writerMutex);
|
||||
Tcl_ExitThread(0);
|
||||
TCL_THREAD_CREATE_RETURN;
|
||||
}
|
||||
|
||||
/*
|
||||
** sqlite3async_start
|
||||
**
|
||||
** Start a new writer thread.
|
||||
*/
|
||||
static int SQLITE_TCLAPI testAsyncStart(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
volatile int isStarted = 0;
|
||||
ClientData threadData = (ClientData)&isStarted;
|
||||
|
||||
Tcl_ThreadId x;
|
||||
const int nStack = TCL_THREAD_STACK_DEFAULT;
|
||||
const int flags = TCL_THREAD_NOFLAGS;
|
||||
int rc;
|
||||
|
||||
rc = Tcl_CreateThread(&x, tclWriterThread, threadData, nStack, flags);
|
||||
if( rc!=TCL_OK ){
|
||||
Tcl_AppendResult(interp, "Tcl_CreateThread() failed", 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
while( isStarted==0 ) { /* Busy loop */ }
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** sqlite3async_wait
|
||||
**
|
||||
** Wait for the current writer thread to terminate.
|
||||
**
|
||||
** If the current writer thread is set to run forever then this
|
||||
** command would block forever. To prevent that, an error is returned.
|
||||
*/
|
||||
static int SQLITE_TCLAPI testAsyncWait(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
int eCond;
|
||||
if( objc!=1 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
sqlite3async_control(SQLITEASYNC_GET_HALT, &eCond);
|
||||
if( eCond==SQLITEASYNC_HALT_NEVER ){
|
||||
Tcl_AppendResult(interp, "would block forever", (char*)0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Tcl_MutexLock(&testasync_g_writerMutex);
|
||||
Tcl_MutexUnlock(&testasync_g_writerMutex);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** sqlite3async_control OPTION ?VALUE?
|
||||
*/
|
||||
static int SQLITE_TCLAPI testAsyncControl(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
int aeOpt[] = { SQLITEASYNC_HALT, SQLITEASYNC_DELAY, SQLITEASYNC_LOCKFILES };
|
||||
const char *azOpt[] = { "halt", "delay", "lockfiles", 0 };
|
||||
const char *az[] = { "never", "now", "idle", 0 };
|
||||
int iVal;
|
||||
int eOpt;
|
||||
|
||||
if( objc!=2 && objc!=3 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "OPTION ?VALUE?");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( Tcl_GetIndexFromObj(interp, objv[1], azOpt, "option", 0, &eOpt) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
eOpt = aeOpt[eOpt];
|
||||
|
||||
if( objc==3 ){
|
||||
switch( eOpt ){
|
||||
case SQLITEASYNC_HALT: {
|
||||
assert( SQLITEASYNC_HALT_NEVER==0 );
|
||||
assert( SQLITEASYNC_HALT_NOW==1 );
|
||||
assert( SQLITEASYNC_HALT_IDLE==2 );
|
||||
if( Tcl_GetIndexFromObj(interp, objv[2], az, "value", 0, &iVal) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SQLITEASYNC_DELAY:
|
||||
if( Tcl_GetIntFromObj(interp, objv[2], &iVal) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case SQLITEASYNC_LOCKFILES:
|
||||
if( Tcl_GetBooleanFromObj(interp, objv[2], &iVal) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
rc = sqlite3async_control(eOpt, iVal);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3async_control(
|
||||
eOpt==SQLITEASYNC_HALT ? SQLITEASYNC_GET_HALT :
|
||||
eOpt==SQLITEASYNC_DELAY ? SQLITEASYNC_GET_DELAY :
|
||||
SQLITEASYNC_GET_LOCKFILES, &iVal);
|
||||
}
|
||||
|
||||
if( rc!=SQLITE_OK ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if( eOpt==SQLITEASYNC_HALT ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(az[iVal], -1));
|
||||
}else{
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(iVal));
|
||||
}
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
#endif /* SQLITE_ENABLE_ASYNCIO */
|
||||
|
||||
/*
|
||||
** This routine registers the custom TCL commands defined in this
|
||||
** module. This should be the only procedure visible from outside
|
||||
** of this module.
|
||||
*/
|
||||
int Sqlitetestasync_Init(Tcl_Interp *interp){
|
||||
#ifdef SQLITE_ENABLE_ASYNCIO
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_start",testAsyncStart,0,0);
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_wait",testAsyncWait,0,0);
|
||||
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_control",testAsyncControl,0,0);
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_initialize",testAsyncInit,0,0);
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_shutdown",testAsyncShutdown,0,0);
|
||||
#endif /* SQLITE_ENABLE_ASYNCIO */
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -59,7 +59,6 @@ const char *sqlite3TestInit(Tcl_Interp *interp){
|
||||
extern int Sqlitetest6_Init(Tcl_Interp*);
|
||||
extern int Sqlitetest8_Init(Tcl_Interp*);
|
||||
extern int Sqlitetest9_Init(Tcl_Interp*);
|
||||
extern int Sqlitetestasync_Init(Tcl_Interp*);
|
||||
extern int Sqlitetest_autoext_Init(Tcl_Interp*);
|
||||
extern int Sqlitetest_blob_Init(Tcl_Interp*);
|
||||
extern int Sqlitetest_demovfs_Init(Tcl_Interp *);
|
||||
@@ -131,7 +130,6 @@ const char *sqlite3TestInit(Tcl_Interp *interp){
|
||||
Sqlitetest6_Init(interp);
|
||||
Sqlitetest8_Init(interp);
|
||||
Sqlitetest9_Init(interp);
|
||||
Sqlitetestasync_Init(interp);
|
||||
Sqlitetest_autoext_Init(interp);
|
||||
Sqlitetest_blob_Init(interp);
|
||||
Sqlitetest_demovfs_Init(interp);
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file runs all tests.
|
||||
#
|
||||
# $Id: async.test,v 1.21 2009/06/05 17:09:12 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
if {[info commands sqlite3async_initialize] eq ""} {
|
||||
# The async logic is not built into this system
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
rename finish_test async_really_finish_test
|
||||
proc finish_test {} {
|
||||
catch {db close}
|
||||
catch {db2 close}
|
||||
catch {db3 close}
|
||||
}
|
||||
if {[info exists G(isquick)]} { set ASYNC_SAVE_ISQUICK $G(isquick) }
|
||||
set G(isquick) 1
|
||||
|
||||
set ASYNC_INCLUDE {
|
||||
insert.test
|
||||
insert2.test
|
||||
insert3.test
|
||||
lock.test
|
||||
lock2.test
|
||||
lock3.test
|
||||
select1.test
|
||||
select2.test
|
||||
select3.test
|
||||
select4.test
|
||||
trans.test
|
||||
}
|
||||
|
||||
# Enable asynchronous IO.
|
||||
sqlite3async_initialize "" 1
|
||||
|
||||
# This proc flushes the contents of the async-IO queue through to the
|
||||
# underlying VFS. A couple of the test scripts identified in $ASYNC_INCLUDE
|
||||
# above contain lines like "catch flush_async_queue" in places where
|
||||
# this is required for the tests to work in async mode.
|
||||
#
|
||||
proc flush_async_queue {} {
|
||||
sqlite3async_control halt idle
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
sqlite3async_control halt never
|
||||
}
|
||||
|
||||
rename do_test async_really_do_test
|
||||
proc do_test {name args} {
|
||||
uplevel async_really_do_test async_io-$name $args
|
||||
flush_async_queue
|
||||
}
|
||||
|
||||
foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
|
||||
set tail [file tail $testfile]
|
||||
if {[lsearch -exact $ASYNC_INCLUDE $tail]<0} continue
|
||||
source $testfile
|
||||
|
||||
# Make sure everything is flushed through. This is because [source]ing
|
||||
# the next test file will delete the database file on disk (using
|
||||
# [delete_file]). If the asynchronous backend still has the file
|
||||
# open, it will become confused.
|
||||
#
|
||||
flush_async_queue
|
||||
}
|
||||
|
||||
# Flush the write-queue and disable asynchronous IO. This should ensure
|
||||
# all allocated memory is cleaned up.
|
||||
set sqlite3async_trace 1
|
||||
flush_async_queue
|
||||
sqlite3async_shutdown
|
||||
set sqlite3async_trace 0
|
||||
|
||||
rename do_test {}
|
||||
rename async_really_do_test do_test
|
||||
rename finish_test {}
|
||||
rename async_really_finish_test finish_test
|
||||
|
||||
if {[info exists ASYNC_SAVE_ISQUICK]} { set G(isquick) $ASYNC_SAVE_ISQUICK }
|
||||
finish_test
|
||||
@@ -1,126 +0,0 @@
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# $Id: async2.test,v 1.12 2009/04/25 08:39:15 danielk1977 Exp $
|
||||
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
if {
|
||||
[info commands sqlite3async_initialize]=="" ||
|
||||
[info command sqlite3_memdebug_fail]==""
|
||||
} {
|
||||
# The async logic is not built into this system
|
||||
puts "Skipping async2 tests: not compiled with required features"
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
# Enable asynchronous IO.
|
||||
|
||||
set setup_script {
|
||||
CREATE TABLE counter(c);
|
||||
INSERT INTO counter(c) VALUES (1);
|
||||
}
|
||||
|
||||
set sql_script {
|
||||
BEGIN;
|
||||
UPDATE counter SET c = 2;
|
||||
CREATE TABLE t1(a PRIMARY KEY, b, c);
|
||||
CREATE TABLE t2(a PRIMARY KEY, b, c);
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
UPDATE counter SET c = 3;
|
||||
INSERT INTO t1 VALUES('abcdefghij', 'four', 'score');
|
||||
INSERT INTO t2 VALUES('klmnopqrst', 'and', 'seven');
|
||||
COMMIT;
|
||||
|
||||
UPDATE counter SET c = 'FIN';
|
||||
}
|
||||
|
||||
db close
|
||||
|
||||
foreach err [list ioerr malloc-transient malloc-persistent] {
|
||||
set ::go 10
|
||||
for {set n 1} {$::go} {incr n} {
|
||||
set ::sqlite_io_error_pending 0
|
||||
sqlite3_memdebug_fail -1
|
||||
forcedelete test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
execsql $::setup_script
|
||||
db close
|
||||
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3 db test.db
|
||||
sqlite3_db_config_lookaside db 0 0 0
|
||||
|
||||
switch -- $err {
|
||||
ioerr { set ::sqlite_io_error_pending $n }
|
||||
malloc-persistent { sqlite3_memdebug_fail $n -repeat 1 }
|
||||
malloc-transient { sqlite3_memdebug_fail $n -repeat 0 }
|
||||
}
|
||||
|
||||
catchsql $::sql_script
|
||||
db close
|
||||
|
||||
sqlite3async_control halt idle
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
sqlite3async_control halt never
|
||||
sqlite3async_shutdown
|
||||
|
||||
set ::sqlite_io_error_pending 0
|
||||
sqlite3_memdebug_fail -1
|
||||
|
||||
sqlite3 db test.db
|
||||
set c [db one {SELECT c FROM counter LIMIT 1}]
|
||||
switch -- $c {
|
||||
1 {
|
||||
do_test async-$err-1.1.$n {
|
||||
execsql {
|
||||
SELECT name FROM sqlite_master;
|
||||
}
|
||||
} {counter}
|
||||
}
|
||||
2 {
|
||||
do_test async-$err-1.2.$n.1 {
|
||||
execsql {
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {}
|
||||
do_test async-$err-1.2.$n.2 {
|
||||
execsql {
|
||||
SELECT * FROM t2;
|
||||
}
|
||||
} {}
|
||||
}
|
||||
3 {
|
||||
do_test async-$err-1.3.$n.1 {
|
||||
execsql {
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {abcdefghij four score}
|
||||
do_test async-$err-1.3.$n.2 {
|
||||
execsql {
|
||||
SELECT * FROM t2;
|
||||
}
|
||||
} {klmnopqrst and seven}
|
||||
}
|
||||
FIN {
|
||||
incr ::go -1
|
||||
}
|
||||
}
|
||||
|
||||
db close
|
||||
}
|
||||
}
|
||||
|
||||
catch {db close}
|
||||
|
||||
finish_test
|
||||
@@ -1,76 +0,0 @@
|
||||
# 2007 September 5
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# The focus of this file is testing the code in test_async.c.
|
||||
# Specifically, it tests that the xFullPathname() method of
|
||||
# of the asynchronous vfs works correctly.
|
||||
#
|
||||
# $Id: async3.test,v 1.5 2009/04/25 08:39:15 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
if { [info commands sqlite3async_initialize]=="" } {
|
||||
# The async logic is not built into this system
|
||||
puts "Skipping async3 tests: not compiled with required features"
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
db close
|
||||
sqlite3async_initialize "" 1
|
||||
#set sqlite3async_trace 1
|
||||
sqlite3async_start
|
||||
|
||||
set paths {
|
||||
chocolate/banana/vanilla/file.db
|
||||
chocolate//banana/vanilla/file.db
|
||||
chocolate/./banana//vanilla/file.db
|
||||
chocolate/banana/./vanilla/file.db
|
||||
chocolate/banana/../banana/vanilla/file.db
|
||||
chocolate/banana/./vanilla/extra_bit/../file.db
|
||||
}
|
||||
|
||||
do_test async3-1.0 {
|
||||
file mkdir [file join chocolate banana vanilla]
|
||||
forcedelete chocolate/banana/vanilla/file.db
|
||||
forcedelete chocolate/banana/vanilla/file.db-journal
|
||||
} {}
|
||||
|
||||
do_test async3-1.1 {
|
||||
sqlite3 db chocolate/banana/vanilla/file.db
|
||||
execsql {
|
||||
CREATE TABLE abc(a, b, c);
|
||||
BEGIN;
|
||||
INSERT INTO abc VALUES(1, 2, 3);
|
||||
}
|
||||
} {}
|
||||
|
||||
set N 2
|
||||
foreach p $paths {
|
||||
sqlite3 db2 $p
|
||||
do_test async3-1.$N.1 {
|
||||
execsql {SELECT * FROM abc} db2
|
||||
} {}
|
||||
do_test async3-1.$N.2 {
|
||||
catchsql {INSERT INTO abc VALUES(4, 5, 6)} db2
|
||||
} {1 {database is locked}}
|
||||
db2 close
|
||||
incr N
|
||||
}
|
||||
|
||||
db close
|
||||
|
||||
sqlite3async_control halt idle
|
||||
sqlite3async_wait
|
||||
sqlite3async_control halt never
|
||||
sqlite3async_shutdown
|
||||
finish_test
|
||||
@@ -1,168 +0,0 @@
|
||||
# 2009 April 25
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# $Id: async4.test,v 1.4 2009/06/05 17:09:12 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
# Do not use a codec for tests in this file, as the database file is
|
||||
# manipulated directly using tcl scripts (using the [hexio_write] command).
|
||||
#
|
||||
do_not_use_codec
|
||||
|
||||
# These tests only work for Tcl version 8.5 and later on Windows (for now)
|
||||
#
|
||||
if {$tcl_platform(platform)=="windows"} {
|
||||
scan $::tcl_version %f vx
|
||||
if {$vx<8.5} {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if {[info commands sqlite3async_initialize] eq ""} {
|
||||
# The async logic is not built into this system
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
db close
|
||||
|
||||
# Test layout:
|
||||
#
|
||||
# async4.1.*: Test the lockfiles parameter.
|
||||
# async4.2.*: Test the delay parameter.
|
||||
|
||||
do_test async4.1.1 {
|
||||
sqlite3async_initialize {} 0
|
||||
sqlite3async_control lockfiles
|
||||
} {1}
|
||||
do_test async4.1.2 {
|
||||
sqlite3async_control lockfiles false
|
||||
} {0}
|
||||
do_test async4.1.3 {
|
||||
sqlite3async_control lockfiles
|
||||
} {0}
|
||||
do_test async4.1.4 {
|
||||
sqlite3async_control lockfiles true
|
||||
} {1}
|
||||
|
||||
do_test async4.1.5 {
|
||||
sqlite3 db test.db -vfs sqlite3async
|
||||
execsql { CREATE TABLE t1(a, b, c) }
|
||||
} {}
|
||||
do_test async4.1.6 {
|
||||
list [file exists test.db] [file size test.db]
|
||||
} {1 0}
|
||||
do_test async4.1.7 {
|
||||
sqlite3 db2 test.db
|
||||
catchsql { CREATE TABLE t2(a, b, c) } db2
|
||||
} {1 {database is locked}}
|
||||
do_test async4.1.8 {
|
||||
sqlite3async_control halt idle
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
} {}
|
||||
do_test async4.1.9 {
|
||||
catchsql { CREATE TABLE t2(a, b, c) } db2
|
||||
} {0 {}}
|
||||
do_test async4.1.10 {
|
||||
list [catch {sqlite3async_control lockfiles false} msg] $msg
|
||||
} {1 SQLITE_MISUSE}
|
||||
do_test async4.1.11 {
|
||||
db close
|
||||
list [catch {sqlite3async_control lockfiles false} msg] $msg
|
||||
} {1 SQLITE_MISUSE}
|
||||
do_test async4.1.12 {
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
sqlite3async_control lockfiles false
|
||||
} {0}
|
||||
do_test async4.1.13 {
|
||||
sqlite3 db test.db -vfs sqlite3async
|
||||
execsql { CREATE TABLE t3(a, b, c) } db
|
||||
} {}
|
||||
do_test async4.1.14 {
|
||||
execsql {
|
||||
CREATE INDEX i1 ON t2(a);
|
||||
CREATE INDEX i2 ON t1(a);
|
||||
} db2
|
||||
} {}
|
||||
do_test async4.1.15 {
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
hexio_write test.db 28 00000000
|
||||
execsql { pragma integrity_check } db2
|
||||
} {{*** in database main ***
|
||||
Page 5 is never used}}
|
||||
do_test async4.1.16 {
|
||||
db close
|
||||
db2 close
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
} {}
|
||||
do_test async4.1.17 {
|
||||
sqlite3async_control lockfiles true
|
||||
} {1}
|
||||
|
||||
do_test async4.2.1 {
|
||||
sqlite3async_control delay
|
||||
} {0}
|
||||
do_test async4.2.2 {
|
||||
sqlite3async_control delay 23
|
||||
} {23}
|
||||
do_test async4.2.3 {
|
||||
sqlite3async_control delay
|
||||
} {23}
|
||||
do_test async4.2.4 {
|
||||
sqlite3async_control delay 0
|
||||
} {0}
|
||||
do_test async4.2.5 {
|
||||
sqlite3 db test.db -vfs sqlite3async
|
||||
|
||||
execsql { CREATE TABLE t4(a, b) }
|
||||
set T1 [lindex [time {
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
}] 0]
|
||||
|
||||
sqlite3async_control delay 100
|
||||
execsql { CREATE TABLE t5(a, b) }
|
||||
set T2 [lindex [time {
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
}] 0]
|
||||
|
||||
expr {($T1+1000000) < $T2}
|
||||
} {1}
|
||||
|
||||
do_test async4.2.6 {
|
||||
sqlite3async_control delay 0
|
||||
execsql { CREATE TABLE t6(a, b) }
|
||||
set T1 [lindex [time {
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
}] 0]
|
||||
|
||||
expr {($T1+1000000) < $T2}
|
||||
} {1}
|
||||
|
||||
do_test async4.2.7 {
|
||||
list [catch { sqlite3async_control delay -1 } msg] $msg
|
||||
} {1 SQLITE_MISUSE}
|
||||
|
||||
do_test async4.2.8 {
|
||||
db close
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
@@ -1,68 +0,0 @@
|
||||
# 2009 July 19
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file tests that asynchronous IO is compatible with multi-file
|
||||
# transactions.
|
||||
#
|
||||
# $Id: async5.test,v 1.1 2009/07/18 11:52:04 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
if {[info commands sqlite3async_initialize] eq ""} {
|
||||
# The async logic is not built into this system
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
db close
|
||||
forcedelete test2.db
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3async_control halt never
|
||||
sqlite3 db test.db
|
||||
|
||||
do_test async5-1.1 {
|
||||
execsql {
|
||||
ATTACH 'test2.db' AS next;
|
||||
CREATE TABLE main.t1(a, b);
|
||||
CREATE TABLE next.t2(a, b);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
INSERT INTO t2 VALUES(3, 4);
|
||||
COMMIT;
|
||||
}
|
||||
} {}
|
||||
do_test async5-1.2 {
|
||||
execsql { SELECT * FROM t1 }
|
||||
} {1 2}
|
||||
do_test async5-1.3 {
|
||||
execsql { SELECT * FROM t2 }
|
||||
} {3 4}
|
||||
do_test async5-1.4 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES('a', 'b');
|
||||
INSERT INTO t2 VALUES('c', 'd');
|
||||
COMMIT;
|
||||
}
|
||||
} {}
|
||||
do_test async5-1.5 {
|
||||
execsql { SELECT * FROM t1 }
|
||||
} {1 2 a b}
|
||||
do_test async5-1.6 {
|
||||
execsql { SELECT * FROM t2 }
|
||||
} {3 4 c d}
|
||||
|
||||
db close
|
||||
|
||||
sqlite3async_control halt idle
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
sqlite3async_control halt never
|
||||
sqlite3async_shutdown
|
||||
set sqlite3async_trace 0
|
||||
finish_test
|
||||
@@ -21,7 +21,7 @@ source $testdir/tester.tcl
|
||||
#
|
||||
do_test lock-1.0 {
|
||||
# Give a complex pathname to stress the path simplification logic in
|
||||
# the vxworks driver and in test_async.
|
||||
# the vxworks driver.
|
||||
file mkdir tempdir/t1/t2
|
||||
sqlite3 db2 ./tempdir/../tempdir/t1/.//t2/../../..//test.db
|
||||
set dummy {}
|
||||
|
||||
@@ -472,67 +472,10 @@ do_test main-3.6 {
|
||||
catchsql {SELECT 'abc' + #9}
|
||||
} {1 {near "#9": syntax error}}
|
||||
|
||||
# The following test-case tests the linked list code used to manage
|
||||
# sqlite3_vfs structures.
|
||||
if {$::tcl_platform(platform)=="unix"
|
||||
&& [info command sqlite3async_initialize]!=""} {
|
||||
ifcapable threadsafe {
|
||||
do_test main-4.1 {
|
||||
sqlite3_crash_enable 1
|
||||
sqlite3_crash_enable 0
|
||||
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3async_shutdown
|
||||
|
||||
sqlite3_crash_enable 1
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3_crash_enable 0
|
||||
sqlite3async_shutdown
|
||||
|
||||
sqlite3_crash_enable 1
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3async_shutdown
|
||||
sqlite3_crash_enable 0
|
||||
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3_crash_enable 1
|
||||
sqlite3_crash_enable 0
|
||||
sqlite3async_shutdown
|
||||
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3_crash_enable 1
|
||||
sqlite3async_shutdown
|
||||
sqlite3_crash_enable 0
|
||||
} {}
|
||||
do_test main-4.2 {
|
||||
set rc [catch {sqlite3 db test.db -vfs crash} msg]
|
||||
list $rc $msg
|
||||
} {1 {no such vfs: crash}}
|
||||
do_test main-4.3 {
|
||||
set rc [catch {sqlite3 db test.db -vfs async} msg]
|
||||
list $rc $msg
|
||||
} {1 {no such vfs: async}}
|
||||
}
|
||||
}
|
||||
|
||||
# Print the version number so that it can be picked up by releasetest.tcl.
|
||||
#
|
||||
puts [db one {SELECT 'VERSION: ' ||
|
||||
sqlite_version() || ' ' ||
|
||||
sqlite_source_id();}]
|
||||
|
||||
# Do deliberate failures if the TEST_FAILURE environment variable is set.
|
||||
# This is done to verify that failure notifications are detected by the
|
||||
# releasetest.tcl script, or possibly by other scripts involved in automatic
|
||||
# testing.
|
||||
#
|
||||
if {[info exists ::env(TEST_FAILURE)]} {
|
||||
set res 123
|
||||
if {$::env(TEST_FAILURE)==0} {set res 234}
|
||||
do_test main-99.1 {
|
||||
bad_behavior $::env(TEST_FAILURE)
|
||||
set x 123
|
||||
} $res
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -38,8 +38,6 @@ set EXCLUDE {
|
||||
misuse.test
|
||||
memleak.test
|
||||
btree2.test
|
||||
async.test
|
||||
async2.test
|
||||
trans.test
|
||||
crash.test
|
||||
autovacuum_crash.test
|
||||
|
||||
@@ -108,14 +108,14 @@ if {$::tcl_platform(platform)!="unix"} {
|
||||
set alltests [test_set $alltests -exclude crash.test crash2.test]
|
||||
}
|
||||
set alltests [test_set $alltests -exclude {
|
||||
all.test async.test quick.test veryquick.test
|
||||
all.test quick.test veryquick.test
|
||||
memleak.test permutations.test soak.test fts3.test
|
||||
mallocAll.test rtree.test full.test extraquick.test
|
||||
session.test rbu.test
|
||||
}]
|
||||
|
||||
set allquicktests [test_set $alltests -exclude {
|
||||
async2.test async3.test backup_ioerr.test corrupt.test
|
||||
backup_ioerr.test corrupt.test
|
||||
corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test
|
||||
crash6.test crash7.test delete3.test e_fts3.test fts3rnd.test
|
||||
fkey_malloc.test fuzz.test fuzz3.test fuzz_malloc.test in2.test loadext.test
|
||||
@@ -790,7 +790,7 @@ test_suite "inmemory_journal" -description {
|
||||
journal3.test 8_3_names.test shmlock.test
|
||||
pendingrace.test
|
||||
|
||||
pager1.test async4.test corrupt.test filefmt.test pager2.test
|
||||
pager1.test corrupt.test filefmt.test pager2.test
|
||||
corrupt5.test corruptA.test pageropt.test
|
||||
|
||||
# Exclude stmt.test, which expects sub-journals to use temporary files.
|
||||
@@ -951,12 +951,11 @@ test_suite "safe_append" -description {
|
||||
set ::G(perm:sqlite3_args) [list -vfs devsym]
|
||||
sqlite3_simulate_device -char safe_append
|
||||
} -files [
|
||||
test_set $::allquicktests shared_err.test -exclude async3.test
|
||||
test_set $::allquicktests shared_err.test
|
||||
]
|
||||
|
||||
# The set of tests to run on the alternative-pcache
|
||||
set perm-alt-pcache-testset {
|
||||
async.test
|
||||
attach.test
|
||||
delete.test delete2.test
|
||||
index.test
|
||||
@@ -997,7 +996,7 @@ test_suite "journaltest" -description {
|
||||
unregister_jt_vfs
|
||||
} -files [test_set $::allquicktests -exclude {
|
||||
wal* incrvacuum.test ioerr.test corrupt4.test io.test crash8.test
|
||||
async4.test bigfile.test backcompat.test e_wal* fstat.test mmap2.test
|
||||
bigfile.test backcompat.test e_wal* fstat.test mmap2.test
|
||||
pager1.test syscall.test tkt3457.test *malloc* mmap* multiplex* nolock*
|
||||
pager2.test *fault* rowal* snapshot* superlock* symlink.test
|
||||
delete_db.test shmlock.test chunksize.test
|
||||
|
||||
@@ -663,7 +663,9 @@ if {[llength $argv]>=1
|
||||
set SQL {SELECT displaytype, displayname, state FROM jobs}
|
||||
if {$pattern!=""} {
|
||||
regsub -all {[^a-zA-Z0-9*.-/]} $pattern ? pattern
|
||||
append SQL " WHERE displayname GLOB '*$pattern*'"
|
||||
set pattern [string tolower $pattern]
|
||||
append SQL \
|
||||
" WHERE lower(concat(state,' ',displaytype,' ',displayname)) GLOB '*$pattern*'"
|
||||
}
|
||||
append SQL " ORDER BY starttime"
|
||||
|
||||
|
||||
@@ -72,11 +72,11 @@ namespace eval trd {
|
||||
# The following mirrors the set of test suites invoked by "all.test".
|
||||
#
|
||||
set all_configs {
|
||||
full no_optimization memsubsys1 memsubsys2 singlethread
|
||||
multithread onefile utf16 exclusive persistent_journal
|
||||
full no_optimization memsubsys1 memsubsys2 singlethread
|
||||
multithread onefile utf16 exclusive persistent_journal
|
||||
persistent_journal_error no_journal no_journal_error
|
||||
autovacuum_ioerr no_mutex_try fullmutex journaltest
|
||||
inmemory_journal pcache0 pcache10 pcache50 pcache90
|
||||
autovacuum_ioerr no_mutex_try fullmutex journaltest
|
||||
inmemory_journal pcache0 pcache10 pcache50 pcache90
|
||||
pcache100 prepare mmap
|
||||
}
|
||||
|
||||
@@ -91,17 +91,17 @@ namespace eval trd {
|
||||
-DSQLITE_ENABLE_STMT_SCANSTATUS
|
||||
}
|
||||
|
||||
# These two are used by [testrunner.tcl mdevtest] (All-O0) and
|
||||
# These two are used by [testrunner.tcl mdevtest] (All-O0) and
|
||||
# [testrunner.tcl sdevtest] (All-Sanitize).
|
||||
#
|
||||
set build(All-Debug) {
|
||||
--enable-debug --enable-all
|
||||
--with-debug --enable-all
|
||||
-DSQLITE_ENABLE_ORDERED_SET_AGGREGATES
|
||||
}
|
||||
set build(All-O0) {
|
||||
-O0 --enable-all
|
||||
}
|
||||
set build(All-Sanitize) {
|
||||
set build(All-Sanitize) {
|
||||
-DSQLITE_OMIT_LOOKASIDE=1
|
||||
--enable-all -fsanitize=address,undefined -fno-sanitize-recover=undefined
|
||||
}
|
||||
@@ -112,10 +112,11 @@ namespace eval trd {
|
||||
-DSQLITE_OMIT_LOOKASIDE=1
|
||||
-DCONFIG_SLOWDOWN_FACTOR=5.0
|
||||
-DSQLITE_ENABLE_RBU
|
||||
--enable-debug
|
||||
--with-debug
|
||||
--enable-all
|
||||
}
|
||||
set build(Stdcall) {
|
||||
-DWITHOUT_JIMSH=1
|
||||
-DUSE_STDCALL=1
|
||||
-DSQLITE_USE_ONLY_WIN32=1
|
||||
-O2
|
||||
@@ -192,7 +193,7 @@ namespace eval trd {
|
||||
set build(Debug-Two) {
|
||||
-DSQLITE_DEFAULT_MEMSTATUS=0
|
||||
-DSQLITE_MAX_EXPR_DEPTH=0
|
||||
--enable-debug
|
||||
--with-debug
|
||||
}
|
||||
set build(Fast-One) {
|
||||
-O6
|
||||
@@ -563,7 +564,7 @@ proc make_script {cfg srcdir bMsvc} {
|
||||
}
|
||||
--enable-fts5 {
|
||||
lappend opts -DSQLITE_ENABLE_FTS5
|
||||
}
|
||||
}
|
||||
--enable-shared {
|
||||
lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1
|
||||
}
|
||||
@@ -573,7 +574,7 @@ proc make_script {cfg srcdir bMsvc} {
|
||||
}
|
||||
--enable-all {
|
||||
}
|
||||
--enable-debug {
|
||||
--with-debug {
|
||||
# lappend makeOpts OPTIMIZATIONS=0
|
||||
lappend opts -DSQLITE_DEBUG
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
# 2009 October 19
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
if {[info commands sqlite3async_initialize] eq ""} {
|
||||
# The async logic is not built into this system
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
# Create a database.
|
||||
do_test tkt-94c94-1.1 {
|
||||
execsql { CREATE TABLE t1(a, b) }
|
||||
} {}
|
||||
|
||||
# Grow the file to larger than 4096MB (2^32 bytes)
|
||||
db close
|
||||
if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} {
|
||||
puts "**** Unable to create a file larger than 4096 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
# Switch to async mode.
|
||||
sqlite3async_initialize "" 1
|
||||
sqlite3 db test.db
|
||||
sqlite3 db2 test.db
|
||||
|
||||
# Read from and write to the db just past the 4096MB mark.
|
||||
#
|
||||
do_test tkt-94c94-2.1 {
|
||||
execsql { CREATE TABLE t2(x, y) } db
|
||||
} {}
|
||||
do_test tkt-94c94-2.2 {
|
||||
execsql { INSERT INTO t2 VALUES(1, 2) } db2
|
||||
} {}
|
||||
do_test tkt-94c94-2.3 {
|
||||
execsql { SELECT * FROM t2 } db
|
||||
} {1 2}
|
||||
do_test tkt-94c94-2.4 {
|
||||
sqlite3async_control halt idle
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
} {}
|
||||
do_test tkt-94c94-2.5 {
|
||||
execsql { SELECT * FROM t2 } db
|
||||
} {1 2}
|
||||
do_test tkt-94c94-2.6 {
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
} {}
|
||||
|
||||
db close
|
||||
db2 close
|
||||
sqlite3async_start
|
||||
sqlite3async_wait
|
||||
sqlite3async_control halt never
|
||||
sqlite3async_shutdown
|
||||
|
||||
finish_test
|
||||
@@ -0,0 +1,28 @@
|
||||
#/usr/bin/tclsh
|
||||
#
|
||||
# This is a TCL script that copies multiple files into a common directory.
|
||||
# The "cp" command will do this on unix, but no such command is available
|
||||
# by default on Windows, so we have to use this script.
|
||||
#
|
||||
# tclsh cp.tcl FILE1 FILE2 ... FILEN DIR
|
||||
#
|
||||
|
||||
# This should be as simple as
|
||||
#
|
||||
# file copy -force -- {*}$argv
|
||||
#
|
||||
# But jimtcl doesn't support that. So we have to do it the hard way.
|
||||
|
||||
if {[llength $argv]<2} {
|
||||
error "Usage: $argv0 SRC... DESTDIR"
|
||||
}
|
||||
set n [llength $argv]
|
||||
set destdir [lindex $argv [expr {$n-1}]]
|
||||
if {![file isdir $destdir]} {
|
||||
error "$argv0: not a directory: \"$destdir\""
|
||||
}
|
||||
for {set i 0} {$i<$n-1} {incr i} {
|
||||
set fn [file normalize [lindex $argv $i]]
|
||||
set tail [file tail $fn]
|
||||
file copy -force $fn [file normalize $destdir/$tail]
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
# ^^^^^^^ Please try to keep this script Bourne-compatible.
|
||||
########################################################################
|
||||
# WARNING: emcc.sh is generated from emcc.sh.in by the configure
|
||||
# process. Do not edit emcc.sh directly, as it may be deleted or
|
||||
# overwritten by the configure script.
|
||||
#
|
||||
# A wrapper around the emcc compiler which uses configure-time state
|
||||
# to locate the Emscripten SDK and import the SDK's environment
|
||||
# script, if needed.
|
||||
########################################################################
|
||||
# EMSDK_HOME comes from the configure --with-emsdk=/dir flag.
|
||||
# EMSDK_ENV is ${thatDir}/emsdk_env.sh and is also set by the
|
||||
# configure process.
|
||||
EMSDK_HOME="@EMSDK_HOME@"
|
||||
EMSDK_ENV="@EMSDK_ENV@"
|
||||
emcc="@BIN_EMCC@"
|
||||
|
||||
if [ x = "x${emcc}" ]; then
|
||||
emcc=`which emcc 2>/dev/null`
|
||||
fi
|
||||
|
||||
if [ x = "x${emcc}" ]; then
|
||||
# If emcc is not found in the path, try to find it via an emsdk
|
||||
# installation. The SDK variant is the official installation
|
||||
# style supported by the Emscripten folks, but emcc is also
|
||||
# available via package managers on some OSes.
|
||||
if [ x = "x${EMSDK_HOME}" ]; then
|
||||
echo "EMSDK_HOME is not set. Pass --with-emsdk=/path/to/emsdk" \
|
||||
"to the configure script." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x = "x${EMSDK_ENV}" ]; then
|
||||
if [ -f "${EMSDK_HOME}/emsdk_env.sh" ]; then
|
||||
EMSDK_ENV="${EMSDK_HOME}/emsdk_env.sh"
|
||||
else
|
||||
echo "EMSDK_ENV is not set. Expecting configure script to set it." 1>&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "${EMSDK_ENV}" ]; then
|
||||
echo "emsdk_env script not found: $EMSDK_ENV" 1>&2
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# $EMSDK is part of the state set by emsdk_env.sh.
|
||||
if [ x = "x${EMSDK}" ]; then
|
||||
source "${EMSDK_ENV}" >/dev/null 2>&1 || {
|
||||
# ^^^ unfortunately outputs lots of noise to stderr
|
||||
rc=$?
|
||||
echo "Error sourcing ${EMSDK_ENV}"
|
||||
exit $rc
|
||||
}
|
||||
fi
|
||||
emcc=`which emcc 2>/dev/null`
|
||||
if [ x = "x${emcc}" ]; then
|
||||
echo "emcc not found in PATH. Normally that's set up by ${EMSDK_ENV}." 1>&2
|
||||
exit 4
|
||||
fi
|
||||
fi
|
||||
|
||||
exec emcc "$@"
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Usage example:
|
||||
#
|
||||
# tclsh mktclsqliteprog.tcl demoapp.c.in >demoapp.c
|
||||
# tclsh mkccode.tcl demoapp.c.in >demoapp.c
|
||||
#
|
||||
# The demoapp.c.in file contains a mixture of C code, TCL script, and
|
||||
# processing directives used by mktclsqliteprog.tcl to build the final C-code
|
||||
@@ -56,8 +56,15 @@ while {1} {
|
||||
set line [gets $in]
|
||||
if {[eof $in]} break
|
||||
if {[regexp {^INCLUDE (.*)} $line all path]} {
|
||||
regsub {^\$ROOT\y} $path $ROOT path
|
||||
regsub {^\$HOME\y} $path $HOME path
|
||||
if {0} {
|
||||
# https://github.com/msteveb/jimtcl/issues/320
|
||||
regsub {^\$ROOT\y} $path $ROOT path
|
||||
regsub {^\$HOME\y} $path $HOME path
|
||||
} else {
|
||||
set path [string map "\$ROOT $ROOT" $path]
|
||||
set path [string map "\$HOME $HOME" $path]
|
||||
# or: set path [string map "\$HOME $HOME \$ROOT $ROOT" $path]
|
||||
}
|
||||
set in2 [open $path rb]
|
||||
puts "/* INCLUDE $path */"
|
||||
if {$instr} {
|
||||
|
||||
@@ -34,7 +34,8 @@ set in [open $topdir/src/shell.c.in]
|
||||
fconfigure $in -translation binary
|
||||
proc omit_redundant_typedefs {line} {
|
||||
global typedef_seen
|
||||
if {[regexp {^typedef .*\y([a-zA-Z0-9_]+);} $line all typename]} {
|
||||
if {[regexp {^typedef .* ([a-zA-Z0-9_]+);} $line all typename]} {
|
||||
# --------------------\y jimtcl does not support \y
|
||||
if {[info exists typedef_seen($typename)]} {
|
||||
return "/* [string map {/* // */ //} $line] */"
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ for {set i 0} {$i<[llength $argv]} {incr i} {
|
||||
lappend extrasrc $x
|
||||
}
|
||||
}
|
||||
set in [open $srcdir/sqlite3.h]
|
||||
set in [open $srcdir/sqlite3.h rb]
|
||||
set cnt 0
|
||||
set VERSION ?????
|
||||
while {![eof $in]} {
|
||||
@@ -86,7 +86,7 @@ close $in
|
||||
#
|
||||
set fname sqlite3.c
|
||||
if {$enable_recover} { set fname sqlite3r.c }
|
||||
set out [open $fname w]
|
||||
set out [open $fname wb]
|
||||
# Force the output to use unix line endings, even on Windows.
|
||||
fconfigure $out -translation lf
|
||||
set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
|
||||
@@ -117,7 +117,12 @@ if {$tcl_platform(platform)=="windows"} {
|
||||
set vsrcprog ./src-verify
|
||||
}
|
||||
if {[file executable $vsrcprog] && [file readable $srcroot/manifest]} {
|
||||
set res [string trim [split [exec $vsrcprog -x $srcroot]] \n]
|
||||
set tmpfile tmp-[clock millisec]-[expr {int(rand()*100000000000)}].txt
|
||||
exec $vsrcprog -x $srcroot > $tmpfile
|
||||
set fd [open $tmpfile rb]
|
||||
set res [string trim [split [read $fd] \n]]
|
||||
close $fd
|
||||
file delete -force $tmpfile
|
||||
puts $out "** The content in this amalgamation comes from Fossil check-in"
|
||||
puts -nonewline $out "** [string range [lindex $res 0] 0 35]"
|
||||
if {[llength $res]==1} {
|
||||
@@ -148,7 +153,7 @@ if {$addstatic} {
|
||||
#
|
||||
# then set the SQLITE_UDL_CAPABLE_PARSER flag in the amalgamation.
|
||||
#
|
||||
set in [open $srcdir/parse.c]
|
||||
set in [open $srcdir/parse.c rb]
|
||||
if {[regexp {ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT} [read $in]]} {
|
||||
puts $out "#define SQLITE_UDL_CAPABLE_PARSER 1"
|
||||
}
|
||||
@@ -243,7 +248,7 @@ proc copy_file {filename} {
|
||||
set tail [file tail $filename]
|
||||
section_comment "Begin file $tail"
|
||||
if {$linemacros} {puts $out "#line 1 \"$filename\""}
|
||||
set in [open $filename r]
|
||||
set in [open $filename rb]
|
||||
set varpattern {^[a-zA-Z][a-zA-Z_0-9 *]+(sqlite3[_a-zA-Z0-9]+)(\[|;| =)}
|
||||
set declpattern {([a-zA-Z][a-zA-Z_0-9 ]+ \**)(sqlite3[_a-zA-Z0-9]+)(\(.*)}
|
||||
if {[file extension $filename]==".h"} {
|
||||
@@ -358,7 +363,7 @@ proc copy_file {filename} {
|
||||
#
|
||||
proc copy_file_verbatim {filename} {
|
||||
global out
|
||||
set in [open $filename r]
|
||||
set in [open $filename rb]
|
||||
set tail [file tail $filename]
|
||||
section_comment "Begin EXTRA_SRC file $tail"
|
||||
while {![eof $in]} {
|
||||
|
||||
@@ -53,7 +53,7 @@ if {[lsearch -regexp [lrange $argv 1 end] {^-+enable-recover}] != -1} {
|
||||
|
||||
# Get the SQLite version number (ex: 3.6.18) from the $TOP/VERSION file.
|
||||
#
|
||||
set in [open $TOP/VERSION]
|
||||
set in [open [file normalize $TOP/VERSION] rb]
|
||||
set zVersion [string trim [read $in]]
|
||||
close $in
|
||||
set nVersion [eval format "%d%03d%03d" [split $zVersion .]]
|
||||
@@ -62,7 +62,12 @@ set nVersion [eval format "%d%03d%03d" [split $zVersion .]]
|
||||
#
|
||||
set PWD [pwd]
|
||||
cd $TOP
|
||||
set zSourceId [exec $PWD/mksourceid manifest]
|
||||
set tmpfile tmp-[clock millisec]-[expr {int(rand()*100000000000)}].txt
|
||||
exec $PWD/mksourceid manifest > $tmpfile
|
||||
set fd [open $tmpfile rb]
|
||||
set zSourceId [string trim [read $fd]]
|
||||
close $fd
|
||||
file delete -force $tmpfile
|
||||
cd $PWD
|
||||
|
||||
# Set up patterns for recognizing API declarations.
|
||||
@@ -111,7 +116,7 @@ set cdecllist {
|
||||
# Process the source files.
|
||||
#
|
||||
foreach file $filelist {
|
||||
set in [open $file]
|
||||
set in [open $file rb]
|
||||
if {![regexp {sqlite\.h\.in} $file]} {
|
||||
puts "/******** Begin file [file tail $file] *********/"
|
||||
}
|
||||
|
||||
@@ -36,17 +36,6 @@ set TCLSH [info nameofexe]
|
||||
#
|
||||
set NERR 0
|
||||
|
||||
######################### configure ###########################################
|
||||
|
||||
set conf [readfile $ROOT/configure]
|
||||
set vers [readfile $ROOT/VERSION]
|
||||
if {[string first $vers $conf]<=0} {
|
||||
puts "ERROR: ./configure does not agree with ./VERSION"
|
||||
puts "...... Fix: run autoconf"
|
||||
incr NERR
|
||||
}
|
||||
unset conf
|
||||
|
||||
######################### autoconf/tea/configure.ac ###########################
|
||||
|
||||
set confac [readfile $ROOT/autoconf/tea/configure.ac]
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# A level of indirection for use soley by the configure script
|
||||
# (auto.def).
|
||||
#
|
||||
# Expects to be passed a full path to a tclConfig.sh. It sources it
|
||||
# and emits TCL code which sets some vars which are exported by
|
||||
# tclConfig.sh.
|
||||
#
|
||||
# This script expects that the caller has already validated that the
|
||||
# file exists, is not a directory, and is readable.
|
||||
#
|
||||
# If passed no filename, or an empty one, then it emits config code
|
||||
# suitable for the "config not found" case.
|
||||
if test x = "x$1"; then
|
||||
TCL_INCLUDE_SPEC=
|
||||
TCL_LIB_SPEC=
|
||||
TCL_STUB_LIB_SPEC=
|
||||
TCL_EXEC_PREFIX=
|
||||
TCL_VERSION=
|
||||
else
|
||||
. "$1"
|
||||
fi
|
||||
|
||||
echo "define TCL_INCLUDE_SPEC {$TCL_INCLUDE_SPEC} ;"
|
||||
echo "define TCL_LIB_SPEC {$TCL_LIB_SPEC} ;"
|
||||
echo "define TCL_STUB_LIB_SPEC {$TCL_STUB_LIB_SPEC} ;"
|
||||
echo "define TCL_EXEC_PREFIX {$TCL_EXEC_PREFIX} ;"
|
||||
echo "define TCL_VERSION {$TCL_VERSION} ;"
|
||||
@@ -69,7 +69,7 @@ set namechars {abcefghjklmnopqrstuvwxyz}
|
||||
set nnc [string length $namechars]
|
||||
while {![eof stdin]} {
|
||||
set line [gets stdin]
|
||||
if {[regexp "^case (OP_\\w+): \173" $line all operator]} {
|
||||
if {[regexp "^case (OP_\\w+): \\x7B" $line all operator]} {
|
||||
append afterUnion $line\n
|
||||
set vlist {}
|
||||
while {![eof stdin]} {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<Application
|
||||
x:Class="vsixtest.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:vsixtest"
|
||||
RequestedTheme="Light">
|
||||
|
||||
</Application>
|
||||
@@ -1,120 +0,0 @@
|
||||
//
|
||||
// App.xaml.cpp
|
||||
// Implementation of the App class.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.xaml.h"
|
||||
|
||||
using namespace vsixtest;
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Windows::ApplicationModel;
|
||||
using namespace Windows::ApplicationModel::Activation;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Interop;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
App::App()
|
||||
{
|
||||
InitializeComponent();
|
||||
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
|
||||
{
|
||||
|
||||
#if _DEBUG
|
||||
// Show graphics profiling information while debugging.
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
// Display the current frame rate counters
|
||||
DebugSettings->EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == nullptr)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and associate it with
|
||||
// a SuspensionManager key
|
||||
rootFrame = ref new Frame();
|
||||
|
||||
rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
|
||||
|
||||
if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
|
||||
{
|
||||
// TODO: Restore the saved session state only when appropriate, scheduling the
|
||||
// final launch steps after the restore is complete
|
||||
|
||||
}
|
||||
|
||||
if (rootFrame->Content == nullptr)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
|
||||
}
|
||||
// Place the frame in the current Window
|
||||
Window::Current->Content = rootFrame;
|
||||
// Ensure the current window is active
|
||||
Window::Current->Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rootFrame->Content == nullptr)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
|
||||
}
|
||||
// Ensure the current window is active
|
||||
Window::Current->Activate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
|
||||
{
|
||||
(void) sender; // Unused parameter
|
||||
(void) e; // Unused parameter
|
||||
|
||||
//TODO: Save application state and stop any background activity
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
|
||||
{
|
||||
throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// App.xaml.h
|
||||
// Declaration of the App class.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "App.g.h"
|
||||
|
||||
namespace vsixtest
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
ref class App sealed
|
||||
{
|
||||
protected:
|
||||
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
|
||||
|
||||
internal:
|
||||
App();
|
||||
|
||||
private:
|
||||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
|
||||
void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -1,13 +0,0 @@
|
||||
<Page
|
||||
x:Class="vsixtest.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:vsixtest"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// MainPage.xaml.cpp
|
||||
// Implementation of the MainPage class.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.xaml.h"
|
||||
#include "sqlite3.h"
|
||||
|
||||
using namespace vsixtest;
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
|
||||
|
||||
MainPage::MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
UseSQLite();
|
||||
}
|
||||
|
||||
void MainPage::UseSQLite(void)
|
||||
{
|
||||
int rc = SQLITE_OK;
|
||||
sqlite3 *pDb = nullptr;
|
||||
|
||||
rc = sqlite3_open_v2("test.db", &pDb,
|
||||
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr);
|
||||
|
||||
if (rc != SQLITE_OK)
|
||||
throw ref new FailureException("Failed to open database.");
|
||||
|
||||
rc = sqlite3_exec(pDb, "VACUUM;", nullptr, nullptr, nullptr);
|
||||
|
||||
if (rc != SQLITE_OK)
|
||||
throw ref new FailureException("Failed to vacuum database.");
|
||||
|
||||
rc = sqlite3_close(pDb);
|
||||
|
||||
if (rc != SQLITE_OK)
|
||||
throw ref new FailureException("Failed to close database.");
|
||||
|
||||
pDb = nullptr;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// MainPage.xaml.h
|
||||
// Declaration of the MainPage class.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MainPage.g.h"
|
||||
|
||||
namespace vsixtest
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public ref class MainPage sealed
|
||||
{
|
||||
public:
|
||||
MainPage();
|
||||
void UseSQLite(void);
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity
|
||||
Name="bb52b3e1-5c8a-4516-a5ff-8b9f9baadef7"
|
||||
Publisher="CN=mistachkin"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="bb52b3e1-5c8a-4516-a5ff-8b9f9baadef7" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>vsixtest</DisplayName>
|
||||
<PublisherDisplayName>mistachkin</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="vsixtest.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="vsixtest"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="vsixtest"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
||||
@@ -1,6 +0,0 @@
|
||||
//
|
||||
// pch.cpp
|
||||
// Include the standard header and generate the precompiled header.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
@@ -1,11 +0,0 @@
|
||||
//
|
||||
// pch.h
|
||||
// Header for standard system include files.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <collection.h>
|
||||
#include <ppltasks.h>
|
||||
|
||||
#include "App.xaml.h"
|
||||
@@ -1,39 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsixtest", "vsixtest.vcxproj", "{60BB14A5-0871-4656-BC38-4F0958230F9A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x64.Build.0 = Debug|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x86.Build.0 = Debug|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|ARM.Build.0 = Release|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x64.ActiveCfg = Release|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x64.Build.0 = Release|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x64.Deploy.0 = Release|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x86.Build.0 = Release|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x86.Deploy.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,373 +0,0 @@
|
||||
#!/usr/bin/tclsh
|
||||
#
|
||||
# This script is used to quickly test a VSIX (Visual Studio Extension) file
|
||||
# with Visual Studio 2015 on Windows.
|
||||
#
|
||||
# PREREQUISITES
|
||||
#
|
||||
# 1. This tool is Windows only.
|
||||
#
|
||||
# 2. This tool must be executed with "elevated administrator" privileges.
|
||||
#
|
||||
# 3. Tcl 8.4 and later are supported, earlier versions have not been tested.
|
||||
#
|
||||
# 4. The "sqlite-UWP-output.vsix" file is assumed to exist in the parent
|
||||
# directory of the directory containing this script. The [optional] first
|
||||
# command line argument to this script may be used to specify an alternate
|
||||
# file. However, currently, the file must be compatible with both Visual
|
||||
# Studio 2015 and the Universal Windows Platform.
|
||||
#
|
||||
# 5. The "VERSION" file is assumed to exist in the parent directory of the
|
||||
# directory containing this script. It must contain a version number that
|
||||
# matches the VSIX file being tested.
|
||||
#
|
||||
# 6. The temporary directory specified in the TEMP or TMP environment variables
|
||||
# must refer to an existing directory writable by the current user.
|
||||
#
|
||||
# 7. The VS140COMNTOOLS environment variable must refer to the Visual Studio
|
||||
# 2015 common tools directory.
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# The first argument to this script is optional. If specified, it must be the
|
||||
# name of the VSIX file to test.
|
||||
#
|
||||
package require Tcl 8.4
|
||||
|
||||
proc fail { {error ""} {usage false} } {
|
||||
if {[string length $error] > 0} then {
|
||||
puts stdout $error
|
||||
if {!$usage} then {exit 1}
|
||||
}
|
||||
|
||||
puts stdout "usage:\
|
||||
[file tail [info nameofexecutable]]\
|
||||
[file tail [info script]] \[vsixFile\]"
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
proc isWindows {} {
|
||||
#
|
||||
# NOTE: Returns non-zero only when running on Windows.
|
||||
#
|
||||
return [expr {[info exists ::tcl_platform(platform)] && \
|
||||
$::tcl_platform(platform) eq "windows"}]
|
||||
}
|
||||
|
||||
proc isAdministrator {} {
|
||||
#
|
||||
# NOTE: Returns non-zero only when running as "elevated administrator".
|
||||
#
|
||||
if {[isWindows]} then {
|
||||
if {[catch {exec -- whoami /groups} groups] == 0} then {
|
||||
set groups [string map [list \r\n \n] $groups]
|
||||
|
||||
foreach group [split $groups \n] {
|
||||
#
|
||||
# NOTE: Match this group line against the "well-known" SID for
|
||||
# the "Administrators" group on Windows.
|
||||
#
|
||||
if {[regexp -- {\sS-1-5-32-544\s} $group]} then {
|
||||
#
|
||||
# NOTE: Match this group line against the attributes column
|
||||
# sub-value that should be present when running with
|
||||
# elevated administrator credentials.
|
||||
#
|
||||
if {[regexp -- {\sEnabled group(?:,|\s)} $group]} then {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
proc getEnvironmentVariable { name } {
|
||||
#
|
||||
# NOTE: Returns the value of the specified environment variable or an empty
|
||||
# string for environment variables that do not exist in the current
|
||||
# process environment.
|
||||
#
|
||||
return [expr {[info exists ::env($name)] ? $::env($name) : ""}]
|
||||
}
|
||||
|
||||
proc getTemporaryPath {} {
|
||||
#
|
||||
# NOTE: Returns the normalized path to the first temporary directory found
|
||||
# in the typical set of environment variables used for that purpose
|
||||
# or an empty string to signal a failure to locate such a directory.
|
||||
#
|
||||
set names [list]
|
||||
|
||||
foreach name [list TEMP TMP] {
|
||||
lappend names [string toupper $name] [string tolower $name] \
|
||||
[string totitle $name]
|
||||
}
|
||||
|
||||
foreach name $names {
|
||||
set value [getEnvironmentVariable $name]
|
||||
|
||||
if {[string length $value] > 0} then {
|
||||
return [file normalize $value]
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
proc appendArgs { args } {
|
||||
#
|
||||
# NOTE: Returns all passed arguments joined together as a single string
|
||||
# with no intervening spaces between arguments.
|
||||
#
|
||||
eval append result $args
|
||||
}
|
||||
|
||||
proc readFile { fileName } {
|
||||
#
|
||||
# NOTE: Reads and returns the entire contents of the specified file, which
|
||||
# may contain binary data.
|
||||
#
|
||||
set file_id [open $fileName RDONLY]
|
||||
fconfigure $file_id -translation binary
|
||||
set result [read $file_id]
|
||||
close $file_id
|
||||
return $result
|
||||
}
|
||||
|
||||
proc writeFile { fileName data } {
|
||||
#
|
||||
# NOTE: Writes the entire contents of the specified file, which may contain
|
||||
# binary data.
|
||||
#
|
||||
set file_id [open $fileName {WRONLY CREAT TRUNC}]
|
||||
fconfigure $file_id -translation binary
|
||||
puts -nonewline $file_id $data
|
||||
close $file_id
|
||||
return ""
|
||||
}
|
||||
|
||||
proc putsAndEval { command } {
|
||||
#
|
||||
# NOTE: Outputs a command to the standard output channel and then evaluates
|
||||
# it in the callers context.
|
||||
#
|
||||
catch {
|
||||
puts stdout [appendArgs "Running: " [lrange $command 1 end] ...\n]
|
||||
}
|
||||
|
||||
return [uplevel 1 $command]
|
||||
}
|
||||
|
||||
proc isBadDirectory { directory } {
|
||||
#
|
||||
# NOTE: Returns non-zero if the directory is empty, does not exist, -OR- is
|
||||
# not a directory.
|
||||
#
|
||||
catch {
|
||||
puts stdout [appendArgs "Checking directory \"" $directory \"...\n]
|
||||
}
|
||||
|
||||
return [expr {[string length $directory] == 0 || \
|
||||
![file exists $directory] || ![file isdirectory $directory]}]
|
||||
}
|
||||
|
||||
proc isBadFile { fileName } {
|
||||
#
|
||||
# NOTE: Returns non-zero if the file name is empty, does not exist, -OR- is
|
||||
# not a regular file.
|
||||
#
|
||||
catch {
|
||||
puts stdout [appendArgs "Checking file \"" $fileName \"...\n]
|
||||
}
|
||||
|
||||
return [expr {[string length $fileName] == 0 || \
|
||||
![file exists $fileName] || ![file isfile $fileName]}]
|
||||
}
|
||||
|
||||
#
|
||||
# NOTE: This is the entry point for this script.
|
||||
#
|
||||
set script [file normalize [info script]]
|
||||
|
||||
if {[string length $script] == 0} then {
|
||||
fail "script file currently being evaluated is unknown" true
|
||||
}
|
||||
|
||||
if {![isWindows]} then {
|
||||
fail "this tool only works properly on Windows"
|
||||
}
|
||||
|
||||
if {![isAdministrator]} then {
|
||||
fail "this tool must run with \"elevated administrator\" privileges"
|
||||
}
|
||||
|
||||
set path [file normalize [file dirname $script]]
|
||||
set argc [llength $argv]; if {$argc > 1} then {fail "" true}
|
||||
|
||||
if {$argc == 1} then {
|
||||
set vsixFileName [lindex $argv 0]
|
||||
} else {
|
||||
set vsixFileName [file join \
|
||||
[file dirname $path] sqlite-UWP-output.vsix]
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
if {[isBadFile $vsixFileName]} then {
|
||||
fail [appendArgs \
|
||||
"VSIX file \"" $vsixFileName "\" does not exist"]
|
||||
}
|
||||
|
||||
set versionFileName [file join [file dirname $path] VERSION]
|
||||
|
||||
if {[isBadFile $versionFileName]} then {
|
||||
fail [appendArgs \
|
||||
"Version file \"" $versionFileName "\" does not exist"]
|
||||
}
|
||||
|
||||
set projectTemplateFileName [file join $path vsixtest.vcxproj.data]
|
||||
|
||||
if {[isBadFile $projectTemplateFileName]} then {
|
||||
fail [appendArgs \
|
||||
"Project template file \"" $projectTemplateFileName \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set envVarName VS140COMNTOOLS
|
||||
set vsDirectory [getEnvironmentVariable $envVarName]
|
||||
|
||||
if {[isBadDirectory $vsDirectory]} then {
|
||||
fail [appendArgs \
|
||||
"Visual Studio 2015 directory \"" $vsDirectory \
|
||||
"\" from environment variable \"" $envVarName \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set vsixInstaller [file join \
|
||||
[file dirname $vsDirectory] IDE VSIXInstaller.exe]
|
||||
|
||||
if {[isBadFile $vsixInstaller]} then {
|
||||
fail [appendArgs \
|
||||
"Visual Studio 2015 VSIX installer \"" $vsixInstaller \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set envVarName ProgramFiles
|
||||
set programFiles [getEnvironmentVariable $envVarName]
|
||||
|
||||
if {[isBadDirectory $programFiles]} then {
|
||||
fail [appendArgs \
|
||||
"Program Files directory \"" $programFiles \
|
||||
"\" from environment variable \"" $envVarName \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set msBuild [file join $programFiles MSBuild 14.0 Bin MSBuild.exe]
|
||||
|
||||
if {[isBadFile $msBuild]} then {
|
||||
fail [appendArgs \
|
||||
"MSBuild v14.0 executable file \"" $msBuild \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set temporaryDirectory [getTemporaryPath]
|
||||
|
||||
if {[isBadDirectory $temporaryDirectory]} then {
|
||||
fail [appendArgs \
|
||||
"Temporary directory \"" $temporaryDirectory \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
set installLogFileName [appendArgs \
|
||||
[file rootname [file tail $vsixFileName]] \
|
||||
-install- [pid] .log]
|
||||
|
||||
set commands(1) [list exec [file nativename $vsixInstaller]]
|
||||
|
||||
lappend commands(1) /quiet /norepair
|
||||
lappend commands(1) [appendArgs /logFile: $installLogFileName]
|
||||
lappend commands(1) [file nativename $vsixFileName]
|
||||
|
||||
###############################################################################
|
||||
|
||||
set buildLogFileName [appendArgs \
|
||||
[file rootname [file tail $vsixFileName]] \
|
||||
-build-%configuration%-%platform%- [pid] .log]
|
||||
|
||||
set commands(2) [list exec [file nativename $msBuild]]
|
||||
|
||||
lappend commands(2) [file nativename [file join $path vsixtest.sln]]
|
||||
lappend commands(2) /target:Rebuild
|
||||
lappend commands(2) /property:Configuration=%configuration%
|
||||
lappend commands(2) /property:Platform=%platform%
|
||||
|
||||
lappend commands(2) [appendArgs \
|
||||
/logger:FileLogger,Microsoft.Build.Engine\;Logfile= \
|
||||
[file nativename [file join $temporaryDirectory \
|
||||
$buildLogFileName]] \;Verbosity=diagnostic]
|
||||
|
||||
###############################################################################
|
||||
|
||||
set uninstallLogFileName [appendArgs \
|
||||
[file rootname [file tail $vsixFileName]] \
|
||||
-uninstall- [pid] .log]
|
||||
|
||||
set commands(3) [list exec [file nativename $vsixInstaller]]
|
||||
|
||||
lappend commands(3) /quiet /norepair
|
||||
lappend commands(3) [appendArgs /logFile: $uninstallLogFileName]
|
||||
lappend commands(3) [appendArgs /uninstall:SQLite.UWP.2015]
|
||||
|
||||
###############################################################################
|
||||
|
||||
if {1} then {
|
||||
catch {
|
||||
puts stdout [appendArgs \
|
||||
"Install log: \"" [file nativename [file join \
|
||||
$temporaryDirectory $installLogFileName]] \"\n]
|
||||
}
|
||||
|
||||
catch {
|
||||
puts stdout [appendArgs \
|
||||
"Build logs: \"" [file nativename [file join \
|
||||
$temporaryDirectory $buildLogFileName]] \"\n]
|
||||
}
|
||||
|
||||
catch {
|
||||
puts stdout [appendArgs \
|
||||
"Uninstall log: \"" [file nativename [file join \
|
||||
$temporaryDirectory $uninstallLogFileName]] \"\n]
|
||||
}
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
if {1} then {
|
||||
putsAndEval $commands(1)
|
||||
|
||||
set versionNumber [string trim [readFile $versionFileName]]
|
||||
set data [readFile $projectTemplateFileName]
|
||||
set data [string map [list %versionNumber% $versionNumber] $data]
|
||||
|
||||
set projectFileName [file join $path vsixtest.vcxproj]
|
||||
writeFile $projectFileName $data
|
||||
|
||||
set platforms [list x86 x64 ARM]
|
||||
set configurations [list Debug Release]
|
||||
|
||||
foreach platform $platforms {
|
||||
foreach configuration $configurations {
|
||||
putsAndEval [string map [list \
|
||||
%platform% $platform %configuration% $configuration] \
|
||||
$commands(2)]
|
||||
}
|
||||
}
|
||||
|
||||
putsAndEval $commands(3)
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{60bb14a5-0871-4656-bc38-4f0958230f9a}</ProjectGuid>
|
||||
<RootNamespace>vsixtest</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.10586.0</WindowsTargetPlatformMinVersion>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<PackageCertificateKeyFile>vsixtest_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="App.xaml.h">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MainPage.xaml.h">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="vsixtest_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Image Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Image Include="Assets\StoreLogo.png" />
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="App.xaml.cpp">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MainPage.xaml.cpp">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="SQLite.UWP.2015, Version=%versionNumber%" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Common">
|
||||
<UniqueIdentifier>60bb14a5-0871-4656-bc38-4f0958230f9a</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Assets">
|
||||
<UniqueIdentifier>e6271362-8f96-476d-907f-4da227b02435</UniqueIdentifier>
|
||||
<Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="App.xaml.cpp" />
|
||||
<ClCompile Include="MainPage.xaml.cpp" />
|
||||
<ClCompile Include="pch.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="App.xaml.h" />
|
||||
<ClInclude Include="MainPage.xaml.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\SplashScreen.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\StoreLogo.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="vsixtest_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainPage.xaml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||