Autoconf: Fix --with-user and --with-chroot. [skip appveyor]
Refine two blocks in configure.ac such that each option correctly
handles both of the Autoconf-supplied values ("yes" and "no") and, when
the option is properly enabled, the message is easier to understand.
See also commit
9aca99a. While at it, use $withval more to unify the
code and squelch the following warnings from Autoconf 2.71:
configure.ac:188: warning: back quotes and double quotes must not be
escaped in: $as_me:${as_lineno-$LINENO}: result: to \"$withval\"
configure.ac:188: warning: back quotes and double quotes must not be
escaped in: to \"$withval\"
configure.ac:198: warning: back quotes and double quotes must not be
escaped in: $as_me:${as_lineno-$LINENO}: result: to \"$withval\"
configure.ac:198: warning: back quotes and double quotes must not be
escaped in: to \"$withval\"
User experience before:
./configure
checking whether to drop root privileges by default... no
checking whether to chroot... no
./configure --with-user=someuser --with-chroot=/some/dir/
checking whether to drop root privileges by default... to "someuser"
checking whether to chroot... to "/some/dir/"
./configure --without-user --without-chroot
checking whether to drop root privileges by default... to "no"
checking whether to chroot... no
./configure --with-user
checking whether to drop root privileges by default... to "yes"
./configure --with-chroot
checking whether to chroot... to "yes"
User experience after:
./configure
checking whether to drop root privileges by default... no
checking whether to chroot... no
./configure --with-user=someuser --with-chroot=/some/dir/
checking whether to drop root privileges by default... yes, to user
"someuser"
checking whether to chroot... yes, to directory "/some/dir/"
./configure --without-user --without-chroot
checking whether to drop root privileges by default... no
checking whether to chroot... no
./configure --with-user
configure: error: --with-user requires a username
./configure --with-chroot
configure: error: --with-chroot requires a directory