Document AS_TR_* macros

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Document AS_TR_* macros

Derek Price
I've attached a short patch which documents the AS_TR_* macros.  I'm
going to commit it in a day or two if there are no objections.

2005-06-07  Derek Price  <[hidden email]>

        * doc/autoconf.texi (Programming in M4sh): Document AS_TR_SH &

My apologies if this email shows up twice.  The copy I sent yesterday
hasn't appeared yet.



Index: doc/autoconf.texi
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.906
diff -u -p -r1.906 autoconf.texi
--- doc/autoconf.texi 6 Jun 2005 08:01:32 -0000 1.906
+++ doc/autoconf.texi 6 Jun 2005 18:27:29 -0000
@@ -8961,6 +8961,30 @@ even though Posix is unclear whether @sa
 succeed in that case.
 @end defmac
+@defmac AS_TR_CPP (@var{expression})
+Transform @var{expression} into a valid right-hand side for a C @code{#define}.
+For example:
+$ type="char *"
+$ echo "#define AS_TR_CPP(HAVE_$type) 1"
+#define HAVE_CHAR_P 1
+@end example
+@end defmac
+@defmac AS_TR_SH (@var{expression})
+Transform @var{expression} into a valid shell variable name.  For example:
+$ header="sys/some file.h"
+$ AS_TR_SH(HAVE_$header)=:
+$ if $HAVE_sys_some_file_h; then echo "Have it!"; fi
+Have it!
+@end example
+@end defmac
 @defmac AS_SET_CATFILE (@var{var}, @var{dir}, @var{file})
 Set the shell variable @var{var} to @var{dir}/@var{file}, but