* doc/invoke.texi (Spec Files): Document getenv spec function.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Feb 2007 03:00:26 +0000 (03:00 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Feb 2007 03:00:26 +0000 (03:00 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122248 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/doc/invoke.texi

index f16b005..641648d 100644 (file)
@@ -1,5 +1,7 @@
 2007-02-22  Mark Mitchell  <mark@codesourcery.com>
 
+       * doc/invoke.texi (Spec Files): Document getenv spec function.
+
        * gcc.c (getenv_spec_function): New function.
        (static_spec_functions): Add it.
        * config/vxworks.h (VXWORKS_TARGET_DIR): Remove.
index a6bcd72..ccd6a54 100644 (file)
@@ -7415,6 +7415,19 @@ of the current spec.
 The following built-in spec functions are provided:
 
 @table @code
+@item @code{getenv}
+The @code{getenv} spec function takes two arguments: an environment
+variable name and a string.  If the environment variable is not
+defined, a fatal error is issued.  Otherwise, the return value is the
+value of the environment variable concatenated with the string.  For
+example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
+
+@smallexample
+%:getenv(TOPDIR /include)
+@end smallexample
+
+expands to @file{/path/to/top/include}.
+
 @item @code{if-exists}
 The @code{if-exists} spec function takes one argument, an absolute
 pathname to a file.  If the file exists, @code{if-exists} returns the