Boost logo

Boost-Build :

From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2005-05-20 03:22:26


>I hate to be such a pain in the ass but I'm having some trouble using
> the solution:
>
> lib lwsock32 : : <name>wsock32:<os>NT ;
>

You have a typo here. It should be:

lib lwsock32 : : <name>wsock32 <os>NT ;

(Not that this matters for the case).

> that line generates an error on my linux machine:
> "error: "NT" is not a known value of feature <os>"

Right... The problem is that, on each platform, the <os> property has only
one legal value.
This reminds me of a recent discussion of this problem in the list. Volodya:
do you have any plans for this?

> I googled around a bit but couldn't find any instance of the error
> code, and the irc channel is pretty quiet.
>
> Any thoughts, I've already done "import os ;" above it?

One possibility could be:

if [ os.name ] == NT
{
lib lwsock32 : : <name>wsock32 ;
}
else
{
alias lwsock32 ;
}

Regards,

Pedro

> --- In jamboost_at_[hidden], "Pedro Ferreira"
> <pedro.ferreira_at_m...> wrote:
>>
>> ----- Original Message -----
>> From: "jjanzer0" <yahoo_at_l...>
>> To: <jamboost_at_[hidden]>
>> Sent: Thursday, May 19, 2005 6:47 PM
>> Subject: [jamboost] Re: Conditional including library based on
> platform
>>
>>
>> >I have no problem using whatever it needs to get it done, I'm still
>> > learning this system out (I have a lot more experience with GNU's
>> > utils) and just having a hard time in general with the
> documentation.
>> >
>> > I think my problem is that I don't really understand how alias
> will
>> > help me, I've read:
>> > http://boost.sourceforge.net/boost-build2/doc/html
>> > /bbv2/advanced/builtins/targets.html#bbv2.builtins.alias
>> > But it's much more of a general overview.
>> >
>> > Also from the first example you sent you specified the
> conditional on
>> > toolset, but I don't think that's a good approach considering a
>> > windows user might be using the toolset "gcc" instead of something
>> > obvious like msvc.
>>
>> You can select on whatever condition you see fit, e.g.:
>>
>> lib lwsock32 : : <name>wsock32 <os>NT ;
>> alias lwsock32 ;
>>
>> This will use the lib on Windows and nothing elsewhere.
>>
>> Pedro
>>
>>
>> > Perhaps the problem could really be solved by reading
> documentation
>> > but I'm having a hard time finding a good set of docs with
> tutorials
>> > examples etc... for V2.
>> >
>> > Any suggestions or pointers would be greatly appreciated.
>> >
>> > --- In jamboost_at_[hidden], "Pedro Ferreira"
>> > <pedro.ferreira_at_m...> wrote:
>> >> > Ok I think I'm almost there now... I just have one more
> question.
>> > I
>> >> > get an error if lwsock32-name is empty during the call:
>> >> > lib lwsock32 : : <name>$(lwsock32-name) ;
>> >> > "
>> >> > *** argument error
>> >> > * rule object(linking-generator)@2.run ( project name ? :
>> > property-set
>> >> > : sources + : multiple ? )
>> >> > * called with: ( Jamfile</home/zeta/code/lanthera/src/client>
>> > lwsock32
>> >> > : object(property-set)@15 : : )
>> >> > * missing argument sources
>> >> > "
>> >> >
>> >> > if i set the condtion that I test for LINUX to any value it
>> > compiles
>> >> > fine, but I'd prefer not to have any value set... like I want
>> > lwsock32
>> >> > to really just be NULL, does that make sense?
>> >>
>> >> Right... and this is a tricky one: you can't declare a lib that
>> > neither has
>> >> a <name> nor sources. That's why I initially proposed to use an
>> > alias.
>> >> Is there a problem for you to use an alias? We do it here all the
>> > time and
>> >> it works really well.
>> >>
>> >> Pedro
>> >
>> >
>> >
>> >
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>

 


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