Commit 1549e303 authored by Eric Anholt's avatar Eric Anholt

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: 's avatarEric Anholt <eric@anholt.net>
Acked-by: 's avatarKeith Packard <keithp@keithp.com>
Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent c7be7a68
srcs_xext = [
'bigreq.c',
'geext.c',
'shape.c',
'sleepuntil.c',
'sync.c',
'xcmisc.c',
'xtest.c',
]
if build_dpms
srcs_xext += 'dpms.c'
endif
if build_mitshm
srcs_xext += 'shm.c'
endif
if build_res
srcs_xext += ['hashtable.c', 'xres.c']
endif
if build_screensaver
srcs_xext += 'saver.c'
endif
if build_xace
srcs_xext += 'xace.c'
endif
if build_xf86bigfont
srcs_xext += 'xf86bigfont.c'
endif
if build_xinerama
srcs_xext += ['panoramiX.c', 'panoramiXprocs.c', 'panoramiXSwap.c']
endif
if build_xsecurity
srcs_xext += ['security.c']
endif
if build_xselinux
srcs_xext += ['xselinux_ext.c', 'xselinux_hooks.c', 'xselinux_label.c']
endif
if build_xv
srcs_xext += ['xvmain.c', 'xvdisp.c', 'xvmc.c']
endif
libxserver_xext = static_library('libxserver_xext',
srcs_xext,
include_directories: inc,
dependencies: common_dep,
)
libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
'vidmode.c',
include_directories: inc,
dependencies: common_dep,
)
srcs_xi = [
'allowev.c',
'chgdctl.c',
'chgfctl.c',
'chgkbd.c',
'chgkmap.c',
'chgprop.c',
'chgptr.c',
'closedev.c',
'devbell.c',
'exevents.c',
'extinit.c',
'getbmap.c',
'getdctl.c',
'getfctl.c',
'getfocus.c',
'getkmap.c',
'getmmap.c',
'getprop.c',
'getselev.c',
'getvers.c',
'grabdev.c',
'grabdevb.c',
'grabdevk.c',
'gtmotion.c',
'listdev.c',
'opendev.c',
'queryst.c',
'selectev.c',
'sendexev.c',
'setbmap.c',
'setdval.c',
'setfocus.c',
'setmmap.c',
'setmode.c',
'ungrdev.c',
'ungrdevb.c',
'ungrdevk.c',
'xiallowev.c',
'xibarriers.c',
'xichangecursor.c',
'xichangehierarchy.c',
'xigetclientpointer.c',
'xigrabdev.c',
'xipassivegrab.c',
'xiproperty.c',
'xiquerydevice.c',
'xiquerypointer.c',
'xiqueryversion.c',
'xiselectev.c',
'xisetclientpointer.c',
'xisetdevfocus.c',
'xiwarppointer.c',
]
libxserver_xi = static_library('libxserver_xi',
srcs_xi,
include_directories: inc,
dependencies: common_dep,
)
srcs_xi_stubs = ['stubs.c']
libxserver_xi_stubs = static_library('libxserver_xi_stubs',
srcs_xi_stubs,
include_directories: inc,
dependencies: common_dep,
)
srcs_composite = [
'compalloc.c',
'compext.c',
'compinit.c',
'compoverlay.c',
'compwindow.c',
]
libxserver_composite = static_library('libxserver_composite',
srcs_composite,
include_directories: inc,
dependencies: common_dep,
)
srcs_config = [
'config.c',
]
config_dep = [common_dep]
if build_dbus
srcs_config += 'dbus-core.c'
config_dep += dbus_dep
endif
if build_hal
srcs_config += 'hal.c'
config_dep += hal_dep
endif
if build_udev
srcs_config += 'udev.c'
config_dep += udev_dep
endif
if host_machine.system() == 'openbsd'
srcs_config += 'wscons.c'
endif
if build_xorg
install_data('10-quirks.conf',
install_dir: join_paths(get_option('datadir'), 'xorg.conf.d'))
endif
libxserver_config = static_library('libxserver_config',
srcs_config,
include_directories: inc,
dependencies: config_dep,
)
srcs_damageext = [
'damageext.c',
]
libxserver_damageext = static_library('libxserver_damageext',
srcs_damageext,
include_directories: inc,
dependencies: common_dep,
)
srcs_dbe = [
'dbe.c',
'midbe.c',
]
libxserver_dbe = static_library('libxserver_dbe',
srcs_dbe,
include_directories: inc,
dependencies: common_dep,
)
srcs_dix = [
'atom.c',
'colormap.c',
'cursor.c',
'devices.c',
'dispatch.c',
'dixfonts.c',
'main.c',
'dixutils.c',
'enterleave.c',
'events.c',
'eventconvert.c',
'extension.c',
'ffs.c',
'gc.c',
'getevents.c',
'globals.c',
'glyphcurs.c',
'grabs.c',
'initatoms.c',
'inpututils.c',
'pixmap.c',
'privates.c',
'property.c',
'ptrveloc.c',
'region.c',
'registry.c',
'resource.c',
'selection.c',
'swaprep.c',
'swapreq.c',
'tables.c',
'touch.c',
'window.c',
]
libxserver_dix = static_library('libxserver_dix',
srcs_dix,
include_directories: inc,
dependencies: common_dep,
)
libxserver_main = static_library('libxserver_main',
'stubmain.c',
include_directories: inc,
dependencies: common_dep,
)
srcs_dri3 = [
'dri3.c',
'dri3_request.c',
'dri3_screen.c',
]
libxserver_dri3 = static_library('libxserver_dri3',
srcs_dri3,
include_directories: inc,
dependencies: common_dep,
c_args: '-DHAVE_XORG_CONFIG_H'
)
srcs_exa = [
'exa.c',
'exa_classic.c',
'exa_migration_classic.c',
'exa_driver.c',
'exa_mixed.c',
'exa_migration_mixed.c',
'exa_accel.c',
'exa_glyphs.c',
'exa_offscreen.c',
'exa_render.c',
'exa_unaccel.c',
]
libxserver_exa = static_library('libxserver_exa',
srcs_exa,
include_directories: inc,
dependencies: common_dep,
c_args: '-DHAVE_XORG_CONFIG_H'
)
if build_xorg
install_data('exa.h', install_dir: xorgsdkdir)
endif
srcs_fb = [
'fballpriv.c',
'fbarc.c',
'fbbits.c',
'fbblt.c',
'fbbltone.c',
'fbcmap_mi.c',
'fbcopy.c',
'fbfill.c',
'fbfillrect.c',
'fbfillsp.c',
'fbgc.c',
'fbgetsp.c',
'fbglyph.c',
'fbimage.c',
'fbline.c',
'fboverlay.c',
'fbpict.c',
'fbpixmap.c',
'fbpoint.c',
'fbpush.c',
'fbscreen.c',
'fbseg.c',
'fbsetsp.c',
'fbsolid.c',
'fbtrap.c',
'fbutil.c',
'fbwindow.c',
]
libxserver_fb = static_library('libxserver_fb',
srcs_fb,
include_directories: inc,
dependencies: common_dep,
pic: true,
)
srcs_glamor = [
'glamor.c',
'glamor_copy.c',
'glamor_core.c',
'glamor_dash.c',
'glamor_font.c',
'glamor_glx.c',
'glamor_composite_glyphs.c',
'glamor_image.c',
'glamor_lines.c',
'glamor_segs.c',
'glamor_render.c',
'glamor_gradient.c',
'glamor_prepare.c',
'glamor_program.c',
'glamor_rects.c',
'glamor_spans.c',
'glamor_text.c',
'glamor_transfer.c',
'glamor_transform.c',
'glamor_trapezoid.c',
'glamor_triangles.c',
'glamor_addtraps.c',
'glamor_glyphblt.c',
'glamor_points.c',
'glamor_pixmap.c',
'glamor_largepixmap.c',
'glamor_picture.c',
'glamor_vbo.c',
'glamor_window.c',
'glamor_fbo.c',
'glamor_compositerects.c',
'glamor_utils.c',
'glamor_sync.c',
]
if build_xv
srcs_glamor += 'glamor_xv.c'
endif
glamor = static_library('glamor',
srcs_glamor,
include_directories: inc,
dependencies: [
common_dep,
dependency('epoxy'),
],
)
glamor_egl_stubs = static_library('glamor_egl_stubs',
'glamor_egl_stubs.c',
include_directories: inc,
dependencies: common_dep,
)
if build_xorg
install_data('glamor.h', install_dir: xorgsdkdir)
endif
srcs_glx = [
'indirect_dispatch.c',
'indirect_dispatch_swap.c',
'indirect_reqsize.c',
'indirect_size_get.c',
'indirect_table.c',
'clientinfo.c',
'createcontext.c',
'extension_string.c',
'indirect_util.c',
'indirect_program.c',
'indirect_texture_compression.c',
'glxcmds.c',
'glxcmdsswap.c',
'glxext.c',
'glxdriswrast.c',
'glxdricommon.c',
'glxscreens.c',
'render2.c',
'render2swap.c',
'renderpix.c',
'renderpixswap.c',
'rensize.c',
'single2.c',
'single2swap.c',
'singlepix.c',
'singlepixswap.c',
'singlesize.c',
'swap_interval.c',
'xfont.c',
]
libxserver_glx = ''
if build_glx
libxserver_glx = static_library('libxserver_glx',
srcs_glx,
include_directories: inc,
dependencies: [
common_dep,
dl_dep,
dependency('glproto', version: '>= 1.4.17'),
dependency('gl', version: '>= 9.2.0'),
],
c_args: [
glx_align64,
# XXX: generated code includes an unused function
'-Wno-unused-function',
]
)
endif
flex = find_program('flex')
bison = find_program('bison')
lgen = generator(
flex,
output : '@PLAINNAME@.yy.c',
arguments : ['-o', '@OUTPUT@', '@INPUT@']
)
lfiles = lgen.process('scanner.l')
pgen = generator(
bison,
output : ['@BASENAME@.c', '@BASENAME@.h'],
arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
)
pfiles = pgen.process('parser.y')
srcs_dmx_config = [
'dmxparse.c',
'dmxprint.c',
'dmxcompat.c',
'dmxconfig.c',
pfiles,
lfiles,
]
dmx_inc = [
inc,
include_directories('../')
]
dmx_c_args = [
'-DHAVE_DMX_CONFIG_H',
'-DDMX_LOG_STANDALONE',
]
dmx_config = static_library('dmx_config',
srcs_dmx_config,
include_directories: dmx_inc,
dependencies: common_dep,
c_args: dmx_c_args,
)
executable('xdmxconfig',
[
'xdmxconfig.c',
'../dmxlog.c',
'Canvas.c',
],
include_directories: [
inc,
include_directories('../')
],
dependencies: [
common_dep,
dependency('xaw7'),
dependency('xmu'),
dependency('xt'),
dependency('xpm'),
dependency('x11'),
],
link_with: dmx_config,
c_args: dmx_c_args,
install: true,
)
executable('vdltodmx',
'vdltodmx.c',
include_directories: dmx_inc,
link_with: dmx_config,
c_args: dmx_c_args,
install: true,
)
executable('dmxtodmx',
'dmxtodmx.c',
include_directories: dmx_inc,
link_with: dmx_config,
c_args: dmx_c_args,
install: true,
)
dmxexamples_dep = [
dependency('xext'),
dependency('x11'),
]
dmx_dep = dependency('dmx', version: '>= 1.0.99.1')
dmx_examples = [
['dmxinfo', [dmx_dep]],
['dmxwininfo', [dmx_dep, dependency('xmu')]],
['dmxreconfig', [dmx_dep]],
['dmxresize', [dmx_dep]],
['dmxaddscreen', [dmx_dep]],
['dmxrmscreen', [dmx_dep]],
['dmxaddinput', [dmx_dep]],
['xinput', [dmx_dep, dependency('xi')]],
['xtest', [dependency('xtst')]],
['evi', []],
['xled', []],
['xbell', []],
['res', [dependency('xres')]],
]
foreach ex: dmx_examples
bin = ex[0]
extra_dep = ex[1]
executable(bin, bin + '.c', dependencies: [dmxexamples_dep, extra_dep])
endforeach
if cc.has_header('linux/input.h')
executable('ev', 'ev.c')
endif
srcs_dmx_glx = [
'compsize.c',
'g_disptab.c',
'global.c',
'glxcmds.c',
'glxcmdsswap.c',
'glxext.c',
'glxfbconfig.c',
'glxscreens.c',
'glxsingle.c',
'glxswap.c',
'glxvendor.c',
'glxvisuals.c',
'g_renderswap.c',
'render2swap.c',
'renderpixswap.c',
]
dmx_glx = static_library('dmx_glx',
srcs_dmx_glx,
include_directories: [
inc,
include_directories('../')
],
dependencies: common_dep,
c_args: ['-DHAVE_DMX_CONFIG_H', glx_align64],
)
srcs_dmx_input = [
'dmxdummy.c',
'dmxbackend.c',
'dmxconsole.c',
'dmxcommon.c',
'dmxinputinit.c',
'dmxarg.c',
'dmxevents.c',
'dmxxinput.c',
'dmxmotion.c',
'dmxmap.c',
'ChkNotMaskEv.c',
]
if cc.has_header('linux/input.h')
srcs_dmx_input += [
'usb-keyboard.c',
'usb-mouse.c',
'usb-other.c',
'usb-common.c',
]
endif
dmx_input = static_library('dmx_input',
srcs_dmx_input,
include_directories: [
inc,
include_directories('../')
],
dependencies: common_dep,
c_args: '-DHAVE_DMX_CONFIG_H',
)
srcs = [
'dmx.c',
'dmxcb.c',
'dmxcmap.c',
'dmxcursor.c',
'dmxdpms.c',
'dmxextension.c',
'dmxfont.c',
'dmxgc.c',
'dmxgcops.c',
'dmxinit.c',
'dmxinput.c',
'dmxlog.c',
'dmxpict.c',
'dmxpixmap.c',
'dmxprop.c',
'dmxscrinit.c',
'dmxstat.c',
'dmxsync.c',
'dmxvisual.c',
'dmxwindow.c',
'../../mi/miinitext.c',
'../../Xext/panoramiX.c',
]
subdir('config')
subdir('input')
subdir('examples')
# XXX: subdir('doc')
# XXX: subdir('doxygen')
# XXX: subdir('man')
dmx_dep = [
common_dep,
dependency('dmxproto', version: '>= 2.2.99.1'),
dependency('xext', version: '>= 1.0.99.4'),
dependency('xau'),
dependency('xmuu'),
dependency('xfixes'),
dependency('xrender'),
dependency('xi', version: '>= 1.2.99.1'),
xdmcp_dep,
dl_dep,
]
dmx_glx = ''
if build_glx
srcs += 'dmx_glxvisuals.c'
subdir('glxProxy')
endif
executable(
'Xdmx',
srcs,
include_directories: inc,
dependencies: dmx_dep,
link_with: [
libxserver_main,
libxserver_fb,
libxserver,
libxserver_xkb_stubs,
dmx_input,
dmx_config,
dmx_glx,
],
c_args: '-DHAVE_DMX_CONFIG_H',
install: true,
)
srcs = [
'ephyr.c',
'ephyrinit.c',
'ephyrcursor.c',
'ephyr_draw.c',
'hostx.c',
'os.c',
]
xephyr_dep = [
common_dep,
dependency('xcb'),
dependency('xcb-shape'),
dependency('xcb-render'),
dependency('xcb-renderutil'),
dependency('xcb-aux'),
dependency('xcb-image'),
dependency('xcb-icccm'),
dependency('xcb-shm'),
dependency('xcb-keysyms'),
dependency('xcb-randr'),
dependency('xcb-xkb'),
]
xephyr_glamor = []
if build_glamor
srcs += 'ephyr_glamor_glx.c'
if build_xv
srcs += 'ephyr_glamor_xv.c'
endif
xephyr_glamor += glamor
xephyr_glamor += glamor_egl_stubs
xephyr_dep += dependency('x11-xcb')
endif
if build_xv
srcs += 'ephyrvideo.c'
xephyr_dep += dependency('xcb-xv')
endif
executable(
'Xephyr',
srcs,
include_directories: [
inc,
include_directories('../src')
],
dependencies: xephyr_dep,
link_with: [
libxserver_main,
libxserver_exa,
xephyr_glamor,
kdrive,
libxserver_fb,
libxserver,
libxserver_config,
libxserver_xkb_stubs,
libxserver_xi_stubs,
libxserver_glx,
],
install: true,
)
subdir('src')
subdir('ephyr')
srcs_kdrive = [
'kcmap.c',
'kdrive.c',
'kinfo.c',
'kinput.c',
'kmode.c',
'kshadow.c',
'../../../mi/miinitext.c',
]
if build_xv
srcs_kdrive += 'kxv.c'
endif
#XXX: libconfig
kdrive = static_library('kdrive',
srcs_kdrive,
include_directories: inc,
dependencies: common_dep,
link_with: libxserver_miext_shadow,
)