File: use-cxx-as-c%2B%2B-compiler-name-variable.patch

package info (click to toggle)
udt 4.11%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,096 kB
  • sloc: cpp: 10,426; makefile: 64
file content (71 lines) | stat: -rw-r--r-- 1,751 bytes parent folder | download | duplicates (2)
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
From: Helmut Grohne <helmut@subdivi.de>
Date: Fri, 24 Jan 2025 02:22:57 +0100
X-Dgit-Generated: 4.11+dfsg1-1.1 a5f3d2b9c7d2f3ee9f36d5e401a8f4f9a3010854
Subject: Use CXX as C++ compiler name variable

Closes: #994675

---

diff --git a/app/Makefile b/app/Makefile
index 7c89996..3c5439d 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -1,4 +1,4 @@
-C++ = g++
+CXX = g++
 
 CCFLAGS = -Wall -I../src -finline-functions -O3
 LDFLAGS = -L../src -ludt -lstdc++ -pthread -lm
@@ -10,18 +10,18 @@ APP = appserver appclient sendfile recvfile test
 all: $(APP)
 
 %.o: %.cpp
-	$(C++) $(CCFLAGS) $< -c
+	$(CXX) $(CCFLAGS) $< -c
 
 appserver: appserver.o
-	$(C++) $^ -o $@ $(LDFLAGS)
+	$(CXX) $^ -o $@ $(LDFLAGS)
 appclient: appclient.o
-	$(C++) $^ -o $@ $(LDFLAGS)
+	$(CXX) $^ -o $@ $(LDFLAGS)
 sendfile: sendfile.o
-	$(C++) $^ -o $@ $(LDFLAGS)
+	$(CXX) $^ -o $@ $(LDFLAGS)
 recvfile: recvfile.o
-	$(C++) $^ -o $@ $(LDFLAGS)
+	$(CXX) $^ -o $@ $(LDFLAGS)
 test: test.o
-	$(C++) $^ -o $@ $(LDFLAGS)
+	$(CXX) $^ -o $@ $(LDFLAGS)
 
 clean:
 	rm -f *.o $(APP)
diff --git a/src/Makefile b/src/Makefile
index 3c6b208..eb6c206 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,4 @@
-C++ = g++
+CXX = g++
 
 CCFLAGS = -fPIC -Wall -Wextra -finline-functions -O3 -fno-strict-aliasing -fvisibility=hidden
 
@@ -8,13 +8,13 @@ DIR = $(shell pwd)
 all: libudt.so libudt.a udt
 
 %.o: %.cpp %.h udt.h
-	$(C++) $(CCFLAGS) $< -c
+	$(CXX) $(CCFLAGS) $< -c
 
 libudt.so: $(OBJS)
 ifneq ($(os), OSX)
-	$(C++) -shared -pthread -Wl,-soname,libudt.so.0 -o $@ $^
+	$(CXX) -shared -pthread -Wl,-soname,libudt.so.0 -o $@ $^
 else
-	$(C++) -dynamiclib -o libudt.dylib -lstdc++ -lpthread -lm $^
+	$(CXX) -dynamiclib -o libudt.dylib -lstdc++ -lpthread -lm $^
 endif
 
 libudt.a: $(OBJS)