Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
4512f273
Commit
4512f273
authored
Jul 24, 2015
by
Andrey Mokhov
Browse files
Drop stringly-typed configuration keys.
parent
580d3972
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Settings/GhcCabal.hs
View file @
4512f273
...
...
@@ -3,7 +3,6 @@ module Settings.GhcCabal (
)
where
import
Way
import
Stage
import
Builder
import
Package
import
Util
...
...
@@ -36,7 +35,7 @@ cabalArgs = builder GhcCabal ? do
,
configureArgs
,
stage0
?
packageConstraints
,
with
$
Gcc
stage
,
notStage
Stage
0
?
with
Ld
,
notStage0
?
with
Ld
,
with
Ar
,
with
Alex
,
with
Happy
]
...
...
@@ -65,25 +64,25 @@ configureArgs = do
let
conf
key
=
appendSubD
$
"--configure-option="
++
key
cFlags
=
mconcat
[
ccArgs
,
remove
[
"-Werror"
]
,
argS
tagedConfig
"conf-cc-args"
]
ldFlags
=
ldArgs
<>
argS
tagedConfig
"conf-gcc-l
inker
-a
rgs
"
cppFlags
=
cppArgs
<>
argS
tagedConfig
"conf-cpp-args"
,
argS
ettingList
$
ConfCcArgs
stage
]
ldFlags
=
ldArgs
<>
(
argS
ettingList
$
ConfGccL
inker
A
rgs
stage
)
cppFlags
=
cppArgs
<>
(
argS
ettingList
$
ConfCppArgs
stage
)
mconcat
[
conf
"CFLAGS"
cFlags
,
conf
"LDFLAGS"
ldFlags
,
conf
"CPPFLAGS"
cppFlags
,
appendSubD
"--gcc-options"
$
cFlags
<>
ldFlags
,
conf
"--with-iconv-includes"
$
arg
Config
"i
conv
-i
nclude
-d
irs
"
,
conf
"--with-iconv-libraries"
$
arg
Config
"iconv-lib-d
irs
"
,
conf
"--with-gmp-includes"
$
arg
Config
"gmp-i
nclude
-d
irs
"
,
conf
"--with-gmp-libraries"
$
arg
Config
"gmp-lib-d
irs
"
,
conf
"--with-iconv-includes"
$
arg
SettingList
I
conv
I
nclude
D
irs
,
conf
"--with-iconv-libraries"
$
arg
SettingList
IconvLibD
irs
,
conf
"--with-gmp-includes"
$
arg
SettingList
GmpI
nclude
D
irs
,
conf
"--with-gmp-libraries"
$
arg
SettingList
GmpLibD
irs
-- TODO: why TargetPlatformFull and not host?
,
crossCompiling
?
(
conf
"--host"
$
arg
Config
"t
arget
-p
latform
-f
ull
"
)
,
crossCompiling
?
(
conf
"--host"
$
arg
Setting
T
arget
P
latform
F
ull
)
,
conf
"--with-cc"
.
argM
.
builderPath
$
Gcc
stage
]
bootPackageDbArgs
::
Args
bootPackageDbArgs
=
do
sourcePath
<-
lift
$
askConfig
"ghc-s
ource
-p
ath
"
sourcePath
<-
lift
.
setting
$
GhcS
ource
P
ath
arg
$
"--package-db="
++
sourcePath
</>
"libraries/bootstrapping.conf"
-- This is a positional argument, hence:
...
...
src/Settings/Util.hs
View file @
4512f273
module
Settings.Util
(
-- Primitive settings elements
arg
,
argPath
,
argM
,
arg
Config
,
argStagedConfig
,
argConfigList
,
argStagedConfi
gList
,
arg
Setting
,
argSettin
gList
,
appendCcArgs
,
needBuilder
-- argBuilderPath, argStagedBuilderPath,
...
...
@@ -13,11 +13,11 @@ module Settings.Util (
)
where
import
Util
import
Stage
import
Builder
import
Settings.User
import
Oracles.Base
import
Expression
import
Oracles.Base
import
Oracles.Setting
import
Settings.User
-- A single argument.
arg
::
String
->
Args
...
...
@@ -30,24 +30,11 @@ argPath = append . return . unifyPath
argM
::
Action
String
->
Args
argM
=
appendM
.
fmap
return
argConfig
::
String
->
Args
argConfig
=
appendM
.
fmap
return
.
askConfig
argConfigList
::
String
->
Args
argConfigList
=
appendM
.
fmap
words
.
askConfig
argSetting
::
Setting
->
Args
argSetting
=
argM
.
setting
stagedKey
::
Stage
->
String
->
String
stagedKey
stage
key
=
key
++
"-stage"
++
show
stage
argStagedConfig
::
String
->
Args
argStagedConfig
key
=
do
stage
<-
asks
getStage
argConfig
(
stagedKey
stage
key
)
argStagedConfigList
::
String
->
Args
argStagedConfigList
key
=
do
stage
<-
asks
getStage
argConfigList
(
stagedKey
stage
key
)
argSettingList
::
SettingList
->
Args
argSettingList
=
appendM
.
settingList
-- Pass arguments to Gcc and corresponding lists of sub-arguments of GhcCabal
appendCcArgs
::
[
String
]
->
Args
...
...
src/Switches.hs
View file @
4512f273
module
Switches
(
notStage
,
stage0
,
stage1
,
stage2
,
stage0
,
stage1
,
stage2
,
notStage
,
notStage0
,
registerPackage
,
splitObjects
)
where
...
...
@@ -9,9 +9,6 @@ import Oracles.Setting
import
Expression
-- Derived predicates
notStage
::
Stage
->
Predicate
notStage
=
notP
.
stage
stage0
::
Predicate
stage0
=
stage
Stage0
...
...
@@ -21,6 +18,12 @@ stage1 = stage Stage1
stage2
::
Predicate
stage2
=
stage
Stage2
notStage
::
Stage
->
Predicate
notStage
=
notP
.
stage
notStage0
::
Predicate
notStage0
=
notP
stage0
-- TODO: Actually, we don't register compiler in some circumstances -- fix.
registerPackage
::
Predicate
registerPackage
=
return
True
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment