gcc 2.96: g++ cross-compiler uses ${prefix}/include

Maciej W. Rozycki macro@ds2.pg.gda.pl
Tue Jun 6 10:36:00 GMT 2000


Hello,

 The preprocessor when invoked by g++ in a cross-compiling environment
accesses ${prefix}/include for library headers.  This is inconsistent with
gcc and it also makes hosting more than a one compiler on a single host
difficult.  The following patchmakes the preprocessor search ${tooldir}
instead.

Tue Jun  6 17:19:08 2000  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>

	* configure.in (gxx_include_dir): Use
	${prefix}/'${target_subdir}'/include/g++'-${libstdcxx_interface}
	instead of ${prefix}/include/g++'-${libstdcxx_interface} for a
	cross-compiler.

Tue Jun  6 17:19:08 2000  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>

	* configure.in (gcc_gxx_include_dir): Use
	.../\$(target_subdir)include/g++-${libstdcxx_interface} instead of
	.../include/g++-${libstdcxx_interface}.
	(target_subdir): Use ${target_alias}/ instead of ${target}/.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

diff -u --recursive --new-file gcc-2.95.2.macro/configure.in gcc-2.95.2/configure.in
--- gcc-2.95.2.macro/configure.in	Tue Jun 22 22:44:40 1999
+++ gcc-2.95.2/configure.in	Sun Feb 13 04:49:00 2000
@@ -1107,7 +1107,11 @@
     gxx_include_dir='${libsubdir}/include/g++'
   else
     . ${topsrcdir}/config.if
-    gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
+    if [ x${is_cross_compiler} = xno ]; then
+      gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
+    else
+      gxx_include_dir='${prefix}/'${target_subdir}'/include/g++'-${libstdcxx_interface}
+    fi
   fi
 else
   gxx_include_dir=${gxx_include_dir}
diff -u --recursive --new-file gcc-2.95.2.macro/gcc/configure.in gcc-2.95.2/gcc/configure.in
--- gcc-2.95.2.macro/gcc/configure.in	Wed Oct 13 07:58:02 1999
+++ gcc-2.95.2/gcc/configure.in	Sun Feb 13 04:35:53 2000
@@ -169,7 +169,7 @@
   else
     topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
 changequote(<<, >>)dnl
-    gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/g++"-${libstdcxx_interface}
+    gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/\$(target_subdir)include/g++"-${libstdcxx_interface}
 changequote([, ])dnl
   fi
 fi
@@ -4267,7 +4267,7 @@
 host_canonical=${host}
 target_subdir=
 if test "${host}" != "${target}" ; then
-    target_subdir=${target}/
+    target_subdir=${target_alias}/
 fi
 AC_SUBST(build_canonical)
 AC_SUBST(host_canonical)



More information about the Gcc-patches mailing list