]> git.ipfire.org Git - thirdparty/git.git/commitdiff
meson: add a couple missing networking dependencies
authorEli Schwartz <eschwartz@gentoo.org>
Fri, 25 Apr 2025 05:25:43 +0000 (01:25 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Apr 2025 16:35:55 +0000 (09:35 -0700)
As evidenced in config.mak.uname and configure.ac, there are various
possible scenarios where these libraries are default-enabled in the
build, which mainly boils down to: SunOS. -lresolv is simply not the
only library that, when it exists, probably needs to be linked to for
networking.

Check for and add -lnsl -lsocket as well.

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
meson.build

index b21b191d251eeaf1aee61cc698c76da39d96e07b..66b69f24717b99c90eb0b8d46bbfa2196321794f 100644 (file)
@@ -1080,10 +1080,11 @@ if host_machine.system() == 'windows'
     networking_dependencies += winsock
   endif
 else
-  libresolv = compiler.find_library('resolv', required: false)
-  if libresolv.found()
-    networking_dependencies += libresolv
-  endif
+  networking_dependencies += [
+    compiler.find_library('nsl', required: false),
+    compiler.find_library('resolv', required: false),
+    compiler.find_library('socket', required: false),
+  ]
 endif
 libgit_dependencies += networking_dependencies