-PKG_CHECK_MODULES(GTK, [ gtk+-2.0 ])
-AC_SUBST(GTK_CFLAGS)
-AC_SUBST(GTK_LIBS)
-
-PKG_CHECK_MODULES( CGROUP, [ libcgroup >= 0.35 ], [],
- [AC_CHECK_HEADER( [libcgroup.h], [], [AC_MSG_ERROR([*** libcgroup.h not found])], )
- save_CPPFLAGS="$CPPFLAGS"
- save_LIBS="$LIBS"
- CGROUP_LIBS=${CGROUP_LIBS:--lcgroup}
- LIBS="$LIBS $CGROUP_LIBS"
- CPPFLAGS="$CPPFLAGS $CGROUP_CFLAGS"
- AC_MSG_CHECKING([for libcgroup >= 0.35])
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[#include <libcgroup.h>]], [[ CGFLAG_DELETE_RECURSIVE; cgroup_init(); ]])],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no]); AC_MSG_ERROR([*** systemd needs libcgroup 0.35 or newer])],
- [${CGROUP_LIBS}])
- CPPFLAGS="$save_CPPFLAGS"
- LIBS="$save_LIBS"
- ])
-
-AC_SUBST(CGROUP_CFLAGS)
-AC_SUBST(CGROUP_LIBS)
-
-AM_PROG_VALAC()
+have_selinux=no
+AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
+if test "x$enable_selinux" != "xno"; then
+ # not using PKG_CHECK_MODULES as for some reason libselinux didn't
+ # install any pkg-config modules here
+ AC_SEARCH_LIBS([getcon], [selinux],
+ [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELINUX is available]) have_selinux=yes],
+ have_selinux=no)
+ AC_SUBST(SELINUX_CFLAGS)
+ AC_SUBST(SELINUX_LIBS)
+ if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
+ AC_MSG_ERROR([*** selinux support requested but libraries not found])
+ fi
+fi
+AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
+
+AC_ARG_ENABLE([tcpwrap],
+ AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
+ [case "${enableval}" in
+ yes) have_tcpwrap=yes ;;
+ no) have_tcpwrap=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
+ esac],
+ [have_tcpwrap=auto])
+
+if test "x${have_tcpwrap}" != xno ; then
+ ACX_LIBWRAP
+ if test "x${LIBWRAP_LIBS}" = x ; then
+ if test "x$have_tcpwrap" = xyes ; then
+ AC_MSG_ERROR([*** TCP wrappers support not found.])
+ fi
+ have_tcpwrap=no
+ else
+ have_tcpwrap=yes
+ fi
+else
+ LIBWRAP_LIBS=
+fi
+AC_SUBST(LIBWRAP_LIBS)
+
+AC_ARG_ENABLE([pam],
+ AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
+ [case "${enableval}" in
+ yes) have_pam=yes ;;
+ no) have_pam=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
+ esac],
+ [have_pam=auto])
+
+if test "x${have_pam}" != xno ; then
+ AC_CHECK_HEADERS(
+ [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
+ [have_pam=yes],
+ [if test "x$have_pam" = xyes ; then
+ AC_MSG_ERROR([*** PAM headers not found.])
+ fi])
+
+ AC_CHECK_LIB(
+ [pam],
+ [pam_syslog],
+ [have_pam=yes],
+ [if test "x$have_pam" = xyes ; then
+ AC_MSG_ERROR([*** libpam not found.])
+ fi])
+
+ if test "x$have_pam" = xyes ; then
+ PAM_LIBS="-lpam -lpam_misc"
+ AC_DEFINE(HAVE_PAM, 1, [PAM available])
+ else
+ have_pam=no
+ fi
+else
+ PAM_LIBS=
+fi
+AC_SUBST(PAM_LIBS)
+AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
+
+AC_ARG_ENABLE([audit],
+ AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
+ [case "${enableval}" in
+ yes) have_audit=yes ;;
+ no) have_audit=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
+ esac],
+ [have_audit=auto])
+
+if test "x${have_audit}" != xno ; then
+ AC_CHECK_HEADERS(
+ [libaudit.h],
+ [have_audit=yes],
+ [if test "x$have_audit" = xyes ; then
+ AC_MSG_ERROR([*** AUDIT headers not found.])
+ fi])
+
+ AC_CHECK_LIB(
+ [audit],
+ [audit_open],
+ [have_audit=yes],
+ [if test "x$have_audit" = xyes ; then
+ AC_MSG_ERROR([*** libaudit not found.])
+ fi])
+
+ if test "x$have_audit" = xyes ; then
+ AUDIT_LIBS="-laudit"
+ AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
+ else
+ have_audit=no
+ fi
+else
+ AUDIT_LIBS=
+fi
+AC_SUBST(AUDIT_LIBS)
+
+have_gtk=no
+AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk], [disable GTK tools]))
+if test "x$enable_gtk" != "xno"; then
+ PKG_CHECK_MODULES(GTK, [ gtk+-2.0 ],
+ [AC_DEFINE(HAVE_GTK, 1, [Define if GTK is available]) have_gtk=yes], have_gtk=no)
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+ if test "x$have_gtk" = xno -a "x$enable_gtk" = xyes; then
+ AC_MSG_ERROR([*** gtk support requested but libraries not found])
+ fi
+fi
+AM_CONDITIONAL(HAVE_GTK, [test "$have_gtk" = "yes"])
+
+AM_PROG_VALAC([0.9])