matitaDisambiguator.cmo \
matitaMathView.cmo \
matitaInterpreter.cmo
-CMXS = $(patsubst %.cmo,%.cmx,$(CMOS))
+
+LIB_DEPS = $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(REQUIRES))
all: matita
ifeq ($(HAVE_OCAMLOPT),yes)
+CMXS = $(patsubst %.cmo,%.cmx,$(CMOS))
+LIBX_DEPS = $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(REQUIRES))
opt: matita.opt
else
opt:
@echo "Native code compilation is disabled"
endif
-matita: $(CMOS) matita.ml
- $(OCAMLC) -linkpkg -o $@ $^
-matita.opt: $(CMXS) matita.ml
- $(OCAMLOPT) -linkpkg -o $@ $^
+matita: $(LIB_DEPS) $(CMOS) matita.ml
+ $(OCAMLC) -linkpkg -o $@ $(CMOS) matita.ml
+matita.opt: $(LIBX_DEPS) $(CMXS) matita.ml
+ $(OCAMLOPT) -linkpkg -o $@ $(CMXS) matita.ml
matitaGeneratedGui.ml matitaGeneratedGui.mli: matita.glade
$(LABLGLADECC) $< > matitaGeneratedGui.ml
let console_history_size = 100;;
let gtkrc = "@MATITA_GTKRC@";;
let base_uri = "cic:/matita";;
-module DB = @DBI_MODULE@;;
AC_MSG_ERROR(could not find camlp4o)
fi
-DBI_DRIVER="mysql"
-
FINDLIB_REQUIRES="\
lablgtk2.glade \
lablgtkmathview \
pcre \
-dbi.$DBI_DRIVER \
+mysql \
unix \
helm-cic_omdoc \
helm-cic_transformations \
fi
MATITA_GTKRC="matita.gtkrc"
-DBI_MODULE="Dbi_$DBI_DRIVER"
AC_SUBST(CAMLP4O)
AC_SUBST(DEBUG)
AC_SUBST(LABLGLADECC)
AC_SUBST(OCAMLFIND)
AC_SUBST(MATITA_GTKRC)
-AC_SUBST(DBI_MODULE)
AC_OUTPUT([
buildTimeConf.ml
<key name="auto_disambiguation">true</key>
</section>
<section name="db">
-<!-- <key name="host">mowgli.cs.unibo.it</key> -->
- <key name="host">localhost</key>
+ <key name="host">mowgli.cs.unibo.it</key>
+<!-- <key name="host">localhost</key> -->
<key name="user">helm</key>
<key name="database">mowgli</key>
</section>
<section name="getter">
<key name="mode">remote</key>
-<!-- <key name="url">http://mowgli.cs.unibo.it:58081/</key> -->
- <key name="url">http://localhost:58081/</key>
+ <key name="url">http://mowgli.cs.unibo.it:58081/</key>
+<!-- <key name="url">http://localhost:58081/</key> -->
</section>
</helm_registry>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
- <property name="default_width">300</property>
+ <property name="default_width">450</property>
<property name="default_height">800</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
open MatitaTypes
open MatitaMisc
-module DB = BuildTimeConf.DB
-
(** {2 Internal status} *)
let (get_proof, set_proof, has_proof) =
GtkMain.Rc.add_default_file BuildTimeConf.gtkrc;
GMain.Main.init ()
let parserr = new MatitaDisambiguator.parserr ()
-let dbh =
- new DB.connection ~host:(Helm_registry.get "db.host")
- ~user:(Helm_registry.get "db.user") (Helm_registry.get "db.database")
+let dbd =
+ Mysql.quick_connect
+ ~host:(Helm_registry.get "db.host")
+ ~user:(Helm_registry.get "db.user")
+ ~database:(Helm_registry.get "db.database")
+ ()
let gui = MatitaGui.instance ()
let disambiguator =
- new MatitaDisambiguator.disambiguator ~parserr ~dbh
+ new MatitaDisambiguator.disambiguator ~parserr ~dbd
~chooseUris:(interactive_user_uri_choice ~gui)
~chooseInterp:(interactive_interp_choice ~gui)
()
match gui#chooseFile () with
| None -> ()
| Some f when is_proof_script f ->
- gui#script#scriptTextView#buffer#set_text (input_file f)
+ gui#script#scriptTextView#buffer#set_text (input_file f);
+ gui#script#scriptWin#show ();
+ gui#main#showScriptMenuItem#set_active true
| Some f ->
gui#console#echo_error (sprintf
- "Don't know what to do with file: %s\nUnrecognized file format." f)))
+ "Don't know what to do with file: %s\nUnrecognized file format."
+ f)))
(** <DEBUGGING> *)
end
class disambiguator
- ~parserr ~dbh ~(chooseUris: MatitaTypes.choose_uris_callback)
+ ~parserr ~dbd ~(chooseUris: MatitaTypes.choose_uris_callback)
~(chooseInterp: MatitaTypes.choose_interp_callback) ()
=
let disambiguate_term =
| Some env -> (false, env)
| None -> (true, _env)
in
- match disambiguate_term ~dbh context metasenv termAst ~aliases:env with
+ match disambiguate_term ~dbd context metasenv termAst ~aliases:env with
| [ (env, metasenv, term) as x ] ->
if save_state then self#setEnv env;
x
class disambiguator:
parserr:MatitaTypes.parserr -> (** parser *)
- dbh:Dbi.connection ->
+ dbd:Mysql.dbd ->
chooseUris:MatitaTypes.choose_uris_callback ->
chooseInterp:MatitaTypes.choose_interp_callback ->
unit ->
win:GWindow.window -> check:GMenu.check_menu_item -> unit
val toggle_win:
- ?check:GMenu.check_menu_item -> GWindow.window -> (unit -> unit)
+ ?check:GMenu.check_menu_item -> GWindow.window -> unit -> unit
val add_key_binding: Gdk.keysym -> (unit -> 'a) -> GBin.event_box -> unit