On 11/15/2012 10:36 PM, Ian Lance Taylor wrote:
On Thu, Nov 15, 2012 at 8:14 PM, Tim Schumacher <schumact@xxxxxxxxx> wrote:
I am using Fedora linux. I would like to build a gcc-4.7.2 with additional
"system paths". Meaning, I have an installation of the Boost C++ libraries
installed at /usr/local/boost-1.52.0 and I would like to build a gcc that
treats the boost include and lib dirs as system paths so that I don't have
to specify -I and -L on all command lines compiling programs that use boost.
I'm guessing there is some easy way to do this at configure time for GCC? I
guess one way would be to re-build the boost libraries with the new compiler
and specify the same --prefix that I used for the GCC tools. Any thoughts
on this would be greatly appreciated!
You could use a shell script to pass the options you want. You could
set the environment variables CPLUS_INCLUDE_PATH and LIBRARY_PATH when
running the compiler. I don't think there is any simple way to add
directories when building GCC itself, though.
Ian
OK, I can write a wrapper script that does what I want.
I also had this pretty crazy idea. Would the following work?
I build boost with the new gcc I just built, and the same --prefix I
used for the gcc. Now all the includes and libraries (only static in my
case) are placed where gcc can find them. Next ... drum roll ... I
unpack all the static boost libraries and also the lidstdc++.a file and
re-archive all the resulting .o files back into libstdc++.a. Now all
the boost objects are magically available whenever I compile any c++
program.
Is that crazy enough to work?
Thanks again!
Tim