Skip to content
This repository was archived by the owner on Nov 13, 2021. It is now read-only.

Commit 0629b61

Browse files
author
notin
committed
Suppression de l'option -dump-glob et ajout d'une option -no-glob
git-svn-id: svn://scm.gforge.inria.fr/svn/coq/trunk@11167 85f007b7-540e-0410-9357-904b9bb8a0f7
1 parent e79db18 commit 0629b61

10 files changed

+41
-24
lines changed

Makefile.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ states/initial.coq: states/MakeInitial.v $(INITVO) $(VO_TOOLS_STRICT) | states/M
563563
theories/Init/%.vo theories/Init/%.glob: theories/Init/%.v $(VO_TOOLS_STRICT) | theories/Init/%.v.d $(VO_TOOLS_ORDER_ONLY)
564564
$(SHOW)'COQC -nois $<'
565565
$(HIDE)rm -f theories/Init/$*.glob
566-
$(HIDE)$(BOOTCOQTOP) -dump-glob theories/Init/$*.glob -nois -compile theories/Init/$*
566+
$(HIDE)$(BOOTCOQTOP) -nois -compile theories/Init/$*
567567

568568
theories/Numbers/Natural/BigN/NMake.v: theories/Numbers/Natural/BigN/NMake_gen.ml
569569
$(OCAML) $< > $@
@@ -875,7 +875,7 @@ endif
875875
%.vo %.glob: %.v states/initial.coq $(VO_TOOLS_STRICT) | %.v.d $(VO_TOOLS_ORDER_ONLY)
876876
$(SHOW)'COQC $<'
877877
$(HIDE)rm -f $*.glob
878-
$(HIDE)$(BOOTCOQTOP) -dump-glob $*.glob -compile $*
878+
$(HIDE)$(BOOTCOQTOP) -compile $*
879879
ifdef VALIDATE
880880
$(SHOW)'COQCHK $(shell basename $*)'
881881
$(HIDE)$(BESTCHICKEN) -silent -norec $(shell basename $*) \

Makefile.common

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ COQIDECMX:=$(COQIDECMO:.cmo=.cmx)
357357
COQMKTOPCMO:=$(CONFIG) scripts/tolink.cmo scripts/coqmktop.cmo
358358

359359
COQMKTOPCMX:=config/coq_config.cmx scripts/tolink.cmx scripts/coqmktop.cmx
360-
COQCCMO:=$(CONFIG) toplevel/usage.cmo scripts/coqc.cmo
361-
COQCCMX:=config/coq_config.cmx toplevel/usage.cmx scripts/coqc.cmx
360+
COQCCMO:=$(CONFIG) toplevel/usage.cmo lib/pp_control.cmo lib/pp.cmo scripts/coqc.cmo
361+
COQCCMX:=config/coq_config.cmx toplevel/usage.cmx lib/pp_control.cmx lib/pp.cmx scripts/coqc.cmx
362362

363363
INTERFACE:=\
364364
contrib/interface/vtp.cmo contrib/interface/xlate.cmo \

lib/flags.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ let is_unsafe s = Stringset.mem s !unsafe_set
8484

8585
(* Dump of globalization (to be used by coqdoc) *)
8686

87+
let noglob = ref false
8788
let dump = ref false
8889
let dump_file = ref ""
8990
let dump_into_file f = dump := true; dump_file := f
@@ -94,9 +95,10 @@ let dump_string = Buffer.add_string dump_buffer
9495

9596
let dump_it () =
9697
if !dump then begin
97-
let mode = [Open_wronly; Open_append; Open_creat] in
98+
let mode = [Open_wronly; Open_creat] in
9899
let c = open_out_gen mode 0o666 !dump_file in
99100
output_string c (Buffer.contents dump_buffer);
101+
Buffer.clear dump_buffer;
100102
close_out c
101103
end
102104

lib/flags.mli

+2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ val is_unsafe : string -> bool
5959

6060
(* Dump of globalization (to be used by coqdoc) *)
6161

62+
val noglob : bool ref
6263
val dump : bool ref
6364
val dump_into_file : string -> unit
6465
val dump_string : string -> unit
66+
val dump_it : unit -> unit
6567

6668
(* Options for the virtual machine *)
6769

