gstreamer: Solaris/Illumos require linking to libnsl / libsocket for various socket APIs

Patch by Tim Mooney <Tim.Mooney@ndsu.edu> from OpenIndiana/oi-userland

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
This commit is contained in:
Sebastian Dröge 2024-05-26 12:24:33 +03:00
parent ecf852d529
commit 1f12493787
5 changed files with 19 additions and 4 deletions

View file

@ -274,7 +274,7 @@ libgst = library('gstreamer-1.0', gst_sources,
link_with : printf_lib,
install : true,
dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, dl_dep,
backtrace_deps, platform_deps, extra_deps],
backtrace_deps, platform_deps, network_deps, extra_deps],
)
gst_compile_args = []

View file

@ -32,7 +32,7 @@ gst_net = library('gstnet-@0@'.format(apiversion),
soversion : soversion,
darwin_versions : osxversion,
install : true,
dependencies : [gio_dep, gst_base_dep, dl_dep],
dependencies : [gio_dep, gst_base_dep, dl_dep, network_deps],
)
library_def = {'lib': gst_net}

View file

@ -573,6 +573,21 @@ mathlib = cc.find_library('m', required : false)
# Also provides clock_gettime in glibc < 2.17
rt_lib = cc.find_library('rt', required : false)
#
# Solaris and Illumos distros split a lot of networking-related code
# into '-lsocket -lnsl'. Anything that calls socketpair(), getifaddr(),
# etc. probably needs to include network_deps
#
socket_lib = cc.find_library('socket', required: false)
nsl_lib = cc.find_library('nsl', required: false)
network_deps = []
if socket_lib.found()
network_deps += socket_lib
endif
if nsl_lib.found()
network_deps += nsl_lib
endif
gir = find_program('g-ir-scanner', required : get_option('introspection'))
gnome = import('gnome')

View file

@ -137,7 +137,7 @@ if get_option('check').disabled()
endif
endif
gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep, gio_dep, gmodule_dep]
gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep, gio_dep, gmodule_dep, network_deps]
foreach t : core_tests
fname = t[0]

View file

@ -1,3 +1,3 @@
executable('netclock-replay', 'netclock-replay.c',
include_directories: libsinc,
dependencies : [gio_dep, gst_dep])
dependencies : [gio_dep, gst_dep, network_deps])