diff options
author | Li xin <lixin.fnst@cn.fujitsu.com> | 2015-01-06 11:54:15 -0500 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-01-26 09:26:22 -0500 |
commit | ab75a8c8d0a57411af1452f9f8f41ccf29bb0cc7 (patch) | |
tree | 8930ac09c441d1ff0d0deec2b6c8744459d456ca /meta-networking/recipes-protocols/openl2tp | |
parent | 645df34e8a319c8de6a7a1f282fd7cef6004639e (diff) | |
download | meta-openembedded-ab75a8c8d0a57411af1452f9f8f41ccf29bb0cc7.tar.gz |
openl2tp: add new recipe
OpenL2TP is an open source L2TP client / server, written specifically
for Linux. It has been designed for use as an enterprise L2TP VPN server
or in commercial, Linux-based, embedded networking products and is able
to support hundreds of sessions, each with different configuration.
It is used by several ISPs to provide L2TP services and by corporations
to implement L2TP VPNs.
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-networking/recipes-protocols/openl2tp')
3 files changed, 183 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch new file mode 100644 index 000000000..96dbc7551 --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 152486fa3c36c3b99d17d5b553cf87ef412fae8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Li xin <lixin.fnst@cn.fujitsu.com> | ||
3 | Date: Mon, 1 Dec 2014 01:53:41 +0900 | ||
4 | Subject: [PATCH] Makefile:modify CFLAGS to aviod build error. | ||
5 | |||
6 | Upstream-Status: pending | ||
7 | |||
8 | Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> | ||
9 | --- | ||
10 | Makefile | 22 +++++++++++----------- | ||
11 | plugins/Makefile | 6 +++--- | ||
12 | 2 files changed, 14 insertions(+), 14 deletions(-) | ||
13 | |||
14 | diff --git a/Makefile b/Makefile | ||
15 | index 4aaa448..baa7882 100644 | ||
16 | --- a/Makefile | ||
17 | +++ b/Makefile | ||
18 | @@ -152,10 +152,10 @@ LIBS.dmalloc= -ldmalloc | ||
19 | export USE_DMALLOC | ||
20 | endif | ||
21 | |||
22 | -CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y) | ||
23 | -CFLAGS= -I. -Iusl -Icli -isystem include \ | ||
24 | - -MMD -Wall -Werror -Wno-strict-aliasing \ | ||
25 | - $(CPPFLAGS) $(CPPFLAGS.dmalloc) \ | ||
26 | +ADD_CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y) | ||
27 | +ADD_CFLAGS= -I. -Iusl -Icli -isystem include \ | ||
28 | + -MMD -Wall -Wno-strict-aliasing \ | ||
29 | + $(ADD_CPPFLAGS) $(CPPFLAGS.dmalloc) \ | ||
30 | -DSYS_LIBDIR=$(SYS_LIBDIR) | ||
31 | LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc | ||
32 | LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc | ||
33 | @@ -170,10 +170,10 @@ CFLAGS.optimize= $(OPT_CFLAGS) | ||
34 | endif | ||
35 | export CFLAGS.optimize | ||
36 | |||
37 | -CFLAGS+= $(CFLAGS.optimize) | ||
38 | +ADD_CFLAGS+= $(CFLAGS.optimize) | ||
39 | |||
40 | ifeq ($(L2TP_USE_ASYNC_RPC),y) | ||
41 | -CPPFLAGS+= -DL2TP_ASYNC_RPC | ||
42 | +ADD_CPPFLAGS+= -DL2TP_ASYNC_RPC | ||
43 | endif | ||
44 | |||
45 | ifeq ($(L2TP_FEATURE_RPC_MANAGEMENT),y) | ||
46 | @@ -220,13 +220,13 @@ endif | ||
47 | |||
48 | # Compile without -Wall because rpcgen-generated code is full of warnings. | ||
49 | %_xdr.o: %_xdr.c | ||
50 | - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $< | ||
51 | + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $< | ||
52 | |||
53 | %_client.o: %_client.c | ||
54 | - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $< | ||
55 | + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $< | ||
56 | |||
57 | %_server.o: %_server.c | ||
58 | - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $< | ||
59 | + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $< | ||
60 | |||
61 | %_xdr.c: %.x | ||
62 | -$(RM) $@ | ||
63 | @@ -272,7 +272,7 @@ l2tpconfig: $(L2TPCONFIG_SRCS.o) | ||
64 | $(CC) -o $@ $^ $(LDFLAGS.l2tpconfig) | ||
65 | |||
66 | %.o: %.c | ||
67 | - $(CC) -c $(CFLAGS) $< -o $@ | ||
68 | + $(CC) -c $(CFLAGS) $(ADD_CFLAGS) $< -o $@ | ||
69 | |||
70 | l2tp_options.h: FORCE | ||
71 | @rm -f $@.tmp | ||
72 | @@ -325,7 +325,7 @@ install: install-all | ||
73 | install-all: all install-daemon install-app | ||
74 | |||
75 | install-daemon: | ||
76 | - @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done | ||
77 | + @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS) $(ADD_CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done | ||
78 | $(INSTALL) -d $(DESTDIR)/usr/sbin | ||
79 | $(INSTALL) openl2tpd $(DESTDIR)/usr/sbin | ||
80 | |||
81 | diff --git a/plugins/Makefile b/plugins/Makefile | ||
82 | index 5be996d..6810236 100644 | ||
83 | --- a/plugins/Makefile | ||
84 | +++ b/plugins/Makefile | ||
85 | @@ -1,7 +1,7 @@ | ||
86 | -CFLAGS := $(CFLAGS.optimize) -MMD -Wall \ | ||
87 | +ADD_CFLAGS := $(CFLAGS.optimize) -MMD -Wall \ | ||
88 | -isystem ../include \ | ||
89 | -I. -I.. -I../usl -fPIC $(EXTRA_CFLAGS) | ||
90 | -LDFLAGS := -shared | ||
91 | +ADD_LDFLAGS := -shared | ||
92 | |||
93 | PLUGINS.c:= ppp_unix.c ppp_null.c ipsec.c event_sock.c | ||
94 | |||
95 | @@ -21,7 +21,7 @@ clean: | ||
96 | $(RM) $(PLUGINS.so) $(wildcard *.o) $(wildcard *.d) $(SRC.generated) | ||
97 | |||
98 | %.so: %.c | ||
99 | - $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $< | ||
100 | + $(CC) -o $@ $(LDFLAGS) $(ADD_LDFLAGS) $(CFLAGS) $(ADD_CFLAGS) $< | ||
101 | |||
102 | install: all | ||
103 | $(INSTALL) -d $(DESTDIR)$(SYS_LIBDIR)/openl2tp | ||
104 | -- | ||
105 | 1.8.4.2 | ||
106 | |||
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch new file mode 100644 index 000000000..c11a127b8 --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 460549a3de27f8dd8371b6d6fc1f69d8bffa102b Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe_macdonald@mentor.com> | ||
3 | Date: Tue, 6 Jan 2015 11:23:21 -0500 | ||
4 | Subject: [PATCH] openl2tp: simplify gcc warning hack | ||
5 | |||
6 | The hack to work around the gcc warning causes problems with some modern | ||
7 | gcc configurations. Since the redef behaviour is essentially correct | ||
8 | everywhere and since the hack is still required on 32-bit builders, leave | ||
9 | it in place but remove the #if guard since it is only there to ensure that | ||
10 | the l2tp_private.h file is updated if the rpc source file is changed and | ||
11 | the two get out of sync. | ||
12 | |||
13 | Upstream-status: pending | ||
14 | |||
15 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | ||
16 | --- | ||
17 | l2tp_private.h | 6 ------ | ||
18 | 1 file changed, 6 deletions(-) | ||
19 | |||
20 | diff --git a/l2tp_private.h b/l2tp_private.h | ||
21 | index f3c1af7..cca6806 100644 | ||
22 | --- a/l2tp_private.h | ||
23 | +++ b/l2tp_private.h | ||
24 | @@ -89,14 +89,8 @@ | ||
25 | * So we redefine the constant with UL suffix to avoid the gcc warning. | ||
26 | * Is there some C preprocessor magic that could avoid having to do this? | ||
27 | */ | ||
28 | -#if L2TP_API_TUNNEL_FLAG_MTU != 2147483648 | ||
29 | -#error Constant L2TP_API_TUNNEL_FLAG_MTU changed. Update local definition here. | ||
30 | -#endif | ||
31 | #undef L2TP_API_TUNNEL_FLAG_MTU | ||
32 | #define L2TP_API_TUNNEL_FLAG_MTU 2147483648UL | ||
33 | -#if L2TP_API_SESSION_FLAG_NO_PPP != 2147483648 | ||
34 | -#error Constant L2TP_API_SESSION_FLAG_NO_PPP changed. Update local definition here. | ||
35 | -#endif | ||
36 | #undef L2TP_API_SESSION_FLAG_NO_PPP | ||
37 | #define L2TP_API_SESSION_FLAG_NO_PPP 2147483648UL | ||
38 | |||
39 | -- | ||
40 | 1.9.1 | ||
41 | |||
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb new file mode 100644 index 000000000..5a041073d --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb | |||
@@ -0,0 +1,36 @@ | |||
1 | SUMMARY = "An L2TP client/server, designed for VPN use." | ||
2 | DESCRIPTION = "OpenL2TP is an open source L2TP client / server, written \ | ||
3 | specifically for Linux. It has been designed for use as an enterprise \ | ||
4 | L2TP VPN server or in commercial, Linux-based, embedded networking \ | ||
5 | products and is able to support hundreds of sessions, each with \ | ||
6 | different configuration. It is used by several ISPs to provide \ | ||
7 | L2TP services and by corporations to implement L2TP VPNs." | ||
8 | HOMEPAGE = "http://www.openl2tp.org/" | ||
9 | SECTION = "console/network" | ||
10 | LICENSE = "GPL-2.0" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585" | ||
12 | DEPENDS = "popt flex readline" | ||
13 | |||
14 | SRC_URI = "http://ftp.jaist.ac.jp/pub/sourceforge/o/op/${PN}/${PN}/${PV}/${BP}.tar.gz \ | ||
15 | file://Makefile-modify-CFLAGS-to-aviod-build-error.patch \ | ||
16 | file://openl2tp-simplify-gcc-warning-hack.patch \ | ||
17 | " | ||
18 | SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0" | ||
19 | SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f" | ||
20 | |||
21 | inherit autotools-brokensep pkgconfig | ||
22 | |||
23 | PARALLEL_MAKE = "" | ||
24 | EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-nused-but-set-variable"' | ||
25 | |||
26 | do_compile_prepend() { | ||
27 | sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \ | ||
28 | -e 's:$(CROSS_COMPILE)as:${AS}:g' \ | ||
29 | -e 's:$(CROSS_COMPILE)ld:${LD}:g' \ | ||
30 | -e 's:$(CROSS_COMPILE)gcc:${CC}:g' \ | ||
31 | -e 's:$(CROSS_COMPILE)ar:${AR}:g' \ | ||
32 | -e 's:$(CROSS_COMPILE)nm:${NM}:g' \ | ||
33 | -e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \ | ||
34 | -e 's:$(CROSS_COMPILE)install:install:g' \ | ||
35 | ${S}/Makefile | ||
36 | } | ||