Skip to content

Commit 5b98caf

Browse files
authored
flambda-backend: Revert "Restructure LIBDIR" (oxcaml#1093)
Revert "Restructure LIBDIR: Move Dynlink, Str and Unix to sub-directories (port PR#11198) (oxcaml#895)" This reverts commit 56db52f.
1 parent 46f1b16 commit 5b98caf

29 files changed

+103
-256
lines changed

.depend

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6257,7 +6257,6 @@ driver/compmisc.cmx : \
62576257
utils/clflags.cmx \
62586258
driver/compmisc.cmi
62596259
driver/compmisc.cmi : \
6260-
utils/load_path.cmi \
62616260
typing/env.cmi \
62626261
utils/clflags.cmi
62636262
driver/errors.cmo : \

Makefile.common-jst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,11 @@ install_for_test: _install
202202
done; \
203203
ln -s . lex; ln -s . yacc; \
204204
ln -s _install/lib/ocaml/compiler-libs compilerlibs; \
205-
mkdir -p otherlibs/{unix,dynlink/native,str,bigarray}; \
205+
mkdir -p otherlibs/{unix,dynlink/native,str}; \
206206
ln -s ../stdlib/threads otherlibs/systhreads; \
207-
$(cpl) stdlib/unix/{lib,}unix* otherlibs/unix; \
208-
$(cpl) stdlib/dynlink/dynlink* otherlibs/dynlink; \
209-
$(cpl) stdlib/str/{lib,}str* otherlibs/str; \
210-
${cpl} stdlib/bigarray/bigarray* otherlibs/bigarray; \
207+
$(cpl) stdlib/{lib,}unix* otherlibs/unix; \
208+
$(cpl) stdlib/dynlink* otherlibs/dynlink; \
209+
$(cpl) stdlib/{lib,}str* otherlibs/str; \
211210
ln -s ../_build/main/$(ocamldir)/toplevel/byte/.ocamltoplevel.objs/byte toplevel; \
212211
)
213212

