X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=autoconf%2Fm4%2Flink_options.m4;h=57da4a0d926998a1db92b428005b339b2dcb5c9c;hb=f6670729aabc1fab85238d2b306a1c1767a807bb;hp=b48710c094d96dbcb5157bb13ebd3ca05c29b3f4;hpb=943005e09482f47619cc1345320df359c6c3021e;p=oota-llvm.git diff --git a/autoconf/m4/link_options.m4 b/autoconf/m4/link_options.m4 index b48710c094d..57da4a0d926 100644 --- a/autoconf/m4/link_options.m4 +++ b/autoconf/m4/link_options.m4 @@ -1,3 +1,24 @@ +# +# 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-\([^ ]*\)\( (.*)\)\{0,1\}#\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. #