Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
b5beba96
Commit
b5beba96
authored
Jan 13, 2015
by
Andrey Mokhov
Browse files
Add options SplitObjectsBroken, GhcUnregisterised, DynamicExtension, ProjectVersion.
parent
7c9dfba2
Changes
3
Hide whitespace changes
Inline
Side-by-side
cfg/default.config.in
View file @
b5beba96
...
...
@@ -32,6 +32,8 @@ lax-dependencies = NO
dynamic-ghc-programs = NO
supports-package-key = @SUPPORTS_PACKAGE_KEY@
solaris-broken-shld = @SOLARIS_BROKEN_SHLD@
split-objects-broken = @SplitObjsBroken@
ghc-unregisterised = @Unregisterised@
# Information about host and target systems:
#===========================================
...
...
@@ -44,6 +46,10 @@ host-os-cpp = @HostOS_CPP@
cross-compiling = @CrossCompiling@
dynamic-extension = @soext_target@
project-version = @ProjectVersion@
# Compilation and linking flags:
#===============================
...
...
src/Oracles/Flag.hs
View file @
b5beba96
...
...
@@ -21,6 +21,8 @@ data Flag = LaxDeps
|
Validating
|
SupportsPackageKey
|
SolarisBrokenShld
|
SplitObjectsBroken
|
GhcUnregisterised
-- TODO: Give the warning *only once* per key
test
::
Flag
->
Action
Bool
...
...
@@ -34,6 +36,8 @@ test flag = do
Validating
->
(
"validating"
,
False
)
SupportsPackageKey
->
(
"supports-package-key"
,
False
)
SolarisBrokenShld
->
(
"solaris-broken-shld"
,
False
)
SplitObjectsBroken
->
(
"split-objects-broken"
,
False
)
GhcUnregisterised
->
(
"ghc-unregisterised"
,
False
)
let
defaultString
=
if
defaultValue
then
"YES"
else
"NO"
value
<-
askConfigWithDefault
key
$
do
putLoud
$
"
\n
Flag '"
...
...
src/Oracles/Option.hs
View file @
b5beba96
{-# LANGUAGE NoImplicitPrelude #-}
module
Oracles.Option
(
Option
(
..
),
ghcWithInterpreter
,
platformSupportsSharedLibs
,
windowsHost
ghcWithInterpreter
,
platformSupportsSharedLibs
,
windowsHost
,
splitObjects
)
where
import
Base
import
Oracles.Flag
import
Oracles.Base
-- TODO: separate single string options from multiple string ones.
data
Option
=
TargetOS
|
TargetArch
|
TargetPlatformFull
...
...
@@ -21,6 +22,8 @@ data Option = TargetOS
|
GmpLibDirs
|
SrcHcOpts
|
HostOsCpp
|
DynamicExtension
|
ProjectVersion
instance
ShowArgs
Option
where
showArgs
opt
=
showArgs
$
fmap
words
$
askConfig
$
case
opt
of
...
...
@@ -37,15 +40,17 @@ instance ShowArgs Option where
GmpLibDirs
->
"gmp-lib-dirs"
SrcHcOpts
->
"src-hc-opts"
HostOsCpp
->
"host-os-cpp"
DynamicExtension
->
"dynamic-extension"
ProjectVersion
->
"project-version"
ghcWithInterpreter
::
Condition
ghcWithInterpreter
=
do
[
os
]
<-
showArgs
TargetOS
[
arch
]
<-
showArgs
TargetArch
return
$
os
`
elem
`
[
"mingw32"
,
"cygwin32"
,
"linux"
,
"solaris2"
,
"freebsd"
,
"dragonfly"
,
"netbsd"
,
"openbsd"
,
"darwin"
,
"kfreebsdgnu"
]
os
`
elem
`
[
"mingw32"
,
"cygwin32"
,
"linux"
,
"solaris2"
,
"freebsd"
,
"dragonfly"
,
"netbsd"
,
"openbsd"
,
"darwin"
,
"kfreebsdgnu"
]
&&
arch
`
elem
`
[
"i386"
,
"x86_64"
,
"powerpc"
,
"sparc"
,
"sparc64"
,
"arm"
]
...
...
@@ -54,12 +59,25 @@ platformSupportsSharedLibs = do
[
platform
]
<-
showArgs
TargetPlatformFull
solarisBrokenShld
<-
test
SolarisBrokenShld
return
$
notElem
platform
$
[
"powerpc-unknown-linux"
,
"x86_64-unknown-mingw32"
,
"i386-unknown-mingw32"
]
++
[
"i386-unknown-solaris2"
|
solarisBrokenShld
]
[
"powerpc-unknown-linux"
,
"x86_64-unknown-mingw32"
,
"i386-unknown-mingw32"
]
++
[
"i386-unknown-solaris2"
|
solarisBrokenShld
]
windowsHost
::
Condition
windowsHost
=
do
[
hostOsCpp
]
<-
showArgs
HostOsCpp
return
$
hostOsCpp
`
elem
`
[
"mingw32"
,
"cygwin32"
]
-- TODO: refactor helper Condition functions into a separate file
splitObjects
::
Stage
->
Condition
splitObjects
stage
=
do
[
os
]
<-
showArgs
TargetOS
[
arch
]
<-
showArgs
TargetArch
splitObjectsBroken
<-
test
SplitObjectsBroken
ghcUnregisterised
<-
test
GhcUnregisterised
return
$
not
splitObjectsBroken
&&
not
ghcUnregisterised
&&
arch
`
elem
`
[
"i386"
,
"x86_64"
,
"powerpc"
,
"sparc"
]
&&
os
`
elem
`
[
"mingw32"
,
"cygwin32"
,
"linux"
,
"darwin"
,
"solaris2"
,
"freebsd"
,
"dragonfly"
,
"netbsd"
,
"openbsd"
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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