Boost logo

Boost-Build :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2004-09-05 22:52:13


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.

Since this could be different for each version of gcc, it seems
that the user-config.jam file should allow something like:

using gcc : VERSION : COMMAND : RPATH ;

where, as now:

VERSION is the version number,
COMMAND is the compiler command

but, in addition:

RPATH is the path to the directory containing libstdc++.so

I've made a partial change to gcc.jam which now has:

rule init ( version ? : command : rpath )
{
local condition = [ common.check-init-parameters gcc : version
$(version) ] ;

local command = [ common.get-invocation-command gcc : g++ :
$(command) ] ;

local rpath = $(rpath) ;

flags gcc CONFIG_COMMAND $(condition) : $(command) ;
}

and the output from bjam --v2 -d5 shows:

/home/evansl/prog_dev/boost-snapshot/boost-04-08-25-1800/tools/build/v2/tools/gcc.jam:35:>>>>|>>>>|>>>>
local command = /usr/local/gcc-3.4.1/bin/g++
/home/evansl/prog_dev/boost-snapshot/boost-04-08-25-1800/tools/build/v2/tools/gcc.jam:37:>>>>|>>>>|>>>>
local rpath = /usr/local/gcc-3.4.1/lib

so at least the right value is being passed to the init rule.
However, before I go any further in figuring out how to do this,
I'd like to know if anyone has a better way to do this?

 


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