forked from camlspotter/opam-repository-mingw
/
menhir-20180703.patch
40 lines (35 loc) · 1.31 KB
/
menhir-20180703.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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