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 C3318A055A; Thu, 27 Feb 2020 05:26:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E65B41BFE3; Thu, 27 Feb 2020 05:25:56 +0100 (CET) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by dpdk.org (Postfix) with ESMTP id 6004C1BFCE for ; Thu, 27 Feb 2020 05:25:52 +0100 (CET) Received: by mail-lj1-f173.google.com with SMTP id w1so1735597ljh.5 for ; Wed, 26 Feb 2020 20:25:52 -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=YCncJPpdWauGQHZNRnP6rzv3Jk6/0Oc5J2HhSRu9zds=; b=SId1KconwfVXHk96vYHIgyC/hRiU9o5Mgtl+B8QxrAkPtVeO/M5MfXOUwCXxLbXRaT GsHnW68Zg2gQk36uk3sdEURLaWdOYG0kCKhhH9WF3y8uamXTKbxXONZ/KuguOzOUmav8 kidKBg+h8jbgLd613oHa9jzLmYJcO9m/vepOH/R1+j5bUktcpOnTpHxKiGAKPWVyBTYn EMs1fOvg0ViIYOyQ4vMF/3dr1n+x4PNl90+AiWv1IZQedzwK7wJaybTlPbIfMM+iaxkV o2wQV1EauzgyyG3xwLpnsx50k143P1wN70qg1tPxwpNfdHP4/vh4GoOcPVawgIhghNX1 RKkQ== 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=YCncJPpdWauGQHZNRnP6rzv3Jk6/0Oc5J2HhSRu9zds=; b=cllZrrlGZhvS9jPaZCj4kTDeXzoeZppDvaAUiDRRgvIfbP+fgt5eFsKJaDfPeT/FPY zGPxDmJylea5pUsujs8AThTkbu1McCxhYme7yzhvRdQfrgyVPX4YoVPivEBxwqjDXms1 lc4xAHWd+9Qqvn0hBWlf4ZHP7Q5tY8/ws4A6p6SodSqTMe/PlZ7MMEeXStjN8Lh2uaZe zFNSd3zm6FG+H4wc+bEkrpFB2Yf/bZhghfFfa80gnyxORZ2E3W/WOvlCLbItO30z1HfU VGvQ8F+ee+m5u5igljlyjZmVApUJaAJ0PaQ0vDEJM1iDZFnBJB1djeSVSPkYQ/Au4KLk 7aBw== X-Gm-Message-State: ANhLgQ0DGDOJ0AoTx+I2AHf447y9OrZcVqs2kk1WY58aW2pdOfpmOgDG cyl9th5beCmyEUuBl5mykYToXmTi2qo= X-Google-Smtp-Source: ADFU+vsL/tVGQrvMia50YfZVkQ9hciiadn6U0qJ0dddhFrqTc4byAzMBSEsjKCI9nvLyU/JfGcdKLg== X-Received: by 2002:a2e:b78e:: with SMTP id n14mr1429754ljo.269.1582777551643; Wed, 26 Feb 2020 20:25:51 -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 g21sm2224350ljj.53.2020.02.26.20.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 20:25:51 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , Harini Ramakrishnan , Omar Cardona , Pallavi Kadam , Ranjit Menon Date: Thu, 27 Feb 2020 07:25:33 +0300 Message-Id: <20200227042537.187459-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227042537.187459-1-dmitry.kozliuk@gmail.com> References: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> <20200227042537.187459-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 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 95a19b2d3..e1e0378e6 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, ...) { @@ -83,6 +84,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.1