File: debian-stop-clobbering-cflags-and-ldflags.patch

package info (click to toggle)
xtrs 4.9d-2.1
  • links: PTS
  • area: contrib
  • in suites: sid, trixie
  • size: 5,480 kB
  • sloc: ansic: 72,545; makefile: 1,633; sh: 554; csh: 132
file content (54 lines) | stat: -rw-r--r-- 1,584 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
Stop clobbering CFLAGS and LDFLAGS, enabling use of Debian's hardening
flags.

Observe LDFLAGS when building internal "compile_rom" tool.

-- Branden Robinson, 2017-04-08T13:29:44-0400
--- a/Makefile
+++ b/Makefile
@@ -153,7 +153,7 @@
 # Local customizations for make variables are done in Makefile.local:
 include Makefile.local
 
-CFLAGS = $(DEBUG) $(ENDIAN) $(DEFAULT_ROM) $(READLINE) $(DISKDIR) $(IFLAGS) \
+CFLAGS += $(DEBUG) $(ENDIAN) $(DEFAULT_ROM) $(READLINE) $(DISKDIR) $(IFLAGS) \
        $(APPDEFAULTS) -DKBWAIT
 LIBS = $(XLIB) $(READLINELIBS) $(EXTRALIBS)
 
@@ -182,7 +182,7 @@
 		$(CC) $(LDFLAGS) -o xtrs $(OBJECTS) $(LIBS)
 
 compile_rom:	$(CR_OBJECTS)
-		$(CC) -o compile_rom $(CR_OBJECTS)
+		$(CC) $(LDFLAGS) -o compile_rom $(CR_OBJECTS)
 
 trs_rom1.c:	compile_rom $(BUILT_IN_ROM)
 		./compile_rom 1 $(BUILT_IN_ROM) > trs_rom1.c
@@ -194,13 +194,13 @@
 		./compile_rom 4p $(BUILT_IN_ROM4P) > trs_rom4p.c
 
 mkdisk:		$(MD_OBJECTS)
-		$(CC) -o mkdisk $(MD_OBJECTS)
+		$(CC) $(LDFLAGS) -o mkdisk $(MD_OBJECTS)
 
 hex2cmd:	$(HC_OBJECTS)
-		$(CC) -o hex2cmd $(HC_OBJECTS)
+		$(CC) $(LDFLAGS) -o hex2cmd $(HC_OBJECTS)
 
 cmddump:	$(CD_OBJECTS)
-		$(CC) -o cmddump $(CD_OBJECTS)
+		$(CC) $(LDFLAGS) -o cmddump $(CD_OBJECTS)
 
 tar:		$(SOURCES) $(HEADERS)
 		tar cvf xtrs.tar $(SOURCES) $(HEADERS)  $(MANSOURCES) $(MISC)
--- a/Makefile.local
+++ b/Makefile.local
@@ -70,7 +70,7 @@
 
 # If you need a different path for libraries:
 
-LDFLAGS = -L/usr/lib/X11
+LDFLAGS += -L/usr/lib/X11
 #LDFLAGS = -non_shared -L/usr/X11/lib
 
 # If you need a different path for include files: