summaryrefslogtreecommitdiff
path: root/hw/xwin
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-05-07 20:53:04 +0100
committerEric Anholt <eric@anholt.net>2017-06-02 09:32:35 -0700
commit1f38a31ed3969471cbed69c61edb971f6cff5287 (patch)
tree0842b9f1dbfcbeea4d08b85db586644a72a7c862 /hw/xwin
parent36b9dac212a0f8a287cdbd35db152a5eb5cbc744 (diff)
Add meson.build for XWin server (v2)
This needs a meson with PRs #1784, #1792 and #1794 Future work: remove conditionals which are always on, and simplify redundant CYGDEBUG conditionals Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'hw/xwin')
-rw-r--r--hw/xwin/dri/meson.build14
-rw-r--r--hw/xwin/glx/meson.build100
-rw-r--r--hw/xwin/meson.build170
-rw-r--r--hw/xwin/winclipboard/meson.build31
4 files changed, 315 insertions, 0 deletions
diff --git a/hw/xwin/dri/meson.build b/hw/xwin/dri/meson.build
new file mode 100644
index 000000000..0d8703c38
--- /dev/null
+++ b/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/hw/xwin/glx/meson.build b/hw/xwin/glx/meson.build
new file mode 100644
index 000000000..77ffeda28
--- /dev/null
+++ b/hw/xwin/glx/meson.build
@@ -0,0 +1,100 @@
+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.c',
+ 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.c',
+ 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.c',
+ 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',
+ 'indirect.c',
+ 'indirect.h',
+ 'wgl_ext_api.c',
+ '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_MULTIWINDOW'
+xwin_glx_c_args += '-DXWIN_GLX_WINDOWS'
+
+xwin_glx = static_library(
+ 'XwinGLX',
+ srcs_windows_glx,
+ include_directories: [
+ inc,
+ top_srcdir_inc,
+ include_directories('../'),
+ ],
+ dependencies: pixman_dep,
+ c_args: xwin_glx_c_args,
+)
+
+srcs_wgl_thunk = [
+ 'glthunk.c',
+]
+
+WGLthunk = shared_library(
+ 'nativeGLthunk',
+ srcs_wgl_thunk,
+ include_directories: [
+ inc,
+ top_srcdir_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/hw/xwin/meson.build b/hw/xwin/meson.build
new file mode 100644
index 000000000..7e418206a
--- /dev/null
+++ b/hw/xwin/meson.build
@@ -0,0 +1,170 @@
+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'
+# XXX: these conditionals are always on and can be removed
+xwin_c_args += '-DXWIN_CLIPBOARD'
+xwin_c_args += '-DXWIN_MULTIWINDOW'
+xwin_c_args += '-DXWIN_RANDR'
+
+srcs_windows = [
+ 'winclipboardinit.c',
+ 'winclipboardwrappers.c',
+]
+subdir('winclipboard')
+
+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']
+
+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',
+]
+
+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('x11-xcb'),
+ dependency('xcb-aux'),
+ dependency('xcb-image'),
+ dependency('xcb-ewmh'),
+ dependency('xcb-icccm'),
+]
+
+executable(
+ server_name,
+ srcs_windows,
+ include_directories: [inc, top_srcdir_inc],
+ dependencies: xwin_dep,
+ link_with: [
+ xwin_windowsdri,
+ xwin_glx,
+ xwin_clipboard,
+ libxserver_fb,
+ libxserver,
+ libxserver_glx,
+ 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')
+)
diff --git a/hw/xwin/winclipboard/meson.build b/hw/xwin/winclipboard/meson.build
new file mode 100644
index 000000000..1c784c384
--- /dev/null
+++ b/hw/xwin/winclipboard/meson.build
@@ -0,0 +1,31 @@
+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('x11'),
+ dependency('xfixes'),
+ ],
+)
+
+srcs_xwinclip = [
+ 'xwinclip.c',
+ 'debug.c',
+]
+
+executable(
+ 'xwinclip',
+ srcs_xwinclip,
+ link_with: xwin_clipboard,
+ link_args: ['-lgdi32', '-lpthread'],
+ install: true,
+)