libarchive-static 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/ext/Makefile +6 -0
  2. data/ext/extconf.rb +61 -0
  3. data/ext/libarchive-0.1.1/COPYING.libarchive +60 -0
  4. data/ext/libarchive-0.1.1/LICENSE.libbzip2 +42 -0
  5. data/ext/libarchive-0.1.1/README.txt +143 -0
  6. data/ext/libarchive-0.1.1/ext/Makefile.in +0 -0
  7. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +31 -0
  8. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.h +6 -0
  9. data/ext/libarchive-0.1.1/ext/archive_read_support_format.c +32 -0
  10. data/ext/libarchive-0.1.1/ext/archive_read_support_format.h +6 -0
  11. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +29 -0
  12. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.h +6 -0
  13. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +32 -0
  14. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.h +6 -0
  15. data/ext/libarchive-0.1.1/ext/config.h.in +22 -0
  16. data/ext/libarchive-0.1.1/ext/configure +3904 -0
  17. data/ext/libarchive-0.1.1/ext/configure.in +11 -0
  18. data/ext/libarchive-0.1.1/ext/depend +19 -0
  19. data/ext/libarchive-0.1.1/ext/extconf.rb +6 -0
  20. data/ext/libarchive-0.1.1/ext/install-sh +250 -0
  21. data/ext/libarchive-0.1.1/ext/libarchive.c +89 -0
  22. data/ext/libarchive-0.1.1/ext/libarchive_archive.c +84 -0
  23. data/ext/libarchive-0.1.1/ext/libarchive_entry.c +1015 -0
  24. data/ext/libarchive-0.1.1/ext/libarchive_internal.h +155 -0
  25. data/ext/libarchive-0.1.1/ext/libarchive_reader.c +328 -0
  26. data/ext/libarchive-0.1.1/ext/libarchive_win32.h +52 -0
  27. data/ext/libarchive-0.1.1/ext/libarchive_writer.c +246 -0
  28. data/ext/libarchive-0.1.1/libarchive.c +1762 -0
  29. data/ext/libarchive-2.8.4/Makefile.in +7076 -0
  30. data/ext/libarchive-2.8.4/build/autoconf/check_stdcall_func.m4 +51 -0
  31. data/ext/libarchive-2.8.4/build/autoconf/compile +143 -0
  32. data/ext/libarchive-2.8.4/build/autoconf/config.guess +1502 -0
  33. data/ext/libarchive-2.8.4/build/autoconf/config.sub +1708 -0
  34. data/ext/libarchive-2.8.4/build/autoconf/depcomp +630 -0
  35. data/ext/libarchive-2.8.4/build/autoconf/install-sh +291 -0
  36. data/ext/libarchive-2.8.4/build/autoconf/la_uid_t.m4 +20 -0
  37. data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +8406 -0
  38. data/ext/libarchive-2.8.4/build/autoconf/missing +376 -0
  39. data/ext/libarchive-2.8.4/build/pkgconfig/libarchive.pc.in +10 -0
  40. data/ext/libarchive-2.8.4/config.h.in +772 -0
  41. data/ext/libarchive-2.8.4/configure +17916 -0
  42. data/ext/libarchive-2.8.4/libarchive/archive.h +741 -0
  43. data/ext/libarchive-2.8.4/libarchive/archive_check_magic.c +134 -0
  44. data/ext/libarchive-2.8.4/libarchive/archive_crc32.h +66 -0
  45. data/ext/libarchive-2.8.4/libarchive/archive_endian.h +162 -0
  46. data/ext/libarchive-2.8.4/libarchive/archive_entry.c +2202 -0
  47. data/ext/libarchive-2.8.4/libarchive/archive_entry.h +524 -0
  48. data/ext/libarchive-2.8.4/libarchive/archive_entry_copy_bhfi.c +74 -0
  49. data/ext/libarchive-2.8.4/libarchive/archive_entry_copy_stat.c +77 -0
  50. data/ext/libarchive-2.8.4/libarchive/archive_entry_link_resolver.c +405 -0
  51. data/ext/libarchive-2.8.4/libarchive/archive_entry_private.h +184 -0
  52. data/ext/libarchive-2.8.4/libarchive/archive_entry_stat.c +118 -0
  53. data/ext/libarchive-2.8.4/libarchive/archive_entry_strmode.c +87 -0
  54. data/ext/libarchive-2.8.4/libarchive/archive_entry_xattr.c +158 -0
  55. data/ext/libarchive-2.8.4/libarchive/archive_hash.h +281 -0
  56. data/ext/libarchive-2.8.4/libarchive/archive_platform.h +165 -0
  57. data/ext/libarchive-2.8.4/libarchive/archive_private.h +124 -0
  58. data/ext/libarchive-2.8.4/libarchive/archive_read.c +1249 -0
  59. data/ext/libarchive-2.8.4/libarchive/archive_read_data_into_fd.c +93 -0
  60. data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +198 -0
  61. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +570 -0
  62. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_private.h +62 -0
  63. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_set_standard_lookup.c +303 -0
  64. data/ext/libarchive-2.8.4/libarchive/archive_read_extract.c +182 -0
  65. data/ext/libarchive-2.8.4/libarchive/archive_read_open_fd.c +190 -0
  66. data/ext/libarchive-2.8.4/libarchive/archive_read_open_file.c +165 -0
  67. data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +272 -0
  68. data/ext/libarchive-2.8.4/libarchive/archive_read_open_memory.c +156 -0
  69. data/ext/libarchive-2.8.4/libarchive/archive_read_private.h +199 -0
  70. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_all.c +60 -0
  71. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_bzip2.c +353 -0
  72. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_compress.c +444 -0
  73. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_gzip.c +465 -0
  74. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_none.c +40 -0
  75. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_program.c +459 -0
  76. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_rpm.c +287 -0
  77. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_uu.c +627 -0
  78. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_xz.c +708 -0
  79. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_all.c +43 -0
  80. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_ar.c +584 -0
  81. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +777 -0
  82. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_empty.c +93 -0
  83. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_iso9660.c +2830 -0
  84. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +1304 -0
  85. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_raw.c +185 -0
  86. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_tar.c +2418 -0
  87. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_xar.c +3151 -0
  88. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +903 -0
  89. data/ext/libarchive-2.8.4/libarchive/archive_string.c +453 -0
  90. data/ext/libarchive-2.8.4/libarchive/archive_string.h +148 -0
  91. data/ext/libarchive-2.8.4/libarchive/archive_string_sprintf.c +164 -0
  92. data/ext/libarchive-2.8.4/libarchive/archive_util.c +391 -0
  93. data/ext/libarchive-2.8.4/libarchive/archive_virtual.c +94 -0
  94. data/ext/libarchive-2.8.4/libarchive/archive_windows.c +1236 -0
  95. data/ext/libarchive-2.8.4/libarchive/archive_windows.h +347 -0
  96. data/ext/libarchive-2.8.4/libarchive/archive_write.c +466 -0
  97. data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +2628 -0
  98. data/ext/libarchive-2.8.4/libarchive/archive_write_disk_private.h +38 -0
  99. data/ext/libarchive-2.8.4/libarchive/archive_write_disk_set_standard_lookup.c +262 -0
  100. data/ext/libarchive-2.8.4/libarchive/archive_write_open_fd.c +141 -0
  101. data/ext/libarchive-2.8.4/libarchive/archive_write_open_file.c +105 -0
  102. data/ext/libarchive-2.8.4/libarchive/archive_write_open_filename.c +162 -0
  103. data/ext/libarchive-2.8.4/libarchive/archive_write_open_memory.c +126 -0
  104. data/ext/libarchive-2.8.4/libarchive/archive_write_private.h +122 -0
  105. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +408 -0
  106. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_compress.c +492 -0
  107. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +477 -0
  108. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +257 -0
  109. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +347 -0
  110. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +438 -0
  111. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format.c +72 -0
  112. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_ar.c +550 -0
  113. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_by_name.c +76 -0
  114. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +344 -0
  115. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +295 -0
  116. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +1050 -0
  117. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_pax.c +1386 -0
  118. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_shar.c +626 -0
  119. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_ustar.c +587 -0
  120. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +667 -0
  121. data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +154 -0
  122. data/ext/libarchive-2.8.4/libarchive/filter_fork.c +161 -0
  123. data/ext/libarchive-2.8.4/libarchive/filter_fork.h +41 -0
  124. data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +113 -0
  125. data/ext/libarchive-static-makefile +80 -0
  126. data/ext/libarchive-static-wrapper-makefile +22 -0
  127. data/ext/zlib-1.2.5/Makefile.in +257 -0
  128. data/ext/zlib-1.2.5/adler32.c +169 -0
  129. data/ext/zlib-1.2.5/compress.c +80 -0
  130. data/ext/zlib-1.2.5/configure +596 -0
  131. data/ext/zlib-1.2.5/crc32.c +442 -0
  132. data/ext/zlib-1.2.5/crc32.h +441 -0
  133. data/ext/zlib-1.2.5/deflate.c +1834 -0
  134. data/ext/zlib-1.2.5/deflate.h +342 -0
  135. data/ext/zlib-1.2.5/example.c +565 -0
  136. data/ext/zlib-1.2.5/gzclose.c +25 -0
  137. data/ext/zlib-1.2.5/gzguts.h +132 -0
  138. data/ext/zlib-1.2.5/gzlib.c +537 -0
  139. data/ext/zlib-1.2.5/gzread.c +653 -0
  140. data/ext/zlib-1.2.5/gzwrite.c +531 -0
  141. data/ext/zlib-1.2.5/infback.c +632 -0
  142. data/ext/zlib-1.2.5/inffast.c +340 -0
  143. data/ext/zlib-1.2.5/inffast.h +11 -0
  144. data/ext/zlib-1.2.5/inffixed.h +94 -0
  145. data/ext/zlib-1.2.5/inflate.c +1480 -0
  146. data/ext/zlib-1.2.5/inflate.h +122 -0
  147. data/ext/zlib-1.2.5/inftrees.c +330 -0
  148. data/ext/zlib-1.2.5/inftrees.h +62 -0
  149. data/ext/zlib-1.2.5/minigzip.c +440 -0
  150. data/ext/zlib-1.2.5/trees.c +1244 -0
  151. data/ext/zlib-1.2.5/trees.h +128 -0
  152. data/ext/zlib-1.2.5/uncompr.c +59 -0
  153. data/ext/zlib-1.2.5/zconf.h +428 -0
  154. data/ext/zlib-1.2.5/zlib.h +1613 -0
  155. data/ext/zlib-1.2.5/zutil.c +318 -0
  156. data/ext/zlib-1.2.5/zutil.h +274 -0
  157. metadata +211 -0
