-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [adding m4-discuss for a discussion on syscmd/esyscmd behavior] According to Eric Blake on 12/14/2007 8:05 AM: > According to Andreas Schwab on 12/14/2007 7:56 AM: >> AC_INIT(my-fine-package, m4_esyscmd([./version.sh | tr -d '\n'])) > >> Note that you need to manually remove the final newline, unlike command >> substitutions m4_esyscmd does not do that for you. > > Hmm - m4's esyscmd does not strip the newline, but maybe we can make > m4sugar's m4_esyscmd do so. What do you think? At any rate, m4_esyscmd([./version.sh | tr -d '\n']) spawns more processes than using m4 to strip the newline, so even if we don't change the semantics of m4_esyscmd, we probably should provide an m4 macro that makes it easy to strip it, rather than requiring the use of tr during the esyscmd. Speaking of which, m4's implementation of esyscmd could possibly be optimized to directly exec the target program if there are no shell metacharacters in the string to be invoked, rather than always going through sh. I'm not sure how many implementations of system(3)/popen(3) already do this optimization, but I know that not all of them do it. - -- Don't work too hard, make some time for fun as well! Eric Blake ebb9@xxxxxxx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHYp4r84KuGfSFAYARAgA4AJwKVUWS8iQWfphfxWROGJgoIJFPowCghqL+ 5iNAYqklfS/VeJNn2u5X+N4= =E7q6 -----END PGP SIGNATURE----- _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf