blob: 4ed0667135fb8f721b4c15b5932b3cb79e1d4503 [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
388
DRC240a5ff2011-07-06 07:28:30 +0000389======================================
DRCce355e32011-06-24 04:58:01 +0000390Building Native Language Support (NLS)
391======================================
392
DRCccc09692011-11-08 06:57:58 +0000393NLS requires gettext, which is supplied with most Linux distributions and
394with MinGW for Windows and which can easily be built from source on OS X and
395other Unix variants.
DRCce355e32011-06-24 04:58:01 +0000396
397You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
398specify the locations of libiconv and libintl, respectively. For instance,
399adding
400
401 -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
402
403to the CMake command line would link TigerVNC against a static version of
404libintl located under /opt/gettext. Adding
405
406 -DICONV_INCLUDE_DIR=/mingw/include \
407 -DICONV_LIBRARIES=/mingw/lib/libiconv.a \
408 -DGETTEXT_INCLUDE_DIR=/mingw/include \
409 -DLIBINTL_LIBRARY=/mingw/lib/libintl.a
410
411to the CMake command line would link TigerVNC against the static versions of
412libiconv and libintl included in the MinGW Developer Toolkit.
413
414
415===============================================
416Building Transport Layer Security (TLS) support
417===============================================
DRC8290dd62011-02-10 22:54:36 +0000418
Adam Tkac445d4ed2011-04-27 11:04:01 +0000419VeNCrypt (the TigerVNC security and authentication extensions) can be built
420with TLS support, which provides built-in encryption for VNC sessions. This
DRCce355e32011-06-24 04:58:01 +0000421requires GnuTLS, which is readily available in many Linux distributions but not
422as readily available in binary form on other types of systems. This section
DRC667df922011-06-23 10:11:22 +0000423describes the issues associated with building a version of TigerVNC with TLS
424support and how to work around those issues.
Adam Tkacf586b842011-04-27 11:20:18 +0000425
DRC667df922011-06-23 10:11:22 +0000426
427Unix/Mac
428--------
429
430In general, if you are building on a Unix-ish platform that has the GnuTLS
431libraries and include files installed in the standard system locations, then
432the TigerVNC build system should detect the system version of GnuTLS
433automatically and link against it. However, this produces a version of
434TigerVNC that depends on the GnuTLS dynamic libraries, and thus the TigerVNC
435binaries are not portable.
436
DRCce355e32011-06-24 04:58:01 +0000437To build a fully portable, cross-compatible version of TigerVNC with TLS
DRC667df922011-06-23 10:11:22 +0000438support, it is necessary to link against the GnuTLS static library (as well
439as the static libraries of its dependencies.) If you are lucky enough, then
440your O/S distribution may include pre-packaged versions of these static
441libraries. Otherwise, it will be necessary to build GnuTLS, libgcrypt,
442libtasn1, and libgpg-error from source.
443
444You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
DRCce355e32011-06-24 04:58:01 +0000445build TigerVNC against a custom build of GnuTLS that is installed in a
446non-system directory. For instance, adding
DRC667df922011-06-23 10:11:22 +0000447
448 -DGNUTLS_INCLUDE_DIR=/opt/gnutls/include \
449 -DGNUTLS_LIBRARY='/opt/gnutls/lib/libgnutls.a;/opt/gnutls/lib/libgcrypt.a;/opt/gnutls/lib/libgpg-error.a;/opt/gnutls/lib/libtasn1.a' \
450 -DUSE_INCLUDED_ZLIB=1
451
452to the CMake or 'build-xorg build' command line will cause TigerVNC to be
453statically linked against a custom installation of GnuTLS that resides under
DRCce355e32011-06-24 04:58:01 +0000454/opt/gnutls. GnuTLS depends on zlib, so specifying -DUSE_INCLUDED_ZLIB=1 will
DRC667df922011-06-23 10:11:22 +0000455satisfy that dependency using TigerVNC's in-tree version of zlib, which
456prevents TigerVNC from depending on the libz dynamic library.
457
458
459MinGW
460-----
DRC8290dd62011-02-10 22:54:36 +0000461
462An installer containing the GnuTLS header files, as well as static and dynamic
Adam Tkacf586b842011-04-27 11:20:18 +0000463link libraries for 32-bit MinGW, can be downloaded from the following site:
DRC8290dd62011-02-10 22:54:36 +0000464
465http://josefsson.org/gnutls4win/
466
Adam Tkacf586b842011-04-27 11:20:18 +0000467As of this writing, GnuTLS cannot be built cleanly with MinGW64 due to the fact
468that portions of the code assume an LP64 data model (Windows uses LLP64.)
469Thus, it is not possible at this time to produce a Win64 version of TigerVNC
470with TLS support.
DRC8290dd62011-02-10 22:54:36 +0000471
Adam Tkacf586b842011-04-27 11:20:18 +0000472Whether you use the above installer or build GnuTLS from source, make sure that
473you install the libraries and headers into a pathname that doesn't contain
474spaces (the installer will try to install under c:\Program Files unless you
475tell it otherwise.) If the GnuTLS include path contains spaces, then the MinGW
476resource compiler will barf when you try to build TigerVNC.
477
478You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
DRC8290dd62011-02-10 22:54:36 +0000479specify the directory under which you installed GnuTLS. For instance, adding
480
481 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
Adam Tkacf586b842011-04-27 11:20:18 +0000482 -DGNUTLS_LIBRARY=/c/gnutls/lib/libgnutls.dll.a
483
484to the CMake command line when using MinGW will cause TigerVNC to be linked
485against GnuTLS DLLs that are installed under c:\gnutls.
486
487Adding
488
489 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
DRC8290dd62011-02-10 22:54:36 +0000490 -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a'
491
Adam Tkacf586b842011-04-27 11:20:18 +0000492to the CMake command line will cause TigerVNC to be statically linked against
493GnuTLS libraries that are installed under c:\gnutls.
494
DRC8290dd62011-02-10 22:54:36 +0000495
DRC180c0162010-10-27 07:20:27 +0000496===================
497Installing TigerVNC
498===================
499
500You can use the build system to install TigerVNC into a directory of your
DRC667df922011-06-23 10:11:22 +0000501choosing. To do this, add:
DRC180c0162010-10-27 07:20:27 +0000502
503 -DCMAKE_INSTALL_PREFIX={install_directory}
504
DRCccc09692011-11-08 06:57:58 +0000505to the CMake command line. Then, you can run 'make install' to build and
506install it.
DRC180c0162010-10-27 07:20:27 +0000507
508If you don't specify CMAKE_INSTALL_PREFIX, then the default is
DRC667df922011-06-23 10:11:22 +0000509c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
DRC180c0162010-10-27 07:20:27 +0000510
511
DRC667df922011-06-23 10:11:22 +0000512=========================
513Creating Release Packages
514=========================
515
516The following commands can be used to create various types of release packages:
517
518
519Unix
520----
521
DRC667df922011-06-23 10:11:22 +0000522make tarball
523
524 Create a binary tarball containing the TigerVNC Viewer
525
526make servertarball
527
528 Create a binary tarball containing both the TigerVNC Server and Viewer
529
530make dmg
531
DRCaab38302011-06-25 20:24:02 +0000532 Create Macintosh disk image file that contains an application bundle of the
533 TigerVNC Viewer
DRC667df922011-06-23 10:11:22 +0000534
DRCaab38302011-06-25 20:24:02 +0000535make udmg
DRC667df922011-06-23 10:11:22 +0000536
537 On 64-bit OS X systems, this creates a version of the Macintosh package and
538 disk image which contains universal i386/x86-64 binaries. You should first
539 configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
540 out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
541 build system will look for the 32-bit build under {source_directory}/osxx86
DRCaab38302011-06-25 20:24:02 +0000542 by default, but you can override this by setting the OSX_X86_BUILD CMake
543 variable to the directory containing your configured 32-bit build. Either
544 the 64-bit or 32-bit build can be configured to be backward compatible by
545 using the instructions in the "Build Recipes" section.
DRC667df922011-06-23 10:11:22 +0000546
547
548Windows
549-------
550
DRCccc09692011-11-08 06:57:58 +0000551make installer
DRC667df922011-06-23 10:11:22 +0000552
DRCccc09692011-11-08 06:57:58 +0000553 Create a Windows installer using Inno Setup. The installer package
554 (TigerVNC[64].exe) will be located under {build_directory}.
DRC667df922011-06-23 10:11:22 +0000555
556
557=============
558Build Recipes
559=============
560
561
56232-bit Build on 64-bit Linux/Unix (including OS X)
563--------------------------------------------------
564
DRCdc4f3542011-08-24 00:30:49 +0000565Set the following environment variables before building TigerVNC.
DRC667df922011-06-23 10:11:22 +0000566
567 CFLAGS='-O3 -m32'
568 CXXFLAGS='-O3 -m32'
569 LDFLAGS=-m32
570
DRCdc4f3542011-08-24 00:30:49 +0000571If you are building the TigerVNC Server on a modern Unix/Linux system, then
572you will also need to pass the appropriate --host argument when configuring the
573X server source (for instance, --host=i686-pc-linux-gnu).
574
DRC667df922011-06-23 10:11:22 +0000575
57664-bit Backward-Compatible Build on 64-bit OS X
577-----------------------------------------------
578
579Add
580
581 -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \
582 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
583
584to the CMake command line. The OS X 10.5 SDK must be installed.
585
586
58732-bit Backward-Compatible Build on 64-bit OS X
588-----------------------------------------------
589
590Set the following environment variables:
591
592 CC=gcc-4.0
593 CXX=g++-4.0
594 CFLAGS='-O3 -m32'
595 CXXFLAGS='-O3 -m32'
596 LDFLAGS=-m32
597
598and add
599
600 -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \
601 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
602
603to the CMake command line. The OS X 10.4 SDK must be installed.
DRC180c0162010-10-27 07:20:27 +0000604
605
60664-bit MinGW Build on Cygwin
607----------------------------
608
609 cd {build_directory}
610 CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
611 RC=/usr/bin/x86_64-w64-mingw32-windres \
612 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
613 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
614 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
615 make
616
617This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
618other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
619packages (and their dependencies) must be installed.
620
621
62232-bit MinGW Build on Cygwin
623----------------------------
624
625 cd {build_directory}
626 CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
627 RC=/usr/bin/i686-w64-mingw32-windres \
628 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
629 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
630 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
631 make
632
633This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
634other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
635packages (and their dependencies) must be installed.
636
637
638MinGW-w64 Build on Windows
639--------------------------
640
641This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
642(which is faster than the Cygwin version):
643
644 cd {build_directory}
645 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
646 CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
647 RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
648 cmake -G "MSYS Makefiles" \
649 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
650 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
651 {source_directory}
652 make
653
654
655MinGW Build on Linux
656--------------------
657
658 cd {build_directory}
659 CC={mingw_binary_path}/i386-mingw32-gcc \
660 CXX={mingw_binary_path}/i386-mingw32-g++ \
661 RC={mingw_binary_path}/i386-mingw32-windres \
662 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
663 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
664 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
665 {source_directory}
666 make
Brian Hinz1ff04d12013-11-28 16:26:08 +0000667
668
669===============================
670Distribution-Specific Packaging
671===============================
672
673
674RPM Packages for RHEL / CentOS
675------------------------------
676
677The RPM spec files and patches used to create the nightly builds
678and releases can be found in the "contrib/rpm/el{5,6}" directories
679of the TigerVNC subversion trunk. All external source tarballs
680must be fetched manually and placed into the 'SOURCES' directory
681under the rpmbuild root. Additonally, the following macros need
682to be defined:
683
684 EL6:
685 %debug_package %{nil}
686
687 EL5:
688 %dist .el5
689 %_smp_mflags -j3
690 %debug_package %{nil}
691 %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
692
693
694Debian packages for Ubuntu 12.04LTS
695-----------------------------------
696The debian folder used to create the nightly builds and releases
697can be found in the "contrib/deb/ubuntu-precise" directory of the
698TigerVNC subversion trunk.