- rebuild with binutils 2.24.51.0.1
[packages/ocaml.git] / ocaml-CFLAGS.patch
CommitLineData
9de25172 1# allow pass CFLAGS, replace -O, -pg,-DPROFILING with $(CFLAGS)
04508f14 2Makefiles=$(find . -type f -name Makefile\*)
3%{__sed} -i -e 's@^CFLAGS[ \t]*=@override CFLAGS += @' $Makefiles
4%{__sed} -i -e 's@\(^override CFLAGS += .*\)-O \(.*\)@\1\2@' $Makefiles
5%{__sed} -i -e 's@^CCFLAGS[ \t]*=\(.*\)@override CCFLAGS += \1 $(CFLAGS)@' $Makefiles
6%{__sed} -i -e 's@-pg -O -DPROFILING@ $(CFLAGS) @' asmrun/Makefile
7%{__sed} -i -e 's@-O@$(CFLAGS)@' otherlibs/systhreads/Makefile
8
31cbf6d8
JR
9diff -ur ocaml-3.11.0/asmrun/Makefile ocaml-3.11.0.CFLAGS/asmrun/Makefile
10--- ocaml-3.11.0/asmrun/Makefile 2007-11-15 14:21:15.000000000 +0100
11+++ ocaml-3.11.0.CFLAGS/asmrun/Makefile 2009-02-16 12:18:06.599221049 +0100
04508f14 12@@ -18,9 +18,9 @@
13 CC=$(NATIVECC)
14 FLAGS=-I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE \
31cbf6d8 15 -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(IFLEXDIR)
04508f14 16-CFLAGS=$(FLAGS) -O $(NATIVECCCOMPOPTS)
17+override CFLAGS += $(FLAGS) $(NATIVECCCOMPOPTS)
18 DFLAGS=$(FLAGS) -g -DDEBUG $(NATIVECCCOMPOPTS)
19-PFLAGS=$(FLAGS) -pg -O -DPROFILING $(NATIVECCPROFOPTS)
20+PFLAGS=$(FLAGS) $(CFLAGS) $(NATIVECCPROFOPTS)
21
31cbf6d8 22 COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \
04508f14 23 misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \
31cbf6d8
JR
24diff -ur ocaml-3.11.0/asmrun/Makefile.nt ocaml-3.11.0.CFLAGS/asmrun/Makefile.nt
25--- ocaml-3.11.0/asmrun/Makefile.nt 2007-11-15 14:21:15.000000000 +0100
26+++ ocaml-3.11.0.CFLAGS/asmrun/Makefile.nt 2009-02-16 12:18:01.212550815 +0100
04508f14 27@@ -16,7 +16,7 @@
28 include ../config/Makefile
29
30 CC=$(NATIVECC)
31-CFLAGS=-I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS)
32+override CFLAGS += -I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS)
33
31cbf6d8 34 COBJS=startup.$(O) main.$(O) fail.$(O) roots.$(O) signals.$(O) signals_asm.$(O) \
04508f14 35 misc.$(O) freelist.$(O) major_gc.$(O) minor_gc.$(O) memory.$(O) alloc.$(O) \
9de25172
JB
36--- ocaml-3.12.0/byterun/Makefile 2008-11-08 17:29:02.000000000 +0100
37+++ ocaml-3.12.0.CFLAGS/byterun/Makefile 2009-02-16 12:18:01.212550815 +0100
31cbf6d8 38@@ -15,7 +15,7 @@
04508f14 39
31cbf6d8
JR
40 include Makefile.common
41
42-CFLAGS=-DCAML_NAME_SPACE -O $(BYTECCCOMPOPTS) $(IFLEXDIR)
43+override CFLAGS += -DCAML_NAME_SPACE $(BYTECCCOMPOPTS) $(IFLEXDIR)
9de25172 44 DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS) $(IFLEXDIR)
04508f14 45
31cbf6d8
JR
46 OBJS=$(COMMONOBJS) unix.o main.o
47diff -ur ocaml-3.11.0/byterun/Makefile.nt ocaml-3.11.0.CFLAGS/byterun/Makefile.nt
48--- ocaml-3.11.0/byterun/Makefile.nt 2008-11-26 14:26:53.000000000 +0100
49+++ ocaml-3.11.0.CFLAGS/byterun/Makefile.nt 2009-02-16 12:18:01.215883365 +0100
50@@ -15,7 +15,7 @@
04508f14 51
31cbf6d8 52 include Makefile.common
04508f14 53
31cbf6d8
JR
54-CFLAGS=-DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR)
55+override CFLAGS += -DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR)
04508f14 56
31cbf6d8
JR
57 DBGO=d.$(O)
58 OBJS=$(COMMONOBJS:.o=.$(O)) win32.$(O) main.$(O)
59diff -ur ocaml-3.11.0/otherlibs/Makefile ocaml-3.11.0.CFLAGS/otherlibs/Makefile
60--- ocaml-3.11.0/otherlibs/Makefile 2007-11-08 10:17:47.000000000 +0100
61+++ ocaml-3.11.0.CFLAGS/otherlibs/Makefile 2009-02-16 12:18:01.282552384 +0100
62@@ -17,7 +17,7 @@
04508f14 63
31cbf6d8
JR
64 CAMLC=$(ROOTDIR)/ocamlcomp.sh
65 CAMLOPT=$(ROOTDIR)/ocamlcompopt.sh
66-CFLAGS=-I$(ROOTDIR)/byterun -O $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
67+override CFLAGS += -I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
04508f14 68
31cbf6d8
JR
69 include ../Makefile.shared
70 # Note .. is the current directory (this makefile is included from
71diff -ur ocaml-3.11.0/otherlibs/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/Makefile.nt
72--- ocaml-3.11.0/otherlibs/Makefile.nt 2007-11-08 10:17:48.000000000 +0100
73+++ ocaml-3.11.0.CFLAGS/otherlibs/Makefile.nt 2009-02-16 12:18:01.282552384 +0100
74@@ -17,7 +17,7 @@
04508f14 75
31cbf6d8
JR
76 CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib -w s
77 CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib -w s
78-CFLAGS=-I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
79+override CFLAGS += -I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
04508f14 80
31cbf6d8
JR
81 include ../Makefile.shared
82 # Note .. is the current directory (this makefile is included from
83diff -ur ocaml-3.11.0/otherlibs/labltk/browser/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/labltk/browser/Makefile.nt
84--- ocaml-3.11.0/otherlibs/labltk/browser/Makefile.nt 2008-12-03 14:03:18.000000000 +0100
85+++ ocaml-3.11.0.CFLAGS/otherlibs/labltk/browser/Makefile.nt 2009-02-16 12:18:01.272552219 +0100
86@@ -1,6 +1,6 @@
04508f14 87 OTHERSLIB=-I $(OTHERS)/win32unix -I $(OTHERS)/str -I $(OTHERS)/systhreads
31cbf6d8 88
04508f14 89-CCFLAGS=-I../../../byterun $(TK_DEFS)
90+override CCFLAGS += -I../../../byterun $(TK_DEFS) $(CFLAGS)
91
31cbf6d8
JR
92 include ../support/Makefile.common
93
94diff -ur ocaml-3.11.0/otherlibs/labltk/support/Makefile ocaml-3.11.0.CFLAGS/otherlibs/labltk/support/Makefile
95--- ocaml-3.11.0/otherlibs/labltk/support/Makefile 2008-04-22 09:38:07.000000000 +0200
96+++ ocaml-3.11.0.CFLAGS/otherlibs/labltk/support/Makefile 2009-02-16 12:18:01.282552384 +0100
97@@ -12,7 +12,7 @@
98 cltkFile.$(O) cltkMain.$(O) cltkMisc.$(O) cltkTimer.$(O) \
99 cltkVar.$(O) cltkWait.$(O) cltkImg.$(O)
04508f14 100
101-CCFLAGS=-I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS)
102+override CCFLAGS += -I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS) $(CFLAGS)
103
31cbf6d8
JR
104 COMPFLAGS=-I $(OTHERS)/win32unix -I $(OTHERS)/unix
105 THFLAGS=-I $(OTHERS)/systhreads -I $(OTHERS)/threads
9de25172
JB
106--- ocaml-3.12.0/otherlibs/systhreads/Makefile.orig 2010-04-27 09:55:08.000000000 +0200
107+++ ocaml-3.12.0/otherlibs/systhreads/Makefile 2011-03-12 10:40:54.827415456 +0100
108@@ -33,7 +33,7 @@
04508f14 109 $(MKLIB) -o threads $(BYTECODE_C_OBJS)
110
9de25172 111 st_stubs_b.o: st_stubs.c st_posix.h
04508f14 112- $(BYTECC) -O -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
113+ $(BYTECC) $(CFLAGS) -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
9de25172
JB
114 -c st_stubs.c
115 mv st_stubs.o st_stubs_b.o
04508f14 116
9de25172 117@@ -43,7 +43,7 @@
04508f14 118 $(AR) rc libthreadsnat.a $(NATIVECODE_C_OBJS)
119
9de25172
JB
120 st_stubs_n.o: st_stubs.c st_posix.h
121- $(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c
122+ $(NATIVECC) $(CFLAGS) -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c
123 mv st_stubs.o st_stubs_n.o
04508f14 124
125 threads.cma: $(THREAD_OBJS)
31cbf6d8
JR
126diff -ur ocaml-3.11.0/otherlibs/systhreads/Makefile.nt ocaml-3.11.0.CFLAGS/otherlibs/systhreads/Makefile.nt
127--- ocaml-3.11.0/otherlibs/systhreads/Makefile.nt 2007-11-06 16:16:56.000000000 +0100
128+++ ocaml-3.11.0.CFLAGS/otherlibs/systhreads/Makefile.nt 2009-02-16 12:18:01.285892127 +0100
129@@ -20,7 +20,7 @@
130 CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix
131 COMPFLAGS=-warn-error A -g
132 MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
133-CFLAGS=-I../../byterun $(EXTRACFLAGS)
134+override CFLAGS += -I../../byterun $(EXTRACFLAGS)
135
136 CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
137 CMIFILES=$(CAMLOBJS:.cmo=.cmi)
138diff -ur ocaml-3.11.0/otherlibs/threads/Makefile ocaml-3.11.0.CFLAGS/otherlibs/threads/Makefile
139--- ocaml-3.11.0/otherlibs/threads/Makefile 2008-10-08 15:07:13.000000000 +0200
140+++ ocaml-3.11.0.CFLAGS/otherlibs/threads/Makefile 2009-02-16 12:18:01.285892127 +0100
04508f14 141@@ -16,7 +16,7 @@
142 include ../../config/Makefile
143
144 CC=$(BYTECC)
145-CFLAGS=-I../../byterun -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
146+override CFLAGS += -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
147 CAMLC=../../ocamlcomp.sh -I ../unix
148 MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
149 COMPFLAGS=-warn-error A
31cbf6d8
JR
150diff -ur ocaml-3.11.0/win32caml/Makefile ocaml-3.11.0.CFLAGS/win32caml/Makefile
151--- ocaml-3.11.0/win32caml/Makefile 2007-11-15 14:21:15.000000000 +0100
152+++ ocaml-3.11.0.CFLAGS/win32caml/Makefile 2009-02-16 12:18:01.289259949 +0100
04508f14 153@@ -16,7 +16,7 @@
154 include ../config/Makefile
155
156 CC=$(BYTECC)
157-CFLAGS=$(BYTECCCOMPOPTS)
158+override CFLAGS += $(BYTECCCOMPOPTS)
159
160 OBJS=startocaml.$(O) ocamlres.$(O) ocaml.$(O) menu.$(O) \
161 history.$(O) editbuffer.$(O)
31cbf6d8
JR
162diff -ur ocaml-3.11.0/yacc/Makefile ocaml-3.11.0.CFLAGS/yacc/Makefile
163--- ocaml-3.11.0/yacc/Makefile 2007-02-07 15:49:42.000000000 +0100
164+++ ocaml-3.11.0.CFLAGS/yacc/Makefile 2009-02-16 12:18:01.289259949 +0100
04508f14 165@@ -17,7 +17,7 @@
166 include ../config/Makefile
167
168 CC=$(BYTECC)
169-CFLAGS=-O -DNDEBUG $(BYTECCCOMPOPTS)
170+override CFLAGS += -DNDEBUG $(BYTECCCOMPOPTS)
171
172 OBJS= closure.o error.o lalr.o lr0.o main.o mkpar.o output.o reader.o \
173 skeleton.o symtab.o verbose.o warshall.o
This page took 0.060697 seconds and 4 git commands to generate.