From patchwork Mon Jul 6 19:13:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 50779 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9D7BE229FC for ; Mon, 6 Jul 2015 19:14:16 +0000 (UTC) Received: by wifm2 with SMTP id m2sf13656967wif.1 for ; Mon, 06 Jul 2015 12:14:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=42tBqFni9C50lGapbjLnzuE9BmsdrpVdglVxy67+j8A=; b=TKl5l1V55hRlwSHHAHK0AWr/VVQ6uy48DKefDHdW1K6QHGqIBBoVUqIMc35aU51qFl czjLbVUVkw9kzVzV5JrQtf69xrRRsKURXkALkZ+T6WpLXjhn7nvbMT8z12/CyErMGj3n +7CsMKeN2/FI9wGB5pTilTHzg8K7DOlaVj2SkrMmf8kABxbXcKmEiFuPirTYidK4DAhw S5H50ud3DEaBRo48Cx/yBCpbOUnFrGkydo3rXX45ixAR+VisCNxs4FsZvNOk9GKclbi9 ykCBdYMNg6k9g4jredhHJe5+Bs8KxNeO3pD1Y81/Wc94Hhgniv1WdlzGk3gvI5I/ECFd mBdQ== X-Gm-Message-State: ALoCoQnQFIwgeQh6U9uh5GwHiAmViSpnS5qoTjR+qz9R4bGV3HOUAE4tJMq0BBryofIfiYNPTNFj X-Received: by 10.152.2.196 with SMTP id 4mr196045law.10.1436210055479; Mon, 06 Jul 2015 12:14:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.99 with SMTP id p3ls235581laj.57.gmail; Mon, 06 Jul 2015 12:14:15 -0700 (PDT) X-Received: by 10.112.29.228 with SMTP id n4mr339331lbh.89.1436210055193; Mon, 06 Jul 2015 12:14:15 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id tp6si16007677lbb.97.2015.07.06.12.14.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 12:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lagx9 with SMTP id x9so167597208lag.1 for ; Mon, 06 Jul 2015 12:14:15 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr404853lbb.56.1436210055015; Mon, 06 Jul 2015 12:14:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1914234lbb; Mon, 6 Jul 2015 12:14:13 -0700 (PDT) X-Received: by 10.55.20.166 with SMTP id 38mr827497qku.12.1436210053204; Mon, 06 Jul 2015 12:14:13 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b73si9415258qge.107.2015.07.06.12.14.12; Mon, 06 Jul 2015 12:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 0376C61E5D; Mon, 6 Jul 2015 19:14:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BF89361E5A; Mon, 6 Jul 2015 19:14:05 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EF72B61E5A; Mon, 6 Jul 2015 19:14:00 +0000 (UTC) Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com [209.85.220.182]) by lists.linaro.org (Postfix) with ESMTPS id 0FB6661B6D for ; Mon, 6 Jul 2015 19:13:59 +0000 (UTC) Received: by qkhu186 with SMTP id u186so124407762qkh.0 for ; Mon, 06 Jul 2015 12:13:58 -0700 (PDT) X-Received: by 10.140.101.140 with SMTP id u12mr758130qge.48.1436210038739; Mon, 06 Jul 2015 12:13:58 -0700 (PDT) Received: from localhost.localdomain (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id f8sm9789294qkf.7.2015.07.06.12.13.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jul 2015 12:13:58 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 6 Jul 2015 15:13:52 -0400 Message-Id: <1436210032-13375-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [PATCH v2] helper: convert to a library X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Remove the need to build helper source files into the linux-generic library by converting helpers to be their own library. This removes the need for all other platforms to also build in the helpers which are optional just to run the tests. Signed-off-by: Mike Holmes Reviewed-by: Christophe Milard --- v2: use srcdir to shorten paths .gitignore | 2 +- Makefile.am | 3 ++- configure.ac | 1 + debian/libodphelper-dev.dirs | 2 ++ debian/libodphelper-dev.install | 4 ++++ debian/libodphelper.dirs | 1 + debian/libodphelper.install | 1 + example/Makefile.inc | 2 +- helper/Makefile.am | 30 +++++++++++++++++++++++++++++- helper/test/Makefile.am | 2 ++ pkgconfig/libodphelper.pc.in | 11 +++++++++++ platform/linux-generic/Makefile.am | 16 ---------------- test/Makefile.inc | 2 +- test/validation/Makefile.inc | 2 +- 14 files changed, 57 insertions(+), 22 deletions(-) create mode 100644 debian/libodphelper-dev.dirs create mode 100644 debian/libodphelper-dev.install create mode 100644 debian/libodphelper.dirs create mode 100644 debian/libodphelper.install create mode 100644 pkgconfig/libodphelper.pc.in diff --git a/.gitignore b/.gitignore index 6222fd9..4dbf28e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ missing config.log config.status libtool -pkgconfig/libodp.pc +pkgconfig/libodp*.pc .deps/ cscope.out tags diff --git a/Makefile.am b/Makefile.am index 2c8a9d6..7ce3a3c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,9 +3,10 @@ AUTOMAKE_OPTIONS = foreign #@with_platform@ works alone in subdir but not as part of a path??? SUBDIRS = @platform_with_platform@ \ + helper \ test \ @platform_with_platform_test@ \ - helper \ + helper/test \ doc \ example \ scripts diff --git a/configure.ac b/configure.ac index 28dad3b..29fcb18 100644 --- a/configure.ac +++ b/configure.ac @@ -296,6 +296,7 @@ AC_CONFIG_FILES([Makefile helper/Makefile helper/test/Makefile pkgconfig/libodp.pc + pkgconfig/libodphelper.pc platform/linux-generic/Makefile platform/linux-generic/test/pktio/Makefile scripts/Makefile diff --git a/debian/libodphelper-dev.dirs b/debian/libodphelper-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/debian/libodphelper-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/debian/libodphelper-dev.install b/debian/libodphelper-dev.install new file mode 100644 index 0000000..b973af4 --- /dev/null +++ b/debian/libodphelper-dev.install @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/*/lib*.so +usr/lib/*/lib*.a +usr/lib/*/pkgconfig/* diff --git a/debian/libodphelper.dirs b/debian/libodphelper.dirs new file mode 100644 index 0000000..6845771 --- /dev/null +++ b/debian/libodphelper.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/debian/libodphelper.install b/debian/libodphelper.install new file mode 100644 index 0000000..3ddde58 --- /dev/null +++ b/debian/libodphelper.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* diff --git a/example/Makefile.inc b/example/Makefile.inc index b3a9706..e1c1cb7 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -1,7 +1,7 @@ include $(top_srcdir)/Makefile.inc include $(top_srcdir)/platform/@with_platform@/Makefile.inc LIB = $(top_builddir)/lib -LDADD = $(LIB)/libodp.la +LDADD = $(LIB)/libodp.la $(LIB)/libodphelper.la AM_CFLAGS += \ -I$(srcdir) \ -I$(top_srcdir)/example \ diff --git a/helper/Makefile.am b/helper/Makefile.am index 02af5b3..44bcc3d 100644 --- a/helper/Makefile.am +++ b/helper/Makefile.am @@ -1 +1,29 @@ -SUBDIRS = test +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = $(top_builddir)/pkgconfig/libodphelper.pc + +LIB = $(top_builddir)/lib +AM_CFLAGS = -I$(srcdir)/include +AM_CFLAGS += -I$(top_srcdir)/platform/@with_platform@/include +AM_CFLAGS += -I$(top_srcdir)/platform/linux-generic/include +AM_CFLAGS += -I$(top_srcdir)/include + +include_HEADERS = \ + $(srcdir)/include/odp/helper/ring.h \ + $(srcdir)/include/odp/helper/linux.h \ + $(srcdir)/include/odp/helper/chksum.h\ + $(srcdir)/include/odp/helper/eth.h\ + $(srcdir)/include/odp/helper/icmp.h\ + $(srcdir)/include/odp/helper/ip.h\ + $(srcdir)/include/odp/helper/ipsec.h\ + $(srcdir)/include/odp/helper/tcp.h\ + $(srcdir)/include/odp/helper/udp.h + +noinst_HEADERS = \ + $(srcdir)/odph_debug.h \ + $(srcdir)/odph_pause.h + +__LIB__libodphelper_la_SOURCES = \ + linux.c \ + ring.c + +lib_LTLIBRARIES = $(LIB)/libodphelper.la diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am index 9ac82eb..aed97cc 100644 --- a/helper/test/Makefile.am +++ b/helper/test/Makefile.am @@ -24,4 +24,6 @@ bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY) dist_odp_chksum_SOURCES = odp_chksum.c dist_odp_thread_SOURCES = odp_thread.c +odp_thread_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp.la dist_odp_process_SOURCES = odp_process.c +odp_process_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp.la diff --git a/pkgconfig/libodphelper.pc.in b/pkgconfig/libodphelper.pc.in new file mode 100644 index 0000000..2993d71 --- /dev/null +++ b/pkgconfig/libodphelper.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libodphelper +Description: Helper for the ODP packet processing engine +Version: @VERSION@ +Libs: -L${libdir} -lodphelper +Libs.private: +Cflags: -I${includedir} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 4f2063f..8cf03b2 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -127,20 +127,6 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_timer_internal.h \ ${top_srcdir}/platform/linux-generic/Makefile.inc -subdirheadersdir = $(includedir)/odp/helper -subdirheaders_HEADERS = \ - $(top_srcdir)/helper/include/odp/helper/chksum.h \ - $(top_srcdir)/helper/include/odp/helper/eth.h \ - $(top_srcdir)/helper/include/odp/helper/icmp.h \ - $(top_srcdir)/helper/include/odp/helper/ip.h \ - $(top_srcdir)/helper/include/odp/helper/ipsec.h \ - $(top_srcdir)/helper/include/odp/helper/linux.h \ - $(top_srcdir)/helper/include/odp/helper/ring.h \ - $(top_srcdir)/helper/include/odp/helper/tcp.h \ - $(top_srcdir)/helper/include/odp/helper/udp.h \ - $(top_srcdir)/helper/odph_debug.h \ - $(top_srcdir)/helper/odph_pause.h - __LIB__libodp_la_SOURCES = \ odp_barrier.c \ odp_buffer.c \ @@ -151,14 +137,12 @@ __LIB__libodp_la_SOURCES = \ odp_event.c \ odp_init.c \ odp_impl.c \ - ../../helper/linux.c \ odp_packet.c \ odp_packet_flags.c \ odp_packet_io.c \ odp_packet_socket.c \ odp_pool.c \ odp_queue.c \ - ../../helper/ring.c \ odp_rwlock.c \ odp_schedule.c \ odp_shared_memory.c \ diff --git a/test/Makefile.inc b/test/Makefile.inc index 1eb6ed5..2fa61e4 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -5,7 +5,7 @@ LIB = $(top_builddir)/lib #in the following line, the libs using the symbols should come before #the libs containing them! The includer is given a chance to add things #before libodp by setting PRE_LDADD before the inclusion. -LDADD = $(PRE_LDADD) $(LIB)/libodp.la +LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp.la INCFLAGS = -I$(srcdir) \ -I$(top_srcdir)/test \ diff --git a/test/validation/Makefile.inc b/test/validation/Makefile.inc index 3cdc6a7..31729b8 100644 --- a/test/validation/Makefile.inc +++ b/test/validation/Makefile.inc @@ -4,4 +4,4 @@ AM_CFLAGS += -I$(top_srcdir)/test/validation/common AM_LDFLAGS += -static LIBCUNIT_COMMON = $(top_builddir)/test/validation/common/libcunit_common.a -LIBODP = $(LIB)/libodp.la +LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp.la