-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Mike Frysinger on 11/21/2009 12:14 PM: > i'm not really familiar with the diversion functionality of m4, so i'll just > post findings ... > > this simple code works under <=autoconf-2.63: > $ cat configure.ac > AC_INIT(f, 0)
Get in the habit of using AC_INIT([f], [0]). > m4_divert(1) There's the bug - in the user's script and not in autoconf. Diversion 1 is too low, and gets output PRIOR to initialization text that autoconf assumes will be present. By using a raw number, instead of a named diversion, the user has violated constraints. According to the manual, you should rely on named diversions rather than mucking with raw diversion numbers. Fix the bug in the user's configure.ac by instead using a named diversion reserved for application initialization: m4_divert([INIT_PREPARE]). If the user still insists on a raw number, at least use something in the range of 300-1000, since autoconf assumes that all diversions prior to 300 (aka INIT_PREPARE) are reserved for autoconf's initialization; the user's output normally starts at 1000 (aka BODY). > > but under autoconf-2.64+, we see: > $ autoconf && ./configure > ./configure: line 3: 5: Bad file descriptor That's because AC_MSG_RESULT was changed to rely on preparatory text that it can assume exists prior to any of the user's diversions. But when the user tries to reuse diversion 1, and the preparatory text doesn't exist until 250, then of course you get invalid shell output. - -- Don't work too hard, make some time for fun as well! Eric Blake [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksISCgACgkQ84KuGfSFAYDInwCgi1LtnAHAJvlViEA+givD2fjR CpIAoId+MaFZ/TpMxgtPNlfED+1dmabT =2iMb -----END PGP SIGNATURE-----
