Strip extraneous information, if present, from the linker version string on
authorCharles Davis <cdavis@mines.edu>
Tue, 28 Feb 2012 02:55:41 +0000 (02:55 +0000)
committerCharles Davis <cdavis@mines.edu>
Tue, 28 Feb 2012 02:55:41 +0000 (02:55 +0000)
Mac OS X. Patch by Fabian Groffen, with a slight tweak by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151612 91177308-0d34-0410-b5e6-96231b3b80d8

autoconf/m4/link_options.m4
configure

index 4c5f2f435d04e3b79b99662715eb147c8b935ea9..57da4a0d926998a1db92b428005b339b2dcb5c9c 100644 (file)
@@ -10,7 +10,7 @@ AC_DEFUN([AC_LINK_GET_VERSION],
 
    # Check for ld64.
    if (echo "$version_string" | grep -q "ld64"); then
-     llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#")
+     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
index 6cd0db887000c93287a1b77526b0024ab4075ca9..848972866e63dc3d23dac2144408379d5deac99e 100755 (executable)
--- a/configure
+++ b/configure
@@ -7783,7 +7783,7 @@ else
 
    # Check for ld64.
    if (echo "$version_string" | grep -q "ld64"); then
-     llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#")
+     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