blob: 6c08bc31dd1cc5cd7da0992f15799cec6d04d9bc [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
40
DRC180c0162010-10-27 07:20:27 +000041==================
42Out-of-Tree Builds
43==================
44
45Binary objects, libraries, and executables are generated in the same directory
46from which configure was executed (the "binary directory"), and this directory
47need not necessarily be the same as the TigerVNC source directory. You can
48create multiple independent binary directories, in which different versions of
49TigerVNC can be built from the same source tree using different compilers or
50settings. In the sections below, {build_directory} refers to the binary
51directory, whereas {source_directory} refers to the TigerVNC source directory.
52For in-tree builds, these directories are the same.
53
54
DRC2c0ea902010-04-16 07:33:41 +000055=================
56Building TigerVNC
57=================
58
59The following procedure will build the TigerVNC viewer on Linux and Unix
60systems. On 64-bit systems, this may build a 32-bit version of TigerVNC,
61depending on the default compiler configuration for your system. See below for
62specific build instructions for 64-bit systems.
63
DRC180c0162010-10-27 07:20:27 +000064 cd {source_directory}
DRC2c0ea902010-04-16 07:33:41 +000065 autoreconf -fiv
DRC180c0162010-10-27 07:20:27 +000066 cd {build_directory}
67 sh {source_directory}/configure [additional configure flags]
DRC2c0ea902010-04-16 07:33:41 +000068 make
69
DRC180c0162010-10-27 07:20:27 +000070NOTE: Running autoreconf in the source directory is only necessary if building
71TigerVNC from the SVN repository.
DRC2c0ea902010-04-16 07:33:41 +000072
73Building the TigerVNC server (Xvnc) is a bit trickier. On newer systems, such
74as Fedora, Xvnc is typically built to use the X11 shared libraries provided
75with the system. This requires a system with Xorg 7.4 or later, however.
76Systems with older versions of Xorg must build a "legacy-friendly" version of
77the TigerVNC server. This is accomplished by downloading and building the
78more recent Xorg modules in a local directory and then building Xvnc such that
79it links against the local build of these libraries, not the X11 libraries
80installed on the system. The "build-xorg" script in the TigerVNC source
81distribution automates this process.
82
83The following procedure will build both the TigerVNC viewer and a
84"legacy-friendly" version of the TigerVNC server:
85
DRC180c0162010-10-27 07:20:27 +000086 cd {build_directory}
87 sh {source_directory}/unix/build-xorg init -version 7.4
88 sh {source_directory}/unix/build-xorg build -version 7.4 [-static] [additional configure flags]
DRC2c0ea902010-04-16 07:33:41 +000089
90Passing an argument of "-static" to the build command line will generate a
91version of Xvnc that has no external dependencies on the X11 shared libraries
92or any other distribution-specific shared libraries. This version of Xvnc
93should be transportable across multiple O/S distributions. The legacy-friendly
DRC180c0162010-10-27 07:20:27 +000094build should work on Red Hat Enterprise 4, its contemporaries, and later
DRC2c0ea902010-04-16 07:33:41 +000095systems. It probably will not work on older systems. It has not been tested
96on non-Linux systems (yet).
97
98build-xorg can also be used to rebuild just the TigerVNC server and viewer,
99once the X11 modules and other dependencies have been built the first time.
100This is convenient for testing changes that just apply to the TigerVNC source
101code. To accomplish this, run:
102
DRC180c0162010-10-27 07:20:27 +0000103 sh {source_directory}/unix/build-xorg rebuild [additional make flags]
DRC2c0ea902010-04-16 07:33:41 +0000104
105For instance,
106
DRC180c0162010-10-27 07:20:27 +0000107 sh {source_directory}/unix/build-xorg rebuild clean
DRC2c0ea902010-04-16 07:33:41 +0000108
109will clean both the Xvnc and vncviewer builds without destroying any of the
110build configuration or module dependencies.
111
112
113==================================
114Build Recipes for Specific Systems
115==================================
116
117
11832-bit Build on 64-bit Linux
119----------------------------
120
121Add
122
DRC896a96c2010-07-08 07:12:09 +0000123 --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
DRC2c0ea902010-04-16 07:33:41 +0000124
DRC180c0162010-10-27 07:20:27 +0000125to the configure or build command lines.
DRC2c0ea902010-04-16 07:33:41 +0000126
127
DRCef5e17f2010-09-30 18:53:42 +000012864-bit Build on 64-bit OS X
DRC2c0ea902010-04-16 07:33:41 +0000129---------------------------
130
131Add
132
DRC896a96c2010-07-08 07:12:09 +0000133 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm
DRC2c0ea902010-04-16 07:33:41 +0000134
135to the configure command line. NASM 2.07 or later from MacPorts must be
136installed.
137
138
DRCef5e17f2010-09-30 18:53:42 +000013932-bit Build on 64-bit OS X
DRC2c0ea902010-04-16 07:33:41 +0000140---------------------------
141
142Add
143
144 CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
145
146to the configure command line.
147
148
DRCef5e17f2010-09-30 18:53:42 +000014964-bit Backward-Compatible Build on 64-bit OS X
DRC896a96c2010-07-08 07:12:09 +0000150-----------------------------------------------
151
152Add
153
154 --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
155 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
156 -mmacosx-version-min=10.5 -O3' \
157 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
158 -mmacosx-version-min=10.5 -O3' \
159 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
160 -mmacosx-version-min=10.5'
161
162to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
163MacPorts, must be installed.
164
165
DRCef5e17f2010-09-30 18:53:42 +000016632-bit Backward-Compatible Build on 64-bit OS X
DRC2c0ea902010-04-16 07:33:41 +0000167-----------------------------------------------
168
169Add
170
171 CC=gcc-4.0 CXX=g++-4.0 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
172 -mmacosx-version-min=10.4 -O3 -m32' \
173 CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
174 -mmacosx-version-min=10.4 -O3 -m32' \
175 LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
176 -mmacosx-version-min=10.4 -m32'
177
178to the configure command line. The OS X 10.4 SDK must be installed.
179
180
DRC2e0b9652010-10-01 09:31:44 +0000181Building VeNCrypt support on OS X
182---------------------------------
183
184VeNCrypt requires GnuTLS, which is not available on OS X systems by default.
185However, it can be obtained from MacPorts (http://www.macports.org/). The
186easiest way to build TigerVNC using this version of GnuTLS is simply to
187modify the CPATH and LIBRARY_PATH environment variables to include /opt/local,
188i.e.:
189
190export CPATH=/opt/local/include
191export LIBRARY_PATH=/opt/local/lib
192
193and then build TigerVNC as you would normally. However, this produces run-time
194dependencies on the .dylib files in /opt/local/lib. To statically link with
195GnuTLS, add the following monstrosity to the configure command line:
196
197 GNUTLS_CFLAGS=-I/opt/local/include \
198 GNUTLS_LDFLAGS='/opt/local/lib/libgnutls.a /opt/local/lib/libgcrypt.a \
199 /opt/local/lib/libgpg-error.a /opt/local/lib/libz.a \
200 /opt/local/lib/libtasn1.a /opt/local/lib/libiconv.a \
201 /opt/local/lib/libintl.a -framework CoreFoundation'
202
203
DRC2c0ea902010-04-16 07:33:41 +0000204*******************************************************************************
DRC180c0162010-10-27 07:20:27 +0000205** Building on Windows (Visual C++ or MinGW)
206*******************************************************************************
207
208
209==================
210Build Requirements
211==================
212
213-- CMake (http://www.cmake.org) v2.6 or later
214
215-- Microsoft Visual C++ 2005 or later
216
217 If you don't already have Visual C++, then the easiest way to get it is by
218 installing the Windows SDK:
219
220 http://msdn.microsoft.com/en-us/windows/bb980924.aspx
221
222 The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
223 everything necessary to build TigerVNC.
224
225 * For 32-bit builds, you can also use Microsoft Visual C++ Express
226 Edition. Visual C++ Express Edition is a free download.
227 * If you intend to build TigerVNC from the command line, then add the
228 appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
229 environment variables. This is generally accomplished by executing
230 vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
231 vcvars64.bat are part of Visual C++ and are located in the same directory
232 as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
233 optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
234 environment.
235
236... OR ...
237
238-- MinGW
239
240 GCC v4.1 or later recommended for best performance
241
242-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
243 a 64-bit build)
244
245-- Inno Setup (needed to build the TigerVNC installer)
246 Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
247 You also need the Inno Setup Preprocessor, which is available in the
248 Inno Setup QuickStart Pack.
249
250 Add the directory containing iscc.exe (for instance,
251 C:\Program Files\Inno Setup 5) to the system or user PATH environment
252 variable prior to building TigerVNC.
253
254
255==================
256Out-of-Tree Builds
257==================
258
259Binary objects, libraries, and executables are generated in the same directory
260from which cmake was executed (the "binary directory"), and this directory need
261not necessarily be the same as the TigerVNC source directory. You can create
262multiple independent binary directories, in which different versions of
263TigerVNC can be built from the same source tree using different compilers or
264settings. In the sections below, {build_directory} refers to the binary
265directory, whereas {source_directory} refers to the TigerVNC source directory.
266For in-tree builds, these directories are the same.
267
268
269=================
270Building TigerVNC
271=================
272
273
274Visual C++ (Command Line)
275-------------------------
276
277 cd {build_directory}
278 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
279 nmake
280
281This will build either a 32-bit or a 64-bit version of TigerVNC, depending
282on which version of cl.exe is in the PATH.
283
284
285Visual C++ (IDE)
286----------------
287
288Choose the appropriate CMake generator option for your version of Visual Studio
289(run "cmake" with no arguments for a list of available generators.) For
290instance:
291
292 cd {build_directory}
293 cmake -G "Visual Studio 9 2008" {source_directory}
294
295You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
296configurations in that project ("Debug", "Release", etc.) to generate a full
297build of TigerVNC.
298
299
300MinGW
301-----
302
303 cd {build_directory}
304 cmake -G "MSYS Makefiles" {source_directory}
305 make
306
307This will generate only vncviewer. Currently, Visual C++ must be used to build
308WinVNC.
309
310
311Debug Build
312-----------
313
314Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
315NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
316NMake.)
317
318
319===================
320Installing TigerVNC
321===================
322
323You can use the build system to install TigerVNC into a directory of your
324choosing (as opposed to creating an installer.) To do this, add:
325
326 -DCMAKE_INSTALL_PREFIX={install_directory}
327
328to the cmake command line.
329
330For example,
331
332 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
333 -DCMAKE_INSTALL_PREFIX=c:\TigerVNC {source_directory}
334 nmake install
335
336If you don't specify CMAKE_INSTALL_PREFIX, then the default is
337c:\Program Files\TigerVNC.
338
339
340=============
341Build Recipes
342=============
343
344
34564-bit MinGW Build on Cygwin
346----------------------------
347
348 cd {build_directory}
349 CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
350 RC=/usr/bin/x86_64-w64-mingw32-windres \
351 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
352 -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
353 -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
354 make
355
356This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
357other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
358packages (and their dependencies) must be installed.
359
360
36132-bit MinGW Build on Cygwin
362----------------------------
363
364 cd {build_directory}
365 CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
366 RC=/usr/bin/i686-w64-mingw32-windres \
367 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
368 -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
369 -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
370 make
371
372This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
373other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
374packages (and their dependencies) must be installed.
375
376
377MinGW-w64 Build on Windows
378--------------------------
379
380This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
381(which is faster than the Cygwin version):
382
383 cd {build_directory}
384 CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
385 CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
386 RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
387 cmake -G "MSYS Makefiles" \
388 -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
389 -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
390 {source_directory}
391 make
392
393
394MinGW Build on Linux
395--------------------
396
397 cd {build_directory}
398 CC={mingw_binary_path}/i386-mingw32-gcc \
399 CXX={mingw_binary_path}/i386-mingw32-g++ \
400 RC={mingw_binary_path}/i386-mingw32-windres \
401 cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
402 -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
403 -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
404 {source_directory}
405 make
406
407
408*******************************************************************************
DRC2c0ea902010-04-16 07:33:41 +0000409** Creating Release Packages
410*******************************************************************************
411
412The following commands can be used to create various types of release packages:
413
DRC180c0162010-10-27 07:20:27 +0000414
415Unix
416----
417
DRC2c0ea902010-04-16 07:33:41 +0000418make dmg
419
420 Create Macintosh package/disk image. This requires the PackageMaker
421 application, which must be installed in /Developer/Applications/Utilities.
422
423make udmg
424
DRC896a96c2010-07-08 07:12:09 +0000425 On 64-bit OS X (10.5 "Leopard") and later, this creates a version of the
DRC2c0ea902010-04-16 07:33:41 +0000426 Macintosh package/disk image which contains universal i386/x86-64 binaries.
427 The 32-bit fork of these binaries is backward compatible with OS X 10.4 and
DRC896a96c2010-07-08 07:12:09 +0000428 later (OS X 10.4 compatibility SDK required.) If building on OS X 10.6
429 ("Snow Leopard") or later, the 64-bit fork can be made backward compatible
430 with 10.5 by using the instructions in the "Build Recipes" section.
DRC180c0162010-10-27 07:20:27 +0000431
432
433Windows
434-------
435
436If using NMake:
437
438 cd {build_directory}
439 nmake installer
440
441If using MinGW:
442
443 cd {build_directory}
444 make installer
445
446If using the Visual Studio IDE, build the "installer" project.
447
448The installer package (TigerVNC[64].exe) will be located under
449{build_directory}. If building using the Visual Studio IDE, then the installer
450package will be located in a subdirectory with the same name as the
451configuration you built (such as {build_directory}\Debug\ or
452{build_directory}\Release\).