Boost logo

Boost-Build :

Subject: Re: [Boost-build] Different commands on different platforms?
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-12-02 13:05:29


John Maddock wrote:

> OK, I give up, I have the seeming trivial:
>
> make gs.check : : @check-gs ;
> if $(NT)
> {
> ECHO "Platform is NT" ;
> actions check-gs
> {
> gswin32c -version
> }
> }
> else
> {
> ECHO "Platform is not NT" ;
> actions check-gs
> {
> gs -version
> }
> }
>
> But it always prints "Platform is not NT". What am I doing wrong?
>
> Also tried switching on $(OS) and $(UNIX) but all the builtin variables seem
> to be undefined in the Jamfile :-(

Steven has already provided the solution. The explanation is that in V2,
variables such as NT and OS and UNIX are available in global module, whereas
each Jamfile is a separate module. Helper functions such as os.name is the
best approach for checking the host OS.

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk