|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] tools/ocaml/*/Makefile: generate paths.ml from configure
commit d91312bfe72f06bb1a555fcb19dfc3e7e141014d
Author: Edwin Török <edvin.torok@xxxxxxxxxx>
AuthorDate: Fri Jul 29 18:53:25 2022 +0100
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Aug 5 17:30:08 2022 +0100
tools/ocaml/*/Makefile: generate paths.ml from configure
paths.ml contains various paths known to configure, and currently is
generated
via a Makefile rule. Simplify this and generate it through configure,
similar
to how oxenstored.conf is generated from oxenstored.conf.in.
This will allow to reuse the generated file more easily with Dune.
No functional change.
Signed-off-by: Edwin Török <edvin.torok@xxxxxxxxxx>
Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
---
tools/configure | 4 +++-
tools/configure.ac | 2 ++
tools/ocaml/Makefile.rules | 11 -----------
tools/ocaml/libs/xs/Makefile | 5 -----
tools/ocaml/libs/xs/paths.ml.in | 1 +
tools/ocaml/xenstored/Makefile | 5 -----
tools/ocaml/xenstored/paths.ml.in | 4 ++++
7 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/tools/configure b/tools/configure
index a052c186a5..41deb7fb96 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2453,7 +2453,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_config_files="$ac_config_files ../config/Tools.mk
hotplug/FreeBSD/rc.d/xencommons hotplug/FreeBSD/rc.d/xendriverdomain
hotplug/Linux/init.d/sysconfig.xencommons
hotplug/Linux/init.d/sysconfig.xendomains hotplug/Linux/init.d/xen-watchdog
hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains
hotplug/Linux/init.d/xendriverdomain hotplug/Linux/launch-xenstore
hotplug/Linux/vif-setup hotplug/Linux/xen-hotplug-common.sh
hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons
hotplug/NetBSD/rc.d/xendriverdomain ocaml/xenstored/oxenstored.conf"
+ac_config_files="$ac_config_files ../config/Tools.mk
hotplug/FreeBSD/rc.d/xencommons hotplug/FreeBSD/rc.d/xendriverdomain
hotplug/Linux/init.d/sysconfig.xencommons
hotplug/Linux/init.d/sysconfig.xendomains hotplug/Linux/init.d/xen-watchdog
hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains
hotplug/Linux/init.d/xendriverdomain hotplug/Linux/launch-xenstore
hotplug/Linux/vif-setup hotplug/Linux/xen-hotplug-common.sh
hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons
hotplug/NetBSD/rc.d/xendriverdomain ocaml/libs/xs/paths.ml
ocaml/xenstored/paths.ml ocaml/xenstored/oxenstored.conf"
ac_config_headers="$ac_config_headers config.h"
@@ -10935,6 +10935,8 @@ do
"hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES
hotplug/Linux/xendomains" ;;
"hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES
hotplug/NetBSD/rc.d/xencommons" ;;
"hotplug/NetBSD/rc.d/xendriverdomain") CONFIG_FILES="$CONFIG_FILES
hotplug/NetBSD/rc.d/xendriverdomain" ;;
+ "ocaml/libs/xs/paths.ml") CONFIG_FILES="$CONFIG_FILES
ocaml/libs/xs/paths.ml" ;;
+ "ocaml/xenstored/paths.ml") CONFIG_FILES="$CONFIG_FILES
ocaml/xenstored/paths.ml" ;;
"ocaml/xenstored/oxenstored.conf") CONFIG_FILES="$CONFIG_FILES
ocaml/xenstored/oxenstored.conf" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES
hotplug/Linux/systemd/proc-xen.mount" ;;
diff --git a/tools/configure.ac b/tools/configure.ac
index 1094d896fc..32cbe6bd3c 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -21,6 +21,8 @@ hotplug/Linux/xen-hotplug-common.sh
hotplug/Linux/xendomains
hotplug/NetBSD/rc.d/xencommons
hotplug/NetBSD/rc.d/xendriverdomain
+ocaml/libs/xs/paths.ml
+ocaml/xenstored/paths.ml
ocaml/xenstored/oxenstored.conf
])
AC_CONFIG_HEADERS([config.h])
diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index d368308d9b..0d3c6ac839 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -100,14 +100,3 @@ $(foreach lib,$(OCAML_LIBRARY),$(eval $(call
OCAML_LIBRARY_template,$(lib))))
$(foreach lib,$(OCAML_NOC_LIBRARY),$(eval $(call
OCAML_NOC_LIBRARY_template,$(lib))))
$(foreach p,$(OCAML_PROGRAM),$(eval $(call OCAML_PROGRAM_template,$(p))))
$(foreach p,$(C_PROGRAM),$(eval $(call C_PROGRAM_template,$(p))))
-
-buildmakevars2module = $(eval $(call buildmakevars2module-closure,$(1)))
-define buildmakevars2module-closure
- $(1): .phony
- rm -f $(1).tmp; \
- $(foreach var, $(BUILD_MAKE_VARS), \
- printf "let %s = \"%s\";;\n" \
- $(shell echo $(var) | tr '[:upper:]' '[:lower:]') \
- $($(var)) >>$(1).tmp;) \
- $(call move-if-changed,$(1).tmp,$(1))
-endef
diff --git a/tools/ocaml/libs/xs/Makefile b/tools/ocaml/libs/xs/Makefile
index e934bbb550..e160e6a711 100644
--- a/tools/ocaml/libs/xs/Makefile
+++ b/tools/ocaml/libs/xs/Makefile
@@ -44,8 +44,3 @@ uninstall:
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
include $(OCAML_TOPLEVEL)/Makefile.rules
-
-genpath-target = $(call buildmakevars2module,paths.ml)
-$(eval $(genpath-target))
-
-GENERATED_FILES += paths.ml
diff --git a/tools/ocaml/libs/xs/paths.ml.in b/tools/ocaml/libs/xs/paths.ml.in
new file mode 100644
index 0000000000..c067f8d012
--- /dev/null
+++ b/tools/ocaml/libs/xs/paths.ml.in
@@ -0,0 +1 @@
+let xen_run_stored = "@XEN_RUN_STORED@"
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 0b5711b507..6f7333926e 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -93,8 +93,3 @@ uninstall:
rm -f $(DESTDIR)$(sbindir)/oxenstored
include $(OCAML_TOPLEVEL)/Makefile.rules
-
-genpath-target = $(call buildmakevars2module,paths.ml)
-$(eval $(genpath-target))
-
-GENERATED_FILES += paths.ml
diff --git a/tools/ocaml/xenstored/paths.ml.in
b/tools/ocaml/xenstored/paths.ml.in
new file mode 100644
index 0000000000..37949dc8f3
--- /dev/null
+++ b/tools/ocaml/xenstored/paths.ml.in
@@ -0,0 +1,4 @@
+let xen_log_dir = "@XEN_LOG_DIR@"
+let xen_config_dir = "@XEN_CONFIG_DIR@"
+let xen_run_dir = "@XEN_RUN_DIR@"
+let xen_run_stored = "@XEN_RUN_STORED@"
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |