File: config.ml.in

package info (click to toggle)
coccinelle 1.0.8.deb-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,148 kB
  • sloc: ml: 136,392; ansic: 23,594; sh: 2,189; makefile: 2,157; perl: 1,576; lisp: 840; python: 823; awk: 70; csh: 12
file content (52 lines) | stat: -rw-r--r-- 1,659 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
let version = "@COCCI_VERSION@"

let rec realpath path =
  if path = "/" || path = "." then
    path
  else
    begin
      let dirname = Filename.dirname path in
      let new_dirname = realpath dirname in
      let new_path =
        if dirname == new_dirname then path
        else Filename.concat new_dirname (Filename.basename path) in
      let rec follow new_path =
        match
          try Some (Unix.readlink new_path) with Unix.Unix_error _ -> None
        with
        | None -> new_path
        | Some target ->
            let new_path =
              if Filename.is_relative target then
                Filename.concat (Filename.dirname new_path) target
              else
                target in
            follow new_path in
      follow new_path
    end

let path =
  try (Sys.getenv "COCCINELLE_HOME")
  with Not_found->
    (* was "@libdir@/coccinelle": incorrect, since "@libdir@" expands into
       "${exec_prefix}/lib" (litteraly, without further expansion, that is
       unlikely to be a valid path! *)
    let exec_realpath = realpath Sys.executable_name in
    let exec_dir = Filename.dirname exec_realpath in
    if Sys.file_exists (Filename.concat exec_dir "standard.iso") then
      exec_dir
    else
      List.fold_left Filename.concat exec_dir
	[Filename.parent_dir_name; "lib"; "coccinelle"]


let std_iso = ref (Filename.concat path "standard.iso")
let std_h   = ref (Filename.concat path "standard.h")

let dynlink_is_native = @DYNLINK_IS_NATIVE@
let get_temp_dir_name = @GET_TEMP_DIR_NAME_EXPR@

let configure_flags = "@CONFIGURE_FLAGS@"
let ocaml_version = "@OCAMLVERSION@"

let python_interpreter = ref "@PYTHON@"