Find the target gcc when cross-compiling
authorReid Barton <rwbarton@gmail.com>
Tue, 16 Sep 2014 12:54:43 +0000 (07:54 -0500)
committerAustin Seipp <austin@well-typed.com>
Tue, 16 Sep 2014 12:54:43 +0000 (07:54 -0500)
commitcfd8c7ddcdae47fc676d7b16ce8af7b5328a1041
tree7c3ee93dd5e52653789e494bc51f062187eb904e
parentcdf5a1c953c439de9e64a9a8364a2184049b9369
Find the target gcc when cross-compiling

Summary:
"./configure --target=TARGET" was broken; it would use the host gcc.
(So you had to explicitly specify "--with-gcc=TARGET-gcc" also,
as a workaround.)

This was broken by commit fc4856f9e811d9a23ae9212f43a09ddf5ef12b26
for #8148. A comment claimed that FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL
was the same as FP_ARG_WITH_PATH_GNU_PROG except for not raising
an error when the program isn't found; but that wasn't true --
the former didn't prepend the target name when cross-compiling.

We actually need three versions of FP_ARG_WITH_PATH_GNU_PROG since
the LLVM tools are usually not prefixed with the target name even
when cross-compiling. So I generalized the logic in a single macro.

Test Plan:
Built with "./configure --target=i386-unknown-linux"
and BuildFlavour=quick, successfully

Reviewers: ezyang, austin

Reviewed By: ezyang, austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D204
aclocal.m4