[Pkg-ocaml-maint-commits] [SCM] dh-ocaml packaging branch, master, updated. debian/0.4.1-36-g747f657

Stephane Glondu steph at glondu.net
Fri Jul 17 14:27:41 UTC 2009


The following commit has been merged in the master branch:
commit 747f65753097c5c15342b124aa8acc2ff6d4e4cd
Author: Stephane Glondu <steph at glondu.net>
Date:   Fri Jul 17 15:49:36 2009 +0200

    Tweak computation of $(OCAML_HAVE_OCAMLOPT) and $(OCAML_OPT_ARCH)

diff --git a/share/ocamlvars.mk b/share/ocamlvars.mk
index 2c413eb..ecca7c0 100644
--- a/share/ocamlvars.mk
+++ b/share/ocamlvars.mk
@@ -41,7 +41,7 @@ OCAML_DLL_DIR ?= $(OCAML_STDLIB_DIR)/stublibs
 
 # 'yes' if native code compilation is available on the build architecture, 'no' otherwise.
 # For debian/rules writers.
-OCAML_HAVE_OCAMLOPT ?= $(shell if test -x /usr/bin/ocamlopt ; then echo "yes" ; else echo "no" ; fi)
+OCAML_HAVE_OCAMLOPT ?= $(if $(wildcard /usr/bin/ocamlopt),yes,no)
 
 # space separated list of Debian architectures supporting OCaml native code
 # compilation.
@@ -55,7 +55,12 @@ OCAML_NATIVE_ARCHS ?= $(shell cat $(OCAML_STDLIB_DIR)/native-archs)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_BUILD_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-OCAML_OPT_ARCH      ?= $(findstring $(DEB_BUILD_ARCH),$(OCAML_NATIVE_ARCHS))
+
+# Variable which is empty on bytecode architectures (useful with make's
+# $(if ...))
+ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
+OCAML_OPT_ARCH      ?= $(DEB_BUILD_ARCH)
+endif
 
 # OCAML_BEST will be 'opt' on native architectures and 'byte' otherwise.
 OCAML_BEST ?= $(if $(OCAML_OPT_ARCH),opt,byte)

-- 
dh-ocaml packaging



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