ocaml: adds an argument to enable flambda
This commit is contained in:
parent
76c146c990
commit
efcb39233d
1 changed files with 10 additions and 4 deletions
|
@ -10,14 +10,18 @@ let
|
||||||
safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
|
safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
|
||||||
in
|
in
|
||||||
|
|
||||||
{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }:
|
{ stdenv, fetchurl, ncurses, buildEnv
|
||||||
|
, libX11, xproto, useX11 ? safeX11 stdenv
|
||||||
|
, flambdaSupport ? false
|
||||||
|
}:
|
||||||
|
|
||||||
assert useX11 -> !stdenv.isArm && !stdenv.isMips;
|
assert useX11 -> !stdenv.isArm && !stdenv.isMips;
|
||||||
|
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
||||||
|
|
||||||
let
|
let
|
||||||
useNativeCompilers = !stdenv.isMips;
|
useNativeCompilers = !stdenv.isMips;
|
||||||
inherit (stdenv.lib) optionals optionalString;
|
inherit (stdenv.lib) optional optionals optionalString;
|
||||||
name = "ocaml-${version}";
|
name = "ocaml${optionalString flambdaSupport "+flambda"}-${version}";
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation (args // rec {
|
stdenv.mkDerivation (args // rec {
|
||||||
|
@ -36,7 +40,9 @@ stdenv.mkDerivation (args // rec {
|
||||||
|
|
||||||
prefixKey = "-prefix ";
|
prefixKey = "-prefix ";
|
||||||
configureFlags = optionals useX11 [ "-x11lib" x11lib
|
configureFlags = optionals useX11 [ "-x11lib" x11lib
|
||||||
"-x11include" x11inc ];
|
"-x11include" x11inc ]
|
||||||
|
++ optional flambdaSupport "-flambda"
|
||||||
|
;
|
||||||
|
|
||||||
buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
|
buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
|
||||||
buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
|
buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
|
||||||
|
|
Loading…
Reference in a new issue