Build libmemif as part of verify job 71/11371/8
authorDamjan Marion <damarion@cisco.com>
Mon, 26 Mar 2018 12:09:38 +0000 (14:09 +0200)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 28 Mar 2018 13:41:15 +0000 (13:41 +0000)
Change-Id: I7e808b5bcbb74343a4ed6782f115ed07e9bfe3a6
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Makefile
build-data/packages/extras.mk [new file with mode: 0644]
build-data/packages/libmemif.mk [new file with mode: 0644]
extras/libmemif/Makefile.am
extras/libmemif/examples/icmp_responder-epoll/main.c
extras/libmemif/src/main.c
extras/libmemif/src/memif_private.h

index 0ea903c..7007ac8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -513,6 +513,8 @@ ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
 endif
        $(call banner,"Building sample-plugin")
        @make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
+       $(call banner,"Building libmemif")
+       @make -C build-root PLATFORM=vpp TAG=vpp libmemif-install
        $(call banner,"Building $(PKG) packages")
        @make pkg-$(PKG)
 ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
diff --git a/build-data/packages/extras.mk b/build-data/packages/extras.mk
new file mode 100644 (file)
index 0000000..fa81ada
--- /dev/null
@@ -0,0 +1 @@
+# empty file
diff --git a/build-data/packages/libmemif.mk b/build-data/packages/libmemif.mk
new file mode 100644 (file)
index 0000000..a4be180
--- /dev/null
@@ -0,0 +1,3 @@
+libmemif_source = extras
+libmemif_configure_subdir =  libmemif
+
index 759f5c4..8640cf8 100644 (file)
@@ -53,14 +53,14 @@ unit_test_LDADD = $(CHECK_LIBS)
 # main lib
 #
 libmemif_la_SOURCES = src/main.c src/socket.c
-libmemif_la_CPPFLAGS = $(AM_CPPFLAGS) -Isrc
+libmemif_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src
 
 #
 # ICMP responder example
 #
 icmpr_SOURCES = examples/icmp_responder/main.c examples/icmp_responder/icmp_proto.c
 icmpr_LDADD = libmemif.la
-icmpr_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -Iexamples/icmp_responder
+icmpr_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src -I$(top_srcdir)/examples/icmp_responder
 
 #
 # ICMP responder libmemif event polling example
@@ -68,7 +68,7 @@ icmpr_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -Iexamples/icmp_responder
 icmpr_epoll_SOURCES = examples/icmp_responder-epoll/main.c \
                     examples/icmp_responder/icmp_proto.c
 icmpr_epoll_LDADD = libmemif.la -lpthread
-icmpr_epoll_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -Iexamples/icmp_responder
+icmpr_epoll_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src -I$(top_srcdir)/examples/icmp_responder
 
 #
 # ICMP responder multi-thread example
@@ -76,11 +76,11 @@ icmpr_epoll_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -Iexamples/icmp_responder
 icmpr_mt_SOURCES = examples/icmp_responder-mt/main.c \
                       examples/icmp_responder/icmp_proto.c
 icmpr_mt_LDADD = libmemif.la -lpthread
-icmpr_mt_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -Iexamples/icmp_responder
+icmpr_mt_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src -I$(top_srcdir)/examples/icmp_responder
 
 noinst_PROGRAMS = icmpr icmpr-epoll icmpr-mt
 
-include_HEADERS = src/libmemif.h src/memif.h
+include_HEADERS = src/libmemif.h
 
 lib_LTLIBRARIES = libmemif.la
 
index 6b977a4..1dab51f 100644 (file)
 
 #include <time.h>
 
+#ifndef TIME_UTC
+#define TIME_UTC 1
+#endif
+
 #include <libmemif.h>
 #include <icmp_proto.h>
 
index 42bced6..dc4a623 100644 (file)
@@ -1346,7 +1346,7 @@ memif_init_regions_and_queues (memif_connection_t * conn)
     (conn->run_args.num_s2m_rings + conn->run_args.num_m2s_rings);
 
   if ((r->fd =
-       memif_memfd_create ("memif region 0", MFD_ALLOW_SEALING)) == -1)
+       memfd_create ("memif region 0", MFD_ALLOW_SEALING)) == -1)
     return memif_syscall_error_handler (errno);
 
   if ((fcntl (r->fd, F_ADD_SEALS, F_SEAL_SHRINK)) == -1)
index b1039f9..accdac3 100644 (file)
@@ -215,7 +215,7 @@ int free_list_elt (memif_list_elt_t * list, uint16_t len, int key);
 
 #ifndef HAVE_MEMFD_CREATE
 static inline int
-memif_memfd_create (const char *name, unsigned int flags)
+memfd_create (const char *name, unsigned int flags)
 {
   return syscall (__NR_memfd_create, name, flags);
 }