aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-09-24 13:48:41 -0700
committerSean Whitton <spwhitton@spwhitton.name>2016-09-24 13:48:41 -0700
commitc758a3ca08604b2563a985f862da34652604a85e (patch)
treef32a5cb8afa65caff7ce49f8002e0fb07b1bc8f2
parent8fc35711277d62b3b8cfb2690dfa2fc8df5e2430 (diff)
downloadzxcvbn-c-c758a3ca08604b2563a985f862da34652604a85e.tar.gz
pass all LDFLAGS
-rw-r--r--debian/patches/targets-to-build-shlib.patch15
1 files changed, 8 insertions, 7 deletions
diff --git a/debian/patches/targets-to-build-shlib.patch b/debian/patches/targets-to-build-shlib.patch
index c9e8729..0a78e02 100644
--- a/debian/patches/targets-to-build-shlib.patch
+++ b/debian/patches/targets-to-build-shlib.patch
@@ -5,14 +5,14 @@ Subject: targets to build shlib
Upstream suggests embedding this library in projects that require it.
This patch adds targets to build a shared library, instead.
---
- makefile | 20 +++++++++++++++++---
- 1 file changed, 17 insertions(+), 3 deletions(-)
+ makefile | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/makefile b/makefile
-index 2b06881..7c43b1f 100644
+index 2b06881..794de48 100644
--- a/makefile
+++ b/makefile
-@@ -1,9 +1,21 @@
+@@ -1,9 +1,22 @@
CFLAGS ?= -O2 -Wall -Wextra -Wdeclaration-after-statement
CPPFLAGS ?= -O2 -Wall -Wextra
@@ -20,6 +20,7 @@ index 2b06881..7c43b1f 100644
+CPPFLAGS += -fPIC -I.
+TARGET_LIB = libzxcvbn.so.0
+SONAME = libzxcvbn.so.0
++LDFLAGS += -shared
+
WORDS = words-10k-pass.txt words-english.txt words-female.txt words-male.txt words-surname.txt
@@ -31,11 +32,11 @@ index 2b06881..7c43b1f 100644
+ gcc $(CFLAGS) -o $@ test.c -L. -lm -lzxcvbn
+
+$(TARGET_LIB): zxcvbn-inline.o
-+ gcc $(CFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ -lm
++ gcc $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^ -lm
test-file: test.c zxcvbn-file.o
gcc $(CFLAGS) -DUSE_DICT_FILE -o test-file test.c zxcvbn-file.o -lm
-@@ -42,11 +54,13 @@ zxcvbn-c++file.o: zxcvbn.c dict-crc.h zxcvbn.h
+@@ -42,11 +55,13 @@ zxcvbn-c++file.o: zxcvbn.c dict-crc.h zxcvbn.h
if [ ! -e zxcvbn.cpp ]; then ln -s zxcvbn.c zxcvbn.cpp; fi
g++ $(CPPFLAGS) -DUSE_DICT_FILE -c -o zxcvbn-c++file.o zxcvbn.cpp
@@ -50,7 +51,7 @@ index 2b06881..7c43b1f 100644
@echo Testing C++ build, dictionary from file
./test-c++file -t testcases.txt
@echo Testing C++ build, dictionary in executable
-@@ -57,4 +71,4 @@ clean:
+@@ -57,4 +72,4 @@ clean:
rm -f test-file zxcvbn-file.o test-c++file zxcvbn-c++file.o
rm -f test-inline zxcvbn-inline.o test-c++inline zxcvbn-c++inline.o
rm -f dictgen