Skip to content

Commit

Permalink
freestanding support
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Jun 1, 2018
1 parent 66708c2 commit 9d4ebb6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions META.bigstring.template
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
xen_linkopts = "-lbigstringaf_stubs_xen"
freestanding_linkopts = "-lbigstringaf_freestanding_stubs"
4 changes: 4 additions & 0 deletions lib/freestanding/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 ocaml-freestanding --cflags)"
echo "($flags)"
18 changes: 18 additions & 0 deletions lib/freestanding/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(jbuild_version 1)

(library
((name bigstringaf_freestanding)
(public_name bigstringaf.freestanding)
(optional)
(libraries (bigarray mirage-solo5))
(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 9d4ebb6

Please sign in to comment.