===================================================================
@@ -759,6 +759,7 @@ CONFIGURE_SPECS
CROSS_SYSTEM_HEADER_DIR
TARGET_SYSTEM_ROOT_DEFINE
TARGET_SYSTEM_ROOT
+SYSROOT_CFLAGS_FOR_TARGET
RUNTIME_ROOT_PREFIX_DEFINE
NATIVE_SYSTEM_HEADER_DIR
enable_shared
@@ -1654,7 +1655,7 @@ Optional Packages:
prepend prefix to paths used by the compiler to
name the dynamic linker and other files used at
runtime. Defaults to empty (no prefix).
- --with-build-sysroot=sysroot
+ --with-build-sysroot=SYSROOT
use sysroot as the system root during the build
--with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR.
--with-specs=SPECS add SPECS to driver command-line processing
@@ -7109,11 +7110,16 @@ fi
# Check whether --with-build-sysroot was given.
if test "${with_build_sysroot+set}" = set; then :
- withval=$with_build_sysroot;
+ withval=$with_build_sysroot; if test x"$withval" != x ; then
+ SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
+ fi
+else
+ SYSROOT_CFLAGS_FOR_TARGET=
fi
+
# Check whether --with-sysroot was given.
if test "${with_sysroot+set}" = set; then :
withval=$with_sysroot;
@@ -17562,7 +17568,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17565 "configure"
+#line 17571 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17668,7 +17674,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17671 "configure"
+#line 17677 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
===================================================================
@@ -741,9 +741,14 @@ AC_ARG_WITH([runtime-root-prefix],
], [RUNTIME_ROOT_PREFIX_DEFINE=""])
AC_SUBST(RUNTIME_ROOT_PREFIX_DEFINE)
-AC_ARG_WITH(build-sysroot,
- [ --with-build-sysroot=sysroot
- use sysroot as the system root during the build])
+AC_ARG_WITH([build-sysroot],
+ [ --with-build-sysroot=SYSROOT
+ use sysroot as the system root during the build],
+ [if test x"$withval" != x ; then
+ SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
+ fi],
+ [SYSROOT_CFLAGS_FOR_TARGET=])
+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
AC_ARG_WITH(sysroot,
[ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
===================================================================
@@ -371,7 +371,8 @@ UNWIND_H = $(srcdir)/unwind-generic.h
# The GCC to use for compiling crt*.o.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES).
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $(shell $(PWD_COMMAND))/xgcc $(SYSROOT_CFLAGS_FOR_TARGET) -B$(shell ($PWD_COMMAND))/ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It specifies -B./.
@@ -4843,6 +4844,7 @@ site.exp: ./config.status Makefile
@echo "set CXXFLAGS \"\"" >> ./tmp0
@echo "set HOSTCC \"$(CC)\"" >> ./tmp0
@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0
+ @echo "set GCC_UNDER_TEST \"$(GCC_FOR_TARGET)\"" >> ./tmp0
# When running the tests we set GCC_EXEC_PREFIX to the install tree so that
# files that have already been installed there will be found. The -B option
# overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files