File: Modify-Makefile.linux.patch

package info (click to toggle)
etw 3.6%2Bsvn162-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,700 kB
  • sloc: ansic: 31,633; objc: 244; sh: 97; makefile: 42
file content (47 lines) | stat: -rw-r--r-- 1,499 bytes parent folder | download | duplicates (4)
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
From: Markus Koschany <apo@debian.org>
Date: Thu, 8 Nov 2012 16:49:13 +0100
Subject: Modify Makefile.linux

Enables pthread linking for better portability and patches the Makefile
to enable hardening.
Note: Enabling all hardening features is possible but leads to a buggy and
unusable game. For now CFLAGS and CPPFLAGS provided by dpkg-buildflags are
disabled.
---
 etw/Makefile.linux |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/etw/Makefile.linux b/etw/Makefile.linux
index 09bc3a5..c6c7923 100644
--- a/etw/Makefile.linux
+++ b/etw/Makefile.linux
@@ -1,11 +1,18 @@
-CC = gcc
+CC = gcc -pthread
 
-CFLAGS = -Wall -g -fsigned-char -Iinclude \
+CFLAGS = -Wall -g -fPIC -fsigned-char -Iinclude \
     -Wpointer-arith -Wcast-align -Wcast-qual  -Wno-char-subscripts  -Wshadow \
     -Waggregate-return  -Wsign-compare \
     `pkg-config --cflags sdl` `pkg-config --cflags gtk+-2.0`
 
+#CFLAGS += `dpkg-buildflags --get CPPFLAGS`
+#CFLAGS += `dpkg-buildflags --get CFLAGS`
+
+SLIM = -Wl,--as-needed
+
 LDFLAGS = `pkg-config --libs sdl` `pkg-config --libs gtk+-2.0`
+LDFLAGS += `dpkg-buildflags --get LDFLAGS`
+
 DEFINES = -DLINUX -DCD_VERSION -DENABLE_BINRELOC -DHAVE_STDINT_H
 
 OBJECTS = highdirent.o cpu.o human.o myiff.o specials.o \
@@ -26,7 +33,7 @@ OBJECTS = highdirent.o cpu.o human.o myiff.o specials.o \
 all: CHECKTOOLS etw
 
 etw: $(OBJECTS)
-	$(CC) -o etw $(OBJECTS) $(LDFLAGS)
+	$(CC) $(SLIM) -o etw $(OBJECTS) $(LDFLAGS)
 
 clean:
 	rm -rf etw *.o