+
+AC_ARG_ENABLE(man-pages,
+ [ --enable-man-pages=no/yes/auto pod2man(1) required for man pages (def.=yes)],,enable_man_pages=yes)
+AC_ARG_ENABLE(sbin-mountdir,
+ [ --enable-sbin-mountdir=DIR mount(8) 'mount.captive' directory (def.=/sbin)],,
+ [ enable_sbin_mountdir="/sbin" ])
+AC_ARG_ENABLE(sbin-mount-fs,
+ [ --enable-sbin-mount-fs=FS1:FS2 sbin-mount pre-installed symlinks (def.=ntfs:fastfat:cdfs:ext2fsd)],,
+ [ enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd" ])
+AC_ARG_ENABLE(sandbox-setuid,
+ [ --enable-sandbox-setuid=USER non-privileged user for captive-sandbox-server (def.=captive)],
+ [ CAPTIVE_SANDBOX_SETUID="$enableval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ])
+AC_ARG_ENABLE(sandbox-setgid,
+ [ --enable-sandbox-setgid=GROUP non-privileged group for captive-sandbox-server (def.=captive)],
+ [ CAPTIVE_SANDBOX_SETGID="$enableval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ])
+AC_ARG_ENABLE(sandbox-chroot,
+ [ --enable-sandbox-chroot=DIR root-owned directory for captive-sandbox-server (def.=/var/lib/captive)],
+ [ CAPTIVE_SANDBOX_CHROOT="$enableval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ])
+AC_ARG_ENABLE(bug-replay,
+ [ --enable-bug-replay=no/yes/auto compile debugging tool (def.=auto)],,enable_bug_replay=auto)
+AC_ARG_ENABLE(lufs,
+ [ --enable-lufs=no/yes/auto compile LUFS filesystem module (def.=auto)],,enable_lufs=auto)
+AC_ARG_ENABLE(install-pkg,
+ [ --enable-install-pkg=no/yes/auto compile installation utils (def.=auto)],,enable_install_pkg=auto)
+
+
+# AC_ARG_ENABLE(sbin-mountdir,[--enable-sbin-mountdir=DIR],,[enable_sbin_mountdir="/sbin"])
+AM_CONDITIONAL(ENABLE_SBIN_MOUNT,[test "$enable_sbin_mount" != "no"])
+AC_SUBST(enable_sbin_mountdir)
+
+# AC_ARG_ENABLE(sbin-mount-fs,[--enable-sbin-mount-fs=FS1:FS2],,[enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd"])
+AC_SUBST(enable_sbin_mount_fs)
+
+# AC_ARG_ENABLE(sandbox-setuid,[--enable-sandbox-setuid=USER],,[CAPTIVE_SANDBOX_SETUID="captive"])
+AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID",
+ [non-privileged user for captive-sandbox-server])
+
+# AC_ARG_ENABLE(sandbox-setgid,[--enable-sandbox-setgid=GROUP],,[CAPTIVE_SANDBOX_SETGID="captive"])
+AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID",
+ [non-privileged group for captive-sandbox-server])
+
+# AC_ARG_ENABLE(sandbox-chroot,[--enable-sandbox-chroot=DIR],,[CAPTIVE_SANDBOX_CHROOT="/var/lib/captive"])
+AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT",
+ [root-owned directory for captive-sandbox-server])
+AC_SUBST(CAPTIVE_SANDBOX_CHROOT)
+
+dnl Permit 'if NEVER' for Makefile.am-s; symbol 'FALSE' forbidden by automake
+AM_CONDITIONAL(NEVER,false)
+
+PERL=
+AC_PATH_PROGS(PERL,perl5 perl)
+if test '!' -f ./src/libcaptive/ke/exports.c -a -z "$PERL";then
+ AC_MSG_ERROR([perl(1) required as './src/libcaptive/ke/exports.c' is not found.])
+fi
+AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
+
+POD2MAN=
+AC_PATH_PROGS(POD2MAN,pod2man)
+AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ])
+if test x$enable_man_pages = xyes;then
+ if test -z "$POD2MAN";then
+ AC_MSG_ERROR([captive requires pod2man(1) for man pages; try --disable-man-pages.])
+ fi
+ if test -z "$PERL";then
+ AC_MSG_ERROR([captive requires perl(1) for man pages; try --disable-man-pages.])
+ fi
+elif test x$enable_man_pages != xno;then
+ if test -z "$POD2MAN";then
+ AC_MSG_WARN([captive requires pod2man(1) for man pages by --enable-man-pages; mans will not be installed.])
+ fi
+ if test -z "$PERL";then
+ AC_MSG_WARN([captive requires perl(1) for man pages by --enable-man-pages; mans will not be installed.])
+ fi
+fi
+AM_CONDITIONAL(ENABLE_MAN_PAGES,[ test x$enable_man_pages != xno -a -n "$POD2MAN" -a -n "$PERL" ])