summaryrefslogtreecommitdiffstats
path: root/recipes-security/audit/audit/audit-for-cross-compiling.patch
blob: 812fdf7d999fb77e22e681d36c435ff428f8f6ec (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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
From d4535ddce48f821a05cfa1409b7ff4611a09e84a Mon Sep 17 00:00:00 2001
From: builder <builder@pek-yocto-build1.(none)>
Date: Wed, 21 Mar 2012 14:56:32 +0800
Subject: [PATCH] audit: for cross-compiling.

---
 auparse/Makefile.am |   26 ++++++++++++++++++++++++++
 configure.ac        |    9 +++++++++
 lib/Makefile.am     |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/auparse/Makefile.am b/auparse/Makefile.am
index ea2360d..eabaacf 100644
--- a/auparse/Makefile.am
+++ b/auparse/Makefile.am
@@ -54,69 +54,95 @@ noinst_PROGRAMS = gen_captabs_h gen_clone-flagtabs_h gen_epoll_ctls_h \
 
 gen_captabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h captab.h
 gen_captabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="captab.h"'
+gen_captabs_h: $(gen_captabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_captabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 captabs.h: gen_captabs_h Makefile
 	./gen_captabs_h --i2s cap > $@
 
 gen_clone_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
 	clone-flagtab.h
 gen_clone_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="clone-flagtab.h"'
+gen_clone-flagtabs_h: $(gen_clone_flagtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_clone_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 clone-flagtabs.h: gen_clone-flagtabs_h Makefile
 	./gen_clone-flagtabs_h --i2s-transtab clone_flag > $@
 
 gen_epoll_ctls_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h epoll_ctl.h
 gen_epoll_ctls_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="epoll_ctl.h"'
+gen_epoll_ctls_h: $(gen_epoll_ctls_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_epoll_ctls_h_CFLAGS) $(LDFLAGS) -o $@ $<
 epoll_ctls.h: gen_epoll_ctls_h Makefile
 	./gen_epoll_ctls_h --i2s epoll_ctl > $@
 
 gen_famtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h famtab.h
 gen_famtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="famtab.h"'
+gen_famtabs_h: $(gen_famtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_famtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 famtabs.h: gen_famtabs_h Makefile
 	./gen_famtabs_h --i2s fam > $@
 
 gen_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h flagtab.h
 # ../auparse/ is used to avoid using ../lib/flagtab.h
 gen_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="../auparse/flagtab.h"'
+gen_flagtabs_h: $(gen_flagtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 flagtabs.h: gen_flagtabs_h Makefile
 	./gen_flagtabs_h --i2s-transtab flag > $@
 
 gen_fcntl_cmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
 	fcntl-cmdtab.h
 gen_fcntl_cmdtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="fcntl-cmdtab.h"'
+gen_fcntl-cmdtabs_h: $(gen_fcntl_cmdtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_fcntl_cmdtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 fcntl-cmdtabs.h: gen_fcntl-cmdtabs_h Makefile
 	./gen_fcntl-cmdtabs_h --i2s fcntl > $@
 
 gen_icmptypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h icmptypetab.h
 gen_icmptypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="icmptypetab.h"'
+gen_icmptypetabs_h: $(gen_icmptypetabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_icmptypetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 icmptypetabs.h: gen_icmptypetabs_h Makefile
 	./gen_icmptypetabs_h --i2s icmptype > $@
 
 gen_ipctabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipctab.h
 gen_ipctabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ipctab.h"'
+gen_ipctabs_h: $(gen_ipctabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_ipctabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 ipctabs.h: gen_ipctabs_h Makefile
 	./gen_ipctabs_h --i2s ipc > $@
 
 gen_nfprototabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h nfprototab.h
 gen_nfprototabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="nfprototab.h"'
+gen_nfprototabs_h: $(gen_nfprototabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_nfprototabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 nfprototabs.h: gen_nfprototabs_h Makefile
 	./gen_nfprototabs_h --i2s nfproto > $@
 
 gen_open_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
 	open-flagtab.h
 gen_open_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="open-flagtab.h"'
+gen_open-flagtabs_h: $(gen_open_flagtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_open_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 open-flagtabs.h: gen_open-flagtabs_h Makefile
 	./gen_open-flagtabs_h --i2s-transtab open_flag > $@
 
 gen_seeks_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seek.h
 gen_seeks_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="seek.h"'
+gen_seeks_h: $(gen_seeks_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_seeks_h_CFLAGS) $(LDFLAGS) -o $@ $<
 seeks.h: gen_seeks_h Makefile
 	./gen_seeks_h --i2s seek > $@
 
 gen_socktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktab.h
 gen_socktabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="socktab.h"'
+gen_socktabs_h: $(gen_socktabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_socktabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 socktabs.h: gen_socktabs_h Makefile
 	./gen_socktabs_h --i2s sock > $@
 
 gen_typetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h typetab.h
 gen_typetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="typetab.h"'
+gen_typetabs_h: $(gen_typetabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../lib $(gen_typetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 typetabs.h: gen_typetabs_h Makefile
 	./gen_typetabs_h --s2i type > $@
diff --git a/configure.ac b/configure.ac
index 3c2efb1..23a7d02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,15 @@ if test x"$GCC" = x"yes"; then
     esac
 fi
 
+if test -z "$CC_FOR_BUILD"; then
+	if test "x$cross_compiling" = "xno"; then
+	    CC_FOR_BUILD='$(CC)'
+    else
+	    CC_FOR_BUILD=gcc
+    fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+
 #gssapi
 AC_ARG_ENABLE(gssapi_krb5,
 	[AS_HELP_STRING([--enable-gssapi-krb5],[Enable GSSAPI Kerberos 5 support @<:@default=no@:>@])],
diff --git a/lib/Makefile.am b/lib/Makefile.am
index c5952f9..ad744c2 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -60,12 +60,16 @@ noinst_PROGRAMS += gen_armeb_tables_h
 endif
 gen_actiontabs_h_SOURCES = gen_tables.c gen_tables.h actiontab.h
 gen_actiontabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="actiontab.h"'
+gen_actiontabs_h: $(gen_actiontabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_actiontabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 actiontabs.h: gen_actiontabs_h Makefile
 	./gen_actiontabs_h --lowercase --i2s --s2i action > $@
 
 if USE_ALPHA
 gen_alpha_tables_h_SOURCES = gen_tables.c gen_tables.h alpha_table.h
 gen_alpha_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="alpha_table.h"'
+gen_alpha_tables_h: $(gen_alpha_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_alpha_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 alpha_tables.h: gen_alpha_tables_h Makefile
 	./gen_alpha_tables_h --lowercase --i2s --s2i alpha_syscall > $@
 endif
@@ -73,73 +77,101 @@ endif
 if USE_ARMEB
 gen_armeb_tables_h_SOURCES = gen_tables.c gen_tables.h armeb_table.h
 gen_armeb_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="armeb_table.h"'
+gen_armeb_tables_h: $(gen_armeb_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_armeb_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 armeb_tables.h: gen_armeb_tables_h Makefile
 	./gen_armeb_tables_h --lowercase --i2s --s2i armeb_syscall > $@
 endif
 
 gen_errtabs_h_SOURCES = gen_tables.c gen_tables.h errtab.h
 gen_errtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="errtab.h"'
+gen_errtabs_h: $(gen_errtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_errtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 errtabs.h: gen_errtabs_h Makefile
 	./gen_errtabs_h --duplicate-ints --uppercase --i2s --s2i err > $@
 
 gen_fieldtabs_h_SOURCES = gen_tables.c gen_tables.h fieldtab.h
 gen_fieldtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="fieldtab.h"'
+gen_fieldtabs_h: $(gen_fieldtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_fieldtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 fieldtabs.h: gen_fieldtabs_h Makefile
 	./gen_fieldtabs_h --duplicate-ints --lowercase --i2s --s2i field > $@
 
 gen_flagtabs_h_SOURCES = gen_tables.c gen_tables.h flagtab.h
 gen_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="flagtab.h"'
+gen_flagtabs_h: $(gen_flagtabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_flagtabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 flagtabs.h: gen_flagtabs_h Makefile
 	./gen_flagtabs_h --lowercase --i2s --s2i flag > $@
 
 gen_ftypetabs_h_SOURCES = gen_tables.c gen_tables.h ftypetab.h
 gen_ftypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ftypetab.h"'
+gen_ftypetabs_h: $(gen_ftypetabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_ftypetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 ftypetabs.h: gen_ftypetabs_h Makefile
 	./gen_ftypetabs_h --lowercase --i2s --s2i ftype > $@
 
 gen_i386_tables_h_SOURCES = gen_tables.c gen_tables.h i386_table.h
 gen_i386_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="i386_table.h"'
+gen_i386_tables_h: $(gen_i386_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_i386_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 i386_tables.h: gen_i386_tables_h Makefile
 	./gen_i386_tables_h --duplicate-ints --lowercase --i2s --s2i \
 		i386_syscall > $@
 
 gen_ia64_tables_h_SOURCES = gen_tables.c gen_tables.h ia64_table.h
 gen_ia64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ia64_table.h"'
+gen_ia64_tables_h: $(gen_ia64_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_ia64_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 ia64_tables.h: gen_ia64_tables_h Makefile
 	./gen_ia64_tables_h --lowercase --i2s --s2i ia64_syscall > $@
 
 gen_machinetabs_h_SOURCES = gen_tables.c gen_tables.h machinetab.h
 gen_machinetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="machinetab.h"'
+gen_machinetabs_h: $(gen_machinetabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_machinetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 machinetabs.h: gen_machinetabs_h Makefile
 	./gen_machinetabs_h --duplicate-ints --lowercase --i2s --s2i machine \
 		> $@
 
 gen_msg_typetabs_h_SOURCES = gen_tables.c gen_tables.h msg_typetab.h
 gen_msg_typetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="msg_typetab.h"'
+gen_msg_typetabs_h: $(gen_msg_typetabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_msg_typetabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 msg_typetabs.h: gen_msg_typetabs_h Makefile
 	./gen_msg_typetabs_h --uppercase --i2s --s2i msg_type > $@
 
 gen_optabs_h_SOURCES = gen_tables.c gen_tables.h optab.h
 gen_optabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="optab.h"'
+gen_optabs_h: $(gen_optabs_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_optabs_h_CFLAGS) $(LDFLAGS) -o $@ $<
 optabs.h: gen_optabs_h Makefile
 	./gen_optabs_h --i2s op > $@
 
 gen_ppc_tables_h_SOURCES = gen_tables.c gen_tables.h ppc_table.h
 gen_ppc_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ppc_table.h"'
+gen_ppc_tables_h: $(gen_ppc_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_ppc_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 ppc_tables.h: gen_ppc_tables_h Makefile
 	./gen_ppc_tables_h --lowercase --i2s --s2i ppc_syscall > $@
 
 gen_s390_tables_h_SOURCES = gen_tables.c gen_tables.h s390_table.h
 gen_s390_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="s390_table.h"'
+gen_s390_tables_h: $(gen_s390_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_s390_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 s390_tables.h: gen_s390_tables_h Makefile
 	./gen_s390_tables_h --lowercase --i2s --s2i s390_syscall > $@
 
 gen_s390x_tables_h_SOURCES = gen_tables.c gen_tables.h s390x_table.h
 gen_s390x_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="s390x_table.h"'
+gen_s390x_tables_h: $(gen_s390x_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_s390x_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 s390x_tables.h: gen_s390x_tables_h Makefile
 	./gen_s390x_tables_h --lowercase --i2s --s2i s390x_syscall > $@
 
 gen_x86_64_tables_h_SOURCES = gen_tables.c gen_tables.h x86_64_table.h
 gen_x86_64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="x86_64_table.h"'
+gen_x86_64_tables_h: $(gen_x86_64_tables_h_SOURCES)
+	$(CC_FOR_BUILD) -DHAVE_CONFIG_H -I. -I.. -I../auparse $(gen_x86_64_tables_h_CFLAGS) $(LDFLAGS) -o $@ $<
 x86_64_tables.h: gen_x86_64_tables_h Makefile
 	./gen_x86_64_tables_h --lowercase --i2s --s2i x86_64_syscall > $@
-- 
1.7.5.4