dependencies: Add system zlib method for freebsd and dragonflybsd

I've tested this on FreeBSD, and dragonfly's userland is close enough
I'm willing to call it good without testing. OpenBSD and NetBSD also
have a zlib in their base configurations, but I'm not confident enough
to enable those without testing.
pull/6421/head
Dylan Baker 5 years ago
parent 5f51ee2fc8
commit d87955f990
  1. 11
      mesonbuild/dependencies/dev.py

@ -456,13 +456,18 @@ class ZlibSystemDependency(ExternalDependency):
def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]): def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]):
super().__init__(name, environment, kwargs) super().__init__(name, environment, kwargs)
m = self.env.machines[self.for_machine]
# I'm not sure this is entirely correct. What if we're cross compiling # I'm not sure this is entirely correct. What if we're cross compiling
# from something to macOS? # from something to macOS?
if (self.env.machines[self.for_machine].is_darwin() and if ((m.is_darwin() and isinstance(self.clib_compiler, (AppleClangCCompiler, AppleClangCPPCompiler))) or
isinstance(self.clib_compiler, (AppleClangCCompiler, AppleClangCPPCompiler))): m.is_freebsd() or m.is_dragonflybsd()):
self.is_found = True self.is_found = True
self.link_args = ['-lz'] self.link_args = ['-lz']
# No need to set includes, xcode/clang will do that for us.
# No need to set includes,
# on macos xcode/clang will do that for us.
# on freebsd zlib.h is in /usr/include
v, _ = self.clib_compiler.get_define('ZLIB_VERSION', '#include <zlib.h>', self.env, [], [self]) v, _ = self.clib_compiler.get_define('ZLIB_VERSION', '#include <zlib.h>', self.env, [], [self])
self.version = v.strip('"') self.version = v.strip('"')

Loading…
Cancel
Save