haskell genenric-builder: Make the C compiler optional
This is GHCJS, and perhaps other obscure targets.
This commit is contained in:
parent
c739c420db
commit
ea9a2c5ec2
1 changed files with 4 additions and 1 deletions
|
@ -40,7 +40,7 @@ in
|
|||
# They must be propagated to the environment of any executable linking with the library
|
||||
, libraryFrameworkDepends ? [], executableFrameworkDepends ? []
|
||||
, homepage ? "https://hackage.haskell.org/package/${pname}"
|
||||
, platforms ? with stdenv.lib.platforms; unix ++ windows # GHC can cross-compile
|
||||
, platforms ? with stdenv.lib.platforms; all # GHC can cross-compile
|
||||
, hydraPlatforms ? null
|
||||
, hyperlinkSource ? true
|
||||
, isExecutable ? false, isLibrary ? !isExecutable
|
||||
|
@ -133,6 +133,7 @@ let
|
|||
crossCabalFlags = [
|
||||
"--with-ghc=${ghc.targetPrefix}ghc"
|
||||
"--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
|
||||
] ++ optionals stdenv.hasCC [
|
||||
"--with-gcc=${stdenv.cc.targetPrefix}cc"
|
||||
"--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
|
||||
"--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
|
||||
|
@ -156,7 +157,9 @@ let
|
|||
"--libsubdir=\\$abi/\\$libname"
|
||||
(optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
|
||||
(optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
|
||||
] ++ optionals stdenv.hasCC [
|
||||
"--with-gcc=$CC" # Clang won't work without that extra information.
|
||||
] ++ [
|
||||
"--package-db=$packageConfDir"
|
||||
(optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
|
||||
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
|
||||
|
|
Loading…
Reference in a new issue