meson: add a couple missing networking dependencies

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>

Eli Schwartz committed Apr 25, 2025 at 01:25 UTC 5cb05d76af33367b061aec65113de06eaa39fc71
1 file changed +5 -4
meson.build
+5 -4
@@ -1080,10 +1080,11 @@ if host_machine.system() == 'windows'
1080 networking_dependencies += winsock
1081 endif
1082 else
1083 - libresolv = compiler.find_library('resolv', required: false)
1084 - if libresolv.found()
1085 - networking_dependencies += libresolv
1086 - endif
1083 + networking_dependencies += [
1084 + compiler.find_library('nsl', required: false),
1085 + compiler.find_library('resolv', required: false),
1086 + compiler.find_library('socket', required: false),
1087 + ]
1088 endif
1089 libgit_dependencies += networking_dependencies
1090