Commit 6ba4392d authored by Kusanagi Kouichi's avatar Kusanagi Kouichi Committed by Emil Velikov

configure: Try pkg-config first for libselinux

v2 (Emil) Add SELINUX_CFLAGS in the respective locations
Signed-off-by: 's avatarKusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
parent 61f6cdde
......@@ -506,13 +506,15 @@ AC_ARG_ENABLE([selinux],
[MESA_SELINUX="$enableval"],
[MESA_SELINUX=no])
if test "x$enable_selinux" = "xyes"; then
AC_CHECK_HEADER([selinux/selinux.h],[],
[AC_MSG_ERROR([SELinux headers not found])])
AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
[AC_MSG_ERROR([SELinux library not found])])
SELINUX_LIBS="-lselinux"
PKG_CHECK_MODULES([SELINUX], [libselinux], [],
[AC_CHECK_HEADER([selinux/selinux.h],[],
[AC_MSG_ERROR([SELinux headers not found])])
AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
[AC_MSG_ERROR([SELinux library not found])])
SELINUX_LIBS="-lselinux"])
DEFINES="$DEFINES -DMESA_SELINUX"
fi
AC_SUBST([SELINUX_CFLAGS])
AC_SUBST([SELINUX_LIBS])
dnl Options for APIs
......
......@@ -27,6 +27,7 @@ include ../Makefile.sources
AM_CPPFLAGS = \
$(DEFINES) \
$(SELINUX_CFLAGS) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mapi \
-I$(top_builddir)/src/mapi \
......
......@@ -21,6 +21,7 @@ CLEANFILES = $(BUILT_SOURCES)
AM_CFLAGS = $(PTHREAD_CFLAGS)
AM_CPPFLAGS = \
$(DEFINES) \
$(SELINUX_CFLAGS) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mapi \
-I$(top_builddir)/src/mapi \
......
......@@ -21,6 +21,7 @@
AM_CPPFLAGS = \
$(DEFINES) \
$(SELINUX_CFLAGS) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mapi \
-DMAPI_ABI_HEADER=\"vgapi_tmp.h\"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment