AC_ARG_ENABLE usage is incorrect
In several locations in configure.ac the AC_ARG_ENABLE usage is incorrect or at least non-standard. Whether --enable-<feature> or --disable-<feature> flag is passed to configure it is treated as if the feature is enabled. The only way to disable a feature is to not pass either option to configure. A user that explicitly disables a feature because a dependency is not available will be met with a unexpected error.
Updated by Andreas Herz about 7 years ago
- Tracker changed from Bug to Optimization
- Assignee set to Andreas Herz
- Target version set to TBD
We will try to improve the whole configure.ac file to be more consistent so we can address that within the general rework. But yes, please provide more details so we can take that into account :)
Updated by Daniel Weeks about 7 years ago
I originally discovered it in the hiredis option but I can see at a glance the same structure exists with the nflog, nfqueue, dag, napatech, and lua options. It appears the form assumed in configure.ac is AC_ARG_ENABLE(..., [action-if-disabled], [action-if-enabled]) when in fact it is AC_ARG_ENABLE(..., [action-if-given], [action-if-not-given]). This leads to configure checking for libraries after the feature has been disabled because /some/ option has been supplied.
Also, in my opinion, this is a clear bug, not an optimization. When a user explicitly sets a feature to be disabled, they expect that to be honored. It is not in these cases.