diff options
author | Baruch Siach <baruch@tkos.co.il> | 2018-04-19 09:28:11 (GMT) |
---|---|---|
committer | Baruch Siach <baruch@tkos.co.il> | 2018-04-19 09:28:11 (GMT) |
commit | 95bde2a4ae4a92e984a5783ca1f09f44bf04fadb (patch) | |
tree | 2c7d8558d81ae7b6a9b402ba58d9acf937acc98d /lib | |
parent | c6301479c5a85aa32d6060b3976995c1ad85a58f (diff) | |
download | lz4-95bde2a4ae4a92e984a5783ca1f09f44bf04fadb.zip lz4-95bde2a4ae4a92e984a5783ca1f09f44bf04fadb.tar.gz lz4-95bde2a4ae4a92e984a5783ca1f09f44bf04fadb.tar.bz2 |
lib: allow to disable shared libraries
Just like BUILD_STATIC=no disables static libraries, BUILD_SHARED=no
disabled shared libraries. This is useful to support toolchains that do
not support shared libraries.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile index dd33f50..976d57c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -42,6 +42,7 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT)) LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT)) LIBVER := $(shell echo $(LIBVER_SCRIPT)) +BUILD_SHARED:=yes BUILD_STATIC:=yes CPPFLAGS+= -DXXH_NAMESPACE=LZ4_ @@ -92,6 +93,7 @@ ifeq ($(BUILD_STATIC),yes) # can be disabled on command line endif $(LIBLZ4): $(SRCFILES) +ifeq ($(BUILD_SHARED),yes) # can be disabled on command line @echo compiling dynamic library $(LIBVER) ifneq (,$(filter Windows%,$(OS))) @$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll\$@.dll @@ -102,6 +104,7 @@ else @ln -sf $@ liblz4.$(SHARED_EXT_MAJOR) @ln -sf $@ liblz4.$(SHARED_EXT) endif +endif liblz4: $(LIBLZ4) @@ -159,9 +162,11 @@ ifeq ($(BUILD_STATIC),yes) @$(INSTALL_DATA) liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a @$(INSTALL_DATA) lz4frame_static.h $(DESTDIR)$(INCLUDEDIR)/lz4frame_static.h endif +ifeq ($(BUILD_SHARED),yes) @$(INSTALL_PROGRAM) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR) @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) +endif @echo Installing headers in $(INCLUDEDIR) @$(INSTALL_DATA) lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h @$(INSTALL_DATA) lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h |