mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
add script to generate jbuilder flags dynamically
This commit is contained in:
parent
a307bb09f7
commit
d97e1e7231
11 changed files with 40 additions and 25 deletions
|
|
@ -3,8 +3,7 @@
|
||||||
((name containers)
|
((name containers)
|
||||||
(public_name containers)
|
(public_name containers)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always -nolabels -open CCMonomorphic))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -nolabels -open CCMonomorphic))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (bytes result containers.monomorphic))
|
(libraries (bytes result containers.monomorphic))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
((name containers_data)
|
((name containers_data)
|
||||||
(public_name containers.data)
|
(public_name containers.data)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (bytes result))
|
(libraries (bytes result))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
((name containers_iter)
|
((name containers_iter)
|
||||||
(public_name containers.iter)
|
(public_name containers.iter)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (bytes result))
|
(libraries (bytes result))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
10
src/jbuild
Normal file
10
src/jbuild
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (flambda.flags))
|
||||||
|
(deps ((file mkflags.ml)))
|
||||||
|
(fallback)
|
||||||
|
(action
|
||||||
|
(run ocaml ./mkflags.ml))
|
||||||
|
))
|
||||||
|
|
||||||
13
src/mkflags.ml
Normal file
13
src/mkflags.ml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
let () =
|
||||||
|
let major, minor =
|
||||||
|
Scanf.sscanf Sys.ocaml_version "%u.%u"
|
||||||
|
(fun major minor -> major, minor)
|
||||||
|
in
|
||||||
|
let after_4_3 = (major, minor) >= (4, 3) in
|
||||||
|
let flags_file = open_out "flambda.flags" in
|
||||||
|
if after_4_3 then (
|
||||||
|
output_string flags_file "(-O3 -unbox-closures -unbox-closures-factor 20 -color always)\n";
|
||||||
|
) else (
|
||||||
|
output_string flags_file "()\n";
|
||||||
|
);
|
||||||
|
close_out flags_file
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
((name containers_monomorphic)
|
((name containers_monomorphic)
|
||||||
(public_name containers.monomorphic)
|
(public_name containers.monomorphic)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries ())
|
(libraries ())
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,8 @@
|
||||||
((name containers_sexp)
|
((name containers_sexp)
|
||||||
(public_name containers.sexp)
|
(public_name containers.sexp)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (bytes result))
|
(libraries (bytes result))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,8 @@
|
||||||
(public_name containers.thread)
|
(public_name containers.thread)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(optional)
|
(optional)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (containers threads))
|
(libraries (containers threads))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,8 @@
|
||||||
((name containers_top)
|
((name containers_top)
|
||||||
(public_name containers.top)
|
(public_name containers.top)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (compiler-libs.common containers containers.data
|
(libraries (compiler-libs.common containers containers.data
|
||||||
containers.unix containers.sexp containers.iter))
|
containers.unix containers.sexp containers.iter))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
B ../../_build/default/src/unix
|
B ../../_build/default/src/unix
|
||||||
FLG -w -40 -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always
|
FLG -w -40 -w +a-4-42-44-48-50-58-32-60@8 -safe-string
|
||||||
PKG bytes
|
PKG bytes
|
||||||
PKG result
|
PKG result
|
||||||
PKG unix
|
PKG unix
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@
|
||||||
(public_name containers.unix)
|
(public_name containers.unix)
|
||||||
(wrapped false)
|
(wrapped false)
|
||||||
(optional)
|
(optional)
|
||||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always))
|
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))
|
||||||
(ocamlopt_flags (:standard -O3 -color always
|
(ocamlopt_flags (:standard (:include ../flambda.flags)))
|
||||||
-unbox-closures -unbox-closures-factor 20))
|
|
||||||
(libraries (bytes result unix))
|
(libraries (bytes result unix))
|
||||||
))
|
))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue