]> git.pld-linux.org Git - packages/ocaml.git/blob - ocaml-CFLAGS.patch
092632d77d0487a29e56430ef839a73bc0e8291e
[packages/ocaml.git] / ocaml-CFLAGS.patch
1 # allow pass CFLAGS, replace -O, -pg,-DPROFILING with $(CFLAGS)
2 Makefiles=$(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
9 --- ocaml-4.02.2/asmrun/Makefile.orig   2015-06-28 13:45:16.203456490 +0200
10 +++ ocaml-4.02.2/asmrun/Makefile        2015-06-28 15:07:59.556581531 +0200
11 @@ -16,11 +16,11 @@
12        -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) $(IFLEXDIR) \
13        $(LIBUNWIND_INCLUDE_FLAGS)
14  #CFLAGS=$(FLAGS) -g -O0
15 -CFLAGS=$(FLAGS) -g -O0 $(NATIVECCCOMPOPTS)
16 +override CFLAGS += $(FLAGS) $(NATIVECCCOMPOPTS)
17  DFLAGS=$(FLAGS) -g -DDEBUG $(NATIVECCCOMPOPTS)
18  IFLAGS=$(FLAGS) -DCAML_INSTR
19  PFLAGS=$(FLAGS) -pg -DPROFILING $(NATIVECCPROFOPTS) $(NATIVECCCOMPOPTS)
20 -PICFLAGS=$(FLAGS) $(SHAREDCCCOMPOPTS) $(NATIVECCCOMPOPTS)
21 +PICFLAGS=$(FLAGS) $(CFLAGS) $(SHAREDCCCOMPOPTS) $(NATIVECCCOMPOPTS)
22  
23  COBJS=startup_aux.o startup.o \
24    main.o fail.o roots.o globroots.o signals.o signals_asm.o \
25 --- ocaml-4.02.1/asmrun/Makefile.nt.orig        2014-11-06 21:32:19.358167666 +0100
26 +++ ocaml-4.02.1/asmrun/Makefile.nt     2014-11-07 16:19:43.681995569 +0100
27 @@ -14,7 +14,7 @@
28  include ../config/Makefile
29  
30  CC=$(NATIVECC)
31 -CFLAGS=-I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) \
32 +override CFLAGS += -I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) \
33         $(NATIVECCCOMPOPTS)
34  
35  COBJS=startup.$(O) main.$(O) fail.$(O) roots.$(O) signals.$(O) signals_asm.$(O)\
36 --- ocaml-4.02.2/byterun/Makefile.orig  2015-06-28 13:45:16.206789823 +0200
37 +++ ocaml-4.02.2/byterun/Makefile       2015-06-28 15:08:35.076580040 +0200
38 @@ -13,7 +13,7 @@
39  
40  include Makefile.common
41  
42 -CFLAGS=-DCAML_NAME_SPACE $(BYTECCCOMPOPTS) $(IFLEXDIR)
43 +override CFLAGS += -DCAML_NAME_SPACE $(BYTECCCOMPOPTS) $(IFLEXDIR)
44  DFLAGS=-DCAML_NAME_SPACE -g -DDEBUG $(BYTECCCOMPOPTS) $(IFLEXDIR)
45  
46  OBJS=$(COMMONOBJS) $(UNIX_OR_WIN32).o main.o
47 diff -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 @@
51  
52  include Makefile.common
53  
54 -CFLAGS=-DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR)
55 +override CFLAGS += -DOCAML_STDLIB_DIR='"$(LIBDIR)"' $(IFLEXDIR)
56  DFLAGS=$(CFLAGS) -DDEBUG
57  
58  DBGO=d.$(O)
59 --- ocaml-4.02.2/otherlibs/Makefile.orig        2015-06-28 13:45:16.210123156 +0200
60 +++ ocaml-4.02.2/otherlibs/Makefile     2015-06-28 15:09:02.573245553 +0200
61 @@ -16,7 +16,7 @@
62  CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib
63  CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib \
64          -I $(ROOTDIR)/stdlib
65 -CFLAGS=-I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
66 +override CFLAGS += -I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
67  
68  include ../Makefile.shared
69  # Note .. is the current directory (this makefile is included from
70 --- ocaml-4.02.2/otherlibs/systhreads/Makefile.orig     2015-06-28 13:45:16.213456489 +0200
71 +++ ocaml-4.02.2/otherlibs/systhreads/Makefile  2015-06-28 15:09:59.356576505 +0200
72 @@ -36,7 +36,7 @@
73         $(MKLIB) -o threads $(BYTECODE_C_OBJS) $(PTHREAD_LINK)
74  
75  st_stubs_b.o: st_stubs.c st_posix.h
76 -       $(BYTECC) -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
77 +       $(BYTECC) $(CFLAGS) -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
78            -c st_stubs.c
79         mv st_stubs.o st_stubs_b.o
80  
81 @@ -46,7 +46,7 @@
82         $(AR) rc libthreadsnat.a $(NATIVECODE_C_OBJS)
83  
84  st_stubs_n.o: st_stubs.c st_posix.h
85 -       $(NATIVECC) -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) \
86 +       $(NATIVECC) $(CFLAGS) -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) \
87                     $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) \
88                     -DSYS_$(SYSTEM) -c st_stubs.c
89         mv st_stubs.o st_stubs_n.o
90 --- ocaml-4.02.2/otherlibs/systhreads/Makefile.nt.orig  2015-06-28 13:45:16.216789823 +0200
91 +++ ocaml-4.02.2/otherlibs/systhreads/Makefile.nt       2015-06-28 15:10:34.866575013 +0200
92 @@ -20,7 +20,7 @@
93  CAMLOPT=$(CAMLRUN) ../../ocamlopt -I ../../stdlib -I ../win32unix
94  COMPFLAGS=-w +33 -warn-error A -g
95  MKLIB=$(CAMLRUN) ../../tools/ocamlmklib
96 -CFLAGS=-I../../byterun $(EXTRACFLAGS)
97 +override CFLAGS += -I../../byterun $(EXTRACFLAGS)
98  
99  CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
100  CMIFILES=$(CAMLOBJS:.cmo=.cmi)
101 --- ocaml-4.02.2/otherlibs/threads/Makefile.orig        2015-06-28 13:45:16.220123156 +0200
102 +++ ocaml-4.02.2/otherlibs/threads/Makefile     2015-06-28 15:11:03.843240464 +0200
103 @@ -18,7 +18,7 @@
104  CAMLYACC ?= ../../boot/ocamlyacc
105  
106  CC=$(BYTECC)
107 -CFLAGS=-I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
108 +override CFLAGS += -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
109  ROOTDIR=../..
110  CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib \
111        -I $(ROOTDIR)/stdlib -I $(ROOTDIR)/otherlibs/unix
112 --- ocaml-4.02.2/yacc/Makefile.orig     2015-06-28 13:45:16.220123156 +0200
113 +++ ocaml-4.02.2/yacc/Makefile  2015-06-28 15:11:25.473239557 +0200
114 @@ -15,7 +15,7 @@
115  include ../config/Makefile
116  
117  CC=$(BYTECC)
118 -CFLAGS=-DNDEBUG $(BYTECCCOMPOPTS)
119 +override CFLAGS += -DNDEBUG $(BYTECCCOMPOPTS)
120  
121  OBJS= closure.o error.o lalr.o lr0.o main.o mkpar.o output.o reader.o \
122    skeleton.o symtab.o verbose.o warshall.o
This page took 0.047701 seconds and 3 git commands to generate.