From patchwork Fri Jan 11 18:22:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49750 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 10C721BAA8; Fri, 11 Jan 2019 19:22:21 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 382441BA65 for ; Fri, 11 Jan 2019 19:22:19 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id q18so16181790wrx.9 for ; Fri, 11 Jan 2019 10:22:19 -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=2edHJHNZQ108rzMd7xaVll6agSGGd6EiFJ0kOrhwjz8=; b=AiiO4R+PcOS5akhV9fMVQ4AbXVc6U6v9rYm1wff5Fc3TnjjX2+wMC+Vk5VmrojcOpo DKPogCokFogkRC5H2kh+g7outkOJpHmBLfXfNlt3x1ktG0K8uovNsYR48p1LCKu715Q4 PeIMYO3fTZFAx4izo5X5hMY7zellCYR5+73KOqXgy5WZ03Njr+1Mtt7Z8o4BFjFokryn l5Y+KIQzsXGJQYSo1dOfFjAntGPn7vZoRpDPif0OLHgT1Qe83BDBpHqyNucy+b/3McY5 qUeHzmts6f2sT1qb/A0SKtKt5ADoiKqSy9qPu+nSyPld5W4uDqf2zEMM2MeRqFNo0VPT gqVg== X-Gm-Message-State: AJcUukcta3PCABnsb62YtdbWbtXv6cfiEVxE/nE/wfd5ayPD47e9yem8 mlq7fRtQ+wsTzenAjNHaCeUsKPD8EfA= X-Google-Smtp-Source: ALg8bN7BDZau0KO1wlmqmqWIwaNJPTX8fJHin280J1Q/fa4kZRdcTXE59purVlgWx84cbij+nqv4eg== X-Received: by 2002:adf:be0f:: with SMTP id n15mr15061625wrh.267.1547230938513; Fri, 11 Jan 2019 10:22:18 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id m4sm16514314wml.2.2019.01.11.10.22.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 10:22:16 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, Luca Boccassi Date: Fri, 11 Jan 2019 18:22:01 +0000 Message-Id: <20190111182204.26031-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 v4 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 d500507c5..d0534dc0d 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('DPDK', 'C', version: '19.02.0-rc1', 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 Fri Jan 11 18:22:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49751 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 482FA1BAD7; Fri, 11 Jan 2019 19:22:24 +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 DB97E1BA65 for ; Fri, 11 Jan 2019 19:22:20 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id y8so3263710wmi.4 for ; Fri, 11 Jan 2019 10:22:20 -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=dN+RrXlfpv2WODhqGHIXGA074hBJyRsncXhW2po5ecc=; b=GuKncSDf35zxBFHkoPcKD6lvdn5VOrEKV1Sqb2pHw3k1TAo+MWs8cd1tv3wGqxUr8/ mUJ5sVdCBTNAoEzkE1A7ba2LpyJ2yWY1WnVe8QjNiBzGxp634S+X6tJ+iXHqUvbpcy3M 15FR347U/MYEgL9hwkU7VAeN6UpvC2x8pF1xs4lCHFZLkNFUmnOm+BNNc7qeVW7JVLX0 N2S9IXW/rPMxTiaaLSuZ6IHlJGt2rLzzwyTHlVEiUK1Du7FpJaACQh1/+XjRiuJDSuh6 90P1hMZeKN7HjhBPCG4IcmFmUxscGCd6lg7lgBGa+N0KSADi9qiciVZATMoC49BKgnns NySQ== X-Gm-Message-State: AJcUukfy7sB7x9neoZ0lbtYXh/bZ//lywIIO64fJZJ1OB6B019PJ5A4L D73xNzUqnD0xGHAj5f7tTmTN8vlXfOs= X-Google-Smtp-Source: ALg8bN6SU0yOBS8V1yfNBbsAUrRXA7M6xEhQ7EAn2Gd39VwCpk4PM77Hvv5jKEFsINQ11gDejCezPQ== X-Received: by 2002:a1c:f613:: with SMTP id w19mr3296901wmc.0.1547230940102; Fri, 11 Jan 2019 10:22:20 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id g129sm20115708wmf.39.2019.01.11.10.22.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 10:22:19 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, Luca Boccassi Date: Fri, 11 Jan 2019 18:22:02 +0000 Message-Id: <20190111182204.26031-2-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111182204.26031-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> <20190111182204.26031-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 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 --- 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 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 +- 10 files changed, 17 insertions(+), 20 deletions(-) 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 c2a0dd8ba..80e5e8835 100644 --- a/drivers/crypto/openssl/meson.build +++ b/drivers/crypto/openssl/meson.build @@ -8,4 +8,3 @@ endif 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 7de571e2a..4ba4e93b6 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 8ba19e818..161c5641f 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 Fri Jan 11 18:22:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49752 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 D3A311BB09; Fri, 11 Jan 2019 19:22:25 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 5E07B1BACA for ; Fri, 11 Jan 2019 19:22:22 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id u4so16226619wrp.3 for ; Fri, 11 Jan 2019 10:22:22 -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=k1iblhd1Nv2uY5tf++ZJNlg/Uu+FUO6RnuLHC7wbtRM=; b=fYtN72YFRHaRkwiSm/gL+2uggLFkLarchYSItP+omgf4CjY3bLFDJPLx2d1JYfQX8B k0CwgrCbvcqFdmFTJ+8bP6u+dj5PopnXQ7u58cqCgWYkkHkiThhIs22PtM8rXzQBouZ8 Nl2mNczEFVhKhfmTwnbaW3mTMF2snYS9nrJOFwAwY3UHGQ2VlQTWRGtXLpZPRWkt+xNB GvFCxAsUl1OWwZClMrrMEuvwdOGQMpZsiDiPie7n0ioKkpjG7/B2nh6uLgypLLqsNOuv tjpdN14s9lNQ6wtumXzX+iedfy/dumINNsTValOCrRGM5ibCduh3acfQ2y3/aFsJgfOC YQ4w== X-Gm-Message-State: AJcUukfuMV9RUaufWM1wR2EJ4br8qKvPbTdUHiYoT33dkCTTvBqbjrfh hByzRZKriklLBKNybjHhl5qKY+Lue90= X-Google-Smtp-Source: ALg8bN6uij7qBoDe9IKIn6mrN18T3dcU6KN3dRJRdWTGm+HqZNpvLH73vdnve0pREXfjRwQDJzHO6g== X-Received: by 2002:a5d:6aca:: with SMTP id u10mr14144026wrw.310.1547230941654; Fri, 11 Jan 2019 10:22:21 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id t63sm17201546wmt.8.2019.01.11.10.22.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 10:22:21 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, Luca Boccassi Date: Fri, 11 Jan 2019 18:22:03 +0000 Message-Id: <20190111182204.26031-3-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111182204.26031-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> <20190111182204.26031-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 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 a2dd52e17..bf8417c6d 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 Fri Jan 11 18:22:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 49753 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 A67031BACB; Fri, 11 Jan 2019 19:22:28 +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 941931BA9F for ; Fri, 11 Jan 2019 19:22:23 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id b11so3307034wmj.1 for ; Fri, 11 Jan 2019 10:22:23 -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=YPJNVqmQ1+59+JQdZ6592aC/Lh3F9VX3AFILjiBMSfNhqwNPdXpwTz9UwB826r98sD zoxMScjJFiDAN2JI97phOLOM7dRwluFVghw2lCqqZNz+mOXDOcH0jIyL0uc+q2nO5HSZ IwtvaQQjyfVs3yM/JH256eM1s0EYD66aAdQ4poDXEnOyQlHBcsRr2NiL94gOMfqM8/5M q0/k5Bq7g4n6NaDrGlsZUeZjot6BYopFY40QYpU4o3EPFa22DV8R6qO2Ftcg8gGbfx8N wftkY5afKUMZDVy2A0hseYtOVt9c7/Le23AQqQjStHWXnfy8uVT4vVTVmv4I3Ew8CfQT 3pmA== X-Gm-Message-State: AJcUukfsvrfq1BF9r78QXUMCqXrjfdtNNZE8HI9MFvJXJeaja2wA4QQG PRtw9CqE5Hqi2otv1Y6LBKXBjvh0zg4= X-Google-Smtp-Source: ALg8bN4X3tNFjM7dizm8+VDy/KG841S2PniJ0OqPAtWT1lGuVwy1EZQWeLUUD5CBdVlMn8btZ02sYQ== X-Received: by 2002:a1c:60c3:: with SMTP id u186mr3508979wmb.66.1547230943029; Fri, 11 Jan 2019 10:22:23 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id t4sm30717815wrb.64.2019.01.11.10.22.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 10:22:22 -0800 (PST) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, Luca Boccassi Date: Fri, 11 Jan 2019 18:22:04 +0000 Message-Id: <20190111182204.26031-4-bluca@debian.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111182204.26031-1-bluca@debian.org> References: <20190103175725.5836-1-bluca@debian.org> <20190111182204.26031-1-bluca@debian.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 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