diff options
Diffstat (limited to 'eclass/ghc-package.eclass')
-rw-r--r-- | eclass/ghc-package.eclass | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass index 5466c0b5b20d..7efa2c838449 100644 --- a/eclass/ghc-package.eclass +++ b/eclass/ghc-package.eclass @@ -11,7 +11,7 @@ # @DESCRIPTION: # Helper eclass to handle ghc installation/upgrade/deinstallation process. -inherit versionator +inherit multiprocessing versionator # @FUNCTION: ghc-getghc # @DESCRIPTION: @@ -106,20 +106,6 @@ ghc-cabal-version() { fi } -# @FUNCTION: ghc-sanecabal -# @DESCRIPTION: -# check if a standalone Cabal version is available for the -# currently used ghc; takes minimal version of Cabal as -# an optional argument -ghc-sanecabal() { - local f - local version - if [[ -z "$1" ]]; then version="1.0.1"; else version="$1"; fi - for f in $(ghc-confdir)/cabal-*; do - [[ -f "${f}" ]] && version_is_at_least "${version}" "${f#*cabal-}" && return - done - return 1 -} # @FUNCTION: ghc-is-dynamic # @DESCRIPTION: # checks if ghc is built against dynamic libraries @@ -193,6 +179,25 @@ ghc-libdir() { echo "${_GHC_LIBDIR_CACHE}" } +# @FUNCTION: ghc-make-args +# @DESCRIPTION: +# Returns default arguments passed along 'ghc --make' +# build mode. Used mainly to enable parallel build mode. +ghc-make-args() { + local ghc_make_args=() + # parallel on all available cores + if ghc-supports-smp && ghc-supports-parallel-make; then + # It should have been just -j$(makeopts_jobs) + # but GHC does not yet have nice defaults: + # https://ghc.haskell.org/trac/ghc/ticket/9221#comment:57 + # SMP is a requirement for parallel GC's gen0 + # 'qb' balancing. + echo "-j$(makeopts_jobs) +RTS -A256M -qb0 -RTS" + ghc_make_args=() + fi + echo "${ghc_make_args[@]}" +} + # @FUNCTION: ghc-confdir # @DESCRIPTION: # returns the (Gentoo) library configuration directory, we |