-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to build Xvnc with meson #1729
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
tigervnc_srcdir = join_paths(meson.source_root(), '../..') | ||
tigervnc_builddir = tigervnc_srcdir | ||
|
||
cpp = meson.get_compiler('cpp') | ||
|
||
vnccommon_deps = [ | ||
declare_dependency( | ||
dependencies: cpp.find_library('rfb', dirs: join_paths(tigervnc_builddir, 'common/rfb'))), | ||
declare_dependency( | ||
dependencies: cpp.find_library('rdr', dirs: join_paths(tigervnc_builddir, 'common/rdr'))), | ||
declare_dependency( | ||
dependencies: cpp.find_library('os', dirs: join_paths(tigervnc_builddir, 'common/os'))), | ||
declare_dependency( | ||
dependencies: cpp.find_library('network', dirs: join_paths(tigervnc_builddir, 'common/network'))), | ||
declare_dependency( | ||
dependencies: cpp.find_library('unixcommon', dirs: join_paths(tigervnc_builddir, 'unix/common'))), | ||
dependency('zlib'), | ||
dependency('pam'), | ||
dependency('gnutls'), | ||
dependency('nettle'), | ||
dependency('hogweed'), | ||
dependency('gmp'), | ||
dependency('libjpeg'), | ||
] | ||
|
||
srcs_vnccommon = [ | ||
'qnum_to_xorgevdev.c', | ||
'qnum_to_xorgkbd.c', | ||
'RandrGlue.c', | ||
'RFBGlue.cc', | ||
'RFBGlue.h', | ||
'vncBlockHandler.c', | ||
'vncBlockHandler.h', | ||
'vncExt.c', | ||
'vncExtInit.cc', | ||
'vncHooks.c', | ||
'vncInput.c', | ||
'vncInput.h', | ||
'vncInputXKB.c', | ||
'vncSelection.c', | ||
'vncSelection.h', | ||
'xorg-version.h', | ||
'XorgGlue.c', | ||
'XorgGlue.h', | ||
'XserverDesktop.cc', | ||
'XserverDesktop.h', | ||
] | ||
|
||
vnccommon_inc = include_directories( | ||
'../../../../common', | ||
'../../../common', | ||
'../../../vncconfig', | ||
) | ||
|
||
libvnccommon = static_library( | ||
'vnccommon', | ||
srcs_vnccommon, | ||
include_directories : [inc, vnccommon_inc], | ||
dependencies: [common_dep, vnccommon_deps], | ||
install: false, | ||
) | ||
|
||
srcs_xvnc = [ | ||
'xvnc.c', | ||
'buildtime.c', | ||
'../../fb/fbcmap_mi.c', | ||
'../../mi/miinitext.c', | ||
'../../Xi/stubs.c', | ||
] | ||
|
||
xvnc_inc = include_directories( | ||
'../../../../common', | ||
'../../../common', | ||
) | ||
|
||
xvnc = executable( | ||
'Xvnc', | ||
srcs_xvnc, | ||
include_directories : [inc, xvnc_inc], | ||
dependencies: common_dep, | ||
c_args: ['-DTIGERVNC', '-DNO_MODULE_EXTS'], | ||
link_with: [ | ||
libxserver, | ||
libxserver_fb, | ||
libxserver_main, | ||
libxserver_glx, | ||
libglxvnd, | ||
libxserver_xi_stubs, | ||
libxserver_xkb_stubs, | ||
libvnccommon, | ||
], | ||
install: true, | ||
) | ||
|
||
libvnc_inc = include_directories( | ||
'../xfree86/common', | ||
'../xfree86/os-support', | ||
'../xfree86/os-support/bus' | ||
) | ||
|
||
libvnc = shared_module( | ||
'vnc', | ||
'vncModule.c', | ||
include_directories : [inc, xvnc_inc, libvnc_inc], | ||
dependencies: common_dep, | ||
link_with: libvnccommon, | ||
install: true, | ||
install_dir: join_paths(module_dir, 'extensions') | ||
) | ||
|
||
install_man(configure_file( | ||
input: 'Xvnc.man', | ||
output: 'Xvnc.1', | ||
configuration: manpage_config, | ||
)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,53 @@ Index: xserver/hw/Makefile.am | |
|
||
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland | ||
|
||
Index: xserver/hw/meson.build | ||
=================================================================== | ||
--- xserver.orig/hw/meson.build | ||
+++ xserver/hw/meson.build | ||
@@ -29,3 +29,5 @@ endif | ||
if build_xwin | ||
subdir('xwin') | ||
endif | ||
+ | ||
+subdir('vnc') | ||
Index: xserver/meson.build | ||
=================================================================== | ||
--- xserver.orig/meson.build | ||
+++ xserver/meson.build | ||
@@ -1,4 +1,4 @@ | ||
-project('xserver', 'c', | ||
+project('xserver', 'c', 'cpp', | ||
default_options: [ | ||
'buildtype=debugoptimized', | ||
'c_std=gnu99', | ||
@@ -6,13 +6,13 @@ project('xserver', 'c', | ||
version: '1.20.0', | ||
meson_version: '>= 0.42.0', | ||
) | ||
-add_project_arguments('-DHAVE_DIX_CONFIG_H', language: 'c') | ||
+add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'cpp']) | ||
cc = meson.get_compiler('c') | ||
|
||
-add_global_arguments('-fno-strict-aliasing', language : 'c') | ||
-add_global_arguments('-fvisibility=hidden', language : 'c') | ||
+add_global_arguments('-fno-strict-aliasing', language : ['c', 'cpp']) | ||
+add_global_arguments('-fvisibility=hidden', language : ['c', 'cpp']) | ||
|
||
-add_global_link_arguments('-fvisibility=hidden', language : 'c') | ||
+add_global_link_arguments('-fvisibility=hidden', language : ['c', 'cpp']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These patches are a bit annoying to maintain, so we ideally want to keep them as small as possible. Would it be possible to move these things to our meson file instead? Basically, tell meson to "copy the global arguments from 'c' to 'cpp'"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the way of copying the cflags arguments from 'c' to 'cpp': using the The other option is to drop these changes on the patches and manually hardcode the cflags on hw/vnc/meson.build for each target (i.e. Xvnc, libvnc...) which might not be in sync with the cflags a new xserver version uses. |
||
|
||
if cc.get_id() == 'gcc' or cc.get_id() == 'clang' | ||
test_wflags = [ | ||
@@ -56,7 +56,7 @@ foreach wflag: test_wflags | ||
endif | ||
endforeach | ||
|
||
-add_global_arguments(common_wflags, language : 'c') | ||
+add_global_arguments(common_wflags, language : ['c', 'cpp']) | ||
|
||
xproto_dep = dependency('xproto', version: '>= 7.0.31') | ||
randrproto_dep = dependency('randrproto', version: '>= 1.6.0') | ||
Index: xserver/mi/miinitext.c | ||
=================================================================== | ||
--- xserver.orig/mi/miinitext.c | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I'm unfamiliar with meson. Will this still use our
.la
files? Or do we need to come up with some new glue for meson?It is important that it not only finds the
.a
files, but also includes any dependent libraries. Possibly also cflags, but I'm unsure how well that even works currently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't think meson is capable of handle .la files.
This first attempt manually adds the dependencies, as you can see (e.g.
dependency('zlib')
).Now that I see, this only works on my build setup. A workaround could be to do the dynamic library selection to build the common libs at hw/vnc/meson.build.
If the common libs were built with meson too, the library dependencies could be known.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That duplication is not something we'll reasonably be able to maintain.
Moving everything from CMake to meson seems overkill. So we want to add some glue, like we have right now between CMake and libtool.
Please have a look at
CMakeMacroLibtoolFile.cmake
and see how we can do something similar for meson. I.e. automatically generate dependency information in a format meson can consume.