Make glibc header feature tests handle --with-build-sysroot

Joseph S. Myers joseph@codesourcery.com
Fri Mar 9 16:04:00 GMT 2007


gcc/configure checks glibc headers to determine whether the target
glibc has a couple of features affecting the compiler (stack
protection and 128-bit long double support).

The code checking glibc headers fails to allow for
--with-build-sysroot (when the path to the headers at build time isn't
the path the installed compiler will be configured to use).  This
patch fixes this by adding --with-build-sysroot logic in the code
determining glibc_header_dir.

Tested with cross to arm-none-linux-gnueabi.  OK to commit?

2007-03-09  Joseph Myers  <joseph@codesourcery.com>

	* configure.ac (glibc_header_dir): Set using with_build_sysroot if
	defined.
	* configure: Regenerate.

Index: configure
===================================================================
--- configure	(revision 122749)
+++ configure	(working copy)
@@ -16309,6 +16309,8 @@
       if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
 	if test "x$with_sysroot" = x; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+	elif test "x$with_build_sysroot" != "x"; then
+	  glibc_header_dir="${with_build_sysroot}/usr/include"
 	elif test "x$with_sysroot" = xyes; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
 	else
@@ -16463,6 +16465,8 @@
       if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
 	if test "x$with_sysroot" = x; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+	elif test "x$with_build_sysroot" != "x"; then
+	  glibc_header_dir="${with_build_sysroot}/usr/include"
 	elif test "x$with_sysroot" = xyes; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
 	else
Index: configure.ac
===================================================================
--- configure.ac	(revision 122749)
+++ configure.ac	(working copy)
@@ -3324,6 +3324,8 @@
       if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
 	if test "x$with_sysroot" = x; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+	elif test "x$with_build_sysroot" != "x"; then
+	  glibc_header_dir="${with_build_sysroot}/usr/include"
 	elif test "x$with_sysroot" = xyes; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
 	else
@@ -3375,6 +3377,8 @@
       if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
 	if test "x$with_sysroot" = x; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+	elif test "x$with_build_sysroot" != "x"; then
+	  glibc_header_dir="${with_build_sysroot}/usr/include"
 	elif test "x$with_sysroot" = xyes; then
 	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
 	else

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list