This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: interesting questions without answers about libraries
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: JoÃo Carlos Mar tins <ttilt at k2sistemas dot com dot br>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 02 Jun 2004 16:30:39 -0400
- Subject: Re: interesting questions without answers about libraries
- References: <40BDF856.9000603@k2sistemas.com.br>
JoÃo Carlos Martins <ttilt@k2sistemas.com.br> writes:
> I searched for this question in the mailing lists but found no
> answers, so I'm sending this e-mail.
>
> Q1) how can I build only the C/C++ libraries that comes with the
> compiler source and not the whole compiler (support libraries, libgcc
> etc)?
It may work to delete the gcc directory from your sources, and then
compile. Naturally you will need an appropriate version of gcc on
your PATH. I haven't tried this for several years, but it did work in
the past.
> Optionally, how can i build them to be static and not shared?
Use --disable-shared when you run configure.
> Q2) Suppose I install a new version of gcc. ItÂs installed in the
> default prefix (/usr/local) and I want to use that version instead of
> the default older version in prefix /usr. I set an environment var
> like 'export GCC=/usr/local/bin/gcc' and use that in my makefiles. The
> question is, will the C/C++ shared libraries used be the ones that
> came w/ this new compiler, which are located in /usr/local/lib or the
> system default ones in /usr/lib? What if I use -L/usr/local/lib, will
> that override the use of the default libraries?
At link time gcc should normally pick up the libstdc++ with which it
was installed.
At run time it depends upon whether you pass a -R option, and/or set
LD_LIBRARY_PATH.
Ian