Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 330139 | Differences between
and this patch

Collapse All | Expand All

(-)gnulib/m4/selinux-context-h.m4.orig (-4 / +9 lines)
Lines 1-4 Link Here
1
# serial 1   -*- Autoconf -*-
1
# serial 2   -*- Autoconf -*-
2
# Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
2
# Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
3
# This file is free software; the Free Software Foundation
3
# This file is free software; the Free Software Foundation
4
# gives unlimited permission to copy and/or distribute it,
4
# gives unlimited permission to copy and/or distribute it,
Lines 9-16 Link Here
9
9
10
AC_DEFUN([gl_HEADERS_SELINUX_CONTEXT_H],
10
AC_DEFUN([gl_HEADERS_SELINUX_CONTEXT_H],
11
[
11
[
12
  AC_CHECK_HEADERS([selinux/context.h],
12
  AC_REQUIRE([gl_LIBSELINUX])
13
                   [SELINUX_CONTEXT_H=],
13
  if test "$with_selinux" != no; then
14
                   [SELINUX_CONTEXT_H=selinux/context.h])
14
    AC_CHECK_HEADERS([selinux/context.h],
15
                     [SELINUX_CONTEXT_H=],
16
                     [SELINUX_CONTEXT_H=selinux/context.h])
17
  else
18
    SELINUX_CONTEXT_H=selinux/context.h
19
  fi
15
  AC_SUBST([SELINUX_CONTEXT_H])
20
  AC_SUBST([SELINUX_CONTEXT_H])
16
])
21
])
(-)gnulib/m4/selinux-selinux-h.m4.orig (-26 / +39 lines)
Lines 1-4 Link Here
1
# serial 3   -*- Autoconf -*-
1
# serial 4   -*- Autoconf -*-
2
# Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
2
# Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
3
# This file is free software; the Free Software Foundation
3
# This file is free software; the Free Software Foundation
4
# gives unlimited permission to copy and/or distribute it,
4
# gives unlimited permission to copy and/or distribute it,
Lines 12-52 Link Here
12
AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
12
AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
13
[
13
[
14
  AC_REQUIRE([gl_LIBSELINUX])
14
  AC_REQUIRE([gl_LIBSELINUX])
15
  AC_CHECK_HEADERS([selinux/selinux.h])
15
  if test "$with_selinux" != no; then
16
    AC_CHECK_HEADERS([selinux/selinux.h])
16
17
17
  if test "$ac_cv_header_selinux_selinux_h" = yes; then
18
    if test "$ac_cv_header_selinux_selinux_h" = yes; then
18
    # We do have <selinux/selinux.h>, so do compile getfilecon.c
19
      # We do have <selinux/selinux.h>, so do compile getfilecon.c
19
    # and arrange to use its wrappers.
20
      # and arrange to use its wrappers.
20
    AC_LIBOBJ([getfilecon])
21
      AC_LIBOBJ([getfilecon])
21
    gl_CHECK_NEXT_HEADERS([selinux/selinux.h])
22
      gl_CHECK_NEXT_HEADERS([selinux/selinux.h])
22
    AC_DEFINE([getfilecon], [rpl_getfilecon],
23
      AC_DEFINE([getfilecon], [rpl_getfilecon],
23
              [Always use our getfilecon wrapper.])
24
                [Always use our getfilecon wrapper.])
24
    AC_DEFINE([lgetfilecon], [rpl_lgetfilecon],
25
      AC_DEFINE([lgetfilecon], [rpl_lgetfilecon],
25
              [Always use our lgetfilecon wrapper.])
26
                [Always use our lgetfilecon wrapper.])
26
    AC_DEFINE([fgetfilecon], [rpl_fgetfilecon],
27
      AC_DEFINE([fgetfilecon], [rpl_fgetfilecon],
27
              [Always use our fgetfilecon wrapper.])
28
                [Always use our fgetfilecon wrapper.])
29
    fi
30
31
    case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
32
      no:*) # already warned
33
        ;;
34
      *:no)
35
        AC_MSG_WARN([libselinux was found but selinux/selinux.h is missing.])
36
        AC_MSG_WARN([AC_PACKAGE_NAME will be compiled without SELinux support.])
37
    esac
38
  else
39
    # Do as if <selinux/selinux.h> does not exist, even if
40
    # AC_CHECK_HEADERS_ONCE has already determined that it exists.
41
    AC_DEFINE([HAVE_SELINUX_SELINUX_H], [0])
28
  fi
42
  fi
29
30
  case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
31
    no:*) # already warned
32
      ;;
33
    *:no)
34
      AC_MSG_WARN([libselinux was found but selinux/selinux.h is missing.])
35
      AC_MSG_WARN([AC_PACKAGE_NAME will be compiled without SELinux support.])
36
  esac
37
])
43
])
38
44
39
AC_DEFUN([gl_LIBSELINUX],
45
AC_DEFUN([gl_LIBSELINUX],
40
[
46
[
41
  AC_REQUIRE([AC_CANONICAL_HOST])
47
  AC_REQUIRE([AC_CANONICAL_HOST])
42
  AC_REQUIRE([AC_CANONICAL_BUILD])
48
  AC_REQUIRE([AC_CANONICAL_BUILD])
49
50
  AC_ARG_WITH([selinux],
51
    AS_HELP_STRING([--without-selinux], [do not use SELinux, even on systems with SELinux]),
52
    [], [with_selinux=maybe])
53
43
  LIB_SELINUX=
54
  LIB_SELINUX=
44
  gl_save_LIBS=$LIBS
55
  if test "$with_selinux" != no; then
45
  AC_SEARCH_LIBS([setfilecon], [selinux],
56
    gl_save_LIBS=$LIBS
46
                 [test "$ac_cv_search_setfilecon" = "none required" ||
57
    AC_SEARCH_LIBS([setfilecon], [selinux],
47
                  LIB_SELINUX=$ac_cv_search_setfilecon])
58
                   [test "$ac_cv_search_setfilecon" = "none required" ||
59
                    LIB_SELINUX=$ac_cv_search_setfilecon])
60
    LIBS=$gl_save_LIBS
61
  fi
48
  AC_SUBST([LIB_SELINUX])
62
  AC_SUBST([LIB_SELINUX])
49
  LIBS=$gl_save_LIBS
50
63
51
  # Warn if SELinux is found but libselinux is absent;
64
  # Warn if SELinux is found but libselinux is absent;
52
  if test "$ac_cv_search_setfilecon" = no &&
65
  if test "$ac_cv_search_setfilecon" = no &&

Return to bug 330139