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 97ACBA0542; Mon, 29 Aug 2022 17:19:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F62F42847; Mon, 29 Aug 2022 17:19:21 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id AEE064069F for ; Mon, 29 Aug 2022 17:19:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661786357; x=1693322357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uxIyNVy6lkiqWO1/YCZwMgbj+x0V9lYKyXY8RkRj2TM=; b=fJ7TdI7m3BTGZ+IRZqa6K40hAXByDzNyQO35VABOD0zwzyOASn2OT59J RIcXUkncHCW+VukZUGQzFNMOAGRCBJ/5jky2PUwjunBXN4i2DffKjjFJl 6jENDUgQadp9mXo6Yc9q4PBpS9AiHZjY0uiGhXxaKWPJMVfhFW52c7cN6 vvaF1AZqNNCZ8sVc0u/LEXiPRofSdQm3I6REMEJ6p9mYbFKf+aUjNZzHw Lgb0t+GfXT5wLcCS9wQT3qDw6G2NrVJk3RSNd+P9DoDvKcWWEZMKOoLuK yBDdbYmt+QtgpUgTOgsqGADiOB36vzQalAeErWMQ+h0+IFORP1bs80FhR A==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="296196037" X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="296196037" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 08:19:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="588198078" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com) ([10.237.222.145]) by orsmga006.jf.intel.com with ESMTP; 29 Aug 2022 08:19:08 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL Date: Mon, 29 Aug 2022 16:18:59 +0100 Message-Id: <20220829151901.376754-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220829151901.376754-1-bruce.richardson@intel.com> References: <20220829151901.376754-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Some library functionality we may want ahead of EAL build depends upon some OS-specific functionality, so we create a new lib for that to be built separately. For now, just includes fnmatch function for windows. Signed-off-by: Bruce Richardson --- lib/eal/windows/meson.build | 1 - lib/meson.build | 11 ++++++----- lib/os/freebsd/fnmatch.c | 3 +++ lib/os/linux/fnmatch.c | 3 +++ lib/os/meson.build | 8 ++++++++ lib/os/os.c | 3 +++ lib/os/version.map | 7 +++++++ lib/{eal => os}/windows/fnmatch.c | 0 lib/{eal/windows/include => os/windows}/fnmatch.h | 0 9 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 lib/os/freebsd/fnmatch.c create mode 100644 lib/os/linux/fnmatch.c create mode 100644 lib/os/meson.build create mode 100644 lib/os/os.c create mode 100644 lib/os/version.map rename lib/{eal => os}/windows/fnmatch.c (100%) rename lib/{eal/windows/include => os/windows}/fnmatch.h (100%) diff --git a/lib/eal/windows/meson.build b/lib/eal/windows/meson.build index 845e406ca1..e4b2427610 100644 --- a/lib/eal/windows/meson.build +++ b/lib/eal/windows/meson.build @@ -18,7 +18,6 @@ sources += files( 'eal_mp.c', 'eal_thread.c', 'eal_timer.c', - 'fnmatch.c', 'getopt.c', 'rte_thread.c', ) diff --git a/lib/meson.build b/lib/meson.build index c648f7d800..7b61b2a5d7 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -9,6 +9,7 @@ # 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 = [ + 'os', # load os compatibility material 'kvargs', # eal depends on kvargs 'telemetry', # basic info querying 'eal', # everything depends on eal @@ -106,6 +107,7 @@ if cc.has_argument('-Wno-format-truncation') endif enabled_libs = [] # used to print summary at the end +default_deps = [] foreach l:libraries build = true @@ -124,11 +126,7 @@ foreach l:libraries # use "deps" for internal DPDK dependencies, and "ext_deps" for # external package/library requirements ext_deps = [] - deps = [] - # eal is standard dependency once built - if dpdk_conf.has('RTE_LIB_EAL') - deps += ['eal'] - endif + deps = default_deps if disabled_libs.contains(l) build = false @@ -271,4 +269,7 @@ foreach l:libraries if developer_mode message('lib/@0@: Defining dependency "@1@"'.format(l, name)) endif + if name == 'os' or name == 'eal' + default_deps = [name] + endif endforeach diff --git a/lib/os/freebsd/fnmatch.c b/lib/os/freebsd/fnmatch.c new file mode 100644 index 0000000000..ca8a050fda --- /dev/null +++ b/lib/os/freebsd/fnmatch.c @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2022 Intel Corporation + */ diff --git a/lib/os/linux/fnmatch.c b/lib/os/linux/fnmatch.c new file mode 100644 index 0000000000..ca8a050fda --- /dev/null +++ b/lib/os/linux/fnmatch.c @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2022 Intel Corporation + */ diff --git a/lib/os/meson.build b/lib/os/meson.build new file mode 100644 index 0000000000..53949ca17e --- /dev/null +++ b/lib/os/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 Intel Corporation + +includes += global_inc +includes += include_directories(exec_env) +sources += files( + exec_env / 'fnmatch.c', +) diff --git a/lib/os/os.c b/lib/os/os.c new file mode 100644 index 0000000000..ca8a050fda --- /dev/null +++ b/lib/os/os.c @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2022 Intel Corporation + */ diff --git a/lib/os/version.map b/lib/os/version.map new file mode 100644 index 0000000000..e1dbd6051e --- /dev/null +++ b/lib/os/version.map @@ -0,0 +1,7 @@ +DPDK_22 { + global: + + fnmatch; + + local: *; +}; diff --git a/lib/eal/windows/fnmatch.c b/lib/os/windows/fnmatch.c similarity index 100% rename from lib/eal/windows/fnmatch.c rename to lib/os/windows/fnmatch.c diff --git a/lib/eal/windows/include/fnmatch.h b/lib/os/windows/fnmatch.h similarity index 100% rename from lib/eal/windows/include/fnmatch.h rename to lib/os/windows/fnmatch.h -- 2.34.1