+dnl Check for Augeas (now optional).
+AC_CHECK_LIB([augeas],[aug_match],[
+ have_augeas=yes
+ AUGEAS_LIB="-laugeas"
+
+ old_LIBS="$LIBS"
+ LIBS="$LIBS $AUGEAS_LIB"
+ dnl Check for functions not available in earlier versions of Augeas.
+ AC_CHECK_FUNCS([aug_load aug_defvar aug_defnode])
+ LIBS="$old_LIBS"
+
+ ],[have_augeas=no])
+if test "x$have_augeas" = "xyes"; then
+ AC_DEFINE([HAVE_AUGEAS],[1],[Define to 1 if you have Augeas])
+fi
+AC_SUBST([AUGEAS_LIB])
+
+dnl Check for libselinux (optional).
+AC_CHECK_HEADERS([selinux/selinux.h])
+AC_CHECK_LIB([selinux],[setexeccon],[
+ have_libselinux="$ac_cv_header_selinux_selinux_h"
+ SELINUX_LIB="-lselinux"
+
+ old_LIBS="$LIBS"
+ LIBS="$LIBS $SELINUX_LIB"
+ AC_CHECK_FUNCS([setcon getcon])
+ LIBS="$old_LIBS"
+
+ ],[have_libselinux=no])
+if test "x$have_libselinux" = "xyes"; then
+ AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux])
+fi
+AC_SUBST([SELINUX_LIB])
+
+dnl Check for systemtap/DTrace userspace probes (optional).
+dnl http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps
+AC_CHECK_HEADERS([sys/sdt.h])
+dnl AC_CHECK_PROG([DTRACE],[dtrace],[dtrace],[no])
+