summaryrefslogtreecommitdiffstats
path: root/m4/want_apparmor.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
commitf7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch)
treea3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /m4/want_apparmor.m4
parentInitial commit. (diff)
downloaddovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz
dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/want_apparmor.m4')
-rw-r--r--m4/want_apparmor.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/want_apparmor.m4 b/m4/want_apparmor.m4
new file mode 100644
index 0000000..6934ea7
--- /dev/null
+++ b/m4/want_apparmor.m4
@@ -0,0 +1,24 @@
+AC_DEFUN([DOVECOT_WANT_APPARMOR], [
+ want_apparmor=auto
+ AC_ARG_WITH([apparmor],
+ [AS_HELP_STRING([--with-apparmor], [enable apparmor plugin (default=auto)])],
+ [want_apparmor=$withval])
+
+ have_apparmor=no
+ if test $want_apparmor != no; then
+ AC_CHECK_HEADER([sys/apparmor.h], [
+ AC_CHECK_LIB([apparmor], [aa_change_hat], [
+ have_apparmor=yes
+ AC_SUBST([APPARMOR_LIBS], [-lapparmor])
+ ])
+ ])
+ fi
+
+ if test $want_apparmor = yes; then
+ if test $have_apparmor = no; then
+ AC_MSG_FAILURE([apparmor was not found])
+ fi
+ fi
+
+ AM_CONDITIONAL(HAVE_APPARMOR, test "$have_apparmor" = "yes")
+])