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