Skip to content
This repository
tag: v1433
Fetching contributors…

Cannot retrieve contributors at this time

file 129 lines (104 sloc) 2.852 kb
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
(*
Copyright © 2011 MLstate

This file is part of OPA.

OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.

OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.

You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
(**
Configuration for plugins files dependencies
@author Mathieu Barbin
*)

(** {6 Purpose} *)
(**
With the separation of plugins/packages, we want to be able to load some
plugins automatically if there are used by an imported package.

For that we need a way to add automatically in the command line of
the back-end compilation all the dependencies of the linked libraries.

Before the separation, these dependencies was added in the command line
of opa.
Now, thanks to this module and conf files of plugins, dependencies
can also be expressed in the opp directly, and automatically added
by the compiler.
*)

(** {6 Configuration} *)
(**
Any file called [*.conf] can be given in the command line of [opa-plugin-builder],
following this syntax:

{[
# comments are welcome at the begining of lines
[myproperty]
argument argument argument
argument argument

[myproperty:platform]
argument argument
]}

Supported properties are:
{[
[mlcopt]
# extra options to be passed to ocaml compiler

[mllopt]
# extra options to be passed to ocaml linker

[mlinclude]
# extra path to be passed to ocaml (absolute only)

[cclib]
# options to the C linker

[ccopt]
# options to the C compiler and linker
]}

Supported platforms are:
{[
linux
windows
mac
]}
*)

(**
The type of the accumulated properties
*)
type properties = {
  cclib : string list ;
  ccopt : string list ;
  mlcopt : string list ;
  mllopt : string list ;
  mlinclude : string list ;
  mllibs : string list ;
}

type conf = {
  all_platform: properties ;
  linux: properties option ;
  mac:properties option ;
  windows: properties option ;
  cygwin: properties option ;
}

type t

(**
The default configuration.
*)
val default : t

(**
<!> used by generated code
*)
val default_conf : conf

(**
Tell if a conf is equal to the default configuration
*)
val is_default : conf -> bool

(**
Fold confs using configration files
*)
val fold : filename:string -> t -> t

(**
Export at the end of the fold the conf
*)
val export : t -> conf

(**
Pretty print for debugging
*)
val pp : Format.formatter -> conf -> unit
Something went wrong with that request. Please try again.