Skip to content

Commit

Permalink
Fix build on OCaml 4.06.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Lavrik committed Feb 12, 2018
1 parent a884f2d commit c9c772c
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 200 deletions.
20 changes: 1 addition & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,7 @@ DIRS = piqilib src
doc piqi


# export installation and search path for third-party OCaml dependencies
ifeq ($(MAKECMDGOALS),deps)
OCAMLFIND_DESTDIR := $(PIQI_BUILD)/lib/ocaml
ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
OCAMLFIND_DESTDIR := $(shell cygpath -w $(OCAMLFIND_DESTDIR))
endif
export OCAMLFIND_DESTDIR

OCAMLPATH := $(PIQI_ROOT)/deps
ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
OCAMLPATH := $(shell cygpath -w $(OCAMLPATH))
endif
export OCAMLPATH
endif


# export installation path for third-party deps and piqilib
# export installation path for piqilib
ifneq ($(findstring ocaml-,$(MAKECMDGOALS)),)
ifneq ($(PIQI_OCAML_DESTDIR),)
export OCAMLFIND_DESTDIR = $(PIQI_OCAML_DESTDIR)
Expand Down Expand Up @@ -83,12 +67,10 @@ ocaml:

ocaml-install: ocaml-uninstall
test -d $(PIQI_OCAML_DESTDIR) || mkdir -p $(PIQI_OCAML_DESTDIR)
$(MAKE) -C deps install
$(MAKE) -C piqilib install


ocaml-uninstall:
$(MAKE) -C deps uninstall
$(MAKE) -C piqilib uninstall


Expand Down
14 changes: 14 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ include ../Makefile.config
include $(PIQI_ROOT)/make/Makefile.dirs


# export installation and search path for third-party OCaml dependencies
OCAMLFIND_DESTDIR := $(PIQI_BUILD)/lib/ocaml
ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
OCAMLFIND_DESTDIR := $(shell cygpath -w $(OCAMLFIND_DESTDIR))
endif
export OCAMLFIND_DESTDIR

OCAMLPATH := $(PIQI_ROOT)/deps
ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
OCAMLPATH := $(shell cygpath -w $(OCAMLPATH))
endif
export OCAMLPATH


ifndef SKIP-ulex
DIRS += ulex
endif
Expand Down
2 changes: 1 addition & 1 deletion deps/base64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SOURCES = b64.ml

PACKS = bytes

LIBINSTALL_FILES = b64.mli b64.cmi base64.cma base64.cmxa base64.a
LIBINSTALL_FILES = b64.mli b64.cmi b64.cmx base64.cma base64.cmxa base64.a


all: bcl ncl
Expand Down
4 changes: 0 additions & 4 deletions deps/bytes.dummy/META

This file was deleted.

30 changes: 0 additions & 30 deletions deps/bytes.dummy/Makefile

This file was deleted.

28 changes: 0 additions & 28 deletions deps/bytes/Makefile

This file was deleted.

33 changes: 0 additions & 33 deletions deps/bytes/Makefile.download

This file was deleted.

36 changes: 0 additions & 36 deletions deps/optcomp/Makefile

This file was deleted.

39 changes: 0 additions & 39 deletions deps/optcomp/Makefile.download

This file was deleted.

6 changes: 3 additions & 3 deletions deps/ulex/Makefile.download
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TARBALL := ulex-1.1.tar.gz
URL := http://www.cduce.org/download/$(TARBALL)
MD5 := ce49a013bc4a0e085977a9fe157017bf
TARBALL := v1.2.tar.gz
URL := https://github.com/whitequark/ulex/archive/$(TARBALL)
MD5 := 7d35f33514cda8ba0925afaba437177c


UPSTREAM_FILES := \
Expand Down
2 changes: 2 additions & 0 deletions deps/xmlm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ RESULT = xmlm

SOURCES = xmlm.ml xmlm.mli

LIBINSTALL_FILES = xmlm.mli xmlm.cmi xmlm.cmx xmlm.cma xmlm.cmxa xmlm.a


all: bcl ncl

Expand Down
10 changes: 5 additions & 5 deletions deps/xmlm/Makefile.download
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION := 1.2.0
TARBALL := v1.2.0.tar.gz
URL := https://github.com/dbuenzli/xmlm/archive/$(TARBALL)
MD5 := 8117ef968659713108be4f07b9252cd3
VERSION := 1.3.0
TARBALL := xmlm-1.3.0.tbz
URL := http://erratique.ch/software/xmlm/releases/$(TARBALL)
MD5 := d63ce15d913975211196b5079e86a797


UPSTREAM_FILES := \
Expand All @@ -24,7 +24,7 @@ META: $(UPSTREAM_DIR)/pkg/META

$(UPSTREAM_DIR): $(TARBALL)
mkdir -p $(UPSTREAM_DIR)
tar -xzf $< -C $(UPSTREAM_DIR) --strip-components=1
tar -xjf $< -C $(UPSTREAM_DIR) --strip-components=1


$(TARBALL):
Expand Down
4 changes: 2 additions & 2 deletions piqilib/piqi_json_parser.mll
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
let len = lexbuf.lex_curr_pos - lexbuf.lex_start_pos in
let s = lexbuf.lex_buffer in
let start = lexbuf.lex_start_pos in
check_adjust_utf8 v lexbuf s start len;
Buffer.add_substring v.buf s start len
check_adjust_utf8 v lexbuf (Bytes.unsafe_to_string s) start len;
Buffer.add_subbytes v.buf s start len

let map_lexeme f lexbuf =
let len = lexbuf.lex_curr_pos - lexbuf.lex_start_pos in
Expand Down

0 comments on commit c9c772c

Please sign in to comment.