List Info

Thread: Using Environment Variables in Boost.Build JamRoot file




Using Environment Variables in Boost.Build JamRoot file
country flaguser name
United States
2007-05-29 11:57:12

I’m having an issue where I can’t use the Windows Environment variables in the JamRoot file. ; I’m having to do 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

  : C:/3rdparty/boost_1_34_0 ;

 

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:

 

bjam toolset=msvc --verbose-test test

Jamroot:8: in modules.load

*** argument error

* rule use-project ( id : where )

* called with: ( boost :  )

* missing argument where

C:/3rdparty/boost_1_34_0/tools/build/v2/buildproject.jam:951:see definition of

rule 'use-project' being called

C:/3rdparty/boost_1_34_0/tools/build/v2/buildproject.jam:312: in load-jamfile

C:/3rdparty/boost_1_34_0/tools/build/v2/buildproject.jam:68: in load

C:/3rdparty/boost_1_34_0/tools/build/v2/buildproject.jam:170: in project.find

C:/3rdparty/boost_1_34_0/tools/build/v2build-system.jam:237: in load

C:3rdpartyboost_1_34_0toolsbuildv2/kernelmodules.jam:261: in import

C:3rdpartyboost_1_34_0toolsbuildv2/kernel/bootstrap.jam:132: in boost-build

 

E:quicktestboost-build.jam:7: in module scope

 

My boost-build.jam seems to take the environment variable with no issue.  I do this:

 

# Copyright David Abrahams 2006. Distributed under the Boost

# Software License, Version 1.0. (See accompanying

# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

 

# Edit this path to point at the tools/build/v2 subdirectory of your

# Boost installation.  Absolute paths work, too.

boost-build $BOOST_ROOT/tools/build/v2 ;

 

 

Any ideas?

 

Thanks in advance,

 

Lawrence

Re: Using Environment Variables in Boost.Build JamRoot file
country flaguser name
Germany
2007-05-29 14:02:19
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

http://boost.org/boost-build2/doc/html/bbv2/faq/envar.
html

> 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,

Yours,

Jürgen

-- 
* 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.hunoldivembh.de        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens:
Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover,
HRB 56965
* PD Dr.-Ing. Alfons Radtke       !





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Re: Using Environment Variables in Boost.BuildJamRoot file
country flaguser name
United States
2007-05-29 14: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,

Lawrence

-----Original Message-----
From: boost-build-bounceslists.boost.org
[mailto:boost-build-bounceslists.boost.org] 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

http://boost.org/boost-build2/doc/html/bbv2/faq/envar.
html

> 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,

Yours,

Jürgen

-- 
* 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.hunoldivembh.de        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens:
Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover,
HRB 56965
* PD Dr.-Ing. Alfons Radtke       !





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Re: Using Environment Variables in Boost.Build JamRoot file
country flaguser name
Germany
2007-05-29 14:02:19
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

http://boost.org/boost-build2/doc/html/bbv2/faq/envar.
html

> 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,

Yours,

Jürgen

-- 
* 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.hunoldivembh.de        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens:
Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover,
HRB 56965
* PD Dr.-Ing. Alfons Radtke       !





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Re: Using Environment Variables in Boost.BuildJamRoot file
country flaguser name
Germany
2007-05-29 14:53:19
Hi Lawrence !

On Dienstag 29 Mai 2007, you wrote:
> 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?

I doubt this ) (B)jam
is definetely unix-centric...

> 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?

You only do have to follow the "recipies" link in
my link.
It is all  document in the fine manual:

http://boost.org/boost-build2/doc/html/bbv2
/recipies/site-config.html

I hope this helps !

Yours,

Jürgen
-- 
* 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.hunoldivembh.de        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens:
Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover,
HRB 56965
* PD Dr.-Ing. Alfons Radtke       !





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )