Skip to content

Commit

Permalink
[enhance] compiler, bsl: added --no-absolute-plugin needed for buildi…
Browse files Browse the repository at this point in the history
…ng opx without absolute reference to opp
  • Loading branch information
BourgerieQuentin committed Jan 25, 2012
1 parent fb992fe commit cadf7ec
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 2 deletions.
1 change: 1 addition & 0 deletions libbsl.mllib
Expand Up @@ -25,3 +25,4 @@ libbsl/BslDirectives
libbsl/BslIncludeFormats libbsl/BslIncludeFormats
libbsl/BslRegisterParserState libbsl/BslRegisterParserState
libbsl/BslError libbsl/BslError
libbsl/BslArgs
34 changes: 34 additions & 0 deletions libbsl/bslArgs.ml
@@ -0,0 +1,34 @@
(*
Copyright © 2012 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/>.
*)

type t = {
no_absolute : bool;
}

let default = {
no_absolute = false;
}

let x = ref default

let get () = !x

let options = [
("--no-absolute-plugin", Base.Arg.Unit (fun () -> x := {no_absolute = true})
, "Plugin paths should not be considered as absolute path (package will not refers to plugin with an absolute path)")
]
25 changes: 25 additions & 0 deletions libbsl/bslArgs.mli
@@ -0,0 +1,25 @@
(*
Copyright © 2012 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/>.
*)

type t = {
no_absolute : bool;
}

val get : unit -> t

val options : (string * Base.Arg.spec * string) list
2 changes: 1 addition & 1 deletion libbsl/bslConvention.ml
@@ -1,5 +1,5 @@
(* (*
Copyright © 2011 MLstate Copyright © 2012 MLstate
This file is part of OPA. This file is part of OPA.
Expand Down
7 changes: 6 additions & 1 deletion opa/pass_BslLoading.ml
Expand Up @@ -393,7 +393,12 @@ let process
Hashtbl.add extralib_plugin basename extralib ; Hashtbl.add extralib_plugin basename extralib ;
Hashtbl.add extrapath_plugin basename extrapath ; Hashtbl.add extrapath_plugin basename extrapath ;
BslDynlink.load_bypass_plugin (BslDynlink.MarshalPlugin plugin) ; BslDynlink.load_bypass_plugin (BslDynlink.MarshalPlugin plugin) ;
let inclusion = BslConvention.inclusion ~cwd:"" bypass_plugin in let inclusion =
let bypass_plugin =
if (BslArgs.get ()).BslArgs.no_absolute then Filename.basename bypass_plugin
else bypass_plugin
in
BslConvention.inclusion ~cwd:"" bypass_plugin in
let extralib = inclusion.BslConvention.extralib in let extralib = inclusion.BslConvention.extralib in
let extrapath = inclusion.BslConvention.extrapath in let extrapath = inclusion.BslConvention.extrapath in
let plugin = inclusion.BslConvention.plugin in let plugin = inclusion.BslConvention.plugin in
Expand Down
1 change: 1 addition & 0 deletions opalib/opaEnv.ml
Expand Up @@ -442,6 +442,7 @@ struct
ObjectFiles.Arg.public_options @ ObjectFiles.Arg.public_options @
I18n.options @ I18n.options @
OpaSyntax.Args.options @ OpaSyntax.Args.options @
BslArgs.options @
QmlDbGen.Args.options @ QmlDbGen.Args.options @
[ [
(* a *) (* a *)
Expand Down

0 comments on commit cadf7ec

Please sign in to comment.