From: Friedrich Beckmann <friedrich.beckmann@gmx.de>
Date: Mon, 10 Oct 2016 17:39:06 +0000 (+0200)
Subject: added CFLAGS, CPPFLAGS and LDFLAGS for PSPP.C and q2c.c compilation
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bc0a0ff21cff9b9c6c613677daee46c6c0af04c;p=pspp

added CFLAGS, CPPFLAGS and LDFLAGS for PSPP.C and q2c.c compilation

The hardening check during the debian build process showed that the
hardening compile flags are not issued to the compilation process of
PSPP.c (the perl module) and q2c.c (the lexer). Although q2c.c is only
relevant during the build process hardening this will not hurt.
---

diff --git a/perl-module/automake.mk b/perl-module/automake.mk
index 276af3930a..92e9dcaf73 100644
--- a/perl-module/automake.mk
+++ b/perl-module/automake.mk
@@ -26,7 +26,9 @@ perl-module/pspp-module-config: Makefile
 	 echo ');') > $(top_builddir)/perl-module/pspp-module-config
 
 perl-module/Makefile: perl-module/Makefile.PL perl-module/pspp-module-config $(module_sources)
-	$(AM_V_GEN)cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix)
+	$(AM_V_GEN)cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix) \
+                                                         OPTIMIZE="$(CFLAGS) $(CPPFLAGS)" \
+                                                         LD="`$(PERL) -V::ld:` $(LDFLAGS)"
 
 perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz: $(module_sources) perl-module/Makefile
 	$(AM_V_at)rm -f $@
diff --git a/src/language/lexer/automake.mk b/src/language/lexer/automake.mk
index 7313e08597..61e1bb239f 100644
--- a/src/language/lexer/automake.mk
+++ b/src/language/lexer/automake.mk
@@ -28,7 +28,7 @@ EXTRA_DIST += src/language/lexer/q2c.c
 
 src/language/lexer/q2c$(EXEEXT_FOR_BUILD): $(top_srcdir)/src/language/lexer/q2c.c 
 	@$(MKDIR_P) `dirname $@`
-	$(AM_V_GEN)$(CC_FOR_BUILD) $(top_srcdir)/src/language/lexer/q2c.c -o $(top_builddir)/src/language/lexer/q2c$(EXEEXT_FOR_BUILD)
+	$(AM_V_GEN)$(CC_FOR_BUILD) $(top_srcdir)/src/language/lexer/q2c.c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(top_builddir)/src/language/lexer/q2c$(EXEEXT_FOR_BUILD)
 
 
 CLEANFILES += src/language/lexer/q2c$(EXEEXT_FOR_BUILD)