DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 4/4] build: add libbsd to pkg-config file if enabled
Date: Tue, 23 Apr 2019 23:06:44 +0100	[thread overview]
Message-ID: <20190423220644.54589-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20190423220644.54589-1-bruce.richardson@intel.com>

If libbsd is enabled in DPDK, the strlcpy and strlcat functions in
rte_string_fns.h redirect to the varients in libbsd, only using the
fallbacks if it is not enabled. Therefore, if libbsd is enabled, it needs
to be called out as a DPDK dependency in the pkgconfig file.

To ensure that we don't have undefined variables on non-Linux platforms, we
can remove the linux condition around the libbsd check - no harm comes in
looking for it on other OS, since it's an optional dependency.

To verify this builds correctly, the cmdline sample app is added to the
list of examples compiled by test-meson-builds. Without this change
compilation fails if libbsd is present on the system

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build            | 10 ++++------
 devtools/test-meson-builds.sh |  2 +-
 meson.build                   |  2 ++
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index f8aded6ed..64e2315dd 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -125,12 +125,10 @@ if numa_dep.found() and cc.has_header('numaif.h')
 	dpdk_extra_ldflags += '-lnuma'
 endif
 
-# check for strlcpy
-if is_linux
-	libbsd = dependency('libbsd', required: false)
-	if libbsd.found()
-		dpdk_conf.set('RTE_USE_LIBBSD', 1)
-	endif
+# check for libbsd
+libbsd = dependency('libbsd', required: false)
+if libbsd.found()
+	dpdk_conf.set('RTE_USE_LIBBSD', 1)
 endif
 
 # add -include rte_config to cflags
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index dfba2a782..41080353b 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -103,7 +103,7 @@ $ninja_cmd -C $build_path install
 # rather than hacking our environment, just edit the .pc file prefix value
 sed -i "s|prefix=|prefix=$DESTDIR|" $PKG_CONFIG_PATH/libdpdk.pc
 
-for example in helloworld l2fwd l3fwd skeleton timer; do
+for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
 	echo "## Building $example"
 	make -C $DESTDIR/usr/local/share/dpdk/examples/$example
 done
