meson: Add dtrace support
This commit is contained in:
parent
e0e051a392
commit
7d0e660e0e
|
@ -33,10 +33,22 @@ srcs_dix = [
|
|||
'window.c',
|
||||
]
|
||||
|
||||
dtrace_src = []
|
||||
if with_dtrace
|
||||
dtrace_object = generator(dtrace,
|
||||
output: '@BASENAME@.o',
|
||||
arguments: ['-G', '-s', '@INPUT@', '-o', '@OUTPUT@']
|
||||
)
|
||||
|
||||
dtrace_src += dtrace_object.process(dtrace_tmpl)
|
||||
endif
|
||||
|
||||
dtrace_dep = declare_dependency(sources: [dtrace_src, dtrace_hdr])
|
||||
|
||||
libxserver_dix = static_library('libxserver_dix',
|
||||
srcs_dix,
|
||||
include_directories: inc,
|
||||
dependencies: common_dep,
|
||||
dependencies: [ dtrace_dep, common_dep, ]
|
||||
)
|
||||
|
||||
libxserver_main = static_library('libxserver_main',
|
||||
|
|
|
@ -31,7 +31,7 @@ cc.compiles('''
|
|||
''',
|
||||
name: 'CLOCK_MONOTONIC'))
|
||||
|
||||
#conf_data.set('XSERVER_DTRACE', '1') # XXX
|
||||
conf_data.set('XSERVER_DTRACE', with_dtrace)
|
||||
|
||||
if host_machine.endian() == 'little'
|
||||
conf_data.set('X_BYTE_ORDER', 'X_LITTLE_ENDIAN')
|
||||
|
@ -402,6 +402,17 @@ configure_file(output : 'xwayland-config.h',
|
|||
input : 'xwayland-config.h.meson.in',
|
||||
configuration : xwayland_data)
|
||||
|
||||
dtrace_hdr = []
|
||||
dtrace_tmpl = files('Xserver.d')
|
||||
if with_dtrace
|
||||
dtrace_header = generator(dtrace,
|
||||
output: '@BASENAME@-dtrace.h',
|
||||
arguments: ['-h', '-s', '@INPUT@', '-o', '@OUTPUT@']
|
||||
)
|
||||
|
||||
dtrace_hdr += dtrace_header.process(dtrace_tmpl)
|
||||
endif
|
||||
|
||||
if build_xorg
|
||||
install_data(
|
||||
[
|
||||
|
|
|
@ -175,6 +175,11 @@ else
|
|||
build_systemd_logind = get_option('systemd_logind') == 'true'
|
||||
endif
|
||||
|
||||
with_dtrace = get_option('dtrace')
|
||||
if with_dtrace
|
||||
dtrace = find_program('dtrace', required: true)
|
||||
endif
|
||||
|
||||
build_xorg = false
|
||||
if (host_machine.system() != 'darwin' and
|
||||
host_machine.system() != 'windows')
|
||||
|
|
|
@ -50,6 +50,9 @@ option('vendor_name', type: 'string', value: 'The X.Org Foundation')
|
|||
option('vendor_name_short', type: 'string', value: 'X.Org')
|
||||
option('vendor_web', type: 'string', value: 'http://wiki.x.org')
|
||||
|
||||
option('dtrace', type: 'boolean', value: false,
|
||||
description: 'Enable dtrace hooks')
|
||||
|
||||
option('listen_tcp', type: 'boolean', value: false,
|
||||
description: 'Listen on TCP by default')
|
||||
option('listen_unix', type: 'boolean', value: true,
|
||||
|
|
|
@ -91,6 +91,7 @@ libxserver_os = static_library('libxserver_os',
|
|||
srcs_os,
|
||||
include_directories: inc,
|
||||
dependencies: [
|
||||
dtrace_dep,
|
||||
common_dep,
|
||||
dl_dep,
|
||||
sha1_dep,
|
||||
|
|
Loading…
Reference in New Issue