# 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.
# 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' \
--- /dev/null
+# 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
# 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