]> matita.cs.unibo.it Git - helm.git/commitdiff
* disable-shared doens't bother ocaml
authorLuca Padovani <luca.padovani@unito.it>
Thu, 13 Mar 2003 10:44:35 +0000 (10:44 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Thu, 13 Mar 2003 10:44:35 +0000 (10:44 +0000)
helm/DEVEL/mathml_editor/LICENSE
helm/DEVEL/mathml_editor/configure.ac
helm/DEVEL/mathml_editor/ocaml/Makefile.am

index 122827fd6d818566f752aba1a1685fd4e381d763..ee8db273a896e7969ef7dc67abf7b21efaa4f027 100644 (file)
@@ -1,4 +1,5 @@
-// Copyright (C) 2002-2003, Luca Padovani <luca.padovani@cs.unibo.it>.
+// Copyright (C) 2002-2003, Luca Padovani <luca.padovani@cs.unibo.it>,
+//                    2003, Paolo Marinelli <pmarinel@cs.unibo.it>.
 //
 // This file is part of EdiTeX, an editor of mathematical
 // expressions based on TeX syntax
index 2ea4dfb15b522723787c00285aa1c62c0876efbe..17b35b57ea81075acfc6b646b10d250503f6a40c 100644 (file)
@@ -225,6 +225,7 @@ else
   OCAMLMKLIB=ocamlmklib
   AC_SUBST(OCAMLMKLIB)
 fi
+AM_CONDITIONAL(HAVE_SHAREDLIBS_COND, test x$enable_shared = xyes)
 
 AC_MSG_CHECKING(for gdome2 ocaml binding)
 ocamlfind query gdome2 ||
index 9962bf6b557c1c5eb2e8a12525703a6340e9fe3d..b43a0650eac71e4c12b8c40112a43ab1abb3fdb8 100644 (file)
@@ -5,7 +5,12 @@ OCAMLFIND = @OCAMLFIND@
 OCAMLC = $(OCAMLFIND) @OCAMLC@ -package "$(REQUIRES)"
 OCAMLOPT = $(OCAMLFIND) @OCAMLOPT@ -package "$(REQUIRES)"
 OCAMLDEP = $(OCAMLFIND) @OCAMLDEP@ -package "$(REQUIRES)"
-OCAMLMKLIB = @OCAMLMKLIB@
+if HAVE_SHAREDLIBS_COND
+OCAMLMKLIBFLAGS = 
+else
+OCAMLMKLIBFLAGS = -custom
+endif
+OCAMLMKLIB = @OCAMLMKLIB@ $(OCAMLMKLIBFLAGS)
 DLL = dll$(ARCHIVE).so
 OCAMLSTDLIBDIR = $(DESTDIR)/@OCAMLSTDLIBDIR@
 OCAMLSTUBDIR = $(DESTDIR)/@OCAMLSTUBDIR@
@@ -16,12 +21,12 @@ CMI_S = $(MODULES:%=%.cmi)
 CMO_S = $(MODULES:%=%.cmo)
 CMX_S = $(MODULES:%=%.cmx)
 O_S = ml_mathml_editor.o c_mathml_editor.o
+LO_S = $(O_S:%.o=%.lo)
 SHARED_LIBS = $(GMETADOM_LIBS) $(GDOMEXSLT_LIBS) -lmlgdome2-xslt -lmlgdome
-BYTE_STUFF = $(ARCHIVE).cma
+BYTE_STUFF = i_mathml_editor.cmi mathml_editor.cmi $(ARCHIVE).cma $(DLL)
 NATIVE_STUFF = $(ARCHIVE).cmxa $(ARCHIVE).a
-BYTE_INSTALL_STUFF =   \
-       i_mathml_editor.cmi mathml_editor.cmi $(ARCHIVE).cma $(DLL) META
-NATIVE_INSTALL_STUFF = $(ARCHIVE).a $(ARCHIVE).cmxa
+BYTE_INSTALL_STUFF = $(BYTE_STUFF) META
+NATIVE_INSTALL_STUFF = $(NATIVE_STUFF)
 
 EXTRA_DIST =   \
        META.in mathml_editor.ml i_mathml_editor.ml     \
@@ -33,17 +38,11 @@ else
 noinst_DATA = $(BYTE_STUFF)
 endif
 
-noinst_LTLIBRARIES = libmlmathml_editor.la
+noinst_LTLIBRARIES = libmlmathml-editor.la
 libmlmathml_editor_la_SOURCES = \
   c_mathml_editor.cc \
   ml_mathml_editor.c
 
-#test: test.ml $(ARCHIVE).cma
-#      $(OCAMLC) -o $@ -linkpkg $(INCLUDES) $<
-
-#test.opt: test.ml $(ARCHIVE).cmxa
-#      $(OCAMLOPT) -o $@ -linkpkg $(INCLUDES) $<
-
 if HAVE_OCAMLOPT_COND
 install-data-local:    $(BYTE_INSTALL_STUFF) $(NATIVE_INSTALL_STUFF)
 else
@@ -56,17 +55,28 @@ endif
 
 CLEANFILES =   \
        $(ARCHIVE).{cma,cmxa,a} $(CMI_S) $(CMO_S) $(CMX_S) ml_mathml_editor.o   \
-       $(DLL) $(INIT).cm[iox] libmlmathml_editor.a
+       $(DLL) $(INIT).cm[iox] libmlmathml-editor.a
 
 INCLUDES =     \
        $(GDOME_CFLAGS) $(MLGDOME_CFLAGS) \
        $(GMETADOM_CFLAGS) $(GDOMEXSLT_CFLAGS) \
        -I$(top_srcdir)/src
 
-$(ARCHIVE).cma $(DLL): $(CMO_S)
-       $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMO_S) $(O_S) $(SHARED_LIBS)
-$(ARCHIVE).cmxa $(ARCHIVE).a: $(CMX_S)
-       $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMX_S) $(O_S) $(SHARED_LIBS)
+$(ARCHIVE).cma: $(CMO_S)
+       $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMO_S) $(SHARED_LIBS)
+
+$(ARCHIVE).cmxa: $(CMX_S)
+       $(OCAMLMKLIB) -o $(ARCHIVE) -L@OCAMLSTUBDIR@ $(CMX_S) $(SHARED_LIBS)
+
+$(DLL) $(ARCHIVE).a: $(LO_S)
+       # use .lo for ocamlmklib
+       for f in $(LO_S); do    \
+               cp $$f $$f.o;   \
+       done
+       $(OCAMLMKLIB) -o $(ARCHIVE) $(GDOME_LIBS) $(LO_S:%=%.o)
+       for f in $(LO_S:%=%.o); do      \
+               rm $$f; \
+       done
 
 %.cmi: %.mli
        $(OCAMLC) -c $<