Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
project ( 'xserver' , 'c' ,
2017-09-27 14:31:37 -04:00
default_options : [
'buildtype=debugoptimized' ,
'c_std=gnu99' ,
] ,
2025-12-21 15:53:30 +01:00
version : '25.1.0' ,
2025-12-20 15:52:15 +00:00
meson_version : '>= 0.61.0' ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
)
2025-12-21 15:53:30 +01:00
release_date = '2025-12-21'
2021-08-05 22:43:54 +03:00
2019-04-18 17:06:41 +01:00
add_project_arguments ( '-DHAVE_DIX_CONFIG_H' , language : [ 'c' , 'objc' ] )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
cc = meson . get_compiler ( 'c' )
2021-10-22 18:15:05 +02:00
add_project_arguments ( '-fno-strict-aliasing' , language : 'c' )
add_project_arguments ( '-fvisibility=hidden' , language : 'c' )
2024-08-28 13:24:08 +02:00
add_project_arguments ( '-Wvla' , language : 'c' )
2025-11-07 15:50:55 +01:00
add_project_arguments ( '-fno-common' , language : 'c' )
2025-12-11 19:38:07 +01:00
add_project_arguments ( '-Wshift-negative-value' , language : 'c' )
2025-12-11 19:12:16 +01:00
add_project_arguments ( '-Wchar-subscripts' , language : 'c' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2025-12-11 20:40:37 +01:00
# workaround for mesa bug causing GLsync to be typedef'ed multiple times
# this is breaking -Werror on FreeBSD
if host_machine . system ( ) == 'freebsd'
add_project_arguments ( '-Wno-error=typedef-redefinition' , language : 'c' )
endif
2025-12-12 13:34:48 +01:00
# workaround for mingw32 bug, which is demanding gnu_print attribute
# while not actually understanding it
if host_machine . system ( ) == 'windows'
add_project_arguments ( '-Wno-error=suggest-attribute=format' , language : 'c' )
endif
2021-10-22 18:15:05 +02:00
add_project_link_arguments ( '-fvisibility=hidden' , language : 'c' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2025-12-04 19:03:47 +01:00
# global config data -- needs to be declared early
conf_data = configuration_data ( )
conf_data . set ( '_DIX_CONFIG_H_' , '1' )
2017-09-27 14:31:39 -04:00
if cc . get_id ( ) == 'gcc' or cc . get_id ( ) == 'clang'
test_wflags = [
'-Wall' ,
2025-12-11 19:12:16 +01:00
'-Wchar-subscripts' ,
2017-09-27 14:31:39 -04:00
'-Wpointer-arith' ,
'-Wmissing-declarations' ,
'-Wformat=2' ,
'-Wstrict-prototypes' ,
'-Wmissing-prototypes' ,
'-Wnested-externs' ,
'-Wbad-function-cast' ,
'-Wold-style-definition' ,
'-Wunused' ,
'-Wuninitialized' ,
'-Wshadow' ,
'-Wmissing-noreturn' ,
'-Wmissing-format-attribute' ,
'-Wredundant-decls' ,
'-Werror=implicit' ,
'-Werror=nonnull' ,
'-Werror=init-self' ,
'-Werror=main' ,
'-Werror=missing-braces' ,
'-Werror=sequence-point' ,
'-Werror=return-type' ,
'-Werror=trigraphs' ,
'-Werror=array-bounds' ,
'-Werror=write-strings' ,
'-Werror=address' ,
'-Werror=int-to-pointer-cast' ,
'-Werror=pointer-to-int-cast' ,
2025-07-10 21:55:20 +02:00
'-Woverride-init' ,
2024-08-28 13:24:08 +02:00
'-Wvla' ,
2025-09-15 16:16:30 +02:00
'-Wincompatible-pointer-types' ,
2017-09-27 14:31:39 -04:00
]
else
test_wflags = [ ]
endif
common_wflags = [ ]
foreach wflag : test_wflags
if cc . has_argument ( wflag )
common_wflags + = [ wflag ]
endif
endforeach
2021-10-22 18:15:05 +02:00
add_project_arguments ( common_wflags , language : [ 'c' , 'objc' ] )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2024-03-18 11:36:35 -07:00
libdrm_req = '>= 2.4.116'
2019-08-01 09:48:59 +02:00
libselinux_req = '>= 2.0.86'
xext_req = '>= 1.0.99.4'
2024-09-09 07:48:07 -07:00
xproto_req = '>= 7.0.31'
2019-08-01 09:48:59 +02:00
gbm_req = '>= 10.2'
xf86dgaproto_req = '>= 2.0.99.1'
2024-01-25 10:20:27 +01:00
xshmfence_req = '>= 1.1'
2019-08-01 09:48:59 +02:00
2024-03-27 11:41:25 +01:00
x11_dep = dependency ( 'x11' )
2024-09-09 07:48:07 -07:00
xproto_dep = dependency ( 'xproto' , version : xproto_req , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
2021-05-30 19:49:43 +00:00
randrproto_dep = dependency ( 'randrproto' , version : '>= 1.6.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
renderproto_dep = dependency ( 'renderproto' , version : '>= 0.11' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
xextproto_dep = dependency ( 'xextproto' , version : '>= 7.2.99.901' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
inputproto_dep = dependency ( 'inputproto' , version : '>= 2.3.99.1' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
kbproto_dep = dependency ( 'kbproto' , version : '>= 1.0.3' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
fontsproto_dep = dependency ( 'fontsproto' , version : '>= 2.1.3' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
xfixes: Add ClientDisconnectMode
With Wayland compositors now being able to start Xwayland on demand, the
next logical step is to be able to stop Xwayland when there is no more
need for it.
The Xserver itself is capable of terminating itself once all X11 clients
are gone, yet in a typical full session, there are a number of X11
clients running continuously (e.g. the Xsettings daemon, IBus, etc.).
Those always-running clients will prevent the Xserver from terminating,
because the actual number of X11 clients will never drop to 0. Worse,
the X11 window manager of a Wayland compositor also counts as an X11
client, hence also preventing Xwayland from stopping.
Some compositors such as mutter use the XRes extension to query the X11
clients connected, match their PID with the actual executable name and
compare those with a list of executables that can be ignored when
deciding to kill the Xserver.
But that's not just clumsy, it is also racy, because a new X11 client
might initiate a connection the X11 server right when the compositor is
about to kill it.
To solve this issue directly at the Xserver level, this add new entries
to the XFixes extension to let the X11 clients themselves specify the
disconnect mode they expect.
Typically, those X11 daemon clients would specify the disconnect mode
XFixesClientDisconnectFlagTerminate to let the Xserver know that they
should not be accounted for when checking the remaining clients prior
to terminate.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-19 12:03:39 +01:00
fixesproto_dep = dependency ( 'fixesproto' , version : '>= 6.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
2021-05-30 19:49:43 +00:00
damageproto_dep = dependency ( 'damageproto' , version : '>= 1.1' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
xcmiscproto_dep = dependency ( 'xcmiscproto' , version : '>= 1.2.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
bigreqsproto_dep = dependency ( 'bigreqsproto' , version : '>= 1.1.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
2024-03-18 11:33:15 -07:00
presentproto_dep = dependency ( 'presentproto' , version : '>= 1.4' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2021-05-30 19:49:43 +00:00
videoproto_dep = dependency ( 'videoproto' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
compositeproto_dep = dependency ( 'compositeproto' , version : '>= 0.4' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
recordproto_dep = dependency ( 'recordproto' , version : '>= 1.13.99.1' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
scrnsaverproto_dep = dependency ( 'scrnsaverproto' , version : '>= 1.1' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
resourceproto_dep = dependency ( 'resourceproto' , version : '>= 1.2.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
xf86driproto_dep = dependency ( 'xf86driproto' , version : '>= 2.1.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] , required : get_option ( 'dri1' ) == 'true' )
dri2proto_dep = dependency ( 'dri2proto' , version : '>= 2.8' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] , required : get_option ( 'dri2' ) == 'true' )
2022-08-16 11:57:40 -07:00
dri3proto_dep = dependency ( 'dri3proto' , version : '>= 1.4' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] , required : get_option ( 'dri3' ) == 'true' )
2021-05-30 19:49:43 +00:00
xineramaproto_dep = dependency ( 'xineramaproto' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
xf86bigfontproto_dep = dependency ( 'xf86bigfontproto' , version : '>= 1.2.0' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] , required : get_option ( 'xf86bigfont' ) )
xf86vidmodeproto_dep = dependency ( 'xf86vidmodeproto' , version : '>= 2.2.99.1' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] )
applewmproto_dep = dependency ( 'applewmproto' , version : '>= 1.4' , fallback : [ 'xorgproto' , 'ext_xorgproto' ] , required : false )
2024-01-25 10:20:27 +01:00
xshmfence_dep = dependency ( 'xshmfence' , version : xshmfence_req , required : false )
2018-10-01 19:52:30 +03:00
dpmsproto_dep = dependency ( 'dpmsproto' , version : '>= 1.2' , required : get_option ( 'dpms' ) )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
pixman_dep = dependency ( 'pixman-1' )
2023-08-02 12:33:19 +01:00
libbsd_dep = dependency ( 'libbsd-overlay' , required : false )
2017-11-06 12:56:05 -05:00
xkbcomp_dep = dependency ( 'xkbcomp' , required : false )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
xkbfile_dep = dependency ( 'xkbfile' )
xfont2_dep = dependency ( 'xfont2' , version : '>= 2.0' )
2017-10-24 13:03:09 -04:00
dbus_required = get_option ( 'systemd_logind' ) == 'true'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
dbus_dep = dependency ( 'dbus-1' , version : '>= 1.0' , required : dbus_required )
2025-09-03 20:09:48 +03:00
seat_libseat_required = get_option ( 'seatd_libseat' ) == 'true'
seat_libseat_dep = dependency ( 'libseat' , version : '>= 0.9.1' , required : seat_libseat_required )
2023-12-31 23:37:19 +00:00
build_systemd = get_option ( 'systemd_notify' ) == 'true'
2018-08-07 16:23:19 -07:00
# libsystemd-daemon was moved into libsystemd in version 209
libsystemd_daemon_dep = dependency ( 'libsystemd' , version : '>= 209' , required : false )
if not libsystemd_daemon_dep . found ( )
libsystemd_daemon_dep = dependency ( 'libsystemd-daemon' , required : false )
endif
2018-04-18 18:09:15 -04:00
build_hashtable = false
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
# Resolve default values of some options
xkb_dir = get_option ( 'xkb_dir' )
if xkb_dir == ''
2019-03-14 17:15:52 +00:00
if xkbcomp_dep . found ( ) and xkbcomp_dep . type_name ( ) == 'pkgconfig'
2023-10-23 17:39:33 +02:00
xkb_dir = xkbcomp_dep . get_variable ( pkgconfig : 'xkbconfigdir' )
2019-03-14 17:15:52 +00:00
endif
2017-11-06 12:56:05 -05:00
if xkb_dir == ''
xkb_dir = join_paths ( get_option ( 'prefix' ) , 'share/X11/xkb' )
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
xkb_output_dir = get_option ( 'xkb_output_dir' )
if xkb_output_dir == ''
2017-11-06 12:56:05 -05:00
xkb_output_dir = join_paths ( xkb_dir , 'compiled' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
2017-10-11 18:03:45 -04:00
xkb_bin_dir = get_option ( 'xkb_bin_dir' )
if xkb_bin_dir == ''
2019-03-14 17:15:52 +00:00
if xkbcomp_dep . found ( ) and xkbcomp_dep . type_name ( ) == 'pkgconfig'
2023-10-23 17:39:33 +02:00
xkb_bin_dir = xkbcomp_dep . get_variable ( pkgconfig : 'bindir' )
2019-03-14 17:15:52 +00:00
endif
2017-11-06 12:56:05 -05:00
if xkb_bin_dir == ''
xkb_bin_dir = join_paths ( get_option ( 'prefix' ) , get_option ( 'bindir' ) )
endif
2017-10-11 18:03:45 -04:00
endif
2018-03-26 14:57:07 -04:00
dfp = get_option ( 'default_font_path' )
if dfp == ''
2022-11-23 14:13:55 +10:00
fontrootdir = get_option ( 'fontrootdir' )
if fontrootdir == ''
fontutil_dep = dependency ( 'fontutil' , required : false )
if fontutil_dep . found ( )
2023-10-23 17:39:33 +02:00
fontrootdir = fontutil_dep . get_variable ( pkgconfig : 'fontrootdir' )
2022-11-23 14:13:55 +10:00
else
fontrootdir = join_paths ( get_option ( 'prefix' ) , get_option ( 'datadir' ) , 'fonts' , 'X11' )
endif
endif
2019-04-18 17:06:41 +01:00
dfp_elements = [
2018-03-26 14:57:07 -04:00
join_paths ( fontrootdir , 'misc' ) ,
join_paths ( fontrootdir , 'TTF' ) ,
join_paths ( fontrootdir , 'OTF' ) ,
join_paths ( fontrootdir , 'Type1' ) ,
join_paths ( fontrootdir , '100dpi' ) ,
join_paths ( fontrootdir , '75dpi' ) ,
2019-04-18 17:06:41 +01:00
]
if host_machine . system ( ) == 'darwin'
dfp_elements + = [
'/Library/Fonts' ,
'/System/Library/Fonts' ,
]
endif
default_font_path = ',' . join ( dfp_elements )
2018-03-26 14:57:07 -04:00
else
default_font_path = dfp
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
glamor_option = get_option ( 'glamor' )
2024-06-27 09:59:11 +02:00
hal_option = get_option ( 'hal' )
if [ 'windows' , 'darwin' , 'cygwin' ] . contains ( host_machine . system ( ) )
hal_option = 'false'
endif
2025-07-24 18:14:52 +03:00
udev_option = get_option ( 'udev' )
udev_kms_option = get_option ( 'udev_kms' )
2025-07-26 17:28:26 +03:00
if not dependency ( 'libudev' , required : ( udev_option == 'true' or udev_kms_option == 'true' ) ) . found ( )
udev_option = 'false'
udev_kms_option = 'false'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
2025-07-26 17:28:26 +03:00
build_udev = ( udev_option != 'false' )
build_udev_kms = ( udev_kms_option != 'false' )
2025-07-24 18:14:52 +03:00
2025-09-03 20:09:48 +03:00
if get_option ( 'seatd_libseat' ) == 'auto'
build_seatd_libseat = build_udev_kms and seat_libseat_dep . found ( )
else
build_seatd_libseat = get_option ( 'seatd_libseat' ) == 'true'
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if get_option ( 'systemd_logind' ) == 'auto'
2025-09-03 20:09:48 +03:00
build_systemd_logind = build_udev_kms and dbus_dep . found ( ) and not build_seatd_libseat
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
else
2017-10-24 13:03:09 -04:00
build_systemd_logind = get_option ( 'systemd_logind' ) == 'true'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
2025-09-03 20:09:48 +03:00
if build_systemd_logind and build_seatd_libseat
error ( 'Support for systemd-logind and seatd-libseat are mutually exclusive: choose either.' )
endif
2019-08-27 15:54:42 -04:00
with_dtrace = get_option ( 'dtrace' )
if with_dtrace
dtrace = find_program ( 'dtrace' , required : true )
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
build_xorg = false
2022-06-20 17:08:53 -07:00
if ( host_machine . system ( ) != 'windows' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if get_option ( 'xorg' ) == 'auto'
build_xorg = ( host_machine . system ( ) != 'darwin' and
host_machine . system ( ) != 'windows' )
else
2017-10-24 13:03:09 -04:00
build_xorg = get_option ( 'xorg' ) == 'true'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
endif
xorgsdkdir = join_paths ( get_option ( 'prefix' ) , get_option ( 'includedir' ) , 'xorg' )
2021-10-22 18:15:53 +02:00
libxcvt_dep = dependency ( 'libxcvt' , fallback : [ 'libxcvt' , 'libxcvt_dep' ] , required : build_xorg )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2024-05-13 12:09:54 +02:00
## configure Xnest - nesting X server
build_xnest = get_option ( 'xnest' ) != 'false'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2017-05-07 20:53:04 +01:00
build_xwin = false
if get_option ( 'xwin' ) == 'auto'
2025-12-07 10:06:52 +00:00
if ( host_machine . system ( ) == 'cygwin' or
host_machine . system ( ) == 'windows' )
2017-05-07 20:53:04 +01:00
build_xwin = true
endif
else
2017-10-24 13:03:09 -04:00
build_xwin = get_option ( 'xwin' ) == 'true'
2017-05-07 20:53:04 +01:00
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
build_xquartz = false
2019-04-18 17:06:41 +01:00
if get_option ( 'xquartz' ) == 'auto'
if host_machine . system ( ) == 'darwin'
build_xquartz = true
endif
else
build_xquartz = get_option ( 'xquartz' ) == 'true'
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2019-04-19 14:01:48 +01:00
build_rootless = false
if build_xquartz
build_rootless = true
endif
2025-03-19 12:14:25 +10:00
build_xvfb = get_option ( 'xvfb' )
summary ( {
'Xorg' : build_xorg ,
'Xnest' : build_xnest ,
'Xvfb' : build_xvfb ,
'Xwin' : build_xwin ,
'Xquartz' : build_xquartz ,
2025-08-28 22:44:45 +03:00
'Xephyr' : get_option ( 'xephyr' ) ,
2025-06-23 22:38:33 +03:00
'Xfbdev' : get_option ( 'xfbdev' ) ,
2025-03-19 12:14:25 +10:00
} ,
section : 'DDX' ,
bool_yn : true ,
)
2024-04-17 18:46:15 +02:00
# IPv6 support
have_AF_INET6 = cc . compiles ( '' '
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
2024-07-27 11:59:34 -07:00
int main ( void ) { int foo = AF_INET6 ; return foo ; } '' ' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if get_option ( 'ipv6' ) == 'auto'
2024-04-17 18:46:15 +02:00
build_ipv6 = cc . has_function ( 'getaddrinfo' ) and have_AF_INET6
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
else
2017-10-24 13:03:09 -04:00
build_ipv6 = get_option ( 'ipv6' ) == 'true'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
2024-04-17 18:46:15 +02:00
if build_ipv6 and not have_AF_INET6
error ( 'ipv6 support needs AF_INET6' )
endif
message ( 'IPv6 support: ' + ( build_ipv6 ? 'YES' : 'NO' ) )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
int10 = get_option ( 'int10' )
if int10 == 'auto'
int10 = 'x86emu'
2022-08-05 12:02:50 +00:00
if host_machine . cpu ( ) == 'ppc' and host_machine . system ( ) == 'freebsd'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
int10 = 'stub'
endif
if host_machine . cpu ( ) == 'arm'
int10 = 'stub'
endif
endif
2017-10-23 16:21:19 -04:00
hal_dep = [ ]
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if hal_option == 'auto'
if not build_udev
hal_dep = dependency ( 'hal' , required : false )
build_hal = hal_dep . found ( )
else
build_hal = false
endif
else
2017-10-24 13:03:09 -04:00
build_hal = hal_option == 'true'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if build_hal
hal_dep = dependency ( 'hal' )
endif
endif
2025-06-17 11:57:41 +02:00
if build_hal
message ( 'WARNING: HAL is deprecated and might be removed in near future' )
message ( 'If you really need it, please file a feature request on keeping it' )
message ( 'and explain why you need it, what your use case is.' )
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if build_udev and build_hal
error ( 'Hotplugging through both libudev and hal not allowed' )
endif
2017-05-08 11:40:21 +01:00
build_dbus = build_hal or build_systemd_logind
2017-05-08 11:40:22 +01:00
udev_dep = dependency ( '' , required : false )
2020-02-09 15:28:10 +00:00
if build_udev or build_udev_kms
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
udev_dep = dependency ( 'libudev' , version : '>= 143' )
endif
log_dir = get_option ( 'log_dir' )
if log_dir == ''
log_dir = join_paths ( get_option ( 'prefix' ) , get_option ( 'localstatedir' ) , 'log' )
endif
2018-05-02 12:54:26 -07:00
module_dir = join_paths ( get_option ( 'libdir' ) , get_option ( 'module_dir' ) )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if glamor_option == 'auto'
2025-06-16 10:59:01 +02:00
build_glamor = build_xorg
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
else
2019-08-01 13:34:13 +02:00
build_glamor = glamor_option == 'true'
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
2018-02-28 01:19:44 +00:00
gbm_dep = dependency ( '' , required : false )
epoxy_dep = dependency ( '' , required : false )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
if build_glamor
2019-10-14 12:48:24 +02:00
gbm_dep = dependency ( 'gbm' , version : gbm_req , required : false )
epoxy_dep = dependency ( 'epoxy' , required : false )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
endif
2019-10-26 17:12:26 +01:00
# Lots of sha1 options, because Linux is about choice :)
# The idea behind the ordering here is that we should first prefer system
# builtin providers, and then smaller implementations of over larger ones.
test_sha1 = [
'libc' , # libmd API is in libc on some BSDs
'CommonCrypto' , # darwin API
'CryptoAPI' , # windows API
'libmd' , # other BSDs & Solaris
'libsha1' , # "a tiny library providing a SHA1 implementation, created for facilitating X server compilation on embedded devices where larger libraries containing SHA1 implementations are not needed"
'libnettle' ,
'libgcrypt' , # in debian base system
'libcrypto' ,
]
if get_option ( 'sha1' ) != 'auto'
test_sha1 = [ get_option ( 'sha1' ) ]
endif
sha1_found = false
foreach t : test_sha1
if t == 'libc'
if cc . has_function ( 'SHA1Init' )
sha1_found = true
sha1_dep = dependency ( '' , required : false )
endif
elif t == 'CommonCrypto'
if cc . has_function ( 'CC_SHA1_Init' )
sha1_found = true
sha1_dep = dependency ( '' , required : false )
endif
elif t == 'CryptoAPI'
if cc . has_header ( 'wincrypt.h' )
sha1_found = true
sha1_dep = dependency ( '' , required : false )
endif
elif t == 'libmd'
md_dep = cc . find_library ( 'md' , required : false )
if md_dep . found ( )
sha1_found = true
sha1_dep = md_dep
endif
elif t == 'libsha1'
libsha1_dep = dependency ( 'libsha1' , required : false )
if libsha1_dep . found ( )
sha1_found = true
sha1_dep = libsha1_dep
endif
elif t == 'libnettle'
nettle_dep = dependency ( 'nettle' , required : false )
if nettle_dep . found ( )
sha1_found = true
sha1_dep = nettle_dep
endif
elif t == 'libgcrypt'
gcrypt_dep = dependency ( 'libgcrypt' , required : false )
if gcrypt_dep . found ( )
sha1_found = true
sha1_dep = gcrypt_dep
endif
elif t == 'libcrypto'
# we don't need all of OpenSSL, just libcrypto
libcrypto_dep = cc . find_library ( 'crypto' , required : false )
openssl_dep = dependency ( 'openssl' , required : false )
if libcrypto_dep . found ( ) or openssl_dep . found ( )
sha1_found = true
if libcrypto_dep . found ( )
sha1_dep = libcrypto_dep
else
sha1_dep = openssl_dep
endif
endif
endif
if sha1_found
sha1 = t
break
endif
endforeach
if sha1_found
message ( 'Using @0@ SHA1 functions' . format ( sha1 ) )
else
if get_option ( 'sha1' ) != 'auto'
error ( '@0@ SHA1 requested, but not found' . format ( get_option ( 'sha1' ) ) )
else
error ( 'No suitable SHA1 implementation found' )
endif
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2025-09-20 13:45:06 +03:00
build_xdmcp = get_option ( 'xdmcp' )
xdmcp_dep = dependency ( 'xdmcp' , required : build_xdmcp )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2018-03-28 14:04:32 +02:00
has_xdm_auth = get_option ( 'xdm-auth-1' )
if not xdmcp_dep . found ( )
has_xdm_auth = false
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
build_glx = get_option ( 'glx' )
2018-04-18 18:09:15 -04:00
if build_glx
build_hashtable = true
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2025-12-14 01:25:14 +02:00
dri_dep = dependency ( 'dri' , required : false )
glx_dri_opt = get_option ( 'glx_dri' )
build_glx_dri = ( glx_dri_opt != 'false' )
if not dri_dep . found ( )
if glx_dri_opt == 'auto'
build_glx_dri = false
endif
if glx_dri_opt == 'true'
error ( 'DRI glx backends requested, but dri.pc was not found' )
endif
endif
2019-08-01 09:48:59 +02:00
libdrm_dep = dependency ( 'libdrm' , version : libdrm_req , required : false )
2018-03-08 12:34:26 +00:00
2017-05-09 12:23:48 +01:00
if get_option ( 'dri1' ) == 'auto'
2018-03-08 12:34:26 +00:00
build_dri1 = xf86driproto_dep . found ( ) and libdrm_dep . found ( )
2017-05-09 12:23:48 +01:00
else
2017-10-24 13:03:09 -04:00
build_dri1 = get_option ( 'dri1' ) == 'true'
2017-05-09 12:23:48 +01:00
endif
if get_option ( 'dri2' ) == 'auto'
2018-03-08 12:34:26 +00:00
build_dri2 = dri2proto_dep . found ( ) and libdrm_dep . found ( )
2017-05-09 12:23:48 +01:00
else
2017-10-24 13:03:09 -04:00
build_dri2 = get_option ( 'dri2' ) == 'true'
2017-05-09 12:23:48 +01:00
endif
2025-09-17 09:32:18 +00:00
if host_machine . system ( ) in [ 'freebsd' , 'openbsd' , 'dragonfly' ]
2024-08-13 10:18:38 +02:00
epoll_dep = dependency ( 'epoll-shim' )
2025-07-31 14:32:09 +00:00
epoll_inc = join_paths ( epoll_dep . get_variable ( 'prefix' ) , get_option ( 'includedir' ) , 'libepoll-shim' )
2024-08-13 10:18:38 +02:00
else
epoll_dep = [ ]
2025-07-31 14:32:09 +00:00
epoll_inc = ''
2024-08-13 10:18:38 +02:00
endif
2024-08-13 10:22:35 +02:00
have_eventfd = cc . has_header ( 'sys/eventfd.h' , dependencies : epoll_dep )
2017-05-09 12:23:48 +01:00
if get_option ( 'dri3' ) == 'auto'
2024-05-07 13:42:22 +02:00
build_dri3 = dri3proto_dep . found ( ) and xshmfence_dep . found ( ) and libdrm_dep . found ( ) and have_eventfd
2017-05-09 12:23:48 +01:00
else
2017-10-24 13:03:09 -04:00
build_dri3 = get_option ( 'dri3' ) == 'true'
2017-05-09 12:23:48 +01:00
if build_dri3
if not xshmfence_dep . found ( )
error ( 'DRI3 requested, but xshmfence not found' )
endif
2024-05-07 13:42:22 +02:00
if not have_eventfd
error ( 'DRI3 requested, but sys/eventfd.h not found' )
endif
2017-05-09 12:23:48 +01:00
endif
endif
2021-08-06 15:21:53 +03:00
libdrm_required = ( build_dri1 or build_dri2 or build_dri3 ) and get_option ( 'drm' ) == true
2018-03-08 12:34:26 +00:00
if not libdrm_dep . found ( ) and libdrm_required
error ( 'DRI requested, but LIBDRM not found' )
endif
2020-12-10 22:32:59 +01:00
build_modesetting = libdrm_dep . found ( ) and dri2proto_dep . found ( )
2017-05-09 12:23:48 +01:00
2017-06-17 14:32:30 +01:00
build_vgahw = false
if get_option ( 'vgahw' ) == 'auto'
if ( host_machine . system ( ) != 'darwin' and
2025-12-07 10:06:52 +00:00
host_machine . system ( ) != 'windows' and
host_machine . system ( ) != 'cygwin' )
2017-06-17 14:32:30 +01:00
build_vgahw = true
endif
else
2017-10-24 13:03:09 -04:00
build_vgahw = get_option ( 'vgahw' ) == 'true'
2017-06-17 14:32:30 +01:00
endif
2018-02-13 22:33:49 +01:00
build_dpms = get_option ( 'dpms' )
if build_xquartz
build_dpms = false
endif
2018-02-13 22:33:50 +01:00
build_xf86bigfont = get_option ( 'xf86bigfont' )
build_screensaver = get_option ( 'screensaver' )
build_res = get_option ( 'xres' )
2018-04-18 18:09:15 -04:00
if build_res
build_hashtable = true
endif
2018-02-13 22:33:50 +01:00
build_xinerama = get_option ( 'xinerama' )
2018-02-13 22:33:51 +01:00
build_xsecurity = get_option ( 'xcsecurity' )
2024-01-25 16:38:10 +01:00
build_namespace = get_option ( 'namespace' )
2018-02-18 10:58:33 +01:00
build_xv = get_option ( 'xv' )
build_xvmc = get_option ( 'xvmc' )
if not build_xv
build_xvmc = false
endif
2018-02-18 10:58:35 +01:00
build_dga = false
2018-09-06 16:40:06 -04:00
xf86dgaproto_dep = dependency ( '' , required : false )
2018-02-18 10:58:35 +01:00
if get_option ( 'dga' ) == 'auto'
2019-08-01 09:48:59 +02:00
xf86dgaproto_dep = dependency ( 'xf86dgaproto' , version : xf86dgaproto_req , required : false )
2018-02-18 10:58:35 +01:00
if xf86dgaproto_dep . found ( )
build_dga = true
endif
elif get_option ( 'dga' ) == 'true'
2019-08-01 09:48:59 +02:00
xf86dgaproto_dep = dependency ( 'xf86dgaproto' , version : xf86dgaproto_req , required : true )
2018-02-18 10:58:35 +01:00
build_dga = true
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
build_apm = false
2018-03-01 12:55:11 +01:00
if ( get_option ( 'linux_apm' ) == true and
host_machine . system ( ) == 'linux' )
if cc . has_header ( 'linux/apm_bios.h' )
build_apm = true
endif
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
build_acpi = false
2018-03-01 12:56:28 +01:00
if ( get_option ( 'linux_acpi' ) == true and
host_machine . system ( ) == 'linux' )
if ( host_machine . cpu ( ) == 'x86' or
host_machine . cpu ( ) == 'x86_64' or
host_machine . cpu ( ) == 'ia64' )
build_acpi = true
endif
endif
2018-03-01 12:58:16 +01:00
build_mitshm = false
if get_option ( 'mitshm' ) == 'auto'
build_mitshm = cc . has_header ( 'sys/shm.h' )
elif get_option ( 'mitshm' ) == 'true'
build_mitshm = true
endif
2025-08-03 17:36:34 +03:00
legacy_nvidia_padding = get_option ( 'legacy_nvidia_padding' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
m_dep = cc . find_library ( 'm' , required : false )
dl_dep = cc . find_library ( 'dl' , required : false )
common_dep = [
xproto_dep ,
randrproto_dep ,
renderproto_dep ,
xextproto_dep ,
inputproto_dep ,
kbproto_dep ,
fontsproto_dep ,
fixesproto_dep ,
damageproto_dep ,
xcmiscproto_dep ,
bigreqsproto_dep ,
2022-10-17 16:31:05 +02:00
presentproto_dep ,
2018-08-07 16:23:19 -07:00
libsystemd_daemon_dep ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
videoproto_dep ,
compositeproto_dep ,
recordproto_dep ,
scrnsaverproto_dep ,
resourceproto_dep ,
xf86driproto_dep ,
dri2proto_dep ,
dri3proto_dep ,
xineramaproto_dep ,
xf86bigfontproto_dep ,
xf86dgaproto_dep ,
xf86vidmodeproto_dep ,
applewmproto_dep ,
2018-10-01 19:52:30 +03:00
dpmsproto_dep ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
pixman_dep ,
libbsd_dep ,
xkbfile_dep ,
xfont2_dep ,
xdmcp_dep ,
]
inc = include_directories (
2024-03-01 16:53:49 +01:00
'.' ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
'Xext' ,
2026-01-01 13:42:08 +02:00
'Xext/dri2' ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
'Xi' ,
'composite' ,
'exa' ,
'fb' ,
'glamor' ,
'mi' ,
'miext/damage' ,
'miext/shadow' ,
'miext/sync' ,
'dbe' ,
2024-02-06 16:22:04 +01:00
'dix' ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
'dri3' ,
'include' ,
'present' ,
'randr' ,
'render' ,
'xfixes' ,
2025-07-31 14:32:09 +00:00
epoll_inc ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
)
2018-08-09 13:02:41 -07:00
build_xselinux = false
if get_option ( 'xselinux' ) != 'false'
2019-08-01 09:48:59 +02:00
dep_selinux = dependency ( 'libselinux' , version : libselinux_req ,
2018-08-09 13:02:41 -07:00
required : get_option ( 'xselinux' ) == 'true' )
dep_audit = dependency ( 'audit' , required : get_option ( 'xselinux' ) == 'true' )
if get_option ( 'xselinux' ) == 'true'
build_xselinux = true
else
build_xselinux = dep_selinux . found ( ) and dep_audit . found ( )
endif
if build_xselinux
common_dep + = dep_selinux
common_dep + = dep_audit
endif
endif
2019-04-26 00:46:09 +01:00
socket_dep = [ ]
if host_machine . system ( ) == 'windows'
socket_dep = meson . get_compiler ( 'c' ) . find_library ( 'ws2_32' )
common_dep + = socket_dep
endif
2019-08-27 18:10:38 -04:00
if get_option ( 'libunwind' )
common_dep + = dependency ( 'libunwind' , required : true )
endif
2017-04-27 12:50:13 -04:00
glx_inc = include_directories ( 'glx' )
2019-04-20 12:45:11 +01:00
top_dir_inc = include_directories ( '.' )
2017-05-07 20:53:04 +01:00
2023-11-17 11:54:54 +01:00
serverconfigdir = get_option ( 'serverconfigdir' )
if serverconfigdir == ''
serverconfigdir = join_paths ( get_option ( 'prefix' ) , get_option ( 'libdir' ) , 'xorg' )
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
2024-03-21 16:19:20 +01:00
subdir ( 'man' )
2018-03-26 18:42:57 -04:00
2021-08-05 22:43:54 +03:00
require_docs = get_option ( 'docs' ) == 'true'
require_devel_docs = get_option ( 'devel-docs' ) == 'true'
require_docs_pdf = ( require_docs or require_devel_docs ) and get_option ( 'docs-pdf' ) == 'true'
sgml_doctools_dep = dependency ( 'xorg-sgml-doctools' ,
required : require_docs or require_devel_docs )
xmlto = find_program ( 'xmlto' , required : require_docs or require_devel_docs )
xsltproc = find_program ( 'xsltproc' , required : require_docs or require_devel_docs )
fop = find_program ( 'fop' , required : require_docs_pdf )
build_docs = ( get_option ( 'docs' ) != 'false' and
sgml_doctools_dep . found ( ) and
xmlto . found ( ) )
build_docs_devel = ( get_option ( 'devel-docs' ) != 'false' and
sgml_doctools_dep . found ( ) and
xmlto . found ( ) )
build_docs_pdf = ( get_option ( 'docs-pdf' ) != 'false' and
( build_docs or build_docs_devel ) and
fop . found ( ) )
if build_docs or build_docs_devel
2023-10-23 17:39:33 +02:00
doc_sgml_path = sgml_doctools_dep . get_variable ( pkgconfig : 'sgmlrootdir' )
2021-08-05 22:43:54 +03:00
doc_stylesheet_srcdir = join_paths ( doc_sgml_path , 'X11' )
# Meson does not and will not support functions so we are copy-pasting
# documentation build code around which is unfortunate
# See https://mesonbuild.com/FAQ.html#why-doesnt-meson-have-user-defined-functionsmacros
docs_xmlto_search_flags = [
'--searchpath' , doc_stylesheet_srcdir ,
2023-10-23 17:39:33 +02:00
'--searchpath' , meson . project_build_root ( ) ,
2021-08-05 22:43:54 +03:00
]
docs_xslt_search_flags = [
'--path' , doc_stylesheet_srcdir ,
2023-10-23 17:39:33 +02:00
'--path' , meson . project_build_root ( ) ,
2021-08-05 22:43:54 +03:00
]
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
# Include must come first, as it sets up dix-config.h
subdir ( 'include' )
# X server core
subdir ( 'config' )
subdir ( 'dix' )
subdir ( 'dri3' )
subdir ( 'glx' )
subdir ( 'fb' )
subdir ( 'mi' )
subdir ( 'os' )
# X extensions
2022-11-27 22:25:49 -08:00
subdir ( 'composite' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
subdir ( 'dbe' )
subdir ( 'miext/damage' )
subdir ( 'miext/shadow' )
subdir ( 'miext/sync' )
2019-04-19 14:01:48 +01:00
if build_rootless
subdir ( 'miext/rootless' )
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
subdir ( 'present' )
if build_xwin or build_xquartz
subdir ( 'pseudoramiX' )
endif
subdir ( 'randr' )
subdir ( 'record' )
subdir ( 'render' )
subdir ( 'xfixes' )
subdir ( 'xkb' )
subdir ( 'Xext' )
subdir ( 'Xi' )
# other
if build_glamor
subdir ( 'glamor' )
endif
if build_xorg or get_option ( 'xephyr' )
subdir ( 'exa' )
endif
2021-08-05 22:43:54 +03:00
subdir ( 'doc' )
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
# Common static libraries of all X servers
libxserver = [
libxserver_mi ,
libxserver_dix ,
2022-11-27 22:25:49 -08:00
libxserver_composite ,
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
libxserver_damageext ,
libxserver_dbe ,
libxserver_randr ,
libxserver_miext_damage ,
libxserver_render ,
libxserver_present ,
libxserver_xext ,
libxserver_miext_sync ,
libxserver_xfixes ,
libxserver_xi ,
libxserver_xkb ,
libxserver_record ,
libxserver_os ,
]
2026-01-01 13:42:08 +02:00
libxserver + = libxserver_dri2
2017-05-09 12:23:48 +01:00
libxserver + = libxserver_dri3
2024-01-25 16:38:10 +01:00
if build_namespace
subdir ( 'Xext/namespace' )
libxserver + = libxserver_namespace
endif
Add a Meson build system alongside autotools.
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.
The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools. meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.
v2: Fix indentation nits, move version declaration to project(), use
existing meson_options for version-config.h's vendor name/web.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-11 10:24:04 -08:00
subdir ( 'hw' )
2019-04-26 01:09:25 +01:00
2025-07-01 20:44:27 +03:00
build_tests = get_option ( 'tests' ) and host_machine . system ( ) != 'windows'
if build_tests
2019-04-26 01:09:25 +01:00
subdir ( 'test' )
endif
2018-03-26 18:42:57 -04:00
2018-03-26 18:43:00 -04:00
if build_xorg
sdkconfig = configuration_data ( )
awk = find_program ( 'awk' )
sdkconfig . set ( 'prefix' , get_option ( 'prefix' ) )
2018-03-28 14:04:37 +02:00
sdkconfig . set ( 'exec_prefix' , '${prefix}' )
sdkconfig . set ( 'libdir' , join_paths ( '${exec_prefix}' , get_option ( 'libdir' ) ) )
sdkconfig . set ( 'includedir' , join_paths ( '${prefix}' , get_option ( 'includedir' ) ) )
sdkconfig . set ( 'datarootdir' , join_paths ( '${prefix}' , get_option ( 'datadir' ) ) )
2025-06-02 15:54:38 +02:00
sdkconfig . set ( 'moduledir' , join_paths ( join_paths ( '${exec_prefix}' , module_dir ) , module_abi_tag ) )
2018-03-28 14:04:37 +02:00
sdkconfig . set ( 'sdkdir' , join_paths ( '${prefix}' , get_option ( 'includedir' ) , 'xorg' ) )
2025-12-19 17:01:50 +01:00
sdkconfig . set ( 'xserverconfigdir' , join_paths ( '${datarootdir}' , 'X11/xorg.conf.d' ) )
2018-03-26 18:43:00 -04:00
sdkconfig . set ( 'abi_ansic' ,
run_command ( awk , '-F' , '[(,)]' ,
2018-03-28 14:04:38 +02:00
'/^#define ABI_ANSIC.*SET/ { printf "%d.%d", $2, $3 }' ,
2023-10-23 17:39:33 +02:00
files ( 'hw/xfree86/common/xf86Module.h' ) ,
check : false
2018-03-26 18:43:00 -04:00
) . stdout ( )
)
sdkconfig . set ( 'abi_videodrv' ,
run_command ( awk , '-F' , '[(,)]' ,
2018-03-28 14:04:38 +02:00
'/^#define ABI_VIDEODRV.*SET/ { printf "%d.%d", $2, $3 }' ,
2023-10-23 17:39:33 +02:00
files ( 'hw/xfree86/common/xf86Module.h' ) ,
check : false
2018-03-26 18:43:00 -04:00
) . stdout ( )
)
sdkconfig . set ( 'abi_xinput' ,
run_command ( awk , '-F' , '[(,)]' ,
2018-03-28 14:04:38 +02:00
'/^#define ABI_XINPUT.*SET/ { printf "%d.%d", $2, $3 }' ,
2023-10-23 17:39:33 +02:00
files ( 'hw/xfree86/common/xf86Module.h' ) ,
check : false
2018-03-26 18:43:00 -04:00
) . stdout ( )
)
sdkconfig . set ( 'abi_extension' ,
run_command ( awk , '-F' , '[(,)]' ,
2018-03-28 14:04:38 +02:00
'/^#define ABI_EXTENSION.*SET/ { printf "%d.%d", $2, $3 }' ,
2023-10-23 17:39:33 +02:00
files ( 'hw/xfree86/common/xf86Module.h' ) ,
check : false
2018-03-26 18:43:00 -04:00
) . stdout ( )
)
2018-03-29 13:07:56 +02:00
sdk_required_modules = [
'pixman-1 >= 0.27.2' ,
2024-09-09 07:48:07 -07:00
f 'xproto @xproto_req@' ,
2024-06-14 17:33:53 +02:00
'xfont2 >= 2.0' ,
2018-03-29 13:07:56 +02:00
]
2018-03-26 18:43:00 -04:00
# XXX this isn't trying very hard, but hard enough.
sdkconfig . set ( 'PACKAGE_VERSION' , meson . project_version ( ) )
2018-03-29 13:07:56 +02:00
sdkconfig . set ( 'SDK_REQUIRED_MODULES' , ' ' . join ( sdk_required_modules ) )
2018-03-26 18:43:00 -04:00
sdkconfig . set ( 'symbol_visibility' , '-fvisibility=hidden' )
sdkconfig . set ( 'XORG_DRIVER_LIBS' , '' )
2026-01-08 13:05:31 +01:00
sdkconfig . set ( 'driver_man_dir' , join_paths ( get_option ( 'prefix' ) , get_option ( 'mandir' ) , 'man4' ) )
sdkconfig . set ( 'driver_man_section' , '4' )
sdkconfig . set ( 'app_man_dir' , join_paths ( get_option ( 'prefix' ) , get_option ( 'mandir' ) , 'man1' ) )
sdkconfig . set ( 'app_man_section' , '1' )
sdkconfig . set ( 'file_man_dir' , join_paths ( get_option ( 'prefix' ) , get_option ( 'mandir' ) , 'man5' ) )
sdkconfig . set ( 'file_man_section' , '5' )
sdkconfig . set ( 'misc_man_dir' , join_paths ( get_option ( 'prefix' ) , get_option ( 'mandir' ) , 'man7' ) )
sdkconfig . set ( 'misc_man_section' , '7' )
sdkconfig . set ( 'server_name' , 'Xorg' )
sdkconfig . set ( 'server_config' , 'xorg.conf' )
2018-03-26 18:43:00 -04:00
2018-06-06 16:25:49 +01:00
# On Windows, modules built with the SDK will need to link with server and
# module implibs to resolve symbols
2025-12-07 10:06:52 +00:00
if ( host_machine . system ( ) == 'cygwin' or
host_machine . system ( ) == 'windows' )
2018-06-06 16:25:49 +01:00
sdkconfig . set ( 'XORG_DRIVER_LIBS' , '-lXorg.exe -L\${moduledir} -lshadow -no-undefined' )
endif
2018-03-26 18:43:00 -04:00
configure_file (
input : 'xorg-server.pc.in' ,
output : 'xorg-server.pc' ,
configuration : sdkconfig ,
2025-12-08 14:57:00 +01:00
install_dir : join_paths ( get_option ( 'prefix' ) ,
get_option ( 'libdir' ) ,
'pkgconfig' ) ,
)
configure_file (
input : 'xlibre-server.pc.in' ,
output : 'xlibre-server.pc' ,
configuration : sdkconfig ,
2018-03-26 18:43:00 -04:00
install_dir : join_paths ( get_option ( 'prefix' ) ,
get_option ( 'libdir' ) ,
'pkgconfig' ) ,
)
2018-03-26 18:43:01 -04:00
2021-03-05 22:50:51 +00:00
install_data ( 'xorg-server.m4' ,
install_dir : join_paths ( get_option ( 'datadir' ) , 'aclocal' ) )
endif
2021-08-05 22:43:54 +03:00
if build_docs or build_docs_devel
docxmlconfig = configuration_data ( )
docxmlconfig . set ( 'PACKAGE_VERSION' , meson . project_version ( ) )
docxmlconfig . set ( 'RELEASE_DATE' , release_date )
configure_file (
input : 'xserver.ent.in' ,
output : 'xserver.ent' ,
configuration : docxmlconfig
)
endif
2024-09-10 20:14:22 +02:00
# finally write config files. doing that very late, so other subdirs still
2025-12-10 13:24:22 +01:00
# have a chance to add config items
2024-09-10 20:14:22 +02:00
configure_file ( output : 'dix-config.h' ,
configuration : conf_data )
2025-12-19 12:52:53 +01:00
# deprecated, but still supported for a while
2024-09-10 20:14:22 +02:00
configure_file ( output : 'xorg-server.h' ,
2025-12-19 12:52:53 +01:00
input : 'hw/xfree86/xlibre-server.h.meson.in' ,
configuration : conf_data ,
install : build_xorg ,
install_dir : xorgsdkdir )
# new config include file for drivers
configure_file ( output : 'xlibre-server.h' ,
input : 'hw/xfree86/xlibre-server.h.meson.in' ,
2024-09-10 20:14:22 +02:00
configuration : conf_data ,
install : build_xorg ,
install_dir : xorgsdkdir )
2025-12-10 13:24:22 +01:00
configure_file ( output : 'xorg-config.h' ,
input : 'hw/xfree86/xorg-config.h.meson.in' ,
configuration : xorg_data )