File: configure.ml

package info (click to toggle)
extlib 1.7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 632 kB
  • sloc: ml: 6,980; makefile: 128; sh: 42; ansic: 31
file content (18 lines) | stat: -rw-r--r-- 634 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Printf

let show_bytes s =
    let (_:int) = Sys.command (sprintf "ocamlfind query -format %s bytes" (Filename.quote s)) in ()

let () =
  match Sys.argv with
  | [|_;"-cppo-args"|] ->
    let version = Scanf.sscanf Sys.ocaml_version "%d.%d." (fun major minor -> major * 100 + minor) in
    printf "-D \\\"OCAML %d\\\"\n" version;
    print_endline (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else "");
    show_bytes "-D WITH_BYTES";
    exit 0
  | [|_;"-compile-args"|] ->
    if Sys.ocaml_version >= "4.00.0" then print_endline "-bin-annot";
    show_bytes "-package bytes";
    exit 0
  | _ -> failwith "not gonna happen"