blob: 044e7c472a8155ea9e23cf7da58b6111d304ad3e [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
DRC69854b42011-05-13 09:31:24 +000012-- If building TLS support:
13 * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
14
DRCce355e32011-06-24 04:58:01 +000015-- If building native language support (NLS):
16 * Gnu gettext 0.14.4 or later
17 * See "Building Native Language Support" below.
18
DRC667df922011-06-23 10:11:22 +000019-- libjpeg-turbo SDK
DRCce355e32011-06-24 04:58:01 +000020 * If your system does not include libjpeg-turbo, then you can download the
21 SDK from http://sourceforge.net/projects/libjpeg-turbo/files/
DRC240a5ff2011-07-06 07:28:30 +000022 * See "Building High-Performance JPEG Support" below.
DRC667df922011-06-23 10:11:22 +000023
24
25=========================
26Build Requirements (Unix)
27=========================
28
29-- Non-Mac platforms:
30 * X11 development kit
31
DRC2c0ea902010-04-16 07:33:41 +000032-- If building Xvnc:
DRC667df922011-06-23 10:11:22 +000033 * autoconf 2.57 or later
34 * automake 1.7 or later
35 * libtool 1.4 or later
36 * OpenSSL v0.9.7 or later
DRC2c0ea902010-04-16 07:33:41 +000037 * Python v2.3 or later
38 * zlib v1.2 or later
DRC2c0ea902010-04-16 07:33:41 +000039
DRC69854b42011-05-13 09:31:24 +000040 * pkgconfig 0.20 or later
41 If you are using an older RPM-based system which does not meet this
42 minimum requirement (such as Red Hat Enterprise Linux 4), then you can
43 build pkgconfig 0.20 from the Fedora 5 source RPM:
44 http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/pkgconfig-0.20-2.2.1.src.rpm
45
DRC69854b42011-05-13 09:31:24 +000046 * gettext 0.14.4 or later
47 If you are using an older RPM-based system which does not meet this
48 minimum requirement (such as Red Hat Enterprise Linux 4), then you can
49 build gettext 0.14.5 from the Fedora 5 source RPM:
50 http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/gettext-0.14.5-3.src.rpm
51 NOTE: gcj and libgcj are required when building the above source RPM.
DRC2b0b1942011-02-09 03:10:44 +000052
DRC2c0ea902010-04-16 07:33:41 +000053
DRC667df922011-06-23 10:11:22 +000054============================
55Build Requirements (Windows)
56============================
DRC180c0162010-10-27 07:20:27 +000057
58-- Microsoft Visual C++ 2005 or later
59
60 If you don't already have Visual C++, then the easiest way to get it is by
61 installing the Windows SDK:
62
63 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
64
65 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
66 everything necessary to build TigerVNC.
67
68 * For 32-bit builds, you can also use Microsoft Visual C++ Express
69 Edition. Visual C++ Express Edition is a free download.
70 * If you intend to build TigerVNC from the command line, then add the
71 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
72 environment variables. This is generally accomplished by executing
73 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
74 vcvars64.bat are part of Visual C++ and are located in the same directory
75 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
76 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
77 environment.
78
79... OR ...
80
81-- MinGW
82
DRC180c0162010-10-27 07:20:27 +000083-- Inno Setup (needed to build the TigerVNC installer)
84 Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
85 You also need the Inno Setup Preprocessor, which is available in the
86 Inno Setup QuickStart Pack.
87
88 Add the directory containing iscc.exe (for instance,
89 C:\Program Files\Inno Setup 5) to the system or user PATH environment
90 variable prior to building TigerVNC.
91
DRC667df922011-06-23 10:11:22 +000092
DRC15b6e052011-10-06 01:20:52 +000093=========================
94Build Requirements (Java)
95=========================
96
97-- Sun/Oracle JDK v5 or later or OpenJDK
98
99-- See "Building Java Support" below.
100
101
DRC180c0162010-10-27 07:20:27 +0000102==================
103Out-of-Tree Builds
104==================
105
106Binary objects, libraries, and executables are generated in the same directory
107from which cmake was executed (the "binary directory"), and this directory need
108not necessarily be the same as the TigerVNC source directory. You can create
109multiple independent binary directories, in which different versions of
110TigerVNC can be built from the same source tree using different compilers or
111settings. In the sections below, {build_directory} refers to the binary
112directory, whereas {source_directory} refers to the TigerVNC source directory.
113For in-tree builds, these directories are the same.
114
115
116=================
117Building TigerVNC
118=================
119
120
DRC62f3a662011-08-24 00:03:31 +0000121Building the TigerVNC Viewer on Unix/Mac Systems
122------------------------------------------------
DRC667df922011-06-23 10:11:22 +0000123
124The following procedure will build the TigerVNC Viewer on Linux and Unix
125systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See
126"Build Recipes" for specific build instructions for building a 32-bit version
127of TigerVNC on 64-bit systems.
128
129 cd {build_directory}
DRC240a5ff2011-07-06 07:28:30 +0000130 cmake -G "Unix Makefiles" [additional CMake flags] {source_directory}
DRC667df922011-06-23 10:11:22 +0000131 make
132
DRC62f3a662011-08-24 00:03:31 +0000133
134Building the TigerVNC Server on Modern Unix/Linux Systems
135---------------------------------------------------------
136
DRC667df922011-06-23 10:11:22 +0000137Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems
138containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use
139the X11 shared libraries provided with the system. The procedure for this is
DRC62f3a662011-08-24 00:03:31 +0000140system-specific, since it requires specifying such things as font directories,
141but the general outline is as follows (this procedure assumes that the viewer
142has already been built, per above.)
143
144 > cd {build_directory}
145
146 If performing an out-of-tree build:
147 > mkdir unix
148 > cp -R {source_directory}/unix/xserver unix/
149
150 > cp -R {xorg_source}/* unix/xserver/
151 (NOTE: {xorg_source} is the directory containing the Xorg source for the
152 machine on which you are building TigerVNC. The most recent versions of
153 Red Hat/CentOS/Fedora, for instance, provide an RPM called
154 "xorg-x11-server-source", which installs the Xorg source under
155 /usr/share/xorg-x11-server-source.)
156
157 > cd unix/xserver/
158 > patch -p1 < {source_directory}/unix/xserver{version}.patch
159 (where {version} matches the X server version you are building, such as
160 "17" for version 1.7.x.)
161 > autoreconf -fiv
162
Peter Åstrand01b24332011-10-31 08:14:40 +0000163 > ./configure --with-pic --without-dtrace --disable-static --disable-dri \
DRC62f3a662011-08-24 00:03:31 +0000164 --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
165 --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
166 --disable-config-dbus --disable-config-hal --disable-config-udev \
167 --disable-dri2 --enable-install-libxf86config --enable-glx \
168 --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
169 --with-fontdir=/usr/share/X11/fonts \
170 --with-xkb-path=/usr/share/X11/xkb \
171 --with-xkb-output=/var/lib/xkb \
DRC0bb7e132011-08-24 00:26:54 +0000172 --with-xkb-bin-directory=/usr/bin \
DRC62f3a662011-08-24 00:03:31 +0000173 --with-serverconfig-path=/usr/lib[64]/xorg \
174 --with-dri-driver-path=/usr/lib[64]/dri \
175 {additional configure options}
176 (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
177 6 and recent Fedora releases. You should customize it for your particular
178 system. In particular, it will be necessary to customize the font, XKB,
179 and DRI directories.)
180
181 > make TIGERVNC_SRCDIR={source_directory}
182
183
184Building the TigerVNC Server on Legacy Unix/Linux Systems
185---------------------------------------------------------
DRC667df922011-06-23 10:11:22 +0000186
187Those using systems with older versions of Xorg must build a "legacy-friendly"
188version of the TigerVNC Server. This is accomplished by downloading and
189building the more recent Xorg modules in a local directory and then building
190Xvnc such that it links against the local build of these libraries, not the X11
191libraries installed on the system. The "build-xorg" script in the TigerVNC
192source distribution (located under unix/) automates this process.
193
194The following procedure will build both the TigerVNC Viewer and a
195"legacy-friendly" version of the TigerVNC Server:
196
197 cd {build_directory}
198 sh {source_directory}/unix/build-xorg init
199 sh {source_directory}/unix/build-xorg build [additional CMake flags]
200
201build-xorg generates a version of Xvnc that has no external dependencies on the
202X11 shared libraries or any other distribution-specific shared libraries. This
203version of Xvnc should be transportable across multiple O/S distributions.
204build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later
205systems. It probably will not work on older systems. It has not been tested
206on non-Linux systems (yet).
207
208build-xorg can also be used to rebuild just the TigerVNC Server and Viewer,
209once the X11 modules and other dependencies have been built for the first time.
210This is convenient for testing changes that just apply to the TigerVNC source
211code. To accomplish this, run:
212
213 sh {source_directory}/unix/build-xorg rebuild [additional make flags]
214
215For instance,
216
217 sh {source_directory}/unix/build-xorg rebuild clean
218
219will clean both the Xvnc and vncviewer builds without destroying any of the
220build configuration or module dependencies.
221
222
DRCe4e604f2011-10-01 17:54:36 +0000223Building the Windows TigerVNC Viewer/Server with Visual C++ (Command Line)
224--------------------------------------------------------------------------
DRC180c0162010-10-27 07:20:27 +0000225
226 cd {build_directory}
DRC240a5ff2011-07-06 07:28:30 +0000227 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release [additional CMake flags] {source_directory}
DRC180c0162010-10-27 07:20:27 +0000228 nmake
229
230This will build either a 32-bit or a 64-bit version of TigerVNC, depending
231on which version of cl.exe is in the PATH.
232
233
DRCe4e604f2011-10-01 17:54:36 +0000234Building the Windows TigerVNC Viewer/Server with Visual C++ (IDE)
235-----------------------------------------------------------------
DRC180c0162010-10-27 07:20:27 +0000236
237Choose the appropriate CMake generator option for your version of Visual Studio
238(run "cmake" with no arguments for a list of available generators.) For
239instance:
240
241 cd {build_directory}
DRC240a5ff2011-07-06 07:28:30 +0000242 cmake -G "Visual Studio 9 2008" [additional CMake flags] {source_directory}
DRC180c0162010-10-27 07:20:27 +0000243
244You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
245configurations in that project ("Debug", "Release", etc.) to generate a full
246build of TigerVNC.
247
248
DRCe4e604f2011-10-01 17:54:36 +0000249Building the Windows TigerVNC Viewer with MinGW
250-----------------------------------------------
DRC180c0162010-10-27 07:20:27 +0000251
252 cd {build_directory}
DRC240a5ff2011-07-06 07:28:30 +0000253 cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory}
DRC180c0162010-10-27 07:20:27 +0000254 make
255
256This will generate only vncviewer. Currently, Visual C++ must be used to build
257WinVNC.
258
259
260Debug Build
261-----------
262
Adam Tkacf586b842011-04-27 11:20:18 +0000263Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line. Or, if building with
DRC180c0162010-10-27 07:20:27 +0000264NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
265NMake.)
266
267
DRCe4e604f2011-10-01 17:54:36 +0000268Self-Contained GCC Build
269------------------------
DRC8290dd62011-02-10 22:54:36 +0000270
DRCe4e604f2011-10-01 17:54:36 +0000271If TigerVNC is built using GCC (including MinGW), then it may depend on the
272libgcc or libstdc++ dynamic libraries. To eliminate this dependency, add
DRC8290dd62011-02-10 22:54:36 +0000273
DRCe4e604f2011-10-01 17:54:36 +0000274 -DBUILD_STATIC=1
DRC8290dd62011-02-10 22:54:36 +0000275
Adam Tkacf586b842011-04-27 11:20:18 +0000276to the CMake command line.
DRC8290dd62011-02-10 22:54:36 +0000277
278
DRCce355e32011-06-24 04:58:01 +0000279======================================
DRC240a5ff2011-07-06 07:28:30 +0000280Building High-Performance JPEG Support
281======================================
282
283In order to achieve its high levels of performance, TigerVNC relies on
284libjpeg-turbo (http://www.libjpeg-turbo.org), a derivative of libjpeg which
285uses SIMD instructions to accelerate baseline JPEG compression and
286decompression. If you are building TigerVNC on an operating system that
287includes libjpeg-turbo as a system library (for instance, Fedora 14 and later),
288then the TigerVNC build system should detect the system version of
289libjpeg-turbo automatically and link against it. However, this produces a
290version of TigerVNC that depends on the libjpeg-turbo dynamic libraries, and
291thus the TigerVNC binaries are not portable.
292
293To build a fully portable, cross-compatible version of TigerVNC with
294high-performance JPEG support, it is necessary to link against the
295libjpeg-turbo static library. This is also necessary when building TigerVNC on
296Windows or OS X. To link against the libjpeg-turbo static library, first
297install the libjpeg-turbo SDK, which is available from
298https://sourceforge.net/projects/libjpeg-turbo/files/. Next, use the
299JPEG_INCLUDE_DIR and JPEG_LIBRARY CMake variables to specify the location of
300libjpeg-turbo. For example, adding
301
302 -DJPEG_INCLUDE_DIR=/opt/libjpeg-turbo/include \
303 -DJPEG_LIBRARY=/opt/libjpeg-turbo/lib/libjpeg.a
304
305to the CMake command line will link TigerVNC against a static version of
306libjpeg-turbo installed under /opt/TigerVNC (which is the normal install
307location for the libjpeg-turbo SDK on Unix and Linux platforms.) Replace "lib"
308with "lib32" or "lib64" to use the 32-bit or 64-bit version of the library on
30964-bit Linux platforms.
310
311Adding
312
313 -DJPEG_INCLUDE_DIR=c:\libjpeg-turbo[64]\include \
314 -DJPEG_LIBRARY=c:\libjpeg-turbo[64]\lib\jpeg-static.lib
315
316to the CMake command line will link TigerVNC against the static version of
317libjpeg-turbo provided by the libjpeg-turbo SDK for Visual C++.
318
319Adding
320
321 -DJPEG_INCLUDE_DIR=/c/libjpeg-turbo-gcc[64]/include \
322 -DJPEG_LIBRARY=/c/libjpeg-turbo-gcc[64]/lib/libjpeg.a
323
324to the CMake command line will link TigerVNC against the static version of
325libjpeg-turbo provided by the libjpeg-turbo SDK for GCC (MinGW.)
326
327CMake will report:
328
329 Performing Test FOUND_LIBJPEG_TURBO - Success
330
331if it successfully finds libjpeg-turbo.
332
333
DRC15b6e052011-10-06 01:20:52 +0000334=====================
335Building Java Support
336=====================
337
338TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on
339any platform that has a Java Runtime Environment (JRE) installed. The Java
340viewer works similarly to the native viewer, but with lower performance.
341
342To build the Java TigerVNC Viewer, add
343
344 -DBUILD_JAVA=1
345
346to the CMake or build-xorg command line. The build system will attempt to find
347an installed Java Development Kit (JDK) and determine the appropriate paths for
348the Java compiler (javac) and the JAR creation utility (jar). You can override
349these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake
350variables. You can also override the default flags that are passed to javac
351by setting the JAVACFLAGS CMake variable. The build system will look for
352keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These
353tools are needed to sign the JAR file, which is necessary to enable certain
354functionality (such as clipboard transfers) when the Java viewer is used as an
355applet.
356
357If the Java viewer is built along with the Windows TigerVNC Server (WinVNC),
358then the build system will embed the Java viewer into WinVNC4.exe so that it
359will automatically be served up using WinVNC's built-in HTTP server.
360Similarly, if the Java viewer is built along with the Unix TigerVNC Server
361(Xvnc), then the build system will include the Java viewer in the server
362tarball.
363
364
DRC240a5ff2011-07-06 07:28:30 +0000365======================================
DRCce355e32011-06-24 04:58:01 +0000366Building Native Language Support (NLS)
367======================================
368
369NLS requires gettext, which is supplied with most Linux distributions but not
370with most other operating systems. Building gettext from source is
371straightforward on Mac and other Unix variants, but on Windows it requires
372MinGW. Thus, it is not possible to enable NLS when building TigerVNC with
373Visual C++.
374
375You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
376specify the locations of libiconv and libintl, respectively. For instance,
377adding
378
379 -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
380
381to the CMake command line would link TigerVNC against a static version of
382libintl located under /opt/gettext. Adding
383
384 -DICONV_INCLUDE_DIR=/mingw/include \
385 -DICONV_LIBRARIES=/mingw/lib/libiconv.a \
386 -DGETTEXT_INCLUDE_DIR=/mingw/include \
387 -DLIBINTL_LIBRARY=/mingw/lib/libintl.a
388
389to the CMake command line would link TigerVNC against the static versions of
390libiconv and libintl included in the MinGW Developer Toolkit.
391
392
393===============================================
394Building Transport Layer Security (TLS) support
395===============================================
DRC8290dd62011-02-10 22:54:36 +0000396
Adam Tkac445d4ed2011-04-27 11:04:01 +0000397VeNCrypt (the TigerVNC security and authentication extensions) can be built
398with TLS support, which provides built-in encryption for VNC sessions. This
DRCce355e32011-06-24 04:58:01 +0000399requires GnuTLS, which is readily available in many Linux distributions but not
400as readily available in binary form on other types of systems. This section
DRC667df922011-06-23 10:11:22 +0000401describes the issues associated with building a version of TigerVNC with TLS
402support and how to work around those issues.
Adam Tkacf586b842011-04-27 11:20:18 +0000403
DRC667df922011-06-23 10:11:22 +0000404
405Unix/Mac
406--------
407
408In general, if you are building on a Unix-ish platform that has the GnuTLS
409libraries and include files installed in the standard system locations, then
410the TigerVNC build system should detect the system version of GnuTLS
411automatically and link against it. However, this produces a version of
412TigerVNC that depends on the GnuTLS dynamic libraries, and thus the TigerVNC
413binaries are not portable.
414
DRCce355e32011-06-24 04:58:01 +0000415To build a fully portable, cross-compatible version of TigerVNC with TLS
DRC667df922011-06-23 10:11:22 +0000416support, it is necessary to link against the GnuTLS static library (as well
417as the static libraries of its dependencies.) If you are lucky enough, then
418your O/S distribution may include pre-packaged versions of these static
419libraries. Otherwise, it will be necessary to build GnuTLS, libgcrypt,
420libtasn1, and libgpg-error from source.
421
422You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
DRCce355e32011-06-24 04:58:01 +0000423build TigerVNC against a custom build of GnuTLS that is installed in a
424non-system directory. For instance, adding
DRC667df922011-06-23 10:11:22 +0000425
426 -DGNUTLS_INCLUDE_DIR=/opt/gnutls/include \
427 -DGNUTLS_LIBRARY='/opt/gnutls/lib/libgnutls.a;/opt/gnutls/lib/libgcrypt.a;/opt/gnutls/lib/libgpg-error.a;/opt/gnutls/lib/libtasn1.a' \
428 -DUSE_INCLUDED_ZLIB=1
429
430to the CMake or 'build-xorg build' command line will cause TigerVNC to be
431statically linked against a custom installation of GnuTLS that resides under
DRCce355e32011-06-24 04:58:01 +0000432/opt/gnutls. GnuTLS depends on zlib, so specifying -DUSE_INCLUDED_ZLIB=1 will
DRC667df922011-06-23 10:11:22 +0000433satisfy that dependency using TigerVNC's in-tree version of zlib, which
434prevents TigerVNC from depending on the libz dynamic library.
435
436
437MinGW
438-----
DRC8290dd62011-02-10 22:54:36 +0000439
440An installer containing the GnuTLS header files, as well as static and dynamic
Adam Tkacf586b842011-04-27 11:20:18 +0000441link libraries for 32-bit MinGW, can be downloaded from the following site:
DRC8290dd62011-02-10 22:54:36 +0000442
443http://josefsson.org/gnutls4win/
444
Adam Tkacf586b842011-04-27 11:20:18 +0000445As of this writing, GnuTLS cannot be built cleanly with MinGW64 due to the fact
446that portions of the code assume an LP64 data model (Windows uses LLP64.)
447Thus, it is not possible at this time to produce a Win64 version of TigerVNC
448with TLS support.
DRC8290dd62011-02-10 22:54:36 +0000449
Adam Tkacf586b842011-04-27 11:20:18 +0000450Whether you use the above installer or build GnuTLS from source, make sure that
451you install the libraries and headers into a pathname that doesn't contain
452spaces (the installer will try to install under c:\Program Files unless you
453tell it otherwise.) If the GnuTLS include path contains spaces, then the MinGW
454resource compiler will barf when you try to build TigerVNC.
455
456You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
DRC8290dd62011-02-10 22:54:36 +0000457specify the directory under which you installed GnuTLS. For instance, adding
458
459 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
Adam Tkacf586b842011-04-27 11:20:18 +0000460 -DGNUTLS_LIBRARY=/c/gnutls/lib/libgnutls.dll.a
461
462to the CMake command line when using MinGW will cause TigerVNC to be linked
463against GnuTLS DLLs that are installed under c:\gnutls.
464
465Adding
466
467 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
DRC8290dd62011-02-10 22:54:36 +0000468 -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a'
469
Adam Tkacf586b842011-04-27 11:20:18 +0000470to the CMake command line will cause TigerVNC to be statically linked against
471GnuTLS libraries that are installed under c:\gnutls.
472
473Note that the use of MinGW means that only the TigerVNC viewer can be built,
474not the server.
475
DRC667df922011-06-23 10:11:22 +0000476
Adam Tkacf586b842011-04-27 11:20:18 +0000477Visual C++
478----------
479
480There is generally no sane way to build GnuTLS and its dependencies using
481Visual C++. Thus, it is necessary to either build the libraries with MinGW (or
482download 32-bit versions of these from the link above), generate Visual C++
483import libraries from the DLLs, then link TigerVNC against the Visual C++
484import libraries.
485
486In the instructions below, {gnutls_path} indicates the path under which GnuTLS
487is installed (Example: c:\Program Files\GnuTLS-2.10.1).
488
489To generate Visual C++ import libraries:
490
491cd {gnutls_path}\lib
492lib /def:..\bin\libgnutls-{version}.def /out:libgnutls.lib
493
494Now, you can add the following arguments to the CMake command line:
495
496 -DGNUTLS_INCLUDE_DIR={gnutls_path}\include \
497 -DGNUTLS_LIBRARY={gnutls_path}\lib\libgnutls.lib
498
499to build TigerVNC against the GnuTLS DLLs installed under {gnutls_path}.
DRC8290dd62011-02-10 22:54:36 +0000500
501
DRC180c0162010-10-27 07:20:27 +0000502===================
503Installing TigerVNC
504===================
505
506You can use the build system to install TigerVNC into a directory of your
DRC667df922011-06-23 10:11:22 +0000507choosing. To do this, add:
DRC180c0162010-10-27 07:20:27 +0000508
509 -DCMAKE_INSTALL_PREFIX={install_directory}
510
DRC231ee422011-07-28 07:22:39 +0000511to the CMake command line. Then, you can run 'make install' or 'nmake install'
512(or build the "install" target in the Visual Studio IDE) to build and install
513it.
DRC180c0162010-10-27 07:20:27 +0000514
515If you don't specify CMAKE_INSTALL_PREFIX, then the default is
DRC667df922011-06-23 10:11:22 +0000516c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
DRC180c0162010-10-27 07:20:27 +0000517
518
DRC667df922011-06-23 10:11:22 +0000519=========================
520Creating Release Packages
521=========================
522
523The following commands can be used to create various types of release packages:
524
525
526Unix
527----
528
DRC667df922011-06-23 10:11:22 +0000529make tarball
530
531 Create a binary tarball containing the TigerVNC Viewer
532
533make servertarball
534
535 Create a binary tarball containing both the TigerVNC Server and Viewer
536
537make dmg
538
DRCaab38302011-06-25 20:24:02 +0000539 Create Macintosh disk image file that contains an application bundle of the
540 TigerVNC Viewer
DRC667df922011-06-23 10:11:22 +0000541
DRCaab38302011-06-25 20:24:02 +0000542make udmg
DRC667df922011-06-23 10:11:22 +0000543
544 On 64-bit OS X systems, this creates a version of the Macintosh package and
545 disk image which contains universal i386/x86-64 binaries. You should first
546 configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
547 out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
548 build system will look for the 32-bit build under {source_directory}/osxx86
DRCaab38302011-06-25 20:24:02 +0000549 by default, but you can override this by setting the OSX_X86_BUILD CMake
550 variable to the directory containing your configured 32-bit build. Either
551 the 64-bit or 32-bit build can be configured to be backward compatible by
552 using the instructions in the "Build Recipes" section.
DRC667df922011-06-23 10:11:22 +0000553
554
555Windows
556-------
557
558If using NMake:
559
560 cd {build_directory}
561 nmake installer
562
563If using MinGW:
564
565 cd {build_directory}
566 make installer
567
568If using the Visual Studio IDE, build the "installer" project.
569
570The installer package (TigerVNC[64].exe) will be located under
571{build_directory}. If building using the Visual Studio IDE, then the installer
572package will be located in a subdirectory with the same name as the
573configuration you built (such as {build_directory}\Debug\ or
574{build_directory}\Release\).
575
576NOTE: If TigerVNC is built with TLS support, then the build system will
577attempt to package the GnuTLS DLLs into the Windows installer. It looks for
578these DLLs in a directory called "bin" one level up from GNUTLS_INCLUDE_DIR.
579
580
581=============
582Build Recipes
583=============
584
585
58632-bit Build on 64-bit Linux/Unix (including OS X)
587--------------------------------------------------
588
DRCdc4f3542011-08-24 00:30:49 +0000589Set the following environment variables before building TigerVNC.
DRC667df922011-06-23 10:11:22 +0000590
591 CFLAGS='-O3 -m32'
592 CXXFLAGS='-O3 -m32'
593 LDFLAGS=-m32
594
DRCdc4f3542011-08-24 00:30:49 +0000595If you are building the TigerVNC Server on a modern Unix/Linux system, then
596you will also need to pass the appropriate --host argument when configuring the
597X server source (for instance, --host=i686-pc-linux-gnu).
598
DRC667df922011-06-23 10:11:22 +0000599
60064-bit Backward-Compatible Build on 64-bit OS X
601-----------------------------------------------
602
603Add
604
605 -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \
606 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
607
608to the CMake command line. The OS X 10.5 SDK must be installed.
609
610
61132-bit Backward-Compatible Build on 64-bit OS X
612-----------------------------------------------
613
614Set the following environment variables:
615
616 CC=gcc-4.0
617 CXX=g++-4.0
618 CFLAGS='-O3 -m32'
619 CXXFLAGS='-O3 -m32'
620 LDFLAGS=-m32
621
622and add
623
624 -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \
625 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
626
627to the CMake command line. The OS X 10.4 SDK must be installed.
DRC180c0162010-10-27 07:20:27 +0000628
629
63064-bit MinGW Build on Cygwin
631----------------------------
632
633 cd {build_directory}
634 CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
635 RC=/usr/bin/x86_64-w64-mingw32-windres \
636 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
637 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
638 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
639 make
640
641This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
642other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
643packages (and their dependencies) must be installed.
644
645
64632-bit MinGW Build on Cygwin
647----------------------------
648
649 cd {build_directory}
650 CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
651 RC=/usr/bin/i686-w64-mingw32-windres \
652 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
653 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
654 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
655 make
656
657This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
658other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
659packages (and their dependencies) must be installed.
660
661
662MinGW-w64 Build on Windows
663--------------------------
664
665This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
666(which is faster than the Cygwin version):
667
668 cd {build_directory}
669 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
670 CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
671 RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
672 cmake -G "MSYS Makefiles" \
673 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
674 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
675 {source_directory}
676 make
677
678
679MinGW Build on Linux
680--------------------
681
682 cd {build_directory}
683 CC={mingw_binary_path}/i386-mingw32-gcc \
684 CXX={mingw_binary_path}/i386-mingw32-g++ \
685 RC={mingw_binary_path}/i386-mingw32-windres \
686 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
687 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
688 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
689 {source_directory}
690 make