[commit: ghc] master: Better handling of find llvm tools. Use IFS as opposed to more hacky tr (355002c)

David Terei davidterei at gmail.com
Wed Feb 20 13:07:24 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/355002c40254f27bb5ca817d7d2664fa58e9640c

>---------------------------------------------------------------

commit 355002c40254f27bb5ca817d7d2664fa58e9640c
Author: David Terei <davidterei at gmail.com>
Date:   Wed Feb 20 04:05:50 2013 -0800

    Better handling of find llvm tools. Use IFS as opposed to more hacky tr
    approach. This way can handle spaces in paths.

>---------------------------------------------------------------

 aclocal.m4 |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index deedafe..b38418b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1963,9 +1963,16 @@ AC_DEFUN([XCODE_VERSION],[
 #
 AC_DEFUN([FIND_LLVM_PROG],[
     FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([$1], [$2], [$3])
-    if test "$$1" == ""; then
-        GOOD_PATH=`echo $PATH | tr ':,;' '   '`
-        $1=`${FindCmd} ${GOOD_PATH} -type f -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' -or -type l -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' | ${SortCmd} -n | tail -1`
+    if test "$$1" != ""; then
+        save_IFS=$IFS
+        IFS=":;"
+        for p in ${PATH}; do
+            $1=`${FindCmd} ${p} -type f -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' -or -type l -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' | ${SortCmd} -n | tail -1`
+            if test -n "${LLC}"; then
+                break
+            fi
+        done
+        IFS=$save_IFS
     fi
 ])
 





More information about the ghc-commits mailing list