* libltdl/config/ltmain.m4sh (func_resolve_sysroot): Partly
revert v2.2.10-83-gc45a288: Do not absolutize path here, only do
sysroot replacement.
(func_mode_link): Adjust.
Fixes AIX testsuite regression.
---

* Paolo Bonzini wrote on Thu, Aug 19, 2010 at 09:40:11AM CEST:
> On 08/19/2010 06:58 AM, Ralf Wildenhues wrote:
> >Why does this function absolutize paths that have nothing to do with
> >sysroot, even in-tree deplib paths?
> >Is there a deeper reason in this?  If yes, there should probably be a
> >test which is fixed by it.
> 
> It's a bug, I think I did it to simplify other places but this was
> wrong as the AIX case shows.  I had the same idea more or less, but
> I didn't have time to make a patch.

Maybe it's as simple as this?  I'm testing this patch now.  Would be
nice if somebody could test it on a sysroot-enabled setup (i.e., where
the sysroot tests don't skip).

I agree that the absolutization issue should probably cleaned up,
but independently of the sysroot feature, and it likely needs a bit
more testsuite exposure, too.

Thanks,
Ralf

 libltdl/config/ltmain.m4sh |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index d29fd5d..a3e8955 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -547,31 +547,16 @@ func_source ()
 
 
 # func_resolve_sysroot PATH
-# Change PATH to an absolute path or replace a leading = with a
-# sysroot.  Store the result into func_resolve_sysroot_result
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
 func_resolve_sysroot ()
 {
   func_resolve_sysroot_result=$1
   case $func_resolve_sysroot_result in
-  [\\/]* | [A-Za-z]:[\\/]*) ;;
   =*)
     func_stripname '=' '' "$func_resolve_sysroot_result"
     func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
     ;;
-  *)
-    if test -d "$1"; then
-      absdir=`cd "$1" && pwd`
-      test -z "$absdir" && \
-        func_fatal_error "cannot determine absolute directory name of \`$dir'"
-      func_resolve_sysroot_result=`cd "$dir" && pwd`
-    else
-      func_dirname_and_basename "$1" "" "."
-      absdir=`cd "$func_dirname_result" && pwd`
-      test -z "$absdir" && \
-        func_fatal_error "cannot determine absolute directory name of 
\`$func_dirname_result'"
-      func_resolve_sysroot_result="$absdir/$func_basename_result"
-    fi
-    ;;
   esac
 }
 
@@ -4440,6 +4425,16 @@ func_mode_link ()
        fi
        func_resolve_sysroot "$func_stripname_result"
        dir=$func_resolve_sysroot_result
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         absdir=`cd "$dir" && pwd`
+         test -z "$absdir" && \
+           func_fatal_error "cannot determine absolute directory name of 
\`$dir'"
+         dir="$absdir"
+         ;;
+       esac
        case "$deplibs " in
        *" -L$dir "* | *" $arg "*)
          # Will only happen for absolute or sysroot arguments
-- 
1.7.2.rc3.47.g996ce


Reply via email to