]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Added LD path canonicalization.
authorGary V. Vaughan <gary@gnu.org>
Fri, 27 Nov 1998 16:52:37 +0000 (16:52 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 27 Nov 1998 16:52:37 +0000 (16:52 +0000)
ChangeLog
libtool.m4
ltconfig.in

index a14f7353655fd164875d44b3001714d54c6edee0..0ae69fb7f047233e6d1056ac2359a9d339a7a798 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 1998-11-27  Gary V. Vaughan  <garyv@oranda.demon.co.uk>
 
+       * libtool.m4 (AM_PROG_LD): Cannonicalize the absolute path for the
+       ld program;  The order is funny to provide canonicalization to
+       paths with '\\' separators as well as '/'.
+       * ltconfig.in: ditto.
+
        * AUTHORS: Added myself as a co-maintainer.
 
        * ltconfig.in (archive_cmds): The `;\' in a compound statement is
index 09cba0c6a9e954b0081322a2150233ce7ed1bf9e..0e058d28fa1a489b76d9c768aecd10514f2b578b 100644 (file)
@@ -189,12 +189,50 @@ if test "$ac_cv_prog_gcc" = yes; then
   AC_MSG_CHECKING([for ld used by GCC])
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
-  # Accept absolute paths.
+    # Accept absolute paths.
 changequote(,)dnl
-  /* | [A-Za-z]:\\*)
+    /* | [A-Za-z]:/*)
+      # Canonicalize the path of ld
+      re_direlt='/[^/]*/\.\./'
+      sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
 changequote([,])dnl
-    test -z "$LD" && LD="$ac_prog"
-    ;;
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%g"`
+      done
+      case "$host_os" in
+      cygwin*)
+        # Convert to a UNC path for cygwin
+        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
+       ;;
+      *)
+        test -z "$LD" && LD="$ac_prog"
+       ;;
+      esac
+      ;;
+    ##
+    ## FIXME:  The code fails later on if we try to use an $LD with
+    ##         '\\' path separators.
+    ##
+changequote(,)dnl
+    [A-Za-z]:[\\]*)
+      # Canonicalize the path of ld
+      re_direlt='\\[^\\]*\\\.\.\(\\\)'
+      sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
+changequote([,])dnl
+      sub_uncdir='s%\\%/%g'
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%g"`
+      done
+      case "$host_os" in
+      cygwin*)
+        # Convert to a UNC path for cygwin
+        test -z "$LD" && LD=`echo X$ac_prog | sed -e 's%^X%%' -e "$sub_uncdrive" -e "$sub_uncdir"`
+       ;;
+      *)
+        test -z "$LD" && LD="$ac_prog"
+       ;;
+      esac
+      ;;
   "")
     # If it fails, then pretend we aren't using GCC.
     ac_prog=ld
index c17fc41b92c6a053ca53f6e8a6b658871eb398f4..0ad5f3faa7163f0ca4be8bf152055a6a583b09fa 100755 (executable)
@@ -867,8 +867,44 @@ if test -z "$LD"; then
     ac_prog=`($CC -print-prog-name=ld) 2>&5`
     case "$ac_prog" in
     # Accept absolute paths.
-    /* | [A-Za-z]:[/\\]*)
-      test -z "$LD" && LD="$ac_prog"
+    /* | [A-Za-z]:/*)
+      re_direlt='/[^/]*/\.\./'
+      sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
+      # Canonicalize the path of ld
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%g"`
+      done
+      case "$host_os" in
+      cygwin*)
+        # Convert to a UNC path for cygwin
+        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
+       ;;
+      *)
+        test -z "$LD" && LD="$ac_prog"
+       ;;
+      esac
+      ;;
+    ##
+    ## FIXME:  The code fails later on if we try to use an $LD with
+    ##         '\\' path separators.
+    ##
+    [A-Za-z]:[\\]*)
+      re_direlt='\\[^\\]*\\\.\.\(\\\)'
+      sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
+      sub_uncdir='s%\\%/%g'
+      # Canonicalize the path of ld
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%g"`
+      done
+      case "$host_os" in
+      cygwin*)
+        # Convert to a UNC path for cygwin
+        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"`
+       ;;
+      *)
+        test -z "$LD" && LD="$ac_prog"
+       ;;
+      esac
       ;;
     "")
       # If it fails, then pretend we are not using GCC.