/ Check-in [eb5da5e1]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Update MSVC makefile to allow targets to be built with support for ICU.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eb5da5e1dbe9c198095036827318fb381441cbd0
User & Date: mistachkin 2011-10-02 05:23:16
Context
2011-10-04
11:22
Add experimental 'content' option to FTS4. check-in: 1d27ea74 user: dan tags: fts4-content
2011-10-03
15:30
Merge the STAT3 changes into trunk. check-in: 774d0842 user: drh tags: trunk
2011-10-02
05:23
Update MSVC makefile to allow targets to be built with support for ICU. check-in: eb5da5e1 user: mistachkin tags: trunk
2011-09-30
12:01
Disable the xfer optimization if "PRAGMA count_changes=1" is configured. Ticket [c48d99d690]. check-in: 9ddfe1e4 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

     6      6   # that contains this "Makefile.msc".
     7      7   #
     8      8   TOP = .
     9      9   
    10     10   # Set this non-0 to create and use the SQLite amalgamation file.
    11     11   #
    12     12   USE_AMALGAMATION = 1
           13  +
           14  +# Set this non-0 to use the International Components for Unicode (ICU).
           15  +#
           16  +USE_ICU = 0
    13     17   
    14     18   # Set this to non-0 to create and use PDBs.
    15     19   #
    16     20   SYMBOLS = 1
    17     21   
    18     22   # Set this to one of the following values to enable various debugging
    19     23   # features.  Each level includes the debugging options from the previous
................................................................................
    27     31   # 5 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros.
    28     32   #
    29     33   DEBUG = 0
    30     34   
    31     35   # Version numbers and release number for the SQLite being compiled.
    32     36   #
    33     37   VERSION = 3.7
    34         -VERSION_NUMBER = 3007008
    35         -RELEASE = 3.7.8
           38  +VERSION_NUMBER = 3007009
           39  +RELEASE = 3.7.9
    36     40   
    37     41   # C Compiler and options for use in building executables that
    38     42   # will run on the platform that is doing the build.
    39     43   #
    40     44   BCC = cl.exe
    41     45   
    42     46   # C Compile and options for use in building executables that
................................................................................
   104    108   !if "$(TCLLIBDIR)" == ""
   105    109   TCLLIBDIR = c:\tcl\lib
   106    110   !endif
   107    111   
   108    112   !if "$(LIBTCL)" == ""
   109    113   LIBTCL = tcl85.lib
   110    114   !endif
          115  +
          116  +# The locations of the ICU header and library files.  These variables
          117  +# (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
          118  +# prior to running nmake in order to match the actual installed location on
          119  +# this machine.
          120  +#
          121  +!if "$(ICUINCDIR)" == ""
          122  +ICUINCDIR = c:\icu\include
          123  +!endif
          124  +
          125  +!if "$(ICULIBDIR)" == ""
          126  +ICULIBDIR = c:\icu\lib
          127  +!endif
          128  +
          129  +!if "$(LIBICU)" == ""
          130  +LIBICU = icuuc.lib icuin.lib
          131  +!endif
   111    132   
   112    133   # This is the command to use for tclsh - normally just "tclsh", but we may
   113    134   # know the specific version we want to use.  This variable (TCLSH_CMD) may be
   114    135   # overridden via the environment prior to running nmake in order to select a
   115    136   # specific Tcl shell to use.
   116    137   #
   117    138   !if "$(TCLSH_CMD)" == ""
................................................................................
   132    153   
   133    154   # Do threads override each others locks by default (1), or do we test (-1)
   134    155   #
   135    156   TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1
   136    157   
   137    158   # Any target libraries which libsqlite must be linked against
   138    159   #
          160  +!if "$(TLIBS)" == ""
   139    161   TLIBS =
          162  +!endif
   140    163   
   141    164   # Flags controlling use of the in memory btree implementation
   142    165   #
   143    166   # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
   144    167   # default to file, 2 to default to memory, and 3 to force temporary
   145    168   # tables to always be in memory.
   146    169   #
................................................................................
   174    197   !ELSE
   175    198   TCC = $(TCC) -O2
   176    199   !ENDIF
   177    200   
   178    201   !IF $(DEBUG)>0 || $(SYMBOLS)!=0
   179    202   TCC = $(TCC) -Zi
   180    203   !ENDIF
          204  +
          205  +# If ICU support is enabled, add the compiler options for it.
          206  +!IF $(USE_ICU)!=0
          207  +TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
          208  +TCC = $(TCC) -I$(TOP)\ext\icu
          209  +TCC = $(TCC) -I$(ICUINCDIR)
          210  +!ENDIF
   181    211   
   182    212   # libtool compile/link
   183    213   LTCOMPILE = $(TCC) -Fo$@
   184    214   LTLIB = lib.exe
   185    215   LTLINK = $(TCC) -Fe$@
   186    216   
   187    217   # If a platform was set, force the linker to target that.
