1 Guide to Building HandBrake svn2194 (2009030201) on Linux
2 *********************************************************
11 5 Building via Terminal
19 5.4.4 Contrib Aggregates
25 This guide documents the recommended process to build HandBrake on
26 Linux hosts from the official source-code repository. Building from any
27 other source is not supported.
32 The following are the recommended specifications for building on
33 Linux; but is not necessarily the only configuration that is possible:
35 * Intel 32-bit or 64-bit kernel
37 * Fedora 8, gcc 4.1.2, yasm 0.6.2.1985
39 * Fedora 9, gcc 4.3.0, yasm 0.6.2.1985
41 * Fedora 10, gcc 4.3.2, yasm 0.7.1.2093
43 * gcc 4.0.0 or higher is reported to work
45 Note: It is recommended to use the platform distribution's bundled
46 compiler for maximum C++ compatibility. If you build with a custom
47 compiler it will likely introduce non-standard runtime
48 requirements. There are of course many valid reasons to build with
49 unbundled compilers, but be aware it is generally unsupported and
50 left as an exercise to the reader.
52 The GTK UI introduces some significant extra build requirements. If you
53 intend to disable building the GUI with `configure --disable-gtk' you
54 may not need any of these packages installed:
80 * libgstreamer0.10-dev
82 * libgstreamer-plugins-base0.10-dev
84 The following general tools are used on various platforms and it is
85 recommended you use these versions or similar:
89 * python - Python 2.4.6
91 * curl - curl 7.19.3 (or wget)
95 * make - GNU Make 3.81
99 * tar - GNU tar 1.15.1
101 * wget - GNU Wget 1.11.4 (or curl)
106 This chapter is for building from a terminal/shell environment in as
107 few commands as possible. If more flexibility is required you should
108 skip this chapter and jump to *Note overview::.
110 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
114 The special option `--launch' selected launch mode and performs the
117 * assert scratch directory `build/' does not exist
119 * create scratch directory `build/'
121 * change to directory `build/'
125 * capture build output to `build/log.txt'
132 Linux builds are performed from a terminal. There is no support for
133 building from any IDEs.
135 5 Building via Terminal
136 ***********************
141 Checkout HandBrake from the official source-code repository.
143 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
146 Sources are checked out from the `trunk' branch. This document was
147 generated from that very branch, and for example purposes, we will use
148 exactly the same branch.
150 If you have write-access to the repository, then you may add the
151 appropriate login/password information as needed. It is recommended to
152 use Subversion 1.5.0 or higher. Lower versions should also work.
157 Configure the build system.
164 Create a scratch directory which will contain all files created during
165 the build process. The directory name is arbitrary but we recommend
166 something simple and descriptive. One directory is required for each
167 distinctly configured build. We name our directory `build' for example
170 The `configure' utility accepts many options. It is recommended that
171 you specify `--help' for the complete list of options. The following
172 options are also documented here:
175 List available options.
178 Specify destination directory for final product install. This
179 defaults to a reasonable platform-specific value.
182 Disable driving the build through Xcode. If this option is
183 disabled only `HandBrakeCLI' will be produced and Xcode will not
184 be invoked. Mac OS X only.
187 Disable building the GTK GUI on applicable platforms such as
191 Select debug mode. Must be one of `none', `min', `std', `max'.
192 This generally maps to gcc options `-g0', `-g1', `-g2', `-g3'.
195 Select optimize mode. Must be one of `none', `speed', `size'.
196 This generally maps to gcc options `-g0', `-O0', `-O3', `-Os'.
199 Select build architecture. The available architectures vary by
200 platform. Most platforms support exactly one architecture except
201 Mac OS X which has support for various universal binary
202 architectures. The available choices are hard-coded per platform
203 and no sanity checks for the required tools are performed.
206 Specify the `gcc' executable to use where EXE is the executable
207 name which is either absolute or environment `PATH' is searched
210 Clean-room procedures dictate that when certain factors change, old
211 builds should be scrapped and new builds configured. This is the main
212 reason for requiring a scratch directory; to promote consistent,
213 reliable and clean software builds. The following is a short list of
214 some of the reasons why someone may choose to scrap an existing build:
216 * configure with different options
218 * subversion working dir is updated and you want configure to
219 re-evaluate working dir metadata.
221 * build corruption is suspected
223 There are generally two methods for scrapping a build. The `build'
224 directory can be recusrively removed which has the effect of loosing
225 your existing configuration but does guarantee no residuals are left
226 behind. The other method is to ask the build system to perform an `make
227 xclean'. This is known to work well but will leave empty directories
228 behind. However, the configuration is left intact.
233 Build main product. All necessary dependencies are also built if
238 Parallel builds may optionally be enabled. Be aware that while a
239 parallel build may save time on systems with additional cores, the
240 output is often mixed, overlapped and sometimes even corrupted with
241 binary characters. Thus if you experience a build issue, you should
242 clean and redo the build in default serial mode to produce a readable
243 log. The following command allows for up to 4 concurrent jobs via make:
250 The build system supports passing many kinds of targets some of which
251 become very useful in normal development cycles. The targets by
252 convention are lower-case words passed to `make'. Global targets are
253 one-word targets. Scoped targets are usually two-words seperated by a
260 Alias for `make build'.
263 Build main product. All necessary dependencies are also built if
267 Clean all build output excluding contrib modules. Configuration is
271 Clean all build output including contrib modules. Configuration is
275 Build auto-generated project documentation. Various articles are
276 produced and may be found in `build/doc/articles'.
278 5.4.2 General Modules
279 ---------------------
281 General modules such as `libhb', `test' and `gtk' have the following
288 Clean build output for MODULE.
290 5.4.3 Contrib Modules
291 ---------------------
293 Contrib modules such as `a52dec', `bzip2', `faac', `faad2', `ffmpeg',
294 `lame', `libdca', `libdvdread', `libmkv', `libmp4v2', `libogg',
295 `libsamplerate', `libtheora', `libvorbis', `mpeg2dec', `x264',
296 `xvidcore' and `zlib' have the following scoped targets:
299 Download source tarball from the Internet and save to
300 `TOP/downloads' directory. No checksumming is performed.
302 `make MODULE.extract'
303 Extract source tarball into `build' tree.
306 Apply appropriate patches (if any) to module sources.
308 `make MODULE.configure'
309 Configure module sources. This usually invokes autotool configure.
312 Build module. This usually invokes autotool build.
314 `make MODULE.install'
315 Install module products such as headers and libraries into `build'
316 tree. This usually invokes autotool install.
318 `make MODULE.uninstall'
319 Uninstall module products; generally the reverse of install. This
320 usually invokes autotool uninstall.
323 Clean module; generally the reverse of build. This usually
324 invokes autotool clean.
327 Extra clean module; first invokes uninstall then recursively
328 removes the module build directory.
330 5.4.4 Contrib Aggregates
331 ------------------------
333 For convenience, the following targets aggregate the all contrib
334 modules' respective targets together:
338 * make contrib.extract
342 * make contrib.configure
346 * make contrib.install
348 * make contrib.uninstall
352 * make contrib.xclean