Skip to content

Commit

Permalink
prep for other --pgmP like options, not available via commandline opt…
Browse files Browse the repository at this point in the history
…s (yet)
  • Loading branch information
atzedijkstra committed Nov 8, 2012
1 parent 5b03b35 commit 2da5082
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions EHC/src/ehc/EHC/CompilePhase/CompileC.chs
Expand Up @@ -81,7 +81,7 @@ cpCompileWithGCC how othModNmL modNm
fpO m f = mkPerModuleOutputFPath opts False m f "o"
fpExec = mkPerExecOutputFPath opts modNm fp Cfg.mbSuffixExec
variant= Cfg.installVariant opts
(fpTarg,targOpt,linkOpts,linkLibOpt,dotOFilesOpt,genOFiles)
(fpTarg,targOpt,linkOpts,linkLibOpt,dotOFilesOpt,genOFiles,pgmExec)
= case how of
FinalCompile_Exec
-> ( fpExec
Expand All @@ -106,6 +106,7 @@ cpCompileWithGCC how othModNmL modNm
%%]]
[ gccArg $ fpathToStr $ fpO m fp | m <- othModNmL2, let (_,_,_,fp) = crBaseInfo m cr ]
, []
, PgmExec_Linker
)
where -- mkl how l = Cfg.mkCLibFilename (Cfg.mkInstallFilePrefix opts how variant l) l
mkl how l = gccArg $ Cfg.mkInstalledRts opts Cfg.mkCLibFilename how variant l
Expand All @@ -122,7 +123,7 @@ cpCompileWithGCC how othModNmL modNm
-}
%%]]
FinalCompile_Module
-> (o, Cfg.gccOpts ++ [gccOptF "c", gccOptOutput $ fpathToStr o ], Cfg.ehcGccOptsStatic', [], [], [o])
-> (o, Cfg.gccOpts ++ [gccOptF "c", gccOptOutput $ fpathToStr o ], Cfg.ehcGccOptsStatic', [], [], [o], PgmExec_C)
where o = fpO modNm fp
%%[[8
pkgKeyL = [] :: [String]
Expand All @@ -133,7 +134,7 @@ cpCompileWithGCC how othModNmL modNm
%%]]
; when (targetIsC (ehcOptTarget opts))
(do { let compileC
= mkShellCmd' [Cmd_CPP, Cmd_C] Cfg.shellCmdGcc
= mkShellCmd' [Cmd_CPP, Cmd_C] (Cfg.shellCmdOverride opts Cfg.shellCmdGcc pgmExec)
( gccDefs opts ["O"]
++ [ cppOptI $ Cfg.mkInstallFilePrefix opts Cfg.INST_INCLUDE variant "" ]
++ [ cppOptI $ Cfg.mkInstallFilePrefix opts Cfg.INST_INCLUDE_SHARED variant "" ]
Expand Down
2 changes: 2 additions & 0 deletions EHC/src/ehc/Opts.chs
Expand Up @@ -149,6 +149,8 @@ tycoreOptMp
%%[99
instance Show PgmExec where
show PgmExec_CPP = "P"
show PgmExec_C = "c"
show PgmExec_Linker = "l"

pgmExecMp :: Map.Map String PgmExec
pgmExecMp = optMp
Expand Down
2 changes: 2 additions & 0 deletions EHC/src/ehc/Opts/Base.chs
Expand Up @@ -123,6 +123,8 @@ data TyCoreOpt
-- | Pgm (internal program used) options, in particular alternate internal shell commands
data PgmExec
= PgmExec_CPP -- alternate CPP
| PgmExec_C -- alternate C compiler
| PgmExec_Linker -- alternate linker
deriving (Eq,Ord,Enum,Bounded)
%%]

Expand Down

0 comments on commit 2da5082

Please sign in to comment.