scripts/coqc.ml

+5-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ let parse_args () =
141141
| ("-I"|"-include"|"-outputstate"
142142
|"-inputstate"|"-is"|"-load-vernac-source"|"-l"|"-load-vernac-object"
143143
|"-load-ml-source"|"-require"|"-load-ml-object"|"-user"
144-
|"-init-file"|"-dump-glob" as o) :: rem ->
144+
|"-init-file" as o) :: rem ->
145145
begin
146146
match rem with
147147
| s :: rem' -> parse (cfiles,s::o::args) rem'
@@ -151,13 +151,16 @@ let parse_args () =
151151

152152
| ("-notactics"|"-debug"|"-nolib"
153153
| "-debugVM"|"-alltransp"|"-VMno"
154-
|"-batch"|"-nois"
154+
|"-batch"|"-nois" | "-noglob" | "-no-glob"
155155
|"-q"|"-full"|"-profile"|"-just-parsing"|"-echo" |"-unsafe"|"-quiet"
156156
|"-silent"|"-m"|"-xml"|"-v7"|"-v8"|"-translate" |"-strict-implicit"
157157
|"-dont-load-proofs"|"-impredicative-set"|"-vm"
158158
| "-unboxed-values" | "-unboxed-definitions" | "-draw-vm-instr"
159159
as o) :: rem ->
160160
parse (cfiles,o::args) rem
161+
162+
| "-dump-glob" :: _ :: rem -> Pp.msg_warning (Pp.str "option -dumpglob is obsolete"); parse (cfiles,args) rem
163+
161164
| "-where" :: _ ->
162165
let coqlib =
163166
try Sys.getenv "COQLIB" with Not_found -> Coq_config.coqlib

tools/coq_makefile.ml4

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ let implicit () =
136136
print "%.ml.d: %.ml\n";
137137
print "\t$(CAMLBIN)ocamldep -slash $(ZFLAGS) $(PP) \"$<\" > \"$@\"\n\n"
138138
and v_rule () =
139-
print "%.vo %.glob: %.v\n\t$(COQC) -dump-glob $*.glob $(COQDEBUG) $(COQFLAGS) $*\n\n";
139+
print "%.vo %.glob: %.v\n\t$(COQC) $(COQDEBUG) $(COQFLAGS) $*\n\n";
140140
print "%.vi: %.v\n\t$(COQC) -i $(COQDEBUG) $(COQFLAGS) $*\n\n";
141141
print "%.g: %.v\n\t$(GALLINA) $<\n\n";
142142
print "%.tex: %.v\n\t$(COQDOC) -latex $< -o $@\n\n";
143-
print "%.html: %.v %.glob\n\t$(COQDOC) -glob-from $*.glob -html $< -o $@\n\n";
143+
print "%.html: %.v %.glob\n\t$(COQDOC) -html $< -o $@\n\n";
144144
print "%.g.tex: %.v\n\t$(COQDOC) -latex -g $< -o $@\n\n";
145-
print "%.g.html: %.v %.glob\n\t$(COQDOC) -glob-from $*.glob -html -g $< -o $@\n\n";
145+
print "%.g.html: %.v %.glob\n\t$(COQDOC) -html -g $< -o $@\n\n";
146146
print "%.v.d: %.v\n";
147-
print "\t$(COQDEP) -glob -slash $(COQLIBS) \"$<\" > \"$@\" || ( RV=$$?; rm -f \"$@\"; exit $${RV} )\n\n"
147+
print "\t$(COQDEP) -slash $(COQLIBS) \"$<\" > \"$@\" || ( RV=$$?; rm -f \"$@\"; exit $${RV} )\n\n"
148148
in
149149
if !some_mlfile then ml_rules ();
150150
if !some_vfile then v_rule ()

tools/coqdep.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let option_D = ref false
2222
let option_w = ref false
2323
let option_i = ref false
2424
let option_sort = ref false
25-
let option_glob = ref false
25+
let option_noglob = ref false
2626
let option_slash = ref false
2727
let option_boot = ref false
2828

