SHA256
1
0
forked from pool/lz4
Jan Engelhardt 2016-04-02 23:45:52 +00:00 committed by Git OBS Bridge
parent 3f17948b3e
commit fb8c9d8784
2 changed files with 48 additions and 10 deletions

View File

@ -4,14 +4,23 @@ Date: 2014-10-01 14:23:22.000000000 +0200
build: make programs use liblz too instead of duplicating object code.
---
programs/Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
programs/Makefile | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: lz4-r131/programs/Makefile
===================================================================
--- lz4-r131.orig/programs/Makefile
+++ lz4-r131/programs/Makefile
@@ -72,11 +72,11 @@ bins: lz4 lz4c fullbench fuzzer frametes
@@ -40,7 +40,7 @@ DESTDIR?=
PREFIX ?= /usr/local
CFLAGS ?= -O3
CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\"
-FLAGS := -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+FLAGS := -DXXH_NAMESPACE=LZ4_ -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
BINDIR := $(PREFIX)/bin
MANDIR := $(PREFIX)/share/man/man1
@@ -72,32 +72,32 @@ bins: lz4 lz4c fullbench fuzzer frametes
all: bins m32
@ -20,10 +29,37 @@ Index: lz4-r131/programs/Makefile
+lz4: bench.c lz4io.c lz4cli.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
-lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
- $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
+lz4c : bench.c lz4io.c lz4cli.c
+ $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -L${LZ4DIR} -llz4
lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
$(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
- $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
+ $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -L${LZ4DIR} -llz4
fullbench : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
fullbench32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c
- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
+ $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
fuzzer : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c fuzzer.c
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
fuzzer32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c fuzzer.c
- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
+ $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
frametest: $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c frametest.c
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
frametest32: $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c frametest.c
- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
+ $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
datagen : datagen.c datagencli.c
$(CC) $(FLAGS) $^ -o $@$(EXT)

View File

@ -75,14 +75,16 @@ applications that want to make use of liblz4.
%build
# Goddammit, lz4
perl -i -pe 's{^\t@}{\t}g' Makefile */Makefile
make -C lib %{?_smp_mflags} CFLAGS="%optflags"
make -C programs %{?_smp_mflags} CFLAGS="%optflags" lz4 lz4c
# don't bother building here, because make install builds it again - unconditionally :-(
%install
make install DESTDIR="%buildroot" PREFIX="%_prefix" LIBDIR="%_libdir"
make install CFLAGS="%optflags -DXXH_NAMESPACE=LZ4_" \
DESTDIR="%buildroot" PREFIX="%_prefix" LIBDIR="%_libdir"
rm -f "%buildroot/%_libdir"/*.a
%check
LD_LIBRARY_PATH="%buildroot/%_libdir" ldd -r "%buildroot/%_bindir/lz4"
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig