Boost logo

Boost-Build :

From: Mike Glazer (mglazer_at_[hidden])
Date: 2005-07-19 11:46:13


Does:

if $(OS) = "LINUX"
{
lib required_system_library : : <name>greatlib ;
}
else if $(OS) = "MACOSX"
{
lib required_system_library : : <name>greatlib_xy ;
}

Work? Bear in mind that I have declared a variable named $(OS)
earlier in my Jamfile you'll have to do the same (modules.peek works for this).

I use a similar method in my jamfile but mine is used to exclude
a library on certain platforms.

hamletclaud wrote:

>Hi Pedro,
>
>--- In jamboost_at_[hidden], "Pedro Ferreira"
><pedro.ferreira_at_m...> wrote:
>
>
>>you can do something like:
>>
>>lib required_system_library : : <name>greatlib <os>LINUX ;
>>lib required_system_library : : <name>greatlib_xy <os>MACOSX ;
>>
>>exe final_exe : source1.cpp required_system_library ;
>>
>>
>
>Thanks for your help and the quick answer!
>
>Unfortunately, this approach doesn't seem to work. Under MacOSX bjam
>gives the following error message:
>
>----------
>[...]/boost-build/build/feature.jam:431: in
>feature.validate-value-string from module feature
>error: "LINUX" is not a known value of feature <os>
>error: legal values: "MACOSX"
>[...]
>----------
>
>Under Linux the error message is the same, just LINUX and MACOSX are
>exchanged. Obviously, <os> can only carry the value of the real host
>OS --- which is somewhat strange.
>
>I use boost-build-2.0-m10.
>
>Any idea?
>
>
>
>>----- Original Message -----
>>From: "hamletclaud" <hamletclaud_at_y...>
>>To: <jamboost_at_[hidden]>
>>Sent: Tuesday, July 19, 2005 2:50 PM
>>Subject: [jamboost] [V2] Choosing library names depending on the OS
>>
>>
>>
>>
>>>Hi!
>>>
>>>Relates to: Boost Build V2
>>>
>>>I have an executable which as one of its sources uses a system
>>>library, so:
>>>
>>>------
>>>lib required_system_library
>>> :
>>> : <name>greatlib
>>>;
>>>
>>>exe final_exe :
>>> source1.cpp
>>>
>>> required_system_library
>>>;
>>>--------
>>>
>>>However, the system library has different names under Linux and
>>>Darwin. I would thus like to choose the library name (say, "greatlib"
>>>for Linux, but "greatlib_xy" for Darwin) depending on the OS, much as
>>>I can easily do for variants, optimization and other factors.
>>>This must be trivial, but in my stupidity I can't find the solution in
>>>the documentation nor in the jam source.
>>>
>>>Many thanks in advance!
>>>
>>>Claudius
>>>
>>>
>>>
>>>
>>>
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>

-- 
_________________________________________ 
/ Mike Glazer Development Intern CDL \
| Systems Ltd. Phone: 289-1733 ext. 256 |
| e-mail: mglazer_at_[hidden] Address: |
| Suite 220, 3553 - 31 Street NW Calgary, |
\ AB T2L 2K7 /
----------------------------------------- 
\
\ (__) 
o o\ 
('') \--------- 
\ \ 
| |\ 
||---( )_|| * 
|| UU || 
== == 
 

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