DELETED Makefile.arm-wince-mingw32ce-gcc Index: Makefile.arm-wince-mingw32ce-gcc ================================================================== --- Makefile.arm-wince-mingw32ce-gcc +++ /dev/null @@ -1,138 +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 directory where to find the mingw32ce tools -MINGW32CE = /opt/mingw32ce/bin - -#### The target prefix of the mingw32ce tools -TARGET = arm-wince-mingw32ce - -#### 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 -O2 -#BCC = /opt/ancic/bin/c89 -0 - -#### If the target operating system supports the "usleep()" system -# call, then define the HAVE_USLEEP macro for all C modules. -# -USLEEP = -#USLEEP = -DHAVE_USLEEP=1 - -#### 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 -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=2 -#OPTS = -DSQLITE_DEBUG=1 -#OPTS = -OPTS = -DNDEBUG=1 -DSQLITE_OS_WIN=1 -D_WIN32_WCE=1 -#OPTS += -DHAVE_FDATASYNC=1 - -#### 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 -O6 -#TCC = gcc -g -O0 -Wall -#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage -#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 -TCC = $(MINGW32CE)/$(TARGET)-gcc -O2 -#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 -AR = $(MINGW32CE)/$(TARGET)-ar cr -#RANLIB = ranlib -#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib -RANLIB = $(MINGW32CE)/$(TARGET)-ranlib - -#MKSHLIB = gcc -shared -#SO = so -#SHPREFIX = lib -MKSHLIB = $(MINGW32CE)/$(TARGET)-gcc -shared -SO = dll -SHPREFIX = - -#### Extra compiler options needed for programs that use the TCL library. -# -#TCL_FLAGS = -#TCL_FLAGS = -DSTATIC_BUILD=1 -TCL_FLAGS = -I/home/drh/tcltk/8.5linux -#TCL_FLAGS = -I/home/drh/tcltk/8.5win -DSTATIC_BUILD=1 -#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux - -#### Linker options needed to link against the TCL library. -# -#LIBTCL = -ltcl -lm -ldl -LIBTCL = /home/drh/tcltk/8.5linux/libtcl8.5g.a -lm -ldl -#LIBTCL = /home/drh/tcltk/8.5win/libtcl85s.a -lmsvcrt -#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc - -#### 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 - -#### Which "awk" program provides nawk compatibilty -# -# NAWK = nawk -NAWK = awk - -# You should not have to change anything below this line -############################################################################### -include $(TOP)/main.mk Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -153,13 +153,10 @@ # libtool compile/link/install LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS) LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS) LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) -# nawk compatible awk. -NAWK = @AWK@ - # You should not have to change anything below this line ############################################################################### USE_AMALGAMATION = @USE_AMALGAMATION@ @@ -897,26 +894,26 @@ $(LTLINK) -o $@ tclsqlite-shell.lo \ libsqlite3.la $(LIBTCL) # Rules to build opcodes.c and opcodes.h # -opcodes.c: opcodes.h $(TOP)/mkopcodec.awk - $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c +opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl + $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c -opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk - cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h +opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl + cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h # Rules to build parse.c and parse.h - the outputs of lemon. # parse.h: parse.c -parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk +parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/tool/addopcodes.tcl cp $(TOP)/src/parse.y . rm -f parse.h ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y mv parse.h parse.h.temp - $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h + $(TCLSH_CMD) $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h keywordhash.h: $(TOP)/tool/mkkeywordhash.c @@ -1094,11 +1091,11 @@ echo "#define TCLSH 2" > $@ echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@ cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@ echo "static const char *tclsh_main_loop(void){" >> $@ echo "static const char *zMainloop = " >> $@ - $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@ + $(TCLSH_CMD) $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@ echo "; return zMainloop; }" >> $@ sqlite3_analyzer$(TEXE): sqlite3_analyzer.c $(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS) Index: Makefile.linux-gcc ================================================================== --- Makefile.linux-gcc +++ Makefile.linux-gcc @@ -116,13 +116,8 @@ #### Linker options needed by programs using readline() must link against. # LIBREADLINE = #LIBREADLINE = -static -lreadline -ltermcap -#### Which "awk" program provides nawk compatibilty -# -# NAWK = nawk -NAWK = awk - # You should not have to change anything below this line ############################################################################### include $(TOP)/main.mk Index: Makefile.msc ================================================================== --- Makefile.msc +++ Makefile.msc @@ -566,10 +566,14 @@ !ENDIF !IFNDEF LIBTCL LIBTCL = tcl85.lib !ENDIF + +!IFNDEF LIBTCLSTUB +LIBTCLSTUB = tclstub85.lib +!ENDIF # The locations of the ICU header and library files. These variables # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment # prior to running nmake in order to match the actual installed location on # this machine. @@ -807,16 +811,10 @@ !IF $(USE_ICU)!=0 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR) LTLIBS = $(LTLIBS) $(LIBICU) !ENDIF -# nawk compatible awk. -# -!IFNDEF NAWK -NAWK = gawk.exe -!ENDIF - # You should not have to change anything below this line ############################################################################### # Object files for the SQLite library (non-amalgamation). # @@ -1227,11 +1225,11 @@ libsqlite3.lib: $(LIBOBJ) $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib - $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS) + $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) sqlite3.exe: $(TOP)\src\shell.c $(JSON1_DEP) $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h $(LTLINK) $(SHELL_COMPILE_OPTS) $(JSON1_OPT) $(READLINE_FLAGS) $(TOP)\src\shell.c $(JSON1_SRC) \ /link /pdb:sqlite3sh.pdb $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) @@ -1329,11 +1327,11 @@ !IF $(USE_RC)!=0 $(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(HDR) echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h for /F %%V in ('type "$(TOP)\VERSION"') do ( \ echo #define SQLITE_RESOURCE_VERSION %%V \ - | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \ + | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \ ) echo #endif >> sqlite3rc.h $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc !ENDIF @@ -1570,26 +1568,26 @@ tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(LIBRESOBJS) $(LTLINK) $(SQLITE3C) /link $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite-shell.lo $(LIBRESOBJS) $(LTLIBS) $(TLIBS) # Rules to build opcodes.c and opcodes.h # -opcodes.c: opcodes.h $(TOP)\mkopcodec.awk - $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c +opcodes.c: opcodes.h $(TOP)\tool\mkopcodec.tcl + $(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c -opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk - type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk > opcodes.h +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 # Rules to build parse.c and parse.h - the outputs of lemon. # parse.h: parse.c -parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk +parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl del /Q parse.y parse.h parse.h.temp 2>NUL copy $(TOP)\src\parse.y . .\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y move parse.h parse.h.temp - $(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp > parse.h + $(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION $(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > sqlite3.h sqlite3ext.h: .target_source @@ -1772,11 +1770,11 @@ echo #define TCLSH 2 > $@ echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@ copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@ echo static const char *tclsh_main_loop(void){ >> $@ echo static const char *zMainloop = >> $@ - $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@ + $(TCLSH_CMD) $(TOP)\tool\tostr.tcl $(TOP)\tool\spaceanal.tcl >> $@ echo ; return zMainloop; } >> $@ sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS) $(LTLINK) $(NO_WARN) -DBUILD_sqlite -I$(TCLINCDIR) sqlite3_analyzer.c \ /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) @@ -1856,10 +1854,10 @@ dll: sqlite3.dll sqlite3.def: libsqlite3.lib echo EXPORTS > sqlite3.def dumpbin /all libsqlite3.lib \ - | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \ + | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_.*)$$" \1 \ | sort >> sqlite3.def sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) DELETED Makefile.vxworks Index: Makefile.vxworks ================================================================== --- Makefile.vxworks +++ /dev/null @@ -1,673 +0,0 @@ -#!/usr/make -# -# Makefile for SQLITE on VxWorks - -ifeq ($(FORCPU),) - FORCPU = SH32gnule -endif - -TOOL_FAMILY = gnu - -include $(WIND_USR)/tool/gnu/make.$(FORCPU) - -#### The toplevel directory of the source tree. This is the directory -# that contains this "Makefile.in" and the "configure.in" script. -# -TOP = . - -#### C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -BCC = gcc -g -O2 -#BCC = /opt/ancic/bin/c89 -0 - -#### If the target operating system supports the "usleep()" system -# call, then define the HAVE_USLEEP macro for all C modules. -# -USLEEP = -#USLEEP = -DHAVE_USLEEP=1 - -#### If you want the SQLite library to be safe for use within a -# multi-threaded program, then define the following macro -# appropriately: -# -THREADSAFE = -DSQLITE_THREADSAFE=1 -#THREADSAFE = -DSQLITE_THREADSAFE=0 - -#### Specify any extra linker options needed to make the library -# thread safe -# -#THREADLIB = -lpthread -THREADLIB = - -#### Specify any extra libraries needed to access required functions. -# -ifeq ($(CPU),SH32) - # for SH4 shared library - TLIBS_SHARED += -L$(WIND_USR)/lib/sh/SH32/commonle/PIC -else - # for all other CPUs shared library - TLIBS_SHARED += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS) -endif -# for static library -TLIBS += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS) - -#### 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=2 -#OPTS = -DSQLITE_DEBUG=1 -#OPTS = -OPTS = -DNDEBUG=1 -DSQLITE_OS_UNIX=1 $(THREADSAFE) -OPTS += -DSQLITE_OMIT_LOAD_EXTENSION=1 -OPTS += -DSQLITE_ENABLE_LOCKING_STYLE=1 -OPTS += -DSQLITE_THREAD_OVERRIDE_LOCK=0 -OPTS += -DSQLITE_ENABLE_COLUMN_METADATA=1 -OPTS += -DHAVE_FDATASYNC=1 - -#### The suffix to add to executable files. ".exe" for windows. -# Nothing for unix. -# -EXE = .vxe -#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 -O6 -#TCC = gcc -g -O0 -Wall -#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage -#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 -TCC = $(CC) $(DEFINE_CC) -O2 -g -mrtp $(CC_ARCH_SPEC) -D_REENTRANT=1 -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=$(TOOL_FAMILY) -D_VX_TOOL=$(TOOL) -TCC += -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip -#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive - -#TCC_SHARED = $(TCC) -fPIC -TCC_SHARED = $(TCC) - -#### Tools used to build a static library. -# -#ARX = ar cr -#ARX = /opt/mingw/bin/i386-mingw32-ar cr -AR += cr -#RANLIB = ranlib -#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib - -#MKSHLIB = gcc -shared -#SO = so -#SHPREFIX = lib -MKSHLIB = $(CC) $(DEFINE_CC) -mrtp -shared $(CC_ARCH_SPEC) -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=$(TOOL_FAMILY) -D_VX_TOOL=$(TOOL) -SO = so -SHPREFIX = lib - -#### Extra compiler options needed for programs that use the TCL library. -# -#TCL_FLAGS = -#TCL_FLAGS = -DSTATIC_BUILD=1 -TCL_FLAGS = -I/home/drh/tcltk/8.5linux -#TCL_FLAGS = -I/home/drh/tcltk/8.5win -DSTATIC_BUILD=1 -#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux - -#### Linker options needed to link against the TCL library. -# -#LIBTCL = -ltcl -lm -ldl -LIBTCL = /home/drh/tcltk/8.5linux/libtcl8.5g.a -lm -ldl -#LIBTCL = /home/drh/tcltk/8.5win/libtcl85s.a -lmsvcrt -#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc - -#### 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 - -#### Which "awk" program provides nawk compatibilty -# -# NAWK = nawk -NAWK = awk - - -#### Pasted and adapted main.mk file -############################################################################### -# The following macros should be defined before this script is -# invoked: -# -# TOP The toplevel directory of the source tree. This is the -# directory that contains this "Makefile.in" and the -# "configure.in" script. -# -# BCC C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -# THREADLIB Specify any extra linker options needed to make the library -# thread safe -# -# OPTS Extra compiler command-line options. -# -# EXE The suffix to add to executable files. ".exe" for windows -# and "" for Unix. -# -# TCC C Compiler 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. -# -# AR Tools used to build a static library. -# RANLIB -# -# TCL_FLAGS Extra compiler options needed for programs that use the -# TCL library. -# -# LIBTCL Linker options needed to link against the TCL library. -# -# READLINE_FLAGS Compiler options needed for programs that use the -# readline() library. -# -# LIBREADLINE Linker options needed by programs using readline() must -# link against. -# -# NAWK Nawk compatible awk program. Older (obsolete?) solaris -# systems need this to avoid using the original AT&T AWK. -# -# Once the macros above are defined, the rest of this make script will -# build the SQLite library and testing tools. -################################################################################ - -# This is how we compile -# -TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) -TCCX_SHARED = $(TCC_SHARED) $(OPTS) -I. -I$(TOP)/src -I$(TOP) \ - -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3 \ - -I$(TOP)/ext/async - -# Object files for the SQLite library. -# -LIBOBJ+= alter.o analyze.o attach.o auth.o \ - backup.o bitvec.o btmutex.o btree.o build.o \ - callback.o complete.o date.o delete.o expr.o fault.o \ - fts3.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \ - fts3_tokenizer.o fts3_tokenizer1.o \ - func.o global.o hash.o \ - icu.o insert.o journal.o legacy.o loadext.o \ - main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \ - memjournal.o \ - mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \ - notify.o opcodes.o os.o os_unix.o os_win.o \ - pager.o parse.o pcache.o pcache1.o pragma.o prepare.o printf.o \ - random.o resolve.o rowset.o rtree.o select.o status.o \ - table.o tokenize.o trigger.o \ - update.o util.o vacuum.o \ - vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o \ - walker.o where.o utf.o vtab.o - - - -# All of the source code files. -# -SRC = \ - $(TOP)/src/alter.c \ - $(TOP)/src/analyze.c \ - $(TOP)/src/attach.c \ - $(TOP)/src/auth.c \ - $(TOP)/src/backup.c \ - $(TOP)/src/bitvec.c \ - $(TOP)/src/btmutex.c \ - $(TOP)/src/btree.c \ - $(TOP)/src/btree.h \ - $(TOP)/src/btreeInt.h \ - $(TOP)/src/build.c \ - $(TOP)/src/callback.c \ - $(TOP)/src/complete.c \ - $(TOP)/src/ctime.c \ - $(TOP)/src/date.c \ - $(TOP)/src/delete.c \ - $(TOP)/src/expr.c \ - $(TOP)/src/fault.c \ - $(TOP)/src/func.c \ - $(TOP)/src/global.c \ - $(TOP)/src/hash.c \ - $(TOP)/src/hash.h \ - $(TOP)/src/hwtime.h \ - $(TOP)/src/insert.c \ - $(TOP)/src/journal.c \ - $(TOP)/src/legacy.c \ - $(TOP)/src/loadext.c \ - $(TOP)/src/main.c \ - $(TOP)/src/malloc.c \ - $(TOP)/src/mem0.c \ - $(TOP)/src/mem1.c \ - $(TOP)/src/mem2.c \ - $(TOP)/src/mem3.c \ - $(TOP)/src/mem5.c \ - $(TOP)/src/memjournal.c \ - $(TOP)/src/msvc.h \ - $(TOP)/src/mutex.c \ - $(TOP)/src/mutex.h \ - $(TOP)/src/mutex_noop.c \ - $(TOP)/src/mutex_unix.c \ - $(TOP)/src/mutex_w32.c \ - $(TOP)/src/notify.c \ - $(TOP)/src/os.c \ - $(TOP)/src/os.h \ - $(TOP)/src/os_common.h \ - $(TOP)/src/os_setup.h \ - $(TOP)/src/os_unix.c \ - $(TOP)/src/os_win.c \ - $(TOP)/src/os_win.h \ - $(TOP)/src/pager.c \ - $(TOP)/src/pager.h \ - $(TOP)/src/parse.y \ - $(TOP)/src/pcache.c \ - $(TOP)/src/pcache.h \ - $(TOP)/src/pcache1.c \ - $(TOP)/src/pragma.c \ - $(TOP)/src/prepare.c \ - $(TOP)/src/printf.c \ - $(TOP)/src/random.c \ - $(TOP)/src/resolve.c \ - $(TOP)/src/rowset.c \ - $(TOP)/src/select.c \ - $(TOP)/src/status.c \ - $(TOP)/src/shell.c \ - $(TOP)/src/sqlite.h.in \ - $(TOP)/src/sqlite3ext.h \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/sqliteLimit.h \ - $(TOP)/src/table.c \ - $(TOP)/src/tclsqlite.c \ - $(TOP)/src/tokenize.c \ - $(TOP)/src/trigger.c \ - $(TOP)/src/utf.c \ - $(TOP)/src/update.c \ - $(TOP)/src/util.c \ - $(TOP)/src/vacuum.c \ - $(TOP)/src/vdbe.c \ - $(TOP)/src/vdbe.h \ - $(TOP)/src/vdbeapi.c \ - $(TOP)/src/vdbeaux.c \ - $(TOP)/src/vdbeblob.c \ - $(TOP)/src/vdbemem.c \ - $(TOP)/src/vdbeInt.h \ - $(TOP)/src/vtab.c \ - $(TOP)/src/walker.c \ - $(TOP)/src/where.c - -# Source code for extensions -# -SRC += \ - $(TOP)/ext/fts1/fts1.c \ - $(TOP)/ext/fts1/fts1.h \ - $(TOP)/ext/fts1/fts1_hash.c \ - $(TOP)/ext/fts1/fts1_hash.h \ - $(TOP)/ext/fts1/fts1_porter.c \ - $(TOP)/ext/fts1/fts1_tokenizer.h \ - $(TOP)/ext/fts1/fts1_tokenizer1.c -SRC += \ - $(TOP)/ext/fts2/fts2.c \ - $(TOP)/ext/fts2/fts2.h \ - $(TOP)/ext/fts2/fts2_hash.c \ - $(TOP)/ext/fts2/fts2_hash.h \ - $(TOP)/ext/fts2/fts2_icu.c \ - $(TOP)/ext/fts2/fts2_porter.c \ - $(TOP)/ext/fts2/fts2_tokenizer.h \ - $(TOP)/ext/fts2/fts2_tokenizer.c \ - $(TOP)/ext/fts2/fts2_tokenizer1.c -SRC += \ - $(TOP)/ext/fts3/fts3.c \ - $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_expr.c \ - $(TOP)/ext/fts3/fts3_expr.h \ - $(TOP)/ext/fts3/fts3_hash.c \ - $(TOP)/ext/fts3/fts3_hash.h \ - $(TOP)/ext/fts3/fts3_icu.c \ - $(TOP)/ext/fts3/fts3_porter.c \ - $(TOP)/ext/fts3/fts3_tokenizer.h \ - $(TOP)/ext/fts3/fts3_tokenizer.c \ - $(TOP)/ext/fts3/fts3_tokenizer1.c -SRC += \ - $(TOP)/ext/icu/sqliteicu.h \ - $(TOP)/ext/icu/icu.c -SRC += \ - $(TOP)/ext/rtree/rtree.h \ - $(TOP)/ext/rtree/rtree.c - - -# Generated source code files -# -SRC += \ - keywordhash.h \ - opcodes.c \ - opcodes.h \ - parse.c \ - parse.h \ - sqlite3.h - - -# Source code to the test files. -# -TESTSRC = \ - $(TOP)/src/test1.c \ - $(TOP)/src/test2.c \ - $(TOP)/src/test3.c \ - $(TOP)/src/test4.c \ - $(TOP)/src/test5.c \ - $(TOP)/src/test6.c \ - $(TOP)/src/test7.c \ - $(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_btree.c \ - $(TOP)/src/test_config.c \ - $(TOP)/src/test_devsym.c \ - $(TOP)/src/test_func.c \ - $(TOP)/src/test_hexio.c \ - $(TOP)/src/test_journal.c \ - $(TOP)/src/test_malloc.c \ - $(TOP)/src/test_md5.c \ - $(TOP)/src/test_mutex.c \ - $(TOP)/src/test_onefile.c \ - $(TOP)/src/test_osinst.c \ - $(TOP)/src/test_pcache.c \ - $(TOP)/src/test_schema.c \ - $(TOP)/src/test_server.c \ - $(TOP)/src/test_tclvar.c \ - $(TOP)/src/test_thread.c \ - $(TOP)/src/test_vfs.c \ - $(TOP)/src/test_wsd.c \ - -#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c -#TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c - -TESTSRC2 = \ - $(TOP)/src/attach.c $(TOP)/src/backup.c $(TOP)/src/btree.c \ - $(TOP)/src/build.c $(TOP)/src/ctime.c $(TOP)/src/date.c \ - $(TOP)/src/expr.c $(TOP)/src/func.c $(TOP)/src/insert.c $(TOP)/src/os.c \ - $(TOP)/src/os_unix.c $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c $(TOP)/src/pragma.c $(TOP)/src/prepare.c \ - $(TOP)/src/printf.c $(TOP)/src/random.c $(TOP)/src/pcache.c \ - $(TOP)/src/pcache1.c $(TOP)/src/select.c $(TOP)/src/tokenize.c \ - $(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \ - $(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c \ - $(TOP)/ext/fts3/fts3.c $(TOP)/ext/fts3/fts3_expr.c \ - $(TOP)/ext/fts3/fts3_tokenizer.c \ - $(TOP)/ext/async/sqlite3async.c - -# Header files used by all library source files. -# -HDR = \ - $(TOP)/src/btree.h \ - $(TOP)/src/btreeInt.h \ - $(TOP)/src/hash.h \ - $(TOP)/src/hwtime.h \ - keywordhash.h \ - $(TOP)/src/msvc.h \ - $(TOP)/src/mutex.h \ - opcodes.h \ - $(TOP)/src/os.h \ - $(TOP)/src/os_common.h \ - $(TOP)/src/os_setup.h \ - $(TOP)/src/os_win.h \ - $(TOP)/src/pager.h \ - $(TOP)/src/pcache.h \ - parse.h \ - sqlite3.h \ - $(TOP)/src/sqlite3ext.h \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/sqliteLimit.h \ - $(TOP)/src/vdbe.h \ - $(TOP)/src/vdbeInt.h - -# Header files used by extensions -# -EXTHDR += \ - $(TOP)/ext/fts1/fts1.h \ - $(TOP)/ext/fts1/fts1_hash.h \ - $(TOP)/ext/fts1/fts1_tokenizer.h -EXTHDR += \ - $(TOP)/ext/fts2/fts2.h \ - $(TOP)/ext/fts2/fts2_hash.h \ - $(TOP)/ext/fts2/fts2_tokenizer.h -EXTHDR += \ - $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_expr.h \ - $(TOP)/ext/fts3/fts3_hash.h \ - $(TOP)/ext/fts3/fts3_tokenizer.h -EXTHDR += \ - $(TOP)/ext/rtree/rtree.h -EXTHDR += \ - $(TOP)/ext/icu/sqliteicu.h - -# This is the default Makefile target. The objects listed here -# are what get build when you type just "make" with no arguments. -# -all: sqlite3.h libsqlite3.a sqlite3$(EXE) - -libsqlite3.a: $(LIBOBJ) - $(AR) libsqlite3.a $(LIBOBJ) - $(RANLIB) libsqlite3.a - -$(SHPREFIX)sqlite3.$(SO): $(LIBOBJ) - $(MKSHLIB) -o $(SHPREFIX)sqlite3.$(SO) $(LIBOBJ) $(TLIBS_SHARED) - -sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h - $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \ - $(TOP)/src/shell.c \ - $(LIBREADLINE) $(TLIBS) $(THREADLIB) -L. -lsqlite3 - -# This target creates a directory named "tsrc" and fills it with -# copies of all of the C source code and header files needed to -# build on the target system. Some of the C source code and header -# files are automatically generated. This target takes care of -# all that automatic generation. -# -target_source: $(SRC) - rm -rf tsrc - mkdir tsrc - cp -f $(SRC) tsrc - rm tsrc/sqlite.h.in tsrc/parse.y - touch target_source - -sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl - tclsh $(TOP)/tool/mksqlite3c.tcl - cp sqlite3.c tclsqlite3.c - cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c - -fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl - tclsh $(TOP)/ext/fts2/mkfts2amal.tcl - -fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl - tclsh $(TOP)/ext/fts3/mkfts3amal.tcl - -# Rules to build the LEMON compiler generator -# -lemon: $(TOP)/tool/lemon.c $(TOP)/src/lempar.c - $(BCC) -o lemon $(TOP)/tool/lemon.c - cp $(TOP)/src/lempar.c . - -# Rules to build individual *.o files from generated *.c files. This -# applies to: -# -# parse.o -# opcodes.o -# -%.o: %.c $(HDR) - $(TCCX_SHARED) -c $< - -# Rules to build individual *.o files from files in the src directory. -# -%.o: $(TOP)/src/%.c $(HDR) - $(TCCX_SHARED) -c $< - -tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR) - $(TCCX_SHARED) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c - - - -# Rules to build opcodes.c and opcodes.h -# -opcodes.c: opcodes.h $(TOP)/mkopcodec.awk - $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c - -opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk - cat parse.h $(TOP)/src/vdbe.c | \ - $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h - -# Rules to build parse.c and parse.h - the outputs of lemon. -# -parse.h: parse.c - -parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk - cp $(TOP)/src/parse.y . - rm -f parse.h - ./lemon $(OPTS) parse.y - mv parse.h parse.h.temp - awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h - -sqlite3.h: $(TOP)/src/sqlite.h.in - sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \ - -e s/--VERSION-NUMBER--/`cat ${TOP}/VERSION | sed 's/[^0-9]/ /g' | $(NAWK) '{printf "%d%03d%03d",$$1,$$2,$$3}'`/ \ - $(TOP)/src/sqlite.h.in >sqlite3.h - -keywordhash.h: $(TOP)/tool/mkkeywordhash.c - $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c - ./mkkeywordhash >keywordhash.h - - - -# Rules to build the extension objects. -# -icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c - -fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c - -fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c - -fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c - -fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c - -fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c - -fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c - -fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c - -fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c - -fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c - -fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c - -fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c - -fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c - -fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c - -rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c - - -# Rules for building test programs and for running tests -# -tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a - $(TCCX_SHARED) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \ - $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB) - - -# Rules to build the 'testfixture' application. -# -TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 -TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE - -testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \ - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a - -amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \ - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) - -fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - -DSQLITE_ENABLE_FTS3=1 \ - $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \ - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) - -fulltest: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/all.test - -soaktest: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/all.test -soak=1 - -fulltestonly: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/full.test - -test: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/veryquick.test - -sqlite3_analyzer$(EXE): $(TOP)/src/tclsqlite.c sqlite3.c $(TESTSRC) \ - $(TOP)/tool/spaceanal.tcl - sed \ - -e '/^#/d' \ - -e 's,\\,\\\\,g' \ - -e 's,",\\",g' \ - -e 's,^,",' \ - -e 's,$$,\\n",' \ - $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_DEBUG=1 -DSQLITE_PRIVATE="" \ - $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \ - -o sqlite3_analyzer$(EXE) \ - $(LIBTCL) $(THREADLIB) - -TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO) -$(TEST_EXTENSION): $(TOP)/src/test_loadext.c - $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION) - -extensiontest: testfixture$(EXE) $(TEST_EXTENSION) - ./testfixture$(EXE) $(TOP)/test/loadext.test - -clean: - rm -f *.o sqlite3$(EXE) libsqlite3.a sqlite3.h opcodes.* - rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h - rm -f $(PUBLISH) - rm -f *.da *.bb *.bbg gmon.out - rm -rf quota2a quota2b quota2c - rm -rf tsrc target_source - rm -f testloadext.dll libtestloadext.so - rm -f sqlite3.c fts?amal.c tclsqlite3.c - rm -f sqlite3rc.h - rm -f shell.c sqlite3ext.h - rm -f $(SHPREFIX)sqlite3.$(SO) DELETED addopcodes.awk Index: addopcodes.awk ================================================================== --- addopcodes.awk +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/awk -# -# This script appends additional token codes to the end of the -# parse.h file that lemon generates. These extra token codes are -# not used by the parser. But they are used by the tokenizer and/or -# the code generator. -# -# -BEGIN { - max = 0 -} -/^#define TK_/ { - print $0 - if( max<$3 ) max = $3 -} -END { - printf "#define TK_%-29s %4d\n", "TO_TEXT", ++max - printf "#define TK_%-29s %4d\n", "TO_BLOB", ++max - printf "#define TK_%-29s %4d\n", "TO_NUMERIC", ++max - printf "#define TK_%-29s %4d\n", "TO_INT", ++max - printf "#define TK_%-29s %4d\n", "TO_REAL", ++max - printf "#define TK_%-29s %4d\n", "ISNOT", ++max - printf "#define TK_%-29s %4d\n", "END_OF_FILE", ++max - printf "#define TK_%-29s %4d\n", "ILLEGAL", ++max - printf "#define TK_%-29s %4d\n", "SPACE", ++max - printf "#define TK_%-29s %4d\n", "UNCLOSED_STRING", ++max - printf "#define TK_%-29s %4d\n", "FUNCTION", ++max - printf "#define TK_%-29s %4d\n", "COLUMN", ++max - printf "#define TK_%-29s %4d\n", "AGG_FUNCTION", ++max - printf "#define TK_%-29s %4d\n", "AGG_COLUMN", ++max - printf "#define TK_%-29s %4d\n", "UMINUS", ++max - printf "#define TK_%-29s %4d\n", "UPLUS", ++max - printf "#define TK_%-29s %4d\n", "REGISTER", ++max -} Index: configure ================================================================== --- configure +++ configure @@ -801,11 +801,10 @@ RELEASE VERSION program_prefix TCLLIBDIR TCLSH_CMD -AWK INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM CPP OTOOL64 @@ -3909,17 +3908,17 @@ if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3914: $ac_compile\"" >&5) + (eval echo "\"\$as_me:3913: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3917: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:3916: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3920: output\"" >&5) + (eval echo "\"\$as_me:3919: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* @@ -5121,11 +5120,11 @@ fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5126 "configure"' > conftest.$ac_ext + echo '#line 5125 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then @@ -6646,15 +6645,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6651: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6650: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6655: \$? = $ac_status" >&5 + echo "$as_me:6654: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -6985,15 +6984,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6990: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6989: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6994: \$? = $ac_status" >&5 + echo "$as_me:6993: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -7090,15 +7089,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7095: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7094: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7099: \$? = $ac_status" >&5 + echo "$as_me:7098: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -7145,15 +7144,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7150: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7149: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7154: \$? = $ac_status" >&5 + echo "$as_me:7153: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -9525,11 +9524,11 @@ lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9530 "configure" +#line 9529 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif @@ -9621,11 +9620,11 @@ lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9626 "configure" +#line 9625 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif @@ -9941,52 +9940,10 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - ######### # Enable large file support (if special flags are necessary) # # Check whether --enable-largefile was given. @@ -11883,11 +11840,10 @@ gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' -AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -88,11 +88,10 @@ ######### # Programs needed # AC_PROG_LIBTOOL AC_PROG_INSTALL -AC_PROG_AWK ######### # Enable large file support (if special flags are necessary) # AC_SYS_LARGEFILE Index: main.mk ================================================================== --- main.mk +++ main.mk @@ -33,13 +33,10 @@ # readline() library. # # LIBREADLINE Linker options needed by programs using readline() must # link against. # -# NAWK Nawk compatible awk program. Older (obsolete?) solaris -# systems need this to avoid using the original AT&T AWK. -# # Once the macros above are defined, the rest of this make script will # build the SQLite library and testing tools. ################################################################################ # This is how we compile @@ -577,27 +574,27 @@ # Rules to build opcodes.c and opcodes.h # -opcodes.c: opcodes.h $(TOP)/mkopcodec.awk - $(NAWK) -f $(TOP)/mkopcodec.awk opcodes.h >opcodes.c +opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl + tclsh $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c -opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk +opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl cat parse.h $(TOP)/src/vdbe.c | \ - $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h + tclsh $(TOP)/tool/mkopcodeh.tcl >opcodes.h # Rules to build parse.c and parse.h - the outputs of lemon. # parse.h: parse.c -parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk +parse.c: $(TOP)/src/parse.y lemon $(TOP)/tool/addopcodes.tcl cp $(TOP)/src/parse.y . rm -f parse.h ./lemon -s $(OPTS) parse.y mv parse.h parse.h.temp - $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h + tclsh $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION $(TOP)/ext/rtree/sqlite3rtree.h tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h keywordhash.h: $(TOP)/tool/mkkeywordhash.c @@ -699,11 +696,11 @@ echo "#define TCLSH 2" > $@ echo "#define SQLITE_ENABLE_DBSTAT_VTAB 1" >> $@ cat sqlite3.c $(TOP)/src/tclsqlite.c >> $@ echo "static const char *tclsh_main_loop(void){" >> $@ echo "static const char *zMainloop = " >> $@ - $(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@ + tclsh $(TOP)/tool/tostr.tcl $(TOP)/tool/spaceanal.tcl >> $@ echo "; return zMainloop; }" >> $@ sqlite3_analyzer$(EXE): sqlite3_analyzer.c $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB) DELETED mkopcodec.awk Index: mkopcodec.awk ================================================================== --- mkopcodec.awk +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/awk -f -# -# This AWK script scans the opcodes.h file (which is itself generated by -# another awk script) and uses the information gleaned to create the -# opcodes.c source file. -# -# Opcodes.c contains strings which are the symbolic names for the various -# opcodes used by the VDBE. These strings are used when disassembling a -# VDBE program during tracing or as a result of the EXPLAIN keyword. -# -BEGIN { - print "/* Automatically generated. Do not edit */" - print "/* See the mkopcodec.awk script for details. */" - printf "#if !defined(SQLITE_OMIT_EXPLAIN)" - printf " || defined(VDBE_PROFILE)" - print " || defined(SQLITE_DEBUG)" - print "#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG)" - print "# define OpHelp(X) \"\\0\" X" - print "#else" - print "# define OpHelp(X)" - print "#endif" - print "const char *sqlite3OpcodeName(int i){" - print " static const char *const azName[] = { \"?\"," - mx = 0 -} -/^.define OP_/ { - sub("OP_","",$2) - i = $3+0 - label[i] = $2 - if( mx=0 ) continue; - if( name=="OP_Transaction" \ - || name=="OP_AutoCommit" \ - || name=="OP_Savepoint" \ - || name=="OP_Checkpoint" \ - || name=="OP_Vacuum" \ - || name=="OP_JournalMode" \ - || name=="OP_VUpdate" \ - || name=="OP_VFilter" \ - || name=="OP_Next" \ - || name=="OP_NextIfOpen" \ - || name=="OP_SorterNext" \ - || name=="OP_Prev" \ - || name=="OP_PrevIfOpen" \ - ){ - cnt++ - while( used[cnt] ) cnt++ - op[name] = cnt - used[cnt] = 1 - def[cnt] = name - } - } - - # Generate the numeric values for opcodes - for(i=0; i + /// This enumeration is used to represent all the possible exit codes from + /// this tool. + /// + internal enum ExitCode + { + /// + /// The file download was a success. + /// + Success = 0, + + /// + /// The command line arguments are missing (i.e. null). Generally, + /// this should not happen. + /// + MissingArgs = 1, + + /// + /// The wrong number of command line arguments was supplied. + /// + WrongNumArgs = 2, + + /// + /// The URI specified on the command line could not be parsed as a + /// supported absolute URI. + /// + BadUri = 3, + + /// + /// The file name portion of the URI specified on the command line + /// could not be extracted from it. + /// + BadFileName = 4, + + /// + /// The temporary directory is either invalid (i.e. null) or does not + /// represent an available directory. + /// + BadTempPath = 5, + + /// + /// An exception was caught in . Generally, this + /// should not happen. + /// + Exception = 6, + + /// + /// The file download was canceled. This tool does not make use of + /// the method; therefore, this + /// should not happen. + /// + DownloadCanceled = 7, + + /// + /// The file download encountered an error. Further information about + /// this error should be displayed on the console. + /// + DownloadError = 8 + } + + /////////////////////////////////////////////////////////////////////////// + + internal static class Program + { + #region Private Data + /// + /// This is used to synchronize multithreaded access to the + /// and + /// fields. + /// + private static readonly object syncRoot = new object(); + + /////////////////////////////////////////////////////////////////////// + + /// + /// This event will be signed when the file download has completed, + /// even if the file download itself was canceled or unsuccessful. + /// + private static EventWaitHandle doneEvent; + + /////////////////////////////////////////////////////////////////////// + + /// + /// The previous file download completion percentage seen by the + /// event handler. This value + /// is never decreased, nor is it ever reset to zero. + /// + private static int previousPercent = 0; + + /////////////////////////////////////////////////////////////////////// + + /// + /// This will be the exit code returned by this tool after the file + /// download completes, successfully or otherwise. This value is only + /// changed by the event handler. + /// + private static ExitCode exitCode = ExitCode.Success; + #endregion + + /////////////////////////////////////////////////////////////////////// + + #region Private Support Methods + /// + /// This method displays an error message to the console and/or + /// displays the command line usage information for this tool. + /// + /// + /// The error message to display, if any. + /// + /// + /// Non-zero to display the command line usage information. + /// + private static void Error( + string message, + bool usage + ) + { + if (message != null) + Console.WriteLine(message); + + string fileName = Path.GetFileName( + Process.GetCurrentProcess().MainModule.FileName); + + Console.WriteLine(String.Format("usage: {0} ", fileName)); + } + + /////////////////////////////////////////////////////////////////////// + + /// + /// This method attempts to determine the file name portion of the + /// specified URI. + /// + /// + /// The URI to process. + /// + /// + /// The file name portion of the specified URI -OR- null if it cannot + /// be determined. + /// + private static string GetFileName( + Uri uri + ) + { + if (uri == null) + return null; + + string pathAndQuery = uri.PathAndQuery; + + if (String.IsNullOrEmpty(pathAndQuery)) + return null; + + int index = pathAndQuery.LastIndexOf('/'); + + if ((index < 0) || (index == pathAndQuery.Length)) + return null; + + return pathAndQuery.Substring(index + 1); + } + #endregion + + /////////////////////////////////////////////////////////////////////// + + #region Private Event Handlers + /// + /// This method is an event handler that is called when the file + /// download completion percentage changes. It will display progress + /// on the console. Special care is taken to make sure that progress + /// events are not displayed out-of-order, even if duplicate and/or + /// out-of-order events are received. + /// + /// + /// The source of the event. + /// + /// + /// Information for the event being processed. + /// + private static void DownloadProgressChanged( + object sender, + DownloadProgressChangedEventArgs e + ) + { + if (e != null) + { + int percent = e.ProgressPercentage; + + lock (syncRoot) + { + if (percent > previousPercent) + { + Console.Write('.'); + + if ((percent % 10) == 0) + Console.Write(" {0}% ", percent); + + previousPercent = percent; + } + } + } + } + + /////////////////////////////////////////////////////////////////////// + + /// + /// This method is an event handler that is called when the file + /// download has completed, successfully or otherwise. It will + /// display the overall result of the file download on the console, + /// including any information, if applicable. + /// The field is changed by this method to + /// indicate the overall result of the file download and the event + /// within the field will be signaled. + /// + /// + /// The source of the event. + /// + /// + /// Information for the event being processed. + /// + private static void DownloadFileCompleted( + object sender, + AsyncCompletedEventArgs e + ) + { + if (e != null) + { + lock (syncRoot) + { + if (previousPercent < 100) + Console.Write(' '); + } + + if (e.Cancelled) + { + Console.WriteLine("Canceled"); + + lock (syncRoot) + { + exitCode = ExitCode.DownloadCanceled; + } + } + else + { + Exception error = e.Error; + + if (error != null) + { + Console.WriteLine("Error: {0}", error); + + lock (syncRoot) + { + exitCode = ExitCode.DownloadError; + } + } + else + { + Console.WriteLine("Done"); + } + } + } + + if (doneEvent != null) + doneEvent.Set(); + } + #endregion + + /////////////////////////////////////////////////////////////////////// + + #region Program Entry Point + /// + /// This is the entry-point for this tool. It handles processing the + /// command line arguments, setting up the web client, downloading the + /// file, and saving it to the file system. + /// + /// + /// The command line arguments. + /// + /// + /// Zero upon success; non-zero on failure. This will be one of the + /// values from the enumeration. + /// + private static int Main( + string[] args + ) + { + // + // NOTE: Sanity check the command line arguments. + // + if (args == null) + { + Error(null, true); + return (int)ExitCode.MissingArgs; + } + + if (args.Length != 1) + { + Error(null, true); + return (int)ExitCode.WrongNumArgs; + } + + // + // NOTE: Attempt to convert the first (and only) command line + // argument to an absolute URI. + // + Uri uri; + + if (!Uri.TryCreate(args[0], UriKind.Absolute, out uri)) + { + Error("Could not create absolute URI from argument.", false); + return (int)ExitCode.BadUri; + } + + // + // NOTE: Attempt to extract the file name portion of the URI we + // just created. + // + string fileName = GetFileName(uri); + + if (fileName == null) + { + Error("Could not extract the file name from the URI.", false); + return (int)ExitCode.BadFileName; + } + + // + // NOTE: Grab the temporary path setup for this process. If it is + // unavailable, we will not continue. + // + string directory = Path.GetTempPath(); + + if (String.IsNullOrEmpty(directory) || + !Directory.Exists(directory)) + { + Error("Temporary directory is invalid or unavailable.", false); + return (int)ExitCode.BadTempPath; + } + + try + { + using (WebClient webClient = new WebClient()) + { + // + // NOTE: Create the event used to signal completion of the + // file download. + // + doneEvent = new ManualResetEvent(false); + + // + // NOTE: Hookup the event handlers we care about on the web + // client. These are necessary because the file is + // downloaded asynchronously. + // + webClient.DownloadProgressChanged += + new DownloadProgressChangedEventHandler( + DownloadProgressChanged); + + webClient.DownloadFileCompleted += + new AsyncCompletedEventHandler( + DownloadFileCompleted); + + // + // NOTE: Build the fully qualified path and file name, + // within the temporary directory, where the file to + // be downloaded will be saved. + // + fileName = Path.Combine(directory, fileName); + + // + // NOTE: If the file name already exists (in the temporary) + // directory, delete it. + // + // TODO: Perhaps an error should be raised here instead? + // + if (File.Exists(fileName)) + File.Delete(fileName); + + // + // NOTE: After kicking off the asynchronous file download + // process, wait [forever] until the "done" event is + // signaled. + // + Console.WriteLine( + "Downloading \"{0}\" to \"{1}\"...", uri, fileName); + + webClient.DownloadFileAsync(uri, fileName); + doneEvent.WaitOne(); + } + + lock (syncRoot) + { + return (int)exitCode; + } + } + catch (Exception e) + { + // + // NOTE: An exception was caught. Report it via the console + // and return failure. + // + Error(e.ToString(), false); + return (int)ExitCode.Exception; + } + } + #endregion + } +} ADDED tool/GetTclKit.bat Index: tool/GetTclKit.bat ================================================================== --- /dev/null +++ tool/GetTclKit.bat @@ -0,0 +1,272 @@ +@ECHO OFF + +:: +:: GetTclKit.bat -- +:: +:: TclKit Download Tool +:: + +SETLOCAL + +REM SET __ECHO=ECHO +REM SET __ECHO2=ECHO +REM SET __ECHO3=ECHO +IF NOT DEFINED _AECHO (SET _AECHO=REM) +IF NOT DEFINED _CECHO (SET _CECHO=REM) +IF NOT DEFINED _VECHO (SET _VECHO=REM) + +SET OVERWRITE=^> +IF DEFINED __ECHO SET OVERWRITE=^^^> + +SET APPEND=^>^> +IF DEFINED __ECHO SET APPEND=^^^>^^^> + +SET PROCESSOR=%1 + +IF DEFINED PROCESSOR ( + CALL :fn_UnquoteVariable PROCESSOR +) ELSE ( + GOTO usage +) + +%_VECHO% Processor = '%PROCESSOR%' + +SET DUMMY2=%2 + +IF DEFINED DUMMY2 ( + GOTO usage +) + +SET ROOT=%~dp0\.. +SET ROOT=%ROOT:\\=\% + +%_VECHO% Root = '%ROOT%' + +SET TOOLS=%~dp0 +SET TOOLS=%TOOLS:~0,-1% + +%_VECHO% Tools = '%TOOLS%' + +IF NOT DEFINED windir ( + ECHO The windir environment variable must be set first. + GOTO errors +) + +%_VECHO% WinDir = '%windir%' + +IF NOT DEFINED TEMP ( + ECHO The TEMP environment variable must be set first. + GOTO errors +) + +%_VECHO% Temp = '%TEMP%' + +IF NOT DEFINED TCLKIT_URI ( + SET TCLKIT_URI=http://tclsh.com/ +) + +%_VECHO% TclKitUri = '%TCLKIT_URI%' + +IF /I "%PROCESSOR%" == "x86" ( + CALL :fn_TclKitX86Variables +) ELSE IF /I "%PROCESSOR%" == "x64" ( + CALL :fn_TclKitX64Variables +) ELSE ( + GOTO usage +) + +%_VECHO% TclKitVersion = '%TCLKIT_VERSION%' +%_VECHO% TclKitPatchLevel = '%TCLKIT_PATCHLEVEL%' +%_VECHO% TclKitNoSdk = '%TCLKIT_NOSDK%' +%_VECHO% TclKitExe = '%TCLKIT_EXE%' +%_VECHO% TclKitLib = '%TCLKIT_LIB%' +%_VECHO% TclKitLibStub = '%TCLKIT_LIB_STUB%' +%_VECHO% TclKitSdk = '%TCLKIT_SDK%' +%_VECHO% TclKitSdkZip = '%TCLKIT_SDK_ZIP%' +%_VECHO% TclKitFiles = '%TCLKIT_FILES%' + +CALL :fn_ResetErrorLevel + +FOR %%T IN (csc.exe) DO ( + SET %%T_PATH=%%~dp$PATH:T +) + +%_VECHO% Csc.exe_PATH = '%csc.exe_PATH%' + +IF DEFINED csc.exe_PATH ( + GOTO skip_addToPath +) + +IF DEFINED FRAMEWORKDIR ( + REM Use the existing .NET Framework directory... +) ELSE IF EXIST "%windir%\Microsoft.NET\Framework64\v2.0.50727" ( + SET FRAMEWORKDIR=%windir%\Microsoft.NET\Framework64\v2.0.50727 +) ELSE IF EXIST "%windir%\Microsoft.NET\Framework64\v3.5" ( + SET FRAMEWORKDIR=%windir%\Microsoft.NET\Framework64\v3.5 +) ELSE IF EXIST "%windir%\Microsoft.NET\Framework64\v4.0.30319" ( + SET FRAMEWORKDIR=%windir%\Microsoft.NET\Framework64\v4.0.30319 +) ELSE IF EXIST "%windir%\Microsoft.NET\Framework\v2.0.50727" ( + SET FRAMEWORKDIR=%windir%\Microsoft.NET\Framework\v2.0.50727 +) ELSE IF EXIST "%windir%\Microsoft.NET\Framework\v3.5" ( + SET FRAMEWORKDIR=%windir%\Microsoft.NET\Framework\v3.5 +) ELSE IF EXIST "%windir%\Microsoft.NET\Framework\v4.0.30319" ( + SET FRAMEWORKDIR=%windir%\Microsoft.NET\Framework\v4.0.30319 +) ELSE ( + ECHO No suitable version of the .NET Framework appears to be installed. + GOTO errors +) + +%_VECHO% FrameworkDir = '%FRAMEWORKDIR%' + +IF NOT EXIST "%FRAMEWORKDIR%\csc.exe" ( + ECHO The file "%FRAMEWORKDIR%\csc.exe" is missing. + GOTO errors +) + +SET PATH=%FRAMEWORKDIR%;%PATH% + +:skip_addToPath + +IF NOT EXIST "%TEMP%\GetFile.exe" ( + %__ECHO% csc.exe "/out:%TEMP%\GetFile.exe" /target:exe "%TOOLS%\GetFile.cs" + + IF ERRORLEVEL 1 ( + ECHO Compilation of "%TOOLS%\GetFile.cs" failed. + GOTO errors + ) +) + +FOR %%F IN (%TCLKIT_FILES%) DO ( + IF NOT EXIST "%TEMP%\%%F" ( + %__ECHO% "%TEMP%\GetFile.exe" "%TCLKIT_URI%%%F" + + IF ERRORLEVEL 1 ( + ECHO Download of "%%F" from "%TCLKIT_URI%" failed. + GOTO errors + ) + ) +) + +IF DEFINED TCLKIT_NOSDK GOTO skip_sdkUnZip + +IF NOT EXIST "%TEMP%\%TCLKIT_SDK%" ( + %__ECHO% MKDIR "%TEMP%\%TCLKIT_SDK%" + + IF ERRORLEVEL 1 ( + ECHO Could not create directory "%TEMP%\%TCLKIT_SDK%". + GOTO errors + ) +) + +%__ECHO% "%TEMP%\unzip.exe" -n "%TEMP%\%TCLKIT_SDK_ZIP%" -d "%TEMP%\%TCLKIT_SDK%" + +IF ERRORLEVEL 1 ( + ECHO Could not unzip "%TEMP%\%TCLKIT_SDK_ZIP%" to "%TEMP%\%TCLKIT_SDK%". + GOTO errors +) + +:skip_sdkUnZip + +%__ECHO% ECHO SET TCLSH_CMD=%TEMP%\%TCLKIT_EXE%%OVERWRITE%"%ROOT%\SetTclKitEnv.bat" + +IF DEFINED TCLKIT_NOSDK GOTO skip_sdkVariables + +%__ECHO% ECHO SET TCLINCDIR=%TEMP%\%TCLKIT_SDK%\include%APPEND%"%ROOT%\SetTclKitEnv.bat" +%__ECHO% ECHO SET TCLLIBDIR=%TEMP%\%TCLKIT_SDK%\lib%APPEND%"%ROOT%\SetTclKitEnv.bat" +%__ECHO% ECHO SET LIBTCL=%TCLKIT_LIB%%APPEND%"%ROOT%\SetTclKitEnv.bat" +%__ECHO% ECHO SET LIBTCLSTUB=%TCLKIT_LIB_STUB%%APPEND%"%ROOT%\SetTclKitEnv.bat" + +:skip_sdkVariables + +ECHO. +ECHO Wrote "%ROOT%\SetTclKitEnv.bat". +ECHO Please run it to set the necessary Tcl environment variables. +ECHO. + +GOTO no_errors + +:fn_TclKitX86Variables + IF NOT DEFINED TCLKIT_PATCHLEVEL ( + SET TCLKIT_PATCHLEVEL=8.6.4 + ) + SET TCLKIT_VERSION=%TCLKIT_PATCHLEVEL:.=% + SET TCLKIT_VERSION=%TCLKIT_VERSION:~0,2% + SET TCLKIT_EXE=tclkit-%TCLKIT_PATCHLEVEL%.exe + SET TCLKIT_LIB=libtclkit%TCLKIT_PATCHLEVEL:.=%.lib + SET TCLKIT_LIB_STUB=libtclstub%TCLKIT_VERSION:.=%.a + SET TCLKIT_SDK=libtclkit-sdk-x86-%TCLKIT_PATCHLEVEL% + SET TCLKIT_SDK_ZIP=%TCLKIT_SDK%.zip + SET TCLKIT_FILES=%TCLKIT_EXE% + IF NOT DEFINED TCLKIT_NOSDK ( + SET TCLKIT_FILES=%TCLKIT_FILES% unzip.exe %TCLKIT_SDK_ZIP% + ) + GOTO :EOF + +:fn_TclKitX64Variables + IF NOT DEFINED TCLKIT_PATCHLEVEL ( + REM + REM NOTE: By default, use latest available version of the TclKit SDK + REM for x64. However, the "default" TclKit executable for x86 + REM is still used here because it is the only one "well-known" + REM to be available for download. + REM + SET TCLKIT_PATCHLEVEL=8.6.3 + SET TCLKIT_EXE=tclkit-8.6.4.exe + ) ELSE ( + SET TCLKIT_EXE=tclkit-%TCLKIT_PATCHLEVEL%.exe + ) + SET TCLKIT_VERSION=%TCLKIT_PATCHLEVEL:.=% + SET TCLKIT_VERSION=%TCLKIT_VERSION:~0,2% + SET TCLKIT_LIB=libtclkit%TCLKIT_PATCHLEVEL:.=%.lib + SET TCLKIT_LIB_STUB=libtclstub%TCLKIT_VERSION:.=%.a + SET TCLKIT_SDK=libtclkit-sdk-x64-%TCLKIT_PATCHLEVEL% + SET TCLKIT_SDK_ZIP=%TCLKIT_SDK%.zip + SET TCLKIT_FILES=%TCLKIT_EXE% + IF NOT DEFINED TCLKIT_NOSDK ( + SET TCLKIT_FILES=%TCLKIT_FILES% unzip.exe %TCLKIT_SDK_ZIP% + ) + GOTO :EOF + +:fn_UnquoteVariable + IF NOT DEFINED %1 GOTO :EOF + SETLOCAL + SET __ECHO_CMD=ECHO %%%1%% + FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO ( + SET VALUE=%%V + ) + SET VALUE=%VALUE:"=% + REM " + ENDLOCAL && SET %1=%VALUE% + GOTO :EOF + +:fn_ResetErrorLevel + VERIFY > NUL + GOTO :EOF + +:fn_SetErrorLevel + VERIFY MAYBE 2> NUL + GOTO :EOF + +:usage + ECHO. + ECHO Usage: %~nx0 ^ + ECHO. + ECHO The only supported values for processor are "x86" and "x64". + GOTO errors + +:errors + CALL :fn_SetErrorLevel + ENDLOCAL + ECHO. + ECHO Failure, errors were encountered. + GOTO end_of_file + +:no_errors + CALL :fn_ResetErrorLevel + ENDLOCAL + ECHO. + ECHO Success, no errors were encountered. + GOTO end_of_file + +:end_of_file +%__ECHO% EXIT /B %ERRORLEVEL% ADDED tool/addopcodes.tcl Index: tool/addopcodes.tcl ================================================================== --- /dev/null +++ tool/addopcodes.tcl @@ -0,0 +1,45 @@ +#!/usr/bin/tclsh +# +# This script appends additional token codes to the end of the +# parse.h file that lemon generates. These extra token codes are +# not used by the parser. But they are used by the tokenizer and/or +# the code generator. +# +# +set in [open [lindex $argv 0] rb] +set max 0 +while {![eof $in]} { + set line [gets $in] + if {[regexp {^#define TK_} $line]} { + puts $line + set x [lindex $line 2] + if {$x>$max} {set max $x} + } +} +close $in + +# The following are the extra token codes to be added +# +set extras { + TO_TEXT + TO_BLOB + TO_NUMERIC + TO_INT + TO_REAL + ISNOT + END_OF_FILE + ILLEGAL + SPACE + UNCLOSED_STRING + FUNCTION + COLUMN + AGG_FUNCTION + AGG_COLUMN + UMINUS + UPLUS + REGISTER +} +foreach x $extras { + incr max + puts [format "#define TK_%-29s %4d" $x $max] +} Index: tool/build-all-msvc.bat ================================================================== --- tool/build-all-msvc.bat +++ tool/build-all-msvc.bat @@ -27,13 +27,13 @@ REM In the example above, "C:\dev\sqlite\core" represents the root of the REM source tree for SQLite and "C:\Temp" represents the final destination REM directory for the generated output files. REM REM Please note that the SQLite build process performed by the Makefile -REM associated with this batch script requires both Gawk ^(gawk.exe^) and Tcl -REM 8.5 ^(tclsh85.exe^) to be present in a directory contained in the PATH -REM environment variable unless a pre-existing amalgamation file is used. +REM associated with this batch script requires a Tcl shell to be present +REM in a directory contained in the PATH environment variable unless a +REM pre-existing amalgamation file is used. REM REM There are several environment variables that may be set to modify the REM behavior of this batch script and its associated Makefile. The list of REM platforms to build may be overriden by using the PLATFORMS environment REM variable, which should contain a list of platforms ^(e.g. x86 x86_amd64 @@ -230,37 +230,34 @@ REM REM NOTE: Check for the external tools needed during the build process ^(i.e. REM those that do not get compiled as part of the build process itself^) REM along the PATH. REM -FOR %%T IN (gawk.exe tclsh85.exe) DO ( +IF DEFINED TCLSH_CMD ( + SET TCLSH_FILE=%TCLSH_CMD% +) ELSE ( + SET TCLSH_FILE=tclsh85.exe +) + +FOR %%T IN (%TCLSH_FILE%) DO ( SET %%T_PATH=%%~dp$PATH:T ) REM -REM NOTE: The Gawk executable "gawk.exe" is required during the SQLite build -REM process unless a pre-existing amalgamation file is used. -REM -IF NOT DEFINED gawk.exe_PATH ( - ECHO The Gawk executable "gawk.exe" is required to be in the PATH. - GOTO errors -) - -REM -REM NOTE: The Tcl 8.5 executable "tclsh85.exe" is required during the SQLite -REM build process unless a pre-existing amalgamation file is used. -REM -IF NOT DEFINED tclsh85.exe_PATH ( - ECHO The Tcl 8.5 executable "tclsh85.exe" is required to be in the PATH. +REM NOTE: A Tcl shell executable is required during the SQLite build process +REM unless a pre-existing amalgamation file is used. +REM +IF NOT DEFINED %TCLSH_FILE%_PATH ( + ECHO The Tcl shell executable "%TCLSH_FILE%" is required to be in the PATH. GOTO errors ) REM REM NOTE: Set the TOOLPATH variable to contain all the directories where the REM external tools were found in the search above. REM -SET TOOLPATH=%gawk.exe_PATH%;%tclsh85.exe_PATH% +CALL :fn_CopyVariable %TCLSH_FILE%_PATH TOOLPATH %_VECHO% ToolPath = '%TOOLPATH%' REM REM NOTE: Setting the Windows SDK library path is only required for MSVC ADDED tool/mkopcodec.tcl Index: tool/mkopcodec.tcl ================================================================== --- /dev/null +++ tool/mkopcodec.tcl @@ -0,0 +1,50 @@ +#!/usr/bin/tclsh +# +# This TCL script scans the opcodes.h file (which is itself generated by +# another TCL script) and uses the information gleaned to create the +# opcodes.c source file. +# +# Opcodes.c contains strings which are the symbolic names for the various +# opcodes used by the VDBE. These strings are used when disassembling a +# VDBE program during tracing or as a result of the EXPLAIN keyword. +# +puts "/* Automatically generated. Do not edit */" +puts "/* See the tool/mkopcodec.tcl script for details. */" +puts "#if !defined(SQLITE_OMIT_EXPLAIN) \\" +puts " || defined(VDBE_PROFILE) \\" +puts " || defined(SQLITE_DEBUG)" +puts "#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG)" +puts "# define OpHelp(X) \"\\0\" X" +puts "#else" +puts "# define OpHelp(X)" +puts "#endif" +puts "const char *sqlite3OpcodeName(int i)\173" +puts " static const char *const azName\[\] = \173 \"?\"," +set mx 0 + +set in [open [lindex $argv 0] rb] +while {![eof $in]} { + set line [gets $in] + if {[regexp {^#define OP_} $line]} { + set name [lindex $line 1] + regsub {^OP_} $name {} name + set i [lindex $line 2] + set label($i) $name + if {$mx<$i} {set mx $i} + if {[regexp {synopsis: (.*) \*/} $line all x]} { + set synopsis($i) [string trim $x] + } else { + set synopsis($i) {} + } + } +} +close $in + +for {set i 1} {$i<=$mx} {incr i} { + puts [format " /* %3d */ %-18s OpHelp(\"%s\")," \ + $i \"$label($i)\" $synopsis($i)] +} +puts " \175;" +puts " return azName\[i\];" +puts "\175" +puts "#endif" ADDED tool/mkopcodeh.tcl Index: tool/mkopcodeh.tcl ================================================================== --- /dev/null +++ tool/mkopcodeh.tcl @@ -0,0 +1,230 @@ +#!/usr/bin/tclsh +# +# Generate the file opcodes.h. +# +# This TCL script scans a concatenation of the parse.h output file from the +# parser and the vdbe.c source file in order to generate the opcodes numbers +# for all opcodes. +# +# The lines of the vdbe.c that we are interested in are of the form: +# +# case OP_aaaa: /* same as TK_bbbbb */ +# +# The TK_ comment is optional. If it is present, then the value assigned to +# the OP_ is the same as the TK_ value. If missing, the OP_ value is assigned +# a small integer that is different from every other OP_ value. +# +# We go to the trouble of making some OP_ values the same as TK_ values +# as an optimization. During parsing, things like expression operators +# are coded with TK_ values such as TK_ADD, TK_DIVIDE, and so forth. Later +# during code generation, we need to generate corresponding opcodes like +# OP_Add and OP_Divide. By making TK_ADD==OP_Add and TK_DIVIDE==OP_Divide, +# code to translate from one to the other is avoided. This makes the +# code generator run (infinitesimally) faster and more importantly it makes +# the library footprint smaller. +# +# This script also scans for lines of the form: +# +# case OP_aaaa: /* jump, in1, in2, in3, out2-prerelease, out3 */ +# +# When such comments are found on an opcode, it means that certain +# properties apply to that opcode. Set corresponding flags using the +# OPFLG_INITIALIZER macro. +# + +set in stdin +set currentOp {} +set nOp 0 +while {![eof $in]} { + set line [gets $in] + + # Remember the TK_ values from the parse.h file. + # NB: The "TK_" prefix stands for "ToKen", not the graphical Tk toolkit + # commonly associated with TCL. + # + if {[regexp {^#define TK_} $line]} { + set tk([lindex $line 1]) [lindex $line 2] + continue + } + + # Find "/* Opcode: " lines in the vdbe.c file. Each one introduces + # a new opcode. Remember which parameters are used. + # + if {[regexp {^.. Opcode: } $line]} { + set currentOp OP_[lindex $line 2] + set m 0 + foreach term $line { + switch $term { + P1 {incr m 1} + P2 {incr m 2} + P3 {incr m 4} + P4 {incr m 8} + P5 {incr m 16} + } + } + set paramused($currentOp) $m + } + + # Find "** Synopsis: " lines that follow Opcode: + # + if {[regexp {^.. Synopsis: (.*)} $line all x] && $currentOp!=""} { + set synopsis($currentOp) [string trim $x] + } + + # Scan for "case OP_aaaa:" lines in the vdbe.c file + # + if {[regexp {^case OP_} $line]} { + set line [split $line] + set name [string trim [lindex $line 1] :] + set op($name) -1 + set jump($name) 0 + set in1($name) 0 + set in2($name) 0 + set in3($name) 0 + set out1($name) 0 + set out2($name) 0 + for {set i 3} {$i<[llength $line]-1} {incr i} { + switch [string trim [lindex $line $i] ,] { + same { + incr i + if {[lindex $line $i]=="as"} { + incr i + set sym [string trim [lindex $line $i] ,] + set val $tk($sym) + set op($name) $val + set used($val) 1 + set sameas($val) $sym + set def($val) $name + } + } + jump {set jump($name) 1} + in1 {set in1($name) 1} + in2 {set in2($name) 1} + in3 {set in3($name) 1} + out2 {set out2($name) 1} + out3 {set out3($name) 1} + } + } + set order($nOp) $name + incr nOp + } +} + +# Assign numbers to all opcodes and output the result. +# +set cnt 0 +set max 0 +puts "/* Automatically generated. Do not edit */" +puts "/* See the tool/mkopcodeh.tcl script for details */" +set op(OP_Noop) -1 +set order($nOp) OP_Noop +incr nOp +set op(OP_Explain) -1 +set order($nOp) OP_Explain +incr nOp + +# The following are the opcodes that are processed by resolveP2Values() +# +set rp2v_ops { + OP_Transaction + OP_AutoCommit + OP_Savepoint + OP_Checkpoint + OP_Vacuum + OP_JournalMode + OP_VUpdate + OP_VFilter + OP_Next + OP_NextIfOpen + OP_SorterNext + OP_Prev + OP_PrevIfOpen +} + +# Assign small values to opcodes that are processed by resolveP2Values() +# to make code generation for the switch() statement smaller and faster. +# +set cnt 0 +for {set i 0} {$i<$nOp} {incr i} { + set name $order($i) + if {[lsearch $rp2v_ops $name]>=0} { + incr cnt + while {[info exists used($cnt)]} {incr cnt} + set op($name) $cnt + set used($cnt) 1 + set def($cnt) $name + } +} + +# Generate the numeric values for remaining opcodes +# +for {set i 0} {$i<$nOp} {incr i} { + set name $order($i) + if {$op($name)<0} { + incr cnt + while {[info exists used($cnt)]} {incr cnt} + set op($name) $cnt + set used($cnt) 1 + set def($cnt) $name + } +} +set max $cnt +for {set i 1} {$i<=$nOp} {incr i} { + if {![info exists used($i)]} { + set def($i) "OP_NotUsed_$i" + } + set name $def($i) + puts -nonewline [format {#define %-16s %3d} $name $i] + set com {} + if {[info exists sameas($i)]} { + set com "same as $sameas($i)" + } + if {[info exists synopsis($name)]} { + set x $synopsis($name) + if {$com==""} { + set com "synopsis: $x" + } else { + append com ", synopsis: $x" + } + } + if {$com!=""} { + puts -nonewline [format " /* %-42s */" $com] + } + puts "" +} + +# Generate the bitvectors: +# +set bv(0) 0 +for {set i 1} {$i<=$max} {incr i} { + set name $def($i) + if {[info exists jump($name)] && $jump($name)} {set a0 1} {set a0 0} + if {[info exists in1($name)] && $in1($name)} {set a1 2} {set a1 0} + if {[info exists in2($name)] && $in2($name)} {set a2 4} {set a2 0} + if {[info exists in3($name)] && $in3($name)} {set a3 8} {set a3 0} + if {[info exists out2($name)] && $out2($name)} {set a4 16} {set a4 0} + if {[info exists out3($name)] && $out3($name)} {set a5 32} {set a5 0} + set bv($i) [expr {$a0+$a1+$a2+$a3+$a4+$a5}] +} +puts "" +puts "/* Properties such as \"out2\" or \"jump\" that are specified in" +puts "** comments following the \"case\" for each opcode in the vdbe.c" +puts "** are encoded into bitvectors as follows:" +puts "*/" +puts "#define OPFLG_JUMP 0x0001 /* jump: P2 holds jmp target */" +puts "#define OPFLG_IN1 0x0002 /* in1: P1 is an input */" +puts "#define OPFLG_IN2 0x0004 /* in2: P2 is an input */" +puts "#define OPFLG_IN3 0x0008 /* in3: P3 is an input */" +puts "#define OPFLG_OUT2 0x0010 /* out2: P2 is an output */" +puts "#define OPFLG_OUT3 0x0020 /* out3: P3 is an output */" +puts "#define OPFLG_INITIALIZER \173\\" +for {set i 0} {$i<=$max} {incr i} { + if {$i%8==0} { + puts -nonewline [format "/* %3d */" $i] + } + puts -nonewline [format " 0x%02x," $bv($i)] + if {$i%8==7} { + puts "\\" + } +} +puts "\175" ADDED tool/replace.tcl Index: tool/replace.tcl ================================================================== --- /dev/null +++ tool/replace.tcl @@ -0,0 +1,20 @@ +#!/usr/bin/tcl +# +# Replace string with another string -OR- include +# only lines successfully modified with a regular +# expression. +# +set mode [string tolower [lindex $argv 0]] +set from [lindex $argv 1] +set to [lindex $argv 2] +if {$mode ni [list exact include]} {exit 1} +if {[string length $from]==0} {exit 2} +while {![eof stdin]} { + set line [gets stdin] + if {[eof stdin]} break + switch -exact $mode { + exact {set line [string map [list $from $to] $line]} + include {if {[regsub -all -- $from $line $to line]==0} continue} + } + puts stdout $line +} DELETED tool/tostr.awk Index: tool/tostr.awk ================================================================== --- tool/tostr.awk +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/awk -# -# Convert input text into a C string -# -{ - gsub(/\\/,"\\\\"); - gsub(/\"/,"\\\""); - print "\"" $0 "\\n\""; -} ADDED tool/tostr.tcl Index: tool/tostr.tcl ================================================================== --- /dev/null +++ tool/tostr.tcl @@ -0,0 +1,12 @@ +#!/usr/bin/tcl +# +# Convert input text into a C string +# +set in [open [lindex $argv 0] rb] +while {![eof $in]} { + set line [gets $in] + if {[eof $in]} break; + set x [string map "\\\\ \\\\\\\\ \\\" \\\\\"" $line] + puts "\"$x\\n\"" +} +close $in