On Mon, Nov 27, 2017 at 2:48 PM, Michael Orlitzky <mich...@orlitzky.com> wrote:
> On 11/27/2017 07:39 AM, Erik Bray wrote:
>>
>> One thing I might do differently from your proposal:  I have some
>> experimental code for an autoconf macro that can slurp in macros from
>> multiple sub-directories.  The idea being that you could put little
>> .m4 files in each build/pkgs/<pkgname> dir with configure-time checks
>> for that specific package, rather than cluttering up configure.ac with
>> them.  Perhaps I could try putting together a ticket for that...?
>
> PHP does this with its extensions, all of which are optional and have
> their own configure flags. There's a shell script that essentially does
>
>   for f in build/pkgs/*/*.m4; do
>     echo "include(${f})"
>   done
>
> and then that shell script is executed in the top-level configure.ac
> with esyscmd:
>
>   esyscmd(./path/to/that/script)
>
> The result is that the "include" commands get inserted into the
> top-level configure.ac file before processing.

Neat--that's more or less how my thing works, except it just uses
esyscmd(find ...).  Seems to work fine, but good to know there's prior
precedent for something like that.  The core of my macro is

m4_foreach_w([f], m4_esyscmd_s([find build/pkgs -name
'spkg-configure.m4' -type f]), [m4_apply([m4_include], f)])

Each spkg-configure.m4 could, in turn, contain a macro with a standard
name like SAGE_CONFIGURE_<PKGNAME> which could also be expanded in
this loop, or elsewhere.

> On the other hand, if we standardize on the name of the m4 file (i.e.
> it's fixed but optional), then you could use "sinclude" to grab them all
> at once, ignoring the errors from the ones that don't exist.

I'm not really sure what you mean here.  You still need to use some
kind of system command plus a loop, if you want to keep the m4 files
in build/pkgs/*/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to