From patchwork Wed Jan 31 13:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126332 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1925212edc; Wed, 31 Jan 2018 05:08:43 -0800 (PST) X-Google-Smtp-Source: AH8x227rtPeyJSHf7aLYvi8XVg+T7LtBcMbP9k/yl2LOrDwmBJfL6KlhGEXDMcrMhA7yvDqmwqAB X-Received: by 10.13.237.69 with SMTP id w66mr22625919ywe.313.1517404123579; Wed, 31 Jan 2018 05:08:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517404123; cv=none; d=google.com; s=arc-20160816; b=FXhsFvnQUY1xaT2wVwwOj/zE/H9rw/xWA7kmSLvLBuQ0dJKuRPPykIjmGODfNr7QmO zd8PUS8xHMq364DLU5NyiyFheWTYtVUOwEwnnGIcj0b7JGtywBbOc+TlXt+nqUnT0UlD k4AZKXmXx6uMnNDRSLyWLI6NWsgDQOqh7dEXOCxvPexLhO1Ox/Nx9tvdEsc5mnYJNmBU LEXTHSoeTwRyt8ehCmj+ZT84PHB6Dlk8eM8WraitAY9yf67LJcJyn3W3IgdT09fPg549 wKmQfjqMfcKUY0FSJ6ViqSvkpruzJp/6dP08V47EPUwPU37h51eIp4q8iqu3CDp3JYh+ 1apg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=3JJguASYq3sYoeJWDoPLgebIg6ZmkQLCpQHi3rVaE3E=; b=HLk8d0h1qNCoIV0NMKQAnMR0tOV2m/g9d9ZSUkxx3HCyc/KL51+J8slOCEbo0g3UAI 0Z3Ry4VUysRwa74+37gfwEGdveRWLWC7Z+3HbGekbOcYGY/45Z0AchYXXV/z9jkouz99 AdzZie4y0OanHHeRAaMiwu9Tm0TrklIoSnJeiA1RAZQWx+QK8NntcQo+QGbbJKN/k1a+ iWjrw85zByspTiV2pauoN13q0IYAziPZTgGeRgQt7+BVTvHM/80jR2powXdDHg6GZY5P ONyY82zJk8OrUkkYguVADtSZIvn7akHeyrpbY6e4qFxcObN4rqnvASRhyQXfUbCkzApc +dUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id n2si3293938ywl.92.2018.01.31.05.08.43; Wed, 31 Jan 2018 05:08:43 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2771F61765; Wed, 31 Jan 2018 13:08:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1461A61787; Wed, 31 Jan 2018 13:04:10 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D172B616DA; Wed, 31 Jan 2018 13:04:05 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id F063D616DA for ; Wed, 31 Jan 2018 13:01:44 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 4E7F2781753 for ; Wed, 31 Jan 2018 16:00:13 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mIVnKXOgQr-0Df8Tv3I; Wed, 31 Jan 2018 16:00:13 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id vZ2onGHxam-0ChKeBSl; Wed, 31 Jan 2018 16:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 16:00:07 +0300 Message-Id: <1517403609-12603-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517403609-12603-1-git-send-email-odpbot@yandex.ru> References: <1517403609-12603-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 440 Subject: [lng-odp] [PATCH v1 4/6] configure: add ODP_CHECK_CXXFLAG X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 440 (lumag:build-fixes) ** https://github.com/Linaro/odp/pull/440 ** Patch: https://github.com/Linaro/odp/pull/440.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: 6f20299f993632a4dda987a31b37160d80c25279 **/ configure.ac | 1 + m4/odp_check_flag.m4 | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 01fdc5a8c..7b90b2127 100644 --- a/configure.ac +++ b/configure.ac @@ -97,6 +97,7 @@ CC_VERSION_PATCH=$(echo $CC_VERSION | cut -d'.' -f3) # Default warning setup ########################################################################## ODP_CFLAGS="$ODP_CFLAGS -W -Wall -Werror" +ODP_CXXFLAGS="$ODP_CXXFLAGS -W -Wall -Werror" ODP_CHECK_CFLAG([-Wstrict-prototypes]) ODP_CHECK_CFLAG([-Wmissing-prototypes]) diff --git a/m4/odp_check_flag.m4 b/m4/odp_check_flag.m4 index e3c8ef714..827f9f011 100644 --- a/m4/odp_check_flag.m4 +++ b/m4/odp_check_flag.m4 @@ -5,8 +5,22 @@ dnl an error when it encounters an unknown warning option. # --------------------- # Add FLAG to ODP_CFLAGS if compiler supports that option AC_DEFUN([ODP_CHECK_CFLAG], - [AX_CHECK_COMPILE_FLAG([$1], + [AC_LANG_PUSH([C]) + AX_CHECK_COMPILE_FLAG([$1], [ODP_CFLAGS="$ODP_CFLAGS $1"], [], [-W -Wall -Werror], [AC_LANG_SOURCE([int main(void) - {return 0;}])])]) + {return 0;}])]) + AC_LANG_POP([C])]) + +# ODP_CHECK_CXXFLAG(FLAG) +# --------------------- +# Add FLAG to ODP_CFLAGS if compiler supports that option +AC_DEFUN([ODP_CHECK_CXXFLAG], + [AC_LANG_PUSH([C++]) + AX_CHECK_COMPILE_FLAG([$1], + [ODP_CXXFLAGS="$ODP_CXXFLAGS $1"], + [], [-W -Wall -Werror], + [AC_LANG_SOURCE([int main(void) + {return 0;}])]) + AC_LANG_POP([C++])])