From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id E8D185323 for ; Tue, 9 Apr 2019 12:57:27 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id 4so2952579wmf.1 for ; Tue, 09 Apr 2019 03:57:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=TVspl1nQG5bEcyirAqRSZynU+KK71GvfLUCSKK92R5Y=; b=C8q8g2sgll58LJ9uLs5XTwfWFpRXWvZzBcTgm0zQ0uj8TUHGJ8XO/+OW07Cgf17/0i bDKLYRpgGqj95UtaYXbYoa3RI661THfTn8jCvSKGkyGjKNlp1+E83zYOl8NYuWHW5fkG tGUF9lgNRFf4ZUw6oNlSzJNz8Yci3y63x1DGVCJvuOvGIRSa13vQaJCgYeJ5mPoOlL7y E+EBpFZhIaEKGaK8S/kSEUQIaUtD+kCdUTWCyGmC51FjM+QRZTCirxcyME6r6Py7KcqA fhf8h0+19l8iR25QKRTbPr8aZzIli/YvQdSPyfuzrGh1m+5opJ49xsGnhdeyYC2aDcgy Jd8Q== X-Gm-Message-State: APjAAAVtpW4GKnTe5tn8UhRmKxoelLxOIfYAnt1EOh2uw9WjR2L6vbIo 2g4ZdKOmSdct0oWKvllLzmLybar9 X-Google-Smtp-Source: APXvYqzSX3nRGkO7w+M1UFLfUq0obF2LfzL+K+IriaAGmdNH4LUkPBRsMK61ZzpFwd7+j1IKM00pqw== X-Received: by 2002:a1c:c186:: with SMTP id r128mr2405858wmf.100.1554807447566; Tue, 09 Apr 2019 03:57:27 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:250:b6ff:feb7:bd60]) by smtp.gmail.com with ESMTPSA id x192sm19511178wmf.48.2019.04.09.03.57.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 03:57:26 -0700 (PDT) Message-ID: <58965a7eedc966683a08886b2944ac9c59808f61.camel@debian.org> From: Luca Boccassi To: Bruce Richardson Cc: dev@dpdk.org Date: Tue, 09 Apr 2019 11:57:26 +0100 In-Reply-To: <20190409104359.GB671@bricha3-MOBL.ger.corp.intel.com> References: <20190409092933.55356-1-bruce.richardson@intel.com> <20190409092933.55356-2-bruce.richardson@intel.com> <15d9832ccfced85eeecb321f811df578a8dadf1c.camel@debian.org> <20190409104359.GB671@bricha3-MOBL.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.30.5-1 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL 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: , X-List-Received-Date: Tue, 09 Apr 2019 10:57:28 -0000 On Tue, 2019-04-09 at 11:44 +0100, Bruce Richardson wrote: > On Tue, Apr 09, 2019 at 11:34:24AM +0100, Luca Boccassi wrote: > > On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote: > > > Within EAL we had a series of if statements for selecting the EAL > > > directory to use. Now that the directory names match those of the > > > OS's > > > they are for we can instead just use a generated subdirectory > > > name, > > > shortening the code. To avoid strange errors, we still need to > > > check > > > for unsupported OS's, but do this check up-front in the config > > > meson.build file. > > >=20 > > > Signed-off-by: Bruce Richardson <=20 > > > bruce.richardson@intel.com > > >=20 > > >=20 > > > --- config/meson.build | 7 +++++++ > > > lib/librte_eal/meson.build > > > > 17 ++--------------- 2 files changed, 9 insertions(+), 15 > > >=20 > > > deletions(-) > > >=20 > > > diff --git a/config/meson.build b/config/meson.build index > > > 483139b10..ce6af2595 100644 --- a/config/meson.build +++ > > > b/config/meson.build @@ -1,6 +1,13 @@ # SPDX-License-Identifier: > > > BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation > > > =20 > > > +# check the OS is supported, rather than going any further > > > +supported_exec_envs =3D ['freebsd', 'linux', 'windows'] +exec_env > > > =3D > > > host_machine.system() +if not > > > supported_exec_envs.contains(exec_env) + > > > error('unsupported system type "@0@"'.format(exec_env)) +endif + > > > # set > > > the major version, which might be used by drivers and libraries # > > > depending on the configuration options pver =3D > > > meson.project_version().split('.') diff --git > > > a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index > > > 1863622c0..fa36b20e0 100644 --- a/lib/librte_eal/meson.build +++ > > > b/lib/librte_eal/meson.build @@ -9,21 +9,8 @@ subdir('common') # > > > defines common_sources, common_objs, etc. > > > =20 > > > # Now do OS/exec-env specific settings, including building > > > kernel > > > modules # The /eal/meson.build file should define > > > env_sources, etc. -if host_machine.system() =3D=3D 'linux' - > > > dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1) - subdir('linux/eal') - > > > -elif > > > host_machine.system() =3D=3D 'freebsd' - > > > dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) - subdir('freebsd > > > /eal') - > > > -elif host_machine.system() =3D=3D 'windows' - > > > dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) - subdir('windows > > > /eal') - > > > -else - error('unsupported system type > > > "@0@"'.format(host_machine.system())) -endif > > > +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1) > > > +subdir(exec_env + '/eal') > >=20 > > Shouldn't this use join_paths() for cross-platform compat? Or does > > foo/bar work fine these days in Windows? > >=20 >=20 > It should work fine on Windows. We have plenty of other places where > we use > "/" for separation, e.g. the subdir() function in EAL >=20 > /Bruce Ah, good to know! --=20 Kind regards, Luca Boccassi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 54A17A0096 for ; Tue, 9 Apr 2019 12:57:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA5954F9B; Tue, 9 Apr 2019 12:57:28 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id E8D185323 for ; Tue, 9 Apr 2019 12:57:27 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id 4so2952579wmf.1 for ; Tue, 09 Apr 2019 03:57:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=TVspl1nQG5bEcyirAqRSZynU+KK71GvfLUCSKK92R5Y=; b=C8q8g2sgll58LJ9uLs5XTwfWFpRXWvZzBcTgm0zQ0uj8TUHGJ8XO/+OW07Cgf17/0i bDKLYRpgGqj95UtaYXbYoa3RI661THfTn8jCvSKGkyGjKNlp1+E83zYOl8NYuWHW5fkG tGUF9lgNRFf4ZUw6oNlSzJNz8Yci3y63x1DGVCJvuOvGIRSa13vQaJCgYeJ5mPoOlL7y E+EBpFZhIaEKGaK8S/kSEUQIaUtD+kCdUTWCyGmC51FjM+QRZTCirxcyME6r6Py7KcqA fhf8h0+19l8iR25QKRTbPr8aZzIli/YvQdSPyfuzrGh1m+5opJ49xsGnhdeyYC2aDcgy Jd8Q== X-Gm-Message-State: APjAAAVtpW4GKnTe5tn8UhRmKxoelLxOIfYAnt1EOh2uw9WjR2L6vbIo 2g4ZdKOmSdct0oWKvllLzmLybar9 X-Google-Smtp-Source: APXvYqzSX3nRGkO7w+M1UFLfUq0obF2LfzL+K+IriaAGmdNH4LUkPBRsMK61ZzpFwd7+j1IKM00pqw== X-Received: by 2002:a1c:c186:: with SMTP id r128mr2405858wmf.100.1554807447566; Tue, 09 Apr 2019 03:57:27 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:250:b6ff:feb7:bd60]) by smtp.gmail.com with ESMTPSA id x192sm19511178wmf.48.2019.04.09.03.57.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 03:57:26 -0700 (PDT) Message-ID: <58965a7eedc966683a08886b2944ac9c59808f61.camel@debian.org> From: Luca Boccassi To: Bruce Richardson Cc: dev@dpdk.org Date: Tue, 09 Apr 2019 11:57:26 +0100 In-Reply-To: <20190409104359.GB671@bricha3-MOBL.ger.corp.intel.com> References: <20190409092933.55356-1-bruce.richardson@intel.com> <20190409092933.55356-2-bruce.richardson@intel.com> <15d9832ccfced85eeecb321f811df578a8dadf1c.camel@debian.org> <20190409104359.GB671@bricha3-MOBL.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.30.5-1 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL 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" Message-ID: <20190409105726.VQUHWYMHpdc26MVDECYHGuwcPM4ZhR4sGjAojrPsYa8@z> On Tue, 2019-04-09 at 11:44 +0100, Bruce Richardson wrote: > On Tue, Apr 09, 2019 at 11:34:24AM +0100, Luca Boccassi wrote: > > On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote: > > > Within EAL we had a series of if statements for selecting the EAL > > > directory to use. Now that the directory names match those of the > > > OS's > > > they are for we can instead just use a generated subdirectory > > > name, > > > shortening the code. To avoid strange errors, we still need to > > > check > > > for unsupported OS's, but do this check up-front in the config > > > meson.build file. > > >=20 > > > Signed-off-by: Bruce Richardson <=20 > > > bruce.richardson@intel.com > > >=20 > > >=20 > > > --- config/meson.build | 7 +++++++ > > > lib/librte_eal/meson.build > > > > 17 ++--------------- 2 files changed, 9 insertions(+), 15 > > >=20 > > > deletions(-) > > >=20 > > > diff --git a/config/meson.build b/config/meson.build index > > > 483139b10..ce6af2595 100644 --- a/config/meson.build +++ > > > b/config/meson.build @@ -1,6 +1,13 @@ # SPDX-License-Identifier: > > > BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation > > > =20 > > > +# check the OS is supported, rather than going any further > > > +supported_exec_envs =3D ['freebsd', 'linux', 'windows'] +exec_env > > > =3D > > > host_machine.system() +if not > > > supported_exec_envs.contains(exec_env) + > > > error('unsupported system type "@0@"'.format(exec_env)) +endif + > > > # set > > > the major version, which might be used by drivers and libraries # > > > depending on the configuration options pver =3D > > > meson.project_version().split('.') diff --git > > > a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index > > > 1863622c0..fa36b20e0 100644 --- a/lib/librte_eal/meson.build +++ > > > b/lib/librte_eal/meson.build @@ -9,21 +9,8 @@ subdir('common') # > > > defines common_sources, common_objs, etc. > > > =20 > > > # Now do OS/exec-env specific settings, including building > > > kernel > > > modules # The /eal/meson.build file should define > > > env_sources, etc. -if host_machine.system() =3D=3D 'linux' - > > > dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1) - subdir('linux/eal') - > > > -elif > > > host_machine.system() =3D=3D 'freebsd' - > > > dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) - subdir('freebsd > > > /eal') - > > > -elif host_machine.system() =3D=3D 'windows' - > > > dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) - subdir('windows > > > /eal') - > > > -else - error('unsupported system type > > > "@0@"'.format(host_machine.system())) -endif > > > +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1) > > > +subdir(exec_env + '/eal') > >=20 > > Shouldn't this use join_paths() for cross-platform compat? Or does > > foo/bar work fine these days in Windows? > >=20 >=20 > It should work fine on Windows. We have plenty of other places where > we use > "/" for separation, e.g. the subdir() function in EAL >=20 > /Bruce Ah, good to know! --=20 Kind regards, Luca Boccassi