summaryrefslogtreecommitdiff
path: root/package/l2tpns/patches/patch-Makefile
blob: 178912dd847d55b82a8c2e87b16bff76525ffa9f (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- l2tpns-2.1.21.orig/Makefile	2005-12-07 06:21:37.000000000 +0100
+++ l2tpns-2.1.21/Makefile	2011-02-26 23:05:41.000000000 +0100
@@ -10,18 +10,11 @@ DEFINES =
 DEFINES += -DLIBDIR='"$(libdir)"'
 DEFINES += -DETCDIR='"$(etcdir)"'
 
-OPTIM =
-OPTIM += -g
-OPTIM += -O3
-
-CC = gcc
-LD = gcc
 INCLUDES = -I.
 CPPFLAGS = $(INCLUDES) $(DEFINES)
-CFLAGS = -Wall -Wformat-security -Wno-format-zero-length $(OPTIM)
-LDFLAGS =
+CFLAGS ?= -Wall -Wformat-security -Wno-format-zero-length
 LDLIBS =
-INSTALL = install -c -D -o root -g root
+INSTALL = install
 
 l2tpns.LIBS = -lm -lcli -ldl
 
@@ -58,10 +51,10 @@ depend:
 	mv Makefile.tmp Makefile
 
 l2tpns: $(OBJS)
-	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) $($@.LIBS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $($@.LIBS)
 
 nsctl: nsctl.o control.o
-	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) $($@.LIBS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $($@.LIBS)
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
@@ -70,6 +63,11 @@ nsctl: nsctl.o control.o
 	$(CC) -fPIC -shared $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
 
 install: all
+	$(INSTALL) -m 0755 -d $(DESTDIR)$(libdir)
+	$(INSTALL) -m 0755 -d $(DESTDIR)$(bindir)
+	$(INSTALL) -m 0755 -d $(DESTDIR)$(etcdir)
+	$(INSTALL) -m 0755 -d $(DESTDIR)$(man5dir)
+	$(INSTALL) -m 0755 -d $(DESTDIR)$(man8dir)
 	$(INSTALL) -m 0755 l2tpns $(DESTDIR)$(bindir)/l2tpns
 	$(INSTALL) -m 0755 nsctl $(DESTDIR)$(bindir)/nsctl
 
@@ -77,7 +75,7 @@ install: all
 	$(INSTALL) -m 0644 Docs/l2tpns.8 $(DESTDIR)$(man8dir)/l2tpns.8
 	$(INSTALL) -m 0644 Docs/nsctl.8 $(DESTDIR)$(man8dir)/nsctl.8
 
-	gzip --best --force $(DESTDIR)$(man5dir)/*.5 $(DESTDIR)$(man8dir)/*.8
+	gzip $(DESTDIR)$(man5dir)/*.5 $(DESTDIR)$(man8dir)/*.8
 
 	@for config in startup-config users ip_pool; \
 	do \