@@ -375,7 +375,7 @@ let mL_dependencies () =
375375
let coq_dependencies () =
376376
List.iter
377377
(fun (name,_) ->
378-
let glob = if !option_glob then " "^name^".glob" else "" in
378+
let glob = if !option_noglob then "" else " "^name^".glob" in
379379
printf "%s%s%s: %s.v" name !suffixe glob name;
380380
traite_fichier_Coq true (name ^ ".v");
381381
printf "\n";
@@ -503,7 +503,7 @@ let rec parse = function
503503
| "-i" :: ll -> option_i := true; parse ll
504504
| "-boot" :: ll -> option_boot := true; parse ll
505505
| "-sort" :: ll -> option_sort := true; parse ll
506-
| "-glob" :: ll -> option_glob := true; parse ll
506+
| "-noglob" :: ll | "-no-glob" :: ll -> option_noglob := true; parse ll
507507
| "-I" :: r :: ll -> add_dir add_known r []; parse ll
508508
| "-I" :: [] -> usage ()
509509
| "-R" :: r :: ln :: ll -> add_rec_dir add_known r [ln]; parse ll

toplevel/coqtop.ml

+6-2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ let compile_files () =
113113
(fun (v,f) ->
114114
States.unfreeze init_state;
115115
Constrintern.coqdoc_unfreeze coqdoc_init_state;
116+
if !Flags.noglob then
117+
Flags.dump := false
118+
else
119+
Flags.dump_into_file (f^".glob");
116120
if Flags.do_translate () then
117121
with_option translate_file (Vernac.compile v) f
118122
else
@@ -231,8 +235,8 @@ let parse_args is_ide =
231235
| "-load-vernac-object" :: f :: rem -> add_vernac_obj f; parse rem
232236
| "-load-vernac-object" :: [] -> usage ()
233237

234-
| "-dump-glob" :: f :: rem -> dump_into_file f; parse rem
235-
| "-dump-glob" :: [] -> usage ()
238+
| "-dump-glob" :: _ :: rem -> warning "option -dumpglob is obsolete"; parse rem
239+
| ("-no-glob" | "-noglob") :: rem -> Flags.noglob := true; parse rem
236240

237241
| "-require" :: f :: rem -> add_require f; parse rem
238242
| "-require" :: [] -> usage ()

toplevel/usage.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let print_usage_channel co command =
5353
-batch batch mode (exits just after arguments parsing)
5454
-boot boot mode (implies -q and -batch)
5555
-emacs tells Coq it is executed under Emacs
56-
-dump-glob f dump globalizations in file f (to be used by coqdoc)
56+
-no-glob f do not dump globalizations
5757
-with-geoproof (yes|no) to (de)activate special functions for Geoproof within Coqide (default is yes)
5858
-impredicative-set set sort Set impredicative
5959
-dont-load-proofs don't load opaque proofs in memory

toplevel/vernac.ml

+13-7
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,17 @@ let load_vernac verb file =
226226
(* Compile a vernac file (f is assumed without .v suffix) *)
227227
let compile verbosely f =
228228
let ldir,long_f_dot_v = Library.start_library f in
229-
if !dump then dump_string ("F" ^ Names.string_of_dirpath ldir ^ "\n");
230-
if !Flags.xml_export then !xml_start_library ();
231-
let _ = load_vernac verbosely long_f_dot_v in
232-
if Pfedit.get_all_proof_names () <> [] then
233-
(message "Error: There are pending proofs"; exit 1);
234-
if !Flags.xml_export then !xml_end_library ();
235-
Library.save_library_to ldir (long_f_dot_v ^ "o")
229+
let dumpstate = !Flags.dump in
230+
if not !Flags.noglob then
231+
(Flags.dump_into_file (f ^ ".glob");
232+
Flags.dump_string ("F" ^ Names.string_of_dirpath ldir ^ "\n"));
233+
if !Flags.xml_export then !xml_start_library ();
234+
let _ = load_vernac verbosely long_f_dot_v in
235+
if Pfedit.get_all_proof_names () <> [] then
236+
(message "Error: There are pending proofs"; exit 1);
237+
if !Flags.xml_export then !xml_end_library ();
238+
if !Flags.dump then Flags.dump_it ();
239+
Flags.dump := dumpstate;
240+
Library.save_library_to ldir (long_f_dot_v ^ "o")
241+
236242

0 commit comments

Comments
 (0)