]> matita.cs.unibo.it Git - helm.git/commitdiff
Dynamic loading of C code enabled.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 6 Mar 2002 15:35:45 +0000 (15:35 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 6 Mar 2002 15:35:45 +0000 (15:35 +0000)
helm/DEVEL/lablgtkmathview/META.in
helm/DEVEL/lablgtkmathview/Makefile.in
helm/DEVEL/lablgtkmathview/configure.in
helm/DEVEL/lablgtkmathview/test/test.xml

index c38ad22dc82fda6d30ba69b2595244981826a95c..f312805fdde0889e05b44ea680a334e9a93e00c4 100644 (file)
@@ -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"
index 9bfde70c129d40b7f73edf5f2f8c0fb269b4853e..defa0b999acdd0995e09240b77eac9eb6bdd3573 100644 (file)
@@ -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)
 
index d9bb91ac2782efe87c3b19859a7ce0a7964feee0..026e0253e55f2edfac2ee6cd3c709671eb179aa2 100644 (file)
@@ -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 ||
index 5f9ce9fc6da43b0c5968fd1f324544555fe31220..97506d16d0287018d544de90152751d386ba6ac1 100644 (file)
-<math display="block">
-  <mrow helm:xref="SELECTION OK">
-    <mo>&int;</mo>
-    <mo>&ApplyFunction;</mo>
-    <mfrac>
-      <maction>
-       <mtext>It's a secret!</mtext>
-       <mrow>
-         <mrow>
-           <mi>a</mi>
-          <mo>&InvisibleTimes;</mo>
-          <mi>x</mi>
-        </mrow>
-        <mo>+</mo>
-        <mi>b</mi>
-       </mrow>
-      </maction>
-      <mrow>
-        <msup>
-         <mi>x</mi>
-         <mn>2</mn>
-       </msup>
-       <mo>+</mo>
-       <mrow>
-         <mi>p</mi>
-         <mo>&InvisibleTimes;</mo>
-         <mi>x</mi>
-       </mrow>
-       <mo>+</mo>
-       <mi>q</mi>
-      </mrow>
-    </mfrac>
-  </mrow>
-  <mo fontstyle="italic">d</mo>
-  <mi>x</mi>
-  <mo>=</mo>
-  <mrow>
-    <mrow>
-      <mfrac><mi>a</mi><mn>2</mn></mfrac>
-      <mo>&InvisibleTimes;</mo>
-      <mrow>
-        <mi>ln</mi>
-       <mo>&ApplyFunction;</mo>
-       <mrow>
-         <mo>(</mo>
-         <mrow>
-           <msup><mi>x</mi><mn>2</mn></msup>
-           <mo>+</mo>
-           <mrow>
-             <mi>p</mi>
-             <mo>&InvisibleTimes;</mo>
-             <mi>x</mi>
-           </mrow>
-           <mo>+</mo>
-           <mi>q</mi>
-         </mrow>
-         <mo>)</mo>
-       </mrow>
-      </mrow>
-    </mrow>
-    <mo>+</mo>
-    <mrow>
-      <mfrac>
-        <mrow>
-         <mrow>
-           <mn>2</mn>
-           <mo>&InvisibleTimes;</mo>
-           <mi>b</mi>
-         </mrow>
-         <mo>-</mo>
-         <mrow>
-           <mi>a</mi>
-           <mo>&InvisibleTimes;</mo>
-           <mi>p</mi>
-         </mrow>
-       </mrow>
-       <msqrt>
-         <mrow>
-           <mrow>
-             <mn>4</mn>
-             <mo>&InvisibleTimes;</mo>
-             <mi>q</mi>
-           </mrow>
-           <mo>-</mo>
-           <msup>
-             <mi>p</mi>
-             <mn>2</mn>
-           </msup>
-         </mrow>
-       </msqrt>
-      </mfrac>
-      <mo>&InvisibleTimes;</mo>
-      <mrow>
-        <mi xlink:href="JUMPS WORK">arctg</mi>
-       <mo>&ApplyFunction;</mo>
-       <mfrac>
-         <mrow>
-           <mrow>
-             <mn>2</mn>
-             <mo>&InvisibleTimes;</mo>
-             <mi>x</mi>
-           </mrow>
-           <mo>+</mo>
-           <mi>p</mi>
-         </mrow>
-         <msqrt>
-           <mrow>
-             <mrow>
-               <mn>4</mn>
-               <mo>&InvisibleTimes;</mo>
-               <mi>q</mi>
-             </mrow>
-             <mo>-</mo>
-             <msup>
-               <mi>p</mi>
-               <mn>2</mn>
-             </msup>
-           </mrow>
-         </msqrt>
-       </mfrac>
-      </mrow>
-    </mrow>
-    <mo>+</mo>
-    <mi>c</mi>
-  </mrow>  
-</math>
+<?xml version="1.0"?>
+
+<!DOCTYPE m:math [
+ <!ENTITY InvisibleTimes "&#x02062;">
+ <!ENTITY ApplyFunction "&#x02061;">
+ <!ENTITY int "&#x0222B;">
+]>
+
+<m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
+  <m:mrow helm:xref="SELECTION OK">
+    <m:mo>&int;</m:mo>
+    <m:mo>&ApplyFunction;</m:mo>
+    <m:mfrac>
+      <m:maction>
+       <m:mtext>It's a secret!</m:mtext>
+       <m:mrow>
+         <m:mrow>
+           <m:mi>a</m:mi>
+          <m:mo>&InvisibleTimes;</m:mo>
+          <m:mi>x</m:mi>
+        </m:mrow>
+        <m:mo>+</m:mo>
+        <m:mi>b</m:mi>
+       </m:mrow>
+      </m:maction>
+      <m:mrow>
+        <m:msup>
+         <m:mi>x</m:mi>
+         <m:mn>2</m:mn>
+       </m:msup>
+       <m:mo>+</m:mo>
+       <m:mrow>
+         <m:mi>p</m:mi>
+         <m:mo>&InvisibleTimes;</m:mo>
+         <m:mi>x</m:mi>
+       </m:mrow>
+       <m:mo>+</m:mo>
+       <m:mi>q</m:mi>
+      </m:mrow>
+    </m:mfrac>
+  </m:mrow>
+  <m:mo fontstyle="italic">d</m:mo>
+  <m:mi>x</m:mi>
+  <m:mo>=</m:mo>
+  <m:mrow>
+    <m:mrow>
+      <m:mfrac><m:mi>a</m:mi><m:mn>2</m:mn></m:mfrac>
+      <m:mo>&InvisibleTimes;</m:mo>
+      <m:mrow>
+        <m:mi>ln</m:mi>
+       <m:mo>&ApplyFunction;</m:mo>
+       <m:mrow>
+         <m:mo>(</m:mo>
+         <m:mrow>
+           <m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup>
+           <m:mo>+</m:mo>
+           <m:mrow>
+             <m:mi>p</m:mi>
+             <m:mo>&InvisibleTimes;</m:mo>
+             <m:mi>x</m:mi>
+           </m:mrow>
+           <m:mo>+</m:mo>
+           <m:mi>q</m:mi>
+         </m:mrow>
+         <m:mo>)</m:mo>
+       </m:mrow>
+      </m:mrow>
+    </m:mrow>
+    <m:mo>+</m:mo>
+    <m:mrow>
+      <m:mfrac>
+        <m:mrow>
+         <m:mrow>
+           <m:mn>2</m:mn>
+           <m:mo>&InvisibleTimes;</m:mo>
+           <m:mi>b</m:mi>
+         </m:mrow>
+         <m:mo>-</m:mo>
+         <m:mrow>
+           <m:mi>a</m:mi>
+           <m:mo>&InvisibleTimes;</m:mo>
+           <m:mi>p</m:mi>
+         </m:mrow>
+       </m:mrow>
+       <m:msqrt>
+         <m:mrow>
+           <m:mrow>
+             <m:mn>4</m:mn>
+             <m:mo>&InvisibleTimes;</m:mo>
+             <m:mi>q</m:mi>
+           </m:mrow>
+           <m:mo>-</m:mo>
+           <m:msup>
+             <m:mi>p</m:mi>
+             <m:mn>2</m:mn>
+           </m:msup>
+         </m:mrow>
+       </m:msqrt>
+      </m:mfrac>
+      <m:mo>&InvisibleTimes;</m:mo>
+      <m:mrow>
+        <m:mi xlink:href="JUMPS WORK">arctg</m:mi>
+       <m:mo>&ApplyFunction;</m:mo>
+       <m:mfrac>
+         <m:mrow>
+           <m:mrow>
+             <m:mn>2</m:mn>
+             <m:mo>&InvisibleTimes;</m:mo>
+             <m:mi>x</m:mi>
+           </m:mrow>
+           <m:mo>+</m:mo>
+           <m:mi>p</m:mi>
+         </m:mrow>
+         <m:msqrt>
+           <m:mrow>
+             <m:mrow>
+               <m:mn>4</m:mn>
+               <m:mo>&InvisibleTimes;</m:mo>
+               <m:mi>q</m:mi>
+             </m:mrow>
+             <m:mo>-</m:mo>
+             <m:msup>
+               <m:mi>p</m:mi>
+               <m:mn>2</m:mn>
+             </m:msup>
+           </m:mrow>
+         </m:msqrt>
+       </m:mfrac>
+      </m:mrow>
+    </m:mrow>
+    <m:mo>+</m:mo>
+    <m:mi>c</m:mi>
+  </m:mrow>  
+</m:math>