Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
039b16b2
Commit
039b16b2
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-04-23 20:53:55 by beppe] Added search for OCaml src in standard directories
Original author: beppe Date: 2004-04-23 20:53:55+00:00
parent
08bce3b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
configure.ml
View file @
039b16b2
...
...
@@ -59,6 +59,9 @@ let vars =
"sessiondir"
,
ref
"/tmp/cduce_sessions"
;
"mliface"
,
ref
""
]
let
src_dirs
=
[
"/usr/src"
;
"/usr/local/src"
;
"/tmp"
]
let
fatal
s
=
printf
"*** Fatal error: %s
\n
"
s
;
exit
1
let
warning
s
=
printf
"* Warning: %s
\n
"
s
...
...
@@ -153,10 +156,27 @@ let exe = match Sys.os_type with
print
"Cygwin detected... executable will have .exe extension"
;
"exe"
|
_
->
""
let
rec
search_sources
source_list
=
match
source_list
with
|
[]
->
(
print
"\
* Warning: no OCaml sources found in standard locations
\n
\
* Warning: please specify the source location with --mliface option
\n
\
* Warning: OCaml interface will not be compiled
\n
"
;
""
)
|
dir
::
tail
->
print
(
"Looking for Ocaml sources in "
^
dir
^
" ...
\n
"
);
flush
stdout
;
if
Sys
.
command
(
"find "
^
dir
^
" -maxdepth 3 -name ocamlcomp.sh -fprintf .try %h 2> /dev/null"
)
=
0
then
try
let
result
=
input_line
(
open_in
".try"
)
in
ignore
(
Sys
.
command
"rm .try"
)
;
print
(
"Found OCaml sources in"
^
result
^
"
\n
"
);
result
with
End_of_file
->
search_sources
tail
else
search_sources
tail
let
ml_interface
=
let
dir
=
!
(
List
.
assoc
"mliface"
vars
)
in
let
dir1
=
!
(
List
.
assoc
"mliface"
vars
)
in
let
dir
=
(
if
dir1
=
""
then
search_sources
src_dirs
else
dir1
)
in
if
dir
=
""
then
`no
else
let
file
=
if
native
then
"types.cmx"
else
"types.cmo"
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment