File: embed.ml

package info (click to toggle)
opam 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,500 kB
  • sloc: ml: 61,414; sh: 2,963; ansic: 1,147; makefile: 479; sed: 6; csh: 1
file content (17 lines) | stat: -rw-r--r-- 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(* General module to embed content.
   Usage: 'ocaml shell/embed.ml > opamEmbedModule.ml'
*)
let () =
  let setup = Sys.argv.(1) in
  let content_setup =
    let ic = open_in_bin setup in
    let len = in_channel_length ic in
    let content = really_input_string ic len in
    close_in ic;
    content
  in
  Printf.printf
    {|(* THIS FILE IS AUTOMATICALLY GENERATED, EDIT configure.ac & shell/embed.ml INSTEAD *)
let content = Some "%s"
|}
    (String.escaped content_setup)