File: hardening-flags

package info (click to toggle)
why3 1.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 45,020 kB
  • sloc: xml: 185,443; ml: 111,224; ansic: 3,998; sh: 2,578; makefile: 2,568; java: 865; python: 720; javascript: 290; lisp: 205; pascal: 173
file content (41 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download
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
35
36
37
38
39
40
41
From: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Date: Mon, 10 Feb 2020 13:53:39 +0100
Subject: hardening-flags

===================================================================
---
 Makefile.in | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 0df3356..1b98516 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -20,6 +20,10 @@ else
   HIDE = @
 endif
 
+CFLAGS  := $(shell dpkg-buildflags --get CFLAGS)
+CFLAGS  += $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+
 # install the binaries
 DESTDIR =
 
@@ -795,13 +799,13 @@ TOOLS = lib/why3server$(EXE) lib/why3cpulimit$(EXE)
 all: $(TOOLS)
 
 lib/why3server$(EXE): $(SERVER_O)
-	$(CC) -Wall -o $@ $^
+	$(CC) -Wall $(LDFLAGS) -o  $@ $^
 
 lib/why3cpulimit$(EXE): $(CPULIM_O)
-	$(CC) -Wall -o $@ $^
+	$(CC) -Wall $(LDFLAGS) -o $@ $^
 
 %.o: %.c
-	$(CC) -Wall -O -g -o $@ -c $<
+	$(CC) -Wall -O -g $(CFLAGS) -o $@ -c $<
 
 uninstall-bin::
 	rm -f $(LIBDIR)/why3/why3server$(EXE) $(LIBDIR)/why3/why3cpulimit$(EXE)