public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@adacore.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: <3246251196ryan@gmail.com>, <gcc-patches@gcc.gnu.org>,
	Iain Sandoe <iain@sandoe.co.uk>, <gcc@gcc.gnu.org>,
	Paolo Bonzini <bonzini@gnu.org>,
	Nathanael Nerode <neroden@gcc.gnu.org>,
	Ralf Wildenhues <Ralf.Wildenhues@gmx.de>,
	"Joseph Myers" <joseph@codesourcery.com>
Subject: Re: Enable top-level recursive 'autoreconf'
Date: Fri, 20 Oct 2023 01:07:02 -0300	[thread overview]
Message-ID: <oril72c4yh.fsf@lxoliva.fsfla.org> (raw)
In-Reply-To: <87v8b37ye7.fsf@euler.schwinge.homeip.net> (Thomas Schwinge's message of "Thu, 19 Oct 2023 11:30:08 +0200")

On Oct 19, 2023, Thomas Schwinge <thomas@codesourcery.com> wrote:

> On 2023-10-18T15:42:18+0100, R jd <3246251196ryan@gmail.com> wrote:
>> I guess I can ask, why there is not a recursive approach for configuring
>> GCC. e.g. AC_SUBDIRS in the top level?

> ('AC_CONFIG_SUBDIRS' you mean.)  You know, often it just takes someone to
> ask the right questions...  ;-)

> What do people think about the attached
> "Enable top-level recursive 'autoreconf'"?  Only lightly tested, so far.

Interesting idea!

It is a little hackish, in that it seems to exploit an implementation
detail in AC_CONFIG_SUBDIRS rather than a documented feature.

I like it!

The autoconf documentation suggests that optional directories can be
tested for:

  if test -d "$srcdir/foo"; then
    AC_CONFIG_SUBDIRS([foo])
  fi

We could use a macro that takes a list and iterates over the list (untested):

dnl Handle a list of optional subdirs.
dnl After AC_OUTPUT, affects autoreconf runs, but not configure runs.
AC_DEFUN([AC_CONFIG_SUBDIRS_OPT], [
  m4_foreach_w([dir], [$1], [
    if test -d "$srcdir/dir"; then
      AC_CONFIG_SUBDIRS(dir)
    fi
  ])
])

Thanks,

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

      parent reply	other threads:[~2023-10-20  4:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPB2dxkMVi=ijhoOo7YVugVPAo3WeOvEpk_FvQMxU7F0BcP2Gw@mail.gmail.com>
2023-10-15 13:00 ` Hints on reconfiguring GCC Iain Sandoe
2023-10-18 12:55   ` Thomas Schwinge
2023-10-18 14:42     ` R jd
2023-10-19  9:30       ` Enable top-level recursive 'autoreconf' (was: Hints on reconfiguring GCC) Thomas Schwinge
2023-10-19  9:57         ` Enable top-level recursive 'autoreconf' Andreas Schwab
2023-10-19 10:42           ` Thomas Schwinge
2023-10-19 23:13             ` Eric Gallager
2023-10-30  1:31             ` Hans-Peter Nilsson
2023-10-20  4:07         ` Alexandre Oliva [this message]

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=oril72c4yh.fsf@lxoliva.fsfla.org \
    --to=oliva@adacore.com \
    --cc=3246251196ryan@gmail.com \
    --cc=Ralf.Wildenhues@gmx.de \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    --cc=joseph@codesourcery.com \
    --cc=neroden@gcc.gnu.org \
    --cc=thomas@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).