From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79354A0554; Tue, 18 Feb 2020 01:03:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 195461DA9C; Tue, 18 Feb 2020 01:02:44 +0100 (CET) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by dpdk.org (Postfix) with ESMTP id E43BD1DA83 for ; Tue, 18 Feb 2020 01:02:39 +0100 (CET) Received: by mail-lj1-f169.google.com with SMTP id q8so20790080ljb.2 for ; Mon, 17 Feb 2020 16:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fE5dG7DvNoE4hGY1vfrgNPPk2vGup7bGT8Koksfo3uk=; b=BeQGA2zOIY6auTeEIcWHLo/XFXLvd+G6k+NpOgoRTbK62tyQvbR8S0akkkfQ35AIcM AtmzgrqGOd37Hktl9+rWlhaaGY1es8EA0rHQhW5HCRE2vlFmI/Zs0aZcMMhi0LnELaXp dTyWNBKvmnIv5zm2OMN55We4kl8bFx7q5TgdlQ/PxBA6Qm4sv4zFENW12gejs2Ys6u9l ySwYYSkPfO3esVT2kYIxXUHxlEJizPBx2DOfZS/fcOxz2Oios3y2XTR9+AyNC0UctfSy 8l1bYo/iMXOt91d4wTyGP6Dxo+f4sqdvTA4w7TKPIIzgJ7e6MWID9TAG9QwR6tEcpg9j ZsZg== 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=fE5dG7DvNoE4hGY1vfrgNPPk2vGup7bGT8Koksfo3uk=; b=YFRfSDdhkWyvbV2NsPpVg0gTymIKQU8HI8crTOc2b/rUI+8AuXRaLeT9OYm74cAako Kur0gxgDYP69hn/cFjAV56A1J9N9f5Lpzs6nP0u7soPpgwDshhNIBrHyBmVZlwwSEJIa scD7MIWy9EpkjIKFOi8sbTy9mpcbBuvS1Fyb0CCV6oHJYJf8MHQKmeQHkKkmQ5rh/Z9u 4wnd9YzXtbFJ09tQxFiPbPrMBAx+1L4nLRf5fKaXb8YOODOuKWc+MHQbiuxUGMjWeJr5 6u0Qvw4N+o63466UdtzcTwDZ3jGIro5NDJxpMTaU+rmFDa9DmIvYVZK3LuRt4RYr9F1f OLYw== X-Gm-Message-State: APjAAAVMDAPyrAY0iVQFSmtMYdoIEeEcInRubrtAxgIy+t5LyYda/Km7 +MKqGcmkvDbU8V6RNKHaVulAMzeE8PA= X-Google-Smtp-Source: APXvYqz8npKYFXch8jhgj6SRWE5538wHM+NQ0saqkkXwvTLkHkTn8CCsl0tLkBbvKWeXW3ZPlt682Q== X-Received: by 2002:a2e:814e:: with SMTP id t14mr11357169ljg.149.1581984159261; Mon, 17 Feb 2020 16:02:39 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.googlemail.com with ESMTPSA id r20sm1068864lfi.91.2020.02.17.16.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 16:02:38 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , Harini Ramakrishnan , Omar Cardona , Pallavi Kadam , Ranjit Menon Date: Tue, 18 Feb 2020 03:02:25 +0300 Message-Id: <20200218000229.86621-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> References: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 3/7] eal/windows: support builing with MinGW-w64 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" Disable bundled getopt implementation and GNU extensions shim when building in GNU environment. Signed-off-by: Dmitry Kozlyuk --- lib/librte_eal/meson.build | 3 +++ lib/librte_eal/windows/eal/eal.c | 6 ++++-- lib/librte_eal/windows/eal/include/getopt.h | 4 ++++ lib/librte_eal/windows/eal/include/rte_os.h | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index 4be5118ce..1730d603f 100644 --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build @@ -20,6 +20,9 @@ endif if cc.has_function('getentropy', prefix : '#include ') cflags += '-DRTE_LIBEAL_USE_GETENTROPY' endif +if cc.has_header('getopt.h') + cflags += ['-DHAVE_GETOPT_H', '-DHAVE_GETOPT', '-DHAVE_GETOPT_LONG'] +endif sources = common_sources + env_sources objs = common_objs + env_objs headers = common_headers + env_headers diff --git a/lib/librte_eal/windows/eal/eal.c b/lib/librte_eal/windows/eal/eal.c index 34852d42c..e4b50df3b 100644 --- a/lib/librte_eal/windows/eal/eal.c +++ b/lib/librte_eal/windows/eal/eal.c @@ -2,9 +2,11 @@ * Copyright(c) 2019 Intel Corporation */ -#include -#include #include +#include +#include +#include + #include #include #include diff --git a/lib/librte_eal/windows/eal/include/getopt.h b/lib/librte_eal/windows/eal/include/getopt.h index 2eebe54e3..6f57af454 100644 --- a/lib/librte_eal/windows/eal/include/getopt.h +++ b/lib/librte_eal/windows/eal/include/getopt.h @@ -26,7 +26,11 @@ #ifndef NEED_USUAL_GETOPT /* Use system getopt */ +#ifdef RTE_TOOLCHAIN_GCC +#include_next +#else #include +#endif #else /* NEED_USUAL_GETOPT */ diff --git a/lib/librte_eal/windows/eal/include/rte_os.h b/lib/librte_eal/windows/eal/include/rte_os.h index c351f2c84..4b9117dc0 100644 --- a/lib/librte_eal/windows/eal/include/rte_os.h +++ b/lib/librte_eal/windows/eal/include/rte_os.h @@ -57,6 +57,7 @@ int eal_thread_create(pthread_t *thread); */ void eal_create_cpu_map(void); +#ifndef RTE_TOOLCHAIN_GCC static inline int asprintf(char **buffer, const char *format, ...) { @@ -80,6 +81,7 @@ asprintf(char **buffer, const char *format, ...) } return ret; } +#endif /* RTE_TOOLCHAIN_GCC */ /* cpu_set macros implementation */ #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) -- 2.25.0