./configure looks up most programs twice
There is a bug introduced in 6be2c5a7 where most tools are configured using AC_PATH_TOOL
in the else clause of
if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then
Result 1: Many of the later configure checks are skipped because by the time we get to them the relevant variables are set. (See #21778 (closed))
Result 2: AC_PATH_TOOL sets absolute paths rather than relative paths as AC_PROG_CC
would set later on.
It seems the correct thing to do is to remove all these configure checks and replace it with something like:
--- a/configure.ac
+++ b/configure.ac
@@ -349,24 +349,8 @@ if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then
FP_INSTALL_WINDOWS_TOOLCHAIN
FP_SETUP_WINDOWS_TOOLCHAIN([$hardtop/inplace/mingw], [$hardtop/inplace/mingw])
else
- AC_PATH_TOOL([CC],[gcc], [clang])
- AC_PATH_TOOL([CXX],[g++], [clang++])
- AC_PATH_TOOL([NM],[nm])
- # N.B. we don't probe for LD here but instead
- # do so in FIND_LD to avoid #21778.
- AC_PATH_TOOL([AR],[ar])
- AC_PATH_TOOL([RANLIB],[ranlib])
- AC_PATH_TOOL([OBJDUMP],[objdump])
- AC_PATH_TOOL([WindresCmd],[windres])
- AC_PATH_TOOL([Genlib],[genlib])
-
- if test "$HostOS" = "mingw32"; then
- AC_CHECK_TARGET_TOOL([WindresCmd],[windres])
- AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump])
-
- if test "$Genlib" != ""; then
- GenlibCmd="$(cygpath -m $Genlib)"
- fi
+ if "$TargetOS" = "mingw32"; then
+ AC_CHECK_TARGET_TOOL([WindresCmd],[windres])
fi
fi
Unfortunately fixing this issue is not immediately easy because ghc-toolchain
is also setting absolute paths because findExecutable
returns an absolute path.