Added LD path canonicalization.

This commit is contained in:
Gary V. Vaughan 1998-11-27 16:52:37 +00:00
parent 2a86145cbf
commit 0e672b6be3
3 changed files with 85 additions and 6 deletions

View File

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

46
libtool.m4 vendored
View 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

View File

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