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