From patchwork Tue Nov 8 18:22:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124417 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]) by ozlabs.org (Postfix) with SMTP id E564B1007D4 for ; Wed, 9 Nov 2011 05:22:48 +1100 (EST) Received: (qmail 9838 invoked by alias); 8 Nov 2011 18:22:46 -0000 Received: (qmail 9827 invoked by uid 22791); 8 Nov 2011 18:22:45 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 18:22:17 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA8IME2f007237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Nov 2011 13:22:14 -0500 Received: from anchor.twiddle.net (vpn-225-39.phx2.redhat.com [10.3.225.39]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pA8IMDks007653; Tue, 8 Nov 2011 13:22:14 -0500 Message-ID: <4EB97355.70704@redhat.com> Date: Tue, 08 Nov 2011 10:22:13 -0800 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: Pedro Alves CC: gcc-patches@gcc.gnu.org Subject: Re: Disable libitm if unsupported References: <4EB959F0.60301@redhat.com> <201111081726.24103.pedro@codesourcery.com> <4EB96781.4030409@redhat.com> <201111081756.04563.pedro@codesourcery.com> In-Reply-To: <201111081756.04563.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 11/08/2011 09:56 AM, Pedro Alves wrote: > On Tuesday 08 November 2011 17:31:45, Richard Henderson wrote: >> On 11/08/2011 09:26 AM, Pedro Alves wrote: >>> On Tuesday 08 November 2011 16:33:52, Richard Henderson wrote: >>>> toplevel/ >>>> * configure.ac: Adjust srcdir for running libitm/configure.tgt. >>> >>>> +# Disable libitm on unsupported hosted systems. >>>> +if test x$enable_libitm = x; then >>>> + AC_MSG_CHECKING([for libitm support]) >>>> + if (srcdir=${srcdir}/libitm; \ >>>> + . ${srcdir}/configure.tgt; \ >>> >>> This should check that libitm exists before sourcing the script, >>> as otherwise it will error out on src tree >>> checkouts (binutils, gdb, ...), given that the libitm directory >>> doesn't exist there. >> >> Should I bother with an explicit test, or just use "set -e"? > > Whatever works is fine with me. :-) > Tested and committed the following. r~ diff --git a/ChangeLog b/ChangeLog index 89eb37a..c25db94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-11-08 Richard Henderson + * configure.ac: Test for libitm directory present first. + * configure.ac: Adjust srcdir for running libitm/configure.tgt. * configure.ac: Test libitm/configure.tgt to disable libitm. diff --git a/configure b/configure index 7a7f287..8a37411 100755 --- a/configure +++ b/configure @@ -3057,20 +3057,23 @@ if test x$enable_libgomp = x ; then esac fi -# Disable libitm on unsupported hosted systems. -if test x$enable_libitm = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libitm support" >&5 +# Disable libitm on unsupported systems. +if test -d ${srcdir}/libitm; then + if test x$enable_libitm = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libitm support" >&5 $as_echo_n "checking for libitm support... " >&6; } - if (srcdir=${srcdir}/libitm; \ - . ${srcdir}/configure.tgt; \ - test -n "$UNSUPPORTED"); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - noconfigdirs="$noconfigdirs target-libitm" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + if (srcdir=${srcdir}/libitm; \ + . ${srcdir}/configure.tgt; \ + test -n "$UNSUPPORTED") + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + noconfigdirs="$noconfigdirs target-libitm" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - fi + fi + fi fi # Disable libssp for some systems. diff --git a/configure.ac b/configure.ac index 888d051..efabad4 100644 --- a/configure.ac +++ b/configure.ac @@ -493,17 +493,20 @@ if test x$enable_libgomp = x ; then esac fi -# Disable libitm on unsupported hosted systems. -if test x$enable_libitm = x; then - AC_MSG_CHECKING([for libitm support]) - if (srcdir=${srcdir}/libitm; \ - . ${srcdir}/configure.tgt; \ - test -n "$UNSUPPORTED"); then - AC_MSG_RESULT([no]) - noconfigdirs="$noconfigdirs target-libitm" - else - AC_MSG_RESULT([yes]) - fi +# Disable libitm on unsupported systems. +if test -d ${srcdir}/libitm; then + if test x$enable_libitm = x; then + AC_MSG_CHECKING([for libitm support]) + if (srcdir=${srcdir}/libitm; \ + . ${srcdir}/configure.tgt; \ + test -n "$UNSUPPORTED") + then + AC_MSG_RESULT([no]) + noconfigdirs="$noconfigdirs target-libitm" + else + AC_MSG_RESULT([yes]) + fi + fi fi # Disable libssp for some systems.