Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 29 Mar 2016 22:11:29 +0200
Description: Propagate hardening options

--- a/Makefile
+++ b/Makefile
@@ -37,8 +37,9 @@
 # CXX      = CC -n32 -LANG:std   # for SGI Irix 6.5, MIPSpro CC version 7.30
 CXX      = g++   # for Linux RedHat 6.1, g++ version 2.95.2
 
-CPPFLAGS = -I. -O
-LDFLAGS  = -L. -lgzstream -lz
+CXXFLAGS+= -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
+CPPFLAGS+= -I. -O
+LDFLAGS += -L. -lgzstream -lz
 AR       = ar cr
 
 # ----------------------------------------------------------------------------
@@ -68,19 +69,19 @@
 	# *** O.K. Installation finished successfully. ***
 
 gzstream.o : gzstream.C gzstream.h
-	${CXX} ${CPPFLAGS} -c -o gzstream.o gzstream.C
+	${CXX} $(CFLAGS) ${CPPFLAGS} -c -o gzstream.o gzstream.C
 
 test_gzip.o : test_gzip.C gzstream.h
-	${CXX} ${CPPFLAGS} -c -o test_gzip.o test_gzip.C
+	${CXX} $(CFLAGS) ${CPPFLAGS} -c -o test_gzip.o test_gzip.C
 
 test_gunzip.o : test_gunzip.C gzstream.h
-	${CXX} ${CPPFLAGS} -c -o test_gunzip.o test_gunzip.C
+	${CXX} $(CFLAGS) ${CPPFLAGS} -c -o test_gunzip.o test_gunzip.C
 
 libgzstream.a : gzstream.o
 	${AR} libgzstream.a gzstream.o
 
 libgzstream.so : gzstream.C gzstream.h
-	${CXX} ${CPPFLAGS} -fPIC -c -o gzstream.o gzstream.C
+	${CXX} ${CPPFLAGS} ${CXXFLAGS} -fPIC -c -o gzstream.o gzstream.C
 	${CXX} ${LDFLAGS} -shared -Wl,-soname,$@.$(SOVERSION) -o $@.$(SOVERSION) gzstream.o
 	ln -s $@.$(SOVERSION) $@
 
