From patchwork Sun Jul 5 23:08:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 50671 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 70961229E5 for ; Sun, 5 Jul 2015 23:11:18 +0000 (UTC) Received: by wguu7 with SMTP id u7sf44088467wgu.0 for ; Sun, 05 Jul 2015 16:11:17 -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=AlIkLIgj9nb52gg7w3W1QFY1K9UDzlhKFYQpT/RWVGw=; b=jAKJ6tPDP1S2FfmIHkmS3i0Kn8BO/04obGcTUY4FW+G6DqovZ9BbQhkUMpBsuTRaOk LceJriCJAwvGPdJ8rY+j0kfRIb5rR1DPFgYgQnYgeDzj/pkxfZH1XczrtJ4ADURnEthG KsUlkX6L+gRDY0/goMFIng178BAUj/XMnmqHM03fz3mWrIAOZPlS5BMIZ8JQweJArWF9 kNP/q8Kjz8Ud10dPqtwlkBToFGQf41T5OyLW842gfDX1n0l3Asu3EvJW4m85Vd+z/BzW W/yUwBW68kf2VtTu/2CV/kE9RxbVBeYCt8FYOjgN86q4gKNsNhB+TuDwLqojtV5sE8dc WOCA== X-Gm-Message-State: ALoCoQnaW/mhLJhBo0XcIWPQ19MhL8n+p23RLcJX5svl6y3UNE2jYYKKMQaAub7wD9s+o9FUEzkJ X-Received: by 10.194.81.136 with SMTP id a8mr28988680wjy.2.1436137877672; Sun, 05 Jul 2015 16:11:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls593848lae.85.gmail; Sun, 05 Jul 2015 16:11:17 -0700 (PDT) X-Received: by 10.112.190.10 with SMTP id gm10mr44938050lbc.2.1436137877428; Sun, 05 Jul 2015 16:11:17 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id w5si13649749laa.59.2015.07.05.16.11.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jul 2015 16:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lagh6 with SMTP id h6so134687433lag.2 for ; Sun, 05 Jul 2015 16:11:17 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr46187647lag.86.1436137876982; Sun, 05 Jul 2015 16:11:16 -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 hn6csp1366133lbb; Sun, 5 Jul 2015 16:11:16 -0700 (PDT) X-Received: by 10.194.60.81 with SMTP id f17mr87539008wjr.62.1436137876153; Sun, 05 Jul 2015 16:11:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id db2si8786425wjb.193.2015.07.05.16.11.14; Sun, 05 Jul 2015 16:11:16 -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 071B161C7D; Sun, 5 Jul 2015 23:11:14 +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 11A0961845; Sun, 5 Jul 2015 23:11:03 +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 4B97961845; Sun, 5 Jul 2015 23:10:53 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by lists.linaro.org (Postfix) with ESMTPS id 23E9E61C7D for ; Sun, 5 Jul 2015 23:08:31 +0000 (UTC) Received: by qkeo142 with SMTP id o142so107055973qke.1 for ; Sun, 05 Jul 2015 16:08:30 -0700 (PDT) X-Received: by 10.140.144.131 with SMTP id 125mr71070612qhq.75.1436137710855; Sun, 05 Jul 2015 16:08:30 -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 q68sm8401653qgd.42.2015.07.05.16.08.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Jul 2015 16:08:29 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Sun, 5 Jul 2015 19:08:24 -0400 Message-Id: <1436137704-15513-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [PATCH] 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.45 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 --- .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..93f57a4 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$(top_srcdir)/helper/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 = \ + $(top_srcdir)/helper/include/odp/helper/ring.h \ + $(top_srcdir)/helper/include/odp/helper/linux.h \ + $(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/tcp.h\ + $(top_srcdir)/helper/include/odp/helper/udp.h + +noinst_HEADERS = \ + $(top_srcdir)/helper/odph_debug.h \ + $(top_srcdir)/helper/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