Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch omit-awk Excluding Merge-Ins
This is equivalent to a diff from 0abd65294e to 6d9cdb931c
2015-10-14
| ||
20:03 | Update makefiles to remove all uses of "awk" - to make building SQLite easier on Windows systems. The only requirements now are tclsh, a C compiler, and common file utilities. (check-in: 4bd0d43db7 user: drh tags: trunk) | |
2015-10-12
| ||
03:56 | Remove AWK requirement from the MSVC batch build tool. (Closed-Leaf check-in: 6d9cdb931c user: mistachkin tags: omit-awk) | |
03:44 | The TclKit batch tool should not download the TclKit SDK when the TCLKIT_NOSDK environment variable is set. (check-in: 7c5d583bac user: mistachkin tags: omit-awk) | |
2015-10-07
| ||
03:07 | When running tests on Tcl 8.6 under Windows, skip tests 'uri-1.12.*' due to a change in Tcl behavior related to NTFS ADS (alternate data streams). (check-in: 8a0a2aa5a6 user: mistachkin tags: trunk) | |
02:52 | Change mkopcodeh.awk into tool/mkopcodeh.tcl. (check-in: ed0ebc460b user: drh tags: omit-awk) | |
00:35 | Remove three obsolete and unused files from tool/ (check-in: 0abd65294e user: drh tags: trunk) | |
2015-10-06
| ||
21:49 | Fix typo in comments. No changes to code. (check-in: a05f903c64 user: mistachkin tags: trunk) | |
Deleted Makefile.arm-wince-mingw32ce-gcc.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Makefile.in.
︙ | ︙ | |||
151 152 153 154 155 156 157 | ALLOWRELEASE = @ALLOWRELEASE@ # 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) | < < < | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | ALLOWRELEASE = @ALLOWRELEASE@ # 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) # You should not have to change anything below this line ############################################################################### USE_AMALGAMATION = @USE_AMALGAMATION@ # Object files for the SQLite library (non-amalgamation). # |
︙ | ︙ | |||
895 896 897 898 899 900 901 | tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la $(LTLINK) -o $@ tclsqlite-shell.lo \ libsqlite3.la $(LIBTCL) # Rules to build opcodes.c and opcodes.h # | | | | | | | | 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la $(LTLINK) -o $@ tclsqlite-shell.lo \ libsqlite3.la $(LIBTCL) # 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.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)/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 $(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 $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c ./mkkeywordhash$(BEXE) >keywordhash.h |
︙ | ︙ | |||
1092 1093 1094 1095 1096 1097 1098 | sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl 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 = " >> $@ | | | 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl 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 = " >> $@ $(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) showdb$(TEXE): $(TOP)/tool/showdb.c sqlite3.lo $(LTLINK) -o $@ $(TOP)/tool/showdb.c sqlite3.lo $(TLIBS) |
︙ | ︙ |
Changes to Makefile.linux-gcc.
︙ | ︙ | |||
114 115 116 117 118 119 120 | #READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline #### Linker options needed by programs using readline() must link against. # LIBREADLINE = #LIBREADLINE = -static -lreadline -ltermcap | < < < < < | 114 115 116 117 118 119 120 121 122 123 | #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 |
Changes to Makefile.msc.
︙ | ︙ | |||
564 565 566 567 568 569 570 571 572 573 574 575 576 577 | !IFNDEF TCLLIBDIR TCLLIBDIR = c:\tcl\lib !ENDIF !IFNDEF LIBTCL LIBTCL = tcl85.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. # !IFNDEF ICUINCDIR | > > > > | 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | !IFNDEF TCLLIBDIR TCLLIBDIR = c:\tcl\lib !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. # !IFNDEF ICUINCDIR |
︙ | ︙ | |||
805 806 807 808 809 810 811 | # If ICU support is enabled, add the linker options for it. # !IF $(USE_ICU)!=0 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR) LTLIBS = $(LTLIBS) $(LIBICU) !ENDIF | < < < < < < | 809 810 811 812 813 814 815 816 817 818 819 820 821 822 | # If ICU support is enabled, add the linker options for it. # !IF $(USE_ICU)!=0 LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR) LTLIBS = $(LTLIBS) $(LIBICU) !ENDIF # You should not have to change anything below this line ############################################################################### # Object files for the SQLite library (non-amalgamation). # LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ |
︙ | ︙ | |||
1225 1226 1227 1228 1229 1230 1231 | # all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib libsqlite3.lib: $(LIBOBJ) $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib | | | 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 | # all: dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib libsqlite3.lib: $(LIBOBJ) $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib $(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) sqldiff.exe: $(TOP)\tool\sqldiff.c sqlite3.c sqlite3.h $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c sqlite3.c |
︙ | ︙ | |||
1327 1328 1329 1330 1331 1332 1333 | # Rule to build the Win32 resources object file. # !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 \ | | | 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 | # Rule to build the Win32 resources object file. # !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 \ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \ ) echo #endif >> sqlite3rc.h $(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc !ENDIF # Rules to build individual *.lo files from files in the src directory. # |
︙ | ︙ | |||
1568 1569 1570 1571 1572 1573 1574 | $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c 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 # | | | | | | | | 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 | $(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c 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)\tool\mkopcodec.tcl $(TCLSH_CMD) $(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 # 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)\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 $(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 copy tsrc\sqlite3ext.h . |
︙ | ︙ | |||
1770 1771 1772 1773 1774 1775 1776 | sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl 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 = >> $@ | | | 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 | sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl 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 = >> $@ $(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) testloadext.lo: $(TOP)\src\test_loadext.c |
︙ | ︙ | |||
1854 1855 1856 1857 1858 1859 1860 | # Dynamic link library section. # dll: sqlite3.dll sqlite3.def: libsqlite3.lib echo EXPORTS > sqlite3.def dumpbin /all libsqlite3.lib \ | | | 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 | # Dynamic link library section. # dll: sqlite3.dll sqlite3.def: libsqlite3.lib echo EXPORTS > sqlite3.def dumpbin /all libsqlite3.lib \ | $(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.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted addopcodes.awk.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to configure.
︙ | ︙ | |||
799 800 801 802 803 804 805 | BUILD_CC VERSION_NUMBER RELEASE VERSION program_prefix TCLLIBDIR TCLSH_CMD | < | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | BUILD_CC VERSION_NUMBER RELEASE VERSION program_prefix TCLLIBDIR TCLSH_CMD INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM CPP OTOOL64 OTOOL LIPO |
︙ | ︙ | |||
3907 3908 3909 3910 3911 3912 3913 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } 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 | | | | | 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } 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:3913: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&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: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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 |
︙ | ︙ | |||
5119 5120 5121 5122 5123 5124 5125 | ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. | | | 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 | ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. 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 if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in |
︙ | ︙ | |||
6644 6645 6646 6647 6648 6649 6650 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # 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:'` | | | | 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # 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:6650: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&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 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes |
︙ | ︙ | |||
6983 6984 6985 6986 6987 6988 6989 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # 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:'` | | | | 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # 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:6989: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&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 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes |
︙ | ︙ | |||
7088 7089 7090 7091 7092 7093 7094 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # 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:'` | | | | 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # 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:7094: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&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 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then |
︙ | ︙ | |||
7143 7144 7145 7146 7147 7148 7149 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # 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:'` | | | | 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # 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:7149: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&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 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then |
︙ | ︙ | |||
9523 9524 9525 9526 9527 9528 9529 | else if test "$cross_compiling" = yes; then : 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 | | | 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 | else if test "$cross_compiling" = yes; then : 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 9529 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> |
︙ | ︙ | |||
9619 9620 9621 9622 9623 9624 9625 | else if test "$cross_compiling" = yes; then : 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 | | | 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 | else if test "$cross_compiling" = yes; then : 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 9625 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> |
︙ | ︙ | |||
9939 9940 9941 9942 9943 9944 9945 | # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 | # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ######### # Enable large file support (if special flags are necessary) # # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; |
︙ | ︙ | |||
11881 11882 11883 11884 11885 11886 11887 | Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' | < | 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 | Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' 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. ac_need_defaults=: while test $# != 0 |
︙ | ︙ |
Changes to configure.ac.
︙ | ︙ | |||
86 87 88 89 90 91 92 | fi ######### # Programs needed # AC_PROG_LIBTOOL AC_PROG_INSTALL | < | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | fi ######### # Programs needed # AC_PROG_LIBTOOL AC_PROG_INSTALL ######### # Enable large file support (if special flags are necessary) # AC_SYS_LARGEFILE ######### |
︙ | ︙ |
Changes to main.mk.
︙ | ︙ | |||
31 32 33 34 35 36 37 | # # READLINE_FLAGS Compiler options needed for programs that use the # readline() library. # # LIBREADLINE Linker options needed by programs using readline() must # link against. # | < < < | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # # READLINE_FLAGS Compiler options needed for programs that use the # readline() library. # # LIBREADLINE Linker options needed by programs using readline() must # link against. # # 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) |
︙ | ︙ | |||
575 576 577 578 579 580 581 | tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR) $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c # Rules to build opcodes.c and opcodes.h # | | | | | | | | 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR) $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c # Rules to build opcodes.c and opcodes.h # 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)/tool/mkopcodeh.tcl cat parse.h $(TOP)/src/vdbe.c | \ 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)/tool/addopcodes.tcl cp $(TOP)/src/parse.y . rm -f parse.h ./lemon -s $(OPTS) parse.y mv parse.h parse.h.temp 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 $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c ./mkkeywordhash >keywordhash.h |
︙ | ︙ | |||
697 698 699 700 701 702 703 | sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl 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 = " >> $@ | | | 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 | sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl 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 = " >> $@ 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) # Rules to build the 'testfixture' application. # |
︙ | ︙ |
Deleted mkopcodec.awk.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted mkopcodeh.awk.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added tool/GetFile.cs.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | /* ** 2015 October 7 ** ** 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 C# code to download a single file based on a URI. */ using System; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Net; using System.Reflection; using System.Runtime.InteropServices; using System.Threading; /////////////////////////////////////////////////////////////////////////////// #region Assembly Metadata [assembly: AssemblyTitle("GetFile Tool")] [assembly: AssemblyDescription("Download a single file based on a URI.")] [assembly: AssemblyCompany("SQLite Development Team")] [assembly: AssemblyProduct("SQLite")] [assembly: AssemblyCopyright("Public Domain")] [assembly: ComVisible(false)] [assembly: Guid("5c4b3728-1693-4a33-a218-8e6973ca15a6")] [assembly: AssemblyVersion("1.0.*")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif #endregion /////////////////////////////////////////////////////////////////////////////// namespace GetFile { /// <summary> /// This enumeration is used to represent all the possible exit codes from /// this tool. /// </summary> internal enum ExitCode { /// <summary> /// The file download was a success. /// </summary> Success = 0, /// <summary> /// The command line arguments are missing (i.e. null). Generally, /// this should not happen. /// </summary> MissingArgs = 1, /// <summary> /// The wrong number of command line arguments was supplied. /// </summary> WrongNumArgs = 2, /// <summary> /// The URI specified on the command line could not be parsed as a /// supported absolute URI. /// </summary> BadUri = 3, /// <summary> /// The file name portion of the URI specified on the command line /// could not be extracted from it. /// </summary> BadFileName = 4, /// <summary> /// The temporary directory is either invalid (i.e. null) or does not /// represent an available directory. /// </summary> BadTempPath = 5, /// <summary> /// An exception was caught in <see cref="Main" />. Generally, this /// should not happen. /// </summary> Exception = 6, /// <summary> /// The file download was canceled. This tool does not make use of /// the <see cref="WebClient.CancelAsync" /> method; therefore, this /// should not happen. /// </summary> DownloadCanceled = 7, /// <summary> /// The file download encountered an error. Further information about /// this error should be displayed on the console. /// </summary> DownloadError = 8 } /////////////////////////////////////////////////////////////////////////// internal static class Program { #region Private Data /// <summary> /// This is used to synchronize multithreaded access to the /// <see cref="previousPercent" /> and <see cref="exitCode"/> /// fields. /// </summary> private static readonly object syncRoot = new object(); /////////////////////////////////////////////////////////////////////// /// <summary> /// This event will be signed when the file download has completed, /// even if the file download itself was canceled or unsuccessful. /// </summary> private static EventWaitHandle doneEvent; /////////////////////////////////////////////////////////////////////// /// <summary> /// The previous file download completion percentage seen by the /// <see cref="DownloadProgressChanged" /> event handler. This value /// is never decreased, nor is it ever reset to zero. /// </summary> private static int previousPercent = 0; /////////////////////////////////////////////////////////////////////// /// <summary> /// 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 <see cref="DownloadFileCompleted" /> event handler. /// </summary> private static ExitCode exitCode = ExitCode.Success; #endregion /////////////////////////////////////////////////////////////////////// #region Private Support Methods /// <summary> /// This method displays an error message to the console and/or /// displays the command line usage information for this tool. /// </summary> /// <param name="message"> /// The error message to display, if any. /// </param> /// <param name="usage"> /// Non-zero to display the command line usage information. /// </param> 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} <uri>", fileName)); } /////////////////////////////////////////////////////////////////////// /// <summary> /// This method attempts to determine the file name portion of the /// specified URI. /// </summary> /// <param name="uri"> /// The URI to process. /// </param> /// <returns> /// The file name portion of the specified URI -OR- null if it cannot /// be determined. /// </returns> 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 /// <summary> /// 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. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// Information for the event being processed. /// </param> 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; } } } } /////////////////////////////////////////////////////////////////////// /// <summary> /// 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 <see cref="Exception" /> information, if applicable. /// The <see cref="exitCode" /> field is changed by this method to /// indicate the overall result of the file download and the event /// within the <see cref="doneEvent" /> field will be signaled. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// Information for the event being processed. /// </param> 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 /// <summary> /// 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. /// </summary> /// <param name="args"> /// The command line arguments. /// </param> /// <returns> /// Zero upon success; non-zero on failure. This will be one of the /// values from the <see cref="ExitCode" /> enumeration. /// </returns> 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.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 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 ^<processor^> 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.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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] } |
Changes to tool/build-all-msvc.bat.
︙ | ︙ | |||
25 26 27 28 29 30 31 | REM tool\build-all-msvc.bat C:\Temp REM 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 | | | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | REM tool\build-all-msvc.bat C:\Temp REM 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 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 REM x86_arm^). All platforms must be supported by the version of Visual Studio REM being used. The list of configurations to build may be overridden by |
︙ | ︙ | |||
228 229 230 231 232 233 234 | %_VECHO% x86_x64_Name = '%x86_x64_NAME%' 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 | > > > > > > | | | | | < < < < < < < < < | | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | %_VECHO% x86_x64_Name = '%x86_x64_NAME%' 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 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: 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 CALL :fn_CopyVariable %TCLSH_FILE%_PATH TOOLPATH %_VECHO% ToolPath = '%TOOLPATH%' REM REM NOTE: Setting the Windows SDK library path is only required for MSVC REM 2012, 2013, and 2015. REM |
︙ | ︙ |
Added tool/mkopcodec.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 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.
> > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 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.
|
| < < < < < < < < < |
Added tool/tostr.tcl.
> > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 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 |