summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-09-03 05:04:16 (GMT)
committerYann Collet <cyan@fb.com>2016-09-03 05:04:16 (GMT)
commit28f98647e3349a4a0a9c8975199aa89f2a02f6b9 (patch)
treeb94e57fc334d30a5321c4f5c4ace2094df26f507 /lib
parentdd51ca63004b4d373f90071d12fbe8c06ef0ae1a (diff)
downloadlz4-28f98647e3349a4a0a9c8975199aa89f2a02f6b9.zip
lz4-28f98647e3349a4a0a9c8975199aa89f2a02f6b9.tar.gz
lz4-28f98647e3349a4a0a9c8975199aa89f2a02f6b9.tar.bz2
lz4 version source from lz4.h
Diffstat (limited to 'lib')
-rw-r--r--lib/.gitignore2
-rw-r--r--lib/Makefile23
-rw-r--r--lib/liblz4.pc.in2
3 files changed, 17 insertions, 10 deletions
diff --git a/lib/.gitignore b/lib/.gitignore
new file mode 100644
index 0000000..5d6f134
--- /dev/null
+++ b/lib/.gitignore
@@ -0,0 +1,2 @@
+# make install artefact
+liblz4.pc
diff --git a/lib/Makefile b/lib/Makefile
index 52e0f95..141da01 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,17 +31,21 @@
# ################################################################
# Version numbers
-VERSION?= 132
-LIBVER_MAJOR:=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h`
-LIBVER_MINOR:=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h`
-LIBVER_PATCH:=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h`
-LIBVER := $(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
+LIBVER_MAJOR_SCRIPT:=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./lz4.h`
+LIBVER_MINOR_SCRIPT:=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./lz4.h`
+LIBVER_PATCH_SCRIPT:=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./lz4.h`
+LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
+LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
+LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
+LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
+LIBVER := $(shell echo $(LIBVER_SCRIPT))
+
DESTDIR?=
PREFIX ?= /usr/local
CPPFLAGS= -DXXH_NAMESPACE=LZ4_
CFLAGS ?= -O3
-CFLAGS += -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -pedantic
+CFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
LIBDIR?= $(PREFIX)/lib
@@ -66,9 +70,10 @@ default: liblz4
all: liblz4
-liblz4: lz4.c lz4hc.c lz4frame.c xxhash.c # need to compile once with -fPIC, and once without -fPIC
+liblz4: *.c
@echo compiling static library
- @$(AR) rcs $@.a $^
+ @$(CC) $(FLAGS) -c $^
+ @$(AR) rcs $@.a *.o
@echo compiling dynamic library $(LIBVER)
@$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
@echo creating versioned links
@@ -90,7 +95,7 @@ liblz4.pc: liblz4.pc.in Makefile
@sed -e 's|@PREFIX@|$(PREFIX)|' \
-e 's|@LIBDIR@|$(LIBDIR)|' \
-e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \
- -e 's|@VERSION@|$(VERSION)|' \
+ -e 's|@VERSION@|$(LIBVER)|' \
$< >$@
install: liblz4 liblz4.pc
diff --git a/lib/liblz4.pc.in b/lib/liblz4.pc.in
index 1b29879..cb31cd7 100644
--- a/lib/liblz4.pc.in
+++ b/lib/liblz4.pc.in
@@ -7,7 +7,7 @@ libdir=@LIBDIR@
includedir=@INCLUDEDIR@
Name: lz4
-Description: fast lossless compression algorithm library
+Description: extremely fast lossless compression algorithm library
URL: http://www.lz4.org/
Version: @VERSION@
Libs: -L@LIBDIR@ -llz4