@@ -219,7 +218,6 @@ install_for_test: _install
219218
cp $(main_build)/$(ocamldir)/.ocamlcommon.objs/byte/*.cmo _runtest/utils
220219
rm -f _runtest/utils/{topdirs,opttopdirs}.cmi
221220
cp _install/lib/ocaml/*.{cmi,cma,a,cmxa} _runtest/utils
222-
cp _install/lib/ocaml/{unix,str,dynlink,bigarray}/*.{cmi,cma,a,cmxa} _runtest/utils
223221
cp $(main_build)/$(ocamldir)/.ocamlcommon.objs/native/config.o _runtest/utils
224222
# Needed for tests/warnings
225223
cp $(ocamldir)/utils/warnings.ml _runtest/utils

compilerlibs/Makefile.compilerlibs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ UTILS = \
3131
utils/identifiable.cmo \
3232
utils/numbers.cmo \
3333
utils/arg_helper.cmo \
34-
utils/local_store.cmo \
35-
utils/load_path.cmo \
3634
utils/clflags.cmo \
3735
utils/profile.cmo \
36+
utils/local_store.cmo \
37+
utils/load_path.cmo \
3838
utils/terminfo.cmo \
3939
utils/ccomp.cmo \
4040
utils/warnings.cmo \

debugger/.depend

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ command_line.cmo : \
7272
debugger_lexer.cmi \
7373
debugger_config.cmi \
7474
debugcom.cmi \
75-
../driver/compmisc.cmi \
7675
checkpoints.cmi \
7776
breakpoints.cmi \
7877
command_line.cmi
@@ -110,7 +109,6 @@ command_line.cmx : \
110109
debugger_lexer.cmx \
111110
debugger_config.cmx \
112111
debugcom.cmx \
113-
../driver/compmisc.cmx \
114112
checkpoints.cmx \
115113
breakpoints.cmx \
116114
command_line.cmi
@@ -329,7 +327,6 @@ main.cmo : \
329327
exec.cmi \
330328
debugger_config.cmi \
331329
../utils/config.cmi \
332-
../driver/compmisc.cmi \
333330
command_line.cmi \
334331
../file_formats/cmi_format.cmi \
335332
../utils/clflags.cmi \
@@ -352,7 +349,6 @@ main.cmx : \
352349
exec.cmx \
353350
debugger_config.cmx \
354351
../utils/config.cmx \
355-
../driver/compmisc.cmx \
356352
command_line.cmx \
357353
../file_formats/cmi_format.cmx \
358354
../utils/clflags.cmx \
@@ -480,7 +476,6 @@ program_management.cmo : \
480476
history.cmi \
481477
../typing/envaux.cmi \
482478
debugger_config.cmi \
483-
../driver/compmisc.cmi \
484479
breakpoints.cmi \
485480
program_management.cmi
486481
program_management.cmx : \
@@ -498,7 +493,6 @@ program_management.cmx : \
498493
history.cmx \
499494
../typing/envaux.cmx \
500495
debugger_config.cmx \
501-
../driver/compmisc.cmx \
502496
breakpoints.cmx \
503497
program_management.cmi
504498
program_management.cmi :

debugger/command_line.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ let instr_dir ppf lexbuf =
262262
let new_directory = argument_list_eol argument lexbuf in
263263
if new_directory = [] then begin
264264
if yes_or_no "Reinitialize directory list" then begin
265-
Load_path.init ~auto_include:Compmisc.auto_include !default_load_path;
265+
Load_path.init !default_load_path;
266266
Envaux.reset_cache ~preserve_persistent_env:false;
267267
Hashtbl.clear Debugger_config.load_path_for;
268268
flush_buffer_list ()

debugger/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ let main () =
230230
if !Parameters.version
231231
then printf "\tOCaml Debugger version %s@.@." Config.version;
232232
Loadprinter.init();
233-
Load_path.init ~auto_include:Compmisc.auto_include !default_load_path;
233+
Load_path.init !default_load_path;
234234
Clflags.recursive_types := true; (* Allow recursive types. *)
235235
toplevel_loop (); (* Toplevel. *)
236236
kill_program ();

debugger/program_management.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ let initialize_loading () =
128128
end;
129129
Symbols.clear_symbols ();
130130
Symbols.read_symbols 0 !program_name;
131-
let dirs = Load_path.get_paths () @ !Symbols.program_source_dirs in
132-
Load_path.init ~auto_include:Compmisc.auto_include dirs;
131+
Load_path.init (Load_path.get_paths () @ !Symbols.program_source_dirs);
133132
Envaux.reset_cache ~preserve_persistent_env:false;
134133
if !debug_loading then
135134
prerr_endline "Opening a socket...";

driver/compenv.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ let read_one_param ppf position name v =
261261
| "noassert" -> set "noassert" [ noassert ] v
262262
| "noautolink" -> set "noautolink" [ no_auto_link ] v
263263
| "nostdlib" -> set "nostdlib" [ no_std_include ] v
264-
| "nocwd" -> set "nocwd" [ no_cwd ] v
265264
| "linkall" -> set "linkall" [ link_everything ] v
266265
| "nolabels" -> set "nolabels" [ classic ] v
267266
| "principal" -> set "principal" [ principal ] v

driver/compmisc.ml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@
1313
(* *)
1414
(**************************************************************************)
1515

16-
let auto_include find_in_dir fn =
17-
if !Clflags.no_std_include then
18-
raise Not_found
19-
else
20-
let alert = Location.auto_include_alert in
21-
Load_path.auto_include_otherlibs alert find_in_dir fn
22-
2316
(* Initialize the search path.
24-
[dir] (default: the current directory)
25-
is always searched first unless -nocwd is specified,
17+
[dir] is always searched first (default: the current directory),
2618
then the directories specified with the -I option (in command-line order),
2719
then the standard library directory (unless the -nostdlib option is given).
2820
*)
@@ -38,13 +30,8 @@ let init_path ?(dir="") () =
3830
!Compenv.first_include_dirs
3931
in
4032
let exp_dirs =
41-
List.map (Misc.expand_directory Config.standard_library) dirs
42-
in
43-
let dirs =
44-
(if !Clflags.no_cwd then [] else [dir])
45-
@ List.rev_append exp_dirs (Clflags.std_include_dir ())
46-
in
47-
Load_path.init ~auto_include dirs;
33+
List.map (Misc.expand_directory Config.standard_library) dirs in
34+
Load_path.init (dir :: List.rev_append exp_dirs (Clflags.std_include_dir ()));
4835
Env.reset_cache ~preserve_persistent_env:false
4936

5037
(* Return the initial environment in which compilation proceeds. *)

driver/compmisc.mli

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,3 @@ val read_clflags_from_env : unit -> unit
2222

2323
val with_ppf_dump : ?stdout:unit ->
2424
file_prefix:string -> (Format.formatter -> 'a) -> 'a
25-
26-
val auto_include :
27-
(Load_path.Dir.t -> string -> string option) -> string -> string
28-
(** [auto_include find_in_dir fn] is a callback function to be passed to
29-
{!Load_path.init} and automatically adds [-I +lib] to the load path after
30-
displaying an alert. *)
31-

0 commit comments

Comments
 (0)