1 HandBrake 0.9.3 Build User Guide
2 ********************************
20 5 Platform Requirements and Notes
29 This guide documents the recommended process to build HandBrake from
30 the official source-code repository. Building from any other source is
36 This chapter is for the impatient or those just looking for a quick
37 summary of the commands used to launch a typical build with the fewest
38 commands possible. For more control over the build process please skip
39 this section and jump to *Note Build Process:: for full details.
41 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
45 The above is an special streamlined invocation of `configure' which
46 performs the following steps automatically:
48 * assert scratch directory `build/' does not exist
50 * create scratch directory `build/'
52 * change to directory `build/'
56 * capture build output to `build/log.txt'
66 Checkout HandBrake from the official source-code repository.
68 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
71 Sources are checked out from the `trunk' branch. This document was
72 generated from that very branch, and for example purposes, we will use
73 exactly the same branch.
75 If you have write-access to the repository, then you may add the
76 appropriate login/password information as needed. It is recommended to
77 use Subversion 1.5.0 or higher. Lower versions should also work.
82 Configure the build system.
89 Create a scratch directory which will contain all files created during
90 the build process. The directory name is arbitrary but we recommend
91 something simple and descriptive. One directory is required for each
92 distinctly configured build. We name our directory `build' for example
95 The `configure' utility accepts many options. It is recommended that
96 you specify `--help' for the complete list of options. The following
100 List available options.
103 Select debug mode. Must be one of `none', `min', `std', `max'.
104 This generally maps to gcc options `-g0', `-g1', `-g2', `-g3'.
107 Select optimize mode. Must be one of `none', `speed', `size'.
108 This generally maps to gcc options `-g0', `-O0', `-O3', `-Os'.
111 Select build architecture. The available architectures vary by
112 platform. Most platforms support exactly one architecture except
113 Mac OS X which has support for various universal binary
114 architectures. The available choices are hard-coded per platform
115 and no sanity checks for the required tools are performed.
118 Specify the `gcc' executable to use where EXE is the executable
119 name which is either absolute or environment `PATH' is searched
122 Clean-room procedures dictate that when certain factors change, old
123 builds should be scrapped and new builds configured. This is the main
124 reason for requiring a scratch directory; to promote consistent,
125 reliable and clean software builds. The following is a short list of
126 some of the reasons why someone may choose to scrap an existing build:
128 * configure with different options
130 * subversion working dir is updated and you want configure to
131 re-evaluate working dir metadata.
133 * build corruption is suspected
135 There are generally two methods for scrapping a build. The `build'
136 directory can be recusrively removed which has the effect of loosing
137 your existing configuration but does guarantee no residuals are left
138 behind. The other method is to use ask the build system to perform an
139 `xclean'. This is known to work well but will leave empty directories
140 behind. However, the configuration is left intact. See *Note Extra
141 Clean:: for further details.
146 Build main product. All necessary dependencies are also built if
151 Parallel builds may optionally be enabled. Be aware that while a
152 parallel build may save time on systems with additional cores, the
153 output is often mixed, overlapped and sometimes even corrupted with
154 binary characters. Thus if you experience a build issue, you should
155 clean and redo the build in default serial mode to produce a readable
156 log. The following command allows for up to 4 concurrent jobs via make:
163 Clean all build output excluding contrib modules. Configuration is
171 Clean all build output including contrib modules. Configuration is
179 The build system supports passing many kinds of targets some of which
180 become very useful in normal development cycles. The targets by
181 convention are lower-case words passed to `make'. Global targets are
182 one-word targets. Scoped targets are usually two-words seperated by a
189 Alias for `make build'.
192 Build main product. All necessary dependencies are also built if
196 Clean all build output excluding contrib modules. Configuration is
200 Clean all build output including contrib modules. Configuration is
206 General modules such as `libhb' and `test' have the following scoped
213 Clean build output for MODULE.
218 Contrib modules such as `a52dec', `bzip2', `faac', `faad2', `ffmpeg',
219 `lame', `libdca', `libdvdread', `libmkv', `libmp4v2', `libogg',
220 `libsamplerate', `libtheora', `libvorbis', `mpeg2dec', `x264',
221 `xvidcore' and `zlib' have the following scoped targets:
224 Download source tarball from the Internet and save to
225 `TOP/downloads' directory. No checksumming is performed.
227 `make MODULE.extract'
228 Extract source tarball into `build' tree.
231 Apply appropriate patches (if any) to module sources.
233 `make MODULE.configure'
234 Configure module sources. This usually invokes autotool configure.
237 Build module. This usually invokes autotool build.
239 `make MODULE.install'
240 Install module products such as headers and libraries into `build'
241 tree. This usually invokes autotool install.
243 `make MODULE.uninstall'
244 Uninstall module products; generally the reverse of install. This
245 usually invokes autotool uninstall.
248 Clean module; generally the reverse of build. This usually
249 invokes autotool clean.
252 Extra clean module; first invokes uninstall then recursively
253 removes the module build directory.
255 4.4 Contrib Aggregate
256 =====================
258 For convenience, the following targets aggregate the all contrib
259 modules' respective targets together:
263 * make contrib.extract
267 * make contrib.configure
271 * make contrib.install
273 * make contrib.uninstall
277 * make contrib.xclean
279 5 Platform Requirements and Notes
280 *********************************
282 The build system supports various platforms of interest to the project.
283 However this does not mean it supports all plaforms. If the platform is
284 not listed in this chapter, then it is not supported.
286 The following tools are used on various platforms and it is recommended
287 you use these versions or newer:
289 * python - Python 2.4.6
291 * curl - curl 7.19.3 (or wget)
295 * make - GNU Make 3.81
297 * patch - Patch 2.5.8
299 * tar - GNU tar 1.15.1
301 * wget - GNU Wget 1.11.4 (or curl)
306 Building on Mac OS X is well supported. It is the reference platform
307 for HandBrake. The following are the recommended specifications for
308 this platform; but is not necessarily the only configuration that is
317 * gcc 4.0.1 (Apple Inc. build 5490)
319 * yasm 0.7.2.2153 (for i386 or x86_64 architectures)
321 Note: It is recommended to use the platform distribution's bundled
322 compiler for maximum C++ compatibility. If you build with a custom
323 compiler it will likely introduce non-standard runtime
324 requirements. There are of course many valid reasons to build with
325 unbundled compilers, but be aware it is generally unsupported and
326 left as an exercise to the reader.
331 Building on Cygwin is supported. The following are the recommended
332 specifications for this platform; but is not necessarily the only
333 configuration that is possible:
335 * Intel 32-bit or 64-bit hardware
339 * yasm 0.7.1.2093 (for i386 or x86_64 architectures)
341 Note: As of this writing, Cygwin has available to it several
342 versions of gcc; only one of which may be found and used in the
343 path as `gcc' and `g++'. Configure will thus find what is probably
344 the older version of gcc in a typical Cygwin environment. If you
345 desire to build with the newer gcc, it is found in the path as
346 `gcc-4' and `g++-4' respectively and you must indicate to
347 configure the desired versions. The following syntax should do the
350 ../configure --gcc=gcc-4
355 Building on Linux is supported. The following are the recommended
356 specifications for this platform; but is not necessarily the only
357 configuration that is possible:
359 * Intel 32-bit or 64-bit hardware
361 * Fedora 8, gcc 4.1.2, yasm 0.6.2.1985
363 * Fedora 9, gcc 4.3.0, yasm 0.6.2.1985
365 * Fedora 10, gcc 4.3.2, yasm 0.7.1.2093
367 * gcc 4.0.0 or higher is reported to work
369 Note: It is recommended to use the platform distribution's bundled
370 compiler for maximum C++ compatibility. If you build with a custom
371 compiler it will likely introduce non-standard runtime
372 requirements. There are of course many valid reasons to build with
373 unbundled compilers, but be aware it is generally unsupported and
374 left as an exercise to the reader.