pbiering/ipv6calc

Incorrect use of AC_ARG_ENABLE() throughout configure.in

Closed this issue · 2 comments

At a few points throughout configure.in, the macro AC_ARG_ENABLE() is incorrectly used. The parameters should be interpreted as follows:

AC_ARG_ENABLE(option-name, help-string, action-if-present, action-if-not-present)

but instead it seems that you are interpreting the 3rd and 4th parameters as what to do if the option is enabled and what to do if it is disabled, respectively. An example of this problem is at line 1440 where you have

AC_ARG_ENABLE([mod_ipv6calc], 
	AS_HELP_STRING([--enable-mod_ipv6calc],
		[Enable build of mod_ipv6calc for Apache (default: disabled)]),
	[
		ENABLE_MOD_IPV6CALC="1"
	],[
		ENABLE_MOD_IPV6CALC="0"
])

This leads to the result that ./configure --disable-mod_ipv6calc actually enables mod_ipv6calc, as does ./configure --enable-mod_ipv6calc. The only way to disable this option is to NOT pass either --disable-mod_ipv6calc nor --enable-mod_ipv6calc.

To fix this, the 3rd parameter above should be changed from ENABLE_MOD_IPV6CALC="1" to ENABLE_MOD_IPV6CALC="$enable_mod_ipv6calc", and the 4th parameter can be left as is if you want --disable_mod_ipv6calc to be the default if this flag is not passed.

I did make your team aware of this some years ago, and sent a patch (if memory serves), but it seems that the same erroneous logic is being re-introduced. Take a look at (say) the db-ipv4 option on line 366 for a correct example.

Also, to modernize things, you should rename configure.in -> configure.ac. The former name has been deprecated for years.

Or actually, I think you want

if test "$enable_mod_ipv6calc" = "yes"; then
    ENABLE_MOD_IPV6CALC="1"
fi

since passing --enable-mod_ipv6calc sets $enable_mod_ipv6calc equal to yes.

Thank you for reporting, fixed in commit 74a8f57