mirror of
git://git.savannah.gnu.org/libtool.git
synced 2024-11-21 01:40:57 +08:00
Added LD path canonicalization.
This commit is contained in:
parent
2a86145cbf
commit
0e672b6be3
@ -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
46
libtool.m4
vendored
@ -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
|
||||
|
40
ltconfig.in
40
ltconfig.in
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user