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 | e7370bd | 2013-01-22 08:11:05 +0000 | [diff] [blame] | 12 | -- FLTK 1.3.2 |
Pierre Ossman | c656bac | 2012-08-17 08:10:27 +0000 | [diff] [blame] | 13 | * Must be a patched snapshot to get full functionality |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame] | 14 | * See "Building FLTK" below. |
| 15 | |
DRC | 69854b4 | 2011-05-13 09:31:24 +0000 | [diff] [blame] | 16 | -- If building TLS support: |
Pierre Ossman | ec3dfe6 | 2014-10-17 10:36:58 +0200 | [diff] [blame] | 17 | * GnuTLS |
Brian P. Hinz | 34d2b4d | 2014-11-14 00:25:12 -0500 | [diff] [blame] | 18 | * See "Building TLS Support" below. |
DRC | 69854b4 | 2011-05-13 09:31:24 +0000 | [diff] [blame] | 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 | |
Pierre Ossman | 3e4281b | 2014-10-17 10:40:07 +0200 | [diff] [blame] | 24 | -- libjpeg-turbo |
| 25 | * "Normal" libjpegv6 is also supported, although it is not |
| 26 | recommended as it is much slower. |
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 | |
Pierre Ossman | 1d36ed8 | 2014-08-22 14:41:03 +0200 | [diff] [blame] | 87 | TigerVNC requires FLTK 1.3.2 (or later). Although it will build and work |
| 88 | with plain 1.3.2, to get full functionality and the best behaviour you |
Pierre Ossman | c656bac | 2012-08-17 08:10:27 +0000 | [diff] [blame] | 89 | need to build a patched version: |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame] | 90 | |
Peter Åstrand | e7370bd | 2013-01-22 08:11:05 +0000 | [diff] [blame] | 91 | 1. Check out FLTK 1.3.2 using Subversion: |
| 92 | $ svn co http://svn.easysw.com/public/fltk/fltk/tags/release-1.3.2 fltk-1.3.2 |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame] | 93 | |
Pierre Ossman | 2f11bd9 | 2014-08-22 14:43:33 +0200 | [diff] [blame] | 94 | 2. For full functionality, apply patches. All patches can be found in |
| 95 | the contrib/fltk/ directory. There are also some general fixes to |
| 96 | FLTK that can be found in the contrib/fltk/fixes/ directory that |
| 97 | might be useful. |
Brian Hinz | 1ff04d1 | 2013-11-28 16:26:08 +0000 | [diff] [blame] | 98 | |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame] | 99 | 3. Use CMake to build FLTK using the same procedures described below for |
| 100 | building TigerVNC. The recipes in the "Build Recipes" section also apply. |
Peter Åstrand | fc3e86e | 2013-01-07 09:59:00 +0000 | [diff] [blame] | 101 | If you want optimized code, make sure to build with |
| 102 | -DCMAKE_BUILD_TYPE=Release. |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame] | 103 | |
| 104 | 4. (optional) Use 'make install' to install FLTK into a directory of your |
| 105 | choosing. |
| 106 | |
| 107 | 5. When building TigerVNC, set the FLTK_FLUID_EXECUTABLE CMake variable to the |
| 108 | location of the fluid executable that was built in Step 3 or installed in |
| 109 | Step 4. This gives CMake a hint as to where to find the FLTK library. |
Pierre Ossman | bbb0c61 | 2012-08-17 08:05:59 +0000 | [diff] [blame] | 110 | |
Peter Åstrand | 956a636 | 2012-08-09 07:33:08 +0000 | [diff] [blame] | 111 | 6. If you did not install FLTK, then set the FLTK_INCLUDE_DIR CMake variable to |
| 112 | the location of the FLTK source directory. |
| 113 | |
| 114 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 115 | ================== |
| 116 | Out-of-Tree Builds |
| 117 | ================== |
| 118 | |
| 119 | Binary objects, libraries, and executables are generated in the same directory |
| 120 | from which cmake was executed (the "binary directory"), and this directory need |
| 121 | not necessarily be the same as the TigerVNC source directory. You can create |
| 122 | multiple independent binary directories, in which different versions of |
| 123 | TigerVNC can be built from the same source tree using different compilers or |
| 124 | settings. In the sections below, {build_directory} refers to the binary |
| 125 | directory, whereas {source_directory} refers to the TigerVNC source directory. |
| 126 | For in-tree builds, these directories are the same. |
| 127 | |
| 128 | |
| 129 | ================= |
| 130 | Building TigerVNC |
| 131 | ================= |
| 132 | |
| 133 | |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 134 | Building the TigerVNC Viewer on Unix/Mac Systems |
| 135 | ------------------------------------------------ |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 136 | |
| 137 | The following procedure will build the TigerVNC Viewer on Linux and Unix |
| 138 | systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See |
| 139 | "Build Recipes" for specific build instructions for building a 32-bit version |
| 140 | of TigerVNC on 64-bit systems. |
| 141 | |
| 142 | cd {build_directory} |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 143 | cmake -G "Unix Makefiles" [additional CMake flags] {source_directory} |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 144 | make |
| 145 | |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 146 | |
| 147 | Building the TigerVNC Server on Modern Unix/Linux Systems |
| 148 | --------------------------------------------------------- |
| 149 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 150 | Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems |
| 151 | containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use |
| 152 | the X11 shared libraries provided with the system. The procedure for this is |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 153 | system-specific, since it requires specifying such things as font directories, |
| 154 | but the general outline is as follows (this procedure assumes that the viewer |
| 155 | has already been built, per above.) |
| 156 | |
| 157 | > cd {build_directory} |
| 158 | |
| 159 | If performing an out-of-tree build: |
| 160 | > mkdir unix |
| 161 | > cp -R {source_directory}/unix/xserver unix/ |
| 162 | |
| 163 | > cp -R {xorg_source}/* unix/xserver/ |
| 164 | (NOTE: {xorg_source} is the directory containing the Xorg source for the |
| 165 | machine on which you are building TigerVNC. The most recent versions of |
| 166 | Red Hat/CentOS/Fedora, for instance, provide an RPM called |
| 167 | "xorg-x11-server-source", which installs the Xorg source under |
| 168 | /usr/share/xorg-x11-server-source.) |
| 169 | |
| 170 | > cd unix/xserver/ |
| 171 | > patch -p1 < {source_directory}/unix/xserver{version}.patch |
| 172 | (where {version} matches the X server version you are building, such as |
| 173 | "17" for version 1.7.x.) |
| 174 | > autoreconf -fiv |
| 175 | |
Peter Åstrand | 01b2433 | 2011-10-31 08:14:40 +0000 | [diff] [blame] | 176 | > ./configure --with-pic --without-dtrace --disable-static --disable-dri \ |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 177 | --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \ |
| 178 | --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \ |
| 179 | --disable-config-dbus --disable-config-hal --disable-config-udev \ |
| 180 | --disable-dri2 --enable-install-libxf86config --enable-glx \ |
| 181 | --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \ |
| 182 | --with-fontdir=/usr/share/X11/fonts \ |
| 183 | --with-xkb-path=/usr/share/X11/xkb \ |
| 184 | --with-xkb-output=/var/lib/xkb \ |
DRC | 0bb7e13 | 2011-08-24 00:26:54 +0000 | [diff] [blame] | 185 | --with-xkb-bin-directory=/usr/bin \ |
DRC | 62f3a66 | 2011-08-24 00:03:31 +0000 | [diff] [blame] | 186 | --with-serverconfig-path=/usr/lib[64]/xorg \ |
| 187 | --with-dri-driver-path=/usr/lib[64]/dri \ |
| 188 | {additional configure options} |
| 189 | (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS |
| 190 | 6 and recent Fedora releases. You should customize it for your particular |
| 191 | system. In particular, it will be necessary to customize the font, XKB, |
| 192 | and DRI directories.) |
| 193 | |
| 194 | > make TIGERVNC_SRCDIR={source_directory} |
| 195 | |
| 196 | |
| 197 | Building the TigerVNC Server on Legacy Unix/Linux Systems |
| 198 | --------------------------------------------------------- |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 199 | |
| 200 | Those using systems with older versions of Xorg must build a "legacy-friendly" |
| 201 | version of the TigerVNC Server. This is accomplished by downloading and |
| 202 | building the more recent Xorg modules in a local directory and then building |
| 203 | Xvnc such that it links against the local build of these libraries, not the X11 |
| 204 | libraries installed on the system. The "build-xorg" script in the TigerVNC |
| 205 | source distribution (located under unix/) automates this process. |
| 206 | |
| 207 | The following procedure will build both the TigerVNC Viewer and a |
| 208 | "legacy-friendly" version of the TigerVNC Server: |
| 209 | |
| 210 | cd {build_directory} |
| 211 | sh {source_directory}/unix/build-xorg init |
| 212 | sh {source_directory}/unix/build-xorg build [additional CMake flags] |
| 213 | |
| 214 | build-xorg generates a version of Xvnc that has no external dependencies on the |
| 215 | X11 shared libraries or any other distribution-specific shared libraries. This |
| 216 | version of Xvnc should be transportable across multiple O/S distributions. |
| 217 | build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later |
| 218 | systems. It probably will not work on older systems. It has not been tested |
| 219 | on non-Linux systems (yet). |
| 220 | |
| 221 | build-xorg can also be used to rebuild just the TigerVNC Server and Viewer, |
| 222 | once the X11 modules and other dependencies have been built for the first time. |
| 223 | This is convenient for testing changes that just apply to the TigerVNC source |
| 224 | code. To accomplish this, run: |
| 225 | |
| 226 | sh {source_directory}/unix/build-xorg rebuild [additional make flags] |
| 227 | |
| 228 | For instance, |
| 229 | |
| 230 | sh {source_directory}/unix/build-xorg rebuild clean |
| 231 | |
| 232 | will clean both the Xvnc and vncviewer builds without destroying any of the |
| 233 | build configuration or module dependencies. |
| 234 | |
| 235 | |
DRC | e4e604f | 2011-10-01 17:54:36 +0000 | [diff] [blame] | 236 | Building the Windows TigerVNC Viewer with MinGW |
| 237 | ----------------------------------------------- |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 238 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 239 | If building the Windows version of TigerVNC on a Windows build system, use |
| 240 | the following procedure. |
| 241 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 242 | cd {build_directory} |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 243 | cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory} |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 244 | make |
| 245 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 246 | If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section |
| 247 | below. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 248 | |
| 249 | |
| 250 | Debug Build |
| 251 | ----------- |
| 252 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 253 | Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 254 | |
| 255 | |
Pierre Ossman | f95272d | 2014-10-17 13:59:35 +0200 | [diff] [blame] | 256 | Portable (semi-static) Build |
| 257 | ---------------------------- |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 258 | |
Pierre Ossman | f95272d | 2014-10-17 13:59:35 +0200 | [diff] [blame] | 259 | TigerVNC can under favourble circumstances be built in a way that allows |
| 260 | the resulting binaries to run on any system without having to also install |
| 261 | all the dynamic libraries it depends on. Enable this mode by adding: |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 262 | |
DRC | e4e604f | 2011-10-01 17:54:36 +0000 | [diff] [blame] | 263 | -DBUILD_STATIC=1 |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 264 | |
Adam Tkac | f586b84 | 2011-04-27 11:20:18 +0000 | [diff] [blame] | 265 | to the CMake command line. |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 266 | |
Pierre Ossman | f95272d | 2014-10-17 13:59:35 +0200 | [diff] [blame] | 267 | Note that the method used to achieve this is very fragile and it may be |
| 268 | necessary to tweak cmake/StaticBuild.cmake to make things work on your |
| 269 | specific system. |
| 270 | |
DRC | 8290dd6 | 2011-02-10 22:54:36 +0000 | [diff] [blame] | 271 | |
DRC | 15b6e05 | 2011-10-06 01:20:52 +0000 | [diff] [blame] | 272 | ===================== |
| 273 | Building Java Support |
| 274 | ===================== |
| 275 | |
| 276 | TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on |
| 277 | any platform that has a Java Runtime Environment (JRE) installed. The Java |
| 278 | viewer works similarly to the native viewer, but with lower performance. |
| 279 | |
| 280 | To build the Java TigerVNC Viewer, add |
| 281 | |
| 282 | -DBUILD_JAVA=1 |
| 283 | |
| 284 | to the CMake or build-xorg command line. The build system will attempt to find |
| 285 | an installed Java Development Kit (JDK) and determine the appropriate paths for |
| 286 | the Java compiler (javac) and the JAR creation utility (jar). You can override |
| 287 | these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake |
| 288 | variables. You can also override the default flags that are passed to javac |
| 289 | by setting the JAVACFLAGS CMake variable. The build system will look for |
| 290 | keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These |
| 291 | tools are needed to sign the JAR file, which is necessary to enable certain |
| 292 | functionality (such as clipboard transfers) when the Java viewer is used as an |
| 293 | applet. |
| 294 | |
| 295 | If the Java viewer is built along with the Windows TigerVNC Server (WinVNC), |
| 296 | then the build system will embed the Java viewer into WinVNC4.exe so that it |
| 297 | will automatically be served up using WinVNC's built-in HTTP server. |
| 298 | Similarly, if the Java viewer is built along with the Unix TigerVNC Server |
| 299 | (Xvnc), then the build system will include the Java viewer in the server |
| 300 | tarball. |
| 301 | |
Brian Hinz | f88b3ad | 2013-12-02 02:53:10 +0000 | [diff] [blame] | 302 | By default, a self-signed certificate will be generated and used to sign the |
| 303 | jar file. By specifying the following command line arguments to the CMake |
| 304 | command line, an alternate certificate may be used for signing. |
| 305 | |
| 306 | -DJAVA_KEYSTORE=${keystore_location_or_url} |
| 307 | -DJAVA_KEYSTORE_TYPE=${keystore_type} (Default: "jks") |
| 308 | -DJAVA_KEY_ALIAS=${keytore_key_alias} |
| 309 | -DJAVA_STOREPASS=${keystore_password} |
| 310 | -DJAVA_KEYPASS=${keystore_entry_password} |
| 311 | -DJAVA_TSA_URL=${url_of_timestamping_authority} |
| 312 | |
| 313 | The values of the JAVA_STOREPASS and JAVA_KEYPASS arguments may optionally be |
| 314 | read from file or environment variables by prefixing the value with ":env " |
| 315 | or ":file " (see the jarsigner documentation for more info): |
| 316 | |
| 317 | export StorePass=tigervnc |
| 318 | export KeyPass=tigervnc |
| 319 | cmake \ |
| 320 | ... |
| 321 | -DJAVA_STOREPASS=":env StorePass" |
| 322 | -DJAVA_KEYPASS=":env KeyPass" |
| 323 | |
DRC | 15b6e05 | 2011-10-06 01:20:52 +0000 | [diff] [blame] | 324 | |
DRC | 240a5ff | 2011-07-06 07:28:30 +0000 | [diff] [blame] | 325 | ====================================== |
Brian P. Hinz | 34d2b4d | 2014-11-14 00:25:12 -0500 | [diff] [blame] | 326 | Building TLS Support |
| 327 | ====================================== |
| 328 | |
| 329 | TLS requires GnuTLS, which is supplied with most Linux distributions and |
| 330 | with MinGW for Windows and can be built from source on OS X and other |
| 331 | Unix variants. However, GnuTLS versions > 2.12.x && < 3.3.x should be |
| 332 | avoided because of potential incompatibilities during initial handshaking. |
| 333 | |
| 334 | You can override the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR CMake variables |
| 335 | to specify the locations of libgnutls and any dependencies. For instance, |
| 336 | adding |
| 337 | |
| 338 | -DGNUTLS_INCLUDE_DIR=/usr/local/include \ |
Brian P. Hinz | 94433e8 | 2014-11-18 07:39:35 -0500 | [diff] [blame^] | 339 | -DGNUTLS_LIBRARY=/usr/local/lib/libgnutls.a |
Brian P. Hinz | 34d2b4d | 2014-11-14 00:25:12 -0500 | [diff] [blame] | 340 | |
| 341 | to the CMake command line would link TigerVNC against a static version of |
| 342 | libgnutls located under /usr/local. |
| 343 | |
| 344 | |
| 345 | ====================================== |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 346 | Building Native Language Support (NLS) |
| 347 | ====================================== |
| 348 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 349 | NLS requires gettext, which is supplied with most Linux distributions and |
| 350 | with MinGW for Windows and which can easily be built from source on OS X and |
| 351 | other Unix variants. |
DRC | ce355e3 | 2011-06-24 04:58:01 +0000 | [diff] [blame] | 352 | |
| 353 | You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to |
| 354 | specify the locations of libiconv and libintl, respectively. For instance, |
| 355 | adding |
| 356 | |
| 357 | -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a |
| 358 | |
| 359 | to the CMake command line would link TigerVNC against a static version of |
| 360 | libintl located under /opt/gettext. Adding |
| 361 | |
| 362 | -DICONV_INCLUDE_DIR=/mingw/include \ |
| 363 | -DICONV_LIBRARIES=/mingw/lib/libiconv.a \ |
| 364 | -DGETTEXT_INCLUDE_DIR=/mingw/include \ |
| 365 | -DLIBINTL_LIBRARY=/mingw/lib/libintl.a |
| 366 | |
| 367 | to the CMake command line would link TigerVNC against the static versions of |
| 368 | libiconv and libintl included in the MinGW Developer Toolkit. |
| 369 | |
| 370 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 371 | =================== |
| 372 | Installing TigerVNC |
| 373 | =================== |
| 374 | |
| 375 | 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] | 376 | choosing. To do this, add: |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 377 | |
| 378 | -DCMAKE_INSTALL_PREFIX={install_directory} |
| 379 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 380 | to the CMake command line. Then, you can run 'make install' to build and |
| 381 | install it. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 382 | |
| 383 | If you don't specify CMAKE_INSTALL_PREFIX, then the default is |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 384 | c:\Program Files\TigerVNC on Windows and /usr/local on Unix. |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 385 | |
| 386 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 387 | ========================= |
| 388 | Creating Release Packages |
| 389 | ========================= |
| 390 | |
| 391 | The following commands can be used to create various types of release packages: |
| 392 | |
| 393 | |
| 394 | Unix |
| 395 | ---- |
| 396 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 397 | make tarball |
| 398 | |
| 399 | Create a binary tarball containing the TigerVNC Viewer |
| 400 | |
| 401 | make servertarball |
| 402 | |
| 403 | Create a binary tarball containing both the TigerVNC Server and Viewer |
| 404 | |
| 405 | make dmg |
| 406 | |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame] | 407 | Create Macintosh disk image file that contains an application bundle of the |
| 408 | TigerVNC Viewer |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 409 | |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame] | 410 | make udmg |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 411 | |
| 412 | On 64-bit OS X systems, this creates a version of the Macintosh package and |
| 413 | disk image which contains universal i386/x86-64 binaries. You should first |
| 414 | configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit |
| 415 | out-of-tree build, then run 'make udmg' from the 64-bit build directory. The |
| 416 | build system will look for the 32-bit build under {source_directory}/osxx86 |
DRC | aab3830 | 2011-06-25 20:24:02 +0000 | [diff] [blame] | 417 | by default, but you can override this by setting the OSX_X86_BUILD CMake |
| 418 | variable to the directory containing your configured 32-bit build. Either |
| 419 | the 64-bit or 32-bit build can be configured to be backward compatible by |
| 420 | using the instructions in the "Build Recipes" section. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 421 | |
| 422 | |
| 423 | Windows |
| 424 | ------- |
| 425 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 426 | make installer |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 427 | |
DRC | ccc0969 | 2011-11-08 06:57:58 +0000 | [diff] [blame] | 428 | Create a Windows installer using Inno Setup. The installer package |
| 429 | (TigerVNC[64].exe) will be located under {build_directory}. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 430 | |
| 431 | |
| 432 | ============= |
| 433 | Build Recipes |
| 434 | ============= |
| 435 | |
| 436 | |
| 437 | 32-bit Build on 64-bit Linux/Unix (including OS X) |
| 438 | -------------------------------------------------- |
| 439 | |
DRC | dc4f354 | 2011-08-24 00:30:49 +0000 | [diff] [blame] | 440 | Set the following environment variables before building TigerVNC. |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 441 | |
| 442 | CFLAGS='-O3 -m32' |
| 443 | CXXFLAGS='-O3 -m32' |
| 444 | LDFLAGS=-m32 |
| 445 | |
DRC | dc4f354 | 2011-08-24 00:30:49 +0000 | [diff] [blame] | 446 | If you are building the TigerVNC Server on a modern Unix/Linux system, then |
| 447 | you will also need to pass the appropriate --host argument when configuring the |
| 448 | X server source (for instance, --host=i686-pc-linux-gnu). |
| 449 | |
DRC | 667df92 | 2011-06-23 10:11:22 +0000 | [diff] [blame] | 450 | |
| 451 | 64-bit Backward-Compatible Build on 64-bit OS X |
| 452 | ----------------------------------------------- |
| 453 | |
| 454 | Add |
| 455 | |
| 456 | -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \ |
| 457 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5 |
| 458 | |
| 459 | to the CMake command line. The OS X 10.5 SDK must be installed. |
| 460 | |
| 461 | |
| 462 | 32-bit Backward-Compatible Build on 64-bit OS X |
| 463 | ----------------------------------------------- |
| 464 | |
| 465 | Set the following environment variables: |
| 466 | |
| 467 | CC=gcc-4.0 |
| 468 | CXX=g++-4.0 |
| 469 | CFLAGS='-O3 -m32' |
| 470 | CXXFLAGS='-O3 -m32' |
| 471 | LDFLAGS=-m32 |
| 472 | |
| 473 | and add |
| 474 | |
| 475 | -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \ |
| 476 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 |
| 477 | |
| 478 | 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] | 479 | |
| 480 | |
| 481 | 64-bit MinGW Build on Cygwin |
| 482 | ---------------------------- |
| 483 | |
| 484 | cd {build_directory} |
| 485 | CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \ |
| 486 | RC=/usr/bin/x86_64-w64-mingw32-windres \ |
| 487 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 488 | -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \ |
| 489 | -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory} |
| 490 | make |
| 491 | |
| 492 | This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or |
| 493 | other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++ |
| 494 | packages (and their dependencies) must be installed. |
| 495 | |
| 496 | |
| 497 | 32-bit MinGW Build on Cygwin |
| 498 | ---------------------------- |
| 499 | |
| 500 | cd {build_directory} |
| 501 | CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \ |
| 502 | RC=/usr/bin/i686-w64-mingw32-windres \ |
| 503 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 504 | -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \ |
| 505 | -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory} |
| 506 | make |
| 507 | |
| 508 | This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or |
| 509 | other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++ |
| 510 | packages (and their dependencies) must be installed. |
| 511 | |
| 512 | |
| 513 | MinGW-w64 Build on Windows |
| 514 | -------------------------- |
| 515 | |
| 516 | This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain |
| 517 | (which is faster than the Cygwin version): |
| 518 | |
| 519 | cd {build_directory} |
| 520 | CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \ |
| 521 | CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \ |
| 522 | RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \ |
| 523 | cmake -G "MSYS Makefiles" \ |
| 524 | -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \ |
| 525 | -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \ |
| 526 | {source_directory} |
| 527 | make |
| 528 | |
| 529 | |
| 530 | MinGW Build on Linux |
| 531 | -------------------- |
| 532 | |
| 533 | cd {build_directory} |
| 534 | CC={mingw_binary_path}/i386-mingw32-gcc \ |
| 535 | CXX={mingw_binary_path}/i386-mingw32-g++ \ |
| 536 | RC={mingw_binary_path}/i386-mingw32-windres \ |
| 537 | cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ |
| 538 | -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ |
| 539 | -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ |
| 540 | {source_directory} |
| 541 | make |
Brian Hinz | 1ff04d1 | 2013-11-28 16:26:08 +0000 | [diff] [blame] | 542 | |
| 543 | |
| 544 | =============================== |
| 545 | Distribution-Specific Packaging |
| 546 | =============================== |
| 547 | |
| 548 | |
| 549 | RPM Packages for RHEL / CentOS |
| 550 | ------------------------------ |
| 551 | |
| 552 | The RPM spec files and patches used to create the nightly builds |
| 553 | and releases can be found in the "contrib/rpm/el{5,6}" directories |
| 554 | of the TigerVNC subversion trunk. All external source tarballs |
| 555 | must be fetched manually and placed into the 'SOURCES' directory |
| 556 | under the rpmbuild root. Additonally, the following macros need |
| 557 | to be defined: |
| 558 | |
| 559 | EL6: |
| 560 | %debug_package %{nil} |
| 561 | |
| 562 | EL5: |
| 563 | %dist .el5 |
| 564 | %_smp_mflags -j3 |
| 565 | %debug_package %{nil} |
| 566 | %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot |
| 567 | |
| 568 | |
| 569 | Debian packages for Ubuntu 12.04LTS |
| 570 | ----------------------------------- |
| 571 | The debian folder used to create the nightly builds and releases |
| 572 | can be found in the "contrib/deb/ubuntu-precise" directory of the |
| 573 | TigerVNC subversion trunk. |