Ticket #7661: 0001-fix-Find-LLVM-tools-when-version-number-at-end-e.g.-.patch

File 0001-fix-Find-LLVM-tools-when-version-number-at-end-e.g.-.patch, 1.7 KB (added by kgardas, 14 months ago)
  • aclocal.m4

    From 48dbe8a28ed3b9f0a03a699ce94328092a45bd9a Mon Sep 17 00:00:00 2001
    From: Karel Gardas <karel.gardas@centrum.cz>
    Date: Thu, 14 Feb 2013 14:31:09 +0100
    Subject: [PATCH] fix `Find LLVM tools when version number at end (e.g., llc-3.0) (#7661)' to work even for links
    
    This patch fixes small issue in the `Find LLVM tools when version number at end (e.g., llc-3.0) (#7661)'
    patch where one $ was missing on variable evaluation and so the patch was
    not working at all.
    It also makes the patch working for links. That means, for example Ubuntu
    installs LLVM 3.0 package into /usr/lib/llvm-3.0 directory and makes links
    /usr/bin/llc-3.0 and /usr/bin/opt-3.0 linking to appropriate installed
    llc and opt inside the installation directory. Original patch was not
    able to find llc-3.0 and opt-3.0 installed in this way.
    ---
     aclocal.m4 |    7 ++++++-
     1 files changed, 6 insertions(+), 1 deletions(-)
    
    diff --git a/aclocal.m4 b/aclocal.m4
    index 942d6bb..1b85774 100644
    a b AC_DEFUN([XCODE_VERSION],[ 
    19811981# 
    19821982AC_DEFUN([FIND_LLVM_PROG],[ 
    19831983    FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([$1], [$2], [$3]) 
    1984     if test "$1" == ""; then 
     1984    if test "$$1" == ""; then 
    19851985        GOOD_PATH=`echo $PATH | tr ':,;' '   '` 
    19861986        $1=`${FindCmd} ${GOOD_PATH} -type f -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' | ${SortCmd} -n | tail -1` 
    19871987    fi 
     1988    if test "$$1" == ""; then 
     1989        # we've not had a luck with searching for file above (find -type f), let's look for link then 
     1990        GOOD_PATH=`echo $PATH | tr ':,;' '   '` 
     1991        $1=`${FindCmd} ${GOOD_PATH} -type l -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' | ${SortCmd} -n | tail -1` 
     1992    fi 
    19881993]) 
    19891994 
    19901995# FIND_GCC()