@@ -110,6 +110,11 @@ configureToolchain _implInfo ghcProg ghcInfo =
110
110
{ programFindLocation = findProg gccProgramName extraGccPath
111
111
, programPostConf = configureGcc
112
112
}
113
+ . addKnownProgram
114
+ gppProgram
115
+ { programFindLocation = findProg gppProgramName extraGppPath
116
+ , programPostConf = configureGpp
117
+ }
113
118
. addKnownProgram
114
119
ldProgram
115
120
{ programFindLocation = findProg ldProgramName extraLdPath
@@ -137,6 +142,7 @@ configureToolchain _implInfo ghcProg ghcInfo =
137
142
maybeName prog = maybe (programName prog) (dropExeExtension . takeFileName)
138
143
139
144
gccProgramName = maybeName gccProgram mbGccLocation
145
+ gppProgramName = maybeName gppProgram mbGppLocation
140
146
ldProgramName = maybeName ldProgram mbLdLocation
141
147
arProgramName = maybeName arProgram mbArLocation
142
148
stripProgramName = maybeName stripProgram mbStripLocation
@@ -149,18 +155,20 @@ configureToolchain _implInfo ghcProg ghcInfo =
149
155
mbDir = maybeToList . fmap takeDirectory $ mbPath
150
156
151
157
extraGccPath = mkExtraPath mbGccLocation windowsExtraGccDir
158
+ extraGppPath = mkExtraPath mbGppLocation windowsExtraGppDir
152
159
extraLdPath = mkExtraPath mbLdLocation windowsExtraLdDir
153
160
extraArPath = mkExtraPath mbArLocation windowsExtraArDir
154
161
extraStripPath = mkExtraPath mbStripLocation windowsExtraStripDir
155
162
156
163
-- on Windows finding and configuring ghc's gcc & binutils is a bit special
157
164
( windowsExtraGccDir
165
+ , windowsExtraGppDir
158
166
, windowsExtraLdDir
159
167
, windowsExtraArDir
160
168
, windowsExtraStripDir
161
169
) =
162
170
let b = mingwBinDir </> binPrefix
163
- in (b, b, b, b)
171
+ in (b, b, b, b, b )
164
172
165
173
findProg
166
174
:: String
@@ -176,11 +184,13 @@ configureToolchain _implInfo ghcProg ghcInfo =
176
184
-- Read tool locations from the 'ghc --info' output. Useful when
177
185
-- cross-compiling.
178
186
mbGccLocation = Map. lookup " C compiler command" ghcInfo
187
+ mbGppLocation = Map. lookup " C++ compiler command" ghcInfo
179
188
mbLdLocation = Map. lookup " ld command" ghcInfo
180
189
mbArLocation = Map. lookup " ar command" ghcInfo
181
190
mbStripLocation = Map. lookup " strip command" ghcInfo
182
191
183
192
ccFlags = getFlags " C compiler flags"
193
+ cxxFlags = getFlags " C++ compiler flags"
184
194
-- GHC 7.8 renamed "Gcc Linker flags" to "C compiler link flags"
185
195
-- and "Ld Linker flags" to "ld flags" (GHC #4862).
186
196
gccLinkerFlags = getFlags " Gcc Linker flags" ++ getFlags " C compiler link flags"
@@ -210,6 +220,15 @@ configureToolchain _implInfo ghcProg ghcInfo =
210
220
++ gccLinkerFlags
211
221
}
212
222
223
+ configureGpp :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
224
+ configureGpp _v gppProg = do
225
+ return
226
+ gppProg
227
+ { programDefaultArgs =
228
+ programDefaultArgs gppProg
229
+ ++ cxxFlags
230
+ }
231
+
213
232
configureLd :: Verbosity -> ConfiguredProgram -> IO ConfiguredProgram
214
233
configureLd v ldProg = do
215
234
ldProg' <- configureLd' v ldProg
0 commit comments