On 02/10/2011 02:02 PM, Dave Goodell wrote: > m4_foreach([subsys_i],[[subconfigure]],[m4_include(subsys_i[.m4])]) So you are indirectly including a file whose name is not immediately apparent in the parent file... > #end > AC_OUTPUT([Makefile]) > ----8<---- > > and here's subconfigure.m4: > > ----8<---- > # begin subconfigure.m4 > # this AM_COND_IF doesn't get expanded for some reason... > AM_COND_IF([COND],[echo COND is true],[echo COND is false]) And only the subfile references the AM_COND_IF macro. My initial take is that the problem is that aclocal is trying to figure out which files to include in order to provide all the necessary macro definitions, but you have obfuscated the name of the included file in such a way that aclocal cannot figure out that it needs to trace subconfigure.m4, and thus does not include the automake-internal files that define AM_COND_IF because it couldn't see anyone using that macro. > > here's the resulting snippet of configure between "#begin" and "#end": > # begin subconfigure.m4 > # this AM_COND_IF doesn't get expanded for some reason... > AM_COND_IF(COND,echo COND is true,echo COND is false) Perhaps you could m4_include the automake file that defines AM_COND_IF, or work around it by using AM_COND_IF from directly within autoconf.ac where aclocal can trace it, or m4_include subconfigure.m4 in such a way that aclocal can trace it. Since aclocal belongs to automake, you may get a slightly better response on that list on how to teach aclocal how to recognize that it needs to suck in the definition for AM_COND_IF. > Many variations of this script work as expected, including non-looped "m4_include" and looped "m4_include" but explicitly naming "subconfigure.m4" instead of attempting to compute it from the loop variable. Have I botched the m4 quoting somehow? You haven't botched m4 quoting, but you did make it much harder for aclocal to do its job. > I believe I have several possible workarounds, Glad to hear it. -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf