[Pkg-ocaml-maint-commits] [SCM] ocaml-melt packaging branch, master, updated. debian/1.3.0-1-1-gd3822da

Stephane Glondu steph at glondu.net
Sun Feb 13 22:23:23 UTC 2011


The following commit has been merged in the master branch:
commit d3822da8d18373cb7a2e3646b9d91a3cd4a102b1
Author: Stephane Glondu <steph at glondu.net>
Date:   Sun Feb 13 17:40:51 2011 +0100

    Add patch to support bytecode architectures (Closes: #613058)

diff --git a/debian/changelog b/debian/changelog
index 72560b4..1077993 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ocaml-melt (1.3.0-2) unstable; urgency=low
+
+  * Add patch to support bytecode architectures (Closes: #613058)
+
+ -- Stéphane Glondu <glondu at debian.org>  Sun, 13 Feb 2011 18:15:25 +0100
+
 ocaml-melt (1.3.0-1) unstable; urgency=low
 
   * Initial release (Closes: #567885)
diff --git a/debian/patches/0003-Support-for-bytecode-architectures.patch b/debian/patches/0003-Support-for-bytecode-architectures.patch
new file mode 100644
index 0000000..fe84c41
--- /dev/null
+++ b/debian/patches/0003-Support-for-bytecode-architectures.patch
@@ -0,0 +1,100 @@
+From: Stephane Glondu <steph at glondu.net>
+Date: Sun, 13 Feb 2011 17:13:26 +0100
+Subject: [PATCH] Support for bytecode architectures
+
+ * Fix also detection of native dynlink.
+ * In meltbuild, compile to bytecode by default, and provide -native
+   option instead of -byte.
+
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613058
+Signed-off-by: Stephane Glondu <steph at glondu.net>
+---
+ Makefile        |    7 +++++++
+ configure.ml    |    4 +---
+ man/meltbuild.1 |    4 ++--
+ melt/tool.ml    |    4 ++--
+ 4 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 9bc24af..99ef55e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -37,12 +37,19 @@ ifeq ($(TERM), dumb)
+ 	OB := $(OBCLASSIC)
+ endif
+ 
++HAS_OCAMLOPT := $(shell if which ocamlopt > /dev/null; then echo yes; else echo no; fi)
++NATDYNLINK := $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi)
++
+ #################################################################################
+ BYTE = latex/latex.cma melt/melt.cma melt/tool.byte latop/latop.byte meltpp/main.byte
++ifeq ($(HAS_OCAMLOPT),yes)
+ NATIVE := latex/latex.cmxa melt/melt.cmxa melt/tool.native latop/latop.native
+ ifeq ($(NATDYNLINK), YES)
+ 	NATIVE := $(NATIVE) meltpp/main.native
+ endif
++else
++NATIVE :=
++endif
+ DOC = latex/latex.docdir/index.html melt/melt.docdir/index.html
+ BENCHPLUGS = bench/plugs/quot.cma
+ 
+diff --git a/configure.ml b/configure.ml
+index 2fdf6ea..f7df595 100644
+--- a/configure.ml
++++ b/configure.ml
+@@ -73,15 +73,13 @@ compiler version (%s)" s v ocaml_version;
+       (String.uppercase name)
+   in
+ 
+-  ocaml_var "ocamlopt";
++  if (try Sys.getenv "HAS_OCAMLOPT" with Not_found -> "no") = "yes" then ocaml_var "ocamlopt";
+   ocaml_var "ocamlbuild";
+   ocaml_var "ocaml";
+   ocaml_var "ocamllex";
+   ocaml_var "ocamlyacc";
+   ocaml_var "ocamldoc";
+ 
+-  BVar.usimple "NATDYNLINK" (Version.ge ocaml_version "3.11");
+-
+   let cm_dir pkg cm = SVar.make
+     ~guess: (fun s ->
+                let l = [
+diff --git a/man/meltbuild.1 b/man/meltbuild.1
+index 83a2a35..da89079 100644
+--- a/man/meltbuild.1
++++ b/man/meltbuild.1
+@@ -64,8 +64,8 @@ Do not produce the final document, i.e. do not call latex. The MAIN_FILE will st
+ .B \-no-link
+ By default, a symbolic link to the produced DVI, PS or PDF document is created in the current directory. This option disables this behavior.
+ .TP
+-.B \-byte
+-Compile the program to bytecode instead of native code. Usually, this is actually faster: the program runs slower but is much faster to compile in bytecode. This may become the default in a future version.
++.B \-native
++Compile the program to native code bytecode instead of bytecode.
+ .TP
+ .B \-dvi
+ Produce a DVI instead of a PS file.
+diff --git a/melt/tool.ml b/melt/tool.ml
+index e6c223b..c2198e3 100644
+--- a/melt/tool.ml
++++ b/melt/tool.ml
+@@ -63,7 +63,7 @@ let main_file = ref ""
+ 
+ let mlpost = ref Melt.compiled_with_mlpost
+ let ocamlbuild = ref true
+-let native = ref true
++let native = ref false
+ let final = ref true
+ let link = ref true
+ 
+@@ -142,7 +142,7 @@ Melt pre-processor";
+   "-no-final", Arg.Clear final, " Do not produce the PS or the PDF";
+   "-no-link", Arg.Clear link, " Do not create a symbolic link to the PS or PDF";
+ 
+-  "-byte", Arg.Clear native, " Compile to bytecode instead of native code";
++  "-native", Arg.Set native, " Compile to native code instead of bytecode";
+ 
+   "-dvi", Arg.Set dvi, " Produce a DVI instead of a PS";
+   "-ps", Arg.Clear pdf, " Produce a PS file (this is the default behavior)";
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 29b4a4c..0fe086f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-usr-bin-melt-meltbuild.patch
 0002-Remove-temporary-files-in-melt-tool-as-well.patch
+0003-Support-for-bytecode-architectures.patch
diff --git a/debian/rules b/debian/rules
index b2e84ce..2299e33 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,6 +3,7 @@
 include /usr/share/ocaml/ocamlvars.mk
 
 export OCAMLFIND_DESTDIR=$(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR)
+export HAS_OCAMLOPT=$(OCAML_HAVE_OCAMLOPT)
 
 %:
 	dh $@ --with ocaml

-- 
ocaml-melt packaging



More information about the Pkg-ocaml-maint-commits mailing list