Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
a7c274b2
Commit
a7c274b2
authored
5 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[dynlink] fix findlib compatibility with Cygwin/Win32
parent
0cf76037
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_services/plugin_entry_points/dynamic.ml
+13
-3
13 additions, 3 deletions
src/kernel_services/plugin_entry_points/dynamic.ml
with
13 additions
and
3 deletions
src/kernel_services/plugin_entry_points/dynamic.ml
+
13
−
3
View file @
a7c274b2
...
...
@@ -273,17 +273,27 @@ let load_script base =
(* --- Command-Line Entry Points --- *)
(* -------------------------------------------------------------------------- *)
(* See https://github.com/ocaml/dune/pull/636 about why the path separator for
ocamlfind is ';' on Cygwin. *)
let
ocamlfind_path_separator
=
if
Sys
.
cygwin
||
Sys
.
win32
then
";"
else
":"
let
set_module_load_path
path
=
let
add_dir
~
user
d
ps
=
if
is_dir
d
then
d
::
ps
else
(
if
user
then
Klog
.
warning
"cannot load '%s' (not a directory)"
d
;
ps
)
in
Klog
.
debug
~
dkey
"plugin_dir: %s"
(
String
.
concat
":"
Config
.
plugin_dir
);
Klog
.
debug
~
dkey
"plugin_dir: %s"
(
String
.
concat
ocamlfind_path_separator
Config
.
plugin_dir
);
load_path
:=
List
.
fold_right
(
add_dir
~
user
:
true
)
path
(
List
.
fold_right
(
add_dir
~
user
:
false
)
(
Config
.
libdir
::
Config
.
plugin_dir
)
[]
);
let
env_ocamlpath
=
try
Str
.
split
(
Str
.
regexp
":"
)
(
Sys
.
getenv
"OCAMLPATH"
)
with
Not_found
->
[]
in
let
findlib_path
=
String
.
concat
":"
(
!
load_path
@
env_ocamlpath
)
in
let
env_ocamlpath
=
try
Str
.
split
(
Str
.
regexp
ocamlfind_path_separator
)
(
Sys
.
getenv
"OCAMLPATH"
)
with
Not_found
->
[]
in
let
findlib_path
=
String
.
concat
ocamlfind_path_separator
(
!
load_path
@
env_ocamlpath
)
in
Klog
.
debug
~
dkey
"setting findlib path to %s"
findlib_path
;
Findlib
.
init
~
env_ocamlpath
:
findlib_path
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment