1 Guide to Building HandBrake svn2213 (2009030301) on Cygwin
2 **********************************************************
11 5 Building via Terminal
19 5.4.4 Contrib Aggregates
26 This guide documents the recommended process to build HandBrake on
27 Cygwin hosts from the official source-code repository. Building from
28 any other source is not supported.
33 The following are the recommended specifications for building on
34 Cygwin; but is not necessarily the only configuration that is possible:
36 * Intel 32-bit or 64-bit hardware (only 32-bit product binaries are
41 * yasm 0.7.2.2153 (for i386 or x86_64 architectures)
43 Note: It is recommended to use the platform distribution's bundled
44 compiler for maximum C++ compatibility. If you build with a custom
45 compiler it will likely introduce non-standard runtime
46 requirements. There are of course many valid reasons to build with
47 unbundled compilers, but be aware it is generally unsupported and
48 left as an exercise to the reader.
50 Note: As of this writing, Cygwin has available to it several
51 versions of gcc; only one of which may be found and used in the
52 path as `gcc' and `g++'. Configure will thus find what is probably
53 the older version of gcc in a typical Cygwin environment. If you
54 desire to build with the newer gcc, it is found in the path as
55 `gcc-4' and `g++-4' respectively and you must indicate to
56 configure the desired versions. The following syntax should do the
59 ../configure --gcc=gcc-4
61 The following general tools are used on various platforms and it is
62 recommended you use these versions or similar:
66 * python - Python 2.4.6
68 * curl - curl 7.19.3 (or wget)
72 * make - GNU Make 3.81
76 * tar - GNU tar 1.15.1
78 * wget - GNU Wget 1.11.4 (or curl)
83 This chapter is for building from a terminal/shell environment in as
84 few commands as possible. If more flexibility is required you should
85 skip this chapter and jump to *Note overview::.
87 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
91 The special option `--launch' selected launch mode and performs the
94 * assert scratch directory `build/' does not exist
96 * create scratch directory `build/'
98 * change to directory `build/'
102 * capture build output to `build/log.txt'
109 Cygwin builds are performed from a terminal. There is no support for
110 building from any IDEs.
112 5 Building via Terminal
113 ***********************
118 Checkout HandBrake from the official source-code repository.
120 svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
123 Sources are checked out from the `trunk' branch. This document was
124 generated from that very branch, and for example purposes, we will use
125 exactly the same branch.
127 If you have write-access to the repository, then you may add the
128 appropriate login/password information as needed. It is recommended to
129 use Subversion 1.5.0 or higher. Lower versions should also work.
134 Configure the build system.
141 Create a scratch directory which will contain all files created during
142 the build process. The directory name is arbitrary but we recommend
143 something simple and descriptive. One directory is required for each
144 distinctly configured build. We name our directory `build' for example
147 The `configure' utility accepts many options. It is recommended that
148 you specify `--help' for the complete list of options. The following
149 options are also documented here:
152 List available options.
155 Specify destination directory for final product install. This
156 defaults to a reasonable platform-specific value.
159 Disable driving the build through Xcode. If this option is
160 disabled only `HandBrakeCLI' will be produced and Xcode will not
161 be invoked. Mac OS X only.
164 Disable building the GTK GUI on applicable platforms such as
168 Select debug mode. Must be one of `none', `min', `std', `max'.
169 This generally maps to gcc options `-g0', `-g1', `-g2', `-g3'.
172 Select optimize mode. Must be one of `none', `speed', `size'.
173 This generally maps to gcc options `-g0', `-O0', `-O3', `-Os'.
176 Select build architecture. The available architectures vary by
177 platform. Most platforms support exactly one architecture except
178 Mac OS X which has support for various universal binary
179 architectures. The available choices are hard-coded per platform
180 and no sanity checks for the required tools are performed.
183 Specify the `gcc' executable to use where EXE is the executable
184 name which is either absolute or environment `PATH' is searched
187 Clean-room procedures dictate that when certain factors change, old
188 builds should be scrapped and new builds configured. This is the main
189 reason for requiring a scratch directory; to promote consistent,
190 reliable and clean software builds. The following is a short list of
191 some of the reasons why someone may choose to scrap an existing build:
193 * configure with different options
195 * subversion working dir is updated and you want configure to
196 re-evaluate working dir metadata.
198 * build corruption is suspected
200 There are generally two methods for scrapping a build. The `build'
201 directory can be recusrively removed which has the effect of loosing
202 your existing configuration but does guarantee no residuals are left
203 behind. The other method is to ask the build system to perform an `make
204 xclean'. This is known to work well but will leave empty directories
205 behind. However, the configuration is left intact.
210 Build main product. All necessary dependencies are also built if
215 Parallel builds may optionally be enabled. Be aware that while a
216 parallel build may save time on systems with additional cores, the
217 output is often mixed, overlapped and sometimes even corrupted with
218 binary characters. Thus if you experience a build issue, you should
219 clean and redo the build in default serial mode to produce a readable
220 log. The following command allows for up to 4 concurrent jobs via make:
227 The build system supports passing many kinds of targets some of which
228 become very useful in normal development cycles. The targets by
229 convention are lower-case words passed to `make'. Global targets are
230 one-word targets. Scoped targets are usually two-words seperated by a
237 Alias for `make build'.
240 Build main product. All necessary dependencies are also built if
244 Clean all build output excluding contrib modules. Configuration is
248 Perform final product(s) install. This will install build
249 products to a standard directory or one specified via `configure
253 Perform final product(s) uninstall. This will uninstall any
254 products which may have been previously installed.
257 Clean all build output including contrib modules. Configuration is
261 Build auto-generated project documentation. Various articles are
262 produced and may be found in `build/doc/articles'.
264 5.4.2 General Modules
265 ---------------------
267 General modules such as `libhb', `test' and `gtk' have the following
274 Clean build output for MODULE.
276 5.4.3 Contrib Modules
277 ---------------------
279 Contrib modules such as `a52dec', `bzip2', `faac', `faad2', `ffmpeg',
280 `lame', `libdca', `libdvdread', `libmkv', `libmp4v2', `libogg',
281 `libsamplerate', `libtheora', `libvorbis', `mpeg2dec', `x264',
282 `xvidcore' and `zlib' have the following scoped targets:
285 Download source tarball from the Internet and save to
286 `TOP/downloads' directory. No checksumming is performed.
288 `make MODULE.extract'
289 Extract source tarball into `build' tree.
292 Apply appropriate patches (if any) to module sources.
294 `make MODULE.configure'
295 Configure module sources. This usually invokes autotool configure.
298 Build module. This usually invokes autotool build.
300 `make MODULE.install'
301 Install module products such as headers and libraries into `build'
302 tree. This usually invokes autotool install.
304 `make MODULE.uninstall'
305 Uninstall module products; generally the reverse of install. This
306 usually invokes autotool uninstall.
309 Clean module; generally the reverse of build. This usually
310 invokes autotool clean.
313 Extra clean module; first invokes uninstall then recursively
314 removes the module build directory.
316 5.4.4 Contrib Aggregates
317 ------------------------
319 For convenience, the following targets aggregate the all contrib
320 modules' respective targets together:
324 * make contrib.extract
328 * make contrib.configure
332 * make contrib.install
334 * make contrib.uninstall
338 * make contrib.xclean
343 If the need arises to override settings in the build system
344 (essentially gnu-make variables) the recommended method is to
345 create/edit the optional include file `build/GNUmakefile.custom' which
346 sits adjacent to the top-level makefile. Do not check this file into
347 the respository. The sole purpose is to allow a place to store local
348 build settings for testing, tweaking, and experimenting with build
349 configuration without losing your settings if `configure' is invoked;
350 ie: `configure' would overwrite `GNUmakefile' and any customizations
351 contained therein would be lost. Here is a short example of what the
352 contents of `build/GNUmakefile.custom' might contain:
354 ## bump to gcc-4.2 in current path
357 ## replace optimize for 'speed' with more agressive settings
358 GCC.args.O.speed = -O3 -fomit-frame-pointer -msse4.2