Hi Eric, * Eric Blake wrote on Wed, Apr 08, 2009 at 05:53:00AM CEST: > According to Ralf Wildenhues on 4/7/2009 12:41 PM: > >> m4_define([_AC_COMPILER_EXEEXT], > >> m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) > >> > >> m4_provide_if([_AM_COMPILER_EXEEXT], > >> [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])]) > > > > I assume that you mean that the m4_define part should happen before > > AC_PROG_CC and the m4_provide_if part afterwards? How would you ensure > > the former? > > The m4_define part would occur in isolation at the top level, as something > that gets folded into aclocal.m4 alongside all your other > m4_define/AC_DEFUN setups. aclocal.m4 is sourced after autoconf.m4 (so > you are guaranteed that the original _AC_COMPILER_EXEEXT that you are > trying to hook has already been defined), and before configure.ac (and > thus before any invocation of AC_INIT, let alone AC_PROG_CC).
Cool. I tend to forget about this possibility. > The m4_provide_if part would be in the same place that you were originally > thinking of investigating _AC_SUBST_VARS. And regardless of whether > AC_PROG_CC or AM_INIT_AUTOMAKE was expanded first, the fact that you > hooked _AC_COMPILER_EXEEXT should be visible. Alright. I think we have it sorted out now. BTW, Automake really needs to do the m4_provide_if dance, rather than just tacking code onto the end of _AC_COMPILER_EXEEXT, because Autoconf may redefine _AC_COMPILER_EXEEXT and expand its earlier definition inside a shell conditional statement, see AC_NO_EXECUTABLES. > > If it works then yes, that sounds easier. Can Automake rely on the > > existence of the _AC_COMPILER_EXEEXT macro then, and that it's this > > macro which is called whenever EXEEXT may be needed? > > Whether it is _AC_COMPILER_EXEEXT or _AC_SUBST_VARS, I think that once we > have a working use in automake that we should definitely add the > documenting comment into autoconf. Yes. I have pushed the inline documentation patch to Autoconf now, see this thread for the patch I've pushed to Automake: <http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3528>. Thank you for your help on this! Cheers, Ralf