From patchwork Tue Jan 22 13:10:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49995 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD2FE3237; Tue, 22 Jan 2019 14:12:06 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id BFAD2316B for ; Tue, 22 Jan 2019 14:12:05 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id t200so14248293wmt.0 for ; Tue, 22 Jan 2019 05:12:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F0ObmkAnvZ7TbEv6QNWj1SX/zwGNPV/6LlFQwZwlH7I=; b=lLSgGipMsuwtR/8fh7G9URQxzesU6EViP5+rj6ov2cI7fyZ+sTcw5HwRmzbJi1ECcn euZIGjy88YTDP9kkusROGwPTXNFk6dmEPJMaJ0tog3Rc7thmr58Dm4oRyttrTbncfrVd uJnguu8r6fm5fxPxg+CNEYytxPQXyHT0oa94hOlzQPmFfyZ/Ztf0Aip5CdeDMxTMWIFm CoO9t+lWgJEevG/DE2zVqqCSfIyi5M4nL3iqOIYHeRiNhgWdm5I6Po3virORrLw2rUgv JmQcTyGt9Cj2rG86DmDOlJlBRx8x3U+YAmNcgCpJ/lO6aP+TgLFJCWgnRkMmLp2nhBCU Lw9w== X-Gm-Message-State: AJcUukeu9W9Tzeww0C/JGJcqoj95zvJvNwokKBvnsAOrcb1sw+KqyMEL TdL5gzhF1Gd3A7UqeNeDERexHLI7 X-Google-Smtp-Source: ALg8bN7T4uff/6LmdpsP22l1rosA6BUuiQpzepOu/274kWcqCV8Q+VllkVDNSFh2cyi3Xxmame9wuw== X-Received: by 2002:a1c:544f:: with SMTP id p15mr3701177wmi.37.1548162725011; Tue, 22 Jan 2019 05:12:05 -0800 (PST) Received: from localhost ([2001:1be0:110d:fcfe:132c:a71a:1896:1395]) by smtp.gmail.com with ESMTPSA id y12sm33143657wmi.7.2019.01.22.05.12.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 05:12:03 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: Luca Boccassi Date: Tue, 22 Jan 2019 13:10:51 +0000 Message-Id: <20190122131054.25196-1-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190103175725.5836-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 1/4] build: bump minimum Meson version to 0.47.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Meson 0.47.1 fixed a bug that is difficult to work around, which causes the linker flag of dependencies to be repeated dozens of times, which causes issues especially when using the built-in dependency() API. Bump the minimum version and remove obsolete version checks. Signed-off-by: Luca Boccassi Acked-by: Bruce Richardson --- v2: bump meson minimum version to 0.47.1 to avoid meson bug v3: split away first independent patch from series v4: add acked-by drivers/meson.build | 5 +---- kernel/linux/meson.build | 6 +----- meson.build | 35 +++++++++++++++-------------------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index c3c66bbc0..e37d4fe2b 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -148,8 +148,5 @@ foreach class:driver_classes endif # build endforeach - if meson.version().version_compare('>=0.47') - # prior to 0.47, set_variable can't take array params - set_variable(class + '_drivers', class_drivers) - endif + set_variable(class + '_drivers', class_drivers) endforeach diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index 5b7ec06e1..d751d939f 100644 --- a/kernel/linux/meson.build +++ b/kernel/linux/meson.build @@ -27,11 +27,7 @@ else make_returncode = run_command('make', '-sC', kernel_dir, 'kernelversion').returncode() if make_returncode != 0 - if meson.version().version_compare('>=0.44') - warning(WARN_NO_HEADERS) - else - message('WARNING: ' + WARN_NO_HEADERS) - endif + warning(WARN_NO_HEADERS) else # returncode == 0 # DO ACTUAL MODULE BUILDING diff --git a/meson.build b/meson.build index 68429f850..bef38ac37 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('DPDK', 'C', version: '19.02.0-rc3', license: 'BSD', default_options: ['buildtype=release', 'default_library=static'], - meson_version: '>= 0.41' + meson_version: '>= 0.47.1' ) # set up some global vars for compiler, platform, configuration, etc. @@ -105,23 +105,18 @@ foreach lib:enabled_libs endforeach message(output_message + '\n') - -# prior to 0.47 set_variable didn't work with arrays, so we can't -# track driver lists easily -if meson.version().version_compare('>=0.47') - output_message = '\n===============\nDrivers Enabled\n===============\n' - foreach class:driver_classes - class_drivers = get_variable(class + '_drivers') - output_message += '\n' + class + ':\n\t' - output_count = 0 - foreach drv:class_drivers - output_message += drv + ', ' - output_count += 1 - if output_count == 8 - output_message += '\n\t' - output_count = 0 - endif - endforeach +output_message = '\n===============\nDrivers Enabled\n===============\n' +foreach class:driver_classes + class_drivers = get_variable(class + '_drivers') + output_message += '\n' + class + ':\n\t' + output_count = 0 + foreach drv:class_drivers + output_message += drv + ', ' + output_count += 1 + if output_count == 8 + output_message += '\n\t' + output_count = 0 + endif endforeach - message(output_message + '\n') -endif +endforeach +message(output_message + '\n') From patchwork Tue Jan 22 13:10:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49996 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75D74343C; Tue, 22 Jan 2019 14:12:16 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id D6C2B324D for ; Tue, 22 Jan 2019 14:12:07 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id n190so14118128wmd.0 for ; Tue, 22 Jan 2019 05:12:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0sxkGmQmHTBIFK4UPZVJ4MT/L8ir4wPlRVLQHhlnOvs=; b=aXkUIhFSsscQtwaYblDE5MPgB0HJwRKPSK+fXL0aArvv2KBc4Y8nV6IYIeuiSSN+FV aGA6z40HLmjkpyv3GCEQKL6kuVYOoIdIwhz3siTvqVxHnK0wLo+J2mAsba++sKF5FF39 ALDJv2iDCE5GQbUnu51teZyvQkf9FOFY2bO/fcUukV3anNfMDJlMmjEhDweWoBcB35/t w6uPVz9Px0/QVEvp4EGgJssBfPMTR6V6i96jV60IveVJeGGALus74oBHuSHMy2gHxH82 aVyhOFc3OsGtigTzP1z3Lbs0kAdgPLBx2ewDaoSmUZVGs3/ipWF1dn++ObGZL7k0ngb/ MYHA== X-Gm-Message-State: AJcUukcGDgG4V7mKS5QDGwFtB5BLTgp66B5agJYg5qB2MgXPXmKs4yic 7+QGpq5YXwiWhXqqcnXpAoIu/FSa X-Google-Smtp-Source: ALg8bN7fv5OHawRpcvzVL+y6MHdh3eSNr25s/C26lR4ha1g+TFhcNZpA3DTud3kjcwJp8h56ji5ZZg== X-Received: by 2002:a1c:c90b:: with SMTP id f11mr3679759wmb.33.1548162726952; Tue, 22 Jan 2019 05:12:06 -0800 (PST) Received: from localhost ([2001:1be0:110d:fcfe:132c:a71a:1896:1395]) by smtp.gmail.com with ESMTPSA id l20sm206326452wrb.93.2019.01.22.05.12.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 05:12:05 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: Luca Boccassi Date: Tue, 22 Jan 2019 13:10:52 +0000 Message-Id: <20190122131054.25196-2-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122131054.25196-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> <20190122131054.25196-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 2/4] build: use dependency() instead of find_library() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Whenever possible (if the library ships a pkg-config file) use meson's dependency() function to look for it, as it will automatically add it to the Requires.private list if needed, to allow for static builds to succeed for reverse dependencies of DPDK. Otherwise the recursive dependencies are not parsed, and users doing static builds have to resolve them manually by themselves. When using this API avoid additional checks that are superfluous and take extra time, and avoid adding the linker flag manually which causes it to be duplicated. Signed-off-by: Luca Boccassi Acked-by: Bruce Richardson --- v2: split libbsd change in a separate commit, remove CC to stable as a meson bump will be required v4: update comment in drivers/meson.build to clarify role of pkgconfig_extra_libs v5: remove -lz from drivers/compress/zlib drivers/compress/zlib/meson.build | 1 - drivers/crypto/ccp/meson.build | 1 - drivers/crypto/openssl/meson.build | 1 - drivers/crypto/qat/meson.build | 1 - drivers/meson.build | 9 +++++---- drivers/net/bnx2x/meson.build | 2 +- drivers/net/mlx4/meson.build | 6 +++--- drivers/net/mlx5/meson.build | 6 +++--- drivers/net/pcap/meson.build | 5 ++--- lib/librte_bpf/meson.build | 4 ++-- lib/librte_telemetry/meson.build | 2 +- 11 files changed, 17 insertions(+), 21 deletions(-) diff --git a/drivers/compress/zlib/meson.build b/drivers/compress/zlib/meson.build index 7748de2df..b036703c7 100644 --- a/drivers/compress/zlib/meson.build +++ b/drivers/compress/zlib/meson.build @@ -9,6 +9,5 @@ endif deps += 'bus_vdev' sources = files('zlib_pmd.c', 'zlib_pmd_ops.c') ext_deps += dep -pkgconfig_extra_libs += '-lz' allow_experimental_apis = true diff --git a/drivers/crypto/ccp/meson.build b/drivers/crypto/ccp/meson.build index e43b00591..915c4c854 100644 --- a/drivers/crypto/ccp/meson.build +++ b/drivers/crypto/ccp/meson.build @@ -18,4 +18,3 @@ sources = files('rte_ccp_pmd.c', 'ccp_pmd_ops.c') ext_deps += dep -pkgconfig_extra_libs += '-lcrypto' diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build index 77a6596d7..d56a32366 100644 --- a/drivers/crypto/openssl/meson.build +++ b/drivers/crypto/openssl/meson.build @@ -9,4 +9,3 @@ allow_experimental_apis = true deps += 'bus_vdev' sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c') ext_deps += dep -pkgconfig_extra_libs += '-lcrypto' diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build index 9cc98d2c2..21f969735 100644 --- a/drivers/crypto/qat/meson.build +++ b/drivers/crypto/qat/meson.build @@ -13,6 +13,5 @@ if dep.found() 'qat_sym.c', 'qat_sym_session.c') qat_ext_deps += dep - pkgconfig_extra_libs += '-lcrypto' qat_cflags += '-DBUILD_QAT_SYM' endif diff --git a/drivers/meson.build b/drivers/meson.build index e37d4fe2b..69d0556d3 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -46,10 +46,11 @@ foreach class:driver_classes # set up internal deps. Drivers can append/override as necessary deps = std_deps # ext_deps: Stores external library dependency got - # using dependency() or cc.find_library(). For most cases, we - # probably also need to specify the "-l" flags in - # pkgconfig_extra_libs variable too, so that it can be reflected - # in the pkgconfig output for static builds + # using dependency() (preferred) or find_library(). + # For the find_library() case (but not with dependency()) we also + # need to specify the "-l" flags in pkgconfig_extra_libs variable + # too, so that it can be reflected in the pkgconfig output for + # static builds. ext_deps = [] pkgconfig_extra_libs = [] diff --git a/drivers/net/bnx2x/meson.build b/drivers/net/bnx2x/meson.build index e3c688869..dd189ffc4 100644 --- a/drivers/net/bnx2x/meson.build +++ b/drivers/net/bnx2x/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -dep = cc.find_library('z', required: false) +dep = dependency('zlib', required: false) build = dep.found() ext_deps += dep cflags += '-DZLIB_CONST' diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 4bccd68e0..b4f9672e7 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -14,9 +14,9 @@ if pmd_dlopen ] endif libs = [ - cc.find_library('mnl', required:false), - cc.find_library('mlx4', required:false), - cc.find_library('ibverbs', required:false), + dependency('libmnl', required:false), + dependency('libmlx4', required:false), + dependency('libibverbs', required:false), ] build = true foreach lib:libs diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index 4540c455b..0cf2f0873 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -14,9 +14,9 @@ if pmd_dlopen ] endif libs = [ - cc.find_library('mnl', required:false), - cc.find_library('mlx5', required:false), - cc.find_library('ibverbs', required:false), + dependency('libmnl', required:false), + dependency('libmlx5', required:false), + dependency('libibverbs', required:false), ] build = true foreach lib:libs diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build index 0c4e0201a..89c9d7a74 100644 --- a/drivers/net/pcap/meson.build +++ b/drivers/net/pcap/meson.build @@ -1,12 +1,11 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -pcap_dep = cc.find_library('pcap', required: false) -if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) +pcap_dep = dependency('pcap', required: false) +if pcap_dep.found() build = true else build = false endif sources = files('rte_eth_pcap.c') ext_deps += pcap_dep -pkgconfig_extra_libs += '-lpcap' diff --git a/lib/librte_bpf/meson.build b/lib/librte_bpf/meson.build index bc0cd78f9..c3b1f698e 100644 --- a/lib/librte_bpf/meson.build +++ b/lib/librte_bpf/meson.build @@ -18,8 +18,8 @@ install_headers = files('bpf_def.h', deps += ['mbuf', 'net', 'ethdev'] -dep = cc.find_library('elf', required: false) -if dep.found() == true and cc.has_header('libelf.h', dependencies: dep) +dep = dependency('libelf', required: false) +if dep.found() sources += files('bpf_load_elf.c') ext_deps += dep endif diff --git a/lib/librte_telemetry/meson.build b/lib/librte_telemetry/meson.build index 9492f544e..cafb26f08 100644 --- a/lib/librte_telemetry/meson.build +++ b/lib/librte_telemetry/meson.build @@ -6,7 +6,7 @@ headers = files('rte_telemetry.h', 'rte_telemetry_internal.h', 'rte_telemetry_pa deps += ['metrics', 'ethdev'] cflags += '-DALLOW_EXPERIMENTAL_API' -jansson = cc.find_library('jansson', required: false) +jansson = dependency('jansson', required: false) if jansson.found() ext_deps += jansson dpdk_app_link_libraries += ['telemetry'] From patchwork Tue Jan 22 13:10:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49997 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E81A84C8B; Tue, 22 Jan 2019 14:12:17 +0100 (CET) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 525BE326C for ; Tue, 22 Jan 2019 14:12:09 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id a62so14083219wmh.4 for ; Tue, 22 Jan 2019 05:12:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hziV0D/BvXsblTxSacrM3LCmBdT6iCh79mtbc659TL8=; b=T+qNHf4tIOWtpwYL7N+zTxQNnbAyXrUB1OsBlOZr72T265iY10cefdNvhbtlmtkgif M0J1NxH77fmJv9/q/XImbI7i9plK/BkMaJgQV8vIdS6ueY4Ci+b72ZCDlYTEPomGEhK4 RLquSBV6FGGSDxpew+ap1Nk9B8eKJECbdjrEQOH24bsV8nozDuv4jlTESr4HLZzecYJe J7lAxQKJxV8mppWXmn0Gr38CbEqm3i95aZHDFF1Hb240IxUP0V90AxxpDLjW+p4px3rN 44EsJ1OpFPq2Oz8Gg8UD3wzJFS/plYQ8ZuVBecrUmwnCD5a5z75jcZ+xsfgDv0JWqfUv JdZw== X-Gm-Message-State: AJcUukc314ooBSR3RYDvG2tNOZt5RwRGxM9xSTuHvKDgQ0E9giViP2LM 4Z/2iV/rHDq+FEgYytbLN/na8twu X-Google-Smtp-Source: ALg8bN4KkWcosmrNb8AOq2CmZpN33u/lkH1dMhHbDZ+i6TnAUwjxs22UP+wkXW7qCUGF10l6Vf5gRw== X-Received: by 2002:a1c:9183:: with SMTP id t125mr3600573wmd.79.1548162728571; Tue, 22 Jan 2019 05:12:08 -0800 (PST) Received: from localhost ([2001:1be0:110d:fcfe:132c:a71a:1896:1395]) by smtp.gmail.com with ESMTPSA id x81sm55176379wmg.17.2019.01.22.05.12.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 05:12:07 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: Luca Boccassi , Bruce Richardson Date: Tue, 22 Jan 2019 13:10:53 +0000 Message-Id: <20190122131054.25196-3-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122131054.25196-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> <20190122131054.25196-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 3/4] build: reorder libraries and build eal before cmdline X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Most libraries and PMDs depend on eal, and eal depends only on kvargs, so reorder the list in Meson to reflect this and take advantage of this dependency chain. Signed-off-by: Luca Boccassi Acked-by: Bruce Richardson --- v3: added this patch to let the next just update librte_eal instead of also having to update rte_cmdline v4: add acked-by lib/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/meson.build b/lib/meson.build index e8b40f546..074a8b8b4 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -9,9 +9,10 @@ # given as a dep, no need to mention ring. This is especially true for the # core libs which are widely reused, so their deps are kept to a minimum. libraries = [ 'compat', # just a header, used for versioning - 'cmdline', # ethdev depends on cmdline for parsing functions 'kvargs', # eal depends on kvargs - 'eal', 'ring', 'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', # core + 'eal', # everything depends on eal + 'cmdline', # ethdev depends on cmdline for parsing functions + 'ring', 'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', # core 'metrics', # bitrate/latency stats depends on this 'hash', # efd depends on this 'timer', # eventdev depends on this From patchwork Tue Jan 22 13:10:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49998 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA3804C91; Tue, 22 Jan 2019 14:12:19 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 95E383421 for ; Tue, 22 Jan 2019 14:12:10 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id a62so14083311wmh.4 for ; Tue, 22 Jan 2019 05:12:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8uOzixkrhEJ9ZPXa3KBmNIC4zvODpqVOv1d+SZ+B96o=; b=Aie6Op/bTe53N9tPg0HWtVWzkWlpgHwGyUMG/YeT7TF9ZHUhpHFfAPj1PDGBjgbujE XBcDkXjPO5TCy+WafLMmclS+9wiJ+IVmcV09vemvXoFdqd7fNcOaFpdg+AQe6s1B5PDv 3AS4n4/79bc8Apg65JNYSPJpkh9Gq2+vGaVQvOIdYU2S2BDauhcy08GifpQWb24XzDJN ftWX4Ywh9dEvLrvJ+XLTQjSWk19z4ih56Q2bbmSha1iNE0XjDH9PmN7fh9JbYep6PujI YvcgCjIVplU20wrxUsoQDYsxBgLiJwdbbvqAJ+lL/2WpOJ7b8mdCWvVzrSlwCgUKM61I pQoQ== X-Gm-Message-State: AJcUuke6O+PRY9KJNCh21VRfdQlJcAXnZFNxupR0afFigZhrBtcRTurL NRDw7j5t9itn5mBD6YLeYkcklQ5Q X-Google-Smtp-Source: ALg8bN7nKz3TF82APj8OsqXb3zNDV+mp8ElJXEhUti5ensoTpit0DAYxMkBrKeakPW7EphCvkkEtgQ== X-Received: by 2002:a1c:8c05:: with SMTP id o5mr3568420wmd.29.1548162729964; Tue, 22 Jan 2019 05:12:09 -0800 (PST) Received: from localhost ([2001:1be0:110d:fcfe:132c:a71a:1896:1395]) by smtp.gmail.com with ESMTPSA id 127sm99810045wmm.45.2019.01.22.05.12.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 05:12:09 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: Luca Boccassi , Bruce Richardson Date: Tue, 22 Jan 2019 13:10:54 +0000 Message-Id: <20190122131054.25196-4-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122131054.25196-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> <20190122131054.25196-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 4/4] build: use dependency() for libbsd instead of manual append to ldflags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Move libbsd inclusion to librte_eal, so that all other libraries and PMDs will inherit it. Signed-off-by: Luca Boccassi Acked-by: Bruce Richardson --- v3: only add dependency to librte_eal and let it propagate from there v4: add acked-by config/meson.build | 10 +++++----- lib/librte_eal/meson.build | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/meson.build b/config/meson.build index db32499b3..e1af468ee 100644 --- a/config/meson.build +++ b/config/meson.build @@ -74,11 +74,11 @@ if numa_dep.found() and cc.has_header('numaif.h') endif # check for strlcpy -if host_machine.system() == 'linux' and cc.find_library('bsd', - required: false).found() and cc.has_header('bsd/string.h') - dpdk_conf.set('RTE_USE_LIBBSD', 1) - add_project_link_arguments('-lbsd', language: 'c') - dpdk_extra_ldflags += '-lbsd' +if host_machine.system() == 'linux' + libbsd = dependency('libbsd', required: false) + if libbsd.found() + dpdk_conf.set('RTE_USE_LIBBSD', 1) + endif endif # add -include rte_config to cflags diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index a18f3a826..fa60736c9 100644 --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build @@ -25,6 +25,9 @@ version = 9 # the version of the EAL API allow_experimental_apis = true deps += 'compat' deps += 'kvargs' +if dpdk_conf.has('RTE_USE_LIBBSD') + ext_deps += libbsd +endif sources = common_sources + env_sources objs = common_objs + env_objs headers = common_headers + env_headers