Description of "--with-dlopen" in "./configure" output is confusing
In v9.16, the description of --with-dlopen
is:
--with-dlopen=ARG support dynamically loadable DLZ and DYNDB drivers
In ~"v9.11", it is:
--with-dlopen=ARG support dynamically loadable DLZ drivers
The problem is that the option controls more than that - specifically,
if it is set to auto
(default) or yes
, it triggers the following
call:
AC_SEARCH_LIBS([dlsym],[dl])
which means: "if the dlsym()
function is found in libdl, append -ldl
to LIBS
".
This means that --with-dlopen
does not just control whether DLZ/dyndb
drivers will be built - it also detects whether the platform supports
dlopen()
. In other words, if --without-dlopen
is used, -ldl
will
not be automatically added to LIBS
, which means the platform will be
treated as if dlopen()
was unavailable on it.
This has consequences when certain combinations of ./configure
switches are used - should --enable-native-pkcs11 --without-dlopen
work or not?
-
If
--without-dlopen
only controls building DLZ/dyndb drivers, as claimed by./configure
, then the above combination of switches should work - PKCS#11 has little to do with DLZ/dyndb. Yet, such a build breaks on PKCS#11 unit tests which do requiredlopen()
support (d'oh!) but-ldl
is not in theirLIBS
. -
If
--without-dlopen
is also meant to mean "forcibly disabledlopen()
support", then the above combination of switches should be prohibited at./configure
time as it does not make sense (PKCS#11 is all about dynamically loading "providers" in the form of shared objects).
In v9.16, the situation only gets more convoluted because - at least
on Linux - pkg-config --libs libuv
returns... -luv -ldl
.
Plugins are also not mentioned in the output of ./configure
in
v9.16.
We need to decide whether we want to:
-
revise the description of
--with-dlopen
in./configure
, keepingconfigure.ac
code as it is, -
revise
configure.ac
so that detection ofdlopen()
support in the operating system is decoupled from detection of the toolchain's capabilities of buildingdlopen()
able objects.