forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
softgun-0.22-make.patch
75 lines (63 loc) · 2.11 KB
/
softgun-0.22-make.patch
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
--- softgun-0.22/config.mk
+++ softgun-0.22/config.mk
@@ -9,7 +9,7 @@ bindir=$(prefix)/bin
libdir=$(prefix)/lib/softgun/
#CFLAGS=-Wall -pg -O0 -DPROFILE
-CFLAGS=-Wall -O9 -g -fomit-frame-pointer -fno-strict-overflow -Wstrict-overflow=3 -Wno-unused-but-set-variable
-DEFS=-D_GNU_SOURCE
+CFLAGS+=-Wall -fno-strict-overflow -Wstrict-overflow=3 -Wno-unused-but-set-variable -fno-strict-aliasing
+DEFS=$(CPPFLAGS) -D_GNU_SOURCE
INCLUDES:=-I$(top_srcdir) -I.
@@ -17,15 +17,16 @@ INCLUDES:=-I$(top_srcdir) -I.
# to omit stack protection symbol in object file
SHAREDCFLAGS=-fPIC -nostdlib -D_SHARED_
SHAREDLDFLAGS=-nostdlib -shared
-CYGWIN=$(findstring CYGWIN,$(shell uname))
-ifeq ($(shell uname),Linux)
-LDFLAGS=-lpthread -lrt -lm -lz -lasound
+UNAME=$(shell uname)
+CYGWIN=$(findstring CYGWIN,$(UNAME))
+ifeq ($(UNAME),Linux)
+LDLIBS=-lpthread -ldl -lrt -lm -lz -lasound
else
- ifeq ($(shell uname),FreeBSD)
- LDFLAGS=-lpthread -lm -lz -lSDL
+ ifeq ($(UNAME),FreeBSD)
+ LDLIBS=-lpthread -lm -lz -lSDL
else
ifeq ($(CYGWIN),CYGWIN)
- LDFLAGS=-lpthread -lrt -lm -lz
+ LDLIBS=-lpthread -lrt -lm -lz
else
$(error "Unknown architecture $(shell uname)")
endif
--- softgun-0.22/Makefile
+++ softgun-0.22/Makefile
@@ -116,7 +116,7 @@
softgun: $(OBJS)
- $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
boards/libboards.a:
$(MAKE) -C boards libboards.a
--- softgun-0.22/printer/module.mk
+++ softgun-0.22/printer/module.mk
@@ -5,5 +5,5 @@
INSTALL_BINS += pcl3gui2png
pcl3gui2png: $(PRINTER_OBJS) printer/pcl3gui2png.c
- $(CC) -o $@ $(PRINTER_OBJS) printer/pcl3gui2png.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
--- softgun-0.22/tools/Makefile
+++ softgun-0.22/tools/Makefile
@@ -2,7 +2,7 @@ include ../config.mk
ifeq ($(shell uname),Linux)
sg_tunctl: tunctl.c
- $(CC) $(CFLAGS) tunctl.c -o sg_tunctl
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
install:
install -m 0755 sg_tunctl $(bindir)
@@ -14,7 +14,7 @@ install:
endif
to_c_array: to_c_array.c
- $(CC) $(CFLAGS) to_c_array.c -o to_c_array
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
clean: