1 Guide to Building HandBrake svn2322 (2009041301) 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 * libnotify-dev (gui)
107 * libgstreamer0.10-dev (gui)
109 * libgstreamer-plugins-base0.10-dev (gui)
111 To install these packages:
112 sudo apt-get install subversion yasm build-essential \
113 autoconf intltool libtool zlib1g-dev libbz2-dev libglib2.0-dev \
114 libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev \
115 libgtkhtml3.14-dev libnotify-dev libgstreamer0.10-dev \
116 libgstreamer-plugins-base0.10-dev
118 Fedora 10 package groups:
121 * Development Libraries
123 * X Software Development (gui)
125 * GNOME Software Development (gui)
127 To install these package groups:
128 sudo yum groupinstall "Development Tools" "Development Libraries" \
129 "X Software Development" "GNOME Software Development"
131 Additional Fedora 10 packages:
136 * dbus-glib-devel (gui)
140 * gtkhtml3-devel (gui)
142 * libnotify-devel (gui)
144 * gstreamer-devel (gui)
146 * gstreamer-plugins-base-devel (gui)
148 To install these packages:
149 sudo yum install yasm zlib-devel bzip2-devel \
150 dbus-glib-devel hal-devel gtkhtml3-devel libnotify-devel\
151 gstreamer-devel gstreamer-plugins-base-devel
156 This chapter is for building from a terminal/shell environment in as
157 few commands as possible. Upon completion of the following commands you
158 should have a fresh build of HandBrake. Further instructions are
159 available beginning with *Note overview:: which describes procedures
160 suitable for repeating builds. This chapter should be skipped by those
161 seeking more than a minimalist build.
163 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
167 The special option `--launch' selects launch mode and performs the
170 * assert scratch directory `build/' does not exist
172 * create scratch directory `build/'
174 * change to directory `build/'
178 * capture build output to `build/log/build.txt'
184 * indicate if build ultimately succeeded or failed
189 Linux builds are performed from a terminal. There is no support for
190 building from any IDEs.
192 5 Building via Terminal
193 ***********************
198 Checkout HandBrake from the official source-code repository.
200 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
203 Sources are checked out from the `trunk' branch. This document was
204 generated from that very branch, and for example purposes, we will use
205 exactly the same branch.
207 If you have write-access to the repository, then you may add the
208 appropriate login/password information as needed. It is recommended to
209 use Subversion 1.5.0 or higher. Lower versions should also work.
214 Configure the build system.
218 Configure will automatically create a scratch build directory `build'
219 unless you use GNU-style build procedures and first `cd' to a directory
220 other than top-level source. Additionally you may use `--build' to
221 specify the directory. The name of the directory is arbitrary but it is
222 recommended to use something which indicates transient files which are
223 not checked into the repository.
225 The `configure' utility accepts many options. It is recommended that
226 you specify `--help' for the complete list of options. The following
227 options are also documented here:
230 List available options.
233 Specify top-level source directory for HandBrake sources.
236 Specify destination directory for final product install. The
237 default is to use either `build' if in the top-level source
238 directory, otherwise `.'
241 Specify destination directory for final product install. This
242 defaults to a reasonable platform-specific value.
245 All-in-one option which launches the build and logs output
246 automatically. Useful for novices and quick-start procedures.
249 Disable shunting the build through `xcodebuild'. If this option is
250 applied, `HandBrakeCLI' will be produced in a similar fashion as
251 it is on other platforms; sans Xcode and the Cocoa application
252 will not be produced. Mac OS X only.
255 Disable building the GTK GUI on applicable platforms such as
259 Select debug mode. Must be one of `none', `min', `std', `max'.
260 This generally maps to gcc options `-g0', `-g1', `-g2', `-g3'.
263 Select optimize mode. Must be one of `none', `speed', `size'.
264 This generally maps to gcc options `-g0', `-O0', `-O3', `-Os'.
267 Select build architecture. The available architectures vary by
268 platform. Most platforms support exactly one architecture except
269 Mac OS X which has support for various universal binary
270 architectures. The available choices are hard-coded per platform
271 and no sanity checks for the required tools are performed.
274 Clean-room procedures dictate that when certain factors change, old
275 builds should be scrapped and new builds configured. This is the main
276 reason for requiring a scratch directory; to promote consistent,
277 reliable and clean software builds. The following is a short list of
278 some of the reasons why someone may choose to scrap an existing build:
280 * configure with different options
282 * subversion working dir is updated and you want configure to
283 re-evaluate working dir metadata.
285 * build corruption is suspected
287 There are generally two methods for scrapping a build. The `build'
288 directory can be recursively removed which has the effect of loosing
289 your existing configuration but does guarantee no residuals are left
290 behind. The other method is to ask the build system to perform an `make
291 xclean'. This is known to work well but will leave empty directories
292 behind. However, the configuration is left intact.
297 Build main product. All necessary dependencies are also built if
302 Parallel builds may optionally be enabled. Be aware that while a
303 parallel build may save time on systems with additional cores, the
304 output is often mixed, overlapped and sometimes even corrupted with
305 binary characters. Thus if you experience a build issue, you should
306 clean and redo the build in default serial mode to produce a readable
307 log. The following command allows for up to 4 concurrent jobs via make:
314 The build system supports passing many kinds of targets some of which
315 become very useful in normal development cycles. The targets by
316 convention are lower-case words passed to `make'. Global targets are
317 one-word targets. Scoped targets are usually two-words separated by a
324 Alias for `make build'.
327 Build main product. All necessary dependencies are also built if
331 Clean all build output excluding contrib modules. Configuration is
335 Perform final product(s) install. This will install build
336 products to a standard directory or one specified via `configure
340 Perform final product(s) uninstall. This will uninstall any
341 products which may have been previously installed.
344 Clean all build output including contrib modules. Configuration is
348 Build auto-generated project documentation. Various articles are
349 produced and may be found in `build/doc/articles'.
352 Print list of available makefile vars report targets. These
353 reports detail var definitions and expanded values used by the
354 build system. For experts only.
357 Convenience target which aggregates all reports. For experts only.
359 5.4.2 General Modules
360 ---------------------
362 General modules such as `libhb', `test' and `gtk' have the following
369 Clean build output for MODULE.
371 5.4.3 Contrib Modules
372 ---------------------
374 Contrib modules such as `a52dec', `bzip2', `faac', `faad2', `ffmpeg',
375 `lame', `libdca', `libdvdread', `libmkv', `libmp4v2', `libogg',
376 `libsamplerate', `libtheora', `libvorbis', `mpeg2dec', `x264',
377 `xvidcore' and `zlib' have the following scoped targets:
380 Download source tarball from the Internet and save to
381 `TOP/downloads' directory. No check-summing is performed.
383 `make MODULE.extract'
384 Extract source tarball into `build' tree.
387 Apply appropriate patches (if any) to module sources.
389 `make MODULE.configure'
390 Configure module sources. This usually invokes autotool configure.
393 Build module. This usually invokes autotool build.
395 `make MODULE.install'
396 Install module products such as headers and libraries into `build'
397 tree. This usually invokes autotool install.
399 `make MODULE.uninstall'
400 Uninstall module products; generally the reverse of install. This
401 usually invokes autotool uninstall.
404 Clean module; generally the reverse of build. This usually
405 invokes autotool clean.
408 Extra clean module; first invokes uninstall then recursively
409 removes the module build directory.
411 5.4.4 Contrib Touch and Untouch
412 -------------------------------
414 Also available are some very granular targets which help force builds
415 from specific cycle points. The following targets are available to
416 touch and untouch the respective module target; this will force the
417 build system to treat the target as satisfied after a touch or
418 unsatisfied after an untouch:
420 * make MODULE.extract.touch
422 * make MODULE.extract.untouch
424 * make MODULE.patch.touch
426 * make MODULE.patch.untouch
428 * make MODULE.configure.touch
430 * make MODULE.configure.untouch
432 * make MODULE.build.touch
434 * make MODULE.build.untouch
436 * make MODULE.install.touch
438 * make MODULE.install.untouch
440 5.4.5 Contrib Aggregates
441 ------------------------
443 For convenience, the following targets aggregate the all contrib
444 modules' respective targets together:
448 * make contrib.extract
452 * make contrib.configure
456 * make contrib.install
458 * make contrib.uninstall
462 * make contrib.xclean
467 If the need arises to override settings in the build system
468 (essentially gnu-make variables) the recommended method is to create
469 optional include files which are automatically included if present and
470 follow this naming convention; Do not check these files into the
474 Custom makevar definitions outside `build'. Suitable for settings
475 which apply across all builds for a particular checkout; or which
476 survives manual removal of `build'.
479 Custom make rules outside `build'. Suitable for rules which apply
480 across all builds for a particular checkout; or which survives
481 manual removal of `build'.
483 `_BUILD_/GNUmakefile.custom.defs'
484 Custom makevar definitions specific to a `build' directory.
486 `_BUILD_/GNUmakefile.custom.rules'
487 Custom makevar rules specific to a `build' directory.
490 The purpose is to allow a place to store local build settings for
491 testing, tweaking, and experimenting with build configuration without
492 losing your settings if `configure' is invoked; ie: `configure' would
493 overwrite `GNUmakefile' and any customizations contained therein would
494 be lost. Here is a short example of what the contents of
495 `_SRC_/custom.defs' might contain:
497 ## bump to gcc-4.2 in current path
500 ## replace optimize for 'speed' with more aggressive settings
501 GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2
503 See also `make report.help' which displays a set of reports used to
506 Appendix A Project Repository Details
507 *************************************
509 url: svn://svn.handbrake.fr/HandBrake/trunk
510 root: svn://svn.handbrake.fr/HandBrake
512 uuid: b64f7644-9d1e-0410-96f1-a4d463321fa5
514 date: 2009-04-13 13:28:21 -0400