diff --git a/meson.build b/meson.build
index a96486597..3c173a587 100644
--- a/meson.build
+++ b/meson.build
@@ -77,6 +77,8 @@ pkg.generate(name: meson.project_name(),
 	libraries: dpdk_libraries,
 	libraries_private: dpdk_drivers + dpdk_static_libraries +
 			['-Wl,-Bdynamic'] + dpdk_extra_ldflags,
+	requires: libbsd, # apps using rte_string_fns.h may need this if enabled
+	                  # if libbsd is not enabled, then this is blank
 	description: '''The Data Plane Development Kit (DPDK).
 Note that CFLAGS might contain an -march flag higher than typical baseline.
 This is required for a number of static inline functions in the public headers.''',
-- 
2.20.1

  parent reply	other threads:[~2019-04-23 22:07 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 22:06 [dpdk-dev] [PATCH 0/4] add testing of libdpdk pkg-config file Bruce Richardson
2019-04-23 22:06 ` Bruce Richardson
2019-04-23 22:06 ` [dpdk-dev] [PATCH 1/4] examples: install examples as part of ninja install Bruce Richardson
2019-04-23 22:06   ` Bruce Richardson
2019-04-23 22:06 ` [dpdk-dev] [PATCH 2/4] examples: simplify getting list of all examples Bruce Richardson
2019-04-23 22:06   ` Bruce Richardson
2019-04-23 22:06 ` [dpdk-dev] [PATCH 3/4] devtools/test-meson-builds: add testing of pkg-config file Bruce Richardson
2019-04-23 22:06   ` Bruce Richardson
2019-04-24  9:22   ` Luca Boccassi
2019-04-24  9:22     ` Luca Boccassi
2019-04-24 10:41     ` Bruce Richardson
2019-04-24 10:41       ` Bruce Richardson
2019-04-24 11:02       ` Luca Boccassi
2019-04-24 11:02         ` Luca Boccassi
2019-04-24 12:31         ` Bruce Richardson
2019-04-24 12:31           ` Bruce Richardson
2019-04-24 13:37           ` Luca Boccassi
2019-04-24 13:37             ` Luca Boccassi
2019-04-26 14:56             ` Bruce Richardson
2019-04-26 14:56               ` Bruce Richardson
2019-04-26 16:10               ` Luca Boccassi
2019-04-26 16:10                 ` Luca Boccassi
2019-05-02 13:11               ` Thomas Monjalon
2019-05-02 13:11                 ` Thomas Monjalon
2019-05-02 13:17                 ` Bruce Richardson
2019-05-02 13:17                   ` Bruce Richardson
2019-05-02 14:08                   ` Luca Boccassi
2019-05-02 14:08                     ` Luca Boccassi
2019-05-02 15:11                     ` Thomas Monjalon
2019-05-02 15:11                       ` Thomas Monjalon
2019-05-02 15:30                       ` Bruce Richardson
2019-05-02 15:30                         ` Bruce Richardson
2019-05-02 15:38                         ` Thomas Monjalon
2019-05-02 15:38                           ` Thomas Monjalon
2019-05-02 15:41                           ` Bruce Richardson
2019-05-02 15:41                             ` Bruce Richardson
2019-04-23 22:06 ` Bruce Richardson [this message]
2019-04-23 22:06   ` [dpdk-dev] [PATCH 4/4] build: add libbsd to pkg-config file if enabled Bruce Richardson
2019-04-23 23:04 ` [dpdk-dev] [PATCH 0/4] add testing of libdpdk pkg-config file Stephen Hemminger
2019-04-23 23:04   ` Stephen Hemminger
2019-04-24  8:54   ` Bruce Richardson
2019-04-24  8:54     ` Bruce Richardson
2019-04-24  9:00     ` Bruce Richardson
2019-04-24  9:00       ` Bruce Richardson
2019-04-26 16:11 ` Luca Boccassi
2019-04-26 16:11   ` Luca Boccassi
2019-04-26 16:20   ` Bruce Richardson
2019-04-26 16:20     ` Bruce Richardson
2019-04-26 16:50 ` [dpdk-dev] [PATCH v2 0/6] " Bruce Richardson
2019-04-26 16:50   ` Bruce Richardson
2019-04-26 16:50   ` [dpdk-dev] [PATCH v2 1/6] examples/l3fwd: fix compile on FreeBSD Bruce Richardson
2019-04-26 16:50     ` Bruce Richardson
2019-05-01 10:10     ` Luca Boccassi
2019-05-01 10:10       ` Luca Boccassi
2019-04-26 16:50   ` [dpdk-dev] [PATCH v2 2/6] examples: install examples as part of ninja install Bruce Richardson
2019-04-26 16:50     ` Bruce Richardson
2019-04-26 16:50   ` [dpdk-dev] [PATCH v2 3/6] build: fix ninja install on FreeBSD Bruce Richardson
2019-04-26 16:50     ` Bruce Richardson
2019-05-01 10:10     ` Luca Boccassi
2019-05-01 10:10       ` Luca Boccassi
2019-04-26 16:50   ` [dpdk-dev] [PATCH v2 4/6] devtools/test-meson-builds: add testing of pkg-config file Bruce Richardson
2019-04-26 16:50     ` Bruce Richardson
2019-05-02 12:38     ` Thomas Monjalon
2019-05-02 12:38       ` Thomas Monjalon
2019-05-02 12:54       ` Luca Boccassi
2019-05-02 12:54         ` Luca Boccassi
2019-05-02 13:21       ` Bruce Richardson
2019-05-02 13:21         ` Bruce Richardson
2019-05-02 13:57         ` Thomas Monjalon
2019-05-02 13:57           ` Thomas Monjalon
2019-04-26 16:50   ` [dpdk-dev] [PATCH v2 5/6] build: add libbsd to pkg-config file if enabled Bruce Richardson
2019-04-26 16:50     ` Bruce Richardson
2019-04-26 16:50   ` [dpdk-dev] [PATCH v2 6/6] examples: remove auto-generation of examples list Bruce Richardson
2019-04-26 16:50     ` Bruce Richardson
2019-05-01 10:10     ` Luca Boccassi
2019-05-01 10:10       ` Luca Boccassi
2019-05-02 16:51   ` [dpdk-dev] [PATCH v4 0/4] file meson compilation and install issues Bruce Richardson
2019-05-02 16:51     ` Bruce Richardson
2019-05-02 16:51     ` [dpdk-dev] [PATCH v4 1/4] examples/l3fwd: fix compile on FreeBSD Bruce Richardson
2019-05-02 16:51       ` Bruce Richardson
2019-05-02 16:51     ` [dpdk-dev] [PATCH v4 2/4] examples: install examples as part of ninja install Bruce Richardson
2019-05-02 16:51       ` Bruce Richardson
2019-05-02 16:51     ` [dpdk-dev] [PATCH v4 3/4] build: fix ninja install on FreeBSD Bruce Richardson
2019-05-02 16:51       ` Bruce Richardson
2019-05-02 16:51     ` [dpdk-dev] [PATCH v4 4/4] build: add libbsd to pkg-config file if enabled Bruce Richardson
2019-05-02 16:51       ` Bruce Richardson
2019-05-02 21:09     ` [dpdk-dev] [PATCH v4 0/4] file meson compilation and install issues Thomas Monjalon
2019-05-02 21:09       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190423220644.54589-5-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).