Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release-src > by-pkgid > b0b9dca144b9b32a560e0afa5395e006 > files > 1

ocamlduce-3.11.1.0-1mdv2010.1.src.rpm

From: Stephane Glondu <steph@glondu.net>
Date: Wed, 17 Jun 2009 10:06:38 +0200
Subject: [PATCH] Build and install native-code plugin

---
 Makefile       |    3 ++-
 mkocamlduce.sh |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index e8ca4fc..17ac494 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ CMI := $(MLI:.mli=.cmi) otherlibs/ocamlduce/cduce_types.cmi
 
 CMA := otherlibs/ocamlduce/ocamlduce.cma
 CMXA := $(CMA:.cma=.cmxa) $(CMA:.cma=.a)
+CMXS := $(CMA:.cma=.cmxs)
 
 TOPCMO := toplevel/toploop.cmo toplevel/topdirs.cmo \
   toplevel/topmain.cmo toplevel/topstart.cmo \
@@ -76,7 +77,7 @@ installbyte: installcommon-stamp
 installopt: installcommon-stamp
 	@echo "===> Installing native files... <==="
 	for X in $(OPT); do Y=$${X##*/}; Y=$${Y#ocaml}; install -m 755 _build/$$X $(BINDIR)/ocamlduce$$Y; done
-	install -m 644 $(addprefix _build/,$(CMXA)) $(DUCE_LIBDIR)
+	install -m 644 $(addprefix _build/,$(CMXA) $(CMXS)) $(DUCE_LIBDIR)
 
 clean:
 	build/distclean.sh
diff --git a/mkocamlduce.sh b/mkocamlduce.sh
index b677ae8..2dec75e 100755
--- a/mkocamlduce.sh
+++ b/mkocamlduce.sh
@@ -27,6 +27,7 @@ cd ..
 
 OCAMLDUCE_BYTE="otherlibs/ocamlduce/ocamlduce.cma"
 OCAMLDUCE_NATIVE="otherlibs/ocamlduce/ocamlduce.cmxa"
+OCAMLDUCE_SHARED="otherlibs/ocamlduce/ocamlduce.cmxs"
 
 INI_TARGETS="ocamlc tools/ocamldep.byte"
 ALL_TARGETS="$TOPLEVEL $OCAMLDUCE_BYTE $TOOLS_BYTE $OCAMLDOC_BYTE"
@@ -51,4 +52,5 @@ cp -p _build/tools/ocamldep.byte _build/tools/ocamldep
 if [ x"$HAS_NATIVE" = x"y" ]; then
   rm -f _build/tools/ocamldep.opt
   cp -p _build/tools/ocamldep.native _build/tools/ocamldep.opt
+  ocamlopt -shared -linkall -o "_build/$OCAMLDUCE_SHARED" "_build/$OCAMLDUCE_NATIVE"
 fi
--