build-system/haskell: Configure to link with shared libraries.

* guix/build/haskell-build-system.scm (configure): Add configure flags to
build shared libraries by default, to generate position independent code, and
to set the RUNPATH.
This commit is contained in:
Ricardo Wurmus 2020-06-24 23:46:57 +02:00
parent 0347888a7e
commit 9e5496e0ae
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -100,6 +100,12 @@ (define* (configure #:key outputs inputs tests? (configure-flags '())
,@(if tests?
'("--enable-tests")
'())
;; Build and link with shared libraries
"--enable-shared"
"--enable-executable-dynamic"
"--ghc-option=-fPIC"
,(string-append "--ghc-option=-optl=-Wl,-rpath=" (or lib out)
"/lib/$compiler/$pkg-$version")
,@configure-flags)))
;; Cabal errors if GHC_PACKAGE_PATH is set during 'configure', so unset
;; and restore it.