blob: 7ab891b9f15daaa781a2a555f26bea6f60267031 [file] [log] [blame]
DRC2c0ea902010-04-16 07:33:41 +00001*******************************************************************************
DRC180c0162010-10-27 07:20:27 +00002** Building on Unix Platforms (including Cygwin)
DRC2c0ea902010-04-16 07:33:41 +00003*******************************************************************************
4
5
6==================
7Build Requirements
8==================
9
10-- autoconf 2.57 or later
DRC2c0ea902010-04-16 07:33:41 +000011-- automake 1.7 or later
DRC2c0ea902010-04-16 07:33:41 +000012-- libtool 1.4 or later
13
14-- NASM
15 * 0.98 or later is required for a 32-bit build
16 * NASM 2.05 or later is required for a 64-bit build
DRCef5e17f2010-09-30 18:53:42 +000017 * NASM 2.07 or later is required for a 64-bit build on OS X. This can be
DRC896a96c2010-07-08 07:12:09 +000018 obtained from MacPorts (http://www.macports.org/).
DRC2c0ea902010-04-16 07:33:41 +000019
DRC180c0162010-10-27 07:20:27 +000020 The NASM 2.05 RPMs do not work on older Linux systems, such as Red Hat
21 Enterprise Linux 4. On such systems, you can easily build and install NASM
22 2.05 from the source RPM by executing the following as root:
DRC2c0ea902010-04-16 07:33:41 +000023
24 ARCH=`uname -m`
25 wget http://www.nasm.us/pub/nasm/releasebuilds/2.05.01/nasm-2.05.01-1.src.rpm
26 rpmbuild --rebuild nasm-2.05.01-1.src.rpm
27 rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-2.05.01-1.$ARCH.rpm
28
29 NOTE: NASM build will fail if texinfo is not installed.
30
31-- GCC v4.1 or later recommended for best performance
32
33-- X11 development kit
34
35-- If building Xvnc:
36 * Python v2.3 or later
37 * zlib v1.2 or later
38 * OpenSSL v0.9.7 or later
39
DRC2b0b1942011-02-09 03:10:44 +000040-- If building VeNCrypt support:
41 * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
42
DRC2c0ea902010-04-16 07:33:41 +000043
DRC180c0162010-10-27 07:20:27 +000044==================
45Out-of-Tree Builds
46==================
47
48Binary objects, libraries, and executables are generated in the same directory
49from which configure was executed (the "binary directory"), and this directory
50need not necessarily be the same as the TigerVNC source directory. You can
51create multiple independent binary directories, in which different versions of
52TigerVNC can be built from the same source tree using different compilers or
53settings. In the sections below, {build_directory} refers to the binary
54directory, whereas {source_directory} refers to the TigerVNC source directory.
55For in-tree builds, these directories are the same.
56
57
DRC2c0ea902010-04-16 07:33:41 +000058=================
59Building TigerVNC
60=================
61
62The following procedure will build the TigerVNC viewer on Linux and Unix
63systems. On 64-bit systems, this may build a 32-bit version of TigerVNC,
DRC2b0b1942011-02-09 03:10:44 +000064depending on the default autotools configuration for your system. See below
65for specific build instructions for 64-bit systems.
DRC2c0ea902010-04-16 07:33:41 +000066
DRC180c0162010-10-27 07:20:27 +000067 cd {source_directory}
DRC2c0ea902010-04-16 07:33:41 +000068 autoreconf -fiv
DRC180c0162010-10-27 07:20:27 +000069 cd {build_directory}
70 sh {source_directory}/configure [additional configure flags]
DRC2c0ea902010-04-16 07:33:41 +000071 make
72
DRC180c0162010-10-27 07:20:27 +000073NOTE: Running autoreconf in the source directory is only necessary if building
74TigerVNC from the SVN repository.
DRC2c0ea902010-04-16 07:33:41 +000075
76Building the TigerVNC server (Xvnc) is a bit trickier. On newer systems, such
77as Fedora, Xvnc is typically built to use the X11 shared libraries provided
78with the system. This requires a system with Xorg 7.4 or later, however.
79Systems with older versions of Xorg must build a "legacy-friendly" version of
80the TigerVNC server. This is accomplished by downloading and building the
81more recent Xorg modules in a local directory and then building Xvnc such that
82it links against the local build of these libraries, not the X11 libraries
83installed on the system. The "build-xorg" script in the TigerVNC source
84distribution automates this process.
85
86The following procedure will build both the TigerVNC viewer and a
87"legacy-friendly" version of the TigerVNC server:
88
DRC180c0162010-10-27 07:20:27 +000089 cd {build_directory}
90 sh {source_directory}/unix/build-xorg init -version 7.4
91 sh {source_directory}/unix/build-xorg build -version 7.4 [-static] [additional configure flags]
DRC2c0ea902010-04-16 07:33:41 +000092
93Passing an argument of "-static" to the build command line will generate a
94version of Xvnc that has no external dependencies on the X11 shared libraries
95or any other distribution-specific shared libraries. This version of Xvnc
96should be transportable across multiple O/S distributions. The legacy-friendly
DRC180c0162010-10-27 07:20:27 +000097build should work on Red Hat Enterprise 4, its contemporaries, and later
DRC2c0ea902010-04-16 07:33:41 +000098systems. It probably will not work on older systems. It has not been tested
99on non-Linux systems (yet).
100
101build-xorg can also be used to rebuild just the TigerVNC server and viewer,
102once the X11 modules and other dependencies have been built the first time.
103This is convenient for testing changes that just apply to the TigerVNC source
104code. To accomplish this, run:
105
DRC180c0162010-10-27 07:20:27 +0000106 sh {source_directory}/unix/build-xorg rebuild [additional make flags]
DRC2c0ea902010-04-16 07:33:41 +0000107
108For instance,
109
DRC180c0162010-10-27 07:20:27 +0000110 sh {source_directory}/unix/build-xorg rebuild clean
DRC2c0ea902010-04-16 07:33:41 +0000111
112will clean both the Xvnc and vncviewer builds without destroying any of the
113build configuration or module dependencies.
114
115
DRC8290dd62011-02-10 22:54:36 +0000116=========================
117Building VeNCrypt support
118=========================
119
120Building VeNCrypt (the TigerVNC security and authentication extensions)
121requires GnuTLS, which is not pre-installed on all platforms. In general, if
122you are building on a Unix-ish platform that has the GnuTLS libraries and
123include files installed in the standard system locations, then the TigerVNC
124build system should detect the system version of GnuTLS automatically and link
125against it. However, this produces a version of TigerVNC that depends on the
126GnuTLS dynamic libraries, and thus the TigerVNC binaries are not portable.
127
128To build a fully portable, cross-compatible version of TigerVNC with VeNCrypt
129support, it is necessary to link against the GnuTLS static library (as well
130as the static libraries of its dependencies.) If you are lucky enough, your
131O/S distribution may include pre-packaged versions of these static libraries.
132Otherwise, it will probably be necessary to build GnuTLS, libgcrypt, libtasn1,
133and libgpg-error from source.
134
135You can manipulate the GNUTLS_CFLAGS and GNUTLS_LDFLAGS configure variables to
136accommodate a custom build of GnuTLS that is installed in a non-system
137directory. For instance, adding
138
139 GNUTLS_CFLAGS=-I/opt/gnutls/include \
140 GNUTLS_LDFLAGS='/opt/gnutls/lib/libgnutls.a /opt/gnutls/lib/libgcrypt.a \
141 /opt/gnutls/lib/libgpg-error.a /opt/gnutls/lib/libtasn1.a' \
142 --with-included-zlib
143
144to the configure or 'build-xorg build' command line will cause TigerVNC to be
145statically linked against a custom installation of GnuTLS that resides under
146/opt/gnutls. GnuTLS depends on zlib, so specifying --with-included-zlib will
147satisfy that dependency using TigerVNC's in-tree version of zlib, which
148prevents TigerVNC from depending on the libz dynamic library.
149
150
DRC2b0b1942011-02-09 03:10:44 +0000151==================
152Unix Build Recipes
153==================
DRC2c0ea902010-04-16 07:33:41 +0000154
155
15632-bit Build on 64-bit Linux
157----------------------------
158
159Add
160
DRC896a96c2010-07-08 07:12:09 +0000161 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
DRC2c0ea902010-04-16 07:33:41 +0000162
DRC180c0162010-10-27 07:20:27 +0000163to the configure or build command lines.
DRC2c0ea902010-04-16 07:33:41 +0000164
165
DRCef5e17f2010-09-30 18:53:42 +000016664-bit Build on 64-bit OS X
DRC2c0ea902010-04-16 07:33:41 +0000167---------------------------
168
169Add
170
DRC896a96c2010-07-08 07:12:09 +0000171 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC2c0ea902010-04-16 07:33:41 +0000172
173to the configure command line. NASM 2.07 or later from MacPorts must be
174installed.
175
176
DRCef5e17f2010-09-30 18:53:42 +000017732-bit Build on 64-bit OS X
DRC2c0ea902010-04-16 07:33:41 +0000178---------------------------
179
180Add
181
182 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
183
184to the configure command line.
185
186
DRCef5e17f2010-09-30 18:53:42 +000018764-bit Backward-Compatible Build on 64-bit OS X
DRC896a96c2010-07-08 07:12:09 +0000188-----------------------------------------------
189
190Add
191
192 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
193 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
194 -mmacosx-version-min=10.5 -O3' \
195 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
196 -mmacosx-version-min=10.5 -O3' \
197 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
198 -mmacosx-version-min=10.5'
199
200to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
201MacPorts, must be installed.
202
203
DRCef5e17f2010-09-30 18:53:42 +000020432-bit Backward-Compatible Build on 64-bit OS X
DRC2c0ea902010-04-16 07:33:41 +0000205-----------------------------------------------
206
207Add
208
209 CC=gcc-4.0 CXX=g++-4.0 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
210 -mmacosx-version-min=10.4 -O3 -m32' \
211 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
212 -mmacosx-version-min=10.4 -O3 -m32' \
213 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
214 -mmacosx-version-min=10.4 -m32'
215
216to the configure command line. The OS X 10.4 SDK must be installed.
217
218
DRC2e0b9652010-10-01 09:31:44 +0000219
DRC2c0ea902010-04-16 07:33:41 +0000220*******************************************************************************
DRC180c0162010-10-27 07:20:27 +0000221** Building on Windows (Visual C++ or MinGW)
222*******************************************************************************
223
224
225==================
226Build Requirements
227==================
228
229-- CMake (http://www.cmake.org) v2.6 or later
230
231-- Microsoft Visual C++ 2005 or later
232
233 If you don't already have Visual C++, then the easiest way to get it is by
234 installing the Windows SDK:
235
236 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
237
238 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
239 everything necessary to build TigerVNC.
240
241 * For 32-bit builds, you can also use Microsoft Visual C++ Express
242 Edition. Visual C++ Express Edition is a free download.
243 * If you intend to build TigerVNC from the command line, then add the
244 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
245 environment variables. This is generally accomplished by executing
246 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
247 vcvars64.bat are part of Visual C++ and are located in the same directory
248 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
249 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
250 environment.
251
252... OR ...
253
254-- MinGW
255
256 GCC v4.1 or later recommended for best performance
257
258-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
259 a 64-bit build)
260
261-- Inno Setup (needed to build the TigerVNC installer)
262 Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
263 You also need the Inno Setup Preprocessor, which is available in the
264 Inno Setup QuickStart Pack.
265
266 Add the directory containing iscc.exe (for instance,
267 C:\Program Files\Inno Setup 5) to the system or user PATH environment
268 variable prior to building TigerVNC.
269
DRC2b0b1942011-02-09 03:10:44 +0000270-- If building VeNCrypt support:
271 * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
272
DRC180c0162010-10-27 07:20:27 +0000273
274==================
275Out-of-Tree Builds
276==================
277
278Binary objects, libraries, and executables are generated in the same directory
279from which cmake was executed (the "binary directory"), and this directory need
280not necessarily be the same as the TigerVNC source directory. You can create
281multiple independent binary directories, in which different versions of
282TigerVNC can be built from the same source tree using different compilers or
283settings. In the sections below, {build_directory} refers to the binary
284directory, whereas {source_directory} refers to the TigerVNC source directory.
285For in-tree builds, these directories are the same.
286
287
288=================
289Building TigerVNC
290=================
291
292
293Visual C++ (Command Line)
294-------------------------
295
296 cd {build_directory}
297 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
298 nmake
299
300This will build either a 32-bit or a 64-bit version of TigerVNC, depending
301on which version of cl.exe is in the PATH.
302
303
304Visual C++ (IDE)
305----------------
306
307Choose the appropriate CMake generator option for your version of Visual Studio
308(run "cmake" with no arguments for a list of available generators.) For
309instance:
310
311 cd {build_directory}
312 cmake -G "Visual Studio 9 2008" {source_directory}
313
314You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
315configurations in that project ("Debug", "Release", etc.) to generate a full
316build of TigerVNC.
317
318
319MinGW
320-----
321
322 cd {build_directory}
323 cmake -G "MSYS Makefiles" {source_directory}
324 make
325
326This will generate only vncviewer. Currently, Visual C++ must be used to build
327WinVNC.
328
329
330Debug Build
331-----------
332
333Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
334NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
335NMake.)
336
337
DRC8290dd62011-02-10 22:54:36 +0000338Self-Contained MinGW Build
339--------------------------
340
341If TigerVNC is built using MinGW, then it may depend on the MinGW libgcc DLL.
342To eliminate this dependency, add
343
344 -DCMAKE_C_FLAGS=-static-libgcc -DCMAKE_CXX_FLAGS=-static-libgcc
345
346to the cmake command line.
347
348
349=========================
350Building VeNCrypt support
351=========================
352
353Building VeNCrypt (the TigerVNC security and authentication extensions)
354requires GnuTLS, which is not Microsoft-friendly. There is generally no
355sane way to build GnuTLS and its dependencies using Visual C++. Those with
356a lot of time on their hands can build the GnuTLS DLLs using MinGW (or download
35732-bit versions of these from the link below), generate Visual C++ import
358libraries from the DLLs, then link TigerVNC against the Visual C++ import
359libraries. However, this creates a version of TigerVNC that depends on
360the GnuTLS DLLs. The TigerVNC packaging system currently is not designed to
361handle DLL dependencies, so really the only way to build and package a
362self-contained, VeNCrypt-enabled version of TigerVNC for Windows is to use
363MinGW and the static GnuTLS libraries. The use of MinGW means that only the
364viewer can be built, not the server.
365
366An installer containing the GnuTLS header files, as well as static and dynamic
367link libraries for 32-bit MinGW, is available from the following site:
368
369http://josefsson.org/gnutls4win/
370
371Whether you choose to use the above installer or build GnuTLS from source,
372make sure that you install the libraries and headers into a pathname that
373doesn't contain spaces (the installer will try to install under
374c:\Program Files unless you tell it otherwise.) If the GnuTLS include path
375contains spaces, then the MinGW resource compiler will barf.
376
377You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY cmake variables to
378specify the directory under which you installed GnuTLS. For instance, adding
379
380 -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
381 -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a'
382
383to the cmake command line when using MinGW will cause TigerVNC to be statically
384linked against an installation of GnuTLS that resides under c:\gnutls.
385
386
DRC180c0162010-10-27 07:20:27 +0000387===================
388Installing TigerVNC
389===================
390
391You can use the build system to install TigerVNC into a directory of your
392choosing (as opposed to creating an installer.) To do this, add:
393
394 -DCMAKE_INSTALL_PREFIX={install_directory}
395
396to the cmake command line.
397
398For example,
399
400 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
401 -DCMAKE_INSTALL_PREFIX=c:\TigerVNC {source_directory}
402 nmake install
403
404If you don't specify CMAKE_INSTALL_PREFIX, then the default is
405c:\Program Files\TigerVNC.
406
407
DRC2b0b1942011-02-09 03:10:44 +0000408=====================
409Windows Build Recipes
410=====================
DRC180c0162010-10-27 07:20:27 +0000411
412
41364-bit MinGW Build on Cygwin
414----------------------------
415
416 cd {build_directory}
417 CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
418 RC=/usr/bin/x86_64-w64-mingw32-windres \
419 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
420 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
421 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
422 make
423
424This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
425other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
426packages (and their dependencies) must be installed.
427
428
42932-bit MinGW Build on Cygwin
430----------------------------
431
432 cd {build_directory}
433 CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
434 RC=/usr/bin/i686-w64-mingw32-windres \
435 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
436 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
437 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
438 make
439
440This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
441other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
442packages (and their dependencies) must be installed.
443
444
445MinGW-w64 Build on Windows
446--------------------------
447
448This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
449(which is faster than the Cygwin version):
450
451 cd {build_directory}
452 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
453 CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
454 RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
455 cmake -G "MSYS Makefiles" \
456 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
457 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
458 {source_directory}
459 make
460
461
462MinGW Build on Linux
463--------------------
464
465 cd {build_directory}
466 CC={mingw_binary_path}/i386-mingw32-gcc \
467 CXX={mingw_binary_path}/i386-mingw32-g++ \
468 RC={mingw_binary_path}/i386-mingw32-windres \
469 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
470 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
471 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
472 {source_directory}
473 make
474
475
476*******************************************************************************
DRC2c0ea902010-04-16 07:33:41 +0000477** Creating Release Packages
478*******************************************************************************
479
480The following commands can be used to create various types of release packages:
481
DRC180c0162010-10-27 07:20:27 +0000482
483Unix
484----
485
DRC61b630a2011-02-09 10:45:09 +0000486make tarball
487
488 Create a binary tarball containing the TigerVNC Viewer
489
490make servertarball
491
492 Create a binary tarball containing both the TigerVNC Server and Viewer
493
DRC2c0ea902010-04-16 07:33:41 +0000494make dmg
495
496 Create Macintosh package/disk image. This requires the PackageMaker
497 application, which must be installed in /Developer/Applications/Utilities.
498
DRC2b0b1942011-02-09 03:10:44 +0000499make udmg [BUILDDIR32={32-bit build directory}]
DRC2c0ea902010-04-16 07:33:41 +0000500
DRC2b0b1942011-02-09 03:10:44 +0000501 On 64-bit OS X systems, this creates a version of the Macintosh package and
502 disk image which contains universal i386/x86-64 binaries. You should first
503 configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
504 out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
505 build system will look for the 32-bit build under {source_directory}/osxx86
506 by default, but you can override this by setting the BUILDDIR32 variable on
507 the make command line as shown above. Either the 64-bit or 32-bit build can
508 be configured to be backward-compatible by using the instructions in the
509 "Unix Build Recipes" section.
DRC180c0162010-10-27 07:20:27 +0000510
511
512Windows
513-------
514
515If using NMake:
516
517 cd {build_directory}
518 nmake installer
519
520If using MinGW:
521
522 cd {build_directory}
523 make installer
524
525If using the Visual Studio IDE, build the "installer" project.
526
527The installer package (TigerVNC[64].exe) will be located under
528{build_directory}. If building using the Visual Studio IDE, then the installer
529package will be located in a subdirectory with the same name as the
530configuration you built (such as {build_directory}\Debug\ or
531{build_directory}\Release\).