From 9e5496e0ae0ee8f638ca93949ecca314fdb9251e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 24 Jun 2020 23:46:57 +0200 Subject: [PATCH] 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. --- guix/build/haskell-build-system.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index a8cd62d03c..f57981511a 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -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.