1From 9a32d42dfc6713fd0085dd4563a934afc30ec097 Mon Sep 17 00:00:00 2001 2From: Li xin <lixin.fnst@cn.fujitsu.com> 3Date: Sun, 19 Jul 2015 02:42:58 +0900 4Subject: [PATCH] Fixed swig host contamination issue 5 6The audit build uses swig to generate a python wrapper. 7Unfortunately, the swig info file references host include 8directories. Some of these were previously noticed and 9eliminated, but the one fixed here was not. 10 11Upstream-Status: Inappropriate [embedded specific] 12 13Signed-off-by: Anders Hedlund <anders.hedlund@windriver.com> 14Signed-off-by: Joe Slater <jslater@windriver.com> 15Signed-off-by: Yi Zhao <yi.zhao@windriver.com> 16--- 17 bindings/swig/python3/Makefile.am | 3 ++- 18 bindings/swig/src/auditswig.i | 2 +- 19 2 files changed, 3 insertions(+), 2 deletions(-) 20 21diff --git a/bindings/swig/python3/Makefile.am b/bindings/swig/python3/Makefile.am 22index 6131e80d..2fb7207b 100644 23--- a/bindings/swig/python3/Makefile.am 24+++ b/bindings/swig/python3/Makefile.am 25@@ -23,6 +23,7 @@ 26 CONFIG_CLEAN_FILES = *.loT *.rej *.orig 27 AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) 28 AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) 29+STDINC ?= /usr/include 30 LIBS = $(top_builddir)/lib/libaudit.la 31 SWIG_FLAGS = -python -py3 -modern 32 SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) 33@@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/lib/libaudit.h ${top_builddir}/lib/libaudi 34 _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la 35 nodist__audit_la_SOURCES = audit_wrap.c 36 audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i 37- swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i 38+ swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} -I$(STDINC) ${srcdir}/../src/auditswig.i 39 40 CLEANFILES = audit.py* audit_wrap.c *~ 41 42diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i 43index 9a2c5661..6cbb7295 100644 44--- a/bindings/swig/src/auditswig.i 45+++ b/bindings/swig/src/auditswig.i 46@@ -43,7 +43,7 @@ typedef unsigned uid_t; 47 * generating setters against them: https://github.com/swig/swig/issues/1699 48 */ 49 %ignore audit_rule_data::buf; 50-%include "/usr/include/linux/audit.h" 51+%include "../lib/audit.h" 52 #define __extension__ /*nothing*/ 53 %include <stdint.i> 54 %include "../lib/libaudit.h" 55-- 562.25.1 57 58