diff options
author | David Terei <davidterei@gmail.com> | 2013-02-10 23:24:27 -0800 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2013-02-14 04:10:27 +0100 |
commit | 64aaaa19aa32c69a13daa375c8316041a44eed5c (patch) | |
tree | 479c566d09cd6202c68e6267bdf84f98e59309fe /aclocal.m4 | |
parent | 6571f4f110248221fb3fa0ac8e5b2584cb2c5b84 (diff) | |
download | haskell-64aaaa19aa32c69a13daa375c8316041a44eed5c.tar.gz |
Find LLVM tools when version number at end (e.g., llc-3.0) (#7661)
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index eb57cbe8bc..fca030414c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1219,6 +1219,26 @@ AC_SUBST([FindCmd])[]dnl ])# FP_PROG_FIND +# FP_PROG_SORT +# ------------ +# Find a Unix-like sort +AC_DEFUN([FP_PROG_SORT], +[AC_PATH_PROG([fp_prog_sort], [sort]) +echo conwip > conftest.txt +$fp_prog_sort -f conftest.txt > conftest.out 2>&1 +if grep 'conwip' conftest.out > /dev/null 2>&1 ; then + # The goods + SortCmd="$fp_prog_sort" +else + # Summink else..pick next one. + AC_MSG_WARN([$fp_prog_sort looks like a non-*nix sort, ignoring it]) + FP_CHECK_PROG([SortCmd], [sort], [], [], [$fp_prog_sort]) +fi +rm -f conftest.txt conftest.out +AC_SUBST([SortCmd])[]dnl +])# FP_PROG_SORT + + dnl dnl FPTOOLS_NOCACHE_CHECK prints a message, then sets the dnl values of the second argument to the result of running @@ -1960,6 +1980,23 @@ AC_DEFUN([XCODE_VERSION],[ fi ]) +# FIND_LLVM_PROG() +# -------------------------------- +# Find where the llvm tools are. We have a special function to handle when they +# are installed with a version suffix (e.g., llc-3.1). +# +# $1 = the variable to set +# $2 = the with option name +# $3 = the command to look for +# +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]]' | ${SortCmd} -n | tail -1` + fi +]) + # FIND_GCC() # -------------------------------- # Finds where gcc is |