................................................................................
   193    223   LTLIBOPTS = /MACHINE:$(PLATFORM)
   194    224   !ENDIF
   195    225   
   196    226   # If debugging is enabled, enable PDBs.
   197    227   !IF $(DEBUG)>0 || $(SYMBOLS)!=0
   198    228   LTLINKOPTS = $(LTLINKOPTS) /DEBUG
   199    229   !ENDIF
          230  +
          231  +# Start with the Tcl related linker options.
          232  +LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
          233  +LTLIBS = $(LIBTCL)
          234  +
          235  +# If ICU support is enabled, add the linker options for it.
          236  +!IF $(USE_ICU)!=0
          237  +LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
          238  +LTLIBS = $(LTLIBS) $(LIBICU)
          239  +!ENDIF
   200    240   
   201    241   # nawk compatible awk.
   202    242   NAWK = gawk.exe
   203    243   
   204    244   # You should not have to change anything below this line
   205    245   ###############################################################################
   206    246   
................................................................................
   524    564   #
   525    565   all:	dll libsqlite3.lib sqlite3.exe libtclsqlite3.lib
   526    566   
   527    567   libsqlite3.lib:	$(LIBOBJ)
   528    568   	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
   529    569   
   530    570   libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
   531         -	$(LTLIB) $(LTLIBOPTS) /LIBPATH:$(TCLLIBDIR) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
          571  +	$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)
   532    572   
   533    573   sqlite3.exe:	$(TOP)\src\shell.c libsqlite3.lib sqlite3.h
   534    574   	$(LTLINK) $(READLINE_FLAGS) \
   535    575   		$(TOP)\src\shell.c \
   536         -		/link $(LTLINKOPTS) libsqlite3.lib $(LIBREADLINE) $(TLIBS)
          576  +		/link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBREADLINE) $(LTLIBS) $(TLIBS)
   537    577   
   538    578   # This target creates a directory named "tsrc" and fills it with
   539    579   # copies of all of the C source code and header files needed to
   540    580   # build on the target system.  Some of the C source code and header
   541    581   # files are automatically generated.  This target takes care of
   542    582   # all that automatic generation.
   543    583   #
................................................................................
   800    840   	$(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
   801    841   
   802    842   tclsqlite-shell.lo:	$(TOP)\src\tclsqlite.c $(HDR)
   803    843   	$(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
   804    844   
   805    845   tclsqlite3.exe:	tclsqlite-shell.lo libsqlite3.lib
   806    846   	$(LTLINK) tclsqlite-shell.lo \
   807         -		/link $(LTLINKOPTS) /LIBPATH:$(TCLLIBDIR) libsqlite3.lib $(LIBTCL)
          847  +		/link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LTLIBS) $(TLIBS)
   808    848   
   809    849   # Rules to build opcodes.c and opcodes.h
   810    850   #
   811    851   opcodes.c:	opcodes.h $(TOP)\mkopcodec.awk
   812    852   	$(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c
   813    853   
   814    854   opcodes.h:	parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk
................................................................................
   911    951   TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
   912    952   !ENDIF
   913    953   
   914    954   testfixture.exe:	$(TESTFIXTURE_SRC) $(HDR)
   915    955   	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
   916    956   		-DBUILD_sqlite -I$(TCLINCDIR) \
   917    957   		$(TESTFIXTURE_SRC) \
   918         -		/link $(LTLINKOPTS) /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)
          958  +		/link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS)
   919    959   
   920    960   fulltest:	testfixture.exe sqlite3.exe
   921    961   	.\testfixture.exe $(TOP)\test\all.test
   922    962   
   923    963   soaktest:	testfixture.exe sqlite3.exe
   924    964   	.\testfixture.exe $(TOP)\test\all.test -soak=1
   925    965   
................................................................................
   931    971   	echo static const char *tclsh_main_loop(void){ >> $@
   932    972   	echo static const char *zMainloop = >> $@
   933    973   	$(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
   934    974   	echo ; return zMainloop; } >> $@
   935    975   
   936    976   sqlite3_analyzer.exe:	sqlite3_analyzer.c
   937    977   	$(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
   938         -		/link $(LTLINKOPTS) /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)
          978  +		/link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS)
   939    979   
   940    980   clean:
   941    981   	del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
   942    982   	del /Q sqlite3.h opcodes.c opcodes.h
   943    983   	del /Q lemon.exe lempar.c parse.*
   944    984   	del /Q mkkeywordhash.exe keywordhash.h
   945    985   	-rmdir /Q/S tsrc
................................................................................
   958    998   sqlite3.def: libsqlite3.lib
   959    999   	echo EXPORTS > sqlite3.def
   960   1000   	dumpbin /all libsqlite3.lib \
   961   1001   		| $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \
   962   1002   		| sort >> sqlite3.def
   963   1003   
   964   1004   sqlite3.dll: $(LIBOBJ) sqlite3.def
   965         -	link $(LTLINKOPTS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ)
         1005  +	link $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:$@ $(LIBOBJ) $(LTLIBS) $(TLIBS)