[commit: ghc] master: Find LLVM tools when version number at end (e.g., llc-3.0) (#7661) (64aaaa1)

David Terei davidterei at gmail.com
Sat Feb 16 11:28:25 CET 2013

On 15 February 2013 19:03, Ian Lynagh <ian at well-typed.com> wrote:
> On Wed, Feb 13, 2013 at 07:11:11PM -0800, David Terei wrote:
>> +    FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([$1], [$2], [$3])
>> +    if test "$1" == ""; then
>> +        GOOD_PATH=`echo $PATH | tr ':,;' '   '`
> Hmm. I don't think we'll ever have a $PATH containing a path like
> c:/..., but there could certainly be paths containing spaces.

Yes. My mistake, I will fix.

>> +        $1=`${FindCmd} ${GOOD_PATH} -type f -perm +111 -maxdepth 1 -regex '.*/$3-[[0-9]]\.[[0-9]]' | ${SortCmd} -n | tail -1`
> This feels rather unpleasant to me. Is it likely that someone will have
> programs called llc-3.0 etc, but no llc? If not, I'd suggest that we
> just detect llc and they can override which llc gets used with a
> --with-llc flag if they want to.
> In fact, i think we should do that regardless. After all, we don't try
> searching for gcc-4.6 etc either.

So I was a little unsure as well. What convinced me was:

* Debian distros have llvm version specific packages (e.g., llvm-3.0)
that install the tools with a version suffix (llc-3.0) and no generic
one (llc).
* Yes, there is a 'llvm' package, that does install the normal,
un-versioned binaries.
* However, the GHC package has llvm-3.0 as a recommended install right
now, not the llvm package.

We try to detect llc first and only fall back to this new test when
that fails. We could just tell users they should install llvm or use
-with-llc... but this seemed more user friendly to me at very little
cost to us.


> Thanks
> Ian

More information about the ghc-devs mailing list