This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Default installation directory for include files when cross compiling


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]