diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-09-24 15:16:30 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-09-24 15:16:30 -0700 |
commit | 46909658430cac37f313299fde0cb6e8023112c7 (patch) | |
tree | 29fa0362c41abcb1cc35889567f80adc2d92565d | |
parent | 07802bed19cd2fd7ddb632d161ebda657ecf1b3b (diff) | |
download | zxcvbn-c-46909658430cac37f313299fde0cb6e8023112c7.tar.gz |
move -fPIC out of CFLAGS
Again, we don't want this in general.
-rw-r--r-- | debian/patches/targets-to-build-shlib.patch | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/debian/patches/targets-to-build-shlib.patch b/debian/patches/targets-to-build-shlib.patch index f4027a3..b118b1e 100644 --- a/debian/patches/targets-to-build-shlib.patch +++ b/debian/patches/targets-to-build-shlib.patch @@ -5,19 +5,22 @@ 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 | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile -index 2b06881..37844d0 100644 +index 2b06881..abff060 100644 --- a/makefile +++ b/makefile -@@ -1,9 +1,21 @@ +@@ -1,9 +1,24 @@ CFLAGS ?= -O2 -Wall -Wextra -Wdeclaration-after-statement CPPFLAGS ?= -O2 -Wall -Wextra -+CFLAGS += -fPIC -I. -+CPPFLAGS += -fPIC -I. ++# need zxcvbn.h prior to package installation ++CFLAGS += -I. ++CPPFLAGS += -I. ++ ++# library metadata +TARGET_LIB = libzxcvbn.so.0 +SONAME = libzxcvbn.so.0 + @@ -31,11 +34,11 @@ index 2b06881..37844d0 100644 + gcc $(CFLAGS) -o $@ test.c -L. -lm -lzxcvbn + +$(TARGET_LIB): zxcvbn-inline.o -+ gcc $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ -lm ++ gcc $(CFLAGS) $(LDFLAGS) -fPIC -shared -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 +57,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 +53,7 @@ index 2b06881..37844d0 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 +74,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 |