This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC 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 integrable-solutions dot net>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, Carlos O'Donell <carlos at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Jun 2006 09:58:52 -0700
- Subject: Re: Default installation directory for include files when cross compiling
- References: <4493395E.6030009@codesourcery.com> <87d5d8k72x.fsf@soliton.cs.tamu.edu> <449343AD.3020303@codesourcery.com> <44934719.2080809@codesourcery.com> <Pine.GSO.4.58.0606161924000.27010@sun> <44935009.3050600@codesourcery.com> <Pine.GSO.4.58.0606161951170.27010@sun> <4493537C.3000504@codesourcery.com> <Pine.GSO.4.58.0606161958550.27010@sun> <449776A5.1030200@codesourcery.com> <m364ivrhzb.fsf@uniton.integrable-solutions.net>
Gabriel Dos Reis wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
>
> | Gabriel Dos Reis wrote:
> |
> | > | Does that mean that you would approve a patch to adjust the default for
> | > | cross builds?
> | >
> | > Yes.
> | >
> | > I was concerned you wanted to change the default uniformly,
> | > e.g. whether native or not. You have clarified it would be only for
> | > cross-compile.
> |
> | Here is a patch to implement this change. (Unfortunately, one has to
> | make this change in two places; perhaps, in future, there should be a
> | driver -print-libstdc++-include option, or some such.)
> |
> | Gaby, is this patch OK?
>
> Hmm, I believe the actual patch is missing...
Indeed.
Apologies,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
2006-06-19 Mark Mitchell <mark@codesourcery.com>
* acinclude.m4 (GLIBCXX_EXPORT_INSTALL_INFO): When
cross-compiling, put headers in $prefix/$target/include/c++.
* configure: Regenerated.
2006-06-19 Mark Mitchell <mark@codesourcery.com>
* configure.ac: Set gcc_gxx_include_dir to $target/include/c++
when cross-compiling. Do not substitute libstdcxx_incdir.
* configure: Regenerated.
Index: libstdc++-v3/acinclude.m4
===================================================================
--- libstdc++-v3/acinclude.m4 (revision 114623)
+++ libstdc++-v3/acinclude.m4 (working copy)
@@ -666,6 +666,7 @@ dnl
dnl Assumes cross_compiling bits already done, and with_cross_host in
dnl particular.
dnl
+dnl This logic must match gcc/configure.ac's setting of gcc_gxx_include_dir.
AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO], [
glibcxx_toolexecdir=no
glibcxx_toolexeclibdir=no
@@ -697,7 +698,13 @@ AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO],
# 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}'
+ gxx_include_dir='include/c++/${gcc_version}'
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ gxx_include_dir='${prefix}/${target_alias}/'"$gxx_include_dir"
+ else
+ gxx_include_dir='${prefix}/'"$gxx_include_dir"
+ fi
fi
# Version-specific runtime libs processing.
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 114623)
+++ gcc/configure.ac (working copy)
@@ -132,13 +132,17 @@ no) ;;
*) gcc_gxx_include_dir=$with_gxx_include_dir ;;
esac])
+# This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO.
if test x${gcc_gxx_include_dir} = x; then
if test x${enable_version_specific_runtime_libs} = xyes; then
gcc_gxx_include_dir='${libsubdir}/include/c++'
else
- libstdcxx_incdir='c++/$(version)'
+ libstdcxx_incdir='include/c++/$(version)'
+ if test x$host != x$target; then
+ libstdcxx_incdir="$target_alias/$libstdcxx_incdir"
+ fi
changequote(<<, >>)dnl
- gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
+ gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/$libstdcxx_incdir"
changequote([, ])dnl
fi
fi
@@ -3446,7 +3450,6 @@ AC_SUBST(extra_programs)
AC_SUBST(float_h_file)
AC_SUBST(gcc_config_arguments)
AC_SUBST(gcc_gxx_include_dir)
-AC_SUBST(libstdcxx_incdir)
AC_SUBST(host_exeext)
AC_SUBST(host_xm_file_list)
AC_SUBST(host_xm_include_list)