1 Guide to Building HandBrake svn2252 (2009031001) on Linux
2 *********************************************************
11 5 Building via Terminal
19 5.4.4 Contrib Touch and Untouch
20 5.4.5 Contrib Aggregates
22 Appendix A Project Repository Details
28 This guide documents the recommended process to build HandBrake on
29 Linux hosts from the official source-code repository. Building from any
30 other source is not supported.
35 The following are the recommended specifications for building on
36 Linux; but is not necessarily the only configuration that is possible:
38 * Intel 32-bit or 64-bit kernel
40 * Ubuntu 8.0.4, gcc 4.3.0, yasm 0.7.1.2093
42 * Ubuntu 8.10, gcc 4.3.2, yasm 0.7.1.2093
44 * Fedora 9, gcc 4.3.0, yasm 0.7.1.2093
46 * Fedora 10, gcc 4.3.2, yasm 0.7.1.2093
48 * gcc 4.0.0 or higher is reported to work
50 Note: It is recommended to use the platform distribution's bundled
51 compiler for maximum C++ compatibility. If you build with a custom
52 compiler it will likely introduce non-standard runtime
53 requirements. There are of course many valid reasons to build with
54 unbundled compilers, but be aware it is generally unsupported and
55 left as an exercise to the reader.
57 The following general tools are used on various platforms and it is
58 recommended you use these versions or similar:
62 * python - Python 2.4.6
64 * curl - curl 7.19.3 (or wget)
68 * make - GNU Make 3.81
72 * tar - GNU tar 1.15.1
74 * wget - GNU Wget 1.11.4 (or curl)
76 The GTK UI introduces some significant extra build requirements. If you
77 intend to disable building the GUI with `configure --disable-gtk' you
78 will not need many of these packages installed:
93 * libglib2.0-dev (gui)
95 * libdbus-glib-1-dev (gui)
101 * libhal-storage-dev (gui)
103 * libgtkhtml3.14-dev (gui)
105 * libgstreamer0.10-dev (gui)
107 * libgstreamer-plugins-base0.10-dev (gui)
109 To install these packages:
110 sudo apt-get install subversion yasm build-essential \
111 autoconf intltool libtool zlib1g-dev libbz2-dev libglib2.0-dev \
112 libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev \
113 libgtkhtml3.14-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
115 Fedora 10 package groups:
118 * Development Libraries
120 * X Software Development (gui)
122 * GNOME Software Development (gui)
124 To install these package groups:
125 sudo yum groupinstall "Development Tools" "Development Libraries" \
126 "X Software Development" "GNOME Software Development"
128 Additional Fedora 10 packages:
133 * dbus-glib-devel (gui)
137 * gtkhtml3-devel (gui)
139 * gstreamer-devel (gui)
141 * gstreamer-plugins-base-devel (gui)
143 To install these packages:
144 sudo yum install yasm zlib-devel bzip2-devel \
145 dbus-glib-devel hal-devel gtkhtml3-devel \
146 gstreamer-devel gstreamer-plugins-base-devel
151 This chapter is for building from a terminal/shell environment in as
152 few commands as possible. Upon completion of the following commands you
153 should have a fresh build of HandBrake. Further instructions are
154 available beginning with *Note overview:: which describes procedures
155 suitable for repeating builds. This chapter should be skipped by those
156 seeking more than a minimalist build.
158 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
162 The special option `--launch' selects launch mode and performs the
165 * assert scratch directory `build/' does not exist
167 * create scratch directory `build/'
169 * change to directory `build/'
173 * capture build output to `build/log/build.txt'
179 * indicate if build ultimately succeeded or failed
184 Linux builds are performed from a terminal. There is no support for
185 building from any IDEs.
187 5 Building via Terminal
188 ***********************
193 Checkout HandBrake from the official source-code repository.
195 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
198 Sources are checked out from the `trunk' branch. This document was
199 generated from that very branch, and for example purposes, we will use
200 exactly the same branch.
202 If you have write-access to the repository, then you may add the
203 appropriate login/password information as needed. It is recommended to
204 use Subversion 1.5.0 or higher. Lower versions should also work.
209 Configure the build system.
213 Configure will automatically create a scratch build directory `build'
214 unless you use GNU-style build procedures and first `cd' to a directory
215 other than top-level source. Additionally you may specify use `--build'
216 to specify the directory. The name of the directory is arbitrary but it
217 is recommended to use something which indicates transient files which
218 are not checked into the repository.
220 The `configure' utility accepts many options. It is recommended that
221 you specify `--help' for the complete list of options. The following
222 options are also documented here:
225 List available options.
228 Specify top-level source directory for HandBrake sources.
231 Specify destination directory for final product install. The
232 default is to use either `build' if in the top-level source
233 directory, otherwise `.'
236 Specify destination directory for final product install. This
237 defaults to a reasonable platform-specific value.
240 All-in-one option which launches the build and logs output
241 automatically. Useful for novices and quickstart procedures.
244 Disable shunting the build through Xcode. If this option is
245 applied, `HandBrakeCLI' will be produced in a similare fashion as
246 it is on other platforms; sans Xcode. Mac OS X only.
249 Disable building the GTK GUI on applicable platforms such as
253 Select debug mode. Must be one of `none', `min', `std', `max'.
254 This generally maps to gcc options `-g0', `-g1', `-g2', `-g3'.
257 Select optimize mode. Must be one of `none', `speed', `size'.
258 This generally maps to gcc options `-g0', `-O0', `-O3', `-Os'.
261 Select build architecture. The available architectures vary by
262 platform. Most platforms support exactly one architecture except
263 Mac OS X which has support for various universal binary
264 architectures. The available choices are hard-coded per platform
265 and no sanity checks for the required tools are performed.
268 Clean-room procedures dictate that when certain factors change, old
269 builds should be scrapped and new builds configured. This is the main
270 reason for requiring a scratch directory; to promote consistent,
271 reliable and clean software builds. The following is a short list of
272 some of the reasons why someone may choose to scrap an existing build:
274 * configure with different options
276 * subversion working dir is updated and you want configure to
277 re-evaluate working dir metadata.
279 * build corruption is suspected
281 There are generally two methods for scrapping a build. The `build'
282 directory can be recusrively removed which has the effect of loosing
283 your existing configuration but does guarantee no residuals are left
284 behind. The other method is to ask the build system to perform an `make
285 xclean'. This is known to work well but will leave empty directories
286 behind. However, the configuration is left intact.
291 Build main product. All necessary dependencies are also built if
296 Parallel builds may optionally be enabled. Be aware that while a
297 parallel build may save time on systems with additional cores, the
298 output is often mixed, overlapped and sometimes even corrupted with
299 binary characters. Thus if you experience a build issue, you should
300 clean and redo the build in default serial mode to produce a readable
301 log. The following command allows for up to 4 concurrent jobs via make:
308 The build system supports passing many kinds of targets some of which
309 become very useful in normal development cycles. The targets by
310 convention are lower-case words passed to `make'. Global targets are
311 one-word targets. Scoped targets are usually two-words seperated by a
318 Alias for `make build'.
321 Build main product. All necessary dependencies are also built if
325 Clean all build output excluding contrib modules. Configuration is
329 Perform final product(s) install. This will install build
330 products to a standard directory or one specified via `configure
334 Perform final product(s) uninstall. This will uninstall any
335 products which may have been previously installed.
338 Clean all build output including contrib modules. Configuration is
342 Build auto-generated project documentation. Various articles are
343 produced and may be found in `build/doc/articles'.
346 Print list of available makefile vars report targets. These
347 reports detail var definitions and expanded values used by the
348 build system. For experts only.
351 Convenience target which aggregates all reports. For experts only.
353 5.4.2 General Modules
354 ---------------------
356 General modules such as `libhb', `test' and `gtk' have the following
363 Clean build output for MODULE.
365 5.4.3 Contrib Modules
366 ---------------------
368 Contrib modules such as `a52dec', `bzip2', `faac', `faad2', `ffmpeg',
369 `lame', `libdca', `libdvdread', `libmkv', `libmp4v2', `libogg',
370 `libsamplerate', `libtheora', `libvorbis', `mpeg2dec', `x264',
371 `xvidcore' and `zlib' have the following scoped targets:
374 Download source tarball from the Internet and save to
375 `TOP/downloads' directory. No checksumming is performed.
377 `make MODULE.extract'
378 Extract source tarball into `build' tree.
381 Apply appropriate patches (if any) to module sources.
383 `make MODULE.configure'
384 Configure module sources. This usually invokes autotool configure.
387 Build module. This usually invokes autotool build.
389 `make MODULE.install'
390 Install module products such as headers and libraries into `build'
391 tree. This usually invokes autotool install.
393 `make MODULE.uninstall'
394 Uninstall module products; generally the reverse of install. This
395 usually invokes autotool uninstall.
398 Clean module; generally the reverse of build. This usually
399 invokes autotool clean.
402 Extra clean module; first invokes uninstall then recursively
403 removes the module build directory.
405 5.4.4 Contrib Touch and Untouch
406 -------------------------------
408 Also available are some very granular targets which help force builds
409 from specific cycle points. The following targets are available to
410 touch and untouch the respective module target; this will force the
411 build system to treat the target as satisfied after a touch or
412 unsatisfied after an untouch:
414 * make MODULE.extract.touch
416 * make MODULE.extract.untouch
418 * make MODULE.patch.touch
420 * make MODULE.patch.untouch
422 * make MODULE.configure.touch
424 * make MODULE.configure.untouch
426 * make MODULE.build.touch
428 * make MODULE.build.untouch
430 * make MODULE.install.touch
432 * make MODULE.install.untouch
434 5.4.5 Contrib Aggregates
435 ------------------------
437 For convenience, the following targets aggregate the all contrib
438 modules' respective targets together:
442 * make contrib.extract
446 * make contrib.configure
450 * make contrib.install
452 * make contrib.uninstall
456 * make contrib.xclean
461 If the need arises to override settings in the build system
462 (essentially gnu-make variables) the recommended method is to create
463 optional include files which are automatically included if present and
464 follow this naming convention; Do not check these files into the
468 Custom makevar definitions outside `build'. Suitable for settings
469 which apply across all builds for a particular checkout; or which
470 survives manual removal of `build'.
473 Custom make rules outside `build'. Suitable for rules which apply
474 across all builds for a particular checkout; or which survives
475 manual removal of `build'.
477 `_BUILD_/GNUmakefile.custom.defs'
478 Custom makevar definitions specific to a `build' directory.
480 `_BUILD_/GNUmakefile.custom.rules'
481 Custom makevar rules specific to a `build' directory.
484 The purpose is to allow a place to store local build settings for
485 testing, tweaking, and experimenting with build configuration without
486 losing your settings if `configure' is invoked; ie: `configure' would
487 overwrite `GNUmakefile' and any customizations contained therein would
488 be lost. Here is a short example of what the contents of
489 `_SRC_/custom.defs' might contain:
491 ## bump to gcc-4.2 in current path
494 ## replace optimize for 'speed' with more agressive settings
495 GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2
497 See also `make report.help' which displays a set of reports used to
500 Appendix A Project Repository Details
501 *************************************
503 url: svn://svn.handbrake.fr/HandBrake/trunk
504 root: svn://svn.handbrake.fr/HandBrake
506 uuid: b64f7644-9d1e-0410-96f1-a4d463321fa5
508 date: 2009-03-10 18:43:11 -0400