Permalink
Browse files

eclass/haskell-cabal.eclass: add parallel building of .hs files for g…

…hc-7.8+

Essentially pass '-j' option down to ghc if supported.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
trofi committed Feb 4, 2014
1 parent a6f2ec2 commit 0bcc8388981a26dd3ea91bc176980e747b0a2dc0
Showing with 13 additions and 0 deletions.
  1. +8 −0 eclass/ghc-package.eclass
  2. +5 −0 eclass/haskell-cabal.eclass
@@ -124,6 +124,14 @@ ghc-supports-interpreter() {
$(ghc-getghc) --info | grep "Have interpreter" | grep -q "YES"
}
+# @FUNCTION: ghc-supports-parallel-make
+# @DESCRIPTION:
+# checks if ghc has support for '--make -j' mode
+# The option was introduced in ghc-7.8-rc1.
+ghc-supports-parallel-make() {
+ $(ghc-getghc) --info | grep "Support parallel --make" | grep -q "YES"
+}
+
# @FUNCTION: ghc-extractportageversion
# @DESCRIPTION:
# extract the version of a portage-installed package
@@ -339,6 +339,11 @@ cabal-configure() {
cabalconf+=(--ghc-option="$option")
done
+ # parallel on all available cores
+ if ghc-supports-parallel-make; then
+ cabalconf+=(--ghc-option=-j)
+ fi
+
# Building GHCi libs on ppc64 causes "TOC overflow".
if use ppc64; then
cabalconf+=(--disable-library-for-ghci)

0 comments on commit 0bcc838

Please sign in to comment.