Best-practice for (not?) re-using/caching computed --with options

Simon Sobisch <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.