diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-08-11 23:53:59 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-08-11 23:53:59 +0000 |
| commit | b524afbae34be02746318009209e80f26189d6aa (patch) | |
| tree | a39ecd808617020117b1aa5f01d1ac816f7b1e4c /llvm/autoconf/m4 | |
| parent | 2ded5d25a9d4b718b249f29aa06d34fe2101e91c (diff) | |
| download | bcm5719-llvm-b524afbae34be02746318009209e80f26189d6aa.tar.gz bcm5719-llvm-b524afbae34be02746318009209e80f26189d6aa.zip | |
configure: Add detection of the linker version string.
- Review appreciated, as long as you understand that I understand that this is
a horrible hack.
llvm-svn: 110883
Diffstat (limited to 'llvm/autoconf/m4')
| -rw-r--r-- | llvm/autoconf/m4/link_options.m4 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/autoconf/m4/link_options.m4 b/llvm/autoconf/m4/link_options.m4 index b48710c094d..4c5f2f435d0 100644 --- a/llvm/autoconf/m4/link_options.m4 +++ b/llvm/autoconf/m4/link_options.m4 @@ -1,4 +1,25 @@ # +# Get the linker version string. +# +# This macro is specific to LLVM. +# +AC_DEFUN([AC_LINK_GET_VERSION], + [AC_CACHE_CHECK([for linker version],[llvm_cv_link_version], + [ + version_string="$(ld -v 2>&1 | head -1)" + + # Check for ld64. + if (echo "$version_string" | grep -q "ld64"); then + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#") + else + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#") + fi + ]) + AC_DEFINE_UNQUOTED([HOST_LINK_VERSION],"$llvm_cv_link_version", + [Linker version detected at compile time.]) +]) + +# # Determine if the system can handle the -R option being passed to the linker. # # This macro is specific to LLVM. |

