/ Check-in [f8c2193b]
Login

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

Overview
Comment:Fix typo in the MSVC makefile. Replace remaining uses of AWK in the MSVC makefile with a Tcl script.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | omit-awk
Files: files | file ages | folders
SHA1:f8c2193b64979a2fe480fcf913573b5fac06235e
User & Date: mistachkin 2015-10-10 01:55:57
Context
2015-10-10
02:06
Remove a couple superfluous double quotes in the MSVC makefile. check-in: 0f9e205b user: mistachkin tags: omit-awk
01:55
Fix typo in the MSVC makefile. Replace remaining uses of AWK in the MSVC makefile with a Tcl script. check-in: f8c2193b user: mistachkin tags: omit-awk
00:53
More fine-tuning to the new TclKit tools. check-in: 43addd8a user: mistachkin tags: omit-awk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

   805    805   # If ICU support is enabled, add the linker options for it.
   806    806   #
   807    807   !IF $(USE_ICU)!=0
   808    808   LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
   809    809   LTLIBS = $(LTLIBS) $(LIBICU)
   810    810   !ENDIF
   811    811   
   812         -# nawk compatible awk.
   813         -#
   814         -!IFNDEF NAWK
   815         -NAWK = gawk.exe
   816         -!ENDIF
   817         -
   818    812   # You should not have to change anything below this line
   819    813   ###############################################################################
   820    814   
   821    815   # Object files for the SQLite library (non-amalgamation).
   822    816   #
   823    817   LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
   824    818            backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
................................................................................
  1327   1321   # Rule to build the Win32 resources object file.
  1328   1322   #
  1329   1323   !IF $(USE_RC)!=0
  1330   1324   $(LIBRESOBJS):	$(TOP)\src\sqlite3.rc $(HDR)
  1331   1325   	echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
  1332   1326   	for /F %%V in ('type "$(TOP)\VERSION"') do ( \
  1333   1327   		echo #define SQLITE_RESOURCE_VERSION %%V \
  1334         -			| $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3rc.h \
         1328  +			| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact . ^, >> sqlite3rc.h \
  1335   1329   	)
  1336   1330   	echo #endif >> sqlite3rc.h
  1337   1331   	$(LTRCOMPILE) -fo $(LIBRESOBJS) $(TOP)\src\sqlite3.rc
  1338   1332   !ENDIF
  1339   1333   
  1340   1334   # Rules to build individual *.lo files from files in the src directory.
  1341   1335   #
................................................................................
  1572   1566   
  1573   1567   # Rules to build opcodes.c and opcodes.h
  1574   1568   #
  1575   1569   opcodes.c:	opcodes.h $(TOP)\tool\mkopcodec.tcl
  1576   1570   	$(TCLSH_CMD) $(TOP)\tool\mkopcodec.tcl opcodes.h > opcodes.c
  1577   1571   
  1578   1572   opcodes.h:	parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
  1579         -	type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.awk > opcodes.h
         1573  +	type parse.h $(TOP)\src\vdbe.c | $(TCLSH_CMD) $(TOP)\tool\mkopcodeh.tcl > opcodes.h
  1580   1574   
  1581   1575   # Rules to build parse.c and parse.h - the outputs of lemon.
  1582   1576   #
  1583   1577   parse.h:	parse.c
  1584   1578   
  1585   1579   parse.c:	$(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
  1586   1580   	del /Q parse.y parse.h parse.h.temp 2>NUL
................................................................................
  1854   1848   # Dynamic link library section.
  1855   1849   #
  1856   1850   dll: sqlite3.dll
  1857   1851   
  1858   1852   sqlite3.def: libsqlite3.lib
  1859   1853   	echo EXPORTS > sqlite3.def
  1860   1854   	dumpbin /all libsqlite3.lib \
  1861         -		| $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
         1855  +		| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_.*)$$" "\1" \
  1862   1856   		| sort >> sqlite3.def
  1863   1857   
  1864   1858   sqlite3.dll: $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
  1865   1859   	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)

Added tool/replace.tcl.

            1  +#!/usr/bin/tcl
            2  +#
            3  +# Replace string with another string -OR- include
            4  +# only lines successfully modified with a regular
            5  +# expression.
            6  +#
            7  +set mode [string tolower [lindex $argv 0]]
            8  +set from [lindex $argv 1]
            9  +set to [lindex $argv 2]
           10  +if {$mode ni [list exact include]} {exit 1}
           11  +if {[string length $from]==0} {exit 2}
           12  +while {![eof stdin]} {
           13  +  set line [gets stdin]
           14  +  if {[eof stdin]} break
           15  +  switch -exact $mode {
           16  +    exact {set line [string map [list $from $to] $line]}
           17  +    include {if {[regsub -all -- $from $line $to line]==0} continue}
           18  +  }
           19  +  puts stdout $line
           20  +}