]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
tools/ocaml/*/Makefile: generate paths.ml from configure
authorEdwin Török <edvin.torok@citrix.com>
Fri, 29 Jul 2022 17:53:25 +0000 (18:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Aug 2022 16:30:08 +0000 (17:30 +0100)
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@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/configure
tools/configure.ac
tools/ocaml/Makefile.rules
tools/ocaml/libs/xs/Makefile
tools/ocaml/libs/xs/paths.ml.in [new file with mode: 0644]
tools/ocaml/xenstored/Makefile
tools/ocaml/xenstored/paths.ml.in [new file with mode: 0644]

index a052c186a546ebc60f3ea439952c2a73e14e700d..41deb7fb96715b9d9f37bdb13f476770ff7a87e5 100755 (executable)
@@ -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" ;;
index 1094d896fcc35966725873ee8dc84386084a8092..32cbe6bd3c008497a9bb08c262f5792a80a91439 100644 (file)
@@ -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])
index d368308d9beafb43af6c20f07693a7e8ede95346..0d3c6ac8394f8da06cf4b429c3bd6b0b62807c6f 100644 (file)
@@ -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
index e934bbb550b0e48b95b5cc04c1ecf983c1a23419..e160e6a711a40e72f4eaee1de5350bde6dbe501c 100644 (file)
@@ -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 (file)
index 0000000..c067f8d
--- /dev/null
@@ -0,0 +1 @@
+let xen_run_stored = "@XEN_RUN_STORED@"
index 0b5711b507aa2ba2957084d630fa20cb71baad16..6f7333926e9d0f11d40a3f5d0fb0573447e0fcbb 100644 (file)
@@ -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 (file)
index 0000000..37949dc
--- /dev/null
@@ -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@"