[Pkg-ocaml-maint-commits] r3143 - in /trunk/tools/cdbs:
ocaml-vars.mk ocaml.mk
zack at users.alioth.debian.org
zack at users.alioth.debian.org
Thu Sep 14 23:27:31 UTC 2006
Author: zack
Date: Thu Sep 14 23:27:30 2006
New Revision: 3143
URL: http://svn.debian.org/wsvn/?sc=1&rev=3143
Log:
added support for ocaml native architecture list
Modified:
trunk/tools/cdbs/ocaml-vars.mk
trunk/tools/cdbs/ocaml.mk
Modified: trunk/tools/cdbs/ocaml-vars.mk
URL: http://svn.debian.org/wsvn/trunk/tools/cdbs/ocaml-vars.mk?rev=3143&op=diff
==============================================================================
--- trunk/tools/cdbs/ocaml-vars.mk (original)
+++ trunk/tools/cdbs/ocaml-vars.mk Thu Sep 14 23:27:30 2006
@@ -44,5 +44,10 @@
# For debian/rules writers.
OCAML_HAVE_OCAMLOPT := $(shell if test -x /usr/bin/ocamlopt ; then echo "yes" ; else echo "no" ; fi)
+# space separated list of Debian architectures supporting OCaml native code
+# compilation.
+# Used internally by ocaml.mk, may be useful to debian/rules writers as well
+OCAML_NATIVE_ARCHS := $(shell cat $(OCAML_STDLIB_DIR)/native-archs)
+
endif
Modified: trunk/tools/cdbs/ocaml.mk
URL: http://svn.debian.org/wsvn/trunk/tools/cdbs/ocaml.mk?rev=3143&op=diff
==============================================================================
--- trunk/tools/cdbs/ocaml.mk (original)
+++ trunk/tools/cdbs/ocaml.mk Thu Sep 14 23:27:30 2006
@@ -25,6 +25,9 @@
ifndef _cdbs_class_ocaml
_cdbs_class_ocaml = 1
+# needed by debian/control:: rule below
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
# to ensure invocations and tests on /usr/bin/ocaml* are meaningful
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), ocaml-nox
@@ -34,6 +37,7 @@
# ensure dpkg-gencontrol will fill F:OCamlABI fields with the proper value
ifdef _cdbs_rules_debhelper
DEB_DH_GENCONTROL_ARGS += -- -VF:OCamlABI="$(OCAML_ABI)"
+DEB_DH_GENCONTROL_ARGS += -VF:OCamlNativeArchs="$(OCAML_NATIVE_ARCHS)"
endif
# generate .in files counterpars before building, substituting @OCamlABI@
@@ -41,10 +45,22 @@
pre-build:: ocamlinit
ocamlinit: ocamlinit-stamp
ocamlinit-stamp:
- for f in $(OCAML_IN_FILES); do sed -e 's/@OCamlABI@/$(OCAML_ABI)/g' $$f.in > $$f; done
+ for f in $(OCAML_IN_FILES) ; do \
+ sed -e 's/@OCamlABI@/$(OCAML_ABI)/g' $$f.in > $$f ; \
+ done
touch $@
clean::
rm -f ocamlinit-stamp
+# update debian/control substituting @OCamlNativeArchs@
+# XXX ASSUMPTION: debian/control has already been generated, i.e. this rule is
+# executed after the debian/control:: rule in builcore.mk
+ifneq ($(DEB_AUTO_UPDATE_DEBIAN_CONTROL),)
+debian/control::
+ if test -f debian/control && test -f debian/control.in ; then \
+ sed -i -e "s/@OCamlNativeArchs@/$(OCAML_NATIVE_ARCHS)/g" $@ ; \
+ fi
endif
+endif
+
More information about the Pkg-ocaml-maint-commits
mailing list