diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-12-02 21:11:45 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-12-02 21:11:45 +0000 |
commit | 94c459cc7a611211d10773eef526826a8da80456 (patch) | |
tree | 68526f35a4f1d891b05436e0233a85c74dcc7eff /libc/aclocal.m4 | |
parent | 2b19f7c91f9f7c2a7c585cc62b5f3fe75bece1b7 (diff) | |
download | eglibc2-94c459cc7a611211d10773eef526826a8da80456.tar.gz |
Merge changes between r21775 and r21911 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@21912 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/aclocal.m4')
-rw-r--r-- | libc/aclocal.m4 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libc/aclocal.m4 b/libc/aclocal.m4 index b173e9e33..956ea8616 100644 --- a/libc/aclocal.m4 +++ b/libc/aclocal.m4 @@ -213,3 +213,31 @@ AC_DEFUN([ACX_BUGURL],[ AC_SUBST(REPORT_BUGS_TO) AC_SUBST(REPORT_BUGS_TEXI) ]) + +dnl Check linker option support. +dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-false]) +AC_DEFUN([LIBC_LINKER_FEATURE], +[AC_MSG_CHECKING([for linker that supports $1]) +libc_linker_feature=no +if test x"$gnu_ld" = x"yes"; then + libc_linker_check=`$LD -v --help 2>/dev/null | grep "\$1"` + if test -n "$libc_linker_check"; then + cat > conftest.c <<EOF +int _start (void) { return 42; } +EOF + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $2 -nostdlib -nostartfiles + -fPIC -shared -o conftest.so conftest.c + 1>&AS_MESSAGE_LOG_FD]) + then + libc_linker_feature=yes + fi + rm -f conftest* + fi +fi +if test $libc_linker_feature = yes; then + $3 +else + $4 +fi +AC_MSG_RESULT($libc_linker_feature)]) |