aboutsummaryrefslogtreecommitdiffstats
path: root/testing/memdump/03-build-flags-support.patch
blob: 4485cc2640267e93548b9f13d0adfc86ec6641fc (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Description: Support build flags injection
 Proper support of LDFLAGS / CFLAGS / CPPFLAGS is required so
 that dpkg-buildflags can inject supplementary build options.
Author: Raphaël Hertzog <hertzog@debian.org>
Origin: vendor
Last-Update: 2015-07-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: memdump/Makefile
===================================================================
--- memdump.orig/Makefile
+++ memdump/Makefile
@@ -1,9 +1,13 @@
 SHELL	= /bin/sh
-CC	= gcc -Wformat -Wunused
+CC	= gcc
 OPT	= -O
 DEBUG	= -g
 PROGS	= memdump
-CFLAGS	= $(OPT) $(DEBUG) -I. $(XFLAGS) $(DEFS)
+ifneq ($(DEFS),)
+# Only complete variables once when we're called with make DEFS="something"
+CPPFLAGS += -I. $(DEFS)
+CFLAGS	+= -Wall -Wno-comment
+endif
 OBJS	= memdump.o convert_size.o error.o mymalloc.o
 PROGS	= memdump
 MAN	= memdump.1
@@ -16,7 +20,7 @@ all:	$(PROGS)
 manpages: $(MAN)
 
 memdump:	$(OBJS)
-	$(CC) $(CFLAGS) -o $@ $(OBJS) $(SYSLIBS)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(SYSLIBS)
 
 memdump.1: memdump.c
 	srctoman $? >$@
Index: memdump/makedefs
===================================================================
--- memdump.orig/makedefs
+++ memdump/makedefs
@@ -40,5 +40,5 @@ esac
 
 unset MAKELEVEL	# shut up chatty GNU make
 
-make DEFS="$DEFS" CC="${CC-gcc -Wunused}" RANLIB="${RANLIB-ranlib}" \
+make DEFS="$DEFS" CC="${CC-gcc}" RANLIB="${RANLIB-ranlib}" \
 	AR="${AR-ar rv}" SYSLIBS="$SYSLIBS" all