mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 06:47:09 +03:00
OCaml: optionally enable AFL support
This commit is contained in:
parent
9b76c5e17a
commit
120102de65
@ -12,16 +12,18 @@ in
|
|||||||
|
|
||||||
{ stdenv, fetchurl, ncurses, buildEnv
|
{ stdenv, fetchurl, ncurses, buildEnv
|
||||||
, libX11, xorgproto, useX11 ? safeX11 stdenv
|
, libX11, xorgproto, useX11 ? safeX11 stdenv
|
||||||
|
, aflSupport ? false
|
||||||
, flambdaSupport ? false
|
, flambdaSupport ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert useX11 -> !stdenv.isAarch32 && !stdenv.isMips;
|
assert useX11 -> !stdenv.isAarch32 && !stdenv.isMips;
|
||||||
|
assert aflSupport -> stdenv.lib.versionAtLeast version "4.05";
|
||||||
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
||||||
|
|
||||||
let
|
let
|
||||||
useNativeCompilers = !stdenv.isMips;
|
useNativeCompilers = !stdenv.isMips;
|
||||||
inherit (stdenv.lib) optional optionals optionalString;
|
inherit (stdenv.lib) optional optionals optionalString;
|
||||||
name = "ocaml${optionalString flambdaSupport "+flambda"}-${version}";
|
name = "ocaml${optionalString aflSupport "+afl"}${optionalString flambdaSupport "+flambda"}-${version}";
|
||||||
in
|
in
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -49,6 +51,7 @@ stdenv.mkDerivation (args // {
|
|||||||
optionals useX11 (flags
|
optionals useX11 (flags
|
||||||
[ "--x-libraries=${x11lib}" "--x-includes=${x11inc}"]
|
[ "--x-libraries=${x11lib}" "--x-includes=${x11inc}"]
|
||||||
[ "-x11lib" x11lib "-x11include" x11inc ])
|
[ "-x11lib" x11lib "-x11include" x11inc ])
|
||||||
|
++ optional aflSupport (flags "--with-afl" "-afl-instrument")
|
||||||
++ optional flambdaSupport (flags "--enable-flambda" "-flambda")
|
++ optional flambdaSupport (flags "--enable-flambda" "-flambda")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user