From: Claudio Sacerdoti Coen Date: Wed, 6 Mar 2002 15:35:45 +0000 (+0000) Subject: Dynamic loading of C code enabled. X-Git-Tag: V_0_3_0_debian_8~243 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=8e69e53f37a1f8ee35fea2a9274ec49eb5d8d5c8;p=helm.git Dynamic loading of C code enabled. --- diff --git a/helm/DEVEL/lablgtkmathview/META.in b/helm/DEVEL/lablgtkmathview/META.in index c38ad22dc..f312805fd 100644 --- a/helm/DEVEL/lablgtkmathview/META.in +++ b/helm/DEVEL/lablgtkmathview/META.in @@ -1,4 +1,4 @@ -requires="gdome lablgtk" +requires="gdome2 lablgtk" version="@VERSION@" archive(byte)="lablgtkmathview.cma ml_gtk_mathview.o" archive(native)="lablgtkmathview.cmxa ml_gtk_mathview.o" diff --git a/helm/DEVEL/lablgtkmathview/Makefile.in b/helm/DEVEL/lablgtkmathview/Makefile.in index 9bfde70c1..defa0b999 100644 --- a/helm/DEVEL/lablgtkmathview/Makefile.in +++ b/helm/DEVEL/lablgtkmathview/Makefile.in @@ -11,7 +11,7 @@ DIST_FILES = \ configure.in gMathView.ml gtkMathView.ml gtk_mathview.ml \ ml_gtk_mathview.c META.in DOC_FILES = AUTHORS COPYING ChangeLog NEWS README -REQUIRES = gdome lablgtk +REQUIRES = gdome2 lablgtk PREDICATES = MLFLAGS = -labels @@ -20,16 +20,17 @@ OCAMLOPT = ocamlfind ocamlopt $(MLFLAGS) OCAMLDEP = ocamldep ARCHIVE = $(PACKAGE).cma -ARCHIVE_C = $(PACKAGE).a +ARCHIVE_A = $(PACKAGE).a +ARCHIVE_SO = dll$(PACKAGE).so ARCHIVE_OPT = $(PACKAGE).cmxa TESTDIR = ./test TMPDIR = .test TMPPKGDIR = $(TMPDIR)/$(PACKAGE) -all: $(OBJECTS_C) $(ARCHIVE) $(TESTDIR)/test +all: $(ARCHIVE) $(ARCHIVE_SO) $(TESTDIR)/test -opt: $(OBJECTS_C) $(ARCHIVE_OPT) $(TESTDIR)/test.opt +opt: $(OBJECTS_C) $(ARCHIVE_OPT) $(ARCHIVE_A) $(ARCHIVE_SO) $(TESTDIR)/test.opt dist: rm -rf $(PACKAGE)-$(VERSION) @@ -39,7 +40,7 @@ dist: rm -rf $(PACKAGE)-$(VERSION) ml_gtk_mathview.o: ml_gtk_mathview.c - gcc -c -I$(INCLUDEDIR) `ocamlfind query -i-format lablgtk` `glib-config --cflags` `gtk-config --cflags` `gtkmathview-config --cflags` `gdome-config --cflags` `ocamlfind query -i-format gdome` $< + gcc -c -I$(INCLUDEDIR) `ocamlfind query -i-format lablgtk` `glib-config --cflags` `gtk-config --cflags` `gtkmathview-config --cflags` `gdome-config --cflags` `ocamlfind query -i-format gdome2` $< .SUFFIXES: .cmo .cmi .cmx .ml .mli @@ -57,37 +58,40 @@ depend: *.ml *.mli $(OCAMLDEP) *.ml *.mli >.depend include .depend -$(ARCHIVE): $(OBJECTS) - $(OCAMLC) -a -custom -package "$(REQUIRES)" \ +$(ARCHIVE): $(OBJECTS) $(ARCHIVE_SO) + $(OCAMLC) -a -package "$(REQUIRES)" \ -predicates "$(PREDICATES)" -o $@ $^ \ - -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" - -$(ARCHIVE_OPT): $(OBJECTS_OPT) + -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" -dllib -l$(PACKAGE) +$(ARCHIVE_OPT) $(ARCHIVE_A): $(OBJECTS_OPT) $(OCAMLOPT) -a -package "$(REQUIRES)" \ -predicates "$(PREDICATES)" -o $@ $^ \ -cclib "`glib-config --libs` `gdome-config --libs` `gtkmathview-config --libs`" +$(ARCHIVE_SO): $(OBJECTS_C) + gcc -shared -o $@ $< `gtkmathview-config --libs` -lmlgdome -L `ocamlfind query gdome2` + + $(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE) $(TESTDIR)/test.ml mkdir -p $(TMPPKGDIR) cp $(OBJECTS_C) $(ARCHIVE) $(INST) $(TMPPKGDIR) cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make rm -r $(TMPDIR) -$(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE_C) $(ARCHIVE_OPT) $(TESTDIR)/test.ml +$(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE_A) $(ARCHIVE_OPT) $(TESTDIR)/test.ml mkdir -p $(TMPPKGDIR) - cp $(OBJECTS_C) $(ARCHIVE_C) $(ARCHIVE_OPT) $(INST) $(TMPPKGDIR) + cp $(OBJECTS_C) $(ARCHIVE_A) $(ARCHIVE_OPT) $(INST) $(TMPPKGDIR) cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt rm -r $(TMPDIR) install: - test ! -f $(ARCHIVE_OPT) || extra="$(ARCHIVE_C) $(ARCHIVE_OPT)" ; \ - ocamlfind install $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(INST) $$extra + test ! -f $(ARCHIVE_OPT) || extra="$(ARCHIVE_A) $(ARCHIVE_OPT)" ; \ + ocamlfind install $(PACKAGE) $(OBJECTS_C) $(ARCHIVE) $(ARCHIVE_SO) $(INST) $$extra uninstall: ocamlfind remove $(PACKAGE) clean: - rm -f *.o *.cm? $(ARCHIVE) $(ARCHIVE_C) $(ARCHIVE_OPT) + rm -f *.o *.cm? $(ARCHIVE) $(ARCHIVE_A) $(ARCHIVE_SO) $(ARCHIVE_OPT) cd $(TESTDIR) ; make clean rm -rf $(TMPDIR) diff --git a/helm/DEVEL/lablgtkmathview/configure.in b/helm/DEVEL/lablgtkmathview/configure.in index d9bb91ac2..026e0253e 100644 --- a/helm/DEVEL/lablgtkmathview/configure.in +++ b/helm/DEVEL/lablgtkmathview/configure.in @@ -23,9 +23,9 @@ if test $HAVE_OCAMLFIND = "no"; then AC_MSG_ERROR(could not find ocamlfind in PATH, please make sure findlib is installed) fi -AC_MSG_CHECKING("for gdome") -ocamlfind query gdome || - AC_MSG_ERROR(gdome not installed (according to findlib)) +AC_MSG_CHECKING("for gdome2") +ocamlfind query gdome2 || + AC_MSG_ERROR(gdome2 not installed (according to findlib)) AC_MSG_CHECKING("for lablgtk") ocamlfind query lablgtk || diff --git a/helm/DEVEL/lablgtkmathview/test/test.xml b/helm/DEVEL/lablgtkmathview/test/test.xml index 5f9ce9fc6..97506d16d 100644 --- a/helm/DEVEL/lablgtkmathview/test/test.xml +++ b/helm/DEVEL/lablgtkmathview/test/test.xml @@ -1,126 +1,134 @@ - - - - - - - It's a secret! - - - a - - x - - + - b - - - - - x - 2 - - + - - p - - x - - + - q - - - - d - x - = - - - a2 - - - ln - - - ( - - x2 - + - - p - - x - - + - q - - ) - - - - + - - - - - 2 - - b - - - - - a - - p - - - - - - 4 - - q - - - - - p - 2 - - - - - - - arctg - - - - - 2 - - x - - + - p - - - - - 4 - - q - - - - - p - 2 - - - - - - - + - c - - + + + + + +]> + + + + + + + + It's a secret! + + + a + + x + + + + b + + + + + x + 2 + + + + + p + + x + + + + q + + + + d + x + = + + + a2 + + + ln + + + ( + + x2 + + + + p + + x + + + + q + + ) + + + + + + + + + + 2 + + b + + - + + a + + p + + + + + + 4 + + q + + - + + p + 2 + + + + + + + arctg + + + + + 2 + + x + + + + p + + + + + 4 + + q + + - + + p + 2 + + + + + + + + + c + +