This allows test runners to set environment variables to let tests know which features are available. This is done by the cmake tests, but probably won't be extended to the make tests.
Not all C libraries are glibc, or impersonating it; for example, musl
does not pretend to be any version of glibc. Thus, building on musl
fails when openssl is disabled, because no random-providing function is
detected, although musl does provide getrandom().
uClibc-ng on the other hand, can impersonate glibc, but availability of
getrandom() is not guatranteed there: getrandom() can be compiled out of
uClinbc-ng, or uClibc-ng can be too old to have it.
Add a configure-time check that getrandom() is available, as a fallback
when TLS is not enabled (and thus openssl is not used), and when not on
Win32 (where getting random numbers is always possible, at least from a
build perspective).
However, building with the plain Makefiles should keep working, so
slightly rework the defines checks in the code to account for the fact
that HAVE_GETRANDOM may already be defined at configure time.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
getaddrinfo_a( is protected by _GNU_SOURCE.
This is properly accounted for in the source code, in lib/net_mosq.c,
but the check in the CmakeList is missing that define, which causes
the check to actually fail.
Add that define when checking; this fixes builds on various C libraries,
like uClibc-ng, musl, or newer/older glibc.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
When using WITH_SQLITE=no, the build system correctly avoids to compile
the plugin, but the install step fails because it tries to install it
even if it has not been compiled.
This commit fixes this behaviour by totally omitting the plugin if
WITH_SQLITE=no is specified, so no compilation and no installation is
performed
Signed-off-by: Jesús Fernández Manzano <jesus.fernandez@titanos.tv>