systemd-ml/lib/config/discover.ml

9 lines
323 B
OCaml
Raw Normal View History

2024-09-24 08:23:56 +00:00
module C = Configurator.V1
let () = C.main ~name:"ocaml-systemd" (fun c ->
let has_malloc_trim = C.c_test c ~c_flags:["-Werror"]
"#include <malloc.h>\nint main(){malloc_trim(0);}" in
let cflags = if has_malloc_trim then [ "-DOCAML_SYSTEMD_USE_MALLOC_TRIM" ] else [] in
C.Flags.write_sexp "c_flags.sexp" cflags
)