c6e735c08f10b2c02fbb18cdd81255ad0a10dfc3
[gnulib.git] / m4 / selinux-selinux-h.m4
1 # serial 2   -*- Autoconf -*-
2 # Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
3 # This file is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # From Jim Meyering
8 # Provide <selinux/selinux.h>, if necessary.
9
10 AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
11 [
12   # Check for <selinux/selinux.h>,
13   AC_CHECK_HEADERS([selinux/selinux.h],
14                    [SELINUX_SELINUX_H=],
15                    [SELINUX_SELINUX_H=selinux/selinux.h])
16   AC_SUBST([SELINUX_SELINUX_H])
17
18   LIB_SELINUX=
19   gl_save_LIBS=$LIBS
20   AC_SEARCH_LIBS([setfilecon], [selinux],
21                  [test "$ac_cv_search_setfilecon" = "none required" ||
22                   LIB_SELINUX=$ac_cv_search_setfilecon])
23   AC_SUBST([LIB_SELINUX])
24   LIBS=$gl_save_LIBS
25 ])