zstd 1.1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.travis.yml +5 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +64 -0
  7. data/Rakefile +19 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/exe/zstd +3 -0
  11. data/ext/zstd/extconf.rb +20 -0
  12. data/ext/zstd/libzstd/.gitignore +2 -0
  13. data/ext/zstd/libzstd/LICENSE +1262 -0
  14. data/ext/zstd/libzstd/Makefile +133 -0
  15. data/ext/zstd/libzstd/PATENTS +1272 -0
  16. data/ext/zstd/libzstd/README.md +77 -0
  17. data/ext/zstd/libzstd/common/bitstream.h +414 -0
  18. data/ext/zstd/libzstd/common/entropy_common.c +227 -0
  19. data/ext/zstd/libzstd/common/error_private.c +43 -0
  20. data/ext/zstd/libzstd/common/error_private.h +76 -0
  21. data/ext/zstd/libzstd/common/fse.h +668 -0
  22. data/ext/zstd/libzstd/common/fse_decompress.c +329 -0
  23. data/ext/zstd/libzstd/common/huf.h +238 -0
  24. data/ext/zstd/libzstd/common/mem.h +372 -0
  25. data/ext/zstd/libzstd/common/xxhash.c +867 -0
  26. data/ext/zstd/libzstd/common/xxhash.h +309 -0
  27. data/ext/zstd/libzstd/common/zstd_common.c +77 -0
  28. data/ext/zstd/libzstd/common/zstd_errors.h +60 -0
  29. data/ext/zstd/libzstd/common/zstd_internal.h +270 -0
  30. data/ext/zstd/libzstd/compress/fse_compress.c +850 -0
  31. data/ext/zstd/libzstd/compress/huf_compress.c +609 -0
  32. data/ext/zstd/libzstd/compress/zstd_compress.c +3291 -0
  33. data/ext/zstd/libzstd/compress/zstd_opt.h +919 -0
  34. data/ext/zstd/libzstd/decompress/huf_decompress.c +885 -0
  35. data/ext/zstd/libzstd/decompress/zstd_decompress.c +2154 -0
  36. data/ext/zstd/libzstd/deprecated/zbuff.h +210 -0
  37. data/ext/zstd/libzstd/deprecated/zbuff_compress.c +145 -0
  38. data/ext/zstd/libzstd/deprecated/zbuff_decompress.c +74 -0
  39. data/ext/zstd/libzstd/dictBuilder/divsufsort.c +1913 -0
  40. data/ext/zstd/libzstd/dictBuilder/divsufsort.h +67 -0
  41. data/ext/zstd/libzstd/dictBuilder/zdict.c +1012 -0
  42. data/ext/zstd/libzstd/dictBuilder/zdict.h +111 -0
  43. data/ext/zstd/libzstd/dll/example/Makefile +47 -0
  44. data/ext/zstd/libzstd/dll/example/README.md +69 -0
  45. data/ext/zstd/libzstd/dll/example/build_package.bat +17 -0
  46. data/ext/zstd/libzstd/dll/example/fullbench-dll.sln +25 -0
  47. data/ext/zstd/libzstd/dll/example/fullbench-dll.vcxproj +179 -0
  48. data/ext/zstd/libzstd/dll/libzstd.def +86 -0
  49. data/ext/zstd/libzstd/legacy/zstd_legacy.h +259 -0
  50. data/ext/zstd/libzstd/legacy/zstd_v01.c +2095 -0
  51. data/ext/zstd/libzstd/legacy/zstd_v01.h +80 -0
  52. data/ext/zstd/libzstd/legacy/zstd_v02.c +3518 -0
  53. data/ext/zstd/libzstd/legacy/zstd_v02.h +79 -0
  54. data/ext/zstd/libzstd/legacy/zstd_v03.c +3159 -0
  55. data/ext/zstd/libzstd/legacy/zstd_v03.h +79 -0
  56. data/ext/zstd/libzstd/legacy/zstd_v04.c +3795 -0
  57. data/ext/zstd/libzstd/legacy/zstd_v04.h +128 -0
  58. data/ext/zstd/libzstd/legacy/zstd_v05.c +4056 -0
  59. data/ext/zstd/libzstd/legacy/zstd_v05.h +149 -0
  60. data/ext/zstd/libzstd/legacy/zstd_v06.c +4167 -0
  61. data/ext/zstd/libzstd/legacy/zstd_v06.h +159 -0
  62. data/ext/zstd/libzstd/legacy/zstd_v07.c +4540 -0
  63. data/ext/zstd/libzstd/legacy/zstd_v07.h +173 -0
  64. data/ext/zstd/libzstd/libzstd.pc.in +14 -0
  65. data/ext/zstd/libzstd/zstd.h +673 -0
  66. data/ext/zstd/zstd.c +185 -0
  67. data/ext/zstd/zstd.h +7 -0
  68. data/lib/zstd/version.rb +3 -0
  69. data/lib/zstd.rb +6 -0
  70. data/zstd.gemspec +38 -0
  71. metadata +172 -0
