Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0548C200D21 for ; Mon, 16 Oct 2017 15:25:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 03A2E160BE9; Mon, 16 Oct 2017 13:25:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 480D81609EC for ; Mon, 16 Oct 2017 15:25:15 +0200 (CEST) Received: (qmail 68114 invoked by uid 500); 16 Oct 2017 13:25:14 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 68095 invoked by uid 99); 16 Oct 2017 13:25:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2017 13:25:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 578E3C435B; Mon, 16 Oct 2017 13:25:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.798 X-Spam-Level: X-Spam-Status: No, score=0.798 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id MKFaSpF648KS; Mon, 16 Oct 2017 13:25:12 +0000 (UTC) Received: from mailserver.kippdata.de (mailserver.kippdata.de [212.79.170.253]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D95895F239; Mon, 16 Oct 2017 13:25:11 +0000 (UTC) Received: from [10.0.110.6] ([192.168.10.67]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id v9GDP7t4023590; Mon, 16 Oct 2017 15:25:08 +0200 (CEST) Subject: Re: AC_CHECK_LIB issues under maintainer mode (Was: Re: Tagging 2.4.29 / 2.5.0-{alpha/beta?} today) To: dev@httpd.apache.org, List List References: <52D25D9D-347F-4C79-800A-8CC0372BE005@greenbytes.de> <44e40cdf-0d21-a25b-5a45-6521777c3be3@thelounge.net> <84262985-E153-48B3-8F81-C1B52384B6FD@jaguNET.com> <20171016103119.GA19589@redhat.com> From: Rainer Jung Message-ID: <66ffac39-6c6b-eb40-c0ed-0a6eda3c6e21@kippdata.de> Date: Mon, 16 Oct 2017 15:25:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171016103119.GA19589@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit archived-at: Mon, 16 Oct 2017 13:25:16 -0000 Am 16.10.2017 um 12:31 schrieb Joe Orton: > On Fri, Oct 13, 2017 at 11:51:54AM -0400, Jim Jagielski wrote: >> The long and short is that under maintainer mode, we cannot >> expect AC_CHECK_LIB to being correct any longer, because >> the combination of -Werror and -Wstrict-prototypes means >> that any and all functions looked for/checked for using >> AC_CHECK_LIB will NOT be found, due to warnings which are >> now fatal errors during configure time, even if those >> functions DO exist. > > IMO the correct fix is to add all -W... flags to NOTEST_CFLAGS not > CFLAGS so they don't take effect during the configure run at all. At > least I can't think of a good motivation for having compiler warnings > enabled when running autoconf tests in general. Good hint, never used that variable. So what about the following patch instead: just tried it on trunk and seemed to work fine there. Ut changes APACHE_ADD_GCC_CFLAG to operate on NOTEST_CFLAGS instead of CFLAGS (the macro currently is only used in places where we IMHO actually want that change) and introduces NOTEST_CFLAGS use to configure where we handle maintainer mode and debugger mode. Index: acinclude.m4 =================================================================== --- acinclude.m4 (revision 1812263) +++ acinclude.m4 (working copy) @@ -960,7 +960,7 @@ dnl dnl APACHE_ADD_GCC_CFLAGS dnl -dnl Check if compiler is gcc and supports flag. If yes, add to CFLAGS. +dnl Check if compiler is gcc and supports flag. If yes, add to NOTEST_CFLAGS. dnl AC_DEFUN([APACHE_ADD_GCC_CFLAG], [ define([ap_gcc_ckvar], [ac_cv_gcc_]translit($1, [-:.=], [____])) @@ -973,7 +973,7 @@ CFLAGS="$save_CFLAGS" ]) if test "$]ap_gcc_ckvar[" = "yes" ; then - APR_ADDTO(CFLAGS,[$1]) + APR_ADDTO(NOTEST_CFLAGS,[$1]) fi fi undefine([ap_gcc_ckvar]) Index: configure.in =================================================================== --- configure.in (revision 1812263) +++ configure.in (working copy) @@ -627,14 +627,10 @@ AC_ARG_ENABLE(maintainer-mode,APACHE_HELP_STRING(--enable-maintainer-mode,Turn on debugging and compile time warnings and load all compiled modules), [ if test "$enableval" = "yes"; then - APR_ADDTO(CPPFLAGS, -DAP_DEBUG) + APR_ADDTO(NOTEST_CPPFLAGS, -DAP_DEBUG) if test "$GCC" = "yes"; then - APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith]) - # Next flag needed, because -Wstrict-prototypes in combination with - # -Werror leads to compiler errors during configure checks (autoconf - # generates incomplete prototypes). - APACHE_ADD_GCC_CFLAG([-Wno-error=strict-prototypes]) - APACHE_ADD_GCC_CFLAG([-std=c89]) + APR_ADDTO(NOTEST_CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith]) + #APACHE_ADD_GCC_CFLAG([-std=c89]) APACHE_ADD_GCC_CFLAG([-Werror]) APACHE_ADD_GCC_CFLAG([-Wdeclaration-after-statement]) APACHE_ADD_GCC_CFLAG([-Wformat]) @@ -641,7 +637,7 @@ APACHE_ADD_GCC_CFLAG([-Wformat-security]) APACHE_ADD_GCC_CFLAG([-Wunused]) elif test "$AIX_XLC" = "yes"; then - APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) + APR_ADDTO(NOTEST_CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi if test "x$enable_load_all_modules" = "x"; then LOAD_ALL_MODULES=yes @@ -657,9 +653,9 @@ AC_ARG_ENABLE(debugger-mode,APACHE_HELP_STRING(--enable-debugger-mode,Turn on debugging and compile time warnings and turn off optimization), [ if test "$enableval" = "yes"; then - APR_ADDTO(CPPFLAGS, -DAP_DEBUG) + APR_ADDTO(NOTEST_CPPFLAGS, -DAP_DEBUG) if test "$GCC" = "yes"; then - APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith -O0]) + APR_ADDTO(NOTEST_CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith -O0]) APACHE_ADD_GCC_CFLAG([-Wdeclaration-after-statement]) APACHE_ADD_GCC_CFLAG([-Werror=declaration-after-statement]) APACHE_ADD_GCC_CFLAG([-Wformat]) @@ -666,7 +662,7 @@ APACHE_ADD_GCC_CFLAG([-Wformat-security]) APACHE_ADD_GCC_CFLAG([-Werror=format-security]) elif test "$AIX_XLC" = "yes"; then - APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) + APR_ADDTO(NOTEST_CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi fi ])dnl Regards, Rainer