Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Modra via Gdb-patches <gdb-patches@sourceware.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	gcc-patches@gcc.gnu.org, binutils@sourceware.org,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] GCC: Check if AR works with --plugin and rc
Date: Tue, 12 Jan 2021 09:57:43 +1030	[thread overview]
Message-ID: <20210111232743.GD5523@bubble.grove.modra.org> (raw)
In-Reply-To: <20210111165706.92117-2-hjl.tools@gmail.com>

On Mon, Jan 11, 2021 at 08:57:05AM -0800, H.J. Lu via Binutils wrote:
> diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
> index c5b72e9a13d..798a2054edd 100644
> --- a/config/gcc-plugin.m4
> +++ b/config/gcc-plugin.m4
> @@ -145,6 +145,18 @@ for plugin in $plugin_names; do
>      break
>    fi
>  done
> +dnl Check if ${AR} $plugin_option rc works.
> +AC_CHECK_TOOL(AR, ar)
> +if test "${AR}" = "" ; then
> +  AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
> +fi
> +touch conftest.c
> +${AR} $plugin_option rc conftest.a conftest.c
> +if test "$?" != 0; then
> +  echo "Failed: ${AR} $plugin_option rc"

Use AC_MSG_ERROR rather than echo.

> +  plugin_option=
> +fi
> +rm -f conftest.*
>  if test -n "$plugin_option"; then
>    $1="$plugin_option"
>    AC_MSG_RESULT($plugin_option)

> diff --git a/libtool.m4 b/libtool.m4
> index 3672e9516e2..150971974c1 100644
> --- a/libtool.m4
> +++ b/libtool.m4
> @@ -1340,7 +1340,14 @@ AC_CHECK_TOOL(AR, ar, false)
>  test -z "$AR" && AR=ar
>  if test -n "$plugin_option"; then
>    if $AR --help 2>&1 | grep -q "\--plugin"; then
> -    AR="$AR $plugin_option"
> +    touch conftest.c
> +    $AR $plugin_option rc conftest.a conftest.c
> +    if test "$?" != 0; then
> +      echo "Failed: $AR $plugin_option rc"

AC_MSG_ERROR again.

> +    else
> +      AR="$AR $plugin_option"
> +    fi
> +    rm -f conftest.*
>    fi
>  fi
>  test -z "$AR_FLAGS" && AR_FLAGS=cru

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2021-01-11 23:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 16:57 [PATCH 0/2] " H.J. Lu via Gdb-patches
2021-01-11 16:57 ` [PATCH 1/2] GCC: " H.J. Lu via Gdb-patches
2021-01-11 23:27   ` Alan Modra via Gdb-patches [this message]
2021-01-12  0:07     ` V2 " H.J. Lu via Gdb-patches
2021-01-12  0:22       ` Alan Modra via Gdb-patches
2021-01-12  0:24         ` H.J. Lu via Gdb-patches
2021-01-11 16:57 ` [PATCH 2/2] Binutils: " H.J. Lu via Gdb-patches
2021-01-11 23:05 ` [PATCH 0/2] " Alan Modra via Gdb-patches
2021-01-11 23:08   ` H.J. Lu via Gdb-patches

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=20210111232743.GD5523@bubble.grove.modra.org \
    --to=gdb-patches@sourceware.org \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=brobecker@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.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