Boost logo

Boost-Build :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2004-09-06 07:42:34


On 09/06/2004 02:15 AM, Vladimir Prus wrote:
> Larry Evans wrote:
>
>>As I mentioned previously here:
>>
>> http://thread.gmane.org/gmane.comp.lib.boost.build/6253
>>
>>on method for doing a shared link with gcc is with the following
>>link flag:
>>
>> -Wl,--rpath -Wl,$(RPATH)
>>
>>where $(RPATH) is the path to the shared library, libstdc++.so.
>
>
> To be more specific, this is only if you don't path to add the path to
> LD_LIBRARY_PATH. I believe that is the right method for making sure system
> libraries are property found, why don't you want to use this method?

Because, so far, I've 2 gcc compilers on my system. I'm guessing
that if the paths to their separate libstdc++.so's are both put
in LD_LIBRARY_PATH, that the first will be selected. Is that
OK? Also, since I'm only using the 2nd gcc compiler for testing
purposes, I don't want to "temporarily" change a "global" variable.

[snip]

> I think using LD_LIBRARY_PATH is the best method. If, for whatever reason,

OK. I'll abandon the idea.

> that's not OK with you, we need to recall what Michael was suggesting: that
> toolset should allow to pass additional compiler and linker options. This is
> more general solution than just RPATH. So, you would write:
>
> using gcc : 3.4 : g++ : : -Wl,--rpath -Wl,whatever ;

Yes. That's better. BTW, I was having trouble understanding how rules
were parsed. For example, the original gcc.init was:

rule init ( version ? : command * ) {...}

I could guess what version ? meant, but initially I though command *
meant command was the trailing elements. Testing indicated that,
I guess, * means don't accept any more arguments.

Is there somewhere the meaning of ? and * in rule formal argument
lists is documented? If so, could you let me know? Also, I was
undertain how to use the rpath value from:

rule init ( version ? : command : rpath ) {...}

to do this:

flags gcc.link OPTIONS <link-runtime>shared : -Wl,--rpath -Wl,$(rpath)

could I just add this right after the:

local rpath = $(rpath) ;

?

TIA.

Regards,
Larry

 


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