From patchwork Fri Oct 24 21:49:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 402964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2D6E2140097 for ; Sat, 25 Oct 2014 08:49:56 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=YQTGRZV4048GWaNP2uQJWQ5QnMjWUgaW2wGnMv2dbJv561 9vEIAYQ5adjKBqfvNDT8MK0wzylagp5VP5TLn9+E7qYXamJ9+N5B/vbhX0BpP9fN s6G5aptT43ttd/UGQZlwqwNE+sKb5J3Ket8SIlI6dprb0rnDWfy2gyZX1jD9Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=0Zm/mTYBNmvlSYt+KEDbcknloNI=; b=DJ2wobDOTIUkvbdGKH3W b0eRc/CF3xRpr0MLeUBjuEuIEAF07V9C4RRGoAE9iwLP/Kr0Tmey2AB6T8TK4Ai/ M+n6L20UHen4ZqwM1prCgVhEk8m/yOH9rCxnPmgDt/7BZgaI+Lm+h02I0IBtM8/t eXfcJsLgjY0AY05qxqBmykk= Received: (qmail 9164 invoked by alias); 24 Oct 2014 21:49:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 9153 invoked by uid 89); 24 Oct 2014 21:49:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_00, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Rework compiler version check in configure. Message-Id: <20141024214947.DD68E2C3ABB@topped-with-meat.com> Date: Fri, 24 Oct 2014 14:49:47 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=kCut_5lDdiKZ8R3yDDwA:9 a=CjuIK1q_8ugA:10 This replaces -v grovelling (AC_CHECK_PROG_VER) with a straightforward compile test of the __GNUC__ and __GNUC_MINOR__ macro values. Everything using AC_CHECK_PROG_VER is inherently fragile, and it's also just more autoconfy to use a more empirical test. This is pretty well orthogonal, but since I used AC_CACHE_CHECK it also now becomes easy to force the check to succeed by putting libc_cv_compiler_ok=yes on the configure command line, which is handy in experimental situations. Thanks, Roland * configure.ac: Validate compiler version with a empirical test of __GNUC__ and __GNUC_MINOR__ predefined values, rather than by grepping $CC -v output. * configure: Regenerated. --- a/configure.ac +++ b/configure.ac @@ -910,9 +910,6 @@ AC_CHECK_PROG_VER(LD, $LD, --version, # These programs are version sensitive. AC_CHECK_TOOL_PREFIX -AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v, - [version \([egcygnustpi-]*[0-9.]*\)], [4.[4-9].* | 4.[1-9][0-9].* | [5-9].* ], - critic_missing="$critic_missing gcc") AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version, [GNU Make[^0-9]*\([0-9][0-9.]*\)], [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make") @@ -933,6 +930,16 @@ AC_CHECK_PROG_VER(AWK, gawk, --version, [GNU Awk[^0-9]*\([0-9][0-9.]*\)], [3.1.[2-9]*|3.[2-9]*|[4-9]*], critic_missing="$critic_missing gawk") +AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [ +AC_TRY_COMPILE([], [ +#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) +#error insufficient compiler +#endif], + [libc_cv_compiler_ok=yes], + [libc_cv_compiler_ok=no])]) +AS_IF([test $libc_cv_compiler_ok != yes], + [critic_missing="$critic_missing compiler"]) + AC_CHECK_TOOL(NM, nm, false) if test "x$maintainer" = "xyes"; then