/ Check-in [e1838cee]
Login

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

Overview
Comment:Add support for including zlib in the shell when compiling with MSVC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sqlar-shell-support
Files: files | file ages | folders
SHA3-256: e1838cee3847301ef491467dc75d9c4e1e3b12599596c058bdb14319a52fd8a0
User & Date: mistachkin 2017-12-05 18:54:12
Context
2017-12-05
19:07
For MSVC, simplify default locations for Tcl and ICU by using directories inside 'compat'. check-in: 8155b5ac user: mistachkin tags: sqlar-shell-support
18:54
Add support for including zlib in the shell when compiling with MSVC. check-in: e1838cee user: mistachkin tags: sqlar-shell-support
18:32
If SQLITE_HAVE_ZLIB is defined at build-time, include the functions in ext/misc/compress.c in the shell. check-in: 0296286a user: dan tags: sqlar-shell-support
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added .fossil-settings/empty-dirs.

            1  +compat

Added .fossil-settings/ignore-glob.

            1  +compat/*

Changes to Makefile.msc.

    88     88   # be used for debugging with Visual Studio.
    89     89   #
    90     90   !IFNDEF SPLIT_AMALGAMATION
    91     91   SPLIT_AMALGAMATION = 0
    92     92   !ENDIF
    93     93   
    94     94   # <<mark>>
           95  +# Set this non-0 to use zlib, possibly compiling it from source code.
           96  +#
           97  +!IFNDEF USE_ZLIB
           98  +USE_ZLIB = 0
           99  +!ENDIF
          100  +
          101  +# Set this non-0 to build zlib from source code.  This is enabled by
          102  +# default and in that case it will be assumed that the ZLIBDIR macro
          103  +# points to the top-level source code directory for zlib.
          104  +#
          105  +!IFNDEF BUILD_ZLIB
          106  +BUILD_ZLIB = 1
          107  +!ENDIF
          108  +
    95    109   # Set this non-0 to use the International Components for Unicode (ICU).
    96    110   #
    97    111   !IFNDEF USE_ICU
    98    112   USE_ICU = 0
    99    113   !ENDIF
   100    114   # <</mark>>
   101    115   
................................................................................
   608    622   !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
   609    623   SHELL_CORE_DEP = $(SQLITE3DLL)
   610    624   !ELSE
   611    625   SHELL_CORE_DEP =
   612    626   !ENDIF
   613    627   !ENDIF
   614    628   
          629  +# <<mark>>
          630  +# If zlib support is enabled, add the shell dependency for it.
          631  +#
          632  +!IF $(USE_ZLIB)!=0 && $(BUILD_ZLIB)!=0
          633  +SHELL_CORE_DEP = zlib $(SHELL_CORE_DEP)
          634  +!ENDIF
          635  +# <</mark>>
          636  +
   615    637   # This is the core library that the shell executable should link with.
   616    638   #
   617    639   !IFNDEF SHELL_CORE_LIB
   618    640   !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
   619    641   SHELL_CORE_LIB = $(SQLITE3LIB)
   620    642   !ELSE
   621    643   SHELL_CORE_LIB =
................................................................................
   798    820   # <<mark>>
   799    821   # The locations of the Tcl header and library files.  Also, the library that
   800    822   # non-stubs enabled programs using Tcl must link against.  These variables
   801    823   # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
   802    824   # prior to running nmake in order to match the actual installed location and
   803    825   # version on this machine.
   804    826   #
          827  +!IFNDEF TCLDIR
          828  +TCLDIR = c:\tcl
          829  +!ENDIF
          830  +
   805    831   !IFNDEF TCLINCDIR
   806         -TCLINCDIR = c:\tcl\include
          832  +TCLINCDIR = $(TCLDIR)\include
   807    833   !ENDIF
   808    834   
   809    835   !IFNDEF TCLLIBDIR
   810         -TCLLIBDIR = c:\tcl\lib
          836  +TCLLIBDIR = $(TCLDIR)\lib
   811    837   !ENDIF
   812    838   
   813    839   !IFNDEF LIBTCL
   814    840   LIBTCL = tcl86.lib
   815    841   !ENDIF
   816    842   
   817    843   !IFNDEF LIBTCLSTUB
   818    844   LIBTCLSTUB = tclstub86.lib
   819    845   !ENDIF
   820    846   
   821    847   !IFNDEF LIBTCLPATH
   822         -LIBTCLPATH = c:\tcl\bin
          848  +LIBTCLPATH = $(TCLDIR)\bin
          849  +!ENDIF
          850  +
          851  +# The locations of the zlib header and library files.  These variables
          852  +# (ZLIBINCDIR, ZLIBLIBDIR, and ZLIBLIB) may be overridden via the environment
          853  +# prior to running nmake in order to match the actual installed (or source
          854  +# code) location on this machine.
          855  +#
          856  +!IFNDEF ZLIBDIR
          857  +ZLIBDIR = $(TOP)\compat\zlib
          858  +!ENDIF
          859  +
          860  +!IFNDEF ZLIBINCDIR
          861  +ZLIBINCDIR = $(ZLIBDIR)
          862  +!ENDIF
          863  +
          864  +!IFNDEF ZLIBLIBDIR
          865  +ZLIBLIBDIR = $(ZLIBDIR)
          866  +!ENDIF
          867  +
          868  +!IFNDEF ZLIBLIB
          869  +!IF $(DYNAMIC_SHELL)!=0
          870  +ZLIBLIB = zdll.lib
          871  +!ELSE
          872  +ZLIBLIB = zlib.lib
          873  +!ENDIF
   823    874   !ENDIF
   824    875   
   825    876   # The locations of the ICU header and library files.  These variables
   826    877   # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment
   827    878   # prior to running nmake in order to match the actual installed location on
   828    879   # this machine.
   829    880   #
          881  +!IFNDEF ICUDIR
          882  +ICUDIR = C:\icu
          883  +!ENDIF
          884  +
   830    885   !IFNDEF ICUINCDIR
   831         -ICUINCDIR = c:\icu\include
          886  +ICUINCDIR = $(ICUDIR)\include
   832    887   !ENDIF
   833    888   
   834    889   !IFNDEF ICULIBDIR
   835         -ICULIBDIR = c:\icu\lib
          890  +ICULIBDIR = $(ICUDIR)\lib
   836    891   !ENDIF
   837    892   
   838    893   !IFNDEF LIBICU
   839    894   LIBICU = icuuc.lib icuin.lib
   840    895   !ENDIF
   841    896   
   842    897   # This is the command to use for tclsh - normally just "tclsh", but we may
................................................................................
   947   1002   #
   948   1003   !IF $(DEBUG)>1 || $(SYMBOLS)!=0
   949   1004   TCC = $(TCC) -Zi
   950   1005   BCC = $(BCC) -Zi
   951   1006   !ENDIF
   952   1007   
   953   1008   # <<mark>>
         1009  +# If zlib support is enabled, add the compiler options for it.
         1010  +#
         1011  +!IF $(USE_ZLIB)!=0
         1012  +TCC = $(TCC) -DSQLITE_HAVE_ZLIB=1
         1013  +RCC = $(RCC) -DSQLITE_HAVE_ZLIB=1
         1014  +TCC = $(TCC) -I$(ZLIBINCDIR)
         1015  +RCC = $(RCC) -I$(ZLIBINCDIR)
         1016  +!ENDIF
         1017  +
   954   1018   # If ICU support is enabled, add the compiler options for it.
   955   1019   #
   956   1020   !IF $(USE_ICU)!=0
   957   1021   TCC = $(TCC) -DSQLITE_ENABLE_ICU=1
   958   1022   RCC = $(RCC) -DSQLITE_ENABLE_ICU=1
   959   1023   TCC = $(TCC) -I$(TOP)\ext\icu
   960   1024   RCC = $(RCC) -I$(TOP)\ext\icu
................................................................................
  1070   1134   # <<mark>>
  1071   1135   # Start with the Tcl related linker options.
  1072   1136   #
  1073   1137   !IF $(NO_TCL)==0
  1074   1138   LTLIBPATHS = /LIBPATH:$(TCLLIBDIR)
  1075   1139   LTLIBS = $(LTLIBS) $(LIBTCL)
  1076   1140   !ENDIF
         1141  +
         1142  +# If zlib support is enabled, add the linker options for it.
         1143  +#
         1144  +!IF $(USE_ZLIB)!=0
         1145  +LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ZLIBLIBDIR)
         1146  +LTLIBS = $(LTLIBS) $(ZLIBLIB)
         1147  +!ENDIF
  1077   1148   
  1078   1149   # If ICU support is enabled, add the linker options for it.
  1079   1150   #
  1080   1151   !IF $(USE_ICU)!=0
  1081   1152   LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
  1082   1153   LTLIBS = $(LTLIBS) $(LIBICU)
  1083   1154   !ENDIF
................................................................................
  1983   2054   	$(TOP)\ext\misc\shathree.c \
  1984   2055   	$(TOP)\ext\misc\fileio.c \
  1985   2056   	$(TOP)\ext\misc\completion.c
  1986   2057   
  1987   2058   shell.c:	$(SHELL_SRC) $(TOP)\tool\mkshellc.tcl
  1988   2059   	$(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl > shell.c
  1989   2060   
         2061  +zlib:
         2062  +	pushd $(ZLIBDIR) && $(MAKE) /f win32\Makefile.msc $(ZLIBLIB) && popd
  1990   2063   
  1991   2064   # Rules to build the extension objects.
  1992   2065   #
  1993   2066   icu.lo:	$(TOP)\ext\icu\icu.c $(HDR) $(EXTHDR)
  1994   2067   	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\icu\icu.c
  1995   2068   
  1996   2069   fts2.lo:	$(TOP)\ext\fts2\fts2.c $(HDR) $(EXTHDR)

Changes to autoconf/Makefile.msc.

   556    556   !IFNDEF SHELL_CORE_DEP
   557    557   !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
   558    558   SHELL_CORE_DEP = $(SQLITE3DLL)
   559    559   !ELSE
   560    560   SHELL_CORE_DEP =
   561    561   !ENDIF
   562    562   !ENDIF
          563  +
   563    564   
   564    565   # This is the core library that the shell executable should link with.
   565    566   #
   566    567   !IFNDEF SHELL_CORE_LIB
   567    568   !IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
   568    569   SHELL_CORE_LIB = $(SQLITE3LIB)
   569    570   !ELSE