ghc head cross-compilation broken (configure)
It looks like this patch: 6be2c5a7 -- broke configure.ac logic and now the code:
6be2c5a7e91 configure.ac (Ben Gamari 2022-01-14 19:56:05 -0500 368) # Extract and configure the Windows toolchain
6be2c5a7e91 configure.ac (Ben Gamari 2022-01-14 19:56:05 -0500 369) if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then
6be2c5a7e91 configure.ac (Ben Gamari 2022-01-14 19:56:05 -0500 370) FP_SETUP_WINDOWS_TOOLCHAIN
6be2c5a7e91 configure.ac (Ben Gamari 2022-01-14 19:56:05 -0500 371) else
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 372) # Ideally should use AC_CHECK_TARGET_TOOL but our triples
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 373) # are screwed up. Configure doesn't think they're ever equal and
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 374) # so never tried without the prefix.
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 375) AC_PATH_PROG([CC],[gcc], [clang])
fb579e15c56 configure.ac (Ben Gamari 2022-03-23 15:53:06 -0400 376) AC_PATH_PROG([CXX],[g++], [clang++])
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 377) AC_PATH_PROG([NM],[nm])
f065b6b012f configure.ac (Tamar Christina 2020-08-16 17:18:14 +0100 378) AC_PATH_PROG([LD],[ld])
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 379) AC_PATH_PROG([AR],[ar])
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 380) AC_PATH_PROG([RANLIB],[ranlib])
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 381) AC_PATH_PROG([OBJDUMP],[objdump])
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 382) AC_PATH_PROG([DllWrap],[dllwrap])
fda094d000c configure.ac (Tamar Christina 2017-06-11 11:40:11 +0100 383) AC_PATH_PROG([Windres],[windres])
5f6a8204069 configure.ac (Tamar Christina 2017-08-29 23:09:09 +0100 384) AC_PATH_PROG([Genlib],[genlib])
is run even on non-Windows platform. That means that cross-compiling is broken due to assignment of platform C compiler into the CC variable which is bad thing to do.
I think the most simple fix may be to use inner if blocks instead of test -a here if I'm not mistaken.