@@ -0,0 +1,133 @@
1
+ # ################################################################
2
+ # Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
3
+ # All rights reserved.
4
+ #
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree. An additional grant
7
+ # of patent rights can be found in the PATENTS file in the same directory.
8
+ # ################################################################
9
+
10
+ # Version numbers
11
+ LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
12
+ LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
13
+ LIBVER_PATCH_SCRIPT:=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
14
+ LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
15
+ LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
16
+ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
17
+ LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
18
+ LIBVER := $(shell echo $(LIBVER_SCRIPT))
19
+ VERSION?= $(LIBVER)
20
+
21
+ DESTDIR?=
22
+ PREFIX ?= /usr/local
23
+ LIBDIR ?= $(PREFIX)/lib
24
+ INCLUDEDIR=$(PREFIX)/include
25
+
26
+ CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_
27
+ CFLAGS ?= -O3
28
+ CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
29
+ -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \
30
+ -Wpointer-arith
31
+ CFLAGS += $(MOREFLAGS)
32
+ FLAGS = $(CPPFLAGS) $(CFLAGS)
33
+
34
+
35
+ ZSTD_FILES := $(wildcard common/*.c compress/*.c decompress/*.c dictBuilder/*.c deprecated/*.c)
36
+
37
+ ifeq ($(ZSTD_LEGACY_SUPPORT), 0)
38
+ CPPFLAGS += -DZSTD_LEGACY_SUPPORT=0
39
+ else
40
+ CPPFLAGS += -I./legacy -DZSTD_LEGACY_SUPPORT=1
41
+ ZSTD_FILES+= $(wildcard legacy/*.c)
42
+ endif
43
+
44
+ # OS X linker doesn't support -soname, and use different extension
45
+ # see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
46
+ ifeq ($(shell uname), Darwin)
47
+ SHARED_EXT = dylib
48
+ SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT)
49
+ SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT)
50
+ SONAME_FLAGS = -install_name $(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER)
51
+ else
52
+ SONAME_FLAGS = -Wl,-soname=libzstd.$(SHARED_EXT).$(LIBVER_MAJOR)
53
+ SHARED_EXT = so
54
+ SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR)
55
+ SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
56
+ endif
57
+
58
+ LIBZSTD = libzstd.$(SHARED_EXT_VER)
59
+
60
+
61
+ .PHONY: default all clean install uninstall
62
+
63
+ default: lib
64
+
65
+ all: lib
66
+
67
+ libzstd.a: ARFLAGS = rcs
68
+ libzstd.a: $(ZSTD_FILES)
69
+ @echo compiling static library
70
+ @$(CC) $(FLAGS) -c $^
71
+ @$(AR) $(ARFLAGS) $@ *.o
72
+
73
+ $(LIBZSTD): LDFLAGS += -shared -fPIC -fvisibility=hidden
74
+ $(LIBZSTD): $(ZSTD_FILES)
75
+ @echo compiling dynamic library $(LIBVER)
76
+ ifneq (,$(filter Windows%,$(OS)))
77
+ @$(CC) $(FLAGS) -DZSTD_DLL_EXPORT=1 -shared $^ -o dll\libzstd.dll
78
+ dlltool -D dll\libzstd.dll -d dll\libzstd.def -l dll\libzstd.lib
79
+ else
80
+ @$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
81
+ @echo creating versioned links
82
+ @ln -sf $@ libzstd.$(SHARED_EXT_MAJOR)
83
+ @ln -sf $@ libzstd.$(SHARED_EXT)
84
+ endif
85
+
86
+ libzstd : $(LIBZSTD)
87
+
88
+ lib: libzstd.a libzstd
89
+
90
+ clean:
91
+ @$(RM) core *.o *.a *.gcda *.$(SHARED_EXT) *.$(SHARED_EXT).* libzstd.pc dll/libzstd.dll dll/libzstd.lib
92
+ @$(RM) decompress/*.o
93
+ @echo Cleaning library completed
94
+
95
+ #------------------------------------------------------------------------
96
+ #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets
97
+ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD))
98
+
99
+ libzstd.pc:
100
+ libzstd.pc: libzstd.pc.in
101
+ @echo creating pkgconfig
102
+ @sed -e 's|@PREFIX@|$(PREFIX)|' \
103
+ -e 's|@LIBDIR@|$(LIBDIR)|' \
104
+ -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \
105
+ -e 's|@VERSION@|$(VERSION)|' \
106
+ $< >$@
107
+
108
+ install: libzstd.a libzstd libzstd.pc
109
+ @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/
110
+ @install -m 755 libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)
111
+ @cp -a libzstd.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR)
112
+ @cp -a libzstd.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
113
+ @cp -a libzstd.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
114
+ @install -m 644 libzstd.a $(DESTDIR)$(LIBDIR)
115
+ @install -m 644 zstd.h $(DESTDIR)$(INCLUDEDIR)
116
+ @install -m 644 common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
117
+ @install -m 644 deprecated/zbuff.h $(DESTDIR)$(INCLUDEDIR) # prototypes generate deprecation warnings
118
+ @install -m 644 dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)
119
+ @echo zstd static and shared library installed
120
+
121
+ uninstall:
122
+ @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.a
123
+ @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
124
+ @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
125
+ @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_VER)
126
+ @$(RM) $(DESTDIR)$(LIBDIR)/pkgconfig/libzstd.pc
127
+ @$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd.h
128
+ @$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd_errors.h
129
+ @$(RM) $(DESTDIR)$(INCLUDEDIR)/zbuff.h # Deprecated streaming functions
130
+ @$(RM) $(DESTDIR)$(INCLUDEDIR)/zdict.h
131
+ @echo zstd libraries successfully uninstalled
132
+
133
+ endif