SHA256
1
0
forked from pool/lz4
lz4/lz4-use-shlib.diff

48 lines
1.3 KiB
Diff

From: Jan Engelhardt <jengelh@inai.de>
Date: 2014-10-01 14:23:22.000000000 +0200
References: https://github.com/Cyan4973/lz4/pull/195
build: make programs use liblz too instead of duplicating object code.
---
programs/Makefile | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: lz4-1.7.5/programs/Makefile
===================================================================
--- lz4-1.7.5.orig/programs/Makefile
+++ lz4-1.7.5/programs/Makefile
@@ -40,7 +40,7 @@ LIBVER := $(shell echo $(LIBVER_SCRIPT)
LZ4DIR := ../lib
-SRCFILES := $(wildcard $(LZ4DIR)/*.c) $(wildcard *.c)
+SRCFILES := $(wildcard *.c)
OBJFILES := $(patsubst %.c,%.o,$(SRCFILES))
CPPFLAGS+= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
@@ -75,19 +75,19 @@ all32: CFLAGS+=-m32
all32: all
lz4: CFLAGS += $(DEBUGFLAGS)
-lz4: $(OBJFILES)
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+lz4: $(SRCFILES)
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
lz4-release: DEBUGFLAGS=
lz4-release: lz4
lz4c : CFLAGS += $(DEBUGFLAGS)
lz4c : $(SRCFILES)
- $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
+ $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -L${LZ4DIR} -llz4
lz4c32: CFLAGS += -m32 $(DEBUGFLAGS)
lz4c32: $(SRCFILES)
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -L${LZ4DIR} -llz4
clean:
@$(MAKE) -C $(LZ4DIR) $@ > $(VOID)