mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-29 10:10:19 +01:00
build: Check for socket(), socketpair() in -lsocket if necessary
On older Solaris, these functions exist in -lsocket rather than in the standard C library. If we can't find them immediately, try again with -lsocket added to the dependencies. Later, use network_libs when checking for optional functions like socketpair(), so that we will detect it correctly. If socketpair() is not found, dbus compiles successfully without it, but dbus-daemon will not start because it cannot set up reload signalling. Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/531 Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
dce4191c64
commit
1c38c6edcd
1 changed files with 27 additions and 1 deletions
28
meson.build
28
meson.build
|
|
@ -612,6 +612,25 @@ else
|
|||
network_libs = []
|
||||
endif
|
||||
|
||||
# socket(), socketpair() might be in -lsocket, for example on older Solaris
|
||||
foreach function : ['socket', 'socketpair']
|
||||
if not cc.has_function(
|
||||
function,
|
||||
args: compile_args_c,
|
||||
dependencies: network_libs,
|
||||
)
|
||||
socket_lib = cc.find_library('socket', required: false)
|
||||
if socket_lib.found() and cc.has_function(
|
||||
function,
|
||||
args: compile_args_c,
|
||||
dependencies: network_libs + [socket_lib],
|
||||
)
|
||||
network_libs += [socket_lib]
|
||||
break
|
||||
endif
|
||||
endif
|
||||
endforeach
|
||||
|
||||
if get_option('x11_autolaunch').disabled()
|
||||
use_x11_autolaunch = false
|
||||
x11 = not_found
|
||||
|
|
@ -675,7 +694,14 @@ check_functions = [
|
|||
|
||||
foreach function : check_functions
|
||||
macro = 'HAVE_' + function.underscorify().to_upper()
|
||||
config.set(macro, cc.has_function(function, args: compile_args_c) ? 1 : false)
|
||||
config.set(
|
||||
macro,
|
||||
cc.has_function(
|
||||
function,
|
||||
args: compile_args_c,
|
||||
dependencies: network_libs,
|
||||
) ? 1 : false,
|
||||
)
|
||||
endforeach
|
||||
|
||||
# keep CMakeLists.txt in sync
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue