+if test $enable_locking = yes; then
+ true
+elif test $enable_locking = no; then
+ AC_DEFINE(NO_LOCKING)
+else
+ echo "error: must be yes or no: --enable-locking=$enable_locking"
+ exit 1
+fi
+
+
+
+# Check to see if we can lock Virtual-Terminal switching, but allow that
+# to be disabled at compile-time.
+#
+ac_vt_lockswitch=no
+AC_ARG_ENABLE(vt-locking,[
+ --enable-vt-locking Compile in support for locking Virtual Terminals.
+ This is the default if the system supports it, and
+ if locking support is included (--enable-locking.)
+ --disable-vt-locking Do not allow locking of VTs, even if locking is
+ enabled.],
+ [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
+if test $enable_vt_locking = yes; then
+
+ AC_MSG_CHECKING(for VT_LOCKSWITCH ioctl)
+ AC_CACHE_VAL(ac_cv_vt_lockswitch,
+ [AC_TRY_COMPILE([#include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <sys/vt.h>],
+ [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
+ [ac_cv_vt_lockswitch=yes],
+ [ac_cv_vt_lockswitch=no])])
+ ac_vt_lockswitch=$ac_cv_vt_lockswitch
+ AC_MSG_RESULT($ac_vt_lockswitch)
+
+elif test $enable_locking = no; then
+ true
+else
+ echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
+ exit 1
+fi
+
+if test $ac_vt_lockswitch = yes; then
+ AC_DEFINE(HAVE_VT_LOCKSWITCH)
+ # the VT_LOCKSWITCH ioctl can only be used when running as root.
+ need_setuid=yes
+fi
+
+
+