DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 1 | ******************************************************************************* |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 2 | ** Building TigerVNC |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 3 | ******************************************************************************* |
| 4 | |
| 5 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 6 | ================================ |
| 7 | Build Requirements (All Systems) |
| 8 | ================================ |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 9 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 10 | -- CMake (http://www.cmake.org) v2.8 or later |
| 11 | |
| 12 | -- FLTK 1.3.0 |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 13 | * Must be patched using fltk/extensions.patch (in the TigerVNC source |
| 14 | directory) to get full functionality |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 15 | * See "Building FLTK" below. |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 16 | |
DRC | 69854b4 | 2011-05-13 09:31:24 +0000 | [diff] [blame] | 17 | -- If building TLS support: |
| 18 | * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error) |
| 19 | |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 20 | -- If building native language support (NLS): |
| 21 | * Gnu gettext 0.14.4 or later |
| 22 | * See "Building Native Language Support" below. |
| 23 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 24 | -- libjpeg-turbo SDK |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 25 | * If your system does not include libjpeg-turbo, then you can download the |
| 26 | SDK from http://sourceforge.net/projects/libjpeg-turbo/files/ |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 27 | |
| 28 | |
| 29 | ========================= |
| 30 | Build Requirements (Unix) |
| 31 | ========================= |
| 32 | |
| 33 | -- Non-Mac platforms: |
| 34 | * X11 development kit |
| 35 | |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 36 | -- If building Xvnc: |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 37 | * autoconf 2.57 or later |
| 38 | * automake 1.7 or later |
| 39 | * libtool 1.4 or later |
| 40 | * OpenSSL v0.9.7 or later |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 41 | * Python v2.3 or later |
| 42 | * zlib v1.2 or later |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 43 | |
DRC | 69854b4 | 2011-05-13 09:31:24 +0000 | [diff] [blame] | 44 | * 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 | |
DRC | 69854b4 | 2011-05-13 09:31:24 +0000 | [diff] [blame] | 50 | * 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. |
DRC | 2b0b194 | 2011-02-09 03:10:44 +0000 | [diff] [blame] | 56 | |
DRC | 2c0ea90 | 2010-04-16 07:33:41 +0000 | [diff] [blame] | 57 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 58 | ============================ |
| 59 | Build Requirements (Windows) |
| 60 | ============================ |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 61 | |
| 62 | -- Microsoft Visual C++ 2005 or later |
| 63 | |
| 64 | If you don't already have Visual C++, then the easiest way to get it is by |
| 65 | installing the Windows SDK: |
| 66 | |
| 67 | http://msdn.microsoft.com/en-us/windows/bb980924.aspx |
| 68 | |
| 69 | The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and |
| 70 | everything necessary to build TigerVNC. |
| 71 | |
| 72 | * For 32-bit builds, you can also use Microsoft Visual C++ Express |
| 73 | Edition. Visual C++ Express Edition is a free download. |
| 74 | * If you intend to build TigerVNC from the command line, then add the |
| 75 | appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH |
| 76 | environment variables. This is generally accomplished by executing |
| 77 | vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and |
| 78 | vcvars64.bat are part of Visual C++ and are located in the same directory |
| 79 | as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass |
| 80 | optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build |
| 81 | environment. |
| 82 | |
| 83 | ... OR ... |
| 84 | |
| 85 | -- MinGW |
| 86 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 87 | -- Inno Setup (needed to build the TigerVNC installer) |
| 88 | Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php. |
| 89 | You also need the Inno Setup Preprocessor, which is available in the |
| 90 | Inno Setup QuickStart Pack. |
| 91 | |
| 92 | Add the directory containing iscc.exe (for instance, |
| 93 | C:\Program Files\Inno Setup 5) to the system or user PATH environment |
| 94 | variable prior to building TigerVNC. |
| 95 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 96 | |
| 97 | ============= |
| 98 | Building FLTK |
| 99 | ============= |
| 100 | |
| 101 | Currently, TigerVNC requires functionality that is not yet included in the |
| 102 | upstream version of FLTK. Thus, it will be necessary to build FLTK from |
| 103 | source. To do this: |
| 104 | |
| 105 | 1. Download the FLTK 1.3.0 source tarball from http://www.fltk.org/ |
| 106 | 2. Extract the source tarball |
| 107 | 3. cd fltk-1.3.0 |
| 108 | 4. patch -p1 < {tigervnc_source_directory}/fltk/extensions.patch |
| 109 | 5. Use CMake to build FLTK using the same procedures described below for |
| 110 | building TigerVNC. The recipes in the "Build Recipes" section also apply. |
| 111 | 6. (optional) Use 'make install' to install FLTK into a directory of your |
| 112 | choosing. |
| 113 | 7. When building TigerVNC, set the FLTK_FLUID_EXECUTABLE CMake variable to the |
| 114 | location of the fluid executable that was built in Step 5 or installed in |
| 115 | Step 6. This gives CMake a hint as to where to find the FLTK library. |
| 116 | 8. If you did not install FLTK, then set the FLTK_INCLUDE_DIR CMake variable to |
| 117 | the location of the FLTK source directory. |
DRC | 2b0b194 | 2011-02-09 03:10:44 +0000 | [diff] [blame] | 118 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 119 | |
| 120 | ================== |
| 121 | Out-of-Tree Builds |
| 122 | ================== |
| 123 | |
| 124 | Binary objects, libraries, and executables are generated in the same directory |
| 125 | from which cmake was executed (the "binary directory"), and this directory need |
| 126 | not necessarily be the same as the TigerVNC source directory. You can create |
| 127 | multiple independent binary directories, in which different versions of |
| 128 | TigerVNC can be built from the same source tree using different compilers or |
| 129 | settings. In the sections below, {build_directory} refers to the binary |
| 130 | directory, whereas {source_directory} refers to the TigerVNC source directory. |
| 131 | For in-tree builds, these directories are the same. |
| 132 | |
| 133 | |
| 134 | ================= |
| 135 | Building TigerVNC |
| 136 | ================= |
| 137 | |
| 138 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 139 | Unix/Mac |
| 140 | -------- |
| 141 | |
| 142 | The following procedure will build the TigerVNC Viewer on Linux and Unix |
| 143 | systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See |
| 144 | "Build Recipes" for specific build instructions for building a 32-bit version |
| 145 | of TigerVNC on 64-bit systems. |
| 146 | |
| 147 | cd {build_directory} |
| 148 | cmake -G "Unix Makefiles" {source_directory} [additional CMake flags] |
| 149 | make |
| 150 | |
| 151 | Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems |
| 152 | containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use |
| 153 | the X11 shared libraries provided with the system. The procedure for this is |
| 154 | very system-specific, since it requires specifying such things as font and X |
| 155 | resource directories. Thus, it cannot be described in terms general enough for |
| 156 | this document. |
| 157 | |
| 158 | Those using systems with older versions of Xorg must build a "legacy-friendly" |
| 159 | version of the TigerVNC Server. This is accomplished by downloading and |
| 160 | building the more recent Xorg modules in a local directory and then building |
| 161 | Xvnc such that it links against the local build of these libraries, not the X11 |
| 162 | libraries installed on the system. The "build-xorg" script in the TigerVNC |
| 163 | source distribution (located under unix/) automates this process. |
| 164 | |
| 165 | The following procedure will build both the TigerVNC Viewer and a |
| 166 | "legacy-friendly" version of the TigerVNC Server: |
| 167 | |
| 168 | cd {build_directory} |
| 169 | sh {source_directory}/unix/build-xorg init |
| 170 | sh {source_directory}/unix/build-xorg build [additional CMake flags] |
| 171 | |
| 172 | build-xorg generates a version of Xvnc that has no external dependencies on the |
| 173 | X11 shared libraries or any other distribution-specific shared libraries. This |
| 174 | version of Xvnc should be transportable across multiple O/S distributions. |
| 175 | build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later |
| 176 | systems. It probably will not work on older systems. It has not been tested |
| 177 | on non-Linux systems (yet). |
| 178 | |
| 179 | build-xorg can also be used to rebuild just the TigerVNC Server and Viewer, |
| 180 | once the X11 modules and other dependencies have been built for the first time. |
| 181 | This is convenient for testing changes that just apply to the TigerVNC source |
| 182 | code. To accomplish this, run: |
| 183 | |
| 184 | sh {source_directory}/unix/build-xorg rebuild [additional make flags] |
| 185 | |
| 186 | For instance, |
| 187 | |
| 188 | sh {source_directory}/unix/build-xorg rebuild clean |
| 189 | |
| 190 | will clean both the Xvnc and vncviewer builds without destroying any of the |
| 191 | build configuration or module dependencies. |
| 192 | |
| 193 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 194 | Visual C++ (Command Line) |
| 195 | ------------------------- |
| 196 | |
| 197 | cd {build_directory} |
| 198 | cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory} |
| 199 | nmake |
| 200 | |
| 201 | This will build either a 32-bit or a 64-bit version of TigerVNC, depending |
| 202 | on which version of cl.exe is in the PATH. |
| 203 | |
| 204 | |
| 205 | Visual C++ (IDE) |
| 206 | ---------------- |
| 207 | |
| 208 | Choose the appropriate CMake generator option for your version of Visual Studio |
| 209 | (run "cmake" with no arguments for a list of available generators.) For |
| 210 | instance: |
| 211 | |
| 212 | cd {build_directory} |
| 213 | cmake -G "Visual Studio 9 2008" {source_directory} |
| 214 | |
| 215 | You can then open ALL_BUILD.vcproj in Visual Studio and build one of the |
| 216 | configurations in that project ("Debug", "Release", etc.) to generate a full |
| 217 | build of TigerVNC. |
| 218 | |
| 219 | |
| 220 | MinGW |
| 221 | ----- |
| 222 | |
| 223 | cd {build_directory} |
| 224 | cmake -G "MSYS Makefiles" {source_directory} |
| 225 | make |
| 226 | |
| 227 | This will generate only vncviewer. Currently, Visual C++ must be used to build |
| 228 | WinVNC. |
| 229 | |
| 230 | |
| 231 | Debug Build |
| 232 | ----------- |
| 233 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 234 | Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line. Or, if building with |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 235 | NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with |
| 236 | NMake.) |
| 237 | |
| 238 | |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 239 | Self-Contained MinGW Build |
| 240 | -------------------------- |
| 241 | |
| 242 | If TigerVNC is built using MinGW, then it may depend on the MinGW libgcc DLL. |
| 243 | To eliminate this dependency, add |
| 244 | |
| 245 | -DCMAKE_C_FLAGS=-static-libgcc -DCMAKE_CXX_FLAGS=-static-libgcc |
| 246 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 247 | to the CMake command line. |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 248 | |
| 249 | |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 250 | ====================================== |
| 251 | Building Native Language Support (NLS) |
| 252 | ====================================== |
| 253 | |
| 254 | NLS requires gettext, which is supplied with most Linux distributions but not |
| 255 | with most other operating systems. Building gettext from source is |
| 256 | straightforward on Mac and other Unix variants, but on Windows it requires |
| 257 | MinGW. Thus, it is not possible to enable NLS when building TigerVNC with |
| 258 | Visual C++. |
| 259 | |
| 260 | You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to |
| 261 | specify the locations of libiconv and libintl, respectively. For instance, |
| 262 | adding |
| 263 | |
| 264 | -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a |
| 265 | |
| 266 | to the CMake command line would link TigerVNC against a static version of |
| 267 | libintl located under /opt/gettext. Adding |
| 268 | |
| 269 | -DICONV_INCLUDE_DIR=/mingw/include \ |
| 270 | -DICONV_LIBRARIES=/mingw/lib/libiconv.a \ |
| 271 | -DGETTEXT_INCLUDE_DIR=/mingw/include \ |
| 272 | -DLIBINTL_LIBRARY=/mingw/lib/libintl.a |
| 273 | |
| 274 | to the CMake command line would link TigerVNC against the static versions of |
| 275 | libiconv and libintl included in the MinGW Developer Toolkit. |
| 276 | |
| 277 | |
| 278 | =============================================== |
| 279 | Building Transport Layer Security (TLS) support |
| 280 | =============================================== |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 281 | |
Adam Tkac | 445d4ed | 2011-04-27 11:04:01 +0000 | [diff] [blame] | 282 | VeNCrypt (the TigerVNC security and authentication extensions) can be built |
| 283 | with TLS support, which provides built-in encryption for VNC sessions. This |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 284 | requires GnuTLS, which is readily available in many Linux distributions but not |
| 285 | as readily available in binary form on other types of systems. This section |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 286 | describes the issues associated with building a version of TigerVNC with TLS |
| 287 | support and how to work around those issues. |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 288 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 289 | |
| 290 | Unix/Mac |
| 291 | -------- |
| 292 | |
| 293 | In general, if you are building on a Unix-ish platform that has the GnuTLS |
| 294 | libraries and include files installed in the standard system locations, then |
| 295 | the TigerVNC build system should detect the system version of GnuTLS |
| 296 | automatically and link against it. However, this produces a version of |
| 297 | TigerVNC that depends on the GnuTLS dynamic libraries, and thus the TigerVNC |
| 298 | binaries are not portable. |
| 299 | |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 300 | To build a fully portable, cross-compatible version of TigerVNC with TLS |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 301 | support, it is necessary to link against the GnuTLS static library (as well |
| 302 | as the static libraries of its dependencies.) If you are lucky enough, then |
| 303 | your O/S distribution may include pre-packaged versions of these static |
| 304 | libraries. Otherwise, it will be necessary to build GnuTLS, libgcrypt, |
| 305 | libtasn1, and libgpg-error from source. |
| 306 | |
| 307 | You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 308 | build TigerVNC against a custom build of GnuTLS that is installed in a |
| 309 | non-system directory. For instance, adding |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 310 | |
| 311 | -DGNUTLS_INCLUDE_DIR=/opt/gnutls/include \ |
| 312 | -DGNUTLS_LIBRARY='/opt/gnutls/lib/libgnutls.a;/opt/gnutls/lib/libgcrypt.a;/opt/gnutls/lib/libgpg-error.a;/opt/gnutls/lib/libtasn1.a' \ |
| 313 | -DUSE_INCLUDED_ZLIB=1 |
| 314 | |
| 315 | to the CMake or 'build-xorg build' command line will cause TigerVNC to be |
| 316 | statically linked against a custom installation of GnuTLS that resides under |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 317 | /opt/gnutls. GnuTLS depends on zlib, so specifying -DUSE_INCLUDED_ZLIB=1 will |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 318 | satisfy that dependency using TigerVNC's in-tree version of zlib, which |
| 319 | prevents TigerVNC from depending on the libz dynamic library. |
| 320 | |
| 321 | |
| 322 | MinGW |
| 323 | ----- |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 324 | |
| 325 | An installer containing the GnuTLS header files, as well as static and dynamic |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 326 | link libraries for 32-bit MinGW, can be downloaded from the following site: |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 327 | |
| 328 | http://josefsson.org/gnutls4win/ |
| 329 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 330 | As of this writing, GnuTLS cannot be built cleanly with MinGW64 due to the fact |
| 331 | that portions of the code assume an LP64 data model (Windows uses LLP64.) |
| 332 | Thus, it is not possible at this time to produce a Win64 version of TigerVNC |
| 333 | with TLS support. |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 334 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 335 | Whether you use the above installer or build GnuTLS from source, make sure that |
| 336 | you install the libraries and headers into a pathname that doesn't contain |
| 337 | spaces (the installer will try to install under c:\Program Files unless you |
| 338 | tell it otherwise.) If the GnuTLS include path contains spaces, then the MinGW |
| 339 | resource compiler will barf when you try to build TigerVNC. |
| 340 | |
| 341 | You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 342 | specify the directory under which you installed GnuTLS. For instance, adding |
| 343 | |
| 344 | -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \ |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 345 | -DGNUTLS_LIBRARY=/c/gnutls/lib/libgnutls.dll.a |
| 346 | |
| 347 | to the CMake command line when using MinGW will cause TigerVNC to be linked |
| 348 | against GnuTLS DLLs that are installed under c:\gnutls. |
| 349 | |
| 350 | Adding |
| 351 | |
| 352 | -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \ |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 353 | -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a' |
| 354 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 355 | to the CMake command line will cause TigerVNC to be statically linked against |
| 356 | GnuTLS libraries that are installed under c:\gnutls. |
| 357 | |
| 358 | Note that the use of MinGW means that only the TigerVNC viewer can be built, |
| 359 | not the server. |
| 360 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 361 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 362 | Visual C++ |
| 363 | ---------- |
| 364 | |
| 365 | There is generally no sane way to build GnuTLS and its dependencies using |
| 366 | Visual C++. Thus, it is necessary to either build the libraries with MinGW (or |
| 367 | download 32-bit versions of these from the link above), generate Visual C++ |
| 368 | import libraries from the DLLs, then link TigerVNC against the Visual C++ |
| 369 | import libraries. |
| 370 | |
| 371 | In the instructions below, {gnutls_path} indicates the path under which GnuTLS |
| 372 | is installed (Example: c:\Program Files\GnuTLS-2.10.1). |
| 373 | |
| 374 | To generate Visual C++ import libraries: |
| 375 | |
| 376 | cd {gnutls_path}\lib |
| 377 | lib /def:..\bin\libgnutls-{version}.def /out:libgnutls.lib |
| 378 | |
| 379 | Now, you can add the following arguments to the CMake command line: |
| 380 | |
| 381 | -DGNUTLS_INCLUDE_DIR={gnutls_path}\include \ |
| 382 | -DGNUTLS_LIBRARY={gnutls_path}\lib\libgnutls.lib |
| 383 | |
| 384 | to build TigerVNC against the GnuTLS DLLs installed under {gnutls_path}. |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 385 | |
| 386 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 387 | =================== |
| 388 | Installing TigerVNC |
| 389 | =================== |
| 390 | |
| 391 | You can use the build system to install TigerVNC into a directory of your |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 392 | choosing. To do this, add: |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 393 | |
| 394 | -DCMAKE_INSTALL_PREFIX={install_directory} |
| 395 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 396 | to the CMake command line. Then, after building TigerVNC, you can run |
| 397 | 'make install' or 'nmake install' (or build the "install" target in the Visual |
| 398 | Studio IDE) to install it. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 399 | |
| 400 | If you don't specify CMAKE_INSTALL_PREFIX, then the default is |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 401 | c:\Program Files\TigerVNC on Windows and /usr/local on Unix. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 402 | |
| 403 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 404 | ========================= |
| 405 | Creating Release Packages |
| 406 | ========================= |
| 407 | |
| 408 | The following commands can be used to create various types of release packages: |
| 409 | |
| 410 | |
| 411 | Unix |
| 412 | ---- |
| 413 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 414 | make tarball |
| 415 | |
| 416 | Create a binary tarball containing the TigerVNC Viewer |
| 417 | |
| 418 | make servertarball |
| 419 | |
| 420 | Create a binary tarball containing both the TigerVNC Server and Viewer |
| 421 | |
| 422 | make dmg |
| 423 | |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame^] | 424 | Create Macintosh disk image file that contains an application bundle of the |
| 425 | TigerVNC Viewer |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 426 | |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame^] | 427 | make udmg |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 428 | |
| 429 | On 64-bit OS X systems, this creates a version of the Macintosh package and |
| 430 | disk image which contains universal i386/x86-64 binaries. You should first |
| 431 | configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit |
| 432 | out-of-tree build, then run 'make udmg' from the 64-bit build directory. The |
| 433 | build system will look for the 32-bit build under {source_directory}/osxx86 |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame^] | 434 | by default, but you can override this by setting the OSX_X86_BUILD CMake |
| 435 | variable to the directory containing your configured 32-bit build. Either |
| 436 | the 64-bit or 32-bit build can be configured to be backward compatible by |
| 437 | using the instructions in the "Build Recipes" section. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 438 | |
| 439 | |
| 440 | Windows |
| 441 | ------- |
| 442 | |
| 443 | If using NMake: |
| 444 | |
| 445 | cd {build_directory} |
| 446 | nmake installer |
| 447 | |
| 448 | If using MinGW: |
| 449 | |
| 450 | cd {build_directory} |
| 451 | make installer |
| 452 | |
| 453 | If using the Visual Studio IDE, build the "installer" project. |
| 454 | |
| 455 | The installer package (TigerVNC[64].exe) will be located under |
| 456 | {build_directory}. If building using the Visual Studio IDE, then the installer |
| 457 | package will be located in a subdirectory with the same name as the |
| 458 | configuration you built (such as {build_directory}\Debug\ or |
| 459 | {build_directory}\Release\). |
| 460 | |
| 461 | NOTE: If TigerVNC is built with TLS support, then the build system will |
| 462 | attempt to package the GnuTLS DLLs into the Windows installer. It looks for |
| 463 | these DLLs in a directory called "bin" one level up from GNUTLS_INCLUDE_DIR. |
| 464 | |
| 465 | |
| 466 | ============= |
| 467 | Build Recipes |
| 468 | ============= |
| 469 | |
| 470 | |
| 471 | 32-bit Build on 64-bit Linux/Unix (including OS X) |
| 472 | -------------------------------------------------- |
| 473 | |
| 474 | Set the following environment variables before running CMake or |
| 475 | 'build-xorg build': |
| 476 | |
| 477 | CFLAGS='-O3 -m32' |
| 478 | CXXFLAGS='-O3 -m32' |
| 479 | LDFLAGS=-m32 |
| 480 | |
| 481 | |
| 482 | 64-bit Backward-Compatible Build on 64-bit OS X |
| 483 | ----------------------------------------------- |
| 484 | |
| 485 | Add |
| 486 | |
| 487 | -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \ |
| 488 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5 |
| 489 | |
| 490 | to the CMake command line. The OS X 10.5 SDK must be installed. |
| 491 | |
| 492 | |
| 493 | 32-bit Backward-Compatible Build on 64-bit OS X |
| 494 | ----------------------------------------------- |
| 495 | |
| 496 | Set the following environment variables: |
| 497 | |
| 498 | CC=gcc-4.0 |
| 499 | CXX=g++-4.0 |
| 500 | CFLAGS='-O3 -m32' |
| 501 | CXXFLAGS='-O3 -m32' |
| 502 | LDFLAGS=-m32 |
| 503 | |
| 504 | and add |
| 505 | |
| 506 | -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \ |
| 507 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 |
| 508 | |
| 509 | to the CMake command line. The OS X 10.4 SDK must be installed. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 510 | |
| 511 | |
| 512 | 64-bit MinGW Build on Cygwin |
| 513 | ---------------------------- |
| 514 | |
| 515 | cd {build_directory} |
| 516 | CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \ |
| 517 | RC=/usr/bin/x86_64-w64-mingw32-windres \ |
| 518 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 519 | -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \ |
| 520 | -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory} |
| 521 | make |
| 522 | |
| 523 | This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or |
| 524 | other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++ |
| 525 | packages (and their dependencies) must be installed. |
| 526 | |
| 527 | |
| 528 | 32-bit MinGW Build on Cygwin |
| 529 | ---------------------------- |
| 530 | |
| 531 | cd {build_directory} |
| 532 | CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \ |
| 533 | RC=/usr/bin/i686-w64-mingw32-windres \ |
| 534 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 535 | -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \ |
| 536 | -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory} |
| 537 | make |
| 538 | |
| 539 | This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or |
| 540 | other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++ |
| 541 | packages (and their dependencies) must be installed. |
| 542 | |
| 543 | |
| 544 | MinGW-w64 Build on Windows |
| 545 | -------------------------- |
| 546 | |
| 547 | This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain |
| 548 | (which is faster than the Cygwin version): |
| 549 | |
| 550 | cd {build_directory} |
| 551 | CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \ |
| 552 | CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \ |
| 553 | RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \ |
| 554 | cmake -G "MSYS Makefiles" \ |
| 555 | -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \ |
| 556 | -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \ |
| 557 | {source_directory} |
| 558 | make |
| 559 | |
| 560 | |
| 561 | MinGW Build on Linux |
| 562 | -------------------- |
| 563 | |
| 564 | cd {build_directory} |
| 565 | CC={mingw_binary_path}/i386-mingw32-gcc \ |
| 566 | CXX={mingw_binary_path}/i386-mingw32-g++ \ |
| 567 | RC={mingw_binary_path}/i386-mingw32-windres \ |
| 568 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 569 | -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ |
| 570 | -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ |
| 571 | {source_directory} |
| 572 | make |