-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 9/9/2006 11:26 AM: > Gary V. Vaughan wrote: >> Untested: >> >> m4_define([gt__NEED_NGETTEXT_FU], >> [shell code to execute after expansion of AM_GNU_GETTEXT, >> whenever AM_GETTEXT_NEED_NGETTEXT is present somewhere]) >> >> AC_DEFUN([AM_GNU_GETTEXT], >> [ >> ...current contents of AM_GNU_GETTEXT definition... >> >> dnl make sure gt__NEED_NGETTEXT_FU is always expanded in the >> dnl presence of AM_GETTEXT_NEED_NGETTEXT: >> AC_PROVIDE_IFELSE([AM_GETTEXT_NEED_NGETTEXT], >> [gt__NEED_NGETTEXT_FU], >> [m4_define([AM_GETTEXT_NEED_NGETTEXT], >> [defn([AM_GETTEXT_NEED_NGETTEXT]) >> gt__NEED_NGETTEXT_FU >> ])dnl >> ])# AM_GNU_GETTEXT > > Thanks for the idea. With this one can have some shell code be executed > after the last invocation of any of the two given macros. But what I'm > looking for is even more: make it known at the beginning of the first > macro that an invocation of the second macro is coming later.
It is not possible to know what macros will be invoked later in the file. But with diversions, it is possible for macros invoked later to emit shell code that will be invoked earlier, by making sure that gt__NEED_NGETTEXT_FU expands to shell code in a lower diversion number than AM_GNU_GETTEXT. That way, AM_GNU_GETTEXT can emit shell code that depends on the value of a shell variable, where the shell variable is guaranteed to be set (either to a default if gt__NEED_NGETTEXT_FU is never called, or to a non-default by gt__NEED_NGETTEXT_FU) in an earlier diversion. - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFAvx+84KuGfSFAYARAvrSAKCelDAtwDcuJ1/4pSGJDzasLTDYAQCgmfq7 N+HR4/VaNFAokVrSxyjRLrc= =I7+2 -----END PGP SIGNATURE-----