aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/imx-lib/imx-lib-3.10.17-1.0.0/obey-variables.patch
blob: cc6319f79fff343c975391501e5369b333c48303 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Obey CFLAGS, LDFLAGS

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Upstream-status: Pending

--- imx-lib-3.10.17-1.0.0_beta.orig/hdmi-cec/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/hdmi-cec/Makefile
@@ -1,5 +1,6 @@
 CC ?=$(CROSS_COMPILE)gcc
 AR ?=$(CROSS_COMPILE)ar
+CFLAGS ?=-O2
 
 # list of platforms which want this test case
 INCLUDE_LIST:= IMX6Q
@@ -32,10 +33,10 @@ all install :
 endif
 
 %.o: %.c
-	$(CC) -D$(PLATFORM) -Wall -O2 -fPIC -c $^ -o $@
+	$(CC) -D$(PLATFORM) -Wall -fPIC $(CFLAGS) -c $^ -o $@
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
--- imx-lib-3.10.17-1.0.0_beta.orig/ipu/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/ipu/Makefile
@@ -1,5 +1,6 @@
 CC ?=$(CROSS_COMPILE)gcc
 AR ?=$(CROSS_COMPILE)ar
+CFLAGS ?=-O2
 
 ifeq ($(PLATFORM), IMX6Q)
 OBJS = mxc_ipu_hl_lib_dummy.o
@@ -28,7 +29,7 @@ all install:
 endif
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
@@ -37,7 +38,7 @@ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVER
 ifeq "$(PLATFORM)" ""
 	$(error "Unspecified PLATFORM variable")
 endif
-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
+	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
 
 .PHONY: clean
 clean:
--- imx-lib-3.10.17-1.0.0_beta.orig/pxp/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/pxp/Makefile
@@ -1,5 +1,6 @@
 CC ?=$(CROSS_COMPILE)gcc
 AR ?=$(CROSS_COMPILE)ar
+CFLAGS ?=-O2
 
 # list of platforms which want this test case
 INCLUDE_LIST:=IMX50 IMX51 IMX5 IMX6Q IMX6S
@@ -26,10 +27,10 @@ all install :
 endif
 
 %.o: %.c
-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
+	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $(LFLAGS) $^ -o $@
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ $(LFLAGS) $^ -o $@ $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
--- imx-lib-3.10.17-1.0.0_beta.orig/rng/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/rng/Makefile
@@ -4,16 +4,17 @@ ifeq (,$(findstring $(PLATFORM), $(EXCLU
 AR = ar -crv
 RM = rm -f
 CC ?=$(CROSS_COMPILE)gcc
-LD=$(CROSS_COMPILE)ld
+LD ?=$(CROSS_COMPILE)ld
+CFLAGS ?=-g
 
 INC := $(INCLUDE)
 
 # Add compilation checks
-CFLAGS += -g -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
+override CFLAGS += -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
 
 # In absence of kernel CONFIG flags, set API library to build on
 # 'unknown' platform.
-CFLAGS += -DFSL_PLATFORM_OTHER -DFSL_HAVE_RNGC $(INC)
+override CFLAGS += -DFSL_PLATFORM_OTHER -DFSL_HAVE_RNGC $(INC)
 
 OBJS= fsl_shw_rand.o  fsl_shw_hash.o  fsl_shw_sym.o  fsl_shw_user.o         \
 		fsl_shw_keystore.o fsl_shw_auth.o  fsl_shw_hmac.o  fsl_shw_wrap.o
@@ -34,7 +35,7 @@ $(LIBNAME).a: $(OBJS)
 	$(AR) $@ $^
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
--- imx-lib-3.10.17-1.0.0_beta.orig/sahara2/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/sahara2/Makefile
@@ -4,7 +4,8 @@ ifeq (,$(findstring $(PLATFORM), $(EXCLU
 AR = ar -crv
 RM = rm -f
 CC ?=$(CROSS_COMPILE)gcc
-LD=$(CROSS_COMPILE)ld
+LD ?=$(CROSS_COMPILE)ld
+CFLAGS ?=-g
 
 INC := $(INCLUDE)
 
@@ -18,19 +19,19 @@ TARGET_ARCH=-DCONFIG_ARCH_MX5
 endif
 
 # Add compilation checks
-CFLAGS += -g -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
+override CFLAGS += -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
 
 OBJS= fsl_shw_rand.o  fsl_shw_hash.o  fsl_shw_sym.o  fsl_shw_user.o         \
       fsl_shw_auth.o  fsl_shw_hmac.o  fsl_shw_wrap.o  fsl_shw_keystore.o um_adaptor.o  sf_util.o
 
 
 #CFLAGS += -DSAHARA -DLINUX -I$(APIINCDIR)
-CFLAGS += -DSAHARA -DLINUX $(INC)
-CFLAGS += $(TARGET_ARCH)
+override CFLAGS += -DSAHARA -DLINUX $(INC)
+override CFLAGS += $(TARGET_ARCH)
 # Uncomment to debug Library's creation of structures for driver
-#CFLAGS +=  -DDIAG_SECURITY_FUNC
+#override CFLAGS +=  -DDIAG_SECURITY_FUNC
 # Uncomment to simulate memory allocation errors
-#CFLAGS += -DDIAG_MEM_ERRORS -DDIAG_MEM_CONST=5
+#override CFLAGS += -DDIAG_MEM_ERRORS -DDIAG_MEM_CONST=5
 
 LIBNAME=libsahara
 SONAMEVERSION=0
@@ -53,7 +54,7 @@ $(LIBNAME).a: $(OBJS)
 	$(AR) $@ $^
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
--- imx-lib-3.10.17-1.0.0_beta.orig/screenlayer/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/screenlayer/Makefile
@@ -1,5 +1,6 @@
 CC ?=$(CROSS_COMPILE)gcc
 AR ?=$(CROSS_COMPILE)ar
+CFLAGS ?=-O2
 INC = $(INCLUDE) -I../ipu
 
 OBJS = ScreenLayer.o
@@ -24,13 +25,13 @@ all install:
 endif
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -L../ipu -lipu
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -L../ipu -lipu $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
 
 %.o: %.c
-	$(CC) $(INC) -Wall -O2 -fPIC -c $^ -o $@
+	$(CC) $(INC) -Wall -fPIC $(CFLAGS) -c $^ -o $@
 
 .PHONY: clean
 clean:
--- imx-lib-3.10.17-1.0.0_beta.orig/sim/Makefile
+++ imx-lib-3.10.17-1.0.0_beta/sim/Makefile
@@ -1,9 +1,10 @@
 CC ?=$(CROSS_COMPILE)gcc
 AR ?=$(CROSS_COMPILE)ar
+CFLAGS ?=-O2
 
 OBJS = iso7816-3.o
 
-CFLAGS += $(INCLUDE)
+override CFLAGS += $(INCLUDE)
 
 LIBNAME=libsim
 SONAMEVERSION=0
@@ -21,13 +22,13 @@ install:
 	cp iso7816-3.h $(DEST_DIR)/usr/include
 
 $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread
+	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread $(LDFLAGS)
 
 $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
 	ln -s $< $@
 
 %.o: %.c
-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
+	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
 
 else
 all install :