meson: Absence of dri.pc is an error if building with GLX

Currently, this can error if dri.pc isn't found, as we can't then get
the value of pkgconfig variable from it:

include/meson.build:199:10: ERROR:  'dri' is not a pkgconfig dependency

I think we need DRI_DRIVER_PATH (only) when building GLX, even if dri2/3
isn't enabled, so we know where to load swrast_dri.so from.

(For autotools, configure.ac directly calls `pkg-config
--variable=dridriverdir dri`, the backticks swallowing any error,
causing the value of this define to be empty if dri.pc isn't present)
This commit is contained in:
Jon Turney 2019-04-28 21:56:20 +01:00 committed by Adam Jackson
parent 1f5742d271
commit c2feeca1b0

View File

@ -10,7 +10,7 @@ endif
release = major * 10000000 + minor * 100000 + patch * 1000 + subpatch
dri_dep = dependency('dri', required: build_dri2 or build_dri3)
dri_dep = dependency('dri', required: build_glx)
conf_data = configuration_data()
conf_data.set('_DIX_CONFIG_H_', '1')
@ -196,7 +196,9 @@ conf_data.set('DGA', build_dga)
conf_data.set('DPMSExtension', build_dpms)
conf_data.set('DRI2', build_dri2)
conf_data.set('DRI3', build_dri3)
conf_data.set_quoted('DRI_DRIVER_PATH', dri_dep.get_pkgconfig_variable('dridriverdir'))
if build_glx
conf_data.set_quoted('DRI_DRIVER_PATH', dri_dep.get_pkgconfig_variable('dridriverdir'))
endif
conf_data.set('HAS_SHM', build_mitshm)
conf_data.set('MITSHM', build_mitshm)
conf_data.set('PANORAMIX', build_xinerama)