Commit 64aaaa19 authored by dterei's avatar dterei

Find LLVM tools when version number at end (e.g., llc-3.0) (#7661)

parent 6571f4f1
......@@ -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
......
......@@ -39,6 +39,7 @@ dnl ** which are needed by FP_SETUP_PROJECT_VERSION
dnl ** Find find command (for Win32's benefit)
FP_PROG_FIND
FP_PROG_SORT
dnl ----------------------------------------------------------
FP_SETUP_PROJECT_VERSION
......@@ -505,13 +506,13 @@ esac
dnl ** Which LLVM llc to use?
dnl --------------------------------------------------------------
FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([LLC], [llc], [llc])
FIND_LLVM_PROG([LLC], [llc], [llc])
LlcCmd="$LLC"
AC_SUBST([LlcCmd])
dnl ** Which LLVM opt to use?
dnl --------------------------------------------------------------
FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([OPT], [opt], [opt])
FIND_LLVM_PROG([OPT], [opt], [opt])
OptCmd="$OPT"
AC_SUBST([OptCmd])
......@@ -1001,6 +1002,8 @@ echo ["\
which is version : $GccVersion
Building a cross compiler : $CrossCompiling
llc : $LlcCmd
opt : $OptCmd
ld : $LdCmd
Happy : $HappyCmd ($HappyVersion)
Alex : $AlexCmd ($AlexVersion)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment