build: check for getrandom and sys/random.h

Fixes #833
This commit is contained in:
Wim Taymans 2021-03-04 10:57:48 +01:00
parent 3af768f124
commit a4b0b9afe5
3 changed files with 27 additions and 5 deletions

View file

@ -218,6 +218,7 @@ check_headers = [['dlfcn.h','HAVE_DLFCN_H'],
['sys/param.h', 'HAVE_SYS_PARAM_H'],
['sys/poll.h', 'HAVE_SYS_POLL_H'],
['sys/prctl.h', 'HAVE_SYS_PRCTL_H'],
['sys/random.h', 'HAVE_SYS_RANDOM_H'],
['sys/socket.h', 'HAVE_SYS_SOCKET_H'],
['sys/stat.h', 'HAVE_SYS_STAT_H'],
['sys/times.h', 'HAVE_SYS_TIMES_H'],
@ -272,6 +273,10 @@ if cc.has_function('memfd_create', prefix : '#include <sys/mman.h>', args : [ '-
cdata.set('HAVE_MEMFD_CREATE', 1)
endif
if cc.has_function('getrandom', prefix : '#include <sys/random.h>')
cdata.set('HAVE_GETRANDOM', 1)
endif
if get_option('systemd')
systemd = dependency('systemd', required: false)
systemd_dep = dependency('libsystemd', required: false)