@@ -0,0 +1,257 @@
1
+ # Makefile for zlib
2
+ # Copyright (C) 1995-2010 Jean-loup Gailly.
3
+ # For conditions of distribution and use, see copyright notice in zlib.h
4
+
5
+ # To compile and test, type:
6
+ # ./configure; make test
7
+ # Normally configure builds both a static and a shared library.
8
+ # If you want to build just a static library, use: ./configure --static
9
+
10
+ # To use the asm code, type:
11
+ # cp contrib/asm?86/match.S ./match.S
12
+ # make LOC=-DASMV OBJA=match.o
13
+
14
+ # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
15
+ # make install
16
+ # To install in $HOME instead of /usr/local, use:
17
+ # make install prefix=$HOME
18
+
19
+ CC=cc
20
+
21
+ CFLAGS=-O
22
+ #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
23
+ #CFLAGS=-g -DDEBUG
24
+ #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
25
+ # -Wstrict-prototypes -Wmissing-prototypes
26
+
27
+ SFLAGS=-O
28
+ LDFLAGS=
29
+ TEST_LDFLAGS=-L. libz.a
30
+ LDSHARED=$(CC)
31
+ CPP=$(CC) -E
32
+
33
+ STATICLIB=libz.a
34
+ SHAREDLIB=libz.so
35
+ SHAREDLIBV=libz.so.1.2.5
36
+ SHAREDLIBM=libz.so.1
37
+ LIBS=$(STATICLIB) $(SHAREDLIBV)
38
+
39
+ AR=ar rc
40
+ RANLIB=ranlib
41
+ LDCONFIG=ldconfig
42
+ LDSHAREDLIBC=-lc
43
+ TAR=tar
44
+ SHELL=/bin/sh
45
+ EXE=
46
+
47
+ prefix = /usr/local
48
+ exec_prefix = ${prefix}
49
+ libdir = ${exec_prefix}/lib
50
+ sharedlibdir = ${libdir}
51
+ includedir = ${prefix}/include
52
+ mandir = ${prefix}/share/man
53
+ man3dir = ${mandir}/man3
54
+ pkgconfigdir = ${libdir}/pkgconfig
55
+
56
+ OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
57
+ gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
58
+
59
+ PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo \
60
+ gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
61
+
62
+ # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
63
+ OBJA =
64
+ PIC_OBJA =
65
+
66
+ OBJS = $(OBJC) $(OBJA)
67
+
68
+ PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
69
+
70
+ all: static shared
71
+
72
+ static: example$(EXE) minigzip$(EXE)
73
+
74
+ shared: examplesh$(EXE) minigzipsh$(EXE)
75
+
76
+ all64: example64$(EXE) minigzip64$(EXE)
77
+
78
+ check: test
79
+
80
+ test: all teststatic testshared
81
+
82
+ teststatic: static
83
+ @if echo hello world | ./minigzip | ./minigzip -d && ./example; then \
84
+ echo ' *** zlib test OK ***'; \
85
+ else \
86
+ echo ' *** zlib test FAILED ***'; false; \
87
+ fi
88
+ -@rm -f foo.gz
89
+
90
+ testshared: shared
91
+ @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
92
+ LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
93
+ DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
94
+ SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
95
+ if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh; then \
96
+ echo ' *** zlib shared test OK ***'; \
97
+ else \
98
+ echo ' *** zlib shared test FAILED ***'; false; \
99
+ fi
100
+ -@rm -f foo.gz
101
+
102
+ test64: all64
103
+ @if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64; then \
104
+ echo ' *** zlib 64-bit test OK ***'; \
105
+ else \
106
+ echo ' *** zlib 64-bit test FAILED ***'; false; \
107
+ fi
108
+ -@rm -f foo.gz
109
+
110
+ libz.a: $(OBJS)
111
+ $(AR) $@ $(OBJS)
112
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
113
+
114
+ match.o: match.S
115
+ $(CPP) match.S > _match.s
116
+ $(CC) -c _match.s
117
+ mv _match.o match.o
118
+ rm -f _match.s
119
+
120
+ match.lo: match.S
121
+ $(CPP) match.S > _match.s
122
+ $(CC) -c -fPIC _match.s
123
+ mv _match.o match.lo
124
+ rm -f _match.s
125
+
126
+ example64.o: example.c zlib.h zconf.h
127
+ $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
128
+
129
+ minigzip64.o: minigzip.c zlib.h zconf.h
130
+ $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
131
+
132
+ .SUFFIXES: .lo
133
+
134
+ .c.lo:
135
+ -@mkdir objs 2>/dev/null || test -d objs
136
+ $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
137
+ -@mv objs/$*.o $@
138
+
139
+ $(SHAREDLIBV): $(PIC_OBJS)
140
+ $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
141
+ rm -f $(SHAREDLIB) $(SHAREDLIBM)
142
+ ln -s $@ $(SHAREDLIB)
143
+ ln -s $@ $(SHAREDLIBM)
144
+ -@rmdir objs
145
+
146
+ example$(EXE): example.o $(STATICLIB)
147
+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
148
+
149
+ minigzip$(EXE): minigzip.o $(STATICLIB)
150
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
151
+
152
+ examplesh$(EXE): example.o $(SHAREDLIBV)
153
+ $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
154
+
155
+ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
156
+ $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
157
+
158
+ example64$(EXE): example64.o $(STATICLIB)
159
+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
160
+
161
+ minigzip64$(EXE): minigzip64.o $(STATICLIB)
162
+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
163
+
164
+ install-libs: $(LIBS)
165
+ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
166
+ -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
167
+ -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
168
+ -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
169
+ -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
170
+ cp $(STATICLIB) $(DESTDIR)$(libdir)
171
+ cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
172
+ cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
173
+ -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
174
+ -@cd $(DESTDIR)$(sharedlibdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
175
+ chmod 755 $(SHAREDLIBV); \
176
+ rm -f $(SHAREDLIB) $(SHAREDLIBM); \
177
+ ln -s $(SHAREDLIBV) $(SHAREDLIB); \
178
+ ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
179
+ ($(LDCONFIG) || true) >/dev/null 2>&1; \
180
+ fi
181
+ cp zlib.3 $(DESTDIR)$(man3dir)
182
+ chmod 644 $(DESTDIR)$(man3dir)/zlib.3
183
+ cp zlib.pc $(DESTDIR)$(pkgconfigdir)
184
+ chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
185
+ # The ranlib in install is needed on NeXTSTEP which checks file times
186
+ # ldconfig is for Linux
187
+
188
+ install: install-libs
189
+ -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
190
+ cp zlib.h zconf.h $(DESTDIR)$(includedir)
191
+ chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
192
+
193
+ uninstall:
194
+ cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
195
+ cd $(DESTDIR)$(libdir); rm -f libz.a; \
196
+ if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
197
+ rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
198
+ fi
199
+ cd $(DESTDIR)$(man3dir); rm -f zlib.3
200
+ cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
201
+
202
+ docs: zlib.3.pdf
203
+
204
+ zlib.3.pdf: zlib.3
205
+ groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
206
+
207
+ zconf.h.in: zconf.h.cmakein
208
+ sed "/^#cmakedefine/D" < zconf.h.cmakein > zconf.h.in
209
+ touch -r zconf.h.cmakein zconf.h.in
210
+
211
+ zconf: zconf.h.in
212
+ cp -p zconf.h.in zconf.h
213
+
214
+ mostlyclean: clean
215
+ clean:
216
+ rm -f *.o *.lo *~ \
217
+ example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
218
+ example64$(EXE) minigzip64$(EXE) \
219
+ libz.* foo.gz so_locations \
220
+ _match.s maketree contrib/infback9/*.o
221
+ rm -rf objs
222
+
223
+ maintainer-clean: distclean
224
+ distclean: clean zconf docs
225
+ rm -f Makefile zlib.pc
226
+ -@rm -f .DS_Store
227
+ -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile
228
+ -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
229
+ -@touch -r Makefile.in Makefile
230
+
231
+ tags:
232
+ etags *.[ch]
233
+
234
+ depend:
235
+ makedepend -- $(CFLAGS) -- *.[ch]
236
+
237
+ # DO NOT DELETE THIS LINE -- make depend depends on it.
238
+
239
+ adler32.o zutil.o: zutil.h zlib.h zconf.h
240
+ gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
241
+ compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
242
+ crc32.o: zutil.h zlib.h zconf.h crc32.h
243
+ deflate.o: deflate.h zutil.h zlib.h zconf.h
244
+ infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
245
+ inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
246
+ inftrees.o: zutil.h zlib.h zconf.h inftrees.h
247
+ trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
248
+
249
+ adler32.lo zutil.lo: zutil.h zlib.h zconf.h
250
+ gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
251
+ compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
252
+ crc32.lo: zutil.h zlib.h zconf.h crc32.h
253
+ deflate.lo: deflate.h zutil.h zlib.h zconf.h
254
+ infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
255
+ inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
256
+ inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
257
+ trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h
@@ -0,0 +1,169 @@
1
+ /* adler32.c -- compute the Adler-32 checksum of a data stream
2
+ * Copyright (C) 1995-2007 Mark Adler
3
+ * For conditions of distribution and use, see copyright notice in zlib.h
4
+ */
5
+
6
+ /* @(#) $Id$ */
7
+
8
+ #include "zutil.h"
9
+
10
+ #define local static
11
+
12
+ local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
13
+
14
+ #define BASE 65521UL /* largest prime smaller than 65536 */
15
+ #define NMAX 5552
16
+ /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
17
+
18
+ #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
19
+ #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
20
+ #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
21
+ #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
22
+ #define DO16(buf) DO8(buf,0); DO8(buf,8);
23
+
24
+ /* use NO_DIVIDE if your processor does not do division in hardware */
25
+ #ifdef NO_DIVIDE
26
+ # define MOD(a) \
27
+ do { \
28
+ if (a >= (BASE << 16)) a -= (BASE << 16); \
29
+ if (a >= (BASE << 15)) a -= (BASE << 15); \
30
+ if (a >= (BASE << 14)) a -= (BASE << 14); \
31
+ if (a >= (BASE << 13)) a -= (BASE << 13); \
32
+ if (a >= (BASE << 12)) a -= (BASE << 12); \
33
+ if (a >= (BASE << 11)) a -= (BASE << 11); \
34
+ if (a >= (BASE << 10)) a -= (BASE << 10); \
35
+ if (a >= (BASE << 9)) a -= (BASE << 9); \
36
+ if (a >= (BASE << 8)) a -= (BASE << 8); \
37
+ if (a >= (BASE << 7)) a -= (BASE << 7); \
38
+ if (a >= (BASE << 6)) a -= (BASE << 6); \
39
+ if (a >= (BASE << 5)) a -= (BASE << 5); \
40
+ if (a >= (BASE << 4)) a -= (BASE << 4); \
41
+ if (a >= (BASE << 3)) a -= (BASE << 3); \
42
+ if (a >= (BASE << 2)) a -= (BASE << 2); \
43
+ if (a >= (BASE << 1)) a -= (BASE << 1); \
44
+ if (a >= BASE) a -= BASE; \
45
+ } while (0)
46
+ # define MOD4(a) \
47
+ do { \
48
+ if (a >= (BASE << 4)) a -= (BASE << 4); \
49
+ if (a >= (BASE << 3)) a -= (BASE << 3); \
50
+ if (a >= (BASE << 2)) a -= (BASE << 2); \
51
+ if (a >= (BASE << 1)) a -= (BASE << 1); \
52
+ if (a >= BASE) a -= BASE; \
53
+ } while (0)
54
+ #else
55
+ # define MOD(a) a %= BASE
56
+ # define MOD4(a) a %= BASE
57
+ #endif
58
+
59
+ /* ========================================================================= */
60
+ uLong ZEXPORT adler32(adler, buf, len)
61
+ uLong adler;
62
+ const Bytef *buf;
63
+ uInt len;
64
+ {
65
+ unsigned long sum2;
66
+ unsigned n;
67
+
68
+ /* split Adler-32 into component sums */
69
+ sum2 = (adler >> 16) & 0xffff;
70
+ adler &= 0xffff;
71
+
72
+ /* in case user likes doing a byte at a time, keep it fast */
73
+ if (len == 1) {
74
+ adler += buf[0];
75
+ if (adler >= BASE)
76
+ adler -= BASE;
77
+ sum2 += adler;
78
+ if (sum2 >= BASE)
79
+ sum2 -= BASE;
80
+ return adler | (sum2 << 16);
81
+ }
82
+
83
+ /* initial Adler-32 value (deferred check for len == 1 speed) */
84
+ if (buf == Z_NULL)
85
+ return 1L;
86
+
87
+ /* in case short lengths are provided, keep it somewhat fast */
88
+ if (len < 16) {
89
+ while (len--) {
90
+ adler += *buf++;
91
+ sum2 += adler;
92
+ }
93
+ if (adler >= BASE)
94
+ adler -= BASE;
95
+ MOD4(sum2); /* only added so many BASE's */
96
+ return adler | (sum2 << 16);
97
+ }
98
+
99
+ /* do length NMAX blocks -- requires just one modulo operation */
100
+ while (len >= NMAX) {
101
+ len -= NMAX;
102
+ n = NMAX / 16; /* NMAX is divisible by 16 */
103
+ do {
104
+ DO16(buf); /* 16 sums unrolled */
105
+ buf += 16;
106
+ } while (--n);
107
+ MOD(adler);
108
+ MOD(sum2);
109
+ }
110
+
111
+ /* do remaining bytes (less than NMAX, still just one modulo) */
112
+ if (len) { /* avoid modulos if none remaining */
113
+ while (len >= 16) {
114
+ len -= 16;
115
+ DO16(buf);
116
+ buf += 16;
117
+ }
118
+ while (len--) {
119
+ adler += *buf++;
120
+ sum2 += adler;
121
+ }
122
+ MOD(adler);
123
+ MOD(sum2);
124
+ }
125
+
126
+ /* return recombined sums */
127
+ return adler | (sum2 << 16);
128
+ }
129
+
130
+ /* ========================================================================= */
131
+ local uLong adler32_combine_(adler1, adler2, len2)
132
+ uLong adler1;
133
+ uLong adler2;
134
+ z_off64_t len2;
135
+ {
136
+ unsigned long sum1;
137
+ unsigned long sum2;
138
+ unsigned rem;
139
+
140
+ /* the derivation of this formula is left as an exercise for the reader */
141
+ rem = (unsigned)(len2 % BASE);
142
+ sum1 = adler1 & 0xffff;
143
+ sum2 = rem * sum1;
144
+ MOD(sum2);
145
+ sum1 += (adler2 & 0xffff) + BASE - 1;
146
+ sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
147
+ if (sum1 >= BASE) sum1 -= BASE;
148
+ if (sum1 >= BASE) sum1 -= BASE;
149
+ if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
150
+ if (sum2 >= BASE) sum2 -= BASE;
151
+ return sum1 | (sum2 << 16);
152
+ }
153
+
154
+ /* ========================================================================= */
155
+ uLong ZEXPORT adler32_combine(adler1, adler2, len2)
156
+ uLong adler1;
157
+ uLong adler2;
158
+ z_off_t len2;
159
+ {
160
+ return adler32_combine_(adler1, adler2, len2);
161
+ }
162
+
163
+ uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
164
+ uLong adler1;
165
+ uLong adler2;
166
+ z_off64_t len2;
167
+ {
168
+ return adler32_combine_(adler1, adler2, len2);
169
+ }
@@ -0,0 +1,80 @@
1
+ /* compress.c -- compress a memory buffer
2
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
3
+ * For conditions of distribution and use, see copyright notice in zlib.h
4
+ */
5
+
6
+ /* @(#) $Id$ */
7
+
8
+ #define ZLIB_INTERNAL
9
+ #include "zlib.h"
10
+
11
+ /* ===========================================================================
12
+ Compresses the source buffer into the destination buffer. The level
13
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
14
+ length of the source buffer. Upon entry, destLen is the total size of the
15
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
16
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
17
+
18
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
19
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
20
+ Z_STREAM_ERROR if the level parameter is invalid.
21
+ */
22
+ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
23
+ Bytef *dest;
24
+ uLongf *destLen;
25
+ const Bytef *source;
26
+ uLong sourceLen;
27
+ int level;
28
+ {
29
+ z_stream stream;
30
+ int err;
31
+
32
+ stream.next_in = (Bytef*)source;
33
+ stream.avail_in = (uInt)sourceLen;
34
+ #ifdef MAXSEG_64K
35
+ /* Check for source > 64K on 16-bit machine: */
36
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
37
+ #endif
38
+ stream.next_out = dest;
39
+ stream.avail_out = (uInt)*destLen;
40
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
41
+
42
+ stream.zalloc = (alloc_func)0;
43
+ stream.zfree = (free_func)0;
44
+ stream.opaque = (voidpf)0;
45
+
46
+ err = deflateInit(&stream, level);
47
+ if (err != Z_OK) return err;
48
+
49
+ err = deflate(&stream, Z_FINISH);
50
+ if (err != Z_STREAM_END) {
51
+ deflateEnd(&stream);
52
+ return err == Z_OK ? Z_BUF_ERROR : err;
53
+ }
54
+ *destLen = stream.total_out;
55
+
56
+ err = deflateEnd(&stream);
57
+ return err;
58
+ }
59
+
60
+ /* ===========================================================================
61
+ */
62
+ int ZEXPORT compress (dest, destLen, source, sourceLen)
63
+ Bytef *dest;
64
+ uLongf *destLen;
65
+ const Bytef *source;
66
+ uLong sourceLen;
67
+ {
68
+ return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
69
+ }
70
+
71
+ /* ===========================================================================
72
+ If the default memLevel or windowBits for deflateInit() is changed, then
73
+ this function needs to be updated.
74
+ */
75
+ uLong ZEXPORT compressBound (sourceLen)
76
+ uLong sourceLen;
77
+ {
78
+ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
79
+ (sourceLen >> 25) + 13;
80
+ }