diff options
Diffstat (limited to 'contrib/llvm/autoconf/m4/link_options.m4')
-rw-r--r-- | contrib/llvm/autoconf/m4/link_options.m4 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/llvm/autoconf/m4/link_options.m4 b/contrib/llvm/autoconf/m4/link_options.m4 index b48710c..4c5f2f4 100644 --- a/contrib/llvm/autoconf/m4/link_options.m4 +++ b/contrib/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. |