[Mesa-dev] [PATCH 3/6] meson: Add support for configuring dri drivers directory.

Dylan Baker dylan at pnwbakers.com
Wed Oct 4 00:26:46 UTC 2017


Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 meson.build                      |  6 ++++++
 meson_options.txt                | 14 ++++++++------
 src/glx/meson.build              |  2 +-
 src/mesa/drivers/dri/meson.build |  2 +-
 4 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 52ac24f59ca..ec50e10b38c 100644
--- a/meson.build
+++ b/meson.build
@@ -42,6 +42,11 @@ with_asm = get_option('asm')
 with_appledri = false
 with_windowsdri = false
 
+with_dri_drivers_path = get_option('dri-drivers-path')
+if with_dri_drivers_path == ''
+  with_dri_drivers_path = join_paths(get_option('libdir'), 'dri')
+endif
+
 with_gles1 = get_option('gles1')
 with_gles2 = get_option('gles2')
 with_opengl = get_option('opengl')
@@ -573,6 +578,7 @@ if with_platform_x11
       dependency('xcb-dri2', version : '>= 1.8'),
       dependency('xcb-xfixes'),
     ]
+    pre_args += '-DHAVE_X11_PLATFORM'
     if with_dri3
       pre_args += '-DHAVE_DRI3'
       dep_xcb_dri3 = [
diff --git a/meson_options.txt b/meson_options.txt
index 62d6b593f88..130d3962db7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -18,13 +18,15 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-option('platforms',      type : 'string',  value : 'x11,wayland',
+option('platforms',       type : 'string',  value : 'x11,wayland',
        description : 'comma separated list of window systems to support. wayland, x11, surfaceless, drm, etc.')
-option('dri3',           type : 'combo',   value : 'auto', choices : ['auto', 'yes', 'no'],
-       description : 'comma separated list of window systems to support. wayland, x11, surfaceless, drm, etc.')
-option('dri-drivers',    type : 'string',  value : 'i965',
+option('dri3',            type : 'combo',   value : 'auto', choices : ['auto', 'yes', 'no'],
+       description : 'enable support for dri3')
+option('dri-drivers',     type : 'string',  value : 'i965',
        description : 'comma separated list of dri drivers to build.')
-option('vulkan-drivers', type : 'string',  value : 'intel,amd',
+option('dri-drivers-path', type : 'string',  value : '',
+       description : 'Location of dri drivers. Default: $libdir/dri.')
+option('vulkan-drivers',  type : 'string',  value : 'intel,amd',
        description : 'comma separated list of vulkan drivers to build.')
 option('shader-cache',    type : 'boolean', value : true,
        description : 'Build with on-disk shader cache support')
@@ -46,5 +48,5 @@ option('asm',            type : 'boolean', value : true,
        description : 'Build assembly code if possible')
 option('valgrind',       type : 'boolean', vaule : true,
        description : 'Build with valgrind support if possible')
-option('build-tests',    type : 'boolean', value : false,
+option('build-tests',     type : 'boolean', value : false,
        description : 'Build unit tests. Currently this will build *all* unit tests, which may build more than expected.')
diff --git a/src/glx/meson.build b/src/glx/meson.build
index 821623dc263..6b6e9095740 100644
--- a/src/glx/meson.build
+++ b/src/glx/meson.build
@@ -108,7 +108,7 @@ endif
 
 # TODO: libglvnd
 
-dri_driver_dir = join_paths(get_option('prefix'), get_option('libdir'), 'dri')
+dri_driver_dir = join_paths(get_option('prefix'), with_dri_drivers_path)
 if not with_glvnd
   gl_lib_name = 'GL'
   gl_lib_version = '1.2'
diff --git a/src/mesa/drivers/dri/meson.build b/src/mesa/drivers/dri/meson.build
index e9612ea7050..f7403ec09fc 100644
--- a/src/mesa/drivers/dri/meson.build
+++ b/src/mesa/drivers/dri/meson.build
@@ -51,7 +51,7 @@ if with_dri
   meson.add_install_script(
     join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
     libmesa_dri_drivers.full_path(),
-    join_paths(get_option('libdir'), 'dri'),
+    with_dri_drivers_path,
     dri_link,
   )
 endif
-- 
2.14.1



More information about the mesa-dev mailing list