From d87955f9905f569588baabef1de76a245ff92b2e Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 7 Jan 2020 10:33:45 -0800 Subject: 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. --- mesonbuild/dependencies/dev.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index c4eeaf1..8ba654b 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -456,13 +456,18 @@ class ZlibSystemDependency(ExternalDependency): def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]): 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 # from something to macOS? - if (self.env.machines[self.for_machine].is_darwin() and - isinstance(self.clib_compiler, (AppleClangCCompiler, AppleClangCPPCompiler))): + if ((m.is_darwin() and isinstance(self.clib_compiler, (AppleClangCCompiler, AppleClangCPPCompiler))) or + m.is_freebsd() or m.is_dragonflybsd()): self.is_found = True 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 ', self.env, [], [self]) self.version = v.strip('"') -- cgit v1.1