summaryrefslogtreecommitdiff
path: root/doc/html/bbv2/faq/envar.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/bbv2/faq/envar.html')
-rw-r--r--doc/html/bbv2/faq/envar.html72
1 files changed, 72 insertions, 0 deletions
diff --git a/doc/html/bbv2/faq/envar.html b/doc/html/bbv2/faq/envar.html
new file mode 100644
index 0000000000..406b531754
--- /dev/null
+++ b/doc/html/bbv2/faq/envar.html
@@ -0,0 +1,72 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>
+ Accessing environment variables
+ </title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+<style type="text/css">
+body { background-image: url('http://docbook.sourceforge.net/release/images/draft.png');
+ background-repeat: no-repeat;
+ background-position: top left;
+ /* The following properties make the watermark "fixed" on the page. */
+ /* I think that's just a bit too distracting for the reader... */
+ /* background-attachment: fixed; */
+ /* background-position: center center; */
+ }</style>
+<link rel="start" href="../../index.html" title="The Boost C++ Libraries">
+<link rel="up" href="../faq.html" title="Chapter 27. Frequently Asked Questions">
+<link rel="prev" href="../faq.html" title="Chapter 27. Frequently Asked Questions">
+<link rel="next" href="s03.html" title="
+ How to control properties order?
+ ">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%">
+<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center"><a href="../../../../index.htm">Home</a></td>
+<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="../../../../people/people.htm">People</a></td>
+<td align="center"><a href="../../../../more/faq.htm">FAQ</a></td>
+<td align="center"><a href="../../../../more/index.htm">More</a></td>
+</table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../faq.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s03.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="bbv2.faq.envar"></a>
+ Accessing environment variables
+ </h2></div></div></div>
+<p>
+ Many users would like to use environment variables in Jamfiles, for
+ example, to control location of external libraries. In many cases you
+ better declare those external libraries in the site-config.jam file, as
+ documented in the <a href="../recipies/site-config.html" title="Targets in site-config.jam">recipes
+ section</a>. However, if the users already have the environment variables set
+ up, it's not convenient to ask them to set up site-config.jam files as
+ well, and using environment variables might be reasonable.
+ </p>
+<p>In Boost.Build V2, each Jamfile is a separate namespace, and the
+ variables defined in environment is imported into the global
+ namespace. Therefore, to access environment variable from Jamfile, you'd
+ need the following code:
+</p>
+<pre class="programlisting">
+import modules ;
+local SOME_LIBRARY_PATH = [ modules.peek : SOME_LIBRARY_PATH ] ;
+exe a : a.cpp : &lt;include&gt;$(SOME_LIBRARY_PATH) ;
+</pre>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><small></small></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../faq.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s03.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>