mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
xwayland: Fix build without <sys/random.h>
The include <sys/random.h> was added to glibc-2.25, previously was
<linux/random.h>.
Adjust meson build and code to accomodate both.
Fixes: a8984a81c
"xwayland: Generate a Xauth file and pass this to
Xwayland when starting it"
https://gitlab.gnome.org/GNOME/mutter/merge_requests/633
This commit is contained in:
parent
7fcdd60ac5
commit
c63d0173b5
@ -61,5 +61,6 @@
|
|||||||
/* XKB base prefix */
|
/* XKB base prefix */
|
||||||
#mesondefine XKB_BASE
|
#mesondefine XKB_BASE
|
||||||
|
|
||||||
/* Default rules for allowing Xwayland grabs */
|
/* Either <sys/random.h> or <linux/random.h> */
|
||||||
#mesondefine XWAYLAND_GRAB_DEFAULT_ACCESS_RULES
|
#mesondefine HAVE_SYS_RANDOM
|
||||||
|
#mesondefine HAVE_LINUX_RANDOM
|
||||||
|
@ -364,6 +364,15 @@ if have_wayland
|
|||||||
xwayland_path = find_program('Xwayland').path()
|
xwayland_path = find_program('Xwayland').path()
|
||||||
endif
|
endif
|
||||||
cdata.set_quoted('XWAYLAND_PATH', xwayland_path)
|
cdata.set_quoted('XWAYLAND_PATH', xwayland_path)
|
||||||
|
|
||||||
|
# For Xwayland authority file generation.
|
||||||
|
if cc.has_header_symbol('sys/random.h', 'getrandom')
|
||||||
|
cdata.set('HAVE_SYS_RANDOM', 1)
|
||||||
|
elif cc.has_header_symbol('linux/random.h', 'getrandom')
|
||||||
|
cdata.set('HAVE_LINUX_RANDOM', 1)
|
||||||
|
else
|
||||||
|
error('Required function getrandom not found')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
xwayland_grab_default_access_rules = get_option('xwayland_grab_default_access_rules')
|
xwayland_grab_default_access_rules = get_option('xwayland_grab_default_access_rules')
|
||||||
|
@ -31,7 +31,11 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#if defined(HAVE_SYS_RANDOM)
|
||||||
#include <sys/random.h>
|
#include <sys/random.h>
|
||||||
|
#elif defined(HAVE_LINUX_RANDOM)
|
||||||
|
#include <linux/random.h>
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <X11/Xauth.h>
|
#include <X11/Xauth.h>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user