Skip to content

Commit

Permalink
add miniz
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Oct 25, 2022
1 parent e557c65 commit c655c56
Show file tree
Hide file tree
Showing 8 changed files with 9,375 additions and 6 deletions.
18 changes: 14 additions & 4 deletions src/Makefile
Expand Up @@ -11,6 +11,7 @@ ZMATDIR ?=$(ROOTDIR)
LIBDIR ?=$(ROOTDIR)/lib

MKDIR :=mkdir
HAVE_MINIZ ?=no
HAVE_LZMA ?=yes
HAVE_LZ4 ?=yes
HAVE_ZSTD ?=yes
Expand Down Expand Up @@ -64,6 +65,14 @@ else
endif
endif

ifeq ($(HAVE_MINIZ),no)
CFLAGS+=-DNO_MINIZ
LINKOPT+=-lz
else
INCLUDEDIRS+=-Iminiz
FILES+=miniz/miniz
endif

ifeq ($(HAVE_LZMA),no)
CFLAGS+=-DNO_LZMA
else
Expand Down Expand Up @@ -122,15 +131,16 @@ ifeq ($(MAKECMDGOALS),dll)
OUTPUTFLAG :=-o
BINARY :=libzmat.so.1
OUTPUT_DIR :=$(LIBDIR)
LINKOPT +=-lz

ifeq ($(findstring Darwin,$(PLATFORM)), Darwin)
ARFLAGS :=-shared -Wl,-install_name,$(BINARY) -lz
ARFLAGS :=-shared -Wl,-install_name,$(BINARY)
else
ARFLAGS :=-shared -Wl,-soname,$(BINARY) -lz
ARFLAGS :=-shared -Wl,-soname,$(BINARY)
endif
endif

export HAVE_MINIZ HAVE_LZ4 HAVE_ZSTD

dll: CPPOPT +=$(DLLFLAG)
dll: ARFLAGS ?=-shared -Wl,-soname,$(BINARY).1
dll: LINKOPT +=$(LDFLAGS)
Expand All @@ -146,7 +156,7 @@ oct: LINKOPT+=--mex $(INCLUDEDIRS)
mex: CXX=$(MEX)
mex: OUTPUTFLAG:=-output
mex: AR=$(MEX) zmat.cpp $(INCLUDEDIRS)
mex: LINKOPT+= -cxx CXXLIBS='$$CXXLIBS -lz -static-libgcc -static-libstdc++' -outdir $(ZMATDIR)
mex: LINKOPT+= -cxx CXXLIBS='$$CXXLIBS -static-libgcc -static-libstdc++' -outdir $(ZMATDIR)
mex: ARFLAGS :=
mex: OUTPUT_DIR=..

Expand Down
21 changes: 20 additions & 1 deletion src/blosc2/blosc/Makefile
Expand Up @@ -19,6 +19,10 @@ ECHO := echo
BINARY:=blosc2
OUTPUT_DIR=$(ZMATDIR)

HAVE_MINIZ ?=yes
HAVE_LZ4 ?=yes
HAVE_ZSTD ?=yes

DOXY := doxygen
DOCDIR := $(ZMATDIR)/doc
DOXYCFG=zmat.cfg
Expand All @@ -32,7 +36,22 @@ PLATFORM = $(shell uname -s)

DLLFLAG=-fPIC

CPPOPT=-g -Wall -Wextra -O3 -msse2 -DHAVE_ZSTD -DHAVE_ZLIB -DHAVE_LZ4 -DNDEBUG $(DLLFLAG) -std=gnu99 #-g -Wall -std=c99 # -DUSE_OS_TIMER
CPPOPT=-g -Wall -Wextra -O3 -msse2 -DNDEBUG $(DLLFLAG) -std=gnu99 #-g -Wall -std=c99 # -DUSE_OS_TIMER

ifeq ($(HAVE_MINIZ),yes)
CPPOPT+= -DHAVE_MINIZ
else
CPPOPT+= -DHAVE_ZLIB
endif

ifeq ($(HAVE_LZ4),yes)
CPPOPT+= -DHAVE_LZ4
endif

ifeq ($(HAVE_ZSTD),yes)
CPPOPT+= -DHAVE_ZSTD
endif


OUTPUTFLAG:=-o
OBJSUFFIX=.o
Expand Down
196 changes: 196 additions & 0 deletions src/miniz/ChangeLog.md

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/miniz/LICENSE
@@ -0,0 +1,22 @@
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC

All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

0 comments on commit c655c56

Please sign in to comment.