Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

BUILDING.txt 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. *******************************************************************************
  2. ** Building on Unix Platforms (including Cygwin)
  3. *******************************************************************************
  4. ==================
  5. Build Requirements
  6. ==================
  7. -- X11 development kit
  8. -- If building TLS support:
  9. * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
  10. -- If building Xvnc:
  11. * Python v2.3 or later
  12. * zlib v1.2 or later
  13. * OpenSSL v0.9.7 or later
  14. * pkgconfig 0.20 or later
  15. If you are using an older RPM-based system which does not meet this
  16. minimum requirement (such as Red Hat Enterprise Linux 4), then you can
  17. build pkgconfig 0.20 from the Fedora 5 source RPM:
  18. http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/pkgconfig-0.20-2.2.1.src.rpm
  19. -- If building Xvnc or building TigerVNC from the subversion repository:
  20. * autoconf 2.57 or later
  21. * automake 1.7 or later
  22. * libtool 1.4 or later
  23. * gettext 0.14.4 or later
  24. If you are using an older RPM-based system which does not meet this
  25. minimum requirement (such as Red Hat Enterprise Linux 4), then you can
  26. build gettext 0.14.5 from the Fedora 5 source RPM:
  27. http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/gettext-0.14.5-3.src.rpm
  28. NOTE: gcj and libgcj are required when building the above source RPM.
  29. ==================
  30. Out-of-Tree Builds
  31. ==================
  32. Binary objects, libraries, and executables are generated in the same directory
  33. from which configure was executed (the "binary directory"), and this directory
  34. need not necessarily be the same as the TigerVNC source directory. You can
  35. create multiple independent binary directories, in which different versions of
  36. TigerVNC can be built from the same source tree using different compilers or
  37. settings. In the sections below, {build_directory} refers to the binary
  38. directory, whereas {source_directory} refers to the TigerVNC source directory.
  39. For in-tree builds, these directories are the same.
  40. =================
  41. Building TigerVNC
  42. =================
  43. The following procedure will build the TigerVNC Viewer on Linux and Unix
  44. systems. On 64-bit systems, this may build a 32-bit version of TigerVNC,
  45. depending on the default autotools configuration for your system. See below
  46. for specific build instructions for 64-bit systems.
  47. cd {source_directory}
  48. autoreconf -fiv
  49. cd {build_directory}
  50. sh {source_directory}/configure [additional configure flags]
  51. make
  52. NOTE: Running autoreconf in the source directory is only necessary if building
  53. TigerVNC from the SVN repository.
  54. Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems, such
  55. as Fedora, Xvnc is typically built to use the X11 shared libraries provided
  56. with the system. This requires a system with Xorg 7.4 or later, however.
  57. Systems with older versions of Xorg must build a "legacy-friendly" version of
  58. the TigerVNC Server. This is accomplished by downloading and building the
  59. more recent Xorg modules in a local directory and then building Xvnc such that
  60. it links against the local build of these libraries, not the X11 libraries
  61. installed on the system. The "build-xorg" script in the TigerVNC source
  62. distribution (located under unix/) automates this process.
  63. The following procedure will build both the TigerVNC Viewer and a
  64. "legacy-friendly" version of the TigerVNC Server:
  65. cd {build_directory}
  66. sh {source_directory}/unix/build-xorg init -version 7.4
  67. sh {source_directory}/unix/build-xorg build -version 7.4 [-static] [additional configure flags]
  68. Passing an argument of "-static" to the build command line will generate a
  69. version of Xvnc that has no external dependencies on the X11 shared libraries
  70. or any other distribution-specific shared libraries. This version of Xvnc
  71. should be transportable across multiple O/S distributions. The legacy-friendly
  72. build should work on Red Hat Enterprise 4, its contemporaries, and later
  73. systems. It probably will not work on older systems. It has not been tested
  74. on non-Linux systems (yet).
  75. build-xorg can also be used to rebuild just the TigerVNC Server and Viewer,
  76. once the X11 modules and other dependencies have been built the first time.
  77. This is convenient for testing changes that just apply to the TigerVNC source
  78. code. To accomplish this, run:
  79. sh {source_directory}/unix/build-xorg rebuild [additional make flags]
  80. For instance,
  81. sh {source_directory}/unix/build-xorg rebuild clean
  82. will clean both the Xvnc and vncviewer builds without destroying any of the
  83. build configuration or module dependencies.
  84. ====================
  85. Building TLS support
  86. ====================
  87. VeNCrypt (the TigerVNC security and authentication extensions) can be built
  88. with TLS support, which provides built-in encryption for VNC sessions. This
  89. requires GnuTLS, which is not pre-installed on all platforms. In general, if
  90. you are building on a Unix-ish platform that has the GnuTLS libraries and
  91. include files installed in the standard system locations, then the TigerVNC
  92. build system should detect the system version of GnuTLS automatically and link
  93. against it. However, this produces a version of TigerVNC that depends on the
  94. GnuTLS dynamic libraries, and thus the TigerVNC binaries are not portable.
  95. To build a fully portable, cross-compatible version of TigerVNC with VeNCrypt
  96. support, it is necessary to link against the GnuTLS static library (as well
  97. as the static libraries of its dependencies.) If you are lucky enough, your
  98. O/S distribution may include pre-packaged versions of these static libraries.
  99. Otherwise, it will probably be necessary to build GnuTLS, libgcrypt, libtasn1,
  100. and libgpg-error from source.
  101. You can manipulate the GNUTLS_CFLAGS and GNUTLS_LDFLAGS configure variables to
  102. accommodate a custom build of GnuTLS that is installed in a non-system
  103. directory. For instance, adding
  104. GNUTLS_CFLAGS=-I/opt/gnutls/include \
  105. GNUTLS_LDFLAGS='/opt/gnutls/lib/libgnutls.a /opt/gnutls/lib/libgcrypt.a \
  106. /opt/gnutls/lib/libgpg-error.a /opt/gnutls/lib/libtasn1.a' \
  107. --with-included-zlib
  108. to the configure or 'build-xorg build' command line will cause TigerVNC to be
  109. statically linked against a custom installation of GnuTLS that resides under
  110. /opt/gnutls. GnuTLS depends on zlib, so specifying --with-included-zlib will
  111. satisfy that dependency using TigerVNC's in-tree version of zlib, which
  112. prevents TigerVNC from depending on the libz dynamic library.
  113. ==================
  114. Unix Build Recipes
  115. ==================
  116. 32-bit Build on 64-bit Linux
  117. ----------------------------
  118. Add
  119. --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
  120. to the configure or build command lines.
  121. 64-bit Build on 64-bit OS X
  122. ---------------------------
  123. Add
  124. --host x86_64-apple-darwin
  125. to the configure command line.
  126. 32-bit Build on 64-bit OS X
  127. ---------------------------
  128. Add
  129. CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
  130. to the configure command line.
  131. 64-bit Backward-Compatible Build on 64-bit OS X
  132. -----------------------------------------------
  133. Add
  134. --host x86_64-apple-darwin \
  135. CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
  136. -mmacosx-version-min=10.5 -O3' \
  137. CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
  138. -mmacosx-version-min=10.5 -O3' \
  139. LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
  140. -mmacosx-version-min=10.5'
  141. to the configure command line. The OS X 10.5 SDK must be installed.
  142. 32-bit Backward-Compatible Build on 64-bit OS X
  143. -----------------------------------------------
  144. Add
  145. CC=gcc-4.0 CXX=g++-4.0 CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
  146. -mmacosx-version-min=10.4 -O3 -m32' \
  147. CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
  148. -mmacosx-version-min=10.4 -O3 -m32' \
  149. LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
  150. -mmacosx-version-min=10.4 -m32'
  151. to the configure command line. The OS X 10.4 SDK must be installed.
  152. *******************************************************************************
  153. ** Building on Windows (Visual C++ or MinGW)
  154. *******************************************************************************
  155. ==================
  156. Build Requirements
  157. ==================
  158. -- CMake (http://www.cmake.org) v2.6 or later
  159. -- Microsoft Visual C++ 2005 or later
  160. If you don't already have Visual C++, then the easiest way to get it is by
  161. installing the Windows SDK:
  162. http://msdn.microsoft.com/en-us/windows/bb980924.aspx
  163. The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
  164. everything necessary to build TigerVNC.
  165. * For 32-bit builds, you can also use Microsoft Visual C++ Express
  166. Edition. Visual C++ Express Edition is a free download.
  167. * If you intend to build TigerVNC from the command line, then add the
  168. appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
  169. environment variables. This is generally accomplished by executing
  170. vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
  171. vcvars64.bat are part of Visual C++ and are located in the same directory
  172. as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
  173. optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
  174. environment.
  175. ... OR ...
  176. -- MinGW
  177. -- Inno Setup (needed to build the TigerVNC installer)
  178. Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
  179. You also need the Inno Setup Preprocessor, which is available in the
  180. Inno Setup QuickStart Pack.
  181. Add the directory containing iscc.exe (for instance,
  182. C:\Program Files\Inno Setup 5) to the system or user PATH environment
  183. variable prior to building TigerVNC.
  184. -- If building TLS support:
  185. * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
  186. ==================
  187. Out-of-Tree Builds
  188. ==================
  189. Binary objects, libraries, and executables are generated in the same directory
  190. from which cmake was executed (the "binary directory"), and this directory need
  191. not necessarily be the same as the TigerVNC source directory. You can create
  192. multiple independent binary directories, in which different versions of
  193. TigerVNC can be built from the same source tree using different compilers or
  194. settings. In the sections below, {build_directory} refers to the binary
  195. directory, whereas {source_directory} refers to the TigerVNC source directory.
  196. For in-tree builds, these directories are the same.
  197. =================
  198. Building TigerVNC
  199. =================
  200. Visual C++ (Command Line)
  201. -------------------------
  202. cd {build_directory}
  203. cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
  204. nmake
  205. This will build either a 32-bit or a 64-bit version of TigerVNC, depending
  206. on which version of cl.exe is in the PATH.
  207. Visual C++ (IDE)
  208. ----------------
  209. Choose the appropriate CMake generator option for your version of Visual Studio
  210. (run "cmake" with no arguments for a list of available generators.) For
  211. instance:
  212. cd {build_directory}
  213. cmake -G "Visual Studio 9 2008" {source_directory}
  214. You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
  215. configurations in that project ("Debug", "Release", etc.) to generate a full
  216. build of TigerVNC.
  217. MinGW
  218. -----
  219. cd {build_directory}
  220. cmake -G "MSYS Makefiles" {source_directory}
  221. make
  222. This will generate only vncviewer. Currently, Visual C++ must be used to build
  223. WinVNC.
  224. Debug Build
  225. -----------
  226. Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line. Or, if building with
  227. NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
  228. NMake.)
  229. Self-Contained MinGW Build
  230. --------------------------
  231. If TigerVNC is built using MinGW, then it may depend on the MinGW libgcc DLL.
  232. To eliminate this dependency, add
  233. -DCMAKE_C_FLAGS=-static-libgcc -DCMAKE_CXX_FLAGS=-static-libgcc
  234. to the CMake command line.
  235. ====================
  236. Building TLS support
  237. ====================
  238. VeNCrypt (the TigerVNC security and authentication extensions) can be built
  239. with TLS support, which provides built-in encryption for VNC sessions. This
  240. requires GnuTLS, which is not Microsoft-friendly. This section describes the
  241. issues associated with building a Windows version of TigerVNC with TLS support
  242. and how to work around those issues.
  243. Building with MinGW
  244. -------------------
  245. An installer containing the GnuTLS header files, as well as static and dynamic
  246. link libraries for 32-bit MinGW, can be downloaded from the following site:
  247. http://josefsson.org/gnutls4win/
  248. As of this writing, GnuTLS cannot be built cleanly with MinGW64 due to the fact
  249. that portions of the code assume an LP64 data model (Windows uses LLP64.)
  250. Thus, it is not possible at this time to produce a Win64 version of TigerVNC
  251. with TLS support.
  252. Whether you use the above installer or build GnuTLS from source, make sure that
  253. you install the libraries and headers into a pathname that doesn't contain
  254. spaces (the installer will try to install under c:\Program Files unless you
  255. tell it otherwise.) If the GnuTLS include path contains spaces, then the MinGW
  256. resource compiler will barf when you try to build TigerVNC.
  257. You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
  258. specify the directory under which you installed GnuTLS. For instance, adding
  259. -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
  260. -DGNUTLS_LIBRARY=/c/gnutls/lib/libgnutls.dll.a
  261. to the CMake command line when using MinGW will cause TigerVNC to be linked
  262. against GnuTLS DLLs that are installed under c:\gnutls.
  263. Adding
  264. -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
  265. -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a'
  266. to the CMake command line will cause TigerVNC to be statically linked against
  267. GnuTLS libraries that are installed under c:\gnutls.
  268. Note that the use of MinGW means that only the TigerVNC viewer can be built,
  269. not the server.
  270. Visual C++
  271. ----------
  272. There is generally no sane way to build GnuTLS and its dependencies using
  273. Visual C++. Thus, it is necessary to either build the libraries with MinGW (or
  274. download 32-bit versions of these from the link above), generate Visual C++
  275. import libraries from the DLLs, then link TigerVNC against the Visual C++
  276. import libraries.
  277. In the instructions below, {gnutls_path} indicates the path under which GnuTLS
  278. is installed (Example: c:\Program Files\GnuTLS-2.10.1).
  279. To generate Visual C++ import libraries:
  280. cd {gnutls_path}\lib
  281. lib /def:..\bin\libgnutls-{version}.def /out:libgnutls.lib
  282. Now, you can add the following arguments to the CMake command line:
  283. -DGNUTLS_INCLUDE_DIR={gnutls_path}\include \
  284. -DGNUTLS_LIBRARY={gnutls_path}\lib\libgnutls.lib
  285. to build TigerVNC against the GnuTLS DLLs installed under {gnutls_path}.
  286. ===================
  287. Installing TigerVNC
  288. ===================
  289. You can use the build system to install TigerVNC into a directory of your
  290. choosing (as opposed to creating an installer.) To do this, add:
  291. -DCMAKE_INSTALL_PREFIX={install_directory}
  292. to the CMake command line.
  293. For example,
  294. cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
  295. -DCMAKE_INSTALL_PREFIX=c:\TigerVNC {source_directory}
  296. nmake install
  297. If you don't specify CMAKE_INSTALL_PREFIX, then the default is
  298. c:\Program Files\TigerVNC.
  299. =====================
  300. Windows Build Recipes
  301. =====================
  302. 64-bit MinGW Build on Cygwin
  303. ----------------------------
  304. cd {build_directory}
  305. CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
  306. RC=/usr/bin/x86_64-w64-mingw32-windres \
  307. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  308. -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
  309. -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
  310. make
  311. This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
  312. other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
  313. packages (and their dependencies) must be installed.
  314. 32-bit MinGW Build on Cygwin
  315. ----------------------------
  316. cd {build_directory}
  317. CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
  318. RC=/usr/bin/i686-w64-mingw32-windres \
  319. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  320. -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
  321. -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
  322. make
  323. This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
  324. other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
  325. packages (and their dependencies) must be installed.
  326. MinGW-w64 Build on Windows
  327. --------------------------
  328. This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
  329. (which is faster than the Cygwin version):
  330. cd {build_directory}
  331. CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
  332. CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
  333. RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
  334. cmake -G "MSYS Makefiles" \
  335. -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
  336. -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
  337. {source_directory}
  338. make
  339. MinGW Build on Linux
  340. --------------------
  341. cd {build_directory}
  342. CC={mingw_binary_path}/i386-mingw32-gcc \
  343. CXX={mingw_binary_path}/i386-mingw32-g++ \
  344. RC={mingw_binary_path}/i386-mingw32-windres \
  345. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  346. -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
  347. -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
  348. {source_directory}
  349. make
  350. *******************************************************************************
  351. ** Creating Release Packages
  352. *******************************************************************************
  353. The following commands can be used to create various types of release packages:
  354. Unix
  355. ----
  356. make tarball
  357. Create a binary tarball containing the TigerVNC Viewer
  358. make servertarball
  359. Create a binary tarball containing both the TigerVNC Server and Viewer
  360. make dmg
  361. Create Macintosh package/disk image. This requires the PackageMaker
  362. application, which must be installed in /Developer/Applications/Utilities.
  363. make udmg [BUILDDIR32={32-bit build directory}]
  364. On 64-bit OS X systems, this creates a version of the Macintosh package and
  365. disk image which contains universal i386/x86-64 binaries. You should first
  366. configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
  367. out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
  368. build system will look for the 32-bit build under {source_directory}/osxx86
  369. by default, but you can override this by setting the BUILDDIR32 variable on
  370. the make command line as shown above. Either the 64-bit or 32-bit build can
  371. be configured to be backward-compatible by using the instructions in the
  372. "Unix Build Recipes" section.
  373. Windows
  374. -------
  375. If using NMake:
  376. cd {build_directory}
  377. nmake installer
  378. If using MinGW:
  379. cd {build_directory}
  380. make installer
  381. If using the Visual Studio IDE, build the "installer" project.
  382. The installer package (TigerVNC[64].exe) will be located under
  383. {build_directory}. If building using the Visual Studio IDE, then the installer
  384. package will be located in a subdirectory with the same name as the
  385. configuration you built (such as {build_directory}\Debug\ or
  386. {build_directory}\Release\).
  387. NOTE: If TigerVNC is built with TLS support, then the build system will
  388. attempt to package the GnuTLS DLLs into the Windows installer. It looks for
  389. these DLLs in a directory called "bin" one level up from GNUTLS_INCLUDE_DIR.