From patchwork Mon Aug 23 19:18:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Galibert X-Patchwork-Id: 44744 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DC9E3858010 for ; Mon, 23 Aug 2021 19:19:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DC9E3858010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629746373; bh=OiT4J1K1pYNi6J+MQ5UVRReocy0P0Y/p5EYK/m8mYl4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MMl3vJAv9qZ1bc6FRNwC0c8cZPyQ/LByzEMv+KobcO5FArzhrztMx7qBsFzF00Ooe Maoc68njR9cgwN0CV2GWsHTCyP2D+Dp/VGi7cl6dTGUkmoQ3yDnXWuznZ+5mA5H+pF 09xHBueplzBumOLMxTlL5Sie4uC6cksTA9QKT2HM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) by sourceware.org (Postfix) with ESMTPS id 13B613857827 for ; Mon, 23 Aug 2021 19:18:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13B613857827 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 49233147E37; Mon, 23 Aug 2021 15:18:48 -0400 (EDT) (envelope-from galibert@pobox.com) Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 42553147E36; Mon, 23 Aug 2021 15:18:48 -0400 (EDT) (envelope-from galibert@pobox.com) Received: from localhost.localdomain (unknown [78.197.126.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 20A87147E34; Mon, 23 Aug 2021 15:18:44 -0400 (EDT) (envelope-from galibert@pobox.com) To: libc-alpha@sourceware.org Subject: [PATCH] Make find_cxx_header compatible with current clang output. Date: Mon, 23 Aug 2021 21:18:31 +0200 Message-Id: <20210823191831.597883-1-galibert@pobox.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Pobox-Relay-ID: EF977084-0446-11EC-B338-D5C30F5B5667-92059326!pb-smtp20.pobox.com X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Olivier Galibert via Libc-alpha From: Olivier Galibert Reply-To: Olivier Galibert Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" For some reason clang does not put the main header in the descendant lists in -M -MP, so sed doesn't pick it up. Use awk to find the correct header in the depedencies lists instead. Signed-off-by: Olivier Galibert --- configure | 3 ++- configure.ac | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 23f5e69445..0f476763b2 100755 --- a/configure +++ b/configure @@ -5521,7 +5521,8 @@ fi if test -n "$CXX"; then find_cxx_header () { echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \ - | sed -n "\,$1:,{s/:\$//;p}" + | awk -vp=$1 '{ for(i=1;i<=NF;i++) if(substr($i, length($i)-length(p)+1) == p) print $i }' \ + | head -n 1 } CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)" CXX_CMATH_HEADER="$(find_cxx_header cmath)" diff --git a/configure.ac b/configure.ac index 53462290a0..1180411a95 100644 --- a/configure.ac +++ b/configure.ac @@ -1115,7 +1115,8 @@ AC_SUBST(CXX_SYSINCLUDES) if test -n "$CXX"; then find_cxx_header () { echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \ - | sed -n "\,$1:,{s/:\$//;p}" + | awk -vp=$1 '{ for(i=1;i<=NF;i++) if(substr($i, length($i)-length(p)+1) == p) print $i }' \ + | head -n 1 } CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)" CXX_CMATH_HEADER="$(find_cxx_header cmath)"