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