mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
Some operating systems (e.g. FreeBSD) do not implement mremap. In that case we can grow the mapping by trying to map adjacent memory. If that fails we can fall back to creating a new larger mapping and moving the old memory contents there. Co-authored-by: Koop Mast <kwm@rainbow-runner.nl> Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
116 lines
2.6 KiB
Meson
116 lines
2.6 KiB
Meson
project(
|
|
'wayland', 'c',
|
|
version: '1.19.90',
|
|
license: 'MIT',
|
|
meson_version: '>= 0.52.1',
|
|
default_options: [
|
|
'warning_level=2',
|
|
'buildtype=debugoptimized'
|
|
]
|
|
)
|
|
|
|
config_h = configuration_data()
|
|
config_h.set_quoted('PACKAGE', meson.project_name())
|
|
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
|
|
|
compiler_flags = [
|
|
'-Wno-unused-parameter',
|
|
'-Wstrict-prototypes',
|
|
'-Wmissing-prototypes',
|
|
'-fvisibility=hidden',
|
|
]
|
|
|
|
cc = meson.get_compiler('c')
|
|
add_project_arguments(
|
|
cc.get_supported_arguments(compiler_flags),
|
|
language: 'c'
|
|
)
|
|
|
|
foreach h: [ 'sys/prctl.h', 'sys/ucred.h' ]
|
|
config_h.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
|
|
endforeach
|
|
|
|
have_funcs = [
|
|
'accept4',
|
|
'mkostemp',
|
|
'posix_fallocate',
|
|
'prctl',
|
|
'memfd_create',
|
|
'mremap',
|
|
'strndup',
|
|
]
|
|
foreach f: have_funcs
|
|
config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f))
|
|
endforeach
|
|
config_h.set10('HAVE_XUCRED_CR_PID', cc.has_member('struct xucred', 'cr_pid', prefix : '#include <sys/ucred.h>'))
|
|
|
|
if get_option('libraries')
|
|
if host_machine.system() == 'freebsd'
|
|
# When building for FreeBSD, epoll(7) is provided by a userspace
|
|
# wrapper around kqueue(2).
|
|
epoll_dep = dependency('epoll-shim')
|
|
else
|
|
# Otherwise, assume that epoll(7) is supported natively.
|
|
epoll_dep = []
|
|
endif
|
|
ffi_dep = dependency('libffi')
|
|
|
|
decls = [
|
|
{ 'header': 'sys/signalfd.h', 'symbol': 'SFD_CLOEXEC' },
|
|
{ 'header': 'sys/timerfd.h', 'symbol': 'TFD_CLOEXEC' },
|
|
{ 'header': 'time.h', 'symbol': 'CLOCK_MONOTONIC' },
|
|
]
|
|
|
|
foreach d: decls
|
|
if not cc.has_header_symbol(d['header'], d['symbol'], dependencies: epoll_dep)
|
|
error('@0@ is needed to compile Wayland libraries'.format(d['symbol']))
|
|
endif
|
|
endforeach
|
|
|
|
rt_dep = []
|
|
if not cc.has_function('clock_gettime', prefix: '#include <time.h>')
|
|
rt_dep = cc.find_library('rt')
|
|
if not cc.has_function('clock_gettime', prefix: '#include <time.h>', dependencies: rt_dep)
|
|
error('clock_gettime not found')
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
configure_file(
|
|
output: 'config.h',
|
|
configuration: config_h,
|
|
)
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
wayland_protocol_xml = files('protocol/wayland.xml')
|
|
|
|
root_inc = include_directories('.')
|
|
protocol_inc = include_directories('protocol')
|
|
src_inc = include_directories('src')
|
|
|
|
subdir('src')
|
|
|
|
if get_option('libraries')
|
|
subdir('cursor')
|
|
subdir('egl')
|
|
if get_option('tests')
|
|
subdir('tests')
|
|
endif
|
|
if get_option('documentation')
|
|
subdir('doc')
|
|
endif
|
|
endif
|
|
|
|
if get_option('scanner')
|
|
install_data([
|
|
'wayland-scanner.mk',
|
|
'protocol/wayland.xml',
|
|
'protocol/wayland.dtd',
|
|
])
|
|
|
|
install_data(
|
|
[ 'wayland-scanner.m4' ],
|
|
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'aclocal'),
|
|
)
|
|
endif
|