views:

129

answers:

2

I need to pass -Wl,-rpath,\$$ORIGIN/lib/ to g++'s linker (reason). Is there a way to pass this argument in Jamroot file?

A: 

To modify linkflags, use approximately:

using gcc : : : <linkflags>"-Wl,-rpath,\\$ORIGIN/lb" ;

Source: RTFM

Ivan Vučica
+1  A: 

Ivan Vucica already described how to do it by modifying the toolset. Another option is to add it to the properties of the project. At the top of your Jamroot, add the following rule (or modify a pre-existing project rule).

project
  : requirements
      <toolset>gcc:<linkflags>"-Wl,-rpath,\\$ORIGIN/lib"
  ;

This will only affect gcc on this project, and works even if the current using gcc ; command is called from outside Jamroot (as in Ubuntu's default configuration).

There might be a better way by somehow modifying the python-for-extensions alias that Boost.Build links against when calling python-extension, but I'm not sure how to do it, or even if it can be done.

AFoglia