summaryrefslogtreecommitdiff
path: root/package/ppp/patches/patch-pppd_plugins_pppol2tp_Makefile_linux
blob: e3d743e6f856cb1c5fb88057d3c7817fca77aec2 (plain)
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
--- ppp-2.4.6.orig/pppd/plugins/pppol2tp/Makefile.linux	2014-01-02 05:42:08.000000000 +0100
+++ ppp-2.4.6/pppd/plugins/pppol2tp/Makefile.linux	2014-06-06 08:18:13.000000000 +0200
@@ -1,22 +1,20 @@
-#CC	= gcc
-COPTS	= -O2 -g
-CFLAGS	= $(COPTS) -I. -I../.. -I../../../include -fPIC
-LDFLAGS	= -shared
-INSTALL	= install
-
-#***********************************************************************
-
-DESTDIR = @DESTDIR@
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
-
 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
 
+include ../../../Makedefs.com
+CPPFLAGS += -I. -I../.. -I../../../include
+ifeq (,$(filter -fPIC,$(CFLAGS)))
+CFLAGS += -fPIC
+endif
+ifeq (,$(filter -shared,$(LDFLAGS)))
+LDFLAGS += -shared
+endif
+
 PLUGINS := pppol2tp.so openl2tp.so
 
 all: $(PLUGINS)
 
 %.so: %.o
-	$(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 install: all
 	$(INSTALL) -d -m 755 $(LIBDIR)
@@ -24,6 +22,3 @@ install: all
 
 clean:
 	rm -f *.o *.so
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $<