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