Commit 2ed0b041 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add new setting keys.

parent 093c1a95
...@@ -10,13 +10,18 @@ import Base ...@@ -10,13 +10,18 @@ import Base
import Oracles.Config import Oracles.Config
import Stage import Stage
-- TODO: reduce the variety of similar flags (e.g. CPP and non-CPP versions).
-- Each Setting comes from the system.config file, e.g. 'target-os = mingw32'. -- Each Setting comes from the system.config file, e.g. 'target-os = mingw32'.
-- setting TargetOs looks up the config file and returns "mingw32". -- setting TargetOs looks up the config file and returns "mingw32".
-- --
-- SettingList is used for multiple string values separated by spaces, such -- SettingList is used for multiple string values separated by spaces, such
-- as 'gmp-include-dirs = a b'. -- as 'gmp-include-dirs = a b'.
-- settingList GmpIncludeDirs therefore returns a list of strings ["a", "b"]. -- settingList GmpIncludeDirs therefore returns a list of strings ["a", "b"].
data Setting = DynamicExtension data Setting = BuildArch
| BuildOs
| BuildPlatform
| BuildVendor
| DynamicExtension
| GhcMajorVersion | GhcMajorVersion
| GhcMinorVersion | GhcMinorVersion
| GhcPatchLevel | GhcPatchLevel
...@@ -24,6 +29,8 @@ data Setting = DynamicExtension ...@@ -24,6 +29,8 @@ data Setting = DynamicExtension
| GhcSourcePath | GhcSourcePath
| HostArch | HostArch
| HostOs | HostOs
| HostPlatform
| HostVendor
| ProjectGitCommitId | ProjectGitCommitId
| ProjectName | ProjectName
| ProjectVersion | ProjectVersion
...@@ -33,7 +40,9 @@ data Setting = DynamicExtension ...@@ -33,7 +40,9 @@ data Setting = DynamicExtension
| ProjectPatchLevel2 | ProjectPatchLevel2
| TargetArch | TargetArch
| TargetOs | TargetOs
| TargetPlatform
| TargetPlatformFull | TargetPlatformFull
| TargetVendor
data SettingList = ConfCcArgs Stage data SettingList = ConfCcArgs Stage
| ConfCppArgs Stage | ConfCppArgs Stage
...@@ -41,11 +50,16 @@ data SettingList = ConfCcArgs Stage ...@@ -41,11 +50,16 @@ data SettingList = ConfCcArgs Stage
| ConfLdLinkerArgs Stage | ConfLdLinkerArgs Stage
| GmpIncludeDirs | GmpIncludeDirs
| GmpLibDirs | GmpLibDirs
| HsCppArgs
| IconvIncludeDirs | IconvIncludeDirs
| IconvLibDirs | IconvLibDirs
setting :: Setting -> Action String setting :: Setting -> Action String
setting key = askConfig $ case key of setting key = askConfig $ case key of
BuildArch -> "build-arch"
BuildOs -> "build-os"
BuildPlatform -> "build-platform"
BuildVendor -> "build-vendor"
DynamicExtension -> "dynamic-extension" DynamicExtension -> "dynamic-extension"
GhcMajorVersion -> "ghc-major-version" GhcMajorVersion -> "ghc-major-version"
GhcMinorVersion -> "ghc-minor-version" GhcMinorVersion -> "ghc-minor-version"
...@@ -54,6 +68,8 @@ setting key = askConfig $ case key of ...@@ -54,6 +68,8 @@ setting key = askConfig $ case key of
GhcSourcePath -> "ghc-source-path" GhcSourcePath -> "ghc-source-path"
HostArch -> "host-arch" HostArch -> "host-arch"
HostOs -> "host-os" HostOs -> "host-os"
HostPlatform -> "host-platform"
HostVendor -> "host-vendor"
ProjectGitCommitId -> "project-git-commit-id" ProjectGitCommitId -> "project-git-commit-id"
ProjectName -> "project-name" ProjectName -> "project-name"
ProjectVersion -> "project-version" ProjectVersion -> "project-version"
...@@ -63,7 +79,9 @@ setting key = askConfig $ case key of ...@@ -63,7 +79,9 @@ setting key = askConfig $ case key of
ProjectPatchLevel2 -> "project-patch-level2" ProjectPatchLevel2 -> "project-patch-level2"
TargetArch -> "target-arch" TargetArch -> "target-arch"
TargetOs -> "target-os" TargetOs -> "target-os"
TargetPlatform -> "target-platform"
TargetPlatformFull -> "target-platform-full" TargetPlatformFull -> "target-platform-full"
TargetVendor -> "target-vendor"
settingList :: SettingList -> Action [String] settingList :: SettingList -> Action [String]
settingList key = fmap words $ askConfig $ case key of settingList key = fmap words $ askConfig $ case key of
...@@ -73,6 +91,7 @@ settingList key = fmap words $ askConfig $ case key of ...@@ -73,6 +91,7 @@ settingList key = fmap words $ askConfig $ case key of
ConfLdLinkerArgs stage -> "conf-ld-linker-args-stage" ++ show stage ConfLdLinkerArgs stage -> "conf-ld-linker-args-stage" ++ show stage
GmpIncludeDirs -> "gmp-include-dirs" GmpIncludeDirs -> "gmp-include-dirs"
GmpLibDirs -> "gmp-lib-dirs" GmpLibDirs -> "gmp-lib-dirs"
HsCppArgs -> "hs-cpp-args"
IconvIncludeDirs -> "iconv-include-dirs" IconvIncludeDirs -> "iconv-include-dirs"
IconvLibDirs -> "iconv-lib-dirs" IconvLibDirs -> "iconv-lib-dirs"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment