From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05951A0C61; Fri, 5 Nov 2021 01:01:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8094540151; Fri, 5 Nov 2021 01:01:30 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id C4BF74014D for ; Fri, 5 Nov 2021 01:01:28 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id f8so9912820plo.12 for ; Thu, 04 Nov 2021 17:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FZhN79UmCEqv/jPFdYllNlaHJzCvT4skm2odP9SwH3w=; b=PSPTzLgVKDjheygizb+rMkBh+IaUSTAe30nk18kf1wmWj8Vax5oV/NYq+tooIdV/Jp +OJvIPGyCwSPRzc51nvQcZiUGjK/N223TchItX5EaakT6a9paBhKKUjyLIofMn0MNWjK VvVyYOIE4lHoIpCDpHpMjh6cexQO8xOAvzcN6VId49jKtJGGQkRKFoeq3GcHks1xyc+p Sj6Iu9gW6EUcl9AFjS0Z+4H/ND4tk+XW84gj1QOzcfaD8F7m9KgDblMf5rTfQG4iUFfN TBQMiP3EtRQvRUyV9H8mgvAE6A9/uFQ7dqo4bsj73Qloi6WiSGdoLJsYoVNjT+h7xsiY r8Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FZhN79UmCEqv/jPFdYllNlaHJzCvT4skm2odP9SwH3w=; b=3bY6Ptnv2Oz7FQF1N+b9nvKHyxHwnikycRO/KaNqk9hLZSXFhrUun4dgi6tw3U+J1z dHIR/PlvS2BHShwYsSvzFkcqoOddtA1MrQd3k7/ifEkt2c5hRgg3j3xT04oPHhSndVaO J+yAuKfz9IH+nTBeO49LCCDLntn7YgE8eHxfgxLn7Yydw12XuqXZvaiXhcxAR1P0Euu2 WlD9CvKFxg7LuBRL1oLlNogEOzh3J+oMRmfjA4hqU5Sf36RdeTF48eextIjQQba8Ufoa +PCnvxyyehxxomsf+yBRyvVxAfsGUGBZlmkUNl9/qcNxKzhGTDFdX3iOL17hxYok33kv NkQg== X-Gm-Message-State: AOAM530LSaBcVKYA+r2C4Ra3G5iYwIoHMxsOIRndBm3We/+k1pIJIqE0 Al+G2qKXk3QZjhcK51StCp2nBLHmEDwSWQ== X-Google-Smtp-Source: ABdhPJzu6NeuezsGfeChUsG+lipkZbgD1pxCp7KOSNgDZ03k6IESUn+wx+wCvStSyj89Y64adpMPaQ== X-Received: by 2002:a17:903:32c5:b0:141:eb39:30b7 with SMTP id i5-20020a17090332c500b00141eb3930b7mr28318950plr.41.1636070487711; Thu, 04 Nov 2021 17:01:27 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id z8sm4943675pgi.45.2021.11.04.17.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 17:01:27 -0700 (PDT) From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, Stephen Hemminger Date: Thu, 4 Nov 2021 17:01:24 -0700 Message-Id: <20211105000124.155788-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211103221205.63175-1-stephen@networkplumber.org> References: <20211103221205.63175-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] build: allow build DPDK as a meson submodule X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Some other projects using meson may not be able to use DPDK using the standard distribution pkg-config mechanism. Meson supports a way to handle this via the subproject https://mesonbuild.com/Subprojects.html This patch adds the necessary dependency to follow the "Naming convention for dependency variables" from the documentation. Signed-off-by: Stephen Hemminger --- Cleaned up from RFC and support both static and shared. lib/meson.build | 5 +++++ meson.build | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/meson.build b/lib/meson.build index 499d26060fdd..e6df538bd6ef 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -241,6 +241,11 @@ foreach l:libraries dpdk_libraries = [shared_lib] + dpdk_libraries dpdk_static_libraries = [static_lib] + dpdk_static_libraries + if get_option('default_library') == 'static' + dpdk_libs_deps += static_dep + else + dpdk_libs_deps += shared_dep + endif set_variable('shared_rte_' + name, shared_dep) set_variable('static_rte_' + name, static_dep) diff --git a/meson.build b/meson.build index 12cb6e0e83f3..032783e4e6cf 100644 --- a/meson.build +++ b/meson.build @@ -36,6 +36,7 @@ dpdk_drivers = [] dpdk_extra_ldflags = [] dpdk_libs_disabled = [] dpdk_drvs_disabled = [] +dpdk_libs_deps = [] abi_version_file = files('ABI_VERSION') if host_machine.cpu_family().startswith('x86') @@ -97,6 +98,17 @@ configure_file(output: build_cfg, # build pkg-config files for dpdk subdir('buildtools/pkg-config') +# If DPDK is being built as subproject then define +# variable with the dependency convention +if meson.is_subproject() + libdpdk_dep = declare_dependency( + version: meson.project_version(), + compile_args : pkg_extra_cflags, + dependencies: dpdk_libs_deps, + link_args: dpdk_extra_ldflags, + ) +endif + # final output, list all the libs and drivers to be built # this does not affect any part of the build, for information only. output_message = '\n=================\nLibraries Enabled\n=================\n' -- 2.30.2