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