Skip to content

Commit

Permalink
menhir.20180703 winfix
Browse files Browse the repository at this point in the history
  • Loading branch information
fdopen committed Jul 10, 2018
1 parent 035b593 commit 54c3e01
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/menhir/menhir.20180703/files/menhir-20180703.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- ./Makefile
+++ ./Makefile
@@ -60,13 +60,8 @@

# If the compiler is MSVC, then object file names end in .obj instead of .o.

-ifneq (,$(shell ocamlc -config | grep -E "ccomp_type: msvc"))
- OBJ := obj
-# LIBSUFFIX := lib
-else
- OBJ := o
-# LIBSUFFIX := a
-endif
+OBJ := $(shell ocamlc -config | awk -F '[\t \r]+' '/^ext_obj:/ {print $$2}' | tr -d '.')
+#LIBSUFFIX := $(shell ocamlc -config | awk -F '[\t \r]+' '/^ext_lib:/ {print $$2}' | tr -d '.')

# If we are under Windows (regardless of whether we are using MSVC or mingw)
# then the name of the executable file ends in .exe.
@@ -92,8 +87,9 @@
# performed if "os_type" is "Win32" or "Win64", and must not be performed if
# "os_type" is "Cygwin" or "Unix".

-ifneq (,$(shell ocamlc -config | grep -E "os_type: (Win32|Win64)"))
-installation_libdir := $(shell cygpath -m $(libdir))
+OS_TYPE:= $(shell ocamlc -config | awk -F '[\t \r]+' '/^os_type:/ {print $$2}')
+ifeq ($(OS_TYPE),Win32)
+installation_libdir := $(shell cygpath -m $(libdir) || echo $(libdir))
else
installation_libdir := $(libdir)
endif
--- ./src/cmly_write.ml
+++ ./src/cmly_write.ml
@@ -168,6 +168,6 @@
output_value oc (t : grammar)

let write filename =
- let oc = open_out filename in
+ let oc = open_out_bin filename in
write oc (encode());
close_out oc
2 changes: 2 additions & 0 deletions packages/menhir/menhir.20180703/opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ install: [
]
remove: [
[make "-f" "Makefile" "uninstall" "PREFIX=%{prefix}%" "docdir=%{doc}%/menhir" "libdir=%{lib}%/menhir" "mandir=%{man}%/man1"]
["rm" "-rf" "%{prefix}%/lib/menhirLib" "%{prefix}%/lib/menhirSdk"]
]
depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
]
available: [ ocaml-version >= "4.02" ]
patches: "menhir-20180703.patch" {os = "win32"}

0 comments on commit 54c3e01

Please sign in to comment.