Fossil SCM

Replaced zlib usage with local copy of miniz. Seems to work.

stephan 2014-08-18 17:13 miniz
Commit 579ae389cef4cd6390f0d93a26229c4419c2f03a
+10 -10
--- auto.def
+++ auto.def
@@ -229,20 +229,20 @@
229229
user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
230230
}
231231
}
232232
233233
# Check for zlib, using the given location if specified
234
-set zlibpath [opt-val with-zlib]
235
-if {$zlibpath ne ""} {
236
- cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
237
- define-append EXTRA_CFLAGS -I$zlibpath
238
- define-append EXTRA_LDFLAGS -L$zlibpath
239
- msg-result "Using zlib from $zlibpath"
240
-}
241
-if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
242
- user-error "zlib not found please install it or specify the location with --with-zlib"
243
-}
234
+#set zlibpath [opt-val with-zlib]
235
+#if {$zlibpath ne ""} {
236
+# cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
237
+# define-append EXTRA_CFLAGS -I$zlibpath
238
+# define-append EXTRA_LDFLAGS -L$zlibpath
239
+# msg-result "Using zlib from $zlibpath"
240
+#}
241
+#if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
242
+# user-error "zlib not found please install it or specify the location with --with-zlib"
243
+#}
244244
245245
if {[opt-bool lineedit]} {
246246
# Need readline-compatible line editing
247247
cc-with {-includes stdio.h} {
248248
if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
249249
--- auto.def
+++ auto.def
@@ -229,20 +229,20 @@
229 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
230 }
231 }
232
233 # Check for zlib, using the given location if specified
234 set zlibpath [opt-val with-zlib]
235 if {$zlibpath ne ""} {
236 cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
237 define-append EXTRA_CFLAGS -I$zlibpath
238 define-append EXTRA_LDFLAGS -L$zlibpath
239 msg-result "Using zlib from $zlibpath"
240 }
241 if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
242 user-error "zlib not found please install it or specify the location with --with-zlib"
243 }
244
245 if {[opt-bool lineedit]} {
246 # Need readline-compatible line editing
247 cc-with {-includes stdio.h} {
248 if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
249
--- auto.def
+++ auto.def
@@ -229,20 +229,20 @@
229 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
230 }
231 }
232
233 # Check for zlib, using the given location if specified
234 #set zlibpath [opt-val with-zlib]
235 #if {$zlibpath ne ""} {
236 # cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
237 # define-append EXTRA_CFLAGS -I$zlibpath
238 # define-append EXTRA_LDFLAGS -L$zlibpath
239 # msg-result "Using zlib from $zlibpath"
240 #}
241 #if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
242 # user-error "zlib not found please install it or specify the location with --with-zlib"
243 #}
244
245 if {[opt-bool lineedit]} {
246 # Need readline-compatible line editing
247 cc-with {-includes stdio.h} {
248 if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
249
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -17,11 +17,11 @@
1717
**
1818
** A Blob is a variable-length containers for arbitrary string
1919
** or binary data.
2020
*/
2121
#include "config.h"
22
-#include <zlib.h>
22
+#include "zlib.h"
2323
#include "blob.h"
2424
2525
#if INTERFACE
2626
/*
2727
** A Blob can hold a string or a binary object of arbitrary size. The
2828
--- src/blob.c
+++ src/blob.c
@@ -17,11 +17,11 @@
17 **
18 ** A Blob is a variable-length containers for arbitrary string
19 ** or binary data.
20 */
21 #include "config.h"
22 #include <zlib.h>
23 #include "blob.h"
24
25 #if INTERFACE
26 /*
27 ** A Blob can hold a string or a binary object of arbitrary size. The
28
--- src/blob.c
+++ src/blob.c
@@ -17,11 +17,11 @@
17 **
18 ** A Blob is a variable-length containers for arbitrary string
19 ** or binary data.
20 */
21 #include "config.h"
22 #include "zlib.h"
23 #include "blob.h"
24
25 #if INTERFACE
26 /*
27 ** A Blob can hold a string or a binary object of arbitrary size. The
28
+1 -1
--- src/gzip.c
+++ src/gzip.c
@@ -21,11 +21,11 @@
2121
** State information is stored in static variables, so this implementation
2222
** can only be building up a single GZIP file at a time.
2323
*/
2424
#include "config.h"
2525
#include <assert.h>
26
-#include <zlib.h>
26
+#include "zlib.h"
2727
#include "gzip.h"
2828
2929
/*
3030
** State information for the GZIP file under construction.
3131
*/
3232
--- src/gzip.c
+++ src/gzip.c
@@ -21,11 +21,11 @@
21 ** State information is stored in static variables, so this implementation
22 ** can only be building up a single GZIP file at a time.
23 */
24 #include "config.h"
25 #include <assert.h>
26 #include <zlib.h>
27 #include "gzip.h"
28
29 /*
30 ** State information for the GZIP file under construction.
31 */
32
--- src/gzip.c
+++ src/gzip.c
@@ -21,11 +21,11 @@
21 ** State information is stored in static variables, so this implementation
22 ** can only be building up a single GZIP file at a time.
23 */
24 #include "config.h"
25 #include <assert.h>
26 #include "zlib.h"
27 #include "gzip.h"
28
29 /*
30 ** State information for the GZIP file under construction.
31 */
32
+4 -1
--- src/main.mk
+++ src/main.mk
@@ -407,11 +407,11 @@
407407
# using -lsqlite3.
408408
SQLITE3_OBJ.1 =
409409
SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
410410
SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
411411
412
-EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
412
+EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o $(OBJDIR)/miniz.o
413413
414414
$(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
415415
$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
416416
417417
# This rule prevents make from using its default rules to try build
@@ -1226,12 +1226,15 @@
12261226
12271227
12281228
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
12291229
$(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
12301230
1231
+$(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c
1232
+ $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $(OBJDIR)/miniz.o
1233
+
12311234
#
12321235
# The list of all the targets that do not correspond to real files. This stops
12331236
# 'make' from getting confused when someone makes an error in a rule.
12341237
#
12351238
12361239
.PHONY: all install test clean
12371240
12381241
--- src/main.mk
+++ src/main.mk
@@ -407,11 +407,11 @@
407 # using -lsqlite3.
408 SQLITE3_OBJ.1 =
409 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
410 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
411
412 EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
413
414 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
415 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
416
417 # This rule prevents make from using its default rules to try build
@@ -1226,12 +1226,15 @@
1226
1227
1228 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1229 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
1230
 
 
 
1231 #
1232 # The list of all the targets that do not correspond to real files. This stops
1233 # 'make' from getting confused when someone makes an error in a rule.
1234 #
1235
1236 .PHONY: all install test clean
1237
1238
--- src/main.mk
+++ src/main.mk
@@ -407,11 +407,11 @@
407 # using -lsqlite3.
408 SQLITE3_OBJ.1 =
409 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
410 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
411
412 EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o $(OBJDIR)/miniz.o
413
414 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
415 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
416
417 # This rule prevents make from using its default rules to try build
@@ -1226,12 +1226,15 @@
1226
1227
1228 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
1229 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
1230
1231 $(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c
1232 $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $(OBJDIR)/miniz.o
1233
1234 #
1235 # The list of all the targets that do not correspond to real files. This stops
1236 # 'make' from getting confused when someone makes an error in a rule.
1237 #
1238
1239 .PHONY: all install test clean
1240
1241
+23 -6
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -153,10 +153,20 @@
153153
-Dmain=sqlite3_shell
154154
-DSQLITE_OMIT_LOAD_EXTENSION=1
155155
-DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE)
156156
-DSQLITE_SHELL_DBNAME_PROC=fossil_open
157157
}
158
+
159
+# miniz (libz drop-in alternative) precompiler flags.
160
+# FIXME: MINIZ_LITTLE_ENDIAN needs to be determined by the platform.
161
+set MINIZ_OPTIONS {
162
+ -DMINIZ_NO_STDIO
163
+ -DMINIZ_NO_TIME
164
+ -DMINIZ_NO_ARCHIVE_APIS
165
+ -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=1
166
+ -DMINIZ_LITTLE_ENDIAN=1
167
+}
158168
159169
# Options used to compile the included SQLite shell on Windows.
160170
#
161171
set SHELL_WIN32_OPTIONS $SHELL_OPTIONS
162172
lappend SHELL_WIN32_OPTIONS -Daccess=file_access
@@ -278,11 +288,12 @@
278288
$(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
279289
$(OBJDIR)/shell.o \
280290
$(OBJDIR)/th.o \
281291
$(OBJDIR)/th_lang.o \
282292
$(OBJDIR)/th_tcl.o \
283
- $(OBJDIR)/cson_amalgamation.o
293
+ $(OBJDIR)/cson_amalgamation.o \
294
+ $(OBJDIR)/miniz.o
284295
285296
$(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
286297
$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
287298
288299
# This rule prevents make from using its default rules to try build
@@ -335,15 +346,19 @@
335346
writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
336347
writeln "\t\$(XTCC) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"
337348
338349
writeln "\$(OBJDIR)/th_tcl.o:\t\$(SRCDIR)/th_tcl.c"
339350
writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n"
351
+
340352
341353
writeln {
342354
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
343355
$(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
344356
357
+$(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c
358
+ $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $(OBJDIR)/miniz.o
359
+
345360
#
346361
# The list of all the targets that do not correspond to real files. This stops
347362
# 'make' from getting confused when someone makes an error in a rule.
348363
#
349364
@@ -603,11 +618,11 @@
603618
604619
#### Extra arguments for linking the finished binary. Fossil needs
605620
# to link against the Z-Lib compression library. There are no
606621
# other mandatory dependencies.
607622
#
608
-LIB += -lmingwex -lz
623
+LIB += -lmingwex
609624
610625
#### These libraries MUST appear in the same order as they do for Tcl
611626
# or linking with it will not work (exact reason unknown).
612627
#
613628
ifdef FOSSIL_ENABLE_TCL
@@ -754,11 +769,12 @@
754769
$(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
755770
$(OBJDIR)/shell.o \
756771
$(OBJDIR)/th.o \
757772
$(OBJDIR)/th_lang.o \
758773
$(OBJDIR)/th_tcl.o \
759
- $(OBJDIR)/cson_amalgamation.o
774
+ $(OBJDIR)/cson_amalgamation.o \
775
+ $(OBJDIR)/miniz.o
760776
761777
zlib:
762778
$(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
763779
764780
clean-zlib:
@@ -1402,11 +1418,12 @@
14021418
THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
14031419
14041420
# define the zlib files, needed by this compile
14051421
ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
14061422
ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
1407
-ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
1423
+ZLIBOBJ=$(OBJDIR)/miniz.o
1424
+#$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
14081425
14091426
# define all fossil sources, using the standard compile and
14101427
# source generation. These are all files in SRCDIR, which are not
14111428
# mentioned as special files above:
14121429
ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
@@ -1466,12 +1483,12 @@
14661483
$(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
14671484
14681485
$(THOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)th.h
14691486
$(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
14701487
1471
-$(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
1472
- $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
1488
+#$(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
1489
+# $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
14731490
14741491
# create the windows resource with icon and version info
14751492
$(RESOURCE): %.res: ../win/%.rc ../win/*.ico
14761493
$(RC) $(RCFLAGS) $< -Fo"$@"
14771494
14781495
14791496
ADDED src/miniz.c
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -153,10 +153,20 @@
153 -Dmain=sqlite3_shell
154 -DSQLITE_OMIT_LOAD_EXTENSION=1
155 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE)
156 -DSQLITE_SHELL_DBNAME_PROC=fossil_open
157 }
 
 
 
 
 
 
 
 
 
 
158
159 # Options used to compile the included SQLite shell on Windows.
160 #
161 set SHELL_WIN32_OPTIONS $SHELL_OPTIONS
162 lappend SHELL_WIN32_OPTIONS -Daccess=file_access
@@ -278,11 +288,12 @@
278 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
279 $(OBJDIR)/shell.o \
280 $(OBJDIR)/th.o \
281 $(OBJDIR)/th_lang.o \
282 $(OBJDIR)/th_tcl.o \
283 $(OBJDIR)/cson_amalgamation.o
 
284
285 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
286 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
287
288 # This rule prevents make from using its default rules to try build
@@ -335,15 +346,19 @@
335 writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
336 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"
337
338 writeln "\$(OBJDIR)/th_tcl.o:\t\$(SRCDIR)/th_tcl.c"
339 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n"
 
340
341 writeln {
342 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
343 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
344
 
 
 
345 #
346 # The list of all the targets that do not correspond to real files. This stops
347 # 'make' from getting confused when someone makes an error in a rule.
348 #
349
@@ -603,11 +618,11 @@
603
604 #### Extra arguments for linking the finished binary. Fossil needs
605 # to link against the Z-Lib compression library. There are no
606 # other mandatory dependencies.
607 #
608 LIB += -lmingwex -lz
609
610 #### These libraries MUST appear in the same order as they do for Tcl
611 # or linking with it will not work (exact reason unknown).
612 #
613 ifdef FOSSIL_ENABLE_TCL
@@ -754,11 +769,12 @@
754 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
755 $(OBJDIR)/shell.o \
756 $(OBJDIR)/th.o \
757 $(OBJDIR)/th_lang.o \
758 $(OBJDIR)/th_tcl.o \
759 $(OBJDIR)/cson_amalgamation.o
 
760
761 zlib:
762 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
763
764 clean-zlib:
@@ -1402,11 +1418,12 @@
1402 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
1403
1404 # define the zlib files, needed by this compile
1405 ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
1406 ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
1407 ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
 
1408
1409 # define all fossil sources, using the standard compile and
1410 # source generation. These are all files in SRCDIR, which are not
1411 # mentioned as special files above:
1412 ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
@@ -1466,12 +1483,12 @@
1466 $(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
1467
1468 $(THOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)th.h
1469 $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
1470
1471 $(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
1472 $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
1473
1474 # create the windows resource with icon and version info
1475 $(RESOURCE): %.res: ../win/%.rc ../win/*.ico
1476 $(RC) $(RCFLAGS) $< -Fo"$@"
1477
1478
1479 DDED src/miniz.c
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -153,10 +153,20 @@
153 -Dmain=sqlite3_shell
154 -DSQLITE_OMIT_LOAD_EXTENSION=1
155 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE)
156 -DSQLITE_SHELL_DBNAME_PROC=fossil_open
157 }
158
159 # miniz (libz drop-in alternative) precompiler flags.
160 # FIXME: MINIZ_LITTLE_ENDIAN needs to be determined by the platform.
161 set MINIZ_OPTIONS {
162 -DMINIZ_NO_STDIO
163 -DMINIZ_NO_TIME
164 -DMINIZ_NO_ARCHIVE_APIS
165 -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=1
166 -DMINIZ_LITTLE_ENDIAN=1
167 }
168
169 # Options used to compile the included SQLite shell on Windows.
170 #
171 set SHELL_WIN32_OPTIONS $SHELL_OPTIONS
172 lappend SHELL_WIN32_OPTIONS -Daccess=file_access
@@ -278,11 +288,12 @@
288 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
289 $(OBJDIR)/shell.o \
290 $(OBJDIR)/th.o \
291 $(OBJDIR)/th_lang.o \
292 $(OBJDIR)/th_tcl.o \
293 $(OBJDIR)/cson_amalgamation.o \
294 $(OBJDIR)/miniz.o
295
296 $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
297 $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
298
299 # This rule prevents make from using its default rules to try build
@@ -335,15 +346,19 @@
346 writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
347 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"
348
349 writeln "\$(OBJDIR)/th_tcl.o:\t\$(SRCDIR)/th_tcl.c"
350 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n"
351
352
353 writeln {
354 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c
355 $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o
356
357 $(OBJDIR)/miniz.o: $(SRCDIR)/miniz.c
358 $(XTCC) $(MINIZ_OPTIONS) -c $(SRCDIR)/miniz.c -o $(OBJDIR)/miniz.o
359
360 #
361 # The list of all the targets that do not correspond to real files. This stops
362 # 'make' from getting confused when someone makes an error in a rule.
363 #
364
@@ -603,11 +618,11 @@
618
619 #### Extra arguments for linking the finished binary. Fossil needs
620 # to link against the Z-Lib compression library. There are no
621 # other mandatory dependencies.
622 #
623 LIB += -lmingwex
624
625 #### These libraries MUST appear in the same order as they do for Tcl
626 # or linking with it will not work (exact reason unknown).
627 #
628 ifdef FOSSIL_ENABLE_TCL
@@ -754,11 +769,12 @@
769 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
770 $(OBJDIR)/shell.o \
771 $(OBJDIR)/th.o \
772 $(OBJDIR)/th_lang.o \
773 $(OBJDIR)/th_tcl.o \
774 $(OBJDIR)/cson_amalgamation.o \
775 $(OBJDIR)/miniz.o
776
777 zlib:
778 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
779
780 clean-zlib:
@@ -1402,11 +1418,12 @@
1418 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
1419
1420 # define the zlib files, needed by this compile
1421 ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
1422 ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
1423 ZLIBOBJ=$(OBJDIR)/miniz.o
1424 #$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
1425
1426 # define all fossil sources, using the standard compile and
1427 # source generation. These are all files in SRCDIR, which are not
1428 # mentioned as special files above:
1429 ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
@@ -1466,12 +1483,12 @@
1483 $(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
1484
1485 $(THOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)th.h
1486 $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
1487
1488 #$(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
1489 # $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
1490
1491 # create the windows resource with icon and version info
1492 $(RESOURCE): %.res: ../win/%.rc ../win/*.ico
1493 $(RC) $(RCFLAGS) $< -Fo"$@"
1494
1495
1496 DDED src/miniz.c
+211
--- a/src/miniz.c
+++ b/src/miniz.c
@@ -0,0 +1,211 @@
1
+/* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/wri
2
+ting/appending, PNG writing
3
+ Rich Geldreich <[email protected]>, last updated Oct. 13, 2013
4
+ Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://w
5
+
6
+ Most API's defined in miniz.c are optional. For example, to disable the archive re
7
+ (r->m_zhdr0 * 256 + r-, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros).
8
+
9
+ * Change History
10
+ 10/1ller must mz_free() the returned heap block (which will typically be larger than *pLen
11
+eeded.
12
+void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level,
13
+mz_bool flip);
14
+void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out);
15
+
16
+// Output stream interface.
17
+nterface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time.
18
+typedef mz_bool (*tdefl_put_buf_func_ptr)(const void* pBuf, in
19
+) compresses a block to an output stream. The above helpers use this function intern return MZ_DATA_ERROR;
20
+
21
+ if (pState->m_has_flushed && (
22
+(pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
23
+ pState->m_has_flushed |= (flush == MZ_FINISH);
24
+
25
+ if ((flush == MZ_FINISH) && (first_call))
26
+ {
27
+ // MZ_FINISH on the first cal
28
+l implies that the input and output buffers are large enough to hold the entire compressed/decompressed file.
29
+ decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
30
+ in_bytes = pStream->avail_
31
+(pState->m_has_flushed && (flusER) && (r->m_check_anfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStrea
32
+comp_flags);
33
+ pState->m_last_status = status;
34
+ pStream->next_in += (mz_uint
35
+)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_byt
36
+nfl_get_adler32(&pState->m_decomp);
37
+ pStream->next_out += (mz_uint)out_bytes;
38
+pStream->avail_out -= (m
39
+total_out += (mz_uint)out_bytes;
40
+
41
+ if (status < 0)
42
+ return MZ_
43
+/* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
44
+ See "unlicense" statement at the end d void *pImage, int w,
45
+ int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip);
46
+
47
+void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chan
48
+utput stream interface. The compressor uses this interface to write compressed data.
49
+d data when flush==MZ_FINI- public domain deflate/inflate, zlib-subset, ZIP reading/writing/appen/(const void* pBuf, int len, void *pUser);
50
+
51
+// tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function inter
52
+ f (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
53
+ pState->m_has_flushed |= (flush == MZ_FINISH);
54
+
55
+ if ((flush == MZ_FINISH) && (first_c
56
+on the first call implies that the input and output buffers are large enough to hold the e
57
+ed file.
58
+ decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
59
+ in_bytes = pStream->avail_in; out_bytes = pStream->avail_out;
60
+ status =
61
+ tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags)
62
+;
63
+ pState->m_last_status = status;
64
+ pStream->next_in += (mz_uint)in_b
65
+ytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes;
66
+ pStream->adler = tinfl_get_adler32(&pState->m_decomp);
67
+
68
+er32(&pState->m_decomp);
69
+ pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint
70
+/* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
71
+ See "unlicense" statement at the end of this file.
72
+ i))
73
+ return MZ_BUF_ERROR; // Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH.
74
+
75
+else if (flush == MZ_FINISH)
76
+ {
77
+ // The output buffer MUST be large to hol
78
+d data when flush==MZ_FINISH.
79
+ if (status == TINFL_STATUS_DONE)
80
+ return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
81
+
82
+T, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong.
83
+ else if
84
+ng is wrong.
85
+ else if (!pStream->avail_out)
86
+ return MZ_BUF_ERROR;
87
+ }
88
+ else if ((status == TINFL_STATUS_DONE)
89
+ tinfl_decompressor riting/appending, PNG writing
90
+ See "unlicense" statement at the end of this file.
91
+ Rich G/te->m_dict_avail)) ? MZ_STREA
92
+flateEnd(mz_streamp pStream)
93
+{
94
+
95
+Z_STREAM_ERROR;
96
+ if (pStream->state)
97
+ {
98
+ pStream->zfree(pStream->opaque, pStream->st
99
+
100
+int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource
101
+onst unsigned char *pSource, mz_ulong source_len)
102
+{
103
+ mz_stream stream;
104
+ int status;
105
+ mem
106
+am));
107
+
108
+ // In case mz_ulong is 64-bits (argh I hate longs).
109
+ if ((source_len | *pD
110
+urn MZ_PARAM_ERROR;
111
+
112
+ stream.next_in = pSource;
113
+ stream.avail_in = (mz_uint32)source_len;
114
+
115
+stream.next_out
116
+t = (mz_uint32)*pD
117
+
118
+tus != MZ_OK)
119
+ return s
120
+
121
+e(&stream, MZ_FINISH);
122
+ if (status != MZ_STREAM_END)
123
+ {
124
+ mz_inflateEnd(&st
125
+ream);
126
+ return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERRO
127
+
128
+
129
+ char *mz_error(int err)
130
+{
131
+ static const struct { int m_err; const char *m_
132
+pDesc; } s_error_descs[] =
133
+ {
134
+ { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "fi
135
+le error" }, { MZ_STRE
136
+
137
+ RD(++q)) && (TDEFL_Ra error" }, { MZ_MEM_ERROR, "out of
138
+
139
+* miniz.c v1.15 - public doefl else if (!pStream->avail_out)
140
+ return MZ_BUF_ERROR;
141
+ }
142
+ else if ((s
143
+
144
+ream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)
145
+;
146
+ inreak;
147
+ }
148
+
149
+ return ((status == TINFL_STATUS_DONE) && (!pState->m_dic
150
+ MZ_OK;
151
+}
152
+
153
+int mz_inflate
154
+End(mz_streamp pStream)
155
+{
156
+
157
+_STREAM_ERROR;
158
+ if (pStream->state)
159
+ {
160
+ pStream->zfree(pStream->opaque, pStream->sta
161
+ULL;
162
+ }
163
+ return MZ_OK;
164
+}
165
+
166
+int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_le
167
+
168
+ Limitations:
169
+pDest_len, const unsigned char *pSource, mz_ulong source_len)
170
+{
171
+ mz_stream stre
172
+;
173
+
174
+ // In case mz_ulong is 64-bits (argh I hate longs).
175
+ if ((source_len | *pD
176
+urn MZ_PARAM_ERROR;
177
+
178
+ stream.next_in = pSource;
179
+ stream.avail_in =
180
+
181
+
182
+_uint32)*pDest_len;
183
+
184
+
185
+
186
+)
187
+ return status;
188
+
189
+ stat
190
+
191
+ return status;
192
+
193
+ status = mz_inflate(&stream, MZ_FINISH);
194
+ if (status != MZ_STREA
195
+d(&stream);
196
+ return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_E
197
+ return mz_inflateEnd(&stream);
198
+}
199
+
200
+const char *mz_error(int err)
201
+{
202
+ static const st
203
+r *m_pDesc; } s_error_descs[] =
204
+ {
205
+ { MZ_OK, "" }, { MZ_STREAM_END, "stream
206
+ end" }, { MZ_NEED_DICT, "need
207
+
208
+file error" }, { MZ_STREAM_ERROR, "stream error" },
209
+ { MZ_DATA_ERROR, "data error" }, {
210
+
211
+* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/w.15 - pubn_bytes = pStream->avail/* miniz.c v1.
--- a/src/miniz.c
+++ b/src/miniz.c
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/miniz.c
+++ b/src/miniz.c
@@ -0,0 +1,211 @@
1 /* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/wri
2 ting/appending, PNG writing
3 Rich Geldreich <[email protected]>, last updated Oct. 13, 2013
4 Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://w
5
6 Most API's defined in miniz.c are optional. For example, to disable the archive re
7 (r->m_zhdr0 * 256 + r-, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros).
8
9 * Change History
10 10/1ller must mz_free() the returned heap block (which will typically be larger than *pLen
11 eeded.
12 void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level,
13 mz_bool flip);
14 void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out);
15
16 // Output stream interface.
17 nterface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time.
18 typedef mz_bool (*tdefl_put_buf_func_ptr)(const void* pBuf, in
19 ) compresses a block to an output stream. The above helpers use this function intern return MZ_DATA_ERROR;
20
21 if (pState->m_has_flushed && (
22 (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
23 pState->m_has_flushed |= (flush == MZ_FINISH);
24
25 if ((flush == MZ_FINISH) && (first_call))
26 {
27 // MZ_FINISH on the first cal
28 l implies that the input and output buffers are large enough to hold the entire compressed/decompressed file.
29 decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
30 in_bytes = pStream->avail_
31 (pState->m_has_flushed && (flusER) && (r->m_check_anfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStrea
32 comp_flags);
33 pState->m_last_status = status;
34 pStream->next_in += (mz_uint
35 )in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_byt
36 nfl_get_adler32(&pState->m_decomp);
37 pStream->next_out += (mz_uint)out_bytes;
38 pStream->avail_out -= (m
39 total_out += (mz_uint)out_bytes;
40
41 if (status < 0)
42 return MZ_
43 /* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
44 See "unlicense" statement at the end d void *pImage, int w,
45 int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip);
46
47 void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chan
48 utput stream interface. The compressor uses this interface to write compressed data.
49 d data when flush==MZ_FINI- public domain deflate/inflate, zlib-subset, ZIP reading/writing/appen/(const void* pBuf, int len, void *pUser);
50
51 // tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function inter
52 f (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
53 pState->m_has_flushed |= (flush == MZ_FINISH);
54
55 if ((flush == MZ_FINISH) && (first_c
56 on the first call implies that the input and output buffers are large enough to hold the e
57 ed file.
58 decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
59 in_bytes = pStream->avail_in; out_bytes = pStream->avail_out;
60 status =
61 tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags)
62 ;
63 pState->m_last_status = status;
64 pStream->next_in += (mz_uint)in_b
65 ytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes;
66 pStream->adler = tinfl_get_adler32(&pState->m_decomp);
67
68 er32(&pState->m_decomp);
69 pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint
70 /* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
71 See "unlicense" statement at the end of this file.
72 i))
73 return MZ_BUF_ERROR; // Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH.
74
75 else if (flush == MZ_FINISH)
76 {
77 // The output buffer MUST be large to hol
78 d data when flush==MZ_FINISH.
79 if (status == TINFL_STATUS_DONE)
80 return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
81
82 T, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong.
83 else if
84 ng is wrong.
85 else if (!pStream->avail_out)
86 return MZ_BUF_ERROR;
87 }
88 else if ((status == TINFL_STATUS_DONE)
89 tinfl_decompressor riting/appending, PNG writing
90 See "unlicense" statement at the end of this file.
91 Rich G/te->m_dict_avail)) ? MZ_STREA
92 flateEnd(mz_streamp pStream)
93 {
94
95 Z_STREAM_ERROR;
96 if (pStream->state)
97 {
98 pStream->zfree(pStream->opaque, pStream->st
99
100 int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource
101 onst unsigned char *pSource, mz_ulong source_len)
102 {
103 mz_stream stream;
104 int status;
105 mem
106 am));
107
108 // In case mz_ulong is 64-bits (argh I hate longs).
109 if ((source_len | *pD
110 urn MZ_PARAM_ERROR;
111
112 stream.next_in = pSource;
113 stream.avail_in = (mz_uint32)source_len;
114
115 stream.next_out
116 t = (mz_uint32)*pD
117
118 tus != MZ_OK)
119 return s
120
121 e(&stream, MZ_FINISH);
122 if (status != MZ_STREAM_END)
123 {
124 mz_inflateEnd(&st
125 ream);
126 return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERRO
127
128
129 char *mz_error(int err)
130 {
131 static const struct { int m_err; const char *m_
132 pDesc; } s_error_descs[] =
133 {
134 { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "fi
135 le error" }, { MZ_STRE
136
137 RD(++q)) && (TDEFL_Ra error" }, { MZ_MEM_ERROR, "out of
138
139 * miniz.c v1.15 - public doefl else if (!pStream->avail_out)
140 return MZ_BUF_ERROR;
141 }
142 else if ((s
143
144 ream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)
145 ;
146 inreak;
147 }
148
149 return ((status == TINFL_STATUS_DONE) && (!pState->m_dic
150 MZ_OK;
151 }
152
153 int mz_inflate
154 End(mz_streamp pStream)
155 {
156
157 _STREAM_ERROR;
158 if (pStream->state)
159 {
160 pStream->zfree(pStream->opaque, pStream->sta
161 ULL;
162 }
163 return MZ_OK;
164 }
165
166 int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_le
167
168 Limitations:
169 pDest_len, const unsigned char *pSource, mz_ulong source_len)
170 {
171 mz_stream stre
172 ;
173
174 // In case mz_ulong is 64-bits (argh I hate longs).
175 if ((source_len | *pD
176 urn MZ_PARAM_ERROR;
177
178 stream.next_in = pSource;
179 stream.avail_in =
180
181
182 _uint32)*pDest_len;
183
184
185
186 )
187 return status;
188
189 stat
190
191 return status;
192
193 status = mz_inflate(&stream, MZ_FINISH);
194 if (status != MZ_STREA
195 d(&stream);
196 return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_E
197 return mz_inflateEnd(&stream);
198 }
199
200 const char *mz_error(int err)
201 {
202 static const st
203 r *m_pDesc; } s_error_descs[] =
204 {
205 { MZ_OK, "" }, { MZ_STREAM_END, "stream
206 end" }, { MZ_NEED_DICT, "need
207
208 file error" }, { MZ_STREAM_ERROR, "stream error" },
209 { MZ_DATA_ERROR, "data error" }, {
210
211 * miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/w.15 - pubn_bytes = pStream->avail/* miniz.c v1.
+1 -1
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -20,11 +20,11 @@
2020
** is a copy of the "shell.c" code from SQLite. This file contains logic
2121
** to initialize the code in shell.c.
2222
*/
2323
#include "config.h"
2424
#include "sqlcmd.h"
25
-#include <zlib.h>
25
+#include "zlib.h"
2626
2727
/*
2828
** Implementation of the "content(X)" SQL function. Return the complete
2929
** content of artifact identified by X as a blob.
3030
*/
3131
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -20,11 +20,11 @@
20 ** is a copy of the "shell.c" code from SQLite. This file contains logic
21 ** to initialize the code in shell.c.
22 */
23 #include "config.h"
24 #include "sqlcmd.h"
25 #include <zlib.h>
26
27 /*
28 ** Implementation of the "content(X)" SQL function. Return the complete
29 ** content of artifact identified by X as a blob.
30 */
31
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -20,11 +20,11 @@
20 ** is a copy of the "shell.c" code from SQLite. This file contains logic
21 ** to initialize the code in shell.c.
22 */
23 #include "config.h"
24 #include "sqlcmd.h"
25 #include "zlib.h"
26
27 /*
28 ** Implementation of the "content(X)" SQL function. Return the complete
29 ** content of artifact identified by X as a blob.
30 */
31
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -17,11 +17,11 @@
1717
**
1818
** This file contains code used to generate tarballs.
1919
*/
2020
#include "config.h"
2121
#include <assert.h>
22
-#include <zlib.h>
22
+#include "zlib.h"
2323
#include "tar.h"
2424
2525
/*
2626
** State information for the tarball builder.
2727
*/
2828
--- src/tar.c
+++ src/tar.c
@@ -17,11 +17,11 @@
17 **
18 ** This file contains code used to generate tarballs.
19 */
20 #include "config.h"
21 #include <assert.h>
22 #include <zlib.h>
23 #include "tar.h"
24
25 /*
26 ** State information for the tarball builder.
27 */
28
--- src/tar.c
+++ src/tar.c
@@ -17,11 +17,11 @@
17 **
18 ** This file contains code used to generate tarballs.
19 */
20 #include "config.h"
21 #include <assert.h>
22 #include "zlib.h"
23 #include "tar.h"
24
25 /*
26 ** State information for the tarball builder.
27 */
28
+1 -1
--- src/zip.c
+++ src/zip.c
@@ -17,11 +17,11 @@
1717
**
1818
** This file contains code used to generate ZIP archives.
1919
*/
2020
#include "config.h"
2121
#include <assert.h>
22
-#include <zlib.h>
22
+#include "zlib.h"
2323
#include "zip.h"
2424
2525
/*
2626
** Write a 16- or 32-bit integer as little-endian into the given buffer.
2727
*/
2828
2929
ADDED src/zlib.h
--- src/zip.c
+++ src/zip.c
@@ -17,11 +17,11 @@
17 **
18 ** This file contains code used to generate ZIP archives.
19 */
20 #include "config.h"
21 #include <assert.h>
22 #include <zlib.h>
23 #include "zip.h"
24
25 /*
26 ** Write a 16- or 32-bit integer as little-endian into the given buffer.
27 */
28
29 DDED src/zlib.h
--- src/zip.c
+++ src/zip.c
@@ -17,11 +17,11 @@
17 **
18 ** This file contains code used to generate ZIP archives.
19 */
20 #include "config.h"
21 #include <assert.h>
22 #include "zlib.h"
23 #include "zip.h"
24
25 /*
26 ** Write a 16- or 32-bit integer as little-endian into the given buffer.
27 */
28
29 DDED src/zlib.h
+10
--- a/src/zlib.h
+++ b/src/zlib.h
@@ -0,0 +1,10 @@
1
+#define MINIZ_HEADER_FILE_ONLY
2
+
3
+#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
4
+#define MINIZ_LITTLE_ENDIAN 1
5
+
6
+#define MINIZ_NO_STDIO
7
+#define MINIZ_NO_TIME
8
+#define MINIZ_NO_ARCHIVE_APIS
9
+
10
+#include "miniz.c"
--- a/src/zlib.h
+++ b/src/zlib.h
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
--- a/src/zlib.h
+++ b/src/zlib.h
@@ -0,0 +1,10 @@
1 #define MINIZ_HEADER_FILE_ONLY
2
3 #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
4 #define MINIZ_LITTLE_ENDIAN 1
5
6 #define MINIZ_NO_STDIO
7 #define MINIZ_NO_TIME
8 #define MINIZ_NO_ARCHIVE_APIS
9
10 #include "miniz.c"
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -99,11 +99,12 @@
9999
THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100100
101101
# define the zlib files, needed by this compile
102102
ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
103103
ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
104
-ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
104
+ZLIBOBJ=$(OBJDIR)/miniz.o
105
+#$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
105106
106107
# define all fossil sources, using the standard compile and
107108
# source generation. These are all files in SRCDIR, which are not
108109
# mentioned as special files above:
109110
ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
@@ -163,12 +164,12 @@
163164
$(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
164165
165166
$(THOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)th.h
166167
$(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
167168
168
-$(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
169
- $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
169
+#$(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
170
+# $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
170171
171172
# create the windows resource with icon and version info
172173
$(RESOURCE): %.res: ../win/%.rc ../win/*.ico
173174
$(RC) $(RCFLAGS) $< -Fo"$@"
174175
175176
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -99,11 +99,12 @@
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
101 # define the zlib files, needed by this compile
102 ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
103 ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
104 ZLIBOBJ=$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
 
105
106 # define all fossil sources, using the standard compile and
107 # source generation. These are all files in SRCDIR, which are not
108 # mentioned as special files above:
109 ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
@@ -163,12 +164,12 @@
163 $(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
164
165 $(THOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)th.h
166 $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
167
168 $(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
169 $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
170
171 # create the windows resource with icon and version info
172 $(RESOURCE): %.res: ../win/%.rc ../win/*.ico
173 $(RC) $(RCFLAGS) $< -Fo"$@"
174
175
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -99,11 +99,12 @@
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
101 # define the zlib files, needed by this compile
102 ZLIBSRC=adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c
103 ORIGZLIBSRC=$(foreach sf,$(ZLIBSRC),$(ZLIBSRCDIR)$(sf))
104 ZLIBOBJ=$(OBJDIR)/miniz.o
105 #$(foreach sf,$(ZLIBSRC),$(sf:.c=.obj))
106
107 # define all fossil sources, using the standard compile and
108 # source generation. These are all files in SRCDIR, which are not
109 # mentioned as special files above:
110 ORIGSRC=$(filter-out $(UTILS_SRC) $(ORIGTHSRC) $(ORIGSQLITESRC) $(ORIGSQLITESHELLSRC),$(wildcard $(SRCDIR)*.c))
@@ -163,12 +164,12 @@
164 $(CC) $(CCFLAGS) $(SQLITESHELLDEFINES) $(INCLUDE) "$<" -Fo"$@"
165
166 $(THOBJ): %.obj: $(SRCDIR)%.c $(SRCDIR)th.h
167 $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
168
169 #$(ZLIBOBJ): %.obj: $(ZLIBSRCDIR)%.c
170 # $(CC) $(CCFLAGS) $(INCLUDE) "$<" -Fo"$@"
171
172 # create the windows resource with icon and version info
173 $(RESOURCE): %.res: ../win/%.rc ../win/*.ico
174 $(RC) $(RCFLAGS) $< -Fo"$@"
175
176
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -239,11 +239,11 @@
239239
240240
#### Extra arguments for linking the finished binary. Fossil needs
241241
# to link against the Z-Lib compression library. There are no
242242
# other mandatory dependencies.
243243
#
244
-LIB += -lmingwex -lz
244
+LIB += -lmingwex
245245
246246
#### These libraries MUST appear in the same order as they do for Tcl
247247
# or linking with it will not work (exact reason unknown).
248248
#
249249
ifdef FOSSIL_ENABLE_TCL
@@ -707,11 +707,11 @@
707707
# using -lsqlite3.
708708
SQLITE3_OBJ.1 =
709709
SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
710710
SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
711711
712
-EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
712
+EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o $(OBJDIR)/miniz.o
713713
714714
zlib:
715715
$(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
716716
717717
clean-zlib:
718718
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -239,11 +239,11 @@
239
240 #### Extra arguments for linking the finished binary. Fossil needs
241 # to link against the Z-Lib compression library. There are no
242 # other mandatory dependencies.
243 #
244 LIB += -lmingwex -lz
245
246 #### These libraries MUST appear in the same order as they do for Tcl
247 # or linking with it will not work (exact reason unknown).
248 #
249 ifdef FOSSIL_ENABLE_TCL
@@ -707,11 +707,11 @@
707 # using -lsqlite3.
708 SQLITE3_OBJ.1 =
709 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
710 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
711
712 EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
713
714 zlib:
715 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
716
717 clean-zlib:
718
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -239,11 +239,11 @@
239
240 #### Extra arguments for linking the finished binary. Fossil needs
241 # to link against the Z-Lib compression library. There are no
242 # other mandatory dependencies.
243 #
244 LIB += -lmingwex
245
246 #### These libraries MUST appear in the same order as they do for Tcl
247 # or linking with it will not work (exact reason unknown).
248 #
249 ifdef FOSSIL_ENABLE_TCL
@@ -707,11 +707,11 @@
707 # using -lsqlite3.
708 SQLITE3_OBJ.1 =
709 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
710 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
711
712 EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o $(OBJDIR)/miniz.o
713
714 zlib:
715 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
716
717 clean-zlib:
718

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button