configure : LLVM and LD detections improvements (#10234).

Authored by erikd.

Description

configure : LLVM and LD detections improvements (Trac #10234).

  • distrib/configure.ac.in : Detect correct version of LLVM tools as was done for the top level configure.ac in 42448e3757.
  • aclocal.m4 : Add a FIND_LD macro that can be used in both configure scripts.
  • Use new FIND_LD macro in both configure scripts.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>

Test Plan: validate on amd64-linux and armhf-linux.

Reviewers: rwbarton, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D828

GHC Trac Issues: Trac #10234