aboutsummaryrefslogtreecommitdiff
blob: 3c03f8e7ab62edd4a5aa1b2a75d2f4d94da5146b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Disable automagical building of stuff with libselinux.

Gentoo-Bug: 230073
Acked-by: Robin H. Johnson <robbat2@gentoo.org>

--- coreutils-6.10/m4/gnulib-comp.m4.orig	2008-07-06 18:44:54.000000000 +0200
+++ coreutils-6.10/m4/gnulib-comp.m4	2008-07-06 20:17:37.000000000 +0200
@@ -263,16 +263,25 @@
   gl_SAVEWD
   # FIXME: put this in an .m4 file?
   # For runcon.
-  AC_CHECK_HEADERS([selinux/flask.h])
-  AC_LIBOBJ([selinux-at])
-  ac_save_LIBS="$LIBS"
+  AC_LIBOBJ([selinux-at])
+  AC_ARG_ENABLE([selinux],
+    AC_HELP_STRING([--disable-selinux], [disable support for SELinux]),
+    , [enable_selinux=auto])
+  if test "x$enable_selinux" != "xno" ; then
+    AC_CHECK_HEADERS([selinux/flask.h])
+    ac_save_LIBS="$LIBS"
     AC_SEARCH_LIBS(setfilecon, selinux,
                    [test "$ac_cv_search_setfilecon" = "none required" ||
                     LIB_SELINUX=$ac_cv_search_setfilecon])
     AC_SUBST(LIB_SELINUX)
-  LIBS="$ac_save_LIBS"
-  gl_HEADERS_SELINUX_SELINUX_H
-  gl_HEADERS_SELINUX_CONTEXT_H
+    LIBS="$ac_save_LIBS"
+    gl_HEADERS_SELINUX_SELINUX_H
+    gl_HEADERS_SELINUX_CONTEXT_H
+  else
+    AC_SUBST(LIB_SELINUX,"")
+    AC_SUBST(SELINUX_CONTEXT_H,selinux/context.h)
+    AC_SUBST(SELINUX_SELINUX_H,selinux/selinux.h)
+  fi
   gl_FUNC_SETENV
   gl_STDLIB_MODULE_INDICATOR([setenv])
   gl_SETTIME