This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Default installation directory for include files when cross compiling
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, Carlos O'Donell <carlos at codesourcery dot com>
- Date: Fri, 16 Jun 2006 16:50:05 -0700
- Subject: Re: Default installation directory for include files when cross compiling
- References: <4493395E.6030009@codesourcery.com> <87d5d8k72x.fsf@soliton.cs.tamu.edu>
Gabriel Dos Reis wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
>
> | By default, libstdc++ seems to install include files in $prefix/include,
> | even when cross-compiling.
> |
> | # Default case for install directory for include files.
> |
> | if test $version_specific_libs = no && test $gxx_include_dir = no; then
> | gxx_include_dir='${prefix}/include/c++/${gcc_version}'
> | fi
> |
> | The theory seems to be that these files are target-independent, and so
> | can be shared if multiple targets are installed in one $prefix, from the
> | same sources. But, $prefix/include should be for host include files,
> | not for target include files, so this seems weird if you're only
> | installing a cross compiler, and it clearly breaks if you install a host
> | compiler built from different sources in the same prefix as one of your
> | target compilers.
>
> would not you want to use different $prefix, from host $prefix, for
> different targets?
If each target gets its own prefix, then the current default has no
advantage over my suggestion, other than brevity -- there is no actual
sharing of header files. If you think that the brevity is worthwhile,
then you could also put libstdc++.a into $prefix/lib, rather than
$prefix/$target/lib.a; by hypothesis, there is no possible conflict with
a host libstdc++.a.
However, in practice, one does want to put multiple targets into a
single prefix, and that generally works. That's one reason that cross
compilers are named $target-gcc; it allows multiple target installations
to be overlaid. (Of course, another advantage is that it makes clear
for which target you're compiling.) That's also why we put target
libraries into $prefix/$target/lib. The libstdc++ include files seem to
be unique in that they do not use $target.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713