ghc: Handle flavors better

This commit is contained in:
John Ericson 2018-05-20 02:16:07 -04:00
parent 6f2f081b90
commit 8d2ce113d5
5 changed files with 37 additions and 5 deletions

View File

@ -24,6 +24,10 @@
, # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built.
enableShared ? true
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
}:
assert !enableIntegerSimple -> gmp != null;
@ -42,11 +46,14 @@ let
};
buildMK = ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
BuildFlavour = perf-cross
Stage1Only = YES
HADDOCK_DOCS = NO
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''

View File

@ -23,6 +23,10 @@
, # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built.
enableShared ? true
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
}:
assert !enableIntegerSimple -> gmp != null;
@ -36,11 +40,14 @@ let
"${targetPlatform.config}-";
buildMK = ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
BuildFlavour = perf-cross
Stage1Only = YES
HADDOCK_DOCS = NO
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''

View File

@ -25,6 +25,9 @@
# platform). Static libs are always built.
enableShared ? true
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
, # Whether to backport https://phabricator.haskell.org/D4388 for
# deterministic profiling symbol names, at the cost of a slightly
# non-standard GHC API
@ -42,11 +45,14 @@ let
"${targetPlatform.config}-";
buildMK = ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
BuildFlavour = perf-cross
Stage1Only = YES
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO

View File

@ -24,6 +24,9 @@
# platform). Static libs are always built.
enableShared ? !targetPlatform.useAndroidPrebuilt
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
}:
assert !enableIntegerSimple -> gmp != null;
@ -37,11 +40,14 @@ let
"${targetPlatform.config}-";
buildMK = ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
BuildFlavour = perf-cross
Stage1Only = YES
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO

View File

@ -25,6 +25,9 @@
enableShared ? !targetPlatform.useAndroidPrebuilt
, version ? "8.5.20180118"
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
}:
assert !enableIntegerSimple -> gmp != null;
@ -38,11 +41,14 @@ let
"${targetPlatform.config}-";
buildMK = ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
BuildFlavour = perf-cross
Stage1Only = YES
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO