configure: Try pkg-config first for libselinux
v2 (Emil) Add SELINUX_CFLAGS in the respective locations Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
This commit is contained in:

committed by
Emil Velikov

parent
61f6cddef7
commit
6ba4392da2
12
configure.ac
12
configure.ac
@@ -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\"
|
||||
|
Reference in New Issue
Block a user