You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BUILDING.txt 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. *******************************************************************************
  2. ** Building TigerVNC
  3. *******************************************************************************
  4. ================================
  5. Build Requirements (All Systems)
  6. ================================
  7. -- CMake (http://www.cmake.org) v3.10 or later
  8. -- zlib
  9. -- pixman
  10. -- FLTK 1.3.3 or later
  11. -- If building TLS support:
  12. * GnuTLS 3.x
  13. * See "Building TLS Support" below.
  14. -- If building RSA-AES support:
  15. * Nettle 3.0 or later
  16. -- If building native language support (NLS):
  17. * Gnu gettext 0.14.4 or later
  18. * See "Building Native Language Support" below.
  19. -- libjpeg-turbo
  20. * "Normal" libjpegv6 is also supported, although it is not
  21. recommended as it is much slower.
  22. =========================
  23. Build Requirements (Unix)
  24. =========================
  25. -- Non-Mac platforms:
  26. * X11 development kit
  27. * PAM
  28. -- If building Xvnc/libvnc.so:
  29. * Xorg server source code, 1.16 or later
  30. * All build requirements Xorg imposes (see its documentation)
  31. -- Optional ffmpeg support (libav)
  32. ============================
  33. Build Requirements (Windows)
  34. ============================
  35. -- MinGW or MinGW-w64
  36. -- Inno Setup (needed to build the TigerVNC installer)
  37. Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
  38. You also need the Inno Setup Preprocessor, which is available in the
  39. Inno Setup QuickStart Pack.
  40. Add the directory containing iscc.exe (for instance,
  41. C:\Program Files\Inno Setup 5) to the system or user PATH environment
  42. variable prior to building TigerVNC.
  43. =========================
  44. Build Requirements (Java)
  45. =========================
  46. -- Sun/Oracle JDK 1.7 or later or OpenJDK 7 or later
  47. -- See "Building Java Support" below.
  48. ==================
  49. Out-of-Tree Builds
  50. ==================
  51. Binary objects, libraries, and executables are generated in the same directory
  52. from which cmake was executed (the "binary directory"), and this directory need
  53. not necessarily be the same as the TigerVNC source directory. You can create
  54. multiple independent binary directories, in which different versions of
  55. TigerVNC can be built from the same source tree using different compilers or
  56. settings. In the sections below, {build_directory} refers to the binary
  57. directory, whereas {source_directory} refers to the TigerVNC source directory.
  58. For in-tree builds, these directories are the same.
  59. =================
  60. Building TigerVNC
  61. =================
  62. Building the TigerVNC Viewer on Unix/Mac Systems
  63. ------------------------------------------------
  64. The following procedure will build the TigerVNC Viewer on Linux and Unix
  65. systems.
  66. cd {build_directory}
  67. cmake -G "Unix Makefiles" [additional CMake flags] {source_directory}
  68. make
  69. Building the TigerVNC Server on Unix/Linux Systems
  70. --------------------------------------------------
  71. Building the TigerVNC Server (Xvnc) is a bit trickier. Xvnc is typically built
  72. to use the X11 shared libraries provided with the system. The procedure for
  73. this is system-specific, since it requires specifying such things as font
  74. directories, but the general outline is as follows (this procedure assumes
  75. that the viewer has already been built, per above.)
  76. > cd {build_directory}
  77. If performing an out-of-tree build:
  78. > mkdir unix
  79. > cp -R {source_directory}/unix/xserver unix/
  80. > cp -R {xorg_source}/* unix/xserver/
  81. (NOTE: {xorg_source} is the directory containing the Xorg source for the
  82. machine on which you are building TigerVNC. The most recent versions of
  83. Red Hat/CentOS/Fedora, for instance, provide an RPM called
  84. "xorg-x11-server-source", which installs the Xorg source under
  85. /usr/share/xorg-x11-server-source.)
  86. > cd unix/xserver/
  87. > patch -p1 < {source_directory}/unix/xserver{version}.patch
  88. (where {version} matches the X server version you are building, such as
  89. "120" for version 1.20.x.)
  90. > autoreconf -fiv
  91. > ./configure --with-pic --without-dtrace --disable-static --disable-dri \
  92. --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
  93. --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
  94. --disable-config-dbus --disable-config-hal --disable-config-udev \
  95. --disable-dri2 --enable-install-libxf86config --enable-glx \
  96. --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
  97. --with-fontdir=/usr/share/X11/fonts \
  98. --with-xkb-path=/usr/share/X11/xkb \
  99. --with-xkb-output=/var/lib/xkb \
  100. --with-xkb-bin-directory=/usr/bin \
  101. --with-serverconfig-path=/usr/lib[64]/xorg \
  102. --with-dri-driver-path=/usr/lib[64]/dri \
  103. {additional configure options}
  104. (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
  105. 6 and recent Fedora releases. You should customize it for your particular
  106. system. In particular, it will be necessary to customize the font, XKB,
  107. and DRI directories.)
  108. For a regular, in-tree build:
  109. > make TIGERVNC_SRCDIR={source_directory}
  110. If performing an out-of-tree build:
  111. > make TIGERVNC_SRCDIR={source_directory} TIGERVNC_BUILDDIR={build_directory}
  112. (NOTE: Use absolute paths for source_directory and build_directory)
  113. Building the Windows TigerVNC Viewer with MinGW
  114. -----------------------------------------------
  115. If building the Windows version of TigerVNC on a Windows build system, use
  116. the following procedure.
  117. cd {build_directory}
  118. cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory}
  119. make
  120. If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section
  121. below.
  122. Debug Build
  123. -----------
  124. Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line.
  125. Portable (semi-static) Build
  126. ----------------------------
  127. TigerVNC can under favourble circumstances be built in a way that allows
  128. the resulting binaries to run on any system without having to also install
  129. all the dynamic libraries it depends on. Enable this mode by adding:
  130. -DBUILD_STATIC=1
  131. to the CMake command line.
  132. Note that the method used to achieve this is very fragile and it may be
  133. necessary to tweak cmake/StaticBuild.cmake to make things work on your
  134. specific system.
  135. =====================
  136. Building Java Support
  137. =====================
  138. TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on
  139. any platform that has a Java Runtime Environment (JRE) installed. The Java
  140. viewer works similarly to the native viewer, but with lower performance.
  141. To build the Java TigerVNC Viewer, add
  142. -DBUILD_JAVA=1
  143. to the CMake or build-xorg command line. The build system will attempt to find
  144. an installed Java Development Kit (JDK) and determine the appropriate paths for
  145. the Java compiler (javac) and the JAR creation utility (jar). You can override
  146. these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake
  147. variables. You can also override the default flags that are passed to javac
  148. by setting the JAVACFLAGS CMake variable. The build system will look for
  149. keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These
  150. tools are needed to sign the JAR file, which is necessary to enable certain
  151. functionality (such as clipboard transfers) when the Java viewer is used as an
  152. applet.
  153. If the Java viewer is built along with the Windows TigerVNC Server (WinVNC),
  154. then the build system will embed the Java viewer into WinVNC4.exe so that it
  155. will automatically be served up using WinVNC's built-in HTTP server.
  156. Similarly, if the Java viewer is built along with the Unix TigerVNC Server
  157. (Xvnc), then the build system will include the Java viewer in the server
  158. tarball.
  159. By default, a self-signed certificate will be generated and used to sign the
  160. jar file. By specifying the following command line arguments to the CMake
  161. command line, an alternate certificate may be used for signing.
  162. -DJAVA_KEYSTORE=${keystore_location_or_url}
  163. -DJAVA_KEYSTORE_TYPE=${keystore_type} (Default: "jks")
  164. -DJAVA_KEY_ALIAS=${keytore_key_alias}
  165. -DJAVA_STOREPASS=${keystore_password}
  166. -DJAVA_KEYPASS=${keystore_entry_password}
  167. -DJAVA_TSA_URL=${url_of_timestamping_authority}
  168. The values of the JAVA_STOREPASS and JAVA_KEYPASS arguments may optionally be
  169. read from file or environment variables by prefixing the value with ":env "
  170. or ":file " (see the jarsigner documentation for more info):
  171. export StorePass=tigervnc
  172. export KeyPass=tigervnc
  173. cmake \
  174. ...
  175. -DJAVA_STOREPASS=":env StorePass"
  176. -DJAVA_KEYPASS=":env KeyPass"
  177. ======================================
  178. Building TLS Support
  179. ======================================
  180. TLS requires GnuTLS, which is supplied with most Linux distributions and
  181. with MinGW for Windows and can be built from source on OS X and other
  182. Unix variants. However, GnuTLS versions > 2.12.x && < 3.3.x should be
  183. avoided because of potential incompatibilities during initial handshaking.
  184. You can override the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR CMake variables
  185. to specify the locations of libgnutls and any dependencies. For instance,
  186. adding
  187. -DGNUTLS_INCLUDE_DIR=/usr/local/include \
  188. -DGNUTLS_LIBRARY=/usr/local/lib/libgnutls.a
  189. to the CMake command line would link TigerVNC against a static version of
  190. libgnutls located under /usr/local.
  191. ======================================
  192. Building Native Language Support (NLS)
  193. ======================================
  194. NLS requires gettext, which is supplied with most Linux distributions and
  195. with MinGW for Windows and which can easily be built from source on OS X and
  196. other Unix variants.
  197. You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
  198. specify the locations of libiconv and libintl, respectively. For instance,
  199. adding
  200. -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
  201. to the CMake command line would link TigerVNC against a static version of
  202. libintl located under /opt/gettext. Adding
  203. -DICONV_INCLUDE_DIR=/mingw/include \
  204. -DICONV_LIBRARIES=/mingw/lib/libiconv.a \
  205. -DGETTEXT_INCLUDE_DIR=/mingw/include \
  206. -DLIBINTL_LIBRARY=/mingw/lib/libintl.a
  207. to the CMake command line would link TigerVNC against the static versions of
  208. libiconv and libintl included in the MinGW Developer Toolkit.
  209. ===================
  210. Installing TigerVNC
  211. ===================
  212. You can use the build system to install TigerVNC into a directory of your
  213. choosing. To do this, add:
  214. -DCMAKE_INSTALL_PREFIX={install_directory}
  215. to the CMake command line. Then, you can run 'make install' to build and
  216. install it.
  217. If you don't specify CMAKE_INSTALL_PREFIX, then the default is
  218. c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
  219. =========================
  220. Creating Release Packages
  221. =========================
  222. The following commands can be used to create various types of release packages:
  223. Unix
  224. ----
  225. make tarball
  226. Create a binary tarball containing the TigerVNC Viewer
  227. make servertarball
  228. Create a binary tarball containing both the TigerVNC Server and Viewer
  229. make dmg
  230. Create Macintosh disk image file that contains an application bundle of the
  231. TigerVNC Viewer
  232. Windows
  233. -------
  234. make installer
  235. Create a Windows installer using Inno Setup. The installer package
  236. (TigerVNC[64].exe) will be located under {build_directory}.
  237. =============
  238. Build Recipes
  239. =============
  240. MinGW Build on Cygwin
  241. ---------------------
  242. cd {build_directory}
  243. CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
  244. RC=/usr/bin/x86_64-w64-mingw32-windres \
  245. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  246. -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
  247. -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
  248. make
  249. This produces a build of TigerVNC that does not depend on cygwin1.dll or
  250. other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
  251. packages (and their dependencies) must be installed.
  252. MinGW-w64 Build on Windows
  253. --------------------------
  254. This produces a build of TigerVNC using the "native" MinGW-w64 toolchain
  255. (which is faster than the Cygwin version):
  256. cd {build_directory}
  257. CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
  258. CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
  259. RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
  260. cmake -G "MSYS Makefiles" \
  261. -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
  262. -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
  263. {source_directory}
  264. make
  265. MinGW Build on Linux
  266. --------------------
  267. cd {build_directory}
  268. CC={mingw_binary_path}/x86_64-w64-mingw32-gcc \
  269. CXX={mingw_binary_path}/x86_64-w64-mingw32-g++ \
  270. RC={mingw_binary_path}/x86_64-w64-mingw32-windres \
  271. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  272. -DCMAKE_AR={mingw_binary_path}/x86_64-w64-mingw32-ar \
  273. -DCMAKE_RANLIB={mingw_binary_path}/x86_64-w64-mingw32-ranlib \
  274. {source_directory}
  275. make
  276. ===============================
  277. Distribution-Specific Packaging
  278. ===============================
  279. Configuration for building packages for current versions of RHEL/CentOS
  280. and Ubuntu LTS can be found under contrib/packages.