summaryrefslogtreecommitdiff
path: root/user/ppp/02_all_make-vars.patch
blob: 7937d666e9de09fbc50e927d761ca2cf4ec7ef62 (plain) (blame)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
--- ppp-2.4.5/chat/Makefile.linux
+++ ppp-2.4.5/chat/Makefile.linux
@@ -10,7 +10,6 @@
 CDEF4=	-DFNDELAY=O_NDELAY		# Old name value
 CDEFS=	$(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
 
-COPTS=	-O2 -g -pipe
 CFLAGS=	$(COPTS) $(CDEFS)
 
 INSTALL= install
@@ -18,7 +17,7 @@
 all:	chat
 
 chat:	chat.o
-	$(CC) -o chat chat.o
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^
 
 chat.o:	chat.c
 	$(CC) -c $(CFLAGS) -o chat.o chat.c
--- ppp-2.4.5/pppd/Makefile.linux
+++ ppp-2.4.5/pppd/Makefile.linux
@@ -32,7 +32,7 @@
 
 # CC = gcc
 #
-COPTS = -O2 -pipe -Wall -g
+COPTS+= -Wall
 LIBS =
 
 # Uncomment the next 2 lines to include support for Microsoft's
--- ppp-2.4.5/pppd/plugins/Makefile.linux
+++ ppp-2.4.5/pppd/plugins/Makefile.linux
@@ -1,7 +1,11 @@
 #CC	= gcc
-COPTS	= -O2 -g
 CFLAGS	= $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS	= -shared
+LDFLAGS_PROG := $(LDFLAGS)
+export LDFLAGS LDFLAGS_PROG
+LDFLAGS	+= -shared
+# need the following option, otherwise linking plugins might fail with undef errors (Gentoo bug 210837)
+LDFLAGS += -Wl,--allow-shlib-undefined
+LIBS = 
 INSTALL	= install
 
 DESTDIR = $(INSTROOT)@DESTDIR@
@@ -23,7 +27,7 @@
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
 
 %.so: %.c
-	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
 
 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
 
--- ppp-2.4.5/pppd/plugins/pppoatm/Makefile.linux
+++ ppp-2.4.5/pppd/plugins/pppoatm/Makefile.linux
@@ -1,7 +1,5 @@
 #CC	= gcc
-COPTS	= -O2 -g
 CFLAGS	= $(COPTS) -I../.. -I../../../include -fPIC
-LDFLAGS	= -shared
 INSTALL	= install
 
 #***********************************************************************
@@ -33,7 +31,7 @@
 all: $(PLUGIN)
 
 $(PLUGIN): $(PLUGIN_OBJS)
-	$(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
 
 install: all
 	$(INSTALL) -d -m 755 $(LIBDIR)
--- ppp-2.4.5/pppd/plugins/pppol2tp/Makefile.linux
+++ ppp-2.4.5/pppd/plugins/pppol2tp/Makefile.linux
@@ -1,7 +1,5 @@
 #CC	= gcc
-COPTS	= -O2 -g
 CFLAGS	= $(COPTS) -I. -I../.. -I../../../include -fPIC
-LDFLAGS	= -shared
 INSTALL	= install
 
 #***********************************************************************
@@ -16,7 +14,7 @@
 all: $(PLUGINS)
 
 %.so: %.o
-	$(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
 
 install: all
 	$(INSTALL) -d -m 755 $(LIBDIR)
--- ppp-2.4.5/pppd/plugins/radius/Makefile.linux
+++ ppp-2.4.5/pppd/plugins/radius/Makefile.linux
@@ -12,7 +12,7 @@
 INSTALL	= install
 
 PLUGIN=radius.so radattr.so radrealms.so
-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+CFLAGS=$(COPTS) -I. -I../.. -I../../../include -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
 
 # Uncomment the next line to include support for Microsoft's
 # MS-CHAP authentication protocol.
@@ -43,13 +43,13 @@
 	$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
 
 radius.so: radius.o libradiusclient.a
-	$(CC) -o radius.so -shared radius.o libradiusclient.a
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^
 
 radattr.so: radattr.o
-	$(CC) -o radattr.so -shared radattr.o
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^
 
 radrealms.so: radrealms.o
-	$(CC) -o radrealms.so -shared radrealms.o
+	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^
 
 CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
 	clientid.o sendserver.o lock.o util.o md5.o
--- ppp-2.4.5/pppd/plugins/rp-pppoe/Makefile.linux
+++ ppp-2.4.5/pppd/plugins/rp-pppoe/Makefile.linux
@@ -25,12 +25,11 @@
 # Version is set ONLY IN THE MAKEFILE!  Don't delete this!
 RP_VERSION=3.8p
 
-COPTS=-O2 -g
 CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
 all: rp-pppoe.so pppoe-discovery
 
 pppoe-discovery: pppoe-discovery.o debug.o
-	$(CC) -o pppoe-discovery pppoe-discovery.o debug.o
+	$(CC) $(LDFLAGS_PROG) $(CFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
 
 pppoe-discovery.o: pppoe-discovery.c
 	$(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
@@ -39,7 +38,7 @@
 	$(CC) $(CFLAGS) -c -o debug.o debug.c
 
 rp-pppoe.so: plugin.o discovery.o if.o common.o
-	$(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
+	$(CC) $(LDFLAGS) $(CFLAGS) -o rp-pppoe.so plugin.o discovery.o if.o common.o
 
 install: all
 	$(INSTALL) -d -m 755 $(LIBDIR)
--- ppp-2.4.5/pppdump/Makefile.linux
+++ ppp-2.4.5/pppdump/Makefile.linux
@@ -2,7 +2,7 @@
 BINDIR = $(DESTDIR)/sbin
 MANDIR = $(DESTDIR)/share/man/man8
 
-CFLAGS= -O -I../include/net
+CFLAGS=$(COPTS) -I../include/net
 OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
 
 INSTALL= install
@@ -10,7 +10,7 @@
 all:	pppdump
 
 pppdump: $(OBJS)
-	$(CC) -o pppdump $(OBJS)
+	$(CC) $(LDFLAGS) -o pppdump $(OBJS)
 
 clean:
 	rm -f pppdump $(OBJS) *~
--- ppp-2.4.5/pppstats/Makefile.linux
+++ ppp-2.4.5/pppstats/Makefile.linux
@@ -10,7 +10,6 @@
 PPPSTATOBJS = pppstats.o
 
 #CC = gcc
-COPTS = -O
 COMPILE_FLAGS = -I../include
 LIBS =
 
@@ -26,7 +25,7 @@
 	$(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
 
 pppstats: $(PPPSTATSRCS)
-	$(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o pppstats pppstats.c $(LIBS)
 
 clean:
 	rm -f pppstats *~ #* core