123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- dnl Copyright (C) 1996-2003, 2009-2017 Free Software Foundation, Inc.
- dnl This file is free software; the Free Software Foundation
- dnl gives unlimited permission to copy and/or distribute it,
- dnl with or without modifications, as long as this notice is preserved.
- dnl Subroutines of libtool.m4,
- dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
- dnl collision with libtool.m4.
- dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
- AC_DEFUN([AC_LIB_PROG_LD_GNU],
- [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
- [
- case `$LD -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- acl_cv_prog_gnu_ld=yes
- ;;
- *)
- acl_cv_prog_gnu_ld=no
- ;;
- esac])
- with_gnu_ld=$acl_cv_prog_gnu_ld
- ])
- dnl From libtool-2.4. Sets the variable LD.
- AC_DEFUN([AC_LIB_PROG_LD],
- [AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])dnl
- AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld [default=no]])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
- if test "${PATH_SEPARATOR+set}" != set; then
-
-
-
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
- && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
- || PATH_SEPARATOR=';'
- }
- fi
- ac_prog=ld
- if test "$GCC" = yes; then
-
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
-
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
-
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
-
- ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
- while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
-
- ac_prog=ld
- ;;
- *)
-
- with_gnu_ld=unknown
- ;;
- esac
- elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
- else
- AC_MSG_CHECKING([for non-GNU ld])
- fi
- AC_CACHE_VAL([acl_cv_path_LD],
- [if test -z "$LD"; then
- acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$acl_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
-
-
-
- case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$acl_save_ifs"
- else
- acl_cv_path_LD="$LD"
- fi])
- LD="$acl_cv_path_LD"
- if test -n "$LD"; then
- AC_MSG_RESULT([$LD])
- else
- AC_MSG_RESULT([no])
- fi
- test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
- AC_LIB_PROG_LD_GNU
- ])
|