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

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