blob: 1bd95980c07ad2b8d30e99f832bb4ca827597017 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Upstream-Status: Pending
2
3This patch updates libtool.m4 (and its output) to resolve a problem
4with variable 'lt_sysroot' not being properly updated if the option
5'--with[-libtool]-sysroot' is not provided when running the 'configure'
6script for a package.
7
8I have also reported the problem to libtool here
9
10http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html
11
12Signed-off-by: Hans Beckerus <hans.beckerus at gmail.com>
13Updated by: Robert Yang <liezhi.yang@windriver.com>
14---
15diff --git a/m4/libtool.m4 b/m4/libtool.m4
16--- a/m4/libtool.m4
17+++ b/m4/libtool.m4
18@@ -1225,16 +1225,21 @@ dnl lt_sysroot will always be passed unquoted. We quote it here
19 dnl in case the user passed a directory name.
20 lt_sysroot=
21 case $with_libtool_sysroot in #(
22- yes)
23+ no)
24 if test yes = "$GCC"; then
25 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
26+ # Treat "/" the same a an unset sysroot. It seems to be more
27+ # compatible across host platforms that way!?
28+ if test "$lt_sysroot" = /; then
29+ lt_sysroot=
30+ fi
31 fi
32 ;; #(
33+ yes|''|/)
34+ ;; #(
35 /*)
36 lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
37 ;; #(
38- no|'')
39- ;; #(
40 *)
41 AC_MSG_RESULT([$with_libtool_sysroot])
42 AC_MSG_ERROR([The sysroot must be an absolute path.])