From: Eric Blake Date: Tue, 2 Mar 2010 22:39:58 +0000 (-0700) Subject: Fix shell code in AS_TR_SH documentation. X-Git-Tag: v2.66~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d174a5362e1adc52d9ef0e9448b2ad142512e42f;p=thirdparty%2Fautoconf.git Fix shell code in AS_TR_SH documentation. * doc/autoconf.texi (Common Shell Constructs) : Fix example to expand to valid shell code. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 747a6290d..5aae86c8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-03-02 Eric Blake + Fix shell code in AS_TR_SH documentation. + * doc/autoconf.texi (Common Shell Constructs) : Fix + example to expand to valid shell code. + Reported by Ralf Wildenhues. + Improve documentation on AC_{COMPILE,LINK}_IFELSE. * doc/autoconf.texi (Running the Compiler): Mention that the object file is available after a successful compile. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 7838f76cf..8fca9ae2b 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -13206,12 +13206,15 @@ echo "[#]define AS_TR_CPP([HAVE_$type]) 1" @defmac AS_TR_SH (@var{expression}) @asindex{TR_SH} -Transform @var{expression} into a valid shell variable name. For example: +Transform @var{expression} into shell code that generates a valid shell +variable name. The result is literal when possible at m4 time, but must +be used with @code{eval} if @var{expression} causes shell indirections. +For example: @example # This outputs "Have it!". header="sys/some file.h" -AS_TR_SH([HAVE_$header])=yes +eval AS_TR_SH([HAVE_$header])=yes if test "x$HAVE_sys_some_file_h" = xyes; then echo "Have it!"; fi @end example @end defmac