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
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
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.