On 10/21/2010 10:23 PM, Khem Raj wrote:
> toolchain has two options when it comes to sysroot --with-sysroot and
> --with-build-sysroot I think libtool should
> also differentiate between two and set both to same if not explicitly
> set during configure time. I think libtool
> means to use build time sysroot and not runtime sysroot its just that
> configure options are colliding
Yes, for target modules the GCC toplevel should pass
--with-sysroot=$with_build_sysroot, or libtool should learn
about --with-build-sysroot.
Also, libtool should probably ignore --with-sysroot if build==host;
native compilers are never build with a sysroot in practice. This however
would still conflict with GCC when cross-building a native compiler, or
for a sysrooted Canadian cross. The attached patch could be made to work
in this scenario if you can afford using --without-build-sysroot.
Another possibility is to have an environment variable which would
override the command-line options (ick). Then the GCC toplevel can
set it as they wish.
Paolo
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 967dd38..3b7ff61 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1183,19 +1183,21 @@ AC_DEFUN([_LT_WITH_SYSROOT],
AC_ARG_WITH([sysroot],
[ --with-sysroot[=DIR] Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
+[], [with_sysroot=${with_build_sysroot}])
dnl lt_sysroot will always be passed unquoted. We quote it here
dnl in case the user passed a directory name.
lt_sysroot=
case ${with_sysroot} in #(
yes)
- if test "$GCC" = yes; then
+ if test "$GCC" = yes && test "$build" != "$host"; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
/*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ if test "$build" != "$host"; then
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ fi
;; #(
no|'')
;; #(
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool