File: Move-our-CFLAGS-before-the-environmental-CFLAGS.patch

package info (click to toggle)
dlm 4.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 900 kB
  • ctags: 1,844
  • sloc: ansic: 13,442; makefile: 297; sh: 83
file content (54 lines) | stat: -rw-r--r-- 1,702 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
42
43
44
45
46
47
48
49
50
51
52
53
54
From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Mon, 19 Dec 2016 22:37:39 +0100
Subject: Move our CFLAGS before the environmental CFLAGS

This gives the user settings (in the environment) higher priority.
At the same time, simplify the pthread handling: use -pthread both for
compilation and linking explicitly.
---
 libdlm/Makefile | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libdlm/Makefile b/libdlm/Makefile
index 9350940..dfd6ff9 100644
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -55,7 +55,8 @@ UDEV_TARGET = 51-dlm.rules
 
 SOURCE = libdlm.c
 
-CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
+DLM_CFLAGS = \
+	-D_GNU_SOURCE -O2 -ggdb \
 	-Wall \
 	-Wformat \
 	-Wformat-security \
@@ -77,24 +78,21 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
 	-fdiagnostics-show-option \
 	-fPIC
 
-LIB_CFLAGS += -D_REENTRANT
-LIB_LDFLAGS += -lpthread
-
 all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
 
 $(LIB_O): $(SOURCE) 
-	$(CC) $(CPPFLAGS) $< $(LIB_CFLAGS) $(CFLAGS) -c -o $@
+	$(CC) $(CPPFLAGS) $< $(DLM_CFLAGS) $(CFLAGS) -c -o $@ -pthread
 
 $(LLT_O): $(SOURCE) 
-	$(CC) $(CPPFLAGS) $< $(LLT_CFLAGS) $(CFLAGS) -c -o $@
+	$(CC) $(CPPFLAGS) $< $(DLM_CFLAGS) $(CFLAGS) -c -o $@
 
 $(LIB_TARGET): $(LIB_O)
-	$(CC) $^ $(LIB_LDFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
+	$(CC) $^ $(LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR) -pthread
 	ln -sf $(LIB_TARGET) $(LIB_SO)
 	ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
 
 $(LLT_TARGET): $(LLT_O)
-	$(CC) $^ $(LLT_LDFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
+	$(CC) $^ $(LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
 	ln -sf $(LLT_TARGET) $(LLT_SO)
 	ln -sf $(LLT_TARGET) $(LLT_SMAJOR)