| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
AC_DEFUN([AC_LIB_PROG_LD_GNU], |
|---|
| 13 |
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, |
|---|
| 14 |
[ |
|---|
| 15 |
case `$LD -v 2>&1 </dev/null` in |
|---|
| 16 |
*GNU* | *'with BFD'*) |
|---|
| 17 |
acl_cv_prog_gnu_ld=yes ;; |
|---|
| 18 |
*) |
|---|
| 19 |
acl_cv_prog_gnu_ld=no ;; |
|---|
| 20 |
esac]) |
|---|
| 21 |
with_gnu_ld=$acl_cv_prog_gnu_ld |
|---|
| 22 |
]) |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
AC_DEFUN([AC_LIB_PROG_LD], |
|---|
| 26 |
[AC_ARG_WITH(gnu-ld, |
|---|
| 27 |
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
|---|
| 28 |
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
|---|
| 29 |
AC_REQUIRE([AC_PROG_CC]) |
|---|
| 30 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
if test "${PATH_SEPARATOR+set}" != set; then |
|---|
| 34 |
echo " |
|---|
| 35 |
echo "exit 0" >>conf$$.sh |
|---|
| 36 |
chmod +x conf$$.sh |
|---|
| 37 |
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then |
|---|
| 38 |
PATH_SEPARATOR=';' |
|---|
| 39 |
else |
|---|
| 40 |
PATH_SEPARATOR=: |
|---|
| 41 |
fi |
|---|
| 42 |
rm -f conf$$.sh |
|---|
| 43 |
fi |
|---|
| 44 |
ac_prog=ld |
|---|
| 45 |
if test "$GCC" = yes; then |
|---|
| 46 |
|
|---|
| 47 |
AC_MSG_CHECKING([for ld used by GCC]) |
|---|
| 48 |
case $host in |
|---|
| 49 |
*-*-mingw*) |
|---|
| 50 |
|
|---|
| 51 |
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; |
|---|
| 52 |
*) |
|---|
| 53 |
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; |
|---|
| 54 |
esac |
|---|
| 55 |
case $ac_prog in |
|---|
| 56 |
|
|---|
| 57 |
[[\\/]* | [A-Za-z]:[\\/]*)] |
|---|
| 58 |
[re_direlt='/[^/][^/]*/\.\./'] |
|---|
| 59 |
|
|---|
| 60 |
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
|---|
| 61 |
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
|---|
| 62 |
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
|---|
| 63 |
done |
|---|
| 64 |
test -z "$LD" && LD="$ac_prog" |
|---|
| 65 |
;; |
|---|
| 66 |
"") |
|---|
| 67 |
|
|---|
| 68 |
ac_prog=ld |
|---|
| 69 |
;; |
|---|
| 70 |
*) |
|---|
| 71 |
|
|---|
| 72 |
with_gnu_ld=unknown |
|---|
| 73 |
;; |
|---|
| 74 |
esac |
|---|
| 75 |
elif test "$with_gnu_ld" = yes; then |
|---|
| 76 |
AC_MSG_CHECKING([for GNU ld]) |
|---|
| 77 |
else |
|---|
| 78 |
AC_MSG_CHECKING([for non-GNU ld]) |
|---|
| 79 |
fi |
|---|
| 80 |
AC_CACHE_VAL(acl_cv_path_LD, |
|---|
| 81 |
[if test -z "$LD"; then |
|---|
| 82 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
|---|
| 83 |
for ac_dir in $PATH; do |
|---|
| 84 |
test -z "$ac_dir" && ac_dir=. |
|---|
| 85 |
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
|---|
| 86 |
acl_cv_path_LD="$ac_dir/$ac_prog" |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in |
|---|
| 91 |
*GNU* | *'with BFD'*) |
|---|
| 92 |
test "$with_gnu_ld" != no && break ;; |
|---|
| 93 |
*) |
|---|
| 94 |
test "$with_gnu_ld" != yes && break ;; |
|---|
| 95 |
esac |
|---|
| 96 |
fi |
|---|
| 97 |
done |
|---|
| 98 |
IFS="$ac_save_ifs" |
|---|
| 99 |
else |
|---|
| 100 |
acl_cv_path_LD="$LD" |
|---|
| 101 |
fi]) |
|---|
| 102 |
LD="$acl_cv_path_LD" |
|---|
| 103 |
if test -n "$LD"; then |
|---|
| 104 |
AC_MSG_RESULT($LD) |
|---|
| 105 |
else |
|---|
| 106 |
AC_MSG_RESULT(no) |
|---|
| 107 |
fi |
|---|
| 108 |
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
|---|
| 109 |
AC_LIB_PROG_LD_GNU |
|---|
| 110 |
]) |
|---|