Boost logo

Boost-Build :

From: Lawrence Spector (Lawrence.Spector_at_[hidden])
Date: 2007-05-29 15:42:32

Thanks for the quick response. That was definitely helpful. One thing I noticed, after doing this, is that the environment variables are treated as case sensitive when using os.environ. While this makes sense in some contexts, it doesn't in the context of Windows, since Windows is a case insensitive OS. Is there any way to specify a case-insensitive match using os.environ?

Also, I got it working when putting it in my Jamroot. Now, if I want to put it in site-config.jam as you suggested, what other steps are there so that the Jamroot file can use the contents of site-config.jam. I tried putting the import os; and local BOOST_ROOT = [ os.environ BOOST_ROOT ] ; into the site-config file, but my Jamroot file was not able to see the variables. What I gathered from reading is that all jam files have their own namespaces. How do you "export" something into the global namespace then?

Thanks again,


-----Original Message-----
From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Juergen Hunold
Sent: Tuesday, May 29, 2007 3:02 PM
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] Using Environment Variables in Boost.BuildJamRoot file

Hi Lawrence !

On Dienstag 29 Mai 2007, Lawrence Spector wrote:
> I'm having an issue where I can't use the Windows Environment
> variables in the JamRoot file.
> When, in reality, my preference would be this:

> # Specify the path to the Boost project. If you move this project,
> # adjust the path to refer to the Boost root directory.
> use-project boost
> : $(BOOST_ROOT);
> However, when I take the second approach, I get the following errors:

That's because environment variables are not import by default. You have
to explicitly do it. Just put

import os ;
local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
use-project /boost : $(BOOST_ROOT) ;

into your Jamroot. Or put it in user-config.jam or site-config.jam for
all projects :-))

This is explained in the manual at

> My boost-build.jam seems to take the environment variable with no
> issue.

Yes, boost-build.jam behaves differently. It evaluates the environment
to set up the build system. Slightly different magic ;-)) Look at the
docs for the details, please.

> Thanks in advance,

You're welcome.

Hope this helps,



* Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für
* voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH
* fax : ++49 511 262926 99 ! Lister Straße 15
* juergen.hunold_at_[hidden] !
* Geschäftsführer: ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke !

Unsubscribe & other changes:

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at