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
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])
23 AC_MSG_CHECKING([for compatible sepol source tree])
24 sepol_version=${sepol_srcdir}/VERSION
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])
34 sepol_devel_incdir="${sepol_srcdir}/../include"
36 SELINUX_CFLAGS="-I${sepol_devel_incdir} -I${selinux_devel_incdir}"
39 #include <sepol/policydb/expand.h>
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);
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"
50 sepol_new_expand_boolmap="no"
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}"
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
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))
81 if (role_set_expand(&roles, &e_roles, policydbp))
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
87 AC_MSG_CHECKING([consistency of all components of python development environment])
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"
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
99 python-build: sesearch.c seinfo.c
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
106 - $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
107 + $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --prefix=$(DESTDIR)/usr`
110 - $(PYTHON) setup.py uninstall `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
111 + $(PYTHON) setup.py uninstall `test -n "$(DESTDIR)" && echo --prefix=$(DESTDIR)/usr`
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
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())