Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

BUILDING.txt 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. *******************************************************************************
  2. ** Building TigerVNC
  3. *******************************************************************************
  4. ================================
  5. Build Requirements (All Systems)
  6. ================================
  7. -- CMake (http://www.cmake.org) v2.8 or later
  8. -- FLTK 1.3.2
  9. * Must be a patched snapshot to get full functionality
  10. * See "Building FLTK" below.
  11. -- If building TLS support:
  12. * GnuTLS
  13. * See "Building TLS Support" below.
  14. -- If building native language support (NLS):
  15. * Gnu gettext 0.14.4 or later
  16. * See "Building Native Language Support" below.
  17. -- libjpeg-turbo
  18. * "Normal" libjpegv6 is also supported, although it is not
  19. recommended as it is much slower.
  20. =========================
  21. Build Requirements (Unix)
  22. =========================
  23. -- Non-Mac platforms:
  24. * X11 development kit
  25. -- If building Xvnc:
  26. * autoconf 2.57 or later
  27. * automake 1.7 or later
  28. * libtool 1.4 or later
  29. * OpenSSL v0.9.7 or later
  30. * Python v2.3 or later
  31. * zlib v1.2 or later
  32. * pkgconfig 0.20 or later
  33. If you are using an older RPM-based system which does not meet this
  34. minimum requirement (such as Red Hat Enterprise Linux 4), then you can
  35. build pkgconfig 0.20 from the Fedora 5 source RPM:
  36. http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/pkgconfig-0.20-2.2.1.src.rpm
  37. * gettext 0.14.4 or later
  38. If you are using an older RPM-based system which does not meet this
  39. minimum requirement (such as Red Hat Enterprise Linux 4), then you can
  40. build gettext 0.14.5 from the Fedora 5 source RPM:
  41. http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/gettext-0.14.5-3.src.rpm
  42. NOTE: gcj and libgcj are required when building the above source RPM.
  43. ============================
  44. Build Requirements (Windows)
  45. ============================
  46. -- MinGW or MinGW-w64
  47. -- Inno Setup (needed to build the TigerVNC installer)
  48. Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
  49. You also need the Inno Setup Preprocessor, which is available in the
  50. Inno Setup QuickStart Pack.
  51. Add the directory containing iscc.exe (for instance,
  52. C:\Program Files\Inno Setup 5) to the system or user PATH environment
  53. variable prior to building TigerVNC.
  54. =========================
  55. Build Requirements (Java)
  56. =========================
  57. -- Sun/Oracle JDK v5 or later or OpenJDK
  58. -- See "Building Java Support" below.
  59. =============
  60. Building FLTK
  61. =============
  62. TigerVNC requires FLTK 1.3.2 (or later). Although it will build and work
  63. with plain 1.3.2, to get full functionality and the best behaviour you
  64. need to build a patched version:
  65. 1. Check out FLTK 1.3.2 using Subversion:
  66. $ svn co http://svn.easysw.com/public/fltk/fltk/tags/release-1.3.2 fltk-1.3.2
  67. 2. For full functionality, apply patches. All patches can be found in
  68. the contrib/fltk/ directory. There are also some general fixes to
  69. FLTK that can be found in the contrib/fltk/fixes/ directory that
  70. might be useful.
  71. 3. Use CMake to build FLTK using the same procedures described below for
  72. building TigerVNC. The recipes in the "Build Recipes" section also apply.
  73. If you want optimized code, make sure to build with
  74. -DCMAKE_BUILD_TYPE=Release.
  75. 4. (optional) Use 'make install' to install FLTK into a directory of your
  76. choosing.
  77. 5. When building TigerVNC, set the FLTK_FLUID_EXECUTABLE CMake variable to the
  78. location of the fluid executable that was built in Step 3 or installed in
  79. Step 4. This gives CMake a hint as to where to find the FLTK library.
  80. 6. If you did not install FLTK, then set the FLTK_INCLUDE_DIR CMake variable to
  81. the location of the FLTK source directory.
  82. ==================
  83. Out-of-Tree Builds
  84. ==================
  85. Binary objects, libraries, and executables are generated in the same directory
  86. from which cmake was executed (the "binary directory"), and this directory need
  87. not necessarily be the same as the TigerVNC source directory. You can create
  88. multiple independent binary directories, in which different versions of
  89. TigerVNC can be built from the same source tree using different compilers or
  90. settings. In the sections below, {build_directory} refers to the binary
  91. directory, whereas {source_directory} refers to the TigerVNC source directory.
  92. For in-tree builds, these directories are the same.
  93. =================
  94. Building TigerVNC
  95. =================
  96. Building the TigerVNC Viewer on Unix/Mac Systems
  97. ------------------------------------------------
  98. The following procedure will build the TigerVNC Viewer on Linux and Unix
  99. systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See
  100. "Build Recipes" for specific build instructions for building a 32-bit version
  101. of TigerVNC on 64-bit systems.
  102. cd {build_directory}
  103. cmake -G "Unix Makefiles" [additional CMake flags] {source_directory}
  104. make
  105. Building the TigerVNC Server on Modern Unix/Linux Systems
  106. ---------------------------------------------------------
  107. Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems
  108. containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use
  109. the X11 shared libraries provided with the system. The procedure for this is
  110. system-specific, since it requires specifying such things as font directories,
  111. but the general outline is as follows (this procedure assumes that the viewer
  112. has already been built, per above.)
  113. > cd {build_directory}
  114. If performing an out-of-tree build:
  115. > mkdir unix
  116. > cp -R {source_directory}/unix/xserver unix/
  117. > cp -R {xorg_source}/* unix/xserver/
  118. (NOTE: {xorg_source} is the directory containing the Xorg source for the
  119. machine on which you are building TigerVNC. The most recent versions of
  120. Red Hat/CentOS/Fedora, for instance, provide an RPM called
  121. "xorg-x11-server-source", which installs the Xorg source under
  122. /usr/share/xorg-x11-server-source.)
  123. > cd unix/xserver/
  124. > patch -p1 < {source_directory}/unix/xserver{version}.patch
  125. (where {version} matches the X server version you are building, such as
  126. "17" for version 1.7.x.)
  127. > autoreconf -fiv
  128. > ./configure --with-pic --without-dtrace --disable-static --disable-dri \
  129. --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
  130. --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
  131. --disable-config-dbus --disable-config-hal --disable-config-udev \
  132. --disable-dri2 --enable-install-libxf86config --enable-glx \
  133. --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
  134. --with-fontdir=/usr/share/X11/fonts \
  135. --with-xkb-path=/usr/share/X11/xkb \
  136. --with-xkb-output=/var/lib/xkb \
  137. --with-xkb-bin-directory=/usr/bin \
  138. --with-serverconfig-path=/usr/lib[64]/xorg \
  139. --with-dri-driver-path=/usr/lib[64]/dri \
  140. {additional configure options}
  141. (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
  142. 6 and recent Fedora releases. You should customize it for your particular
  143. system. In particular, it will be necessary to customize the font, XKB,
  144. and DRI directories.)
  145. > make TIGERVNC_SRCDIR={source_directory}
  146. Building the TigerVNC Server on Legacy Unix/Linux Systems
  147. ---------------------------------------------------------
  148. Those using systems with older versions of Xorg must build a "legacy-friendly"
  149. version of the TigerVNC Server. This is accomplished by downloading and
  150. building the more recent Xorg modules in a local directory and then building
  151. Xvnc such that it links against the local build of these libraries, not the X11
  152. libraries installed on the system. The "build-xorg" script in the TigerVNC
  153. source distribution (located under unix/) automates this process.
  154. The following procedure will build both the TigerVNC Viewer and a
  155. "legacy-friendly" version of the TigerVNC Server:
  156. cd {build_directory}
  157. sh {source_directory}/unix/build-xorg init
  158. sh {source_directory}/unix/build-xorg build [additional CMake flags]
  159. build-xorg generates a version of Xvnc that has no external dependencies on the
  160. X11 shared libraries or any other distribution-specific shared libraries. This
  161. version of Xvnc should be transportable across multiple O/S distributions.
  162. build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later
  163. systems. It probably will not work on older systems. It has not been tested
  164. on non-Linux systems (yet).
  165. build-xorg can also be used to rebuild just the TigerVNC Server and Viewer,
  166. once the X11 modules and other dependencies have been built for the first time.
  167. This is convenient for testing changes that just apply to the TigerVNC source
  168. code. To accomplish this, run:
  169. sh {source_directory}/unix/build-xorg rebuild [additional make flags]
  170. For instance,
  171. sh {source_directory}/unix/build-xorg rebuild clean
  172. will clean both the Xvnc and vncviewer builds without destroying any of the
  173. build configuration or module dependencies.
  174. Building the Windows TigerVNC Viewer with MinGW
  175. -----------------------------------------------
  176. If building the Windows version of TigerVNC on a Windows build system, use
  177. the following procedure.
  178. cd {build_directory}
  179. cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory}
  180. make
  181. If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section
  182. below.
  183. Debug Build
  184. -----------
  185. Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line.
  186. Portable (semi-static) Build
  187. ----------------------------
  188. TigerVNC can under favourble circumstances be built in a way that allows
  189. the resulting binaries to run on any system without having to also install
  190. all the dynamic libraries it depends on. Enable this mode by adding:
  191. -DBUILD_STATIC=1
  192. to the CMake command line.
  193. Note that the method used to achieve this is very fragile and it may be
  194. necessary to tweak cmake/StaticBuild.cmake to make things work on your
  195. specific system.
  196. =====================
  197. Building Java Support
  198. =====================
  199. TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on
  200. any platform that has a Java Runtime Environment (JRE) installed. The Java
  201. viewer works similarly to the native viewer, but with lower performance.
  202. To build the Java TigerVNC Viewer, add
  203. -DBUILD_JAVA=1
  204. to the CMake or build-xorg command line. The build system will attempt to find
  205. an installed Java Development Kit (JDK) and determine the appropriate paths for
  206. the Java compiler (javac) and the JAR creation utility (jar). You can override
  207. these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake
  208. variables. You can also override the default flags that are passed to javac
  209. by setting the JAVACFLAGS CMake variable. The build system will look for
  210. keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These
  211. tools are needed to sign the JAR file, which is necessary to enable certain
  212. functionality (such as clipboard transfers) when the Java viewer is used as an
  213. applet.
  214. If the Java viewer is built along with the Windows TigerVNC Server (WinVNC),
  215. then the build system will embed the Java viewer into WinVNC4.exe so that it
  216. will automatically be served up using WinVNC's built-in HTTP server.
  217. Similarly, if the Java viewer is built along with the Unix TigerVNC Server
  218. (Xvnc), then the build system will include the Java viewer in the server
  219. tarball.
  220. By default, a self-signed certificate will be generated and used to sign the
  221. jar file. By specifying the following command line arguments to the CMake
  222. command line, an alternate certificate may be used for signing.
  223. -DJAVA_KEYSTORE=${keystore_location_or_url}
  224. -DJAVA_KEYSTORE_TYPE=${keystore_type} (Default: "jks")
  225. -DJAVA_KEY_ALIAS=${keytore_key_alias}
  226. -DJAVA_STOREPASS=${keystore_password}
  227. -DJAVA_KEYPASS=${keystore_entry_password}
  228. -DJAVA_TSA_URL=${url_of_timestamping_authority}
  229. The values of the JAVA_STOREPASS and JAVA_KEYPASS arguments may optionally be
  230. read from file or environment variables by prefixing the value with ":env "
  231. or ":file " (see the jarsigner documentation for more info):
  232. export StorePass=tigervnc
  233. export KeyPass=tigervnc
  234. cmake \
  235. ...
  236. -DJAVA_STOREPASS=":env StorePass"
  237. -DJAVA_KEYPASS=":env KeyPass"
  238. ======================================
  239. Building TLS Support
  240. ======================================
  241. TLS requires GnuTLS, which is supplied with most Linux distributions and
  242. with MinGW for Windows and can be built from source on OS X and other
  243. Unix variants. However, GnuTLS versions > 2.12.x && < 3.3.x should be
  244. avoided because of potential incompatibilities during initial handshaking.
  245. You can override the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR CMake variables
  246. to specify the locations of libgnutls and any dependencies. For instance,
  247. adding
  248. -DGNUTLS_INCLUDE_DIR=/usr/local/include \
  249. -DGNUTLS_LIBRARY=/usr/local/lib/libgnutls.a
  250. to the CMake command line would link TigerVNC against a static version of
  251. libgnutls located under /usr/local.
  252. ======================================
  253. Building Native Language Support (NLS)
  254. ======================================
  255. NLS requires gettext, which is supplied with most Linux distributions and
  256. with MinGW for Windows and which can easily be built from source on OS X and
  257. other Unix variants.
  258. You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
  259. specify the locations of libiconv and libintl, respectively. For instance,
  260. adding
  261. -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
  262. to the CMake command line would link TigerVNC against a static version of
  263. libintl located under /opt/gettext. Adding
  264. -DICONV_INCLUDE_DIR=/mingw/include \
  265. -DICONV_LIBRARIES=/mingw/lib/libiconv.a \
  266. -DGETTEXT_INCLUDE_DIR=/mingw/include \
  267. -DLIBINTL_LIBRARY=/mingw/lib/libintl.a
  268. to the CMake command line would link TigerVNC against the static versions of
  269. libiconv and libintl included in the MinGW Developer Toolkit.
  270. ===================
  271. Installing TigerVNC
  272. ===================
  273. You can use the build system to install TigerVNC into a directory of your
  274. choosing. To do this, add:
  275. -DCMAKE_INSTALL_PREFIX={install_directory}
  276. to the CMake command line. Then, you can run 'make install' to build and
  277. install it.
  278. If you don't specify CMAKE_INSTALL_PREFIX, then the default is
  279. c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
  280. =========================
  281. Creating Release Packages
  282. =========================
  283. The following commands can be used to create various types of release packages:
  284. Unix
  285. ----
  286. make tarball
  287. Create a binary tarball containing the TigerVNC Viewer
  288. make servertarball
  289. Create a binary tarball containing both the TigerVNC Server and Viewer
  290. make dmg
  291. Create Macintosh disk image file that contains an application bundle of the
  292. TigerVNC Viewer
  293. make udmg
  294. On 64-bit OS X systems, this creates a version of the Macintosh package and
  295. disk image which contains universal i386/x86-64 binaries. You should first
  296. configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
  297. out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
  298. build system will look for the 32-bit build under {source_directory}/osxx86
  299. by default, but you can override this by setting the OSX_X86_BUILD CMake
  300. variable to the directory containing your configured 32-bit build. Either
  301. the 64-bit or 32-bit build can be configured to be backward compatible by
  302. using the instructions in the "Build Recipes" section.
  303. Windows
  304. -------
  305. make installer
  306. Create a Windows installer using Inno Setup. The installer package
  307. (TigerVNC[64].exe) will be located under {build_directory}.
  308. =============
  309. Build Recipes
  310. =============
  311. 32-bit Build on 64-bit Linux/Unix (including OS X)
  312. --------------------------------------------------
  313. Set the following environment variables before building TigerVNC.
  314. CFLAGS='-O3 -m32'
  315. CXXFLAGS='-O3 -m32'
  316. LDFLAGS=-m32
  317. If you are building the TigerVNC Server on a modern Unix/Linux system, then
  318. you will also need to pass the appropriate --host argument when configuring the
  319. X server source (for instance, --host=i686-pc-linux-gnu).
  320. 64-bit Backward-Compatible Build on 64-bit OS X
  321. -----------------------------------------------
  322. Add
  323. -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \
  324. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
  325. to the CMake command line. The OS X 10.5 SDK must be installed.
  326. 32-bit Backward-Compatible Build on 64-bit OS X
  327. -----------------------------------------------
  328. Set the following environment variables:
  329. CC=gcc-4.0
  330. CXX=g++-4.0
  331. CFLAGS='-O3 -m32'
  332. CXXFLAGS='-O3 -m32'
  333. LDFLAGS=-m32
  334. and add
  335. -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \
  336. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
  337. to the CMake command line. The OS X 10.4 SDK must be installed.
  338. 64-bit MinGW Build on Cygwin
  339. ----------------------------
  340. cd {build_directory}
  341. CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
  342. RC=/usr/bin/x86_64-w64-mingw32-windres \
  343. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  344. -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
  345. -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
  346. make
  347. This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
  348. other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
  349. packages (and their dependencies) must be installed.
  350. 32-bit MinGW Build on Cygwin
  351. ----------------------------
  352. cd {build_directory}
  353. CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
  354. RC=/usr/bin/i686-w64-mingw32-windres \
  355. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  356. -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
  357. -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
  358. make
  359. This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
  360. other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
  361. packages (and their dependencies) must be installed.
  362. MinGW-w64 Build on Windows
  363. --------------------------
  364. This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
  365. (which is faster than the Cygwin version):
  366. cd {build_directory}
  367. CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
  368. CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
  369. RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
  370. cmake -G "MSYS Makefiles" \
  371. -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
  372. -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
  373. {source_directory}
  374. make
  375. MinGW Build on Linux
  376. --------------------
  377. cd {build_directory}
  378. CC={mingw_binary_path}/i386-mingw32-gcc \
  379. CXX={mingw_binary_path}/i386-mingw32-g++ \
  380. RC={mingw_binary_path}/i386-mingw32-windres \
  381. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  382. -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
  383. -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
  384. {source_directory}
  385. make
  386. ===============================
  387. Distribution-Specific Packaging
  388. ===============================
  389. RPM Packages for RHEL / CentOS
  390. ------------------------------
  391. The RPM spec files and patches used to create the nightly builds
  392. and releases can be found in the "contrib/rpm/el{5,6}" directories
  393. of the TigerVNC subversion trunk. All external source tarballs
  394. must be fetched manually and placed into the 'SOURCES' directory
  395. under the rpmbuild root. Additonally, the following macros need
  396. to be defined:
  397. EL6:
  398. %debug_package %{nil}
  399. EL5:
  400. %dist .el5
  401. %_smp_mflags -j3
  402. %debug_package %{nil}
  403. %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
  404. Debian packages for Ubuntu 12.04LTS
  405. -----------------------------------
  406. The debian folder used to create the nightly builds and releases
  407. can be found in the "contrib/deb/ubuntu-precise" directory of the
  408. TigerVNC subversion trunk.