[Boost-users] [bjam] boost compilation with cxxflags -fPIC

2,225 views
Skip to first unread message

alfC

unread,
Jul 8, 2010, 10:35:19 PM7/8/10
to boost...@lists.boost.org
Hi,

Please, can anybody tell me how to compile Boost (e.g. 1.43) with the
-fPIC as cxxflag:

typicially I do

./bootstrap --prefix=$HOME/usr
./bjam
./bjam install

There are some threads that give answers but in none of them it is
clear exactly what is the command we need to write.

I tried with

CFLAGS=-fPIC ./bjam
./bjam cxxflags=-fPIC

and still the result seems not to use -fPIC

Thank you,
Alfredo
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Vladimir Prus

unread,
Jul 9, 2010, 2:13:22 AM7/9/10
to boost...@lists.boost.org
alfC wrote:

> Hi,
>
> Please, can anybody tell me how to compile Boost (e.g. 1.43) with the
> -fPIC as cxxflag:
>
> typicially I do
>
> ./bootstrap --prefix=$HOME/usr
> ./bjam
> ./bjam install

You don't need to separate invocations. "./bjam install" will just work.



> There are some threads that give answers but in none of them it is
> clear exactly what is the command we need to write.
>
> I tried with
>
> CFLAGS=-fPIC ./bjam
> ./bjam cxxflags=-fPIC

./bjam cxxflags=-fPIC install

should work (if you need installing). You can add -n to see the command
lines. You can add -a to rebuild everything -- necessary if you have
already did a complete build without -fPIC.

Note that this flag will only make sense for static builds, since
shared libraries are built with -fPIC anyway.

- Volodya

Reply all
Reply to author
Forward
0 new messages