diff options
author | Andrew Krasavin <noiseless-ak@yandex.ru> | 2022-02-01 06:13:09 +0300 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-02-01 15:51:15 -0500 |
commit | b564e342219b9a453ae2c5857b5aa2bcc54511af (patch) | |
tree | 7467caff2f478cfc96b5a3d1336d646adb08722d /mesonbuild/dependencies/misc.py | |
parent | 248e6cf4736ef9ec636228da66c28f9be03aa74f (diff) | |
download | meson-b564e342219b9a453ae2c5857b5aa2bcc54511af.zip meson-b564e342219b9a453ae2c5857b5aa2bcc54511af.tar.gz meson-b564e342219b9a453ae2c5857b5aa2bcc54511af.tar.bz2 |
new custom dependency lookup for libdl
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 470305e..c95f7da 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -60,6 +60,25 @@ def netcdf_factory(env: 'Environment', return candidates +class DlBuiltinDependency(BuiltinDependency): + def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]): + super().__init__(name, env, kwargs) + + if self.clib_compiler.has_function('dlopen', '#include <dlfcn.h>', env)[0]: + self.is_found = True + + +class DlSystemDependency(SystemDependency): + def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]): + super().__init__(name, env, kwargs) + + h = self.clib_compiler.has_header('dlfcn.h', '', env) + self.link_args = self.clib_compiler.find_library('dl', env, [], self.libtype) + + if h[0] and self.link_args: + self.is_found = True + + class OpenMPDependency(SystemDependency): # Map date of specification release (which is the macro value) to a version. VERSIONS = { @@ -559,6 +578,13 @@ cups_factory = DependencyFactory( cmake_name='Cups', ) +dl_factory = DependencyFactory( + 'dl', + [DependencyMethods.BUILTIN, DependencyMethods.SYSTEM], + builtin_class=DlBuiltinDependency, + system_class=DlSystemDependency, +) + gpgme_factory = DependencyFactory( 'gpgme', [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL], |