Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions unix/xserver/hw/vnc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
tigervnc_builddir = get_option('tigervnc_builddir')
cpp = meson.get_compiler('cpp')

vnccommon_deps = [
declare_dependency(
dependencies: cpp.find_library('core', dirs: join_paths(tigervnc_builddir, 'common/core'))),
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('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'),
Comment on lines +15 to +21

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the original PR, this is duplication we want to avoid. So we'd like some clever way of providing this information to Meson based on what's in our CMake files.

]

srcs_vnccommon = [
'vncPresent.c',
'xvnc.c',
'vncDRI3.c',
'vncDRI3Draw.c',
Comment on lines +27 to +28

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these conditional, like for autoconf?

'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',
Comment on lines +52 to +54

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have a tigervnc_srcdir like we do for autoconf, to support different ways of building Xvnc.

)

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'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are no longer used.

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,
))
10 changes: 6 additions & 4 deletions unix/xserver/hw/vnc/xorg-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
Expand All @@ -26,7 +26,7 @@

#include <version-config.h>

#define XORG_AT_LEAST(major, minor, patch) \
#define XORG_AT_LEAST(major, minor, patch) \
(VENDOR_RELEASE >= ((major * 10000000) + (minor * 100000) + (patch * 1000)))
#define XORG_OLDER_THAN(major, minor, patch) \
(VENDOR_RELEASE < ((major * 10000000) + (minor * 100000) + (patch * 1000)))
Expand All @@ -35,7 +35,9 @@
#error "X.Org older than 1.20 is not supported"
#endif

#if XORG_AT_LEAST(1, 22, 0)
#if XORG_AT_LEAST(1, 25, 0)
#warning "Xserver master branch detected, compilation may fail"
#elif XORG_AT_LEAST(1, 22, 0)
#error "X.Org newer than 1.21 is not supported"
#endif

Expand Down
40 changes: 40 additions & 0 deletions unix/xservermain.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/hw/meson.build b/hw/meson.build
index f9605a5b7..359b622dd 100644
--- a/hw/meson.build
+++ b/hw/meson.build
@@ -1,3 +1,7 @@
+if get_option('tigervnc_builddir') != ''
+ subdir('vnc')
+endif
+
if build_xephyr
subdir('kdrive')
endif
diff --git a/meson.build b/meson.build
index 1556491eb..680d23e51 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('xserver', 'c',
+project('xserver', ['c', 'cpp'],
default_options: [
'buildtype=debugoptimized',
'c_std=gnu99',
@@ -8,7 +8,7 @@ project('xserver', 'c',
)
release_date = '2021-07-05'

-add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc'])
+add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc', 'cpp'])
cc = meson.get_compiler('c')

add_project_arguments('-fno-strict-aliasing', language : 'c')
diff --git a/meson_options.txt b/meson_options.txt
index 94698f218..616686299 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
+option('tigervnc_builddir', type: 'string', description: 'tigervncbuild dir', value: '')
option('xorg', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Enable Xorg X Server')
option('xephyr', type: 'boolean', value: false,