Permalink
Browse files

haskell-cabal.eclass: check if ghc actually enables 'Dynamic by default'

As exbb2 found out in Issue #216 (#216)
ghc-HEAD switched bask to static by default:
    ghc/ghc@951e28c

Added some helpers to detect such ghc and made use of them.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
trofi committed Feb 18, 2013
1 parent b5a4de7 commit 17764338a95b1dcd9c5b05a2591d78584c168e09
Showing with 16 additions and 1 deletion.
  1. +15 −0 eclass/ghc-package.eclass
  2. +1 −1 eclass/haskell-cabal.eclass
View
@@ -102,6 +102,21 @@ ghc-supports-threaded-runtime() {
$(ghc-getghc) --info | grep "RTS ways" | grep -q "thr"
}
+# @FUNCTION: ghc-supports-smp
+# @DESCRIPTION:
+# checks if ghc is built with support for multiple cores runtime
+ghc-supports-smp() {
+ $(ghc-getghc) --info | grep "Support SMP" | grep -q "YES"
+}
+
+# @FUNCTION: ghc-supports-dynamic-by-default
+# @DESCRIPTION:
+# checks if ghc is built with support for multiple cores runtime
+ghc-supports-dynamic-by-default() {
+ $(ghc-getghc) --info | grep "Dynamic by default" | grep -q "YES"
+}
+
+
# @FUNCTION: ghc-extractportageversion
# @DESCRIPTION:
# extract the version of a portage-installed package
@@ -338,7 +338,7 @@ cabal-configure() {
if $(ghc-supports-shared-libraries); then
# maybe a bit lower
- if version_is_at_least "7.7.20121114" "$(ghc-version)"; then
+ if $(ghc-supports-dynamic-by-default); then
cabalconf="${cabalconf} --enable-shared"
fi
fi

0 comments on commit 1776433

Please sign in to comment.