[meta-freescale] [[PATCH v2 28/29] ofp: add recipes

Chunrong Guo B40290 at freescale.com
Tue Apr 25 20:28:31 PDT 2017


From: Chunrong Guo <chunrong.guo at nxp.com>

Signed-off-by: Chunrong Guo <B40290 at freescale.com>
---
 ...Patch-to-install-ofp-example-applications.patch | 166 +++++++++++++++++++++
 ...ation-issue-with-redefinition-of-a-struct.patch |  19 +++
 recipes-extended/ofp/ofp_git.bb                    |  39 +++++
 3 files changed, 224 insertions(+)
 create mode 100644 recipes-extended/ofp/ofp/0001-Patch-to-install-ofp-example-applications.patch
 create mode 100644 recipes-extended/ofp/ofp/Fix-compilation-issue-with-redefinition-of-a-struct.patch
 create mode 100644 recipes-extended/ofp/ofp_git.bb

diff --git a/recipes-extended/ofp/ofp/0001-Patch-to-install-ofp-example-applications.patch b/recipes-extended/ofp/ofp/0001-Patch-to-install-ofp-example-applications.patch
new file mode 100644
index 0000000..041896a
--- /dev/null
+++ b/recipes-extended/ofp/ofp/0001-Patch-to-install-ofp-example-applications.patch
@@ -0,0 +1,166 @@
+From 82691546d6125f1d07c4f9faa06475dff94ba567 Mon Sep 17 00:00:00 2001
+From: Nikhil Agarwal <nikhil.agarwal at linaro.org>
+Date: Wed, 11 Jan 2017 00:24:07 +0530
+Subject: [PATCH] Patch to install ofp example applications.
+
+Signed-off-by: Nikhil Agarwal <nikhil.agarwal at linaro.org>
+---
+ example/classifier/Makefile.am     | 3 ++-
+ example/fpm/Makefile.am            | 3 ++-
+ example/fpm_burstmode/Makefile.am  | 3 ++-
+ example/ioctl_test/Makefile.am     | 3 ++-
+ example/multicast/Makefile.am      | 3 ++-
+ example/socket/Makefile.am         | 3 ++-
+ example/sysctl/Makefile.am         | 3 ++-
+ example/udp_fwd_socket/Makefile.am | 3 ++-
+ example/udpecho/Makefile.am        | 3 ++-
+ example/webserver/Makefile.am      | 3 ++-
+ example/webserver2/Makefile.am     | 3 ++-
+ 11 files changed, 22 insertions(+), 11 deletions(-)
+
+diff --git a/example/classifier/Makefile.am b/example/classifier/Makefile.am
+index c54542c..cb4eb31 100644
+--- a/example/classifier/Makefile.am
++++ b/example/classifier/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = classifier 
++inst_PROGRAMS = classifier
++instdir=${exec_prefix}/ofp/bin
+ classifier_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+ dist_classifier_SOURCES = classifier_main.c
+diff --git a/example/fpm/Makefile.am b/example/fpm/Makefile.am
+index d04916c..2b459d7 100644
+--- a/example/fpm/Makefile.am
++++ b/example/fpm/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = fpm
++inst_PROGRAMS = fpm
++instdir=${exec_prefix}/ofp/bin
+ fpm_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+ dist_fpm_SOURCES = app_main.c \
+diff --git a/example/fpm_burstmode/Makefile.am b/example/fpm_burstmode/Makefile.am
+index 6b7b024..fc8cdfe 100644
+--- a/example/fpm_burstmode/Makefile.am
++++ b/example/fpm_burstmode/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = fpm_burstmode
++inst_PROGRAMS = fpm_burstmode
++instdir=${exec_prefix}/ofp/bin
+ fpm_burstmode_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+ dist_fpm_burstmode_SOURCES = app_main.c
+diff --git a/example/ioctl_test/Makefile.am b/example/ioctl_test/Makefile.am
+index d45c4c4..98fd573 100644
+--- a/example/ioctl_test/Makefile.am
++++ b/example/ioctl_test/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = ioctl_test
++inst_PROGRAMS = ioctl_test
++instdir=${exec_prefix}/ofp/bin
+ 
+ ioctl_test_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+diff --git a/example/multicast/Makefile.am b/example/multicast/Makefile.am
+index 378aaf3..8476123 100644
+--- a/example/multicast/Makefile.am
++++ b/example/multicast/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = mcast
++inst_PROGRAMS = mcast
++instdir=${exec_prefix}/ofp/bin
+ 
+ mcast_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+diff --git a/example/socket/Makefile.am b/example/socket/Makefile.am
+index 9fa2b7d..c296fc2 100644
+--- a/example/socket/Makefile.am
++++ b/example/socket/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = socket
++inst_PROGRAMS = socket
++instdir=${exec_prefix}/ofp/bin
+ socket_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+ dist_socket_SOURCES = \
+diff --git a/example/sysctl/Makefile.am b/example/sysctl/Makefile.am
+index 42f3a27..7ef0227 100644
+--- a/example/sysctl/Makefile.am
++++ b/example/sysctl/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = sysctl
++inst_PROGRAMS = sysctl
++instdir=${exec_prefix}/ofp/bin
+ 
+ sysctl_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+diff --git a/example/udp_fwd_socket/Makefile.am b/example/udp_fwd_socket/Makefile.am
+index 653fd21..c8ce9ca 100644
+--- a/example/udp_fwd_socket/Makefile.am
++++ b/example/udp_fwd_socket/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = udp_fwd_socket
++inst_PROGRAMS = udp_fwd_socket
++instdir=${exec_prefix}/ofp/bin
+ 
+ udp_fwd_socket_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+diff --git a/example/udpecho/Makefile.am b/example/udpecho/Makefile.am
+index e64f2c0..a0c1085 100644
+--- a/example/udpecho/Makefile.am
++++ b/example/udpecho/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = udpecho
++inst_PROGRAMS = udpecho
++instdir=${exec_prefix}/ofp/bin
+ 
+ udpecho_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+diff --git a/example/webserver/Makefile.am b/example/webserver/Makefile.am
+index 1dad1b6..230515e 100644
+--- a/example/webserver/Makefile.am
++++ b/example/webserver/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = webserver
++inst_PROGRAMS = webserver
++instdir=${exec_prefix}/ofp/bin
+ 
+ webserver_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+diff --git a/example/webserver2/Makefile.am b/example/webserver2/Makefile.am
+index d9f4767..c53a9d2 100644
+--- a/example/webserver2/Makefile.am
++++ b/example/webserver2/Makefile.am
+@@ -1,6 +1,7 @@
+ include $(top_srcdir)/example/Makefile.inc
+ 
+-noinst_PROGRAMS = webserver2
++inst_PROGRAMS = webserver2
++instdir=${exec_prefix}/ofp/bin
+ 
+ webserver2_LDFLAGS = $(AM_LDFLAGS) -static
+ 
+-- 
+2.9.3
+
diff --git a/recipes-extended/ofp/ofp/Fix-compilation-issue-with-redefinition-of-a-struct.patch b/recipes-extended/ofp/ofp/Fix-compilation-issue-with-redefinition-of-a-struct.patch
new file mode 100644
index 0000000..4163dc8
--- /dev/null
+++ b/recipes-extended/ofp/ofp/Fix-compilation-issue-with-redefinition-of-a-struct.patch
@@ -0,0 +1,19 @@
+ofp_netlink.c: do not include netinet/ip.h
+
+The struct iphdr is defined in netinet/ip.h and in linux/ip.h. The
+backwards compatible ofp_netlink.c is modified to include linux/ip.h.
+
+http://www.openfastpath.org/pipermail/openfastpath/2016-October/001330.html
+
+
+--- a/src/ofp_netlink.cold	2017-04-20 16:08:20.942851781 +0800
++++ b/src/ofp_netlink.c	2017-04-20 16:08:39.222851148 +0800
+@@ -9,7 +9,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <netinet/in.h>
+-#include <netinet/ip.h>
++#include <linux/ip.h>
+ #include <linux/netlink.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/if_arp.h>
diff --git a/recipes-extended/ofp/ofp_git.bb b/recipes-extended/ofp/ofp_git.bb
new file mode 100644
index 0000000..1c6757e
--- /dev/null
+++ b/recipes-extended/ofp/ofp_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "An open source user space fast path TCP/IP stack" 
+DESCRIPTION = "openfastpath is used to enable accelerated routing/forwarding for IPv4 and IPv6, \
+               tunneling and termination for a variety of protocols."
+HOMEPAGE = "http://www.openfastpath.org"
+SECTION = "console/network"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fbe4957c430eed6cc20521d4eb429fae"
+
+SRC_URI = "git://github.com/OpenFastPath/ofp.git;protocol=https \
+           file://0001-Patch-to-install-ofp-example-applications.patch \
+           file://Fix-compilation-issue-with-redefinition-of-a-struct.patch \
+"
+SRCREV = "f7ea51b32450ba45d87aff79504e39fad801e7a7"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+DEPENDS = "odp"
+
+EXTRA_OECONF = " \
+    --prefix=/usr \
+    --libdir=${libdir} \
+    --host=${SIMPLE_TARGET_SYS} \
+    --with-odp=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+    export SIMPLE_TARGET_SYS="$(echo ${TARGET_SYS} | sed s:${TARGET_VENDOR}::g)"
+
+    ${S}/bootstrap
+    ${S}/configure ${EXTRA_OECONF}
+}
+
+FILES_${PN} += "/usr/ofp/bin"
+FILES_${PN}-dbg += "/usr/ofp/bin/.debug"
+COMPATIBLE_MACHINE = "(ls2088a)"
-- 
1.9.0



More information about the meta-freescale mailing list