Commonly (?) --with-foo is used in the following way:
--without-foo: disable foo, don't do any checks for it
--with-foo=bar check for foo using bar, if it doesn't work, error
--with-foo=baz check for foo using baz, if it doesn't work, error
--with-foo=check: check if foo works with bar or baz,
if it doesn't work, disable
not specified: same as with-foo=check
--with-foo: same as specified, but if it doesn't work, error
This matches the documentation for AC_ARG_WITH
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#index-AC_005fARG_005fWITH-1
All of --with-foo, --with-foo=bar and --without-foo are re-used (when
configure is re-run by make, then those will be used, again) and the
test for them may _should_ be cached (I _guess_ this is a best practive
but I did not found that in the documentation).
Please correct me if anything so far is wrong.
But when re-run by make without being specified on the original
configure command line, then the check for foo would be re-run, which
could lead to the program being configured different then before (for
example because a system header was added/removed).
I do search for a "best practice" solution - should the check in
configure for foo cache its result as-if --with-for / --without-foo was
specified by the user?
Would it be more reasonable to not do any caching if --with-foo=check is
implied, so the check is always done?
Should this be different if --with-foo=check was explicit specified
(which I _guess_ could be test with some _set variable)?
Is there an option to "add" to the configure options that are used for
re-running the configure script?
Thanks for any pointers,
Simon