From patchwork Tue Feb 20 09:25:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffan Karger X-Patchwork-Id: 240 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id ZaW1A5m/jVrzQQAAIUCqbw for ; Wed, 21 Feb 2018 13:51:05 -0500 Received: from director8.mail.ord1c.rsapps.net ([172.28.255.1]) by director10.mail.ord1d.rsapps.net (Dovecot) with LMTP id MxXyBJm/jVryKgAApN4f7A ; Wed, 21 Feb 2018 13:51:05 -0500 Received: from smtp59.gate.ord1a ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by director8.mail.ord1c.rsapps.net (Dovecot) with LMTP id CH6xBJm/jVrlegAAPBwpBw ; Wed, 21 Feb 2018 13:51:05 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp59.gate.ord1a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=karger-me.20150623.gappssmtp.com; dmarc=none (p=nil; dis=none) header.from=karger.me X-Classification-ID: 2ab85606-1738-11e8-bc3e-842b2b4126a2-1-1 Received: from [216.105.38.7] ([216.105.38.7:4519] helo=lists.sourceforge.net) by smtp59.gate.ord1a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 28/13-24217-89FBD8A5; Wed, 21 Feb 2018 13:51:04 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1eoZSw-0004L7-Jd; Wed, 21 Feb 2018 18:50:06 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eoZSu-0004L1-T5 for openvpn-devel@lists.sourceforge.net; Wed, 21 Feb 2018 18:50:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Resent-To: Resent-Message-ID:Resent-Date:Resent-From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Sender:Resent-Cc:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0EwwTpn2P1RON6YKz9yzeIN1lRBOHiiNGToHSXlRziE=; b=cGwk3zJBMStYcA9urbp+FvXXS2 PiVJPpJfLu38BK5tDqegVY5FKLwSe+Vdjb2OzbxP+iwr+SuP1i49i0KmIUX1JV4YiboxyxdH81IOn DA6Owb08mGGthZRijtJ5haa7VpbRSRJt0bHyIG3Q4dxIqK2vW+kmxgwl7dWW39kYTYAo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Resent-To:Resent-Message-ID: Resent-Date:Resent-From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Sender: Resent-Cc:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0EwwTpn2P1RON6YKz9yzeIN1lRBOHiiNGToHSXlRziE=; b=Qry4nPPqftqA0OteDegX3zNAnu Wp8JmOzY6Chig9sxaKZCVpiAXSxgS86NiYHmqfpTNUSe/NHbiq+NG8EgTpST+2ZIyo5cfPLFjpm3X 0jI6G8IjJnpC1DL+YuKOdsZ0fSAcrsBpwDKXf8e3PliTEUXeYVoktRDcAbK6KnDm6N6w=; Received: from sfi-lb-mx.v20.lw.sourceforge.com ([172.30.20.201] helo=chekov.greenie.muc.de) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) id 1eoZSt-0006HK-2S for openvpn-devel@lists.sourceforge.net; Wed, 21 Feb 2018 18:50:03 +0000 Received: from chekov.greenie.muc.de (localhost [127.0.0.1]) by chekov.greenie.muc.de (8.15.2/8.15.2) with ESMTPS id w1LIo1sG087044 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 21 Feb 2018 19:50:01 +0100 (CET) (envelope-from gert@chekov.greenie.muc.de) Received: (from gert@localhost) by chekov.greenie.muc.de (8.15.2/8.15.2/Submit) id w1LIo1Mg087043 for openvpn-devel@lists.sourceforge.net; Wed, 21 Feb 2018 19:50:01 +0100 (CET) (envelope-from gert) Resent-From: Gert Doering Resent-Date: Wed, 21 Feb 2018 19:50:01 +0100 Resent-Message-ID: <20180221185001.GX69387@greenie.muc.de> Resent-To: openvpn-devel@lists.sourceforge.net X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chekov.greenie.muc.de X-Spam-Level: X-Spam-Status: No, score=0.8 required=7.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.1 Received: from delta2.greenie.net (root@delta2.greenie.net [IPv6:2001:608:0:1007:a00:20ff:fefe:4bd2]) by chekov.greenie.muc.de (8.15.2/8.15.2) with ESMTPS id w1LISRoI086916 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 21 Feb 2018 19:28:27 +0100 (CET) (envelope-from steffan@karger.me) Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by delta2.greenie.net (8.15.2/8.12.11) with ESMTPS id w1LISQf0072887 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 21 Feb 2018 19:28:26 +0100 (CET) Received: by mail-wr0-x241.google.com with SMTP id p104so7174939wrc.12 for ; Wed, 21 Feb 2018 10:28:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karger-me.20150623.gappssmtp.com; s=20150623; h=resent-from:resent-date:resent-message-id:resent-to:from:to:cc :subject:date:message-id; bh=0EwwTpn2P1RON6YKz9yzeIN1lRBOHiiNGToHSXlRziE=; b=SdY/SWlwoSSDxYR1AKCUT+Nw9tjGRftE+SK8zHf5PuGAIQVarL1Dg7/Ykw8ufTDl74 ZtS0MXg6uXfjLU1fTiwHg4CeRSE5+l/ogFyH+s2bVVmCpbQXfuF4YNYQikORvcyV/j/D Z6MGjpeedgmfqrZ0QWIiG7I48zR2yXqCQ3o3upF2NfWyJ1Rdm/d3r0v8s+EvRe7hf4bl iGLHR5+a99BRTL4ZLuY4+1AfOngciBv0p+Rm351+TQt7tA9bq4veyBGGtpvjwObGtxhs lQPbpLAv8RVQuLqyusUvirY5z3iqnjpkD9eQameIpPqxRiqQBF3I3s5QSRhVT8VNmqdx jzjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:from:to:cc:subject:date:message-id; bh=0EwwTpn2P1RON6YKz9yzeIN1lRBOHiiNGToHSXlRziE=; b=qC0FvlqYl3wzGhbei/IBHKlLjUnCAZ+F/MvjsoNMCdjX4S9iudUins0/2UyqQ9zUht 2ii07GMs6KMypsAfPQIG2Oyk3nc/VZ/3hlAscvJDBTDxCzz8BOYLx57/A7u7TR+Rh33H qbEp8zHy7KnljSLTxR76Q+uQDB0uXvVizAfmEFRtUVd9v+WUnxTDDMLHneYlwxBSqz94 3KnM25haJ4tUTK6Iciv42sH2+iMc0DqY0h4q+qvBCOxfe8J3pCN2NbdVO2+gA4yljWLb t5zO+Ht9bl4m0W8hYrIiVM1vH+It01TcCzp43CfQObq/dBdfmOj0ql/GzmHqwLBDHxS8 xDng== X-Gm-Message-State: APf1xPCJK0ld3dR5zWKS5pKB6R18pLw9ksRxIeEMuiRTUvrkTflpyQ6Y FDzJYhAy46WtnVYRhMPKWgvHMFNYbWo= X-Google-Smtp-Source: AH8x227x2L4VXJCUW+y+mdeiI/2tLrBDH7lrD87HQl/rfMsNsNX0kzs9VUCN3YGGBFOb7UxLjxOylw== X-Received: by 10.80.174.6 with SMTP id c6mr6120172edd.217.1519237705683; Wed, 21 Feb 2018 10:28:25 -0800 (PST) Received: from vesta ([2001:985:e54:1:b184:3a60:308f:68a9]) by smtp.gmail.com with ESMTPSA id t23sm5022503edb.54.2018.02.21.10.28.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 10:28:25 -0800 (PST) Resent-From: Steffan Karger Resent-Date: Wed, 21 Feb 2018 19:28:23 +0100 Resent-Message-ID: <20180221182823.mtjfu75kulgdudkm@vesta> Resent-To: gert@greenie.muc.de Received: from localhost.localdomain ([31.161.144.98]) by smtp.gmail.com with ESMTPSA id d30sm21814861edd.90.2018.02.20.12.25.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 12:25:23 -0800 (PST) From: Steffan Karger To: openvpn-devel@lists.sourceforge.net Date: Tue, 20 Feb 2018 21:25:08 +0100 Message-Id: <20180220202508.16201-1-steffan@karger.me> X-Mailer: git-send-email 2.14.1 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.2 (delta2.greenie.net [IPv6:2001:608:0:1007:a00:20ff:fefe:4bd2]); Wed, 21 Feb 2018 19:28:26 +0100 (CET) X-Virus-Status: Clean Subject: [Openvpn-devel] [PATCH] Get rid of ax_check_compile_flag.m4 X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net Sender: "Openvpn-devel" X-getmail-retrieved-from-mailbox: Inbox The macro was too new for some of the platforms we still support. In particular, centos/rhel 6 and opensolaris 10. To work around that, we introduce our own simpler and more tailored ACL_CHECK_ADD_COMPILE_FLAGS macro, that not only checks but also sets the flags in CFLAGS if it is accepted. Since this doesn't use new-and-shine autoconf features, it should also work on the legacy platforms. Signed-off-by: Steffan Karger Acked-by: Gert Doering --- configure.ac | 18 ++++++----- m4/ax_check_compile_flag.m4 | 74 --------------------------------------------- 2 files changed, 10 insertions(+), 82 deletions(-) delete mode 100644 m4/ax_check_compile_flag.m4 diff --git a/configure.ac b/configure.ac index 1496fd55..626b4dd4 100644 --- a/configure.ac +++ b/configure.ac @@ -1292,15 +1292,17 @@ if test "${enable_pkcs11}" = "yes"; then ) fi -AX_CHECK_COMPILE_FLAG( - [-Wno-unused-function], - [CFLAGS="-Wno-unused-function ${CFLAGS}"] +AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ + old_cflags="$CFLAGS" + CFLAGS="$1 $CFLAGS" + AC_MSG_CHECKING([whether the compiler acceppts $1]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]); CFLAGS="$old_cflags"])] ) -AX_CHECK_COMPILE_FLAG( - [-Wno-unused-parameter], - [CFLAGS="-Wno-unused-parameter ${CFLAGS}"] -) -AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="-Wall ${CFLAGS}"]) + +ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-unused-function]) +ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-unused-parameter]) +ACL_CHECK_ADD_COMPILE_FLAGS([-Wall]) if test "${enable_pedantic}" = "yes"; then enable_strict="yes" diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 deleted file mode 100644 index dcabb92a..00000000 --- a/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,74 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 5 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS