audit: Add a patch for cross compiling.

This commit is contained in:
Xin Ouyang 2012-03-27 17:22:19 +08:00
parent 9a7b0ecb92
commit b1508dbf5b
2 changed files with 259 additions and 0 deletions

View File

@ -0,0 +1,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

View File

@ -12,6 +12,8 @@ SRC_URI = "http://people.redhat.com/sgrubb/audit/audit-2.1.3.tar.gz \
file://disable-ldap.patch \
file://audit-python.patch"
SRC_URI += "file://audit-for-cross-compiling.patch"
inherit autotools
SRC_URI[md5sum] = "abf26e3ac09f666905c5636dd24611fa"