Issue #8604: NetBSD does not provide libdl.

The dl*() functions are in libc directly. This probably applies to all
*BSD too. And from what I read, it should even apply to macOS, even
though a libdl is present there (is it bogus?).

So let's make the libdl check proper by only make it mandatory on Linux
(on Windows it was already unchecked too).
This commit is contained in:
Jehan 2022-09-10 17:42:28 +02:00
parent a78651aca4
commit 646bc3e43b

View file

@ -328,7 +328,11 @@ conf.set('ENABLE_RELOCATABLE_RESOURCES', relocatable_bundle)
math = cc.find_library('m')
dl = platform_windows ? no_dep : cc.find_library('dl')
# libdl is only required on Linux. On Windows and some (all?) BSD, it
# doesn't exist, but the API exists in libc by default (see #8604). On
# macOS, it apparently exists but linking it explicitly is actually
# unneeded as well.
dl = cc.find_library('dl', required: platform_linux)
rpc = platform_windows ? cc.find_library('rpcrt4') : no_dep
dbghelp = platform_windows ? cc.find_library('dbghelp') : no_dep
winsock = platform_windows ? cc.find_library('ws2_32') : no_dep