X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fselinux-selinux-h.m4;h=20dc77c4369f9362204df5672aefe262ff33b558;hb=6cdf6086af1513a0a7cc54d8abd3d8634b452875;hp=464b7821f1b49e220ac58d49a2fc68f37dd5a972;hpb=d62671f288e52669bb9de34f4ad4e5e694ab9bd3;p=gnulib.git diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4 index 464b7821f..20dc77c43 100644 --- a/m4/selinux-selinux-h.m4 +++ b/m4/selinux-selinux-h.m4 @@ -1,5 +1,5 @@ -# serial 1 -*- Autoconf -*- -# Copyright (C) 2006, 2007 Free Software Foundation, Inc. +# serial 3 -*- Autoconf -*- +# Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -9,17 +9,37 @@ AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H], [ - # Check for , + AC_REQUIRE([gl_LIBSELINUX]) AC_CHECK_HEADERS([selinux/selinux.h], [SELINUX_SELINUX_H=], [SELINUX_SELINUX_H=selinux/selinux.h]) AC_SUBST([SELINUX_SELINUX_H]) + case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in + no:*) # already warned + ;; + *:no) + AC_MSG_WARN([libselinux was found but selinux/selinux.h is missing.]) + AC_MSG_WARN([AC_PACKAGE_NAME will be compiled without SELinux support.]) + esac +]) + +AC_DEFUN([gl_LIBSELINUX], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_CANONICAL_BUILD]) LIB_SELINUX= gl_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) + AC_SUBST([LIB_SELINUX]) LIBS=$gl_save_LIBS + + # Warn if SELinux is found but libselinux is absent; + if test "$ac_cv_search_setfilecon" = no && + test "$host" = "$build" && test -d /selinux; then + AC_MSG_WARN([This system supports SELinux but libselinux is missing.]) + AC_MSG_WARN([AC_PACKAGE_NAME will be compiled without SELinux support.]) + fi ])