linux-headers: bump 4.{4, 9}.x series
[buildroot-gz.git] / package / setools / 0001-cross-compile-fixes.patch
blob1a4af0ce31e2623b12862d066a0426ae82da2fa6
1 Correct build issues to enable cross compiling. These changes require the
2 package to be auto reconfigured.
4 These updates were not upsteamed as the 3.3.x version has stablized and they
5 were only taking bug fixes. Also the 4.0 preview has completely reworked
6 the build infrastructure which will require this to be revisited.
8 Signed-off-by Clayton Shotwell <clshotwe@rockwellcollins.com>
10 diff -urN a/configure.ac b/configure.ac
11 --- a/configure.ac 2013-01-16 10:36:24.000000000 -0600
12 +++ b/configure.ac 2013-07-12 08:22:10.380255248 -0500
13 @@ -448,8 +448,9 @@
14 sepol_srcdir="")
15 if test "x${sepol_srcdir}" = "x"; then
16 sepol_srcdir=${sepol_devel_libdir}
17 - AC_CHECK_FILE([${sepol_srcdir}/libsepol.a],,
18 - AC_MSG_ERROR([make sure libsepol-static is installed]))
19 + if test ! -f ${sepol_srcdir}/libsepol.a; then
20 + AC_MSG_ERROR([could not find precompiled libsepol.a])
21 + fi
22 else
23 AC_MSG_CHECKING([for compatible sepol source tree])
24 sepol_version=${sepol_srcdir}/VERSION
25 @@ -484,8 +485,9 @@
26 AC_CHECK_HEADER([sepol/policydb/policydb.h], , AC_MSG_ERROR([could not find sepol source tree]))
27 CFLAGS="${sepol_src_save_CFLAGS}"
28 CPPFLAGS="${sepol_src_save_CPPFLAGS}"
29 - AC_CHECK_FILE([${sepol_srcdir}/libsepol.a],,
30 - AC_MSG_ERROR([could not find precompiled libsepol.a]))
31 + if test ! -f ${sepol_srcdir}/libsepol.a; then
32 + AC_MSG_ERROR([could not find precompiled libsepol.a])
33 + fi
34 sepol_devel_incdir="${sepol_srcdir}/../include"
36 SELINUX_CFLAGS="-I${sepol_devel_incdir} -I${selinux_devel_incdir}"
37 @@ -578,12 +580,13 @@
38 [AC_LANG_SOURCE([
39 #include <sepol/policydb/expand.h>
40 int main () {
41 - return expand_module_avrules(NULL, NULL, NULL, NULL, NULL, 0, 0);
42 + return expand_module_avrules(NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0);
43 }])],
44 AC_MSG_RESULT([yes]),
45 AC_MSG_ERROR([this version of libsepol is incompatible with SETools]))
47 sepol_new_expand_boolmap="yes"
48 + sepol_new_user_role_mapping="yes"
49 else
50 sepol_new_expand_boolmap="no"
52 @@ -607,7 +610,8 @@
53 exit(EXIT_FAILURE);
54 }])],
55 sepol_policy_version_max=`cat conftest.data`,
56 - AC_MSG_FAILURE([could not determine maximum libsepol policy version]))
57 + AC_MSG_FAILURE([could not determine maximum libsepol policy version]),
58 + sepol_policy_version_max="26")
59 AC_DEFINE_UNQUOTED(SEPOL_POLICY_VERSION_MAX, ${sepol_policy_version_max}, [maximum policy version supported by libsepol])
60 CFLAGS="${sepol_save_CFLAGS}"
61 CPPFLAGS="${sepol_save_CPPFLAGS}"
62 @@ -631,7 +635,7 @@
63 changequote([,])dnl
64 selinux_save_CFLAGS="${CFLAGS}"
65 CFLAGS="${SELINUX_CFLAGS} ${SELINUX_LIB_FLAG} -lselinux -lsepol ${CFLAGS}"
66 - gcc ${CFLAGS} -o conftest conftest.c >&5
67 + ${CC} ${CFLAGS} -o conftest conftest.c >&5
68 selinux_policy_dir=`./conftest`
69 AC_MSG_RESULT(${selinux_policy_dir})
70 CFLAGS="${selinux_save_CFLAGS}"
71 diff -urN a/libqpol/src/policy_define.c b/libqpol/src/policy_define.c
72 --- a/libqpol/src/policy_define.c 2013-01-16 10:36:24.000000000 -0600
73 +++ b/libqpol/src/policy_define.c 2013-07-12 08:22:10.380255248 -0500
74 @@ -2135,7 +2135,7 @@
75 #ifdef HAVE_SEPOL_ROLE_ATTRS
76 if (role_set_expand(&roles, &e_roles, policydbp, NULL, NULL))
77 #elif HAVE_SEPOL_USER_ROLE_MAPPING
78 - if (role_set_expand(&roles, &e_roles, policydbp, NULL))
79 + if (role_set_expand(&roles, &e_roles, policydbp, NULL, NULL))
80 #else
81 if (role_set_expand(&roles, &e_roles, policydbp))
82 #endif
83 diff -urN a/m4/ac_python_devel.m4 b/m4/ac_python_devel.m4
84 --- a/m4/ac_python_devel.m4 2013-01-16 10:36:22.000000000 -0600
85 +++ b/m4/ac_python_devel.m4 2013-07-12 08:22:10.380255248 -0500
86 @@ -234,7 +234,7 @@
87 AC_MSG_CHECKING([consistency of all components of python development environment])
88 AC_LANG_PUSH([C])
89 # save current global flags
90 - LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
91 + LIBS="$ac_save_LIBS $PYTHON_EXTRA_LIBS $PYTHON_LDFLAGS"
92 CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
93 AC_TRY_LINK([
94 #include <Python.h>
95 diff -urN a/python/setools/Makefile.am b/python/setools/Makefile.am
96 --- a/python/setools/Makefile.am 2013-01-16 10:36:22.000000000 -0600
97 +++ b/python/setools/Makefile.am 2013-07-12 08:22:19.200251011 -0500
98 @@ -22,13 +22,13 @@
99 python-build: sesearch.c seinfo.c
100 @mkdir -p setools
101 @cp __init__.py setools
102 - LIBS="$(QPOL_LIB_FLAG) $(APOL_LIB_FLAG)" INCLUDES="$(QPOL_CFLAGS) $(APOL_CFLAGS)" $(PYTHON) setup.py build
103 + LIBS="$(QPOL_LIB_FLAG) $(APOL_LIB_FLAG)" LIBDIRS="$(PYTHON_LDFLAGS)" INCLUDES="$(PYTHON_CPPFLAGS) $(QPOL_CFLAGS) $(APOL_CFLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(LDFLAGS)" $(PYTHON) setup.py build_ext
105 install-exec-hook:
106 - $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
107 + $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --prefix=$(DESTDIR)/usr`
109 uninstall-hook:
110 - $(PYTHON) setup.py uninstall `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
111 + $(PYTHON) setup.py uninstall `test -n "$(DESTDIR)" && echo --prefix=$(DESTDIR)/usr`
113 clean-local:
114 $(PYTHON) setup.py clean -a
115 --- a/python/setools/setup.py 2013-01-16 10:36:22.000000000 -0600
116 +++ b/python/setools/setup.py 2013-09-04 09:17:48.452916991 -0500
117 @@ -8,7 +8,7 @@
118 try:
119 inc=os.getenv("INCLUDES").split(" ")
120 INCLUDES=map(lambda x: x[2:], inc)
121 - LIBDIRS=map(lambda x: "/".join(x.split("/")[:-1]), os.getenv("LIBS").split())
122 + LIBDIRS=map(lambda x: "/".join(x.split("/")[:-1]), os.getenv("LIBS").split()) + map(lambda x: x[2:], os.getenv("LIBDIRS").split())
123 except:
124 INCLUDES=""
125 LIBDIRS=""