Skip to content
Snippets Groups Projects
Commit bde4b5d4 authored by Rodrigo Mesquita's avatar Rodrigo Mesquita :seedling: Committed by Marge Bot
Browse files

Improve handling of Cc as a fallback

parent 294a6d80
No related branches found
No related tags found
No related merge requests found
......@@ -24,8 +24,8 @@ newtype HsCpp = HsCpp { hsCppProgram :: Program
findHsCpp :: ProgOpt -> Cc -> M HsCpp
findHsCpp progOpt cc = checking "for Haskell C preprocessor" $ do
-- Use the specified HS CPP or try to find one (candidate is the c compiler)
foundHsCppProg <- findProgram "Haskell C preprocessor" progOpt [takeFileName $ prgPath $ ccProgram cc]
-- Use the specified HS CPP or try to use the c compiler
foundHsCppProg <- findProgram "Haskell C preprocessor" progOpt [] <|> pure (Program (prgPath $ ccProgram cc) [])
case poFlags progOpt of
-- If the user specified HS CPP flags don't second-guess them
Just _ -> return HsCpp{hsCppProgram=foundHsCppProg}
......@@ -84,8 +84,8 @@ findHsCppArgs cpp = withTempDir $ \dir -> do
findCpp :: ProgOpt -> Cc -> M Cpp
findCpp progOpt cc = checking "for C preprocessor" $ do
-- Use the specified CPP or try to find one (candidate is the c compiler)
foundCppProg <- findProgram "C preprocessor" progOpt [prgPath $ ccProgram cc]
-- Use the specified CPP or try to use the c compiler
foundCppProg <- findProgram "C preprocessor" progOpt [] <|> pure (Program (prgPath $ ccProgram cc) [])
case poFlags progOpt of
-- If the user specified CPP flags don't second-guess them
Just _ -> return Cpp{cppProgram=foundCppProg}
......
......@@ -46,8 +46,8 @@ findCcLink :: String -- ^ The llvm target to use if CcLink supports --target
-> Bool -- ^ Whether we should search for a more efficient linker
-> ArchOS -> Cc -> Maybe Readelf -> M CcLink
findCcLink target progOpt ldOverride archOs cc readelf = checking "for C compiler for linking command" $ do
-- Use the specified linker or try to find one
rawCcLink <- findProgram "C compiler for linking" progOpt [takeFileName $ prgPath $ ccProgram cc]
-- Use the specified linker or try using the C compiler
rawCcLink <- findProgram "C compiler for linking" progOpt [] <|> pure (Program (prgPath $ ccProgram cc) [])
ccLinkProgram <- case poFlags progOpt of
Just _ ->
-- If the user specified linker flags don't second-guess them
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment