summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2013-02-20 04:05:50 -0800
committerDavid Terei <davidterei@gmail.com>2013-02-20 04:07:12 -0800
commit355002c40254f27bb5ca817d7d2664fa58e9640c (patch)
tree0ee54e78ed1b891b9fb2f267e118448587b4fa8d /aclocal.m4
parentf469eff89a69580b37fc1b1c5b99a0f9075dcd67 (diff)
downloadhaskell-355002c40254f27bb5ca817d7d2664fa58e9640c.tar.gz
Better handling of find llvm tools. Use IFS as opposed to more hacky tr
approach. This way can handle spaces in paths.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m413
1 files changed, 10 insertions, 3 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index deedafe75d..b38418bf06 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
])