From 365bde9ab1ac4e256a236dfd1cea33dfd9b8f5c9 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Fri, 21 Jul 2017 17:31:43 +0200 Subject: [PATCH] Move OCAML_* vars into separate file so it's available for ocamlinit.mk --- debian/ocamlinit.mk | 11 ++--------- debian/ocamlvars.mk | 14 ++++++++++++++ debian/rules | 15 +-------------- 3 files changed, 17 insertions(+), 23 deletions(-) create mode 100644 debian/ocamlvars.mk diff --git a/debian/ocamlinit.mk b/debian/ocamlinit.mk index 9348c278..4ce7b66e 100644 --- a/debian/ocamlinit.mk +++ b/debian/ocamlinit.mk @@ -19,12 +19,11 @@ # 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 index 00000000..1ec64373 --- /dev/null +++ b/debian/ocamlvars.mk @@ -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 diff --git a/debian/rules b/debian/rules index 70aeb4a3..4224b324 100755 --- a/debian/rules +++ b/debian/rules @@ -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 -- 2.30.2