Skip to content

Commit

Permalink
Merge pull request #45 from hannesm/no-xen
Browse files Browse the repository at this point in the history
remove mirage-xen-posix cross-compilation rule (unneeded since mirage-xen 6.0.0)
  • Loading branch information
seliopou authored Nov 2, 2020
2 parents 4d0e687 + 836a3d0 commit 353cb28
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 49 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ env:
matrix:
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.03"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.05" DEPOPTS="mirage-xen-posix"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06" DEPOPTS="ocaml-freestanding"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.07" DEPOPTS="ocaml-freestanding"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.05"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.07"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.08"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.09" DEPOPTS="ocaml-freestanding"
- PACKAGE="bigstringaf" DISTRO="ubuntu-16.04" OCAML_VERSION="4.10" DEPOPTS="ocaml-freestanding"
5 changes: 2 additions & 3 deletions META.bigstringaf.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# JBUILDER_GEN
# DUNE_GEN

xen_linkopts = "-l:xen/libbigstringaf_xen_stubs.a"
freestanding_linkopts = "-l:freestanding/libbigstringaf_freestanding_stubs.a"
freestanding_linkopts = "-l:libbigstringaf_freestanding_stubs.a"
6 changes: 3 additions & 3 deletions bigstringaf.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ build: [
["dune" "runtest" "-p" name] {with-test}
]
depends: [
"dune" {build}
"dune" {>= "2.6.0"}
"alcotest" {with-test}
"bigarray-compat"
"ocaml" {>= "4.03.0"}
"conf-pkg-config" {build}
]
depopts: [
"mirage-xen-posix"
"ocaml-freestanding"
]
conflicts: [
"mirage-xen-posix" {< "3.1.0"}
"mirage-xen" {< "6.0.0"}
"ocaml-freestanding" {< "0.4.1"}
"js_of_ocaml" {< "3.5.0"}
]
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(lang dune 1.0)
(lang dune 2.6)
(name bigstringaf)
6 changes: 4 additions & 2 deletions lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
(libraries bigarray-compat)
(flags (:standard -safe-string))

(c_names bigstringaf_stubs)
(c_flags (:standard -Wall -Wextra -Wpedantic))
(foreign_stubs
(language c)
(names bigstringaf_stubs)
(flags (:standard -Wall -Wextra -Wpedantic)))

(js_of_ocaml (javascript_files runtime.js))
)
23 changes: 23 additions & 0 deletions lib/freestanding/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PKG_CONFIG_PATH := $(shell opam config var prefix)/lib/pkgconfig

EXISTS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --exists ocaml-freestanding; echo $$?)

.PHONY: all clean
all: libbigstringaf_freestanding_stubs.a

ifeq ($(EXISTS), 1)
libbigstringaf_freestanding_stubs.a:
touch $@
else
CC ?= cc
FREESTANDING_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags ocaml-freestanding)
CFLAGS := -O3 $(FREESTANDING_CFLAGS)

OBJS=bigstringaf_stubs.o

libbigstringaf_freestanding_stubs.a: $(OBJS)
$(AR) r $@ $^
endif

clean:
$(RM) $(OBJS) libbigstringaf_freestanding_stubs.a
4 changes: 0 additions & 4 deletions lib/freestanding/cflags.sh

This file was deleted.

20 changes: 11 additions & 9 deletions lib/freestanding/dune
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
(library
(name bigstringaf_freestanding)
(public_name bigstringaf.freestanding)
(optional)
(libraries bigarray-compat ocaml-freestanding)
(c_names bigstringaf_stubs)
(c_flags (:include cflags.sexp)))
(copy_files# ../bigstringaf_stubs.c)

(rule (copy# ../bigstringaf_stubs.c bigstringaf_stubs.c))
(rule
(deps Makefile bigstringaf_stubs.c)
(targets libbigstringaf_freestanding_stubs.a)
(action
(no-infer
(progn
(run %{make})))))

(rule (with-stdout-to cflags.sexp (run ./cflags.sh)))
(install
(section lib)
(files libbigstringaf_freestanding_stubs.a))
4 changes: 0 additions & 4 deletions lib/xen/cflags.sh

This file was deleted.

11 changes: 0 additions & 11 deletions lib/xen/dune

This file was deleted.

12 changes: 3 additions & 9 deletions lib_test/dune
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
(executables
(test
(name test_bigstringaf)
(libraries alcotest bigstringaf)
(modules test_bigstringaf s)
(names test_bigstringaf))

(alias
(name runtest)
(package bigstringaf)
(deps (:test test_bigstringaf.exe))
(action (run %{test})))
(modules test_bigstringaf s))

0 comments on commit 353cb28

Please sign in to comment.