Description: Use debian cflags for hardening
Author: dod
--- a/makefile.shared
+++ b/makefile.shared
@@ -5,6 +5,9 @@
 
 CC = libtool --mode=compile --tag=CC gcc
 
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
 CFLAGS  +=  -I./ -Wall -W -Wshadow -Wsign-compare
 
 ifndef IGNORE_SPEED
@@ -83,7 +86,7 @@
 objs: $(OBJECTS)
 
 $(LIBNAME):  $(OBJECTS)
-	libtool --mode=link gcc *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
+	libtool --mode=link gcc $(LDFLAGS) *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
 
 install: $(LIBNAME)
 	install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
@@ -93,10 +96,10 @@
 
 test: $(LIBNAME) demo/demo.o
 	gcc $(CFLAGS) -c demo/demo.c -o demo/demo.o
-	libtool --mode=link gcc -o test demo/demo.o $(LIBNAME_S)
+	libtool --mode=link gcc -o test $(LDFLAGS) demo/demo.o $(LIBNAME_S)
 	
 mtest: test	
 	cd mtest ; gcc $(CFLAGS) mtest.c -o mtest
         
 timing: $(LIBNAME)
-	gcc $(CFLAGS) -DTIMER demo/timing.c $(LIBNAME_S) -o ltmtest
+	gcc $(CFLAGS) -DTIMER demo/timing.c $(LDFLAGS) $(LIBNAME_S) -o ltmtest
