aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/0002-introduce-debian-standard-build-flags.patch
blob: e4b7c6d66c14a88d203c2741cffbbd27170d057e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: YAEGASHI Takeshi <yaegashi@debian.org>
Date: Mon, 17 Feb 2014 06:51:44 +0900
Subject: introduce debian standard build flags

See https://wiki.debian.org/Hardening
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 1dac1ef..7e1381c 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,10 @@ DOC_PDF  = $(patsubst %.txt,%.pdf,$(MAN_TXT))
 #
 -include cgit.conf
 
+# Import Debian standard build flags.
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
 export CGIT_VERSION CGIT_SCRIPT_NAME CGIT_SCRIPT_PATH CGIT_DATA_PATH CGIT_CONFIG CACHE_ROOT
 
 #
@@ -65,7 +69,8 @@ endif
 all:: cgit
 
 cgit:
-	$(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) -f ../cgit.mk ../cgit $(EXTRA_GIT_TARGETS) NO_CURL=1
+	$(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) -f ../cgit.mk ../cgit $(EXTRA_GIT_TARGETS) NO_CURL=1 \
+		CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
 
 test:
 	@$(MAKE) --no-print-directory cgit EXTRA_GIT_TARGETS=all