[PATCH xserver 3/3] Add a Meson build system alongside autotools.

Jon Turney jon.turney at dronecode.org.uk
Wed Apr 26 11:38:18 UTC 2017


On 26/04/2017 00:03, Eric Anholt wrote:
> This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest,
> and Xdmx so far.  The outline of Xquartz/Xwin support is in tree, but
> hasn't been built yet.  The unit tests are also not done.

man pages and documentation are also not done.

I've more or less written XWin, so don't feel the need to do that :)

> diff --git a/glx/meson.build b/glx/meson.build
[...]
> +libxserver_glx = ''
> +if build_glx
> +    libxserver_glx = static_library('libxserver_glx',

This doesn't seem to be right.  If you mesonconf with -Dglx=false, this 
causes "Link target '' is not library." when it appears in link_with:.

Attached is a patch with a few small fixes I made.

Adding project(..., meson_version: '>0.40') seems like a good idea as well.

-------------- next part --------------
From f7e55ca8051242de2d1782cbf85cda87b0a8f123 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney at dronecode.org.uk>
Date: Tue, 18 Apr 2017 13:37:35 +0100
Subject: [PATCH xserver 1/6] Various fixes and tweaks to meson.build

Restore stub ossupport
Make xf86vidmode optional, set XF86VIDMODE
Make DGA optional, always disabled
Nettle is required if it's the only SHA1 choice
Test to build xserver_poll.c was inverted
Typos
---
 hw/xfree86/os-support/meson.build | 17 ++++++++++++++++-
 include/meson.build               |  4 ++--
 meson.build                       |  7 ++++---
 meson_options.txt                 |  2 +-
 os/meson.build                    |  4 ++--
 5 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/hw/xfree86/os-support/meson.build b/hw/xfree86/os-support/meson.build
index a3c3b5688..4cef618b0 100644
--- a/hw/xfree86/os-support/meson.build
+++ b/hw/xfree86/os-support/meson.build
@@ -73,7 +73,7 @@ elif host_machine.system() == 'solaris'
     endif
 
     os_support_flags += '-DHAVE_SYSV_IPC'
-else
+elif (host_machine.system() == 'freebsd') or (host_machine.system() == 'netbsd') or (host_machine.system() == 'openbsd')
     srcs_xorg_os_support += [
         'bsd/bsd_VTsw.c',
         'bsd/bsd_bell.c',
@@ -109,6 +109,21 @@ else
     else
         srcs_xorg_os_support += 'shared/agp_noop.c'
     endif
+else
+    # stub ossupport
+    srcs_xorg_os_support += [
+        'shared/VTsw_noop.c',
+        'shared/agp_noop.c',
+        'shared/ioperm_noop.c',
+        'shared/kmod_noop.c',
+        'shared/pm_noop.c',
+        'shared/vidmem.c',
+        'shared/posix_tty.c',
+        'shared/sigio.c',
+        'stub/stub_bell.c',
+        'stub/stub_init.c',
+        'stub/stub_video.c',
+    ]
 endif
 
 xorg_os_support = static_library('xorg_os_support',
diff --git a/include/meson.build b/include/meson.build
index 75469ff0a..e066fc469 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -161,8 +161,8 @@ conf_data.set('XCSECURITY', build_xsecurity)
 conf_data.set('XDMCP', get_option('xdmcp'))
 conf_data.set('XF86BIGFONT', build_xf86bigfont)
 conf_data.set('XF86DRI', build_dri1)
-conf_data.set('XF86VIDMODE', '1')
-conf_data.set('XFIXES	 ', '1')
+conf_data.set('XF86VIDMODE', build_xf86vidmode)
+conf_data.set('XFIXES', '1')
 conf_data.set('XINERAMA', build_xinerama)
 conf_data.set('XINPUT', '1')
 conf_data.set('XRECORD', '1')
diff --git a/meson.build b/meson.build
index 30103f8d6..3955ad0bd 100644
--- a/meson.build
+++ b/meson.build
@@ -35,8 +35,8 @@ dri2proto_dep = dependency('dri2proto', version: '>= 2.8')
 dri3proto_dep = dependency('dri3proto', version: '>= 1.0')
 xineramaproto_dep = dependency('xineramaproto')
 xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
-xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1')
-xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1')
+xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', required: false)
+xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1', required: false)
 windowswmproto_dep = dependency('windowswmproto', required: false)
 applewmproto_dep = dependency('applewmproto', version: '>= 1.4', required: false)
 xshmfence_dep = dependency('xshmfence', version: '>= 1.1')
@@ -45,7 +45,7 @@ pixman_dep = dependency('pixman-1')
 libbsd_dep = dependency('libbsd', required: false)
 xkbfile_dep = dependency('xkbfile')
 xfont2_dep = dependency('xfont2', version: '>= 2.0')
-nettle_dep = dependency('nettle', required: false)
+nettle_dep = dependency('nettle')
 
 dbus_required = get_option('systemd_logind') == 'yes'
 dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
@@ -233,6 +233,7 @@ build_xinerama = true
 build_xselinux = false
 build_xv = true
 build_dga = false
+build_xf86vidmode = xf86vidmodeproto_dep.found()
 
 m_dep = cc.find_library('m', required : false)
 dl_dep = cc.find_library('dl', required : false)
diff --git a/meson_options.txt b/meson_options.txt
index b89fdaa2c..a5d7de6f4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,7 +1,7 @@
 option('xorg', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
        description: 'Enable Xorg X Server')
 option('xephyr', type: 'boolean', value: false,
-       description: 'Enable Xephyr nexted X server')
+       description: 'Enable Xephyr nested X server')
 option('xwayland', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
        description: 'Enable XWayland X server')
 option('glamor', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
diff --git a/os/meson.build b/os/meson.build
index e26778a43..60da555e8 100644
--- a/os/meson.build
+++ b/os/meson.build
@@ -41,10 +41,10 @@ endif
 if not cc.has_function('timingsafe_memcmp')
     srcs_os += 'timingsafe_memcmp.c'
 endif
-
-if cc.has_function('poll')
+if not cc.has_function('poll')
     srcs_os += 'xserver_poll.c'
 endif
+
 if cc.has_function('sigaction')
     srcs_os += 'busfault.c'
 endif
-- 
2.12.2



More information about the xorg-devel mailing list