[Nut-upsdev] WITH_FOO vs. HAVE_FOO
Arjen de Korte
nut+devel at de-korte.org
Tue Dec 30 17:57:37 UTC 2008
Citeren Charles Lepple <clepple at gmail.com>:
> Interesting, I hadn't noticed that. I wonder if it's just because
> packagers tend to enable almost everything?
It probably has to do when these are evaluated. WITH_FOO is set
through AM_CONDITIONAL and is used in Makefile.am files. In contrast,
HAVE_FOO is set through an AC_DEFINE and eventually ends up in the
'include/config.h' file as a C-preprocessor macro.
Maybe there is no other way to do this (WITH_FOO and HAVE_FOO are both
set at the same time, based on the same variable in 'configure.in').
So just replacing HAVE_FOO by WITH_FOO probably isn't going to work.
Or should we handle this by creating separate objects that are linked
in, depending on whether something is available or not. In that case,
we wouldn't need the preprocessor macros. It would surely clean up the
code a lot, although it may require lots of stub functions (which we
seem to have for SSL anyway).
Best regards, Arjen
--
Please keep list traffic on the list
More information about the Nut-upsdev
mailing list