Skip to content

Commit

Permalink
Update the configure infrastructure for paths.ml
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Sultanov <[email protected]>
  • Loading branch information
last-genius committed Sep 20, 2024
1 parent 944942b commit 7e95056
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 34 deletions.
4 changes: 0 additions & 4 deletions configure

This file was deleted.

18 changes: 0 additions & 18 deletions configure.ml

This file was deleted.

12 changes: 0 additions & 12 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@
;(action
;(run ../../config.status --file=oxenstored.conf)))

;(rule
;(targets paths.ml)
;(deps paths.ml.in)
;(mode fallback)
;(action
;(run ../../config.status --file=paths.ml)))

; Get xen and libs from somewhere - xs-opam?
;(install
;(package xen)
;(section etc)
;(files oxenstored.conf))

;(executable
;(modules configure)
;(name configure)
;(libraries dune-configurator))

(env
(dev
(flags (:standard -warn-error -34-69))))
4 changes: 4 additions & 0 deletions oxenstored/configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

#exec dune exec --profile=release ./configure.exe conf -- $* >oxenstored.conf
dune exec --profile=release ./configure.exe paths -- $*
28 changes: 28 additions & 0 deletions oxenstored/configure.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
let xen_run_dir = ref "/var/run/xen/"

let xen_run_stored = ref "/var/run/xenstored"

let xen_log_dir = ref "/var/log/xen/"

let xen_config_dir = ref "/etc/xen"

let libexec = ref "/usr/local/lib/xen"

let args =
[
("XEN_RUN_DIR", Arg.Set_string xen_run_dir, "")
; ("XEN_RUN_STORED", Arg.Set_string xen_run_stored, "")
; ("XEN_LOG_DIR", Arg.Set_string xen_log_dir, "")
; ("XEN_CONFIG_DIR", Arg.Set_string xen_config_dir, "")
; ("LIBEXEC", Arg.Set_string libexec, "")
]

let () =
Arg.parse (args |> Arg.align) ignore "" ;
List.iter2
(fun var (name, _, _) ->
print_endline
(Printf.sprintf {|let %s = "%s"|} (String.lowercase_ascii name) var)
)
[!xen_run_dir; !xen_run_stored; !xen_log_dir; !xen_config_dir; !libexec]
args
11 changes: 11 additions & 0 deletions oxenstored/dune
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
(files
(xenstored.exe as oxenstored)))

(executable
(modules configure)
(name configure))

(rule
(targets paths.ml)
(deps paths.ml.in configure.exe)
(action
(with-stdout-to paths.ml
(run ./configure))))

(library
(foreign_stubs (language c) (names syslog_stubs select_stubs))
(modules syslog)
Expand Down

0 comments on commit 7e95056

Please sign in to comment.