blob: 98c7c6b08040326521c490db888f1a3539720b21 [file] [log] [blame]
DRC2c0ea902010-04-16 07:33:41 +00001*******************************************************************************
DRC667df922011-06-23 10:11:22 +00002** Building TigerVNC
DRC2c0ea902010-04-16 07:33:41 +00003*******************************************************************************
4
5
DRC667df922011-06-23 10:11:22 +00006================================
7Build Requirements (All Systems)
8================================
DRC2c0ea902010-04-16 07:33:41 +00009
DRC667df922011-06-23 10:11:22 +000010-- CMake (http://www.cmake.org) v2.8 or later
11
Peter Åstrande7370bd2013-01-22 08:11:05 +000012-- FLTK 1.3.2
Pierre Ossmanc656bac2012-08-17 08:10:27 +000013 * Must be a patched snapshot to get full functionality
Peter Åstrand956a6362012-08-09 07:33:08 +000014 * See "Building FLTK" below.
15
DRC69854b42011-05-13 09:31:24 +000016-- If building TLS support:
17 * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
18
DRCce355e32011-06-24 04:58:01 +000019-- If building native language support (NLS):
20 * Gnu gettext 0.14.4 or later
21 * See "Building Native Language Support" below.
22
DRC667df922011-06-23 10:11:22 +000023-- libjpeg-turbo SDK
DRCce355e32011-06-24 04:58:01 +000024 * If your system does not include libjpeg-turbo, then you can download the
25 SDK from http://sourceforge.net/projects/libjpeg-turbo/files/
DRC240a5ff2011-07-06 07:28:30 +000026 * See "Building High-Performance JPEG Support" below.
DRC667df922011-06-23 10:11:22 +000027
28
29=========================
30Build Requirements (Unix)
31=========================
32
33-- Non-Mac platforms:
34 * X11 development kit
35
DRC2c0ea902010-04-16 07:33:41 +000036-- If building Xvnc:
DRC667df922011-06-23 10:11:22 +000037 * autoconf 2.57 or later
38 * automake 1.7 or later
39 * libtool 1.4 or later
40 * OpenSSL v0.9.7 or later
DRC2c0ea902010-04-16 07:33:41 +000041 * Python v2.3 or later
42 * zlib v1.2 or later
DRC2c0ea902010-04-16 07:33:41 +000043
DRC69854b42011-05-13 09:31:24 +000044 * pkgconfig 0.20 or later
45 If you are using an older RPM-based system which does not meet this
46 minimum requirement (such as Red Hat Enterprise Linux 4), then you can
47 build pkgconfig 0.20 from the Fedora 5 source RPM:
48 http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/pkgconfig-0.20-2.2.1.src.rpm
49
DRC69854b42011-05-13 09:31:24 +000050 * gettext 0.14.4 or later
51 If you are using an older RPM-based system which does not meet this
52 minimum requirement (such as Red Hat Enterprise Linux 4), then you can
53 build gettext 0.14.5 from the Fedora 5 source RPM:
54 http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/gettext-0.14.5-3.src.rpm
55 NOTE: gcj and libgcj are required when building the above source RPM.
DRC2b0b1942011-02-09 03:10:44 +000056
DRC2c0ea902010-04-16 07:33:41 +000057
DRC667df922011-06-23 10:11:22 +000058============================
59Build Requirements (Windows)
60============================
DRC180c0162010-10-27 07:20:27 +000061
DRCccc09692011-11-08 06:57:58 +000062-- MinGW or MinGW-w64
DRC180c0162010-10-27 07:20:27 +000063
DRC180c0162010-10-27 07:20:27 +000064-- Inno Setup (needed to build the TigerVNC installer)
65 Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
66 You also need the Inno Setup Preprocessor, which is available in the
67 Inno Setup QuickStart Pack.
68
69 Add the directory containing iscc.exe (for instance,
70 C:\Program Files\Inno Setup 5) to the system or user PATH environment
71 variable prior to building TigerVNC.
72
DRC667df922011-06-23 10:11:22 +000073
DRC15b6e052011-10-06 01:20:52 +000074=========================
75Build Requirements (Java)
76=========================
77
78-- Sun/Oracle JDK v5 or later or OpenJDK
79
80-- See "Building Java Support" below.
81
82
Peter Åstrand956a6362012-08-09 07:33:08 +000083=============
84Building FLTK
85=============
86
Pierre Ossmanc656bac2012-08-17 08:10:27 +000087TigerVNC requires FLTK 1.3.0 (or later). Although it will build and work
88with plain 1.3.0, to get full functionality and the best behaviour you
89need to build a patched version:
Peter Åstrand956a6362012-08-09 07:33:08 +000090
Peter Åstrande7370bd2013-01-22 08:11:05 +0000911. Check out FLTK 1.3.2 using Subversion:
92$ svn co http://svn.easysw.com/public/fltk/fltk/tags/release-1.3.2 fltk-1.3.2
Peter Åstrand956a6362012-08-09 07:33:08 +000093
Peter Åstrande7370bd2013-01-22 08:11:05 +0000942. For full functionality, apply patches. Here's a shell script to do
95that:
Peter Åstrand956a6362012-08-09 07:33:08 +000096
Peter Åstrande7370bd2013-01-22 08:11:05 +000097#!/bin/bash
98set -e
99apply_patch()
100{
101 rm -f $2
102 wget http://www.fltk.org/strfiles/$1/$2
103 patch -p1 < $2
104}
Peter Åstrand956a6362012-08-09 07:33:08 +0000105
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000106# Export dead key information from FLTK to the apps
107# http://www.fltk.org/str.php?L2599
Peter Åstrande7370bd2013-01-22 08:11:05 +0000108apply_patch 2599 fltk-1_v4.3.x-keyboard-x11.patch
109apply_patch 2599 fltk-1_v4.3.x-keyboard-win32.patch
110apply_patch 2599 fltk-1_v6.3.x-keyboard-osx.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000111
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000112# Notify applications of changes to the clipboard
113# http://www.fltk.org/str.php?L2636
Peter Åstrande7370bd2013-01-22 08:11:05 +0000114apply_patch 2636 fltk-1.3.x-clipboard.patch
Pierre Ossman7adc4882013-09-05 14:27:21 +0000115apply_patch 2636 fltk-1_v6.3.x-clipboard-x11.patch
Peter Åstrande7370bd2013-01-22 08:11:05 +0000116apply_patch 2636 fltk-1_v3.3.x-clipboard-win32-fix.patch
117apply_patch 2636 fltk-1_v2.3.x-clipboard-win32.patch
118apply_patch 2636 fltk-1_v2.3.x-clipboard-osx.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000119
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000120# Ability to convert a Fl_Pixmap to a Fl_RGB_Image
121# http://www.fltk.org/str.php?L2659
Peter Åstrande7370bd2013-01-22 08:11:05 +0000122apply_patch 2659 pixmap_v2.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000123
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000124# Support for custom cursors
125# http://www.fltk.org/str.php?L2660
Peter Åstrand923c5fe2013-02-05 13:38:06 +0000126apply_patch 2660 fltk-1_v5.3.x-cursor.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000127
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000128# Improve modality interaction with WM
129# http://www.fltk.org/str.php?L2802
Peter Åstrande7370bd2013-01-22 08:11:05 +0000130apply_patch 2802 fltk-1_v2.3.0-modal.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000131
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000132# Window icons
133# http://www.fltk.org/str.php?L2816
Peter Åstrande7370bd2013-01-22 08:11:05 +0000134apply_patch 2816 fltk-1_v3.3.0-icons.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000135
Peter Åstrand578ea4d2013-01-22 08:08:10 +0000136# Multihead
137# http://fltk.org/str.php?L2860
Peter Åstrande7370bd2013-01-22 08:11:05 +0000138apply_patch 2860 fltk-1.3.x-screen_num.patch
139apply_patch 2860 fltk-1_v3.3.x-multihead.patch
Peter Åstrand956a6362012-08-09 07:33:08 +0000140
Brian Hinz1ff04d12013-11-28 16:26:08 +0000141### END SCRIPT ###
142
Peter Åstrand956a6362012-08-09 07:33:08 +00001433. Use CMake to build FLTK using the same procedures described below for
144 building TigerVNC. The recipes in the "Build Recipes" section also apply.
Peter Åstrandfc3e86e2013-01-07 09:59:00 +0000145 If you want optimized code, make sure to build with
146 -DCMAKE_BUILD_TYPE=Release.
Peter Åstrand956a6362012-08-09 07:33:08 +0000147
1484. (optional) Use 'make install' to install FLTK into a directory of your
149 choosing.
150
1515. When building TigerVNC, set the FLTK_FLUID_EXECUTABLE CMake variable to the
152 location of the fluid executable that was built in Step 3 or installed in
153 Step 4. This gives CMake a hint as to where to find the FLTK library.
Pierre Ossmanbbb0c612012-08-17 08:05:59 +0000154
Peter Åstrand956a6362012-08-09 07:33:08 +00001556. If you did not install FLTK, then set the FLTK_INCLUDE_DIR CMake variable to
156 the location of the FLTK source directory.
157
158
DRC180c0162010-10-27 07:20:27 +0000159==================
160Out-of-Tree Builds
161==================
162
163Binary objects, libraries, and executables are generated in the same directory
164from which cmake was executed (the "binary directory"), and this directory need
165not necessarily be the same as the TigerVNC source directory. You can create
166multiple independent binary directories, in which different versions of
167TigerVNC can be built from the same source tree using different compilers or
168settings. In the sections below, {build_directory} refers to the binary
169directory, whereas {source_directory} refers to the TigerVNC source directory.
170For in-tree builds, these directories are the same.
171
172
173=================
174Building TigerVNC
175=================
176
177
DRC62f3a662011-08-24 00:03:31 +0000178Building the TigerVNC Viewer on Unix/Mac Systems
179------------------------------------------------
DRC667df922011-06-23 10:11:22 +0000180
181The following procedure will build the TigerVNC Viewer on Linux and Unix
182systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See
183"Build Recipes" for specific build instructions for building a 32-bit version
184of TigerVNC on 64-bit systems.
185
186 cd {build_directory}
DRC240a5ff2011-07-06 07:28:30 +0000187 cmake -G "Unix Makefiles" [additional CMake flags] {source_directory}
DRC667df922011-06-23 10:11:22 +0000188 make
189
DRC62f3a662011-08-24 00:03:31 +0000190
191Building the TigerVNC Server on Modern Unix/Linux Systems
192---------------------------------------------------------
193
DRC667df922011-06-23 10:11:22 +0000194Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems
195containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use
196the X11 shared libraries provided with the system. The procedure for this is
DRC62f3a662011-08-24 00:03:31 +0000197system-specific, since it requires specifying such things as font directories,
198but the general outline is as follows (this procedure assumes that the viewer
199has already been built, per above.)
200
201 > cd {build_directory}
202
203 If performing an out-of-tree build:
204 > mkdir unix
205 > cp -R {source_directory}/unix/xserver unix/
206
207 > cp -R {xorg_source}/* unix/xserver/
208 (NOTE: {xorg_source} is the directory containing the Xorg source for the
209 machine on which you are building TigerVNC. The most recent versions of
210 Red Hat/CentOS/Fedora, for instance, provide an RPM called
211 "xorg-x11-server-source", which installs the Xorg source under
212 /usr/share/xorg-x11-server-source.)
213
214 > cd unix/xserver/
215 > patch -p1 < {source_directory}/unix/xserver{version}.patch
216 (where {version} matches the X server version you are building, such as
217 "17" for version 1.7.x.)
218 > autoreconf -fiv
219
Peter Åstrand01b24332011-10-31 08:14:40 +0000220 > ./configure --with-pic --without-dtrace --disable-static --disable-dri \
DRC62f3a662011-08-24 00:03:31 +0000221 --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
222 --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
223 --disable-config-dbus --disable-config-hal --disable-config-udev \
224 --disable-dri2 --enable-install-libxf86config --enable-glx \
225 --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
226 --with-fontdir=/usr/share/X11/fonts \
227 --with-xkb-path=/usr/share/X11/xkb \
228 --with-xkb-output=/var/lib/xkb \
DRC0bb7e132011-08-24 00:26:54 +0000229 --with-xkb-bin-directory=/usr/bin \
DRC62f3a662011-08-24 00:03:31 +0000230 --with-serverconfig-path=/usr/lib[64]/xorg \
231 --with-dri-driver-path=/usr/lib[64]/dri \
232 {additional configure options}
233 (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
234 6 and recent Fedora releases. You should customize it for your particular
235 system. In particular, it will be necessary to customize the font, XKB,
236 and DRI directories.)
237
238 > make TIGERVNC_SRCDIR={source_directory}
239
240
241Building the TigerVNC Server on Legacy Unix/Linux Systems
242---------------------------------------------------------
DRC667df922011-06-23 10:11:22 +0000243
244Those using systems with older versions of Xorg must build a "legacy-friendly"
245version of the TigerVNC Server. This is accomplished by downloading and
246building the more recent Xorg modules in a local directory and then building
247Xvnc such that it links against the local build of these libraries, not the X11
248libraries installed on the system. The "build-xorg" script in the TigerVNC
249source distribution (located under unix/) automates this process.
250
251The following procedure will build both the TigerVNC Viewer and a
252"legacy-friendly" version of the TigerVNC Server:
253
254 cd {build_directory}
255 sh {source_directory}/unix/build-xorg init
256 sh {source_directory}/unix/build-xorg build [additional CMake flags]
257
258build-xorg generates a version of Xvnc that has no external dependencies on the
259X11 shared libraries or any other distribution-specific shared libraries. This
260version of Xvnc should be transportable across multiple O/S distributions.
261build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later
262systems. It probably will not work on older systems. It has not been tested
263on non-Linux systems (yet).
264
265build-xorg can also be used to rebuild just the TigerVNC Server and Viewer,
266once the X11 modules and other dependencies have been built for the first time.
267This is convenient for testing changes that just apply to the TigerVNC source
268code. To accomplish this, run:
269
270 sh {source_directory}/unix/build-xorg rebuild [additional make flags]
271
272For instance,
273
274 sh {source_directory}/unix/build-xorg rebuild clean
275
276will clean both the Xvnc and vncviewer builds without destroying any of the
277build configuration or module dependencies.
278
279
DRCe4e604f2011-10-01 17:54:36 +0000280Building the Windows TigerVNC Viewer with MinGW
281-----------------------------------------------
DRC180c0162010-10-27 07:20:27 +0000282
DRCccc09692011-11-08 06:57:58 +0000283If building the Windows version of TigerVNC on a Windows build system, use
284the following procedure.
285
DRC180c0162010-10-27 07:20:27 +0000286 cd {build_directory}
DRC240a5ff2011-07-06 07:28:30 +0000287 cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory}
DRC180c0162010-10-27 07:20:27 +0000288 make
289
DRCccc09692011-11-08 06:57:58 +0000290If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section
291below.
DRC180c0162010-10-27 07:20:27 +0000292
293
294Debug Build
295-----------
296
DRCccc09692011-11-08 06:57:58 +0000297Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line.
DRC180c0162010-10-27 07:20:27 +0000298
299
DRCe4e604f2011-10-01 17:54:36 +0000300Self-Contained GCC Build
301------------------------
DRC8290dd62011-02-10 22:54:36 +0000302
DRCe4e604f2011-10-01 17:54:36 +0000303If TigerVNC is built using GCC (including MinGW), then it may depend on the
304libgcc or libstdc++ dynamic libraries. To eliminate this dependency, add
DRC8290dd62011-02-10 22:54:36 +0000305
DRCe4e604f2011-10-01 17:54:36 +0000306 -DBUILD_STATIC=1
DRC8290dd62011-02-10 22:54:36 +0000307
Adam Tkacf586b842011-04-27 11:20:18 +0000308to the CMake command line.
DRC8290dd62011-02-10 22:54:36 +0000309
310
DRCce355e32011-06-24 04:58:01 +0000311======================================
DRC240a5ff2011-07-06 07:28:30 +0000312Building High-Performance JPEG Support
313======================================
314
315In order to achieve its high levels of performance, TigerVNC relies on
316libjpeg-turbo (http://www.libjpeg-turbo.org), a derivative of libjpeg which
317uses SIMD instructions to accelerate baseline JPEG compression and
318decompression. If you are building TigerVNC on an operating system that
319includes libjpeg-turbo as a system library (for instance, Fedora 14 and later),
320then the TigerVNC build system should detect the system version of
321libjpeg-turbo automatically and link against it. However, this produces a
322version of TigerVNC that depends on the libjpeg-turbo dynamic libraries, and
323thus the TigerVNC binaries are not portable.
324
325To build a fully portable, cross-compatible version of TigerVNC with
326high-performance JPEG support, it is necessary to link against the
DRCccc09692011-11-08 06:57:58 +0000327libjpeg-turbo static library. This is also necessary when building the
328Windows or OS X versions of TigerVNC. To link against the libjpeg-turbo static
329library, first install the libjpeg-turbo SDK, which is available from
DRC240a5ff2011-07-06 07:28:30 +0000330https://sourceforge.net/projects/libjpeg-turbo/files/. Next, use the
331JPEG_INCLUDE_DIR and JPEG_LIBRARY CMake variables to specify the location of
332libjpeg-turbo. For example, adding
333
334 -DJPEG_INCLUDE_DIR=/opt/libjpeg-turbo/include \
335 -DJPEG_LIBRARY=/opt/libjpeg-turbo/lib/libjpeg.a
336
337to the CMake command line will link TigerVNC against a static version of
338libjpeg-turbo installed under /opt/TigerVNC (which is the normal install
339location for the libjpeg-turbo SDK on Unix and Linux platforms.) Replace "lib"
340with "lib32" or "lib64" to use the 32-bit or 64-bit version of the library on
34164-bit Linux platforms.
342
DRCccc09692011-11-08 06:57:58 +0000343When building on Windows systems, adding
DRC240a5ff2011-07-06 07:28:30 +0000344
345 -DJPEG_INCLUDE_DIR=/c/libjpeg-turbo-gcc[64]/include \
346 -DJPEG_LIBRARY=/c/libjpeg-turbo-gcc[64]/lib/libjpeg.a
347
348to the CMake command line will link TigerVNC against the static version of
349libjpeg-turbo provided by the libjpeg-turbo SDK for GCC (MinGW.)
350
351CMake will report:
352
353 Performing Test FOUND_LIBJPEG_TURBO - Success
354
355if it successfully finds libjpeg-turbo.
356
357
DRC15b6e052011-10-06 01:20:52 +0000358=====================
359Building Java Support
360=====================
361
362TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on
363any platform that has a Java Runtime Environment (JRE) installed. The Java
364viewer works similarly to the native viewer, but with lower performance.
365
366To build the Java TigerVNC Viewer, add
367
368 -DBUILD_JAVA=1
369
370to the CMake or build-xorg command line. The build system will attempt to find
371an installed Java Development Kit (JDK) and determine the appropriate paths for
372the Java compiler (javac) and the JAR creation utility (jar). You can override
373these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake
374variables. You can also override the default flags that are passed to javac
375by setting the JAVACFLAGS CMake variable. The build system will look for
376keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These
377tools are needed to sign the JAR file, which is necessary to enable certain
378functionality (such as clipboard transfers) when the Java viewer is used as an
379applet.
380
381If the Java viewer is built along with the Windows TigerVNC Server (WinVNC),
382then the build system will embed the Java viewer into WinVNC4.exe so that it
383will automatically be served up using WinVNC's built-in HTTP server.
384Similarly, if the Java viewer is built along with the Unix TigerVNC Server
385(Xvnc), then the build system will include the Java viewer in the server
386tarball.
387
Brian Hinzf88b3ad2013-12-02 02:53:10 +0000388By default, a self-signed certificate will be generated and used to sign the
389jar file. By specifying the following command line arguments to the CMake
390command line, an alternate certificate may be used for signing.
391
392 -DJAVA_KEYSTORE=${keystore_location_or_url}
393 -DJAVA_KEYSTORE_TYPE=${keystore_type} (Default: "jks")
394 -DJAVA_KEY_ALIAS=${keytore_key_alias}
395 -DJAVA_STOREPASS=${keystore_password}
396 -DJAVA_KEYPASS=${keystore_entry_password}
397 -DJAVA_TSA_URL=${url_of_timestamping_authority}
398
399The values of the JAVA_STOREPASS and JAVA_KEYPASS arguments may optionally be
400read from file or environment variables by prefixing the value with ":env "
401or ":file " (see the jarsigner documentation for more info):
402
403 export StorePass=tigervnc
404 export KeyPass=tigervnc
405 cmake \
406 ...
407 -DJAVA_STOREPASS=":env StorePass"
408 -DJAVA_KEYPASS=":env KeyPass"
409
DRC15b6e052011-10-06 01:20:52 +0000410
DRC240a5ff2011-07-06 07:28:30 +0000411======================================
DRCce355e32011-06-24 04:58:01 +0000412Building Native Language Support (NLS)
413======================================
414
DRCccc09692011-11-08 06:57:58 +0000415NLS requires gettext, which is supplied with most Linux distributions and
416with MinGW for Windows and which can easily be built from source on OS X and
417other Unix variants.
DRCce355e32011-06-24 04:58:01 +0000418
419You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
420specify the locations of libiconv and libintl, respectively. For instance,
421adding
422
423 -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
424
425to the CMake command line would link TigerVNC against a static version of
426libintl located under /opt/gettext. Adding
427
428 -DICONV_INCLUDE_DIR=/mingw/include \
429 -DICONV_LIBRARIES=/mingw/lib/libiconv.a \
430 -DGETTEXT_INCLUDE_DIR=/mingw/include \
431 -DLIBINTL_LIBRARY=/mingw/lib/libintl.a
432
433to the CMake command line would link TigerVNC against the static versions of
434libiconv and libintl included in the MinGW Developer Toolkit.
435
436
437===============================================
438Building Transport Layer Security (TLS) support
439===============================================
DRC8290dd62011-02-10 22:54:36 +0000440
Adam Tkac445d4ed2011-04-27 11:04:01 +0000441VeNCrypt (the TigerVNC security and authentication extensions) can be built
442with TLS support, which provides built-in encryption for VNC sessions. This
DRCce355e32011-06-24 04:58:01 +0000443requires GnuTLS, which is readily available in many Linux distributions but not
444as readily available in binary form on other types of systems. This section
DRC667df922011-06-23 10:11:22 +0000445describes the issues associated with building a version of TigerVNC with TLS
446support and how to work around those issues.
Adam Tkacf586b842011-04-27 11:20:18 +0000447
DRC667df922011-06-23 10:11:22 +0000448
449Unix/Mac
450--------
451
452In general, if you are building on a Unix-ish platform that has the GnuTLS
453libraries and include files installed in the standard system locations, then
454the TigerVNC build system should detect the system version of GnuTLS
455automatically and link against it. However, this produces a version of
456TigerVNC that depends on the GnuTLS dynamic libraries, and thus the TigerVNC
457binaries are not portable.
458
DRCce355e32011-06-24 04:58:01 +0000459To build a fully portable, cross-compatible version of TigerVNC with TLS
DRC667df922011-06-23 10:11:22 +0000460support, it is necessary to link against the GnuTLS static library (as well
461as the static libraries of its dependencies.) If you are lucky enough, then
462your O/S distribution may include pre-packaged versions of these static
463libraries. Otherwise, it will be necessary to build GnuTLS, libgcrypt,
464libtasn1, and libgpg-error from source.
465
466You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
DRCce355e32011-06-24 04:58:01 +0000467build TigerVNC against a custom build of GnuTLS that is installed in a
468non-system directory. For instance, adding
DRC667df922011-06-23 10:11:22 +0000469
470 -DGNUTLS_INCLUDE_DIR=/opt/gnutls/include \
471 -DGNUTLS_LIBRARY='/opt/gnutls/lib/libgnutls.a;/opt/gnutls/lib/libgcrypt.a;/opt/gnutls/lib/libgpg-error.a;/opt/gnutls/lib/libtasn1.a' \
472 -DUSE_INCLUDED_ZLIB=1
473
474to the CMake or 'build-xorg build' command line will cause TigerVNC to be
475statically linked against a custom installation of GnuTLS that resides under
DRCce355e32011-06-24 04:58:01 +0000476/opt/gnutls. GnuTLS depends on zlib, so specifying -DUSE_INCLUDED_ZLIB=1 will
DRC667df922011-06-23 10:11:22 +0000477satisfy that dependency using TigerVNC's in-tree version of zlib, which
478prevents TigerVNC from depending on the libz dynamic library.
479
480
481MinGW
482-----
DRC8290dd62011-02-10 22:54:36 +0000483
484An installer containing the GnuTLS header files, as well as static and dynamic
Adam Tkacf586b842011-04-27 11:20:18 +0000485link libraries for 32-bit MinGW, can be downloaded from the following site:
DRC8290dd62011-02-10 22:54:36 +0000486
487http://josefsson.org/gnutls4win/
488
Adam Tkacf586b842011-04-27 11:20:18 +0000489As of this writing, GnuTLS cannot be built cleanly with MinGW64 due to the fact
490that portions of the code assume an LP64 data model (Windows uses LLP64.)
491Thus, it is not possible at this time to produce a Win64 version of TigerVNC
492with TLS support.
DRC8290dd62011-02-10 22:54:36 +0000493
Adam Tkacf586b842011-04-27 11:20:18 +0000494Whether you use the above installer or build GnuTLS from source, make sure that
495you install the libraries and headers into a pathname that doesn't contain
496spaces (the installer will try to install under c:\Program Files unless you
497tell it otherwise.) If the GnuTLS include path contains spaces, then the MinGW
498resource compiler will barf when you try to build TigerVNC.
499
500You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
DRC8290dd62011-02-10 22:54:36 +0000501specify the directory under which you installed GnuTLS. For instance, adding
502
503 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
Adam Tkacf586b842011-04-27 11:20:18 +0000504 -DGNUTLS_LIBRARY=/c/gnutls/lib/libgnutls.dll.a
505
506to the CMake command line when using MinGW will cause TigerVNC to be linked
507against GnuTLS DLLs that are installed under c:\gnutls.
508
509Adding
510
511 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
DRC8290dd62011-02-10 22:54:36 +0000512 -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a'
513
Adam Tkacf586b842011-04-27 11:20:18 +0000514to the CMake command line will cause TigerVNC to be statically linked against
515GnuTLS libraries that are installed under c:\gnutls.
516
DRC8290dd62011-02-10 22:54:36 +0000517
DRC180c0162010-10-27 07:20:27 +0000518===================
519Installing TigerVNC
520===================
521
522You can use the build system to install TigerVNC into a directory of your
DRC667df922011-06-23 10:11:22 +0000523choosing. To do this, add:
DRC180c0162010-10-27 07:20:27 +0000524
525 -DCMAKE_INSTALL_PREFIX={install_directory}
526
DRCccc09692011-11-08 06:57:58 +0000527to the CMake command line. Then, you can run 'make install' to build and
528install it.
DRC180c0162010-10-27 07:20:27 +0000529
530If you don't specify CMAKE_INSTALL_PREFIX, then the default is
DRC667df922011-06-23 10:11:22 +0000531c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
DRC180c0162010-10-27 07:20:27 +0000532
533
DRC667df922011-06-23 10:11:22 +0000534=========================
535Creating Release Packages
536=========================
537
538The following commands can be used to create various types of release packages:
539
540
541Unix
542----
543
DRC667df922011-06-23 10:11:22 +0000544make tarball
545
546 Create a binary tarball containing the TigerVNC Viewer
547
548make servertarball
549
550 Create a binary tarball containing both the TigerVNC Server and Viewer
551
552make dmg
553
DRCaab38302011-06-25 20:24:02 +0000554 Create Macintosh disk image file that contains an application bundle of the
555 TigerVNC Viewer
DRC667df922011-06-23 10:11:22 +0000556
DRCaab38302011-06-25 20:24:02 +0000557make udmg
DRC667df922011-06-23 10:11:22 +0000558
559 On 64-bit OS X systems, this creates a version of the Macintosh package and
560 disk image which contains universal i386/x86-64 binaries. You should first
561 configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
562 out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
563 build system will look for the 32-bit build under {source_directory}/osxx86
DRCaab38302011-06-25 20:24:02 +0000564 by default, but you can override this by setting the OSX_X86_BUILD CMake
565 variable to the directory containing your configured 32-bit build. Either
566 the 64-bit or 32-bit build can be configured to be backward compatible by
567 using the instructions in the "Build Recipes" section.
DRC667df922011-06-23 10:11:22 +0000568
569
570Windows
571-------
572
DRCccc09692011-11-08 06:57:58 +0000573make installer
DRC667df922011-06-23 10:11:22 +0000574
DRCccc09692011-11-08 06:57:58 +0000575 Create a Windows installer using Inno Setup. The installer package
576 (TigerVNC[64].exe) will be located under {build_directory}.
DRC667df922011-06-23 10:11:22 +0000577
578
579=============
580Build Recipes
581=============
582
583
58432-bit Build on 64-bit Linux/Unix (including OS X)
585--------------------------------------------------
586
DRCdc4f3542011-08-24 00:30:49 +0000587Set the following environment variables before building TigerVNC.
DRC667df922011-06-23 10:11:22 +0000588
589 CFLAGS='-O3 -m32'
590 CXXFLAGS='-O3 -m32'
591 LDFLAGS=-m32
592
DRCdc4f3542011-08-24 00:30:49 +0000593If you are building the TigerVNC Server on a modern Unix/Linux system, then
594you will also need to pass the appropriate --host argument when configuring the
595X server source (for instance, --host=i686-pc-linux-gnu).
596
DRC667df922011-06-23 10:11:22 +0000597
59864-bit Backward-Compatible Build on 64-bit OS X
599-----------------------------------------------
600
601Add
602
603 -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \
604 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
605
606to the CMake command line. The OS X 10.5 SDK must be installed.
607
608
60932-bit Backward-Compatible Build on 64-bit OS X
610-----------------------------------------------
611
612Set the following environment variables:
613
614 CC=gcc-4.0
615 CXX=g++-4.0
616 CFLAGS='-O3 -m32'
617 CXXFLAGS='-O3 -m32'
618 LDFLAGS=-m32
619
620and add
621
622 -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \
623 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
624
625to the CMake command line. The OS X 10.4 SDK must be installed.
DRC180c0162010-10-27 07:20:27 +0000626
627
62864-bit MinGW Build on Cygwin
629----------------------------
630
631 cd {build_directory}
632 CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
633 RC=/usr/bin/x86_64-w64-mingw32-windres \
634 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
635 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
636 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
637 make
638
639This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
640other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
641packages (and their dependencies) must be installed.
642
643
64432-bit MinGW Build on Cygwin
645----------------------------
646
647 cd {build_directory}
648 CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
649 RC=/usr/bin/i686-w64-mingw32-windres \
650 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
651 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
652 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
653 make
654
655This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
656other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
657packages (and their dependencies) must be installed.
658
659
660MinGW-w64 Build on Windows
661--------------------------
662
663This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
664(which is faster than the Cygwin version):
665
666 cd {build_directory}
667 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
668 CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
669 RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
670 cmake -G "MSYS Makefiles" \
671 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
672 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
673 {source_directory}
674 make
675
676
677MinGW Build on Linux
678--------------------
679
680 cd {build_directory}
681 CC={mingw_binary_path}/i386-mingw32-gcc \
682 CXX={mingw_binary_path}/i386-mingw32-g++ \
683 RC={mingw_binary_path}/i386-mingw32-windres \
684 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
685 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
686 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
687 {source_directory}
688 make
Brian Hinz1ff04d12013-11-28 16:26:08 +0000689
690
691===============================
692Distribution-Specific Packaging
693===============================
694
695
696RPM Packages for RHEL / CentOS
697------------------------------
698
699The RPM spec files and patches used to create the nightly builds
700and releases can be found in the "contrib/rpm/el{5,6}" directories
701of the TigerVNC subversion trunk. All external source tarballs
702must be fetched manually and placed into the 'SOURCES' directory
703under the rpmbuild root. Additonally, the following macros need
704to be defined:
705
706 EL6:
707 %debug_package %{nil}
708
709 EL5:
710 %dist .el5
711 %_smp_mflags -j3
712 %debug_package %{nil}
713 %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
714
715
716Debian packages for Ubuntu 12.04LTS
717-----------------------------------
718The debian folder used to create the nightly builds and releases
719can be found in the "contrib/deb/ubuntu-precise" directory of the
720TigerVNC subversion trunk.