meson: Make driprotos and libdrm optional
Add options for DRI{1,2,3} shmfence is required for DRI3 libdrm is required for any DRI{1,2,3} Consolidate calls to dependency('libdrm') Set WITH_LIBDRM when building with libdrm v2: Initialize libxserver_dri3 to [] Manually flatten libxserver, since meson doesn't (currently) Use version_compare rather than circumloctions with dependency() Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
fdb11e2274
commit
820a4cbe9f
|
@ -4,9 +4,12 @@ srcs_dri3 = [
|
||||||
'dri3_screen.c',
|
'dri3_screen.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
libxserver_dri3 = static_library('libxserver_dri3',
|
libxserver_dri3 = []
|
||||||
srcs_dri3,
|
if build_dri3
|
||||||
include_directories: inc,
|
libxserver_dri3 = static_library('libxserver_dri3',
|
||||||
dependencies: common_dep,
|
srcs_dri3,
|
||||||
c_args: '-DHAVE_XORG_CONFIG_H'
|
include_directories: inc,
|
||||||
)
|
dependencies: common_dep,
|
||||||
|
c_args: '-DHAVE_XORG_CONFIG_H'
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
@ -8,7 +8,7 @@ xorg_dri = static_library('xorg_dri',
|
||||||
include_directories: [inc, xorg_inc],
|
include_directories: [inc, xorg_inc],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
common_dep,
|
common_dep,
|
||||||
dependency('libdrm'),
|
libdrm_dep,
|
||||||
],
|
],
|
||||||
c_args: xorg_c_args,
|
c_args: xorg_c_args,
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ xorg_dri2 = static_library('xorg_dri2',
|
||||||
include_directories: [inc, xorg_inc],
|
include_directories: [inc, xorg_inc],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
common_dep,
|
common_dep,
|
||||||
dependency('libdrm'),
|
libdrm_dep,
|
||||||
],
|
],
|
||||||
c_args: xorg_c_args,
|
c_args: xorg_c_args,
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,7 +18,7 @@ shared_module(
|
||||||
dependencies: [
|
dependencies: [
|
||||||
common_dep,
|
common_dep,
|
||||||
udev_dep,
|
udev_dep,
|
||||||
dependency('libdrm', version: '>= 2.4.46'),
|
libdrm_dep,
|
||||||
],
|
],
|
||||||
|
|
||||||
install: true,
|
install: true,
|
||||||
|
|
|
@ -57,7 +57,9 @@ endif
|
||||||
if build_vgahw
|
if build_vgahw
|
||||||
subdir('vgahw')
|
subdir('vgahw')
|
||||||
endif
|
endif
|
||||||
subdir('drivers/modesetting')
|
if build_modesetting
|
||||||
|
subdir('drivers/modesetting')
|
||||||
|
endif
|
||||||
|
|
||||||
srcs_xorg = [
|
srcs_xorg = [
|
||||||
'../../mi/miinitext.c'
|
'../../mi/miinitext.c'
|
||||||
|
@ -106,7 +108,7 @@ executable(
|
||||||
xfont2_dep,
|
xfont2_dep,
|
||||||
xshmfence_dep,
|
xshmfence_dep,
|
||||||
config_dep,
|
config_dep,
|
||||||
dependency('libdrm'),
|
libdrm_dep,
|
||||||
],
|
],
|
||||||
link_args: '-Wl,--export-dynamic',
|
link_args: '-Wl,--export-dynamic',
|
||||||
c_args: xorg_c_args,
|
c_args: xorg_c_args,
|
||||||
|
|
|
@ -117,7 +117,7 @@ xorg_os_support = static_library('xorg_os_support',
|
||||||
dependencies: [
|
dependencies: [
|
||||||
common_dep,
|
common_dep,
|
||||||
dbus_dep,
|
dbus_dep,
|
||||||
dependency('libdrm'),
|
libdrm_dep,
|
||||||
],
|
],
|
||||||
c_args: xorg_c_args,
|
c_args: xorg_c_args,
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,8 +61,8 @@ conf_data.set_quoted('SHMDIR', '/tmp')
|
||||||
|
|
||||||
conf_data.set('HAVE_SIGACTION', '1') # XXX
|
conf_data.set('HAVE_SIGACTION', '1') # XXX
|
||||||
conf_data.set('BUSFAULT', '1') # XXX
|
conf_data.set('BUSFAULT', '1') # XXX
|
||||||
conf_data.set('XSHMFENCE', '1') # XXX
|
conf_data.set('XSHMFENCE', xshmfence_dep.found())
|
||||||
conf_data.set('WITH_LIBDRM', '1') # XXX
|
conf_data.set('WITH_LIBDRM', libdrm_dep.found())
|
||||||
conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
|
conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
|
||||||
dependency('libdrm', version: '>= 2.4.74', required: false).found())
|
dependency('libdrm', version: '>= 2.4.74', required: false).found())
|
||||||
conf_data.set('GLXEXT', build_glx)
|
conf_data.set('GLXEXT', build_glx)
|
||||||
|
|
49
meson.build
49
meson.build
|
@ -32,16 +32,16 @@ compositeproto_dep = dependency('compositeproto', version: '>= 0.4')
|
||||||
recordproto_dep = dependency('recordproto', version: '>= 1.13.99.1')
|
recordproto_dep = dependency('recordproto', version: '>= 1.13.99.1')
|
||||||
scrnsaverproto_dep = dependency('scrnsaverproto', version: '>= 1.1')
|
scrnsaverproto_dep = dependency('scrnsaverproto', version: '>= 1.1')
|
||||||
resourceproto_dep = dependency('resourceproto', version: '>= 1.2.0')
|
resourceproto_dep = dependency('resourceproto', version: '>= 1.2.0')
|
||||||
xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0')
|
xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: get_option('dri1') == 'yes')
|
||||||
dri2proto_dep = dependency('dri2proto', version: '>= 2.8')
|
dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: get_option('dri2') == 'yes')
|
||||||
dri3proto_dep = dependency('dri3proto', version: '>= 1.0')
|
dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: get_option('dri3') == 'yes')
|
||||||
xineramaproto_dep = dependency('xineramaproto')
|
xineramaproto_dep = dependency('xineramaproto')
|
||||||
xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
|
xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
|
||||||
xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', required: false)
|
xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', required: false)
|
||||||
xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1', required: false)
|
xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1', required: false)
|
||||||
windowswmproto_dep = dependency('windowswmproto', required: false)
|
windowswmproto_dep = dependency('windowswmproto', required: false)
|
||||||
applewmproto_dep = dependency('applewmproto', version: '>= 1.4', required: false)
|
applewmproto_dep = dependency('applewmproto', version: '>= 1.4', required: false)
|
||||||
xshmfence_dep = dependency('xshmfence', version: '>= 1.1')
|
xshmfence_dep = dependency('xshmfence', version: '>= 1.1', required: false)
|
||||||
|
|
||||||
pixman_dep = dependency('pixman-1')
|
pixman_dep = dependency('pixman-1')
|
||||||
libbsd_dep = dependency('libbsd', required: false)
|
libbsd_dep = dependency('libbsd', required: false)
|
||||||
|
@ -216,12 +216,44 @@ endif
|
||||||
|
|
||||||
build_glx = get_option('glx')
|
build_glx = get_option('glx')
|
||||||
|
|
||||||
|
if get_option('dri1') == 'auto'
|
||||||
|
build_dri1 = xf86driproto_dep.found()
|
||||||
|
else
|
||||||
|
build_dri1 = get_option('dri1') == 'yes'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('dri2') == 'auto'
|
||||||
|
build_dri2 = dri2proto_dep.found()
|
||||||
|
else
|
||||||
|
build_dri2 = get_option('dri2') == 'yes'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('dri3') == 'auto'
|
||||||
|
build_dri3 = dri3proto_dep.found() and xshmfence_dep.found()
|
||||||
|
else
|
||||||
|
build_dri3 = get_option('dri3') == 'yes'
|
||||||
|
if build_dri3
|
||||||
|
if not xshmfence_dep.found()
|
||||||
|
error('DRI3 requested, but xshmfence not found')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
libdrm_required = (get_option('dri1') == 'yes') or (get_option('dri2') == 'yes') or (get_option('dri3') == 'yes')
|
||||||
|
libdrm_dep = dependency('libdrm', version: '>= 2.3.1', required: libdrm_required)
|
||||||
|
build_modesetting = false
|
||||||
|
if libdrm_dep.found()
|
||||||
|
if build_dri2
|
||||||
|
# 2.4.65 is required for drmGetDevice
|
||||||
|
dependency('libdrm', version: '>= 2.4.65')
|
||||||
|
endif
|
||||||
|
# 2.4.46 is required for cursor hotspot support.
|
||||||
|
build_modesetting = libdrm_dep.version().version_compare('>= 2.4.46')
|
||||||
|
endif
|
||||||
|
|
||||||
# XXX: Allow configuration of these.
|
# XXX: Allow configuration of these.
|
||||||
build_apm = false
|
build_apm = false
|
||||||
build_acpi = false
|
build_acpi = false
|
||||||
build_dri1 = true
|
|
||||||
build_dri2 = true
|
|
||||||
build_dri3 = true
|
|
||||||
build_dpms = true
|
build_dpms = true
|
||||||
build_mitshm = true
|
build_mitshm = true
|
||||||
build_res = true
|
build_res = true
|
||||||
|
@ -346,7 +378,6 @@ libxserver = [
|
||||||
libxserver_composite,
|
libxserver_composite,
|
||||||
libxserver_damageext,
|
libxserver_damageext,
|
||||||
libxserver_dbe,
|
libxserver_dbe,
|
||||||
libxserver_dri3,
|
|
||||||
libxserver_randr,
|
libxserver_randr,
|
||||||
libxserver_miext_damage,
|
libxserver_miext_damage,
|
||||||
libxserver_render,
|
libxserver_render,
|
||||||
|
@ -361,4 +392,6 @@ libxserver = [
|
||||||
libxserver_os,
|
libxserver_os,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
libxserver += libxserver_dri3
|
||||||
|
|
||||||
subdir('hw')
|
subdir('hw')
|
||||||
|
|
|
@ -44,3 +44,7 @@ option('hal', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
|
||||||
description: 'Enable HAL integration')
|
description: 'Enable HAL integration')
|
||||||
option('systemd_logind', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
|
option('systemd_logind', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
|
||||||
description: 'Enable systemd-logind integration')
|
description: 'Enable systemd-logind integration')
|
||||||
|
|
||||||
|
option('dri1', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)')
|
||||||
|
option('dri2', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)')
|
||||||
|
option('dri3', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'Build DRI3 extension (default: auto)')
|
||||||
|
|
Loading…
Reference in New Issue