advancecomp: configure rules mishandle --disable-*
Brought to you by:
amadvance
The AC_ARG_ENABLE is used incorrectly in configure.ac, resulting in --disable-valgrind and --disable-debug enabling them rather than disabling.
It is a common mistake to confuse the two last arguments with yes/no but the actual usage is roughly;
AC_ARG_ENABLE(flag, docstring, if-passed, if-not-passed)
i.e. the third argument is run both when --enable-foo and --disable-foo is passed, and fourth is run only when none are passed. The common way of handling this is to set the default in if-not-passed clause and check the actual value passed by user afterwards, e.g.:
AC_ARG_ENABLE(..., ..., [], [enable_valgrind=yes])
if "$enable_valgrind" = "yes"; then
...
fi