File: Use-the-passed-in-CFLAGS-and-LDFLAGS-settings.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 (92 lines) | stat: -rw-r--r-- 2,989 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Mon, 19 Dec 2016 20:22:25 +0100
Subject: Use the passed in CFLAGS and LDFLAGS settings

---
 dlm_controld/Makefile |  4 ++--
 dlm_tool/Makefile     |  2 +-
 fence/Makefile        |  2 +-
 libdlm/Makefile       | 15 ++++++---------
 4 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index cf556c9..873d7c2 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -70,10 +70,10 @@ endif
 all: $(LIB_TARGET) $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
+	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(CFLAGS) $(BIN_LDFLAGS) $(LDFLAGS) -o $@ -L.
 
 $(LIB_TARGET): $(LIB_SOURCE)
-	$(CC) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR)
+	$(CC) $^ $(LIB_CFLAGS) $(CFLAGS) $(LIB_LDFLAGS) $(LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR)
 	ln -sf $(LIB_TARGET) $(LIB_SO)
 	ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
 
diff --git a/dlm_tool/Makefile b/dlm_tool/Makefile
index c16d8f5..27635a7 100644
--- a/dlm_tool/Makefile
+++ b/dlm_tool/Makefile
@@ -39,7 +39,7 @@ BIN_LDFLAGS += -lpthread -ldlm -ldlmcontrol
 all: $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@
+	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(CFLAGS) $(BIN_LDFLAGS) $(LDFLAGS) -o $@
 
 clean:
 	rm -f *.o *.so *.so.* $(BIN_TARGET)
diff --git a/fence/Makefile b/fence/Makefile
index 77bf0fd..2574382 100644
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -40,7 +40,7 @@ BIN_LDFLAGS += -ldl
 all: $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
+	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(CFLAGS) $(BIN_LDFLAGS) $(LDFLAGS) -o $@ -L.
 
 clean:
 	rm -f *.o *.so *.so.* $(BIN_TARGET)
diff --git a/libdlm/Makefile b/libdlm/Makefile
index 336c22e..3352b0a 100644
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -77,27 +77,24 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
 	-fdiagnostics-show-option \
 	-fPIC
 
-LIB_CFLAGS += $(CFLAGS) -D_REENTRANT
-LLT_CFLAGS += $(CFLAGS)
-
-LIB_LDFLAGS += $(LDFLAGS) -lpthread
-LLT_LDFLAGS += $(LDFLAGS)
+LIB_CFLAGS += -D_REENTRANT
+LIB_LDFLAGS += -lpthread
 
 all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
 
 $(LIB_O): $(SOURCE) 
-	$(CC) $< $(LIB_CFLAGS) -c -o $@
+	$(CC) $< $(LIB_CFLAGS) $(CFLAGS) -c -o $@
 
 $(LLT_O): $(SOURCE) 
-	$(CC) $< $(LLT_CFLAGS) -c -o $@
+	$(CC) $< $(LLT_CFLAGS) $(CFLAGS) -c -o $@
 
 $(LIB_TARGET): $(LIB_O)
-	$(CC) $^ $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
+	$(CC) $^ $(LIB_LDFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
 	ln -sf $(LIB_TARGET) $(LIB_SO)
 	ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
 
 $(LLT_TARGET): $(LLT_O)
-	$(CC) $^ $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
+	$(CC) $^ $(LLT_LDFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
 	ln -sf $(LLT_TARGET) $(LLT_SO)
 	ln -sf $(LLT_TARGET) $(LLT_SMAJOR)