Skip to content

Commit

Permalink
Fix Xen support
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed May 21, 2018
1 parent 682db3e commit 66708c2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,3 @@
(javascript_files (runtime.js))
))
))

(rule (copy# bigstringaf_stubs.c bigstringaf_stubs_xen.c))

(rule
(with-stdout-to cflags-xen.sexp
(progn
(echo "(")
(run pkg-config pkg-config --static mirage-xen --cflags)
(echo ")")
)))
4 changes: 4 additions & 0 deletions lib/xen/cflags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
export PKG_CONFIG_PATH="$(opam config var lib)/pkgconfig"
flags="$(pkg-config --static mirage-xen-posix --cflags)"
echo "($flags)"
18 changes: 18 additions & 0 deletions lib/xen/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(jbuild_version 1)

(library
((name bigstringaf_xen)
(public_name bigstringaf.xen)
(optional)
(libraries (bigarray mirage-xen))
(c_names (bigstringaf_stubs))
(c_flags (:include cflags.sexp))))

(rule (copy# ../bigstringaf_stubs.c bigstringaf_stubs.c))
(rule (copy# ../bigstringaf.ml bigstringaf.ml))
(rule (copy# ../bigstringaf.mli bigstringaf.mli))

(rule
((targets (cflags.sexp))
(deps (cflags.sh))
(action (bash "./${<} > ${@}"))))

0 comments on commit 66708c2

Please sign in to comment.