Move OCAML_* vars into separate file so it's available for ocamlinit.mk
authorXimin Luo <infinity0@debian.org>
Fri, 21 Jul 2017 15:31:43 +0000 (17:31 +0200)
committerXimin Luo <infinity0@debian.org>
Fri, 21 Jul 2017 15:31:43 +0000 (17:31 +0200)
debian/ocamlinit.mk
debian/ocamlvars.mk [new file with mode: 0644]
debian/rules

index 9348c27802859b75d11118e280ac015fe9e01629..4ce7b66e7741ac54913f1f9fde76365111d8bb90 100644 (file)
 # 02110-1301 USA.
 #
 
-_ocaml_share_path ?= /usr/share/ocaml
-
 ifndef _ocaml_share_ocamlinit
 _ocaml_share_ocamlinit = 1
 
-include $(_ocaml_share_path)/ocamlvars.mk
+include $(CURDIR)/debian/ocamlvars.mk
+-include $(CURDIR)/config/Makefile
 
 # list of .in files contained (non-recursively) in debian/ that requires
 # pre-build filling.
@@ -32,12 +31,6 @@ include $(_ocaml_share_path)/ocamlvars.mk
 #  e.g.: OCAML_IN_FILES += debian/patches/foo  # (no .in extension)
 OCAML_IN_FILES ?= $(filter-out debian/control,$(patsubst %.in,%,$(wildcard debian/*.in)))
 
-# WARNING: there are currently duplications with ocamlvars.mk and
-# ocaml.mk, but hopefully they will be removed at some point in the
-# future
-
--include $(CURDIR)/config/Makefile
-
 OCAMLINIT_SED := \
   -e 's%@OCamlABI@%$(OCAML_ABI)%g' \
   -e 's%@OCamlStdlibDir@%$(OCAML_STDLIB_DIR)%g' \
diff --git a/debian/ocamlvars.mk b/debian/ocamlvars.mk
new file mode 100644 (file)
index 0000000..1ec6437
--- /dev/null
@@ -0,0 +1,14 @@
+# Can't use /usr/share/ocaml/ocamlvars.mk because it tries to run ocamlc
+OCAML_ABI := $(OCAMLMAJOR).$(OCAMLMINOR)
+OCAML_STDLIB_DIR := /usr/lib/ocaml
+OCAML_NATIVE_ARCHS := $(shell cat debian/native-archs)
+OCAML_NATDYNLINK_ARCHS := $(shell cat debian/natdynlink-archs)
+OCAML_OPT_ARCH := $(findstring $(DEB_BUILD_ARCH),$(OCAML_NATIVE_ARCHS))
+OCAML_HAVE_OCAMLOPT := $(if $(OCAML_OPT_ARCH),yes,no)
+OCAML_OCAMLDOC_DESTDIR_HTML =
+
+ifneq (,$(findstring $(DEB_BUILD_ARCH),$(OCAML_NATDYNLINK_ARCHS)))
+  OCAML_NATDYNLINK := yes
+else
+  OCAML_NATDYNLINK := no
+endif
index 70aeb4a3a150186abc784a1d44f1b6cfc6bdfde2..4224b32447d8a567d78e556c3cbce6fe98750f92 100755 (executable)
@@ -20,20 +20,7 @@ endif
 # Build cache (for Debian debugging)
 BUILDCACHE := $(wildcard ../ocaml.cache)
 
-# These are defined here to avoid definition of them in ocamlvars.mk
-OCAML_ABI := $(OCAMLMAJOR).$(OCAMLMINOR)
-OCAML_STDLIB_DIR := /usr/lib/ocaml
-OCAML_NATIVE_ARCHS := $(shell cat debian/native-archs)
-OCAML_NATDYNLINK_ARCHS := $(shell cat debian/natdynlink-archs)
-OCAML_OPT_ARCH := $(findstring $(DEB_BUILD_ARCH),$(OCAML_NATIVE_ARCHS))
-OCAML_HAVE_OCAMLOPT := $(if $(OCAML_OPT_ARCH),yes,no)
-OCAML_OCAMLDOC_DESTDIR_HTML =
-
-ifneq (,$(findstring $(DEB_BUILD_ARCH),$(OCAML_NATDYNLINK_ARCHS)))
-  OCAML_NATDYNLINK := yes
-else
-  OCAML_NATDYNLINK := no
-endif
+include $(CURDIR)/debian/ocamlvars.mk
 
 MD5SUMSDIR = /var/lib/ocaml/md5sums
 INSTDIR = $(CURDIR)/debian/tmp/usr