updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / mingw32-ocaml / mingw32-ocaml-combined-Makefile.patch
blob0c4d2236dbb71539ab118390ca3eaed6a16368f7
1 OCaml sources uses separate Makefile and Makefile.nt in each directory,
2 which is a pain when cross-compiling. Instead of that, it's better to
3 combine all objects into one Makefile, and make sure the source is
4 defended by #ifdef/#ifndef WIN32 ... #endif, around the whole files as
5 necessary.
7 Index: build-tree/ocaml-3.12.0/asmrun/Makefile
8 ===================================================================
9 --- build-tree.orig/ocaml-3.12.0/asmrun/Makefile 2010-06-23 19:37:52.000000000 +0200
10 +++ build-tree/ocaml-3.12.0/asmrun/Makefile 2010-06-23 19:39:37.000000000 +0200
11 @@ -26,7 +26,7 @@
12 misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \
13 floats.o str.o array.o io.o extern.o intern.o hash.o sys.o parsing.o \
14 gc_ctrl.o terminfo.o md5.o obj.o lexing.o printexc.o callback.o weak.o \
15 - compact.o finalise.o custom.o unix.o backtrace.o natdynlink.o debugger.o
16 + compact.o finalise.o custom.o unix.o win32.o backtrace.o natdynlink.o debugger.o
18 ASMOBJS=$(ARCH).o
20 @@ -138,6 +138,8 @@
21 ln -s ../byterun/globroots.c globroots.c
22 unix.c: ../byterun/unix.c
23 ln -s ../byterun/unix.c unix.c
24 +win32.c: ../byterun/win32.c
25 + ln -s ../byterun/win32.c win32.c
26 dynlink.c: ../byterun/dynlink.c
27 ln -s ../byterun/dynlink.c dynlink.c
28 signals.c: ../byterun/signals.c
29 @@ -148,7 +150,7 @@
30 LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \
31 compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \
32 parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \
33 - weak.c compact.c finalise.c meta.c custom.c main.c globroots.c unix.c \
34 + weak.c compact.c finalise.c meta.c custom.c main.c globroots.c unix.c win32.c \
35 dynlink.c signals.c debugger.c
37 clean::
38 Index: build-tree/ocaml-3.12.0/byterun/Makefile.common
39 ===================================================================
40 --- build-tree.orig/ocaml-3.12.0/byterun/Makefile.common 2010-06-23 19:37:51.000000000 +0200
41 +++ build-tree/ocaml-3.12.0/byterun/Makefile.common 2010-06-23 19:39:37.000000000 +0200
42 @@ -24,7 +24,7 @@
43 compare.o ints.o floats.o str.o array.o io.o extern.o intern.o \
44 hash.o sys.o meta.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o \
45 lexing.o callback.o debugger.o weak.o compact.o finalise.o custom.o \
46 - dynlink.o
47 + dynlink.o win32.o
49 PRIMS=\
50 alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c \
51 Index: build-tree/ocaml-3.12.0/byterun/unix.c
52 ===================================================================
53 --- build-tree.orig/ocaml-3.12.0/byterun/unix.c 2010-06-23 19:37:51.000000000 +0200
54 +++ build-tree/ocaml-3.12.0/byterun/unix.c 2010-06-23 19:39:37.000000000 +0200
55 @@ -15,6 +15,8 @@
57 /* Unix-specific stuff */
59 +#ifndef WIN32
61 #define _GNU_SOURCE
62 /* Helps finding RTLD_DEFAULT in glibc */
64 @@ -320,3 +322,5 @@
67 #endif
69 +#endif /* !WIN32 */
70 Index: build-tree/ocaml-3.12.0/byterun/win32.c
71 ===================================================================
72 --- build-tree.orig/ocaml-3.12.0/byterun/win32.c 2010-06-23 19:37:52.000000000 +0200
73 +++ build-tree/ocaml-3.12.0/byterun/win32.c 2010-06-23 19:39:37.000000000 +0200
74 @@ -13,6 +13,8 @@
76 /* $Id: win32.c 9547 2010-01-22 12:48:24Z doligez $ */
78 +#ifdef WIN32
80 /* Win32-specific stuff */
82 #include <windows.h>
83 @@ -543,3 +545,5 @@
84 seed ^= GetCurrentProcessId();
85 return seed;
88 +#endif /* WIN32 */
89 Index: build-tree/ocaml-3.12.0/otherlibs/systhreads/Makefile
90 ===================================================================
91 --- build-tree.orig/ocaml-3.12.0/otherlibs/systhreads/Makefile 2010-06-23 19:37:52.000000000 +0200
92 +++ build-tree/ocaml-3.12.0/otherlibs/systhreads/Makefile 2010-06-23 19:43:39.000000000 +0200
93 @@ -46,9 +50,9 @@
94 $(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c
95 mv st_stubs.o st_stubs_n.o
97 threads.cma: $(THREAD_OBJS)
98 $(MKLIB) -ocamlc '$(CAMLC)' -o threads $(THREAD_OBJS) \
99 - -cclib -lunix $(PTHREAD_LINK)
100 + -cclib -lunix $(PTHREAD_LINK) -lcamlrun
102 # See remark above: force static linking of libthreadsnat.a
103 threads.cmxa: $(THREAD_OBJS:.cmo=.cmx)