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 | |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame^] | 12 | -- FLTK 1.3.0 snapshot |
| 13 | * Must be patched to get full functionality |
| 14 | * See "Building FLTK" below. |
| 15 | |
DRC | 69854b4 | 2011-05-13 09:31:24 +0000 | [diff] [blame] | 16 | -- If building TLS support: |
| 17 | * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error) |
| 18 | |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 19 | -- If building native language support (NLS): |
| 20 | * Gnu gettext 0.14.4 or later |
| 21 | * See "Building Native Language Support" below. |
| 22 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 23 | -- libjpeg-turbo SDK |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 24 | * If your system does not include libjpeg-turbo, then you can download the |
| 25 | SDK from http://sourceforge.net/projects/libjpeg-turbo/files/ |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 26 | * See "Building High-Performance JPEG Support" below. |
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 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 62 | -- MinGW or MinGW-w64 |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 63 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 64 | -- Inno Setup (needed to build the TigerVNC installer) |
| 65 | Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php. |
| 66 | You also need the Inno Setup Preprocessor, which is available in the |
| 67 | Inno Setup QuickStart Pack. |
| 68 | |
| 69 | Add the directory containing iscc.exe (for instance, |
| 70 | C:\Program Files\Inno Setup 5) to the system or user PATH environment |
| 71 | variable prior to building TigerVNC. |
| 72 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 73 | |
DRC | 15b6e05 | 2011-10-06 01:20:52 +0000 | [diff] [blame] | 74 | ========================= |
| 75 | Build Requirements (Java) |
| 76 | ========================= |
| 77 | |
| 78 | -- Sun/Oracle JDK v5 or later or OpenJDK |
| 79 | |
| 80 | -- See "Building Java Support" below. |
| 81 | |
| 82 | |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame^] | 83 | ============= |
| 84 | Building FLTK |
| 85 | ============= |
| 86 | |
| 87 | Currently, TigerVNC requires functionality that is not yet included in the |
| 88 | upstream version of FLTK. Thus, it will be necessary to build FLTK from |
| 89 | source. To do this: |
| 90 | |
| 91 | 1. Check out FLTK 1.3.0r9619 using Subversion: |
| 92 | $ svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3 -r 9619 fltk-1.3.0r9619 |
| 93 | |
| 94 | 2. For full functionality, apply these patches: |
| 95 | |
| 96 | Support horizontal mouse wheel |
| 97 | http://www.fltk.org/str.php?L2644 |
| 98 | |
| 99 | Incorrect resize handling |
| 100 | http://fltk.org/str.php?L2859 |
| 101 | |
| 102 | Export dead key information from FLTK to the apps |
| 103 | http://www.fltk.org/str.php?L2599 |
| 104 | |
| 105 | Notify applications of changes to the clipboard |
| 106 | http://www.fltk.org/str.php?L2636 |
| 107 | |
| 108 | Ability to convert a Fl_Pixmap to a Fl_RGB_Image |
| 109 | http://www.fltk.org/str.php?L2659 |
| 110 | |
| 111 | Support for custom cursors |
| 112 | http://www.fltk.org/str.php?L2660 |
| 113 | |
| 114 | Improve modality interaction with WM |
| 115 | http://www.fltk.org/str.php?L2802 |
| 116 | |
| 117 | Window icons |
| 118 | http://www.fltk.org/str.php?L2816 |
| 119 | |
| 120 | Multihead |
| 121 | http://fltk.org/str.php?L2860 |
| 122 | |
| 123 | |
| 124 | 3. Use CMake to build FLTK using the same procedures described below for |
| 125 | building TigerVNC. The recipes in the "Build Recipes" section also apply. |
| 126 | |
| 127 | 4. (optional) Use 'make install' to install FLTK into a directory of your |
| 128 | choosing. |
| 129 | |
| 130 | 5. When building TigerVNC, set the FLTK_FLUID_EXECUTABLE CMake variable to the |
| 131 | location of the fluid executable that was built in Step 3 or installed in |
| 132 | Step 4. This gives CMake a hint as to where to find the FLTK library. |
| 133 | 6. If you did not install FLTK, then set the FLTK_INCLUDE_DIR CMake variable to |
| 134 | the location of the FLTK source directory. |
| 135 | |
| 136 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 137 | ================== |
| 138 | Out-of-Tree Builds |
| 139 | ================== |
| 140 | |
| 141 | Binary objects, libraries, and executables are generated in the same directory |
| 142 | from which cmake was executed (the "binary directory"), and this directory need |
| 143 | not necessarily be the same as the TigerVNC source directory. You can create |
| 144 | multiple independent binary directories, in which different versions of |
| 145 | TigerVNC can be built from the same source tree using different compilers or |
| 146 | settings. In the sections below, {build_directory} refers to the binary |
| 147 | directory, whereas {source_directory} refers to the TigerVNC source directory. |
| 148 | For in-tree builds, these directories are the same. |
| 149 | |
| 150 | |
| 151 | ================= |
| 152 | Building TigerVNC |
| 153 | ================= |
| 154 | |
| 155 | |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 156 | Building the TigerVNC Viewer on Unix/Mac Systems |
| 157 | ------------------------------------------------ |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 158 | |
| 159 | The following procedure will build the TigerVNC Viewer on Linux and Unix |
| 160 | systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See |
| 161 | "Build Recipes" for specific build instructions for building a 32-bit version |
| 162 | of TigerVNC on 64-bit systems. |
| 163 | |
| 164 | cd {build_directory} |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 165 | cmake -G "Unix Makefiles" [additional CMake flags] {source_directory} |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 166 | make |
| 167 | |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 168 | |
| 169 | Building the TigerVNC Server on Modern Unix/Linux Systems |
| 170 | --------------------------------------------------------- |
| 171 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 172 | Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems |
| 173 | containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use |
| 174 | the X11 shared libraries provided with the system. The procedure for this is |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 175 | system-specific, since it requires specifying such things as font directories, |
| 176 | but the general outline is as follows (this procedure assumes that the viewer |
| 177 | has already been built, per above.) |
| 178 | |
| 179 | > cd {build_directory} |
| 180 | |
| 181 | If performing an out-of-tree build: |
| 182 | > mkdir unix |
| 183 | > cp -R {source_directory}/unix/xserver unix/ |
| 184 | |
| 185 | > cp -R {xorg_source}/* unix/xserver/ |
| 186 | (NOTE: {xorg_source} is the directory containing the Xorg source for the |
| 187 | machine on which you are building TigerVNC. The most recent versions of |
| 188 | Red Hat/CentOS/Fedora, for instance, provide an RPM called |
| 189 | "xorg-x11-server-source", which installs the Xorg source under |
| 190 | /usr/share/xorg-x11-server-source.) |
| 191 | |
| 192 | > cd unix/xserver/ |
| 193 | > patch -p1 < {source_directory}/unix/xserver{version}.patch |
| 194 | (where {version} matches the X server version you are building, such as |
| 195 | "17" for version 1.7.x.) |
| 196 | > autoreconf -fiv |
| 197 | |
Peter Åstrand | 01b2433 | 2011-10-31 08:14:40 +0000 | [diff] [blame] | 198 | > ./configure --with-pic --without-dtrace --disable-static --disable-dri \ |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 199 | --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \ |
| 200 | --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \ |
| 201 | --disable-config-dbus --disable-config-hal --disable-config-udev \ |
| 202 | --disable-dri2 --enable-install-libxf86config --enable-glx \ |
| 203 | --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \ |
| 204 | --with-fontdir=/usr/share/X11/fonts \ |
| 205 | --with-xkb-path=/usr/share/X11/xkb \ |
| 206 | --with-xkb-output=/var/lib/xkb \ |
DRC | 0bb7e13 | 2011-08-24 00:26:54 +0000 | [diff] [blame] | 207 | --with-xkb-bin-directory=/usr/bin \ |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 208 | --with-serverconfig-path=/usr/lib[64]/xorg \ |
| 209 | --with-dri-driver-path=/usr/lib[64]/dri \ |
| 210 | {additional configure options} |
| 211 | (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS |
| 212 | 6 and recent Fedora releases. You should customize it for your particular |
| 213 | system. In particular, it will be necessary to customize the font, XKB, |
| 214 | and DRI directories.) |
| 215 | |
| 216 | > make TIGERVNC_SRCDIR={source_directory} |
| 217 | |
| 218 | |
| 219 | Building the TigerVNC Server on Legacy Unix/Linux Systems |
| 220 | --------------------------------------------------------- |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 221 | |
| 222 | Those using systems with older versions of Xorg must build a "legacy-friendly" |
| 223 | version of the TigerVNC Server. This is accomplished by downloading and |
| 224 | building the more recent Xorg modules in a local directory and then building |
| 225 | Xvnc such that it links against the local build of these libraries, not the X11 |
| 226 | libraries installed on the system. The "build-xorg" script in the TigerVNC |
| 227 | source distribution (located under unix/) automates this process. |
| 228 | |
| 229 | The following procedure will build both the TigerVNC Viewer and a |
| 230 | "legacy-friendly" version of the TigerVNC Server: |
| 231 | |
| 232 | cd {build_directory} |
| 233 | sh {source_directory}/unix/build-xorg init |
| 234 | sh {source_directory}/unix/build-xorg build [additional CMake flags] |
| 235 | |
| 236 | build-xorg generates a version of Xvnc that has no external dependencies on the |
| 237 | X11 shared libraries or any other distribution-specific shared libraries. This |
| 238 | version of Xvnc should be transportable across multiple O/S distributions. |
| 239 | build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later |
| 240 | systems. It probably will not work on older systems. It has not been tested |
| 241 | on non-Linux systems (yet). |
| 242 | |
| 243 | build-xorg can also be used to rebuild just the TigerVNC Server and Viewer, |
| 244 | once the X11 modules and other dependencies have been built for the first time. |
| 245 | This is convenient for testing changes that just apply to the TigerVNC source |
| 246 | code. To accomplish this, run: |
| 247 | |
| 248 | sh {source_directory}/unix/build-xorg rebuild [additional make flags] |
| 249 | |
| 250 | For instance, |
| 251 | |
| 252 | sh {source_directory}/unix/build-xorg rebuild clean |
| 253 | |
| 254 | will clean both the Xvnc and vncviewer builds without destroying any of the |
| 255 | build configuration or module dependencies. |
| 256 | |
| 257 | |
DRC | e4e604f | 2011-10-01 17:54:36 +0000 | [diff] [blame] | 258 | Building the Windows TigerVNC Viewer with MinGW |
| 259 | ----------------------------------------------- |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 260 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 261 | If building the Windows version of TigerVNC on a Windows build system, use |
| 262 | the following procedure. |
| 263 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 264 | cd {build_directory} |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 265 | cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory} |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 266 | make |
| 267 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 268 | If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section |
| 269 | below. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 270 | |
| 271 | |
| 272 | Debug Build |
| 273 | ----------- |
| 274 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 275 | Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 276 | |
| 277 | |
DRC | e4e604f | 2011-10-01 17:54:36 +0000 | [diff] [blame] | 278 | Self-Contained GCC Build |
| 279 | ------------------------ |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 280 | |
DRC | e4e604f | 2011-10-01 17:54:36 +0000 | [diff] [blame] | 281 | If TigerVNC is built using GCC (including MinGW), then it may depend on the |
| 282 | libgcc or libstdc++ dynamic libraries. To eliminate this dependency, add |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 283 | |
DRC | e4e604f | 2011-10-01 17:54:36 +0000 | [diff] [blame] | 284 | -DBUILD_STATIC=1 |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 285 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 286 | to the CMake command line. |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 287 | |
| 288 | |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 289 | ====================================== |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 290 | Building High-Performance JPEG Support |
| 291 | ====================================== |
| 292 | |
| 293 | In order to achieve its high levels of performance, TigerVNC relies on |
| 294 | libjpeg-turbo (http://www.libjpeg-turbo.org), a derivative of libjpeg which |
| 295 | uses SIMD instructions to accelerate baseline JPEG compression and |
| 296 | decompression. If you are building TigerVNC on an operating system that |
| 297 | includes libjpeg-turbo as a system library (for instance, Fedora 14 and later), |
| 298 | then the TigerVNC build system should detect the system version of |
| 299 | libjpeg-turbo automatically and link against it. However, this produces a |
| 300 | version of TigerVNC that depends on the libjpeg-turbo dynamic libraries, and |
| 301 | thus the TigerVNC binaries are not portable. |
| 302 | |
| 303 | To build a fully portable, cross-compatible version of TigerVNC with |
| 304 | high-performance JPEG support, it is necessary to link against the |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 305 | libjpeg-turbo static library. This is also necessary when building the |
| 306 | Windows or OS X versions of TigerVNC. To link against the libjpeg-turbo static |
| 307 | library, first install the libjpeg-turbo SDK, which is available from |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 308 | https://sourceforge.net/projects/libjpeg-turbo/files/. Next, use the |
| 309 | JPEG_INCLUDE_DIR and JPEG_LIBRARY CMake variables to specify the location of |
| 310 | libjpeg-turbo. For example, adding |
| 311 | |
| 312 | -DJPEG_INCLUDE_DIR=/opt/libjpeg-turbo/include \ |
| 313 | -DJPEG_LIBRARY=/opt/libjpeg-turbo/lib/libjpeg.a |
| 314 | |
| 315 | to the CMake command line will link TigerVNC against a static version of |
| 316 | libjpeg-turbo installed under /opt/TigerVNC (which is the normal install |
| 317 | location for the libjpeg-turbo SDK on Unix and Linux platforms.) Replace "lib" |
| 318 | with "lib32" or "lib64" to use the 32-bit or 64-bit version of the library on |
| 319 | 64-bit Linux platforms. |
| 320 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 321 | When building on Windows systems, adding |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 322 | |
| 323 | -DJPEG_INCLUDE_DIR=/c/libjpeg-turbo-gcc[64]/include \ |
| 324 | -DJPEG_LIBRARY=/c/libjpeg-turbo-gcc[64]/lib/libjpeg.a |
| 325 | |
| 326 | to the CMake command line will link TigerVNC against the static version of |
| 327 | libjpeg-turbo provided by the libjpeg-turbo SDK for GCC (MinGW.) |
| 328 | |
| 329 | CMake will report: |
| 330 | |
| 331 | Performing Test FOUND_LIBJPEG_TURBO - Success |
| 332 | |
| 333 | if it successfully finds libjpeg-turbo. |
| 334 | |
| 335 | |
DRC | 15b6e05 | 2011-10-06 01:20:52 +0000 | [diff] [blame] | 336 | ===================== |
| 337 | Building Java Support |
| 338 | ===================== |
| 339 | |
| 340 | TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on |
| 341 | any platform that has a Java Runtime Environment (JRE) installed. The Java |
| 342 | viewer works similarly to the native viewer, but with lower performance. |
| 343 | |
| 344 | To build the Java TigerVNC Viewer, add |
| 345 | |
| 346 | -DBUILD_JAVA=1 |
| 347 | |
| 348 | to the CMake or build-xorg command line. The build system will attempt to find |
| 349 | an installed Java Development Kit (JDK) and determine the appropriate paths for |
| 350 | the Java compiler (javac) and the JAR creation utility (jar). You can override |
| 351 | these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake |
| 352 | variables. You can also override the default flags that are passed to javac |
| 353 | by setting the JAVACFLAGS CMake variable. The build system will look for |
| 354 | keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These |
| 355 | tools are needed to sign the JAR file, which is necessary to enable certain |
| 356 | functionality (such as clipboard transfers) when the Java viewer is used as an |
| 357 | applet. |
| 358 | |
| 359 | If the Java viewer is built along with the Windows TigerVNC Server (WinVNC), |
| 360 | then the build system will embed the Java viewer into WinVNC4.exe so that it |
| 361 | will automatically be served up using WinVNC's built-in HTTP server. |
| 362 | Similarly, if the Java viewer is built along with the Unix TigerVNC Server |
| 363 | (Xvnc), then the build system will include the Java viewer in the server |
| 364 | tarball. |
| 365 | |
| 366 | |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 367 | ====================================== |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 368 | Building Native Language Support (NLS) |
| 369 | ====================================== |
| 370 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 371 | NLS requires gettext, which is supplied with most Linux distributions and |
| 372 | with MinGW for Windows and which can easily be built from source on OS X and |
| 373 | other Unix variants. |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 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 | |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 473 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 474 | =================== |
| 475 | Installing TigerVNC |
| 476 | =================== |
| 477 | |
| 478 | 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] | 479 | choosing. To do this, add: |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 480 | |
| 481 | -DCMAKE_INSTALL_PREFIX={install_directory} |
| 482 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 483 | to the CMake command line. Then, you can run 'make install' to build and |
| 484 | install it. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 485 | |
| 486 | If you don't specify CMAKE_INSTALL_PREFIX, then the default is |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 487 | c:\Program Files\TigerVNC on Windows and /usr/local on Unix. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 488 | |
| 489 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 490 | ========================= |
| 491 | Creating Release Packages |
| 492 | ========================= |
| 493 | |
| 494 | The following commands can be used to create various types of release packages: |
| 495 | |
| 496 | |
| 497 | Unix |
| 498 | ---- |
| 499 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 500 | make tarball |
| 501 | |
| 502 | Create a binary tarball containing the TigerVNC Viewer |
| 503 | |
| 504 | make servertarball |
| 505 | |
| 506 | Create a binary tarball containing both the TigerVNC Server and Viewer |
| 507 | |
| 508 | make dmg |
| 509 | |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame] | 510 | Create Macintosh disk image file that contains an application bundle of the |
| 511 | TigerVNC Viewer |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 512 | |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame] | 513 | make udmg |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 514 | |
| 515 | On 64-bit OS X systems, this creates a version of the Macintosh package and |
| 516 | disk image which contains universal i386/x86-64 binaries. You should first |
| 517 | configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit |
| 518 | out-of-tree build, then run 'make udmg' from the 64-bit build directory. The |
| 519 | build system will look for the 32-bit build under {source_directory}/osxx86 |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame] | 520 | by default, but you can override this by setting the OSX_X86_BUILD CMake |
| 521 | variable to the directory containing your configured 32-bit build. Either |
| 522 | the 64-bit or 32-bit build can be configured to be backward compatible by |
| 523 | using the instructions in the "Build Recipes" section. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 524 | |
| 525 | |
| 526 | Windows |
| 527 | ------- |
| 528 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 529 | make installer |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 530 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 531 | Create a Windows installer using Inno Setup. The installer package |
| 532 | (TigerVNC[64].exe) will be located under {build_directory}. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 533 | |
| 534 | |
| 535 | ============= |
| 536 | Build Recipes |
| 537 | ============= |
| 538 | |
| 539 | |
| 540 | 32-bit Build on 64-bit Linux/Unix (including OS X) |
| 541 | -------------------------------------------------- |
| 542 | |
DRC | dc4f354 | 2011-08-24 00:30:49 +0000 | [diff] [blame] | 543 | Set the following environment variables before building TigerVNC. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 544 | |
| 545 | CFLAGS='-O3 -m32' |
| 546 | CXXFLAGS='-O3 -m32' |
| 547 | LDFLAGS=-m32 |
| 548 | |
DRC | dc4f354 | 2011-08-24 00:30:49 +0000 | [diff] [blame] | 549 | If you are building the TigerVNC Server on a modern Unix/Linux system, then |
| 550 | you will also need to pass the appropriate --host argument when configuring the |
| 551 | X server source (for instance, --host=i686-pc-linux-gnu). |
| 552 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 553 | |
| 554 | 64-bit Backward-Compatible Build on 64-bit OS X |
| 555 | ----------------------------------------------- |
| 556 | |
| 557 | Add |
| 558 | |
| 559 | -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \ |
| 560 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5 |
| 561 | |
| 562 | to the CMake command line. The OS X 10.5 SDK must be installed. |
| 563 | |
| 564 | |
| 565 | 32-bit Backward-Compatible Build on 64-bit OS X |
| 566 | ----------------------------------------------- |
| 567 | |
| 568 | Set the following environment variables: |
| 569 | |
| 570 | CC=gcc-4.0 |
| 571 | CXX=g++-4.0 |
| 572 | CFLAGS='-O3 -m32' |
| 573 | CXXFLAGS='-O3 -m32' |
| 574 | LDFLAGS=-m32 |
| 575 | |
| 576 | and add |
| 577 | |
| 578 | -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \ |
| 579 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 |
| 580 | |
| 581 | 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] | 582 | |
| 583 | |
| 584 | 64-bit MinGW Build on Cygwin |
| 585 | ---------------------------- |
| 586 | |
| 587 | cd {build_directory} |
| 588 | CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \ |
| 589 | RC=/usr/bin/x86_64-w64-mingw32-windres \ |
| 590 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 591 | -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \ |
| 592 | -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory} |
| 593 | make |
| 594 | |
| 595 | This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or |
| 596 | other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++ |
| 597 | packages (and their dependencies) must be installed. |
| 598 | |
| 599 | |
| 600 | 32-bit MinGW Build on Cygwin |
| 601 | ---------------------------- |
| 602 | |
| 603 | cd {build_directory} |
| 604 | CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \ |
| 605 | RC=/usr/bin/i686-w64-mingw32-windres \ |
| 606 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 607 | -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \ |
| 608 | -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory} |
| 609 | make |
| 610 | |
| 611 | This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or |
| 612 | other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++ |
| 613 | packages (and their dependencies) must be installed. |
| 614 | |
| 615 | |
| 616 | MinGW-w64 Build on Windows |
| 617 | -------------------------- |
| 618 | |
| 619 | This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain |
| 620 | (which is faster than the Cygwin version): |
| 621 | |
| 622 | cd {build_directory} |
| 623 | CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \ |
| 624 | CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \ |
| 625 | RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \ |
| 626 | cmake -G "MSYS Makefiles" \ |
| 627 | -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \ |
| 628 | -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \ |
| 629 | {source_directory} |
| 630 | make |
| 631 | |
| 632 | |
| 633 | MinGW Build on Linux |
| 634 | -------------------- |
| 635 | |
| 636 | cd {build_directory} |
| 637 | CC={mingw_binary_path}/i386-mingw32-gcc \ |
| 638 | CXX={mingw_binary_path}/i386-mingw32-g++ \ |
| 639 | RC={mingw_binary_path}/i386-mingw32-windres \ |
| 640 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 641 | -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ |
| 642 | -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ |
| 643 | {source_directory} |
| 644 | make |