public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Disable libitm if unsupported
Date: Tue, 08 Nov 2011 18:35:00 -0000	[thread overview]
Message-ID: <4EB97355.70704@redhat.com> (raw)
In-Reply-To: <201111081756.04563.pedro@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

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~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 2574 bytes --]

diff --git a/ChangeLog b/ChangeLog
index 89eb37a..c25db94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-11-08  Richard Henderson  <rth@redhat.com>
 
+	* 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.

  reply	other threads:[~2011-11-08 18:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 16:55 Richard Henderson
2011-11-08 17:38 ` Pedro Alves
2011-11-08 17:40   ` Richard Henderson
2011-11-08 18:13     ` Pedro Alves
2011-11-08 18:35       ` Richard Henderson [this message]
2011-11-08 21:29         ` Iain Sandoe
2011-11-08 21:33           ` Richard Henderson
2011-11-08 21:56             ` Iain Sandoe
2011-11-09 17:01             ` Iain Sandoe
2011-11-09 17:14               ` Richard Henderson
2011-11-09 17:36                 ` Iain Sandoe
2011-11-09 18:56                   ` Richard Henderson
2011-11-09 18:58                     ` Iain Sandoe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EB97355.70704@redhat.com \
    --to=rth@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).