summaryrefslogtreecommitdiff
path: root/xserver/hw
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/hw')
-rw-r--r--xserver/hw/kdrive/ephyr/meson.build70
-rw-r--r--xserver/hw/kdrive/meson.build2
-rw-r--r--xserver/hw/kdrive/src/meson.build20
-rw-r--r--xserver/hw/meson.build23
-rw-r--r--xserver/hw/vfb/meson.build29
-rw-r--r--xserver/hw/xfree86/common/meson.build103
-rw-r--r--xserver/hw/xfree86/ddc/meson.build15
-rw-r--r--xserver/hw/xfree86/dixmods/meson.build43
-rw-r--r--xserver/hw/xfree86/doc/meson.build35
-rw-r--r--xserver/hw/xfree86/dri/meson.build23
-rw-r--r--xserver/hw/xfree86/dri2/meson.build16
-rw-r--r--xserver/hw/xfree86/drivers/inputtest/meson.build26
-rw-r--r--xserver/hw/xfree86/drivers/modesetting/meson.build48
-rw-r--r--xserver/hw/xfree86/exa/meson.build15
-rw-r--r--xserver/hw/xfree86/fbdevhw/meson.build23
-rw-r--r--xserver/hw/xfree86/glamor_egl/meson.build22
-rw-r--r--xserver/hw/xfree86/i2c/meson.build12
-rw-r--r--xserver/hw/xfree86/int10/meson.build64
-rw-r--r--xserver/hw/xfree86/loader/meson.build16
-rw-r--r--xserver/hw/xfree86/meson.build234
-rw-r--r--xserver/hw/xfree86/modes/meson.build29
-rw-r--r--xserver/hw/xfree86/os-support/meson.build170
-rw-r--r--xserver/hw/xfree86/parser/meson.build32
-rw-r--r--xserver/hw/xfree86/ramdac/meson.build18
-rw-r--r--xserver/hw/xfree86/shadowfb/meson.build11
-rw-r--r--xserver/hw/xfree86/vgahw/meson.build10
-rw-r--r--xserver/hw/xfree86/x86emu/meson.build15
-rw-r--r--xserver/hw/xnest/meson.build44
-rw-r--r--xserver/hw/xquartz/GL/meson.build5
-rw-r--r--xserver/hw/xquartz/bundle/meson.build59
-rw-r--r--xserver/hw/xquartz/mach-startup/meson.build99
-rw-r--r--xserver/hw/xquartz/meson.build97
-rw-r--r--xserver/hw/xquartz/pbproxy/meson.build31
-rw-r--r--xserver/hw/xquartz/xpr/meson.build18
-rw-r--r--xserver/hw/xwin/dri/meson.build14
-rw-r--r--xserver/hw/xwin/glx/meson.build102
-rw-r--r--xserver/hw/xwin/meson.build184
-rw-r--r--xserver/hw/xwin/winclipboard/meson.build41
38 files changed, 1818 insertions, 0 deletions
diff --git a/xserver/hw/kdrive/ephyr/meson.build b/xserver/hw/kdrive/ephyr/meson.build
new file mode 100644
index 000000000..9e329ba67
--- /dev/null
+++ b/xserver/hw/kdrive/ephyr/meson.build
@@ -0,0 +1,70 @@
+srcs = [
+ 'ephyr.c',
+ 'ephyrinit.c',
+ 'ephyrcursor.c',
+ 'ephyr_draw.c',
+ 'hostx.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', version : '>=1.9.3'),
+ 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')
+ xephyr_dep += epoxy_dep
+endif
+
+if build_xv
+ srcs += 'ephyrvideo.c'
+ xephyr_dep += dependency('xcb-xv')
+endif
+
+xephyr_server = 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,
+ libglxvnd,
+ ],
+ install: true,
+)
+
+xephyr_man = configure_file(
+ input: 'man/Xephyr.man',
+ output: 'Xephyr.1',
+ configuration: manpage_config,
+)
+install_man(xephyr_man)
diff --git a/xserver/hw/kdrive/meson.build b/xserver/hw/kdrive/meson.build
new file mode 100644
index 000000000..16341e228
--- /dev/null
+++ b/xserver/hw/kdrive/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('ephyr')
diff --git a/xserver/hw/kdrive/src/meson.build b/xserver/hw/kdrive/src/meson.build
new file mode 100644
index 000000000..fbc0727e9
--- /dev/null
+++ b/xserver/hw/kdrive/src/meson.build
@@ -0,0 +1,20 @@
+srcs_kdrive = [
+ 'kcmap.c',
+ 'kdrive.c',
+ 'kinfo.c',
+ 'kinput.c',
+ 'kshadow.c',
+ '../../../mi/miinitext.c',
+ '../../../mi/miinitext.h',
+]
+
+if build_xv
+ srcs_kdrive += 'kxv.c'
+endif
+
+kdrive = static_library('kdrive',
+ srcs_kdrive,
+ include_directories: inc,
+ dependencies: common_dep,
+ link_with: libxserver_miext_shadow,
+)
diff --git a/xserver/hw/meson.build b/xserver/hw/meson.build
new file mode 100644
index 000000000..f8bd28a25
--- /dev/null
+++ b/xserver/hw/meson.build
@@ -0,0 +1,23 @@
+if get_option('xephyr')
+ subdir('kdrive')
+endif
+
+if get_option('xvfb')
+ subdir('vfb')
+endif
+
+if build_xnest
+ subdir('xnest')
+endif
+
+if build_xorg
+ subdir('xfree86')
+endif
+
+if build_xquartz
+ subdir('xquartz')
+endif
+
+if build_xwin
+ subdir('xwin')
+endif
diff --git a/xserver/hw/vfb/meson.build b/xserver/hw/vfb/meson.build
new file mode 100644
index 000000000..7332866b3
--- /dev/null
+++ b/xserver/hw/vfb/meson.build
@@ -0,0 +1,29 @@
+srcs = [
+ 'InitInput.c',
+ 'InitOutput.c',
+ '../../mi/miinitext.c',
+ '../../mi/miinitext.h',
+]
+
+xvfb_server = executable(
+ 'Xvfb',
+ srcs,
+ include_directories: inc,
+ dependencies: common_dep,
+ link_with: [
+ libxserver_main,
+ libxserver_fb,
+ libxserver,
+ libxserver_xkb_stubs,
+ libxserver_xi_stubs,
+ libxserver_glx,
+ libglxvnd,
+ ],
+ install: true,
+)
+
+install_man(configure_file(
+ input: 'man/Xvfb.man',
+ output: 'Xvfb.1',
+ configuration: manpage_config,
+))
diff --git a/xserver/hw/xfree86/common/meson.build b/xserver/hw/xfree86/common/meson.build
new file mode 100644
index 000000000..7dc19c6f9
--- /dev/null
+++ b/xserver/hw/xfree86/common/meson.build
@@ -0,0 +1,103 @@
+srcs_xorg_common = [
+ 'xf86fbBus.c',
+ 'xf86noBus.c',
+ 'xf86Configure.c',
+ 'xf86Bus.c',
+ 'xf86Config.c',
+ 'xf86Cursor.c',
+ 'xf86DPMS.c',
+ 'xf86Events.c',
+ 'xf86Globals.c',
+ 'xf86AutoConfig.c',
+ 'xf86Option.c',
+ 'xf86Init.c',
+ 'xf86VidMode.c',
+ 'xf86fbman.c',
+ 'xf86cmap.c',
+ 'xf86Helper.c',
+ 'xf86PM.c',
+ 'xf86RandR.c',
+ 'xf86Xinput.c',
+ 'xisb.c',
+ 'xf86Mode.c',
+ 'xorgHelper.c',
+ 'xf86Extensions.c',
+]
+
+xorg_sdk_headers = [
+ 'compiler.h',
+ 'xf86.h',
+ 'xf86Module.h',
+ 'xf86Opt.h',
+ 'xf86PciInfo.h',
+ 'xf86Priv.h',
+ 'xf86Privstr.h',
+ 'xf86cmap.h',
+ 'xf86fbman.h',
+ 'xf86str.h',
+ 'xf86Xinput.h',
+ 'xisb.h',
+ 'xorgVersion.h',
+ 'xf86sbusBus.h',
+ 'xf86VGAarbiter.h',
+ 'xf86Optionstr.h',
+ 'xf86platformBus.h',
+ 'xf86MatchDrivers.h',
+ 'xaarop.h',
+]
+
+fallback_driver = get_option('fallback_input_driver')
+if fallback_driver == 'auto'
+ if host_machine.system() == 'linux'
+ fallback_driver = 'libinput'
+ else
+ fallback_driver = ''
+ endif
+endif
+
+if build_dga
+ srcs_xorg_common += 'xf86DGA.c'
+ xorg_sdk_headers += 'dgaproc.h'
+endif
+
+if build_xv
+ srcs_xorg_common += ['xf86xv.c', 'xf86xvmc.c']
+ xorg_sdk_headers += ['xf86xv.h', 'xf86xvmc.h', 'xf86xvpriv.h']
+endif
+
+if build_udev
+ srcs_xorg_common += 'xf86platformBus.c'
+endif
+
+if get_option('pciaccess')
+ srcs_xorg_common += ['xf86pciBus.c', 'xf86VGAarbiter.c']
+
+ if host_machine.cpu() == 'sparc' or host_machine.cpu() == 'sparc64'
+ srcs_xorg_common += 'xf86sbusBus.c'
+ endif
+endif
+
+srcs_xorg_common += custom_target(
+ 'xf86DefModeSet.c',
+ output: 'xf86DefModeSet.c',
+ input: ['modeline2c.awk', 'vesamodes', 'extramodes'],
+ command: [find_program('awk'), '-f', '@INPUT0@', '@INPUT1@', '@INPUT2@'],
+ capture: true,
+)
+
+xorg_common = static_library('xorg_common',
+ srcs_xorg_common,
+ include_directories: [inc, xorg_inc, top_dir_inc],
+ dependencies: [
+ common_dep,
+ dbus_dep,
+ pciaccess_dep,
+ libdrm_dep,
+ ],
+ c_args: [
+ xorg_c_args,
+ '-DFALLBACK_INPUT_DRIVER="@0@"'.format(fallback_driver)
+ ],
+)
+
+install_data(xorg_sdk_headers, install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/ddc/meson.build b/xserver/hw/xfree86/ddc/meson.build
new file mode 100644
index 000000000..c9b816f2e
--- /dev/null
+++ b/xserver/hw/xfree86/ddc/meson.build
@@ -0,0 +1,15 @@
+srcs_xorg_ddc = [
+ 'ddc.c',
+ 'interpret_edid.c',
+ 'print_edid.c',
+ 'ddcProperty.c',
+]
+
+xorg_ddc = static_library('xorg_ddc',
+ srcs_xorg_ddc,
+ include_directories: [inc, xorg_inc],
+ dependencies: common_dep,
+ c_args: xorg_c_args,
+)
+
+install_data(['edid.h', 'xf86DDC.h'], install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/dixmods/meson.build b/xserver/hw/xfree86/dixmods/meson.build
new file mode 100644
index 000000000..a1afbe8b9
--- /dev/null
+++ b/xserver/hw/xfree86/dixmods/meson.build
@@ -0,0 +1,43 @@
+shared_module(
+ 'wfb',
+ 'fbmodule.c',
+
+ include_directories: [inc, xorg_inc],
+ c_args: [ xorg_c_args, wfb_args ],
+ dependencies: common_dep,
+ link_whole: libxserver_wfb,
+ link_with: e,
+
+ install: true,
+ install_dir: module_dir,
+)
+
+shared_module(
+ 'shadow',
+ 'shmodule.c',
+
+ include_directories: [inc, xorg_inc],
+ c_args: xorg_c_args,
+ dependencies: common_dep,
+ link_whole: libxserver_miext_shadow,
+ link_with: e,
+
+ install: true,
+ install_dir: module_dir,
+)
+
+if build_glx
+ shared_module(
+ 'glx',
+ [ 'glxmodule.c', srcs_glxdri2 ],
+
+ include_directories: [ inc, xorg_inc, glx_inc ],
+ c_args: [ xorg_c_args, glx_align64 ],
+ dependencies: [ common_dep, dl_dep, dri_dep ],
+ link_whole: libxserver_glx,
+ link_with: e,
+
+ install: true,
+ install_dir: join_paths(module_dir, 'extensions')
+ )
+endif
diff --git a/xserver/hw/xfree86/doc/meson.build b/xserver/hw/xfree86/doc/meson.build
new file mode 100644
index 000000000..df1d5e215
--- /dev/null
+++ b/xserver/hw/xfree86/doc/meson.build
@@ -0,0 +1,35 @@
+
+if build_docs_devel
+ basename = 'ddxDesign'
+ input_xml = basename + '.xml'
+
+ custom_target(
+ basename + '.html',
+ output: basename + '.html',
+ input: [input_xml],
+ command: [xmlto] + docs_xmlto_search_flags + [
+ '-x', join_paths(doc_stylesheet_srcdir, 'xorg-xhtml.xsl'),
+ '-o', meson.current_build_dir(),
+ 'xhtml-nochunks', '@INPUT0@'],
+ build_by_default: true,
+ install: false,
+ )
+
+ if build_docs_pdf
+ foreach format : ['ps', 'pdf']
+ output_fn = basename + '.' + format
+ custom_target(
+ output_fn,
+ output: output_fn,
+ input: [input_xml],
+ command: [xmlto] + docs_xmlto_search_flags + [
+ '-x', join_paths(doc_stylesheet_srcdir, 'xorg-fo.xsl'),
+ '--stringparam', 'img.src.path=' + meson.current_build_dir(),
+ '-o', meson.current_build_dir(),
+ '--with-fop', format, '@INPUT0@'],
+ build_by_default: true,
+ install: false,
+ )
+ endforeach
+ endif
+endif
diff --git a/xserver/hw/xfree86/dri/meson.build b/xserver/hw/xfree86/dri/meson.build
new file mode 100644
index 000000000..53d1e4f26
--- /dev/null
+++ b/xserver/hw/xfree86/dri/meson.build
@@ -0,0 +1,23 @@
+srcs_xorg_dri = [
+ 'dri.c',
+ 'xf86dri.c',
+]
+
+xorg_dri = static_library('xorg_dri',
+ srcs_xorg_dri,
+ include_directories: [inc, xorg_inc],
+ dependencies: [
+ common_dep,
+ libdrm_dep,
+ ],
+ c_args: xorg_c_args,
+)
+
+install_data(
+ [
+ 'dri.h',
+ 'sarea.h',
+ 'dristruct.h',
+ ],
+ install_dir: xorgsdkdir,
+)
diff --git a/xserver/hw/xfree86/dri2/meson.build b/xserver/hw/xfree86/dri2/meson.build
new file mode 100644
index 000000000..087a21131
--- /dev/null
+++ b/xserver/hw/xfree86/dri2/meson.build
@@ -0,0 +1,16 @@
+srcs_xorg_dri2 = [
+ 'dri2.c',
+ 'dri2ext.c',
+]
+
+xorg_dri2 = static_library('xorg_dri2',
+ srcs_xorg_dri2,
+ include_directories: [inc, xorg_inc],
+ dependencies: [
+ common_dep,
+ libdrm_dep,
+ ],
+ c_args: xorg_c_args,
+)
+
+install_data('dri2.h', install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/drivers/inputtest/meson.build b/xserver/hw/xfree86/drivers/inputtest/meson.build
new file mode 100644
index 000000000..fa642c89f
--- /dev/null
+++ b/xserver/hw/xfree86/drivers/inputtest/meson.build
@@ -0,0 +1,26 @@
+inputtestdrv_srcs = [
+ 'xf86-input-inputtest.c',
+]
+
+shared_module(
+ 'inputtest_drv',
+ inputtestdrv_srcs,
+ name_prefix: '',
+
+ include_directories: [inc, xorg_inc],
+ c_args: xorg_c_args,
+ dependencies: [common_dep],
+
+ install: true,
+ install_dir: join_paths(module_dir, 'input'),
+
+ link_with: e,
+)
+
+install_man(configure_file(
+ input: 'inputtestdrv.man',
+ output: 'inputtestdrv.4',
+ configuration: manpage_config,
+))
+
+install_data('xf86-input-inputtest-protocol.h', install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/drivers/modesetting/meson.build b/xserver/hw/xfree86/drivers/modesetting/meson.build
new file mode 100644
index 000000000..02852a716
--- /dev/null
+++ b/xserver/hw/xfree86/drivers/modesetting/meson.build
@@ -0,0 +1,48 @@
+modesetting_srcs = [
+ 'dri2.c',
+ 'driver.c',
+ 'drmmode_display.c',
+ 'dumb_bo.c',
+ 'pageflip.c',
+ 'present.c',
+ 'vblank.c',
+]
+
+shared_module(
+ 'modesetting_drv',
+ modesetting_srcs,
+ name_prefix: '',
+
+ include_directories: [inc, xorg_inc],
+ c_args: xorg_c_args,
+ dependencies: [
+ common_dep,
+ udev_dep,
+ libdrm_dep,
+ gbm_dep,
+ ],
+
+ install: true,
+ install_dir: join_paths(module_dir, 'drivers'),
+)
+
+# Test that we don't have any unresolved symbols from our module to Xorg.
+xorg_build_root = join_paths(meson.build_root(), 'hw', 'xfree86')
+symbol_test_args = []
+symbol_test_args += join_paths(xorg_build_root, 'libxorgserver.so')
+symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libshadow.so')
+if gbm_dep.found()
+ symbol_test_args += join_paths(xorg_build_root, 'glamor_egl', 'libglamoregl.so')
+endif
+symbol_test_args += join_paths(xorg_build_root, 'drivers', 'modesetting', 'modesetting_drv.so')
+
+install_man(configure_file(
+ input: 'modesetting.man',
+ output: 'modesetting.4',
+ configuration: manpage_config,
+))
+
+test('modesetting symbol test',
+ xorg_symbol_test,
+ args: symbol_test_args,
+)
diff --git a/xserver/hw/xfree86/exa/meson.build b/xserver/hw/xfree86/exa/meson.build
new file mode 100644
index 000000000..75a5d429e
--- /dev/null
+++ b/xserver/hw/xfree86/exa/meson.build
@@ -0,0 +1,15 @@
+xorg_exa = shared_module('exa',
+ 'examodule.c',
+ include_directories: [inc, xorg_inc],
+ dependencies: common_dep,
+ link_with: [libxserver_exa, e],
+ c_args: xorg_c_args,
+ install: true,
+ install_dir: module_dir,
+)
+
+install_man(configure_file(
+ input: 'man/exa.man',
+ output: 'exa.4',
+ configuration: manpage_config,
+))
diff --git a/xserver/hw/xfree86/fbdevhw/meson.build b/xserver/hw/xfree86/fbdevhw/meson.build
new file mode 100644
index 000000000..f3146f3c9
--- /dev/null
+++ b/xserver/hw/xfree86/fbdevhw/meson.build
@@ -0,0 +1,23 @@
+if host_machine.system() == 'linux'
+ srcs_fbdevhw = 'fbdevhw.c'
+else
+ srcs_fbdevhw = 'fbdevhwstub.c'
+endif
+
+shared_module('fbdevhw',
+ srcs_fbdevhw,
+ include_directories: [ inc, xorg_inc ],
+ dependencies: common_dep,
+ c_args: xorg_c_args,
+ install: true,
+ install_dir: module_dir,
+ link_with: e,
+)
+
+install_data('fbdevhw.h', install_dir: xorgsdkdir)
+
+install_man(configure_file(
+ input: 'man/fbdevhw.man',
+ output: 'fbdevhw.4',
+ configuration: manpage_config,
+))
diff --git a/xserver/hw/xfree86/glamor_egl/meson.build b/xserver/hw/xfree86/glamor_egl/meson.build
new file mode 100644
index 000000000..7eae05812
--- /dev/null
+++ b/xserver/hw/xfree86/glamor_egl/meson.build
@@ -0,0 +1,22 @@
+glamoregl_src = [
+ '../../../glamor/glamor_egl.c',
+ '../../../glamor/glamor_eglmodule.c',
+ 'glamor_xf86_xv.c',
+]
+
+shared_module(
+ 'glamoregl',
+ glamoregl_src,
+
+ include_directories: [inc, xorg_inc],
+ c_args: xorg_c_args,
+ dependencies: [
+ common_dep,
+ dependency('libdrm', version: '>= 2.4.46'),
+ gbm_dep,
+ ],
+ link_with: glamor,
+
+ install: true,
+ install_dir: module_dir,
+)
diff --git a/xserver/hw/xfree86/i2c/meson.build b/xserver/hw/xfree86/i2c/meson.build
new file mode 100644
index 000000000..d22860e9e
--- /dev/null
+++ b/xserver/hw/xfree86/i2c/meson.build
@@ -0,0 +1,12 @@
+srcs_xorg_i2c = [
+ 'xf86i2c.c'
+]
+
+xorg_i2c = static_library('xorg_i2c',
+ srcs_xorg_i2c,
+ include_directories: [inc, xorg_inc],
+ dependencies: common_dep,
+ c_args: xorg_c_args,
+)
+
+install_data(['xf86i2c.h', 'i2c_def.h'], install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/int10/meson.build b/xserver/hw/xfree86/int10/meson.build
new file mode 100644
index 000000000..a309e9b53
--- /dev/null
+++ b/xserver/hw/xfree86/int10/meson.build
@@ -0,0 +1,64 @@
+srcs_xorg_int10 = [
+ 'vbe.c',
+ 'vbeModes.c',
+ 'helper_exec.c',
+ 'helper_mem.c',
+ 'xf86int10.c',
+ 'xf86int10module.c',
+]
+
+int10_c_args = [xorg_c_args]
+int10_link = []
+
+if host_machine.cpu() == 'i386' or host_machine.cpu() == 'x86_64'
+ int10_c_args += '-D_PC'
+endif
+
+if int10 == 'stub'
+ srcs_xorg_int10 += 'stub.c'
+ int10_c_args += '-D_VM86_LINUX'
+endif
+
+if int10 == 'x86emu'
+ srcs_xorg_int10 += [
+ 'generic.c',
+ 'xf86x86emu.c',
+ 'x86emu.c',
+ ]
+ int10_c_args += '-D_X86EMU'
+ int10_c_args += '-DNO_SYS_HEADERS'
+
+ # Silence some useless warnings from x86emu
+ if cc.has_argument('-Wno-format-nonliteral')
+ int10_c_args += '-Wno-format-nonliteral'
+ endif
+
+ int10_link += xorg_x86emu
+endif
+
+if int10 == 'vm86'
+ srcs_xorg_int10 += [
+ 'vm86/linux_vm86.c',
+ 'linux.c',
+ ]
+ int10_c_args += '-D_VM86_LINUX'
+endif
+
+xorg_int10 = shared_module('int10',
+ srcs_xorg_int10,
+ include_directories: [
+ inc,
+ xorg_inc,
+ include_directories('../x86emu')
+ ],
+ dependencies: common_dep,
+ link_with: int10_link,
+ c_args: int10_c_args,
+
+ install: true,
+ install_dir: module_dir,
+)
+
+install_data('xf86int10.h', install_dir: xorgsdkdir)
+install_data('vbe.h', install_dir: xorgsdkdir)
+install_data('vbeModes.h', install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/loader/meson.build b/xserver/hw/xfree86/loader/meson.build
new file mode 100644
index 000000000..533c4f15c
--- /dev/null
+++ b/xserver/hw/xfree86/loader/meson.build
@@ -0,0 +1,16 @@
+srcs_xorg_loader = [
+ 'loader.c',
+ 'loadmod.c',
+]
+
+xorg_loader = static_library('xorg_loader',
+ srcs_xorg_loader,
+ include_directories: [inc, xorg_inc],
+ dependencies: [common_dep, dl_dep],
+ c_args: xorg_c_args,
+)
+
+xorg_symbol_test = executable('xorg_symbol_test',
+ 'symbol-test.c',
+ dependencies: dl_dep,
+)
diff --git a/xserver/hw/xfree86/meson.build b/xserver/hw/xfree86/meson.build
new file mode 100644
index 000000000..c4db85cdb
--- /dev/null
+++ b/xserver/hw/xfree86/meson.build
@@ -0,0 +1,234 @@
+xorg_inc = include_directories(
+ 'common',
+ 'ddc',
+ 'dri2',
+ 'i2c',
+ 'int10',
+ 'loader',
+ 'modes',
+ 'os-support',
+ 'os-support/bus',
+ 'parser',
+ 'ramdac',
+ 'vgahw',
+)
+
+xorg_c_args = []
+xorg_c_args += '-DHAVE_XORG_CONFIG_H'
+xorg_c_args += '-DXORG_NO_SDKSYMS'
+
+pciaccess_dep = []
+if get_option('pciaccess')
+ pciaccess_dep = dependency('pciaccess', version: '>= 0.12.901')
+endif
+
+# subdirs for convenience libraries statically linked into Xorg
+subdir('common')
+subdir('ddc')
+if build_dri1
+ subdir('dri')
+endif
+if build_dri2
+ subdir('dri2')
+endif
+subdir('i2c')
+subdir('loader')
+subdir('modes')
+subdir('os-support')
+subdir('parser')
+subdir('ramdac')
+subdir('xkb')
+
+srcs_xorg = [
+ '../../mi/miinitext.c',
+ '../../mi/miinitext.h',
+]
+
+# Extract all the objects so that all symbols get brought into the
+# server. This prevents us from needing a global table of all symbols
+# that should be exported to Xorg modules, at the expense of all
+# symbols being included and public
+
+xorg_link = [
+ libxserver,
+ libglxvnd,
+ xorg_common,
+ xorg_loader,
+ xorg_ddc,
+ xorg_xkb,
+ xorg_i2c,
+ xorg_modes,
+ xorg_os_support,
+ xorg_parser,
+ xorg_ramdac,
+ libxserver_fb,
+ libxserver_xext_vidmode,
+ libxserver_main,
+ libxserver_config,
+]
+if build_dri1
+ xorg_link += xorg_dri
+endif
+if build_dri2
+ xorg_link += xorg_dri2
+endif
+
+if host_machine.system() == 'cygwin' or host_machine.system() == 'windows'
+ linker_export_flags = '-Wl,--export-all-symbols'
+elif host_machine.system() == 'sunos' or host_machine.system() == 'darwin'
+ linker_export_flags = []
+else
+ linker_export_flags = '-Wl,--export-dynamic'
+endif
+
+xorg_deps = [
+ pixman_dep,
+ m_dep,
+ dl_dep,
+ pciaccess_dep,
+ sha1_dep,
+ dependency('xau'),
+ xdmcp_dep,
+ xfont2_dep,
+ xshmfence_dep,
+ config_dep,
+ libdrm_dep,
+]
+
+if get_option('suid_wrapper')
+ xorg_install_dir = get_option('libexecdir')
+else
+ xorg_install_dir = get_option('bindir')
+endif
+
+e = executable(
+ 'Xorg',
+ srcs_xorg,
+ include_directories: [inc, xorg_inc],
+ link_whole: xorg_link,
+ dependencies: xorg_deps,
+ link_args: linker_export_flags,
+ c_args: xorg_c_args,
+ install: true,
+ install_dir: xorg_install_dir,
+ implib: true,
+)
+
+# subdirs for modules loadable by Xorg
+subdir('dixmods')
+subdir('exa')
+subdir('fbdevhw')
+if gbm_dep.found()
+ subdir('glamor_egl')
+endif
+if int10 != 'false'
+ if int10 == 'x86emu'
+ subdir('x86emu')
+ endif
+ subdir('int10')
+endif
+subdir('shadowfb')
+if build_vgahw
+ subdir('vgahw')
+endif
+if build_modesetting
+ subdir('drivers/modesetting')
+endif
+if get_option('xf86-input-inputtest')
+ subdir('drivers/inputtest')
+endif
+
+meson.add_install_script(
+ 'sh', '-c',
+ 'ln -fs Xorg @0@@1@'.format(
+ '${DESTDIR}',
+ join_paths(get_option('prefix'), get_option('bindir'), 'X')))
+
+if get_option('suid_wrapper')
+ executable('Xorg.wrap',
+ 'xorg-wrapper.c',
+ include_directories: [inc, xorg_inc],
+ dependencies: xorg_deps,
+ c_args: xorg_c_args,
+ install: true,
+ install_dir: get_option('libexecdir'),
+ install_mode: ['r-sr-xr-x', 0, 0],
+ )
+
+ # meson gets confused when there are two targets of the same name
+ # within the same directory, so we use a different intermediate name.
+ xorg_sh = configure_file(
+ input: 'Xorg.sh.in',
+ output: 'Xorg.sh',
+ configuration: conf_data,
+ )
+
+ install_data(
+ xorg_sh,
+ install_mode: 'rwxr-xr-x',
+ install_dir: join_paths(get_option('prefix'), get_option('bindir')),
+ rename: ['Xorg']
+ )
+endif
+
+executable('gtf',
+ 'utils/gtf/gtf.c',
+ include_directories: [inc, xorg_inc],
+ dependencies: xorg_deps,
+ c_args: xorg_c_args,
+ install: true,
+)
+
+# For symbol presence testing only
+xorgserver_lib = shared_library(
+ 'xorgserver',
+ srcs_xorg,
+ include_directories: [inc, xorg_inc],
+ link_whole: xorg_link,
+ dependencies: xorg_deps,
+ link_args: linker_export_flags,
+ c_args: xorg_c_args,
+ install: false,
+)
+
+xorgserver_dep = declare_dependency(link_with: xorgserver_lib)
+
+install_man(configure_file(
+ input: 'man/Xorg.man',
+ output: 'Xorg.1',
+ configuration: manpage_config,
+))
+
+if get_option('suid_wrapper')
+ install_man(configure_file(
+ input: 'man/Xorg.wrap.man',
+ output: 'Xorg.wrap.1',
+ configuration: manpage_config,
+ ))
+
+ install_man(configure_file(
+ input: 'man/Xwrapper.config.man',
+ output: 'Xwrapper.config.5',
+ configuration: manpage_config,
+ ))
+endif
+
+install_man(configure_file(
+ input: 'man/xorg.conf.man',
+ output: 'xorg.conf.5',
+ configuration: manpage_config,
+))
+
+install_man(configure_file(
+ input: 'man/xorg.conf.d.man',
+ output: 'xorg.conf.d.5',
+ configuration: manpage_config,
+))
+
+install_man(configure_file(
+ input: 'utils/man/gtf.man',
+ output: 'gtf.1',
+ configuration: manpage_config,
+))
+
+subdir('doc')
diff --git a/xserver/hw/xfree86/modes/meson.build b/xserver/hw/xfree86/modes/meson.build
new file mode 100644
index 000000000..8a40018ca
--- /dev/null
+++ b/xserver/hw/xfree86/modes/meson.build
@@ -0,0 +1,29 @@
+srcs_xorg_modes = [
+ 'xf86Crtc.c',
+ 'xf86Cursors.c',
+ 'xf86gtf.c',
+ 'xf86EdidModes.c',
+ 'xf86Modes.c',
+ 'xf86RandR12.c',
+ 'xf86Rotate.c',
+]
+
+if build_dga
+ srcs_xorg_modes += 'xf86DiDGA.c'
+endif
+
+xorg_modes = static_library('xorg_modes',
+ srcs_xorg_modes,
+ include_directories: [ inc, xorg_inc ],
+ dependencies: [ common_dep, libxcvt_dep ],
+ c_args: xorg_c_args,
+)
+
+install_data(
+ [
+ 'xf86Crtc.h',
+ 'xf86Modes.h',
+ 'xf86RandR12.h',
+ ],
+ install_dir: xorgsdkdir,
+)
diff --git a/xserver/hw/xfree86/os-support/meson.build b/xserver/hw/xfree86/os-support/meson.build
new file mode 100644
index 000000000..b6069ee85
--- /dev/null
+++ b/xserver/hw/xfree86/os-support/meson.build
@@ -0,0 +1,170 @@
+srcs_xorg_os_support = [
+ 'bus/nobus.c',
+ 'shared/posix_tty.c',
+ 'shared/sigio.c',
+ 'shared/vidmem.c',
+]
+
+hdrs_xorg_os_support = [
+ 'bus/xf86Pci.h',
+ 'xf86_OSlib.h',
+ 'xf86_OSproc.h'
+]
+
+os_dep = []
+os_c_args = []
+
+if get_option('pciaccess')
+ srcs_xorg_os_support += 'bus/Pci.c'
+ if host_machine.system() != 'linux'
+ srcs_xorg_os_support += 'bus/bsd_pci.c'
+ endif
+ if host_machine.cpu() == 'sparc' or host_machine.cpu() == 'sparc64'
+ srcs_xorg_os_support += 'bus/Sbus.c'
+ install_data('bus/xf86Sbus.h', install_dir: xorgsdkdir)
+ endif
+endif
+
+if get_option('agp') == 'auto'
+ build_agp = cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h') or cc.has_header('linux/agpgart.h')
+else
+ build_agp = get_option('agp') == 'true'
+endif
+
+if host_machine.system() == 'linux'
+ srcs_xorg_os_support += [
+ 'linux/lnx_bell.c',
+ 'linux/lnx_init.c',
+ 'linux/lnx_kmod.c',
+ 'linux/lnx_platform.c',
+ 'linux/lnx_video.c',
+ 'misc/SlowBcopy.c',
+ 'shared/VTsw_usl.c',
+ ]
+ if build_agp
+ srcs_xorg_os_support += 'linux/lnx_agp.c'
+ else
+ srcs_xorg_os_support += 'shared/agp_noop.c'
+ endif
+ if build_systemd_logind
+ srcs_xorg_os_support += 'linux/systemd-logind.c'
+ endif
+
+ # this is ugly because the code is also
+ if build_apm or build_acpi
+ srcs_xorg_os_support += 'linux/lnx_apm.c'
+ if build_acpi
+ srcs_xorg_os_support += 'linux/lnx_acpi.c'
+ endif
+ else
+ srcs_xorg_os_support += 'shared/pm_noop.c'
+ endif
+
+elif host_machine.system() == 'sunos'
+ srcs_xorg_os_support += [
+ 'solaris/sun_apm.c',
+ 'solaris/sun_bell.c',
+ 'solaris/sun_init.c',
+ 'solaris/sun_vid.c',
+ 'shared/kmod_noop.c',
+ ]
+
+ if cc.has_header('sys/vt.h')
+ srcs_xorg_os_support += 'solaris/sun_VTsw.c'
+ else
+ srcs_xorg_os_support += 'shared/VTsw_noop.c'
+ endif
+
+ if build_agp
+ srcs_xorg_os_support += 'solaris/sun_agp.c'
+ else
+ srcs_xorg_os_support += 'shared/agp_noop.c'
+ endif
+
+ if host_machine.cpu_family() == 'sparc'
+ srcs_xorg_os_support += 'solaris/solaris-sparcv8plus.S'
+ elif host_machine.cpu_family() == 'x86_64'
+ srcs_xorg_os_support += 'solaris/solaris-amd64.S'
+ elif host_machine.cpu_family() == 'x86'
+ srcs_xorg_os_support += 'solaris/solaris-ia32.S'
+ else
+ error('Unknown CPU family for Solaris build')
+ endif
+
+elif host_machine.system().endswith('bsd')
+ srcs_xorg_os_support += [
+ 'bsd/bsd_VTsw.c',
+ 'bsd/bsd_bell.c',
+ 'bsd/bsd_init.c',
+ 'shared/pm_noop.c'
+ ]
+
+ if host_machine.cpu_family() == 'x86_64'
+ srcs_xorg_os_support += 'bsd/i386_video.c'
+ if host_machine.system() == 'netbsd'
+ os_dep += cc.find_library('x86_64')
+ elif host_machine.system() == 'openbsd'
+ os_dep += cc.find_library('amd64')
+ endif
+ elif host_machine.cpu_family() == 'x86'
+ srcs_xorg_os_support += 'bsd/i386_video.c'
+ if host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd'
+ os_dep += cc.find_library('i386')
+ endif
+ elif host_machine.cpu_family() == 'arm'
+ srcs_xorg_os_support += 'bsd/arm_video.c'
+ elif host_machine.cpu_family() == 'powerpc'
+ srcs_xorg_os_support += 'bsd/ppc_video.c'
+ elif host_machine.cpu_family() == 'sparc64'
+ srcs_xorg_os_support += 'bsd/sparc64_video.c'
+ srcs_xorg_os_support += 'shared/ioperm_noop.c'
+ elif host_machine.cpu_family() == 'alpha'
+ srcs_xorg_os_support += 'bsd/alpha_video.c'
+ if host_machine.system() == 'freebsd'
+ os_dep += cc.find_library('io')
+ elif host_machine.system() == 'netbsd'
+ os_c_args += '-DUSE_ALPHA_PIO'
+ endif
+ endif
+
+ if host_machine.system() == 'freebsd'
+ srcs_xorg_os_support += 'bsd/bsd_kmod.c'
+ else
+ srcs_xorg_os_support += 'shared/kmod_noop.c'
+ endif
+
+ if build_agp
+ srcs_xorg_os_support += 'linux/lnx_agp.c'
+ else
+ srcs_xorg_os_support += 'shared/agp_noop.c'
+ endif
+else
+ # stub ossupport
+ srcs_xorg_os_support += [
+ 'shared/VTsw_noop.c',
+ 'shared/agp_noop.c',
+ 'shared/ioperm_noop.c',
+ 'shared/kmod_noop.c',
+ 'shared/pm_noop.c',
+ 'shared/vidmem.c',
+ 'shared/posix_tty.c',
+ 'shared/sigio.c',
+ 'stub/stub_bell.c',
+ 'stub/stub_init.c',
+ 'stub/stub_video.c',
+ ]
+endif
+
+xorg_os_support = static_library('xorg_os_support',
+ srcs_xorg_os_support,
+ include_directories: [inc, xorg_inc],
+ dependencies: [
+ common_dep,
+ dbus_dep,
+ libdrm_dep,
+ os_dep,
+ ],
+ c_args: xorg_c_args + os_c_args,
+)
+
+install_data(hdrs_xorg_os_support, install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/parser/meson.build b/xserver/hw/xfree86/parser/meson.build
new file mode 100644
index 000000000..031dc2bec
--- /dev/null
+++ b/xserver/hw/xfree86/parser/meson.build
@@ -0,0 +1,32 @@
+srcs_xorg_parser = [
+ 'Device.c',
+ 'Files.c',
+ 'Flags.c',
+ 'Input.c',
+ 'InputClass.c',
+ 'OutputClass.c',
+ 'Layout.c',
+ 'Module.c',
+ 'Video.c',
+ 'Monitor.c',
+ 'Pointer.c',
+ 'Screen.c',
+ 'Vendor.c',
+ 'read.c',
+ 'scan.c',
+ 'write.c',
+ 'DRI.c',
+ 'Extensions.c',
+]
+
+xorg_parser = static_library('xorg_parser',
+ srcs_xorg_parser,
+ include_directories: [inc, xorg_inc],
+ dependencies: common_dep,
+ c_args: [
+ xorg_c_args,
+ '-DDATADIR="' + join_paths(get_option('prefix'), get_option('datadir')) + '"',
+ ],
+)
+
+install_data(['xf86Parser.h', 'xf86Optrec.h'], install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/ramdac/meson.build b/xserver/hw/xfree86/ramdac/meson.build
new file mode 100644
index 000000000..0a2bb4b79
--- /dev/null
+++ b/xserver/hw/xfree86/ramdac/meson.build
@@ -0,0 +1,18 @@
+srcs_xorg_ramdac = [
+ 'xf86CursorRD.c',
+ 'xf86HWCurs.c',
+]
+
+xorg_ramdac = static_library('xorg_ramdac',
+ srcs_xorg_ramdac,
+ include_directories: [inc, xorg_inc],
+ dependencies: common_dep,
+ c_args: xorg_c_args,
+)
+
+install_data(
+ [
+ 'xf86Cursor.h',
+ ],
+ install_dir: xorgsdkdir,
+)
diff --git a/xserver/hw/xfree86/shadowfb/meson.build b/xserver/hw/xfree86/shadowfb/meson.build
new file mode 100644
index 000000000..7ecc9bc30
--- /dev/null
+++ b/xserver/hw/xfree86/shadowfb/meson.build
@@ -0,0 +1,11 @@
+shared_module('shadowfb',
+ [ 'shadowfb.c', 'sfbmodule.c'],
+ include_directories: [ inc, xorg_inc ],
+ dependencies: common_dep,
+ c_args: xorg_c_args,
+ install: true,
+ install_dir: module_dir,
+ link_with: e,
+)
+
+install_data('shadowfb.h', install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/vgahw/meson.build b/xserver/hw/xfree86/vgahw/meson.build
new file mode 100644
index 000000000..762a90f06
--- /dev/null
+++ b/xserver/hw/xfree86/vgahw/meson.build
@@ -0,0 +1,10 @@
+shared_module('vgahw',
+ [ 'vgaHW.c', 'vgaHWmodule.c'],
+ include_directories: [ inc, xorg_inc ],
+ dependencies: common_dep,
+ c_args: xorg_c_args,
+ install: true,
+ install_dir: module_dir,
+)
+
+install_data('vgaHW.h', install_dir: xorgsdkdir)
diff --git a/xserver/hw/xfree86/x86emu/meson.build b/xserver/hw/xfree86/x86emu/meson.build
new file mode 100644
index 000000000..4846da99d
--- /dev/null
+++ b/xserver/hw/xfree86/x86emu/meson.build
@@ -0,0 +1,15 @@
+srcs_xorg_x86emu = [
+ 'debug.c',
+ 'decode.c',
+ 'fpu.c',
+ 'ops2.c',
+ 'ops.c',
+ 'prim_ops.c',
+ 'sys.c',
+]
+
+xorg_x86emu = static_library('x86emu',
+ srcs_xorg_x86emu,
+ include_directories: [inc, xorg_inc],
+ dependencies: common_dep,
+)
diff --git a/xserver/hw/xnest/meson.build b/xserver/hw/xnest/meson.build
new file mode 100644
index 000000000..37ac5a691
--- /dev/null
+++ b/xserver/hw/xnest/meson.build
@@ -0,0 +1,44 @@
+srcs = [
+ 'Args.c',
+ 'Color.c',
+ 'Cursor.c',
+ 'Display.c',
+ 'Events.c',
+ 'Font.c',
+ 'GC.c',
+ 'GCOps.c',
+ 'Handlers.c',
+ 'Init.c',
+ 'Keyboard.c',
+ 'Pixmap.c',
+ 'Pointer.c',
+ 'Screen.c',
+ 'Visual.c',
+ 'Window.c',
+ '../../mi/miinitext.c',
+ '../../mi/miinitext.h',
+]
+
+executable(
+ 'Xnest',
+ srcs,
+ include_directories: inc,
+ dependencies: [
+ common_dep,
+ xnest_dep,
+ ],
+ link_with: [
+ libxserver_main,
+ libxserver,
+ libxserver_xi_stubs,
+ libxserver_xkb_stubs,
+ ],
+ c_args: '-DHAVE_XNEST_CONFIG_H',
+ install: true,
+)
+
+install_man(configure_file(
+ input: 'man/Xnest.man',
+ output: 'Xnest.1',
+ configuration: manpage_config,
+))
diff --git a/xserver/hw/xquartz/GL/meson.build b/xserver/hw/xquartz/GL/meson.build
new file mode 100644
index 000000000..556417525
--- /dev/null
+++ b/xserver/hw/xquartz/GL/meson.build
@@ -0,0 +1,5 @@
+libcglcore = static_library('CGLCore',
+ ['indirect.c', 'capabilities.c', 'visualConfigs.c'],
+ include_directories: [inc, glx_inc, '..', '../xpr'],
+ dependencies: [xproto_dep, pixman_dep],
+)
diff --git a/xserver/hw/xquartz/bundle/meson.build b/xserver/hw/xquartz/bundle/meson.build
new file mode 100644
index 000000000..22941203b
--- /dev/null
+++ b/xserver/hw/xquartz/bundle/meson.build
@@ -0,0 +1,59 @@
+# generate Info.plist
+# https://github.com/mesonbuild/meson/issues/8434
+#cpp = find_program('cpp')
+cpp = '/usr/bin/cpp'
+cpp_defs = [
+ '-DAPPLE_APPLICATION_NAME=@0@'.format(apple_application_name),
+ '-DBUNDLE_ID_PREFIX=@0@'.format(bundle_id_prefix),
+ '-DBUNDLE_VERSION=@0@'.format(bundle_version),
+ '-DBUNDLE_VERSION_STRING=@0@'.format(bundle_version_string),
+]
+
+if build_sparkle
+cpp_defs += sparkle_defs
+endif
+
+# bundle data
+localities = [
+ 'Dutch', 'English', 'French', 'German', 'Italian', 'Japanese', 'Spanish',
+ 'ar','ca','cs','da','el','fi','he','hr','hu','ko','no','pl','pt','pt_PT',
+ 'ro','ru','sk','sv','th','tr','uk','zh_CN','zh_TW'
+]
+foreach lang : localities
+ install_data(join_paths('Resources', lang + '.lproj', 'Localizable.strings'),
+ install_dir: join_paths(bundle_root, 'Contents/Resources', lang + '.lproj'),
+ install_mode: 'rw-r--r--')
+
+ install_data(join_paths('Resources', lang + '.lproj', 'main.nib/keyedobjects.nib'),
+ install_dir: join_paths(bundle_root, 'Contents/Resources', lang + '.lproj', 'main.nib'),
+ install_mode: 'rw-r--r--')
+endforeach
+
+install_data('Resources/English.lproj/main.nib/designable.nib',
+ install_dir: join_paths(bundle_root, 'Contents/Resources/English.lproj/main.nib'),
+ install_mode: 'rw-r--r--')
+
+install_data('Resources/X11.icns',
+ install_dir: join_paths(bundle_root, 'Contents/Resources'),
+ install_mode: 'rw-r--r--')
+
+custom_target('Info.plist',
+ command: [cpp, '-P', cpp_defs, '@INPUT@'],
+ capture: true,
+ input: 'Info.plist.cpp',
+ output: 'Info.plist',
+ install: true,
+ install_dir: join_paths(bundle_root, 'Contents'),
+ install_mode: 'rw-r--r--',
+ build_by_default: true,
+)
+
+install_data('PkgInfo',
+ install_dir: join_paths(bundle_root, 'Contents'),
+ install_mode: 'rw-r--r--')
+
+install_data('X11.sh',
+ install_dir: join_paths(bundle_root, 'Contents/MacOS'),
+ install_mode: 'rwxr-xr-x')
+
+meson.add_install_script('chown-bundle.sh', bundle_root)
diff --git a/xserver/hw/xquartz/mach-startup/meson.build b/xserver/hw/xquartz/mach-startup/meson.build
new file mode 100644
index 000000000..2f7694252
--- /dev/null
+++ b/xserver/hw/xquartz/mach-startup/meson.build
@@ -0,0 +1,99 @@
+# mach interface
+mig = find_program('mig')
+mach_startup = custom_target('mach_startup',
+ command: [mig,
+ '-sheader', '@OUTPUT0@', '-header', '@OUTPUT2@',
+ '-server', '@OUTPUT1@', '-user', '@OUTPUT3@',
+ '@INPUT@'],
+ input: 'mach_startup.defs',
+ output: ['mach_startupServer.h',
+ 'mach_startupServer.c',
+ 'mach_startup.h',
+ 'mach_startupUser.c'],
+)
+
+mach_startup_dep = declare_dependency(
+ sources: mach_startup[2] # mach_startup.h
+)
+
+# common defines
+xquartz_defs = [
+ bundle_id_def,
+ '-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
+ '-DX11BINDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('bindir'))),
+]
+
+# X11.bin
+x11appdir = join_paths(bundle_root, 'Contents/MacOS')
+
+x11_bin_deps = [
+ meson.get_compiler('c').find_library('Xplugin'),
+ dependency('Carbon', method: 'extraframework'),
+ cocoa,
+ dependency('CoreAudio', method: 'extraframework'),
+ dependency('IOKit', method: 'extraframework')
+]
+
+if build_glx
+ x11_bin_deps += [dependency('OpenGL', method: 'extraframework')]
+endif
+
+if build_sparkle
+ x11_bin_deps += sparkle
+endif
+
+x11_bin_libs = [
+ libXquartz,
+ libXquartzXpr,
+ libxpbproxy,
+ libxserver_fb,
+ libxserver,
+ libxserver_xkb_stubs,
+]
+
+if build_glx
+ x11_bin_libs += [libcglcore, libxserver_glx, libglxvnd]
+endif
+
+x11_bin = executable('X11.bin',
+ [
+ 'bundle-main.c',
+ mach_startup[1], # mach_startupServer.c
+ mach_startup[3], # mach_startupUser.c
+ ],
+ link_with: x11_bin_libs,
+ dependencies: [xproto_dep, x11_bin_deps, mach_startup_dep],
+ include_directories: [inc, '..', top_dir_inc],
+ c_args: xquartz_defs,
+ link_args: ['-Objc'],
+ install: true,
+ install_dir: x11appdir,
+)
+
+# X11 (Bundle trampoline)
+x11 = executable('X11',
+ [
+ 'bundle_trampoline.c',
+ ],
+ c_args: xquartz_defs,
+ link_args: ['-Objc'],
+ install: true,
+ install_dir: x11appdir,
+)
+
+# Xquartz
+xquartz_deps = [
+ dependency('CoreServices', method: 'extraframework'),
+]
+
+xquartz = executable('Xquartz',
+ [
+ 'stub.c',
+ 'launchd_fd.c',
+ mach_startup[3], # mach_startupUser.c
+ ],
+ include_directories: inc,
+ c_args: xquartz_defs,
+ dependencies: [xquartz_deps, mach_startup_dep],
+ install: true,
+)
diff --git a/xserver/hw/xquartz/meson.build b/xserver/hw/xquartz/meson.build
new file mode 100644
index 000000000..05600fdd9
--- /dev/null
+++ b/xserver/hw/xquartz/meson.build
@@ -0,0 +1,97 @@
+add_languages('objc')
+
+apple_applications_dir = get_option('apple-applications-dir')
+apple_application_name = get_option('apple-application-name')
+bundle_id_prefix = get_option('bundle-id-prefix')
+xquartz_sparkle_feed_url = get_option('sparkle-feed-url')
+xquartz_sparkle_public_edkey = get_option('sparkle-public-edkey')
+
+bundle_version_string = get_option('bundle-version-string') # CFBundleShortVersionString
+if bundle_version_string == 'auto'
+ bundle_version_string = meson.project_version()
+endif
+
+bundle_version = get_option('bundle-version') # CFBundleVersion
+if bundle_version == 'auto'
+ version_arr = bundle_version_string.split('.')
+ version_major = version_arr[0].to_int()
+ version_minor = version_arr[1].to_int()
+ version_tiny = version_arr[2].to_int()
+ bundle_version = '@0@.@1@.@2@'.format(version_major, version_minor, version_tiny)
+endif
+
+bundle_id_def = '-DBUNDLE_ID_PREFIX="@0@"'.format(bundle_id_prefix)
+
+bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app')
+
+# using sparkle update framework?
+build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
+if build_sparkle
+ sparkle = dependency('Sparkle', method: 'extraframework')
+
+ sparkle_defs = [
+ '-DXQUARTZ_SPARKLE',
+ '-DXQUARTZ_SPARKLE_FEED_URL=@0@'.format(xquartz_sparkle_feed_url),
+ '-DXQUARTZ_SPARKLE_PUBLIC_EDKEY=@0@'.format(xquartz_sparkle_public_edkey),
+ ]
+else
+ sparkle_defs = []
+endif
+
+# libxquartz
+srcs_libxquartz = [
+ 'NSUserDefaults+XQuartzDefaults.m',
+ 'X11Application.m',
+ 'X11Controller.m',
+ 'applewm.c',
+ 'darwin.c',
+ 'darwinEvents.c',
+ 'darwinXinput.c',
+ 'keysym2ucs.c',
+ 'quartz.c',
+ 'quartzKeyboard.c',
+ 'quartzStartup.c',
+ 'quartzRandR.c',
+ '../../mi/miinitext.c',
+ '../../mi/miinitext.h',
+]
+
+libxquartz_defs = [
+ '-DUSE_NEW_CLUT',
+ '-DX11LIBDIR="@0@"'.format(join_paths(get_option('prefix'),
+ get_option('libdir'))),
+ '-DXFree86Server',
+ '-DXQUARTZ',
+ '-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
+ bundle_id_def,
+ sparkle_defs,
+]
+
+if cc.has_function('dispatch_async')
+ libxquartz_defs += '-DHAVE_LIBDISPATCH'
+endif
+
+libXquartz = static_library('Xquartz',
+ srcs_libxquartz,
+ c_args: libxquartz_defs,
+ objc_args: libxquartz_defs,
+ include_directories: [inc, '../../pseudoramiX', '../../miext/rootless', top_dir_inc],
+ dependencies: [xproto_dep, pixman_dep],
+ link_with: [libxserver_pseudoramix, libxserver_miext_rootless],
+)
+
+subdir('bundle')
+if build_glx
+ subdir('GL')
+endif
+subdir('pbproxy')
+subdir('xpr')
+subdir('mach-startup')
+
+# manpage
+xquartz_man = configure_file(
+ input: 'man/Xquartz.man',
+ output: 'Xquartz.1',
+ configuration: manpage_config,
+)
+install_man(xquartz_man)
diff --git a/xserver/hw/xquartz/pbproxy/meson.build b/xserver/hw/xquartz/pbproxy/meson.build
new file mode 100644
index 000000000..eebb9fd70
--- /dev/null
+++ b/xserver/hw/xquartz/pbproxy/meson.build
@@ -0,0 +1,31 @@
+build_standalone_pbproxy = get_option('xpbproxy')
+
+pbproxy_defs = [bundle_id_def]
+if build_standalone_pbproxy
+ pbproxy_defs += ['-DSTANDALONE_XPBPROXY']
+endif
+
+libapplewm_dep = dependency('applewm', version: '>=1.4')
+
+libxpbproxy = static_library('xpbproxy',
+ ['../NSUserDefaults+XQuartzDefaults.m',
+ 'main.m',
+ 'x-input.m',
+ 'x-selection.m'],
+ include_directories: ['..'],
+ dependencies: [applewmproto_dep, libapplewm_dep, dependency('xfixes'), dependency('x11')],
+ objc_args: pbproxy_defs,
+)
+
+cocoa = dependency('Cocoa', method: 'extraframework')
+
+# standalone xpbproxy
+if build_standalone_pbproxy
+ executable('xpbproxy',
+ 'app-main.m',
+ link_with: libxpbproxy,
+ dependencies: [cocoa, dependency('x11')],
+ objc_args: pbproxy_defs,
+ install: true,
+ )
+endif
diff --git a/xserver/hw/xquartz/xpr/meson.build b/xserver/hw/xquartz/xpr/meson.build
new file mode 100644
index 000000000..590727f47
--- /dev/null
+++ b/xserver/hw/xquartz/xpr/meson.build
@@ -0,0 +1,18 @@
+libXquartzXpr = static_library('XquartzXpr',
+ [
+ 'appledri.c',
+ 'dri.c',
+ 'driWrap.c',
+ 'xprAppleWM.c',
+ 'xprCursor.c',
+ 'xprEvent.c',
+ 'xprFrame.c',
+ 'xprScreen.c',
+ 'x-hash.c',
+ 'x-hook.c',
+ 'x-list.c',
+ ],
+ include_directories: [inc, '..', '../../../pseudoramiX', '../../../miext/rootless'],
+ c_args: [bundle_id_def, '-DXQUARTZ'],
+ dependencies: [xproto_dep, pixman_dep],
+)
diff --git a/xserver/hw/xwin/dri/meson.build b/xserver/hw/xwin/dri/meson.build
new file mode 100644
index 000000000..0d8703c38
--- /dev/null
+++ b/xserver/hw/xwin/dri/meson.build
@@ -0,0 +1,14 @@
+srcs_windows_dri = [
+ 'windowsdri.c',
+ 'windowsdri.h',
+]
+
+xwin_windowsdri = static_library(
+ 'WindowsDRI',
+ srcs_windows_dri,
+ include_directories: [ inc, include_directories('../') ],
+ dependencies: [
+ windowsdri_dep,
+ pixman_dep,
+ ],
+)
diff --git a/xserver/hw/xwin/glx/meson.build b/xserver/hw/xwin/glx/meson.build
new file mode 100644
index 000000000..95f248953
--- /dev/null
+++ b/xserver/hw/xwin/glx/meson.build
@@ -0,0 +1,102 @@
+python3 = import('python3')
+
+# XWin requires OpenGL spec files in order to generate wrapper code for native GL functions
+py3 = python3.find_python()
+if run_command(py3, '-c', 'import lxml;').returncode() != 0
+ error('python3 lxml module not found')
+endif
+
+khronos_spec_dir = dependency('khronos-opengl-registry').get_pkgconfig_variable('specdir')
+
+gen_gl_wrappers_opts= ['-nodebug']
+gen_gl_wrappers_cmd = ['env', 'PYTHONPATH=' + khronos_spec_dir, py3, files('./gen_gl_wrappers.py'), gen_gl_wrappers_opts]
+
+wgl_wrappers = custom_target(
+ 'gen_wgl_wrappers',
+ command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-prefix', 'wgl', '-wrapper', '-preresolve', '-outfile', '@OUTPUT@'],
+ input: join_paths(khronos_spec_dir, 'wgl.xml'),
+ output: 'generated_wgl_wrappers.ic',
+ depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+gl_shim = custom_target(
+ 'gen_gl_shim',
+ command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-shim', '-outfile', '@OUTPUT@'],
+ input: join_paths(khronos_spec_dir, 'gl.xml'),
+ output: 'generated_gl_shim.ic',
+ depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+gl_thunks = custom_target(
+ 'gen_gl_thunks',
+ command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-thunk', '-outfile', '@OUTPUT@'],
+ input: join_paths(khronos_spec_dir, 'gl.xml'),
+ output: 'generated_gl_thunks.ic',
+ depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+gl_thunks_def = custom_target(
+ 'gen_gl_thunks_def',
+ command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-thunkdefs', '-outfile', '@OUTPUT@'],
+ input: join_paths(khronos_spec_dir, 'gl.xml'),
+ output: 'generated_gl_thunks.def',
+ depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+srcs_windows_glx = [
+ 'winpriv.c',
+ 'winpriv.h',
+ 'glwindows.h',
+ 'glshim.c',
+ gl_shim,
+ 'indirect.c',
+ 'indirect.h',
+ 'wgl_ext_api.c',
+ wgl_wrappers,
+ 'wgl_ext_api.h',
+]
+
+if build_windowsdri
+ srcs_windows_glx += [
+ 'dri_helpers.c',
+ 'dri_helpers.h',
+ ]
+endif
+
+xwin_glx_c_args = []
+xwin_glx_c_args += '-DHAVE_XWIN_CONFIG_H'
+xwin_glx_c_args += '-DXWIN_GLX_WINDOWS'
+
+xwin_glx = static_library(
+ 'XwinGLX',
+ srcs_windows_glx,
+ include_directories: [
+ inc,
+ top_dir_inc,
+ include_directories('../'),
+ ],
+ dependencies: common_dep,
+ c_args: xwin_glx_c_args,
+)
+
+srcs_wgl_thunk = [
+ 'glthunk.c',
+ gl_thunks,
+]
+
+WGLthunk = shared_library(
+ 'nativeGLthunk',
+ srcs_wgl_thunk,
+ include_directories: [
+ inc,
+ top_dir_inc,
+ ],
+ c_args: xwin_glx_c_args + [
+ '-Wno-unused-function',
+ '-Wno-missing-prototypes',
+ '-Wno-missing-declarations',
+ ],
+ link_args: ['-lopengl32'],
+ vs_module_defs: gl_thunks_def,
+ install: true,
+)
diff --git a/xserver/hw/xwin/meson.build b/xserver/hw/xwin/meson.build
new file mode 100644
index 000000000..e9940ccc3
--- /dev/null
+++ b/xserver/hw/xwin/meson.build
@@ -0,0 +1,184 @@
+windows = import('windows')
+
+windowsdri_dep = dependency('windowsdriproto', required: false)
+
+build_windowsdri = windowsdri_dep.found()
+
+xwin_sys_libs = []
+xwin_sys_libs += '-ldxguid'
+
+if host_machine.system() == 'cygwin'
+ server_name = 'XWin'
+else
+ server_name = 'Xming'
+ xwin_sys_libs += ['-lpthread', '-lws2_32']
+endif
+
+xwin_c_args = []
+xwin_c_args += '-DHAVE_XWIN_CONFIG_H'
+xwin_c_args += '-Wno-bad-function-cast'
+
+srcs_windows = [
+ 'winclipboardinit.c',
+ 'winclipboardwrappers.c',
+]
+subdir('winclipboard')
+
+xwin_glx = []
+xwin_windowsdri = []
+if build_glx
+ if build_windowsdri
+ xwin_c_args += '-DXWIN_WINDOWS_DRI'
+ subdir('dri')
+ endif
+ xwin_c_args += '-DXWIN_GLX_WINDOWS'
+ xwin_sys_libs += '-lopengl32'
+ subdir('glx')
+endif
+
+srcs_windows += [
+ 'winmultiwindowshape.c',
+ 'winmultiwindowwindow.c',
+ 'winmultiwindowwm.c',
+ 'winmultiwindowwndproc.c',
+ 'propertystore.h',
+ 'winSetAppUserModelID.c',
+]
+xwin_sys_libs += ['-lshlwapi', '-lole32', '-ldwmapi']
+
+srcs_windows += [
+ 'winrandr.c',
+]
+
+srcs_windows += [
+ 'InitInput.c',
+ 'InitOutput.c',
+ 'winallpriv.c',
+ 'winauth.c',
+ 'winblock.c',
+ 'wincmap.c',
+ 'winconfig.c',
+ 'wincreatewnd.c',
+ 'wincursor.c',
+ 'windialogs.c',
+ 'winengine.c',
+ 'winerror.c',
+ 'winglobals.c',
+ 'winkeybd.c',
+ 'winkeyhook.c',
+ 'winmisc.c',
+ 'winmonitors.c',
+ 'winmouse.c',
+ 'winmsg.c',
+ 'winmsgwindow.c',
+ 'winmultiwindowclass.c',
+ 'winmultiwindowicons.c',
+ 'winos.c',
+ 'winprefs.c',
+ 'winprocarg.c',
+ 'winscrinit.c',
+ 'winshadddnl.c',
+ 'winshadgdi.c',
+ 'wintaskbar.c',
+ 'wintrayicon.c',
+ 'winvalargs.c',
+ 'winwakeup.c',
+ 'winwindow.c',
+ 'winwndproc.c',
+ 'ddraw.h',
+ 'winconfig.h',
+ 'win.h',
+ 'winglobals.h',
+ 'winkeybd.h',
+ 'winkeynames.h',
+ 'winlayouts.h',
+ 'winmessages.h',
+ 'winmonitors.h',
+ 'winmsg.h',
+ 'winms.h',
+ 'winmultiwindowclass.h',
+ 'winmultiwindowicons.h',
+ 'winprefs.h',
+ 'winresource.h',
+ 'winwindow.h',
+ 'windisplay.c',
+ 'windisplay.h',
+ '../../mi/miinitext.c',
+ '../../mi/miinitext.h',
+]
+
+rsrc = windows.compile_resources('XWin.rc', include_directories: include_directories('../../include/'))
+srcs_windows += rsrc
+
+flex = find_program('flex')
+bison = find_program('bison')
+
+lgen = generator(
+ flex,
+ output : '@PLAINNAME@.yy.c',
+ arguments : ['-i', '-o', '@OUTPUT@', '@INPUT@']
+)
+
+lfiles = lgen.process('winprefslex.l')
+srcs_windows += lfiles
+
+pgen = generator(
+ bison,
+ output : ['@BASENAME@.c', '@BASENAME@.h'],
+ arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
+)
+
+pfiles = pgen.process('winprefsyacc.y')
+srcs_windows += pfiles
+
+xwin_dep = [
+ common_dep,
+ dependency('xcb-aux'),
+ dependency('xcb-image'),
+ dependency('xcb-ewmh'),
+ dependency('xcb-icccm'),
+ dependency('xcb-composite'),
+]
+
+executable(
+ server_name,
+ srcs_windows,
+ include_directories: [inc, top_dir_inc],
+ dependencies: xwin_dep,
+ link_with: [
+ xwin_windowsdri,
+ xwin_glx,
+ xwin_clipboard,
+ libxserver_fb,
+ libxserver,
+ libxserver_glx,
+ libglxvnd,
+ libxserver_xkb_stubs,
+ libxserver_miext_shadow,
+ libxserver_pseudoramix,
+ libxserver_xi_stubs,
+ ],
+ link_args: ['-Wl,--disable-stdcall-fixup', '-Wl,--export-all-symbols'] + xwin_sys_libs,
+ c_args: xwin_c_args,
+ gui_app: true,
+ install: true,
+)
+
+install_data(
+ 'system.XWinrc',
+ install_dir: join_paths(get_option('sysconfdir'), 'X11')
+)
+
+xwin_man = configure_file(
+ input: 'man/XWin.man',
+ output: 'XWin.1',
+ configuration: manpage_config,
+)
+install_man(xwin_man)
+
+xwinrc_man = configure_file(
+ input: 'man/XWinrc.man',
+ output: 'XWinrc.5',
+ configuration: manpage_config,
+)
+install_man(xwinrc_man)
diff --git a/xserver/hw/xwin/winclipboard/meson.build b/xserver/hw/xwin/winclipboard/meson.build
new file mode 100644
index 000000000..2a46c670e
--- /dev/null
+++ b/xserver/hw/xwin/winclipboard/meson.build
@@ -0,0 +1,41 @@
+srcs_windows_clipboard = [
+ 'winclipboard.h',
+ 'textconv.c',
+ 'thread.c',
+ 'wndproc.c',
+ 'xevents.c',
+]
+
+xwin_clipboard = static_library(
+ 'XWinclipboard',
+ srcs_windows_clipboard,
+ include_directories: inc,
+ c_args: '-DHAVE_XWIN_CONFIG_H',
+ dependencies: [
+ dependency('xcb'),
+ dependency('xcb-aux'),
+ dependency('xcb-icccm'),
+ dependency('xcb-xfixes'),
+ socket_dep,
+ ],
+)
+
+srcs_xwinclip = [
+ 'xwinclip.c',
+ 'debug.c',
+]
+
+executable(
+ 'xwinclip',
+ srcs_xwinclip,
+ link_with: xwin_clipboard,
+ link_args: ['-lgdi32', '-lpthread'],
+ install: true,
+)
+
+xwinclip_man = configure_file(
+ input: 'xwinclip.man',
+ output: 'xwinclip.1',
+ configuration: manpage_config,
+)
+install_man(xwinclip_man)