[Git][ghc/ghc][wip/T26394] configure: Fix consistency between distrib and source CC check

Ben Gamari pushed to branch wip/T26394 at Glasgow Haskell Compiler / GHC Commits: 70dfd4f5 by Ben Gamari at 2025-09-09T10:39:19-04:00 configure: Fix consistency between distrib and source CC check Previously distrib/configure.ac did not include `cc`. Closes #26394. - - - - - 4 changed files: - configure.ac - distrib/configure.ac.in - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cc.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cxx.hs Changes: ===================================== configure.ac ===================================== @@ -423,7 +423,7 @@ AC_ARG_WITH([clang], dnl detect compiler (prefer gcc over clang) and set $CC (unless CC already set), dnl later CC is copied to CC_STAGE{1,2,3} AC_PROG_CC([cc gcc clang]) -AC_PROG_CXX([g++ clang++ c++]) +AC_PROG_CXX([c++ g++ clang++]) # Work around #24324 MOVE_TO_FLAGS([CC],[CFLAGS]) MOVE_TO_FLAGS([CXX],[CXXFLAGS]) ===================================== distrib/configure.ac.in ===================================== @@ -137,8 +137,8 @@ AC_SUBST([EnableStrictGhcToolchainCheck]) dnl ** Which gcc to use? dnl -------------------------------------------------------------- -AC_PROG_CC([gcc clang]) -AC_PROG_CXX([g++ clang++ c++]) +AC_PROG_CC([cc gcc clang]) +AC_PROG_CXX([c++ g++ clang++]) # Work around #24324 MOVE_TO_FLAGS([CC],[CFLAGS]) MOVE_TO_FLAGS([CXX],[CXXFLAGS]) ===================================== utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cc.hs ===================================== @@ -40,7 +40,7 @@ findBasicCc :: ProgOpt -> M Cc findBasicCc progOpt = checking "for C compiler" $ do -- TODO: We keep the candidate order we had in configure, but perhaps -- there's a more optimal one - ccProgram <- findProgram "C compiler" progOpt ["gcc", "clang", "cc"] + ccProgram <- findProgram "C compiler" progOpt ["cc", "gcc", "clang"] return $ Cc{ccProgram} findCc :: ArchOS ===================================== utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cxx.hs ===================================== @@ -26,7 +26,7 @@ findCxx :: ArchOS -> ProgOpt -> M Cxx findCxx archOs target progOpt = checking "for C++ compiler" $ do -- TODO: We use the search order in configure, but there could be a more optimal one - cxxProgram <- findProgram "C++ compiler" progOpt ["g++", "clang++", "c++"] + cxxProgram <- findProgram "C++ compiler" progOpt ["c++", "g++", "clang++"] cxx <- cxxSupportsTarget archOs target Cxx{cxxProgram} checkCxxWorks cxx return cxx View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/70dfd4f5f58e39f8227bb851554184d0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/70dfd4f5f58e39f8227bb851554184d0... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Ben Gamari (@bgamari)