1 @input texinfo @c -*- Texinfo -*-
3 @setfilename BuildUserGuide.info
4 @include base/article.texi
5 @include build/command.texi
9 @majorheading @value{HB.title} Build User Guide
12 @c %**-------------------------------------------------------------------------
14 This guide documents the recommended process to build @value{HB.name} from the official source-code repository. @b{Building from any other source is not unsupported}.
17 This chapter is for the impatient or those just looking for a quick summary of the commands used to launch a typical build with the fewest commands possible. For more control over the build process please skip this section and jump to @ref{Build Process} for full details.
21 @COMMAND.configure.launch{}
24 The above is an special streamlined invocation of @command{configure} which performs the following steps automatically:
27 @item assert scratch directory @file{build/} does not exist
28 @item create scratch directory @file{build/}
29 @item change to directory @file{build/}
30 @item launch @command{make}
31 @item capture build output to @file{build/log.txt}
32 @item echo build output
35 @c %**-------------------------------------------------------------------------
36 @anchor{Build Process}
37 @chapter Build Process
40 @section Checkout Sources
41 Checkout @value{HB.name} from the official source-code repository.
47 Sources are checked out from the @samp{@value{HB.repo.branch}} branch. This document was generated from that very branch, and for example purposes, we will use exactly the same branch.
49 If you have write-access to the repository, then you may add the appropriate login/password information as needed. It is recommended to use Subversion 1.5.0 or higher. Lower versions should also work.
53 Configure the build system.
59 Create a scratch directory which will contain all files created during the build process. The directory name is arbitrary but we recommend something simple and descriptive. One directory is required for each distinctly configured build. We name our directory @file{build} for example purposes.
61 The @command{configure} utility accepts many options. It is recommended that you specify @command{--help} for the complete list of options. The following options are detailed:
65 List available options.
68 Select debug mode. Must be one of @samp{none}, @samp{min}, @samp{std}, @samp{max}.
69 This generally maps to gcc options @samp{-g0}, @samp{-g1}, @samp{-g2}, @samp{-g3}.
72 Select optimize mode. Must be one of @samp{none}, @samp{speed}, @samp{size}.
73 This generally maps to gcc options @samp{-g0}, @samp{-O0}, @samp{-O3}, @samp{-Os}.
76 Select build architecture. The available architectures vary by platform. Most platforms support exactly one architecture except @value{OS.osx} which has support for various universal binary architectures. The available choices are hard-coded per platform and no sanity checks for the required tools are performed.
79 Specify the @command{gcc} executable to use where @b{EXE} is the executable name which is either absolute or environment @samp{PATH} is searched accordingly.
82 Clean-room procedures dictate that when certain factors change, old builds should be scrapped and new builds configured. This is the main reason for requiring a scratch directory; to promote consistent, reliable and clean software builds. The following is a short list of some of the reasons why someone may choose to scrap an existing build:
85 @item configure with different options
86 @item subversion working dir is updated and you want configure to re-evaluate working dir metadata.
87 @item build corruption is suspected
90 There are generally two methods for scrapping a build. The @file{build} directory can be recusrively removed which has the effect of loosing your existing configuration but does guarantee no residuals are left behind. The other method is to use ask the build system to perform an @command{xclean}. This is known to work well but will leave empty directories behind. However, the configuration is left intact. See @ref{Extra Clean} for further details.
94 Build main product. All necessary dependencies are also built if required.
100 Parallel builds may optionally be enabled. Be aware that while a parallel build may save time on systems with additional cores, the output is often mixed, overlapped and sometimes even corrupted with binary characters. Thus if you experience a build issue, you should clean and redo the build in default serial mode to produce a readable log. The following command allows for up to 4 concurrent jobs via make:
108 Clean all build output excluding contrib modules. Configuration is retained.
116 Clean all build output including contrib modules. Configuration is retained.
122 @c %**-------------------------------------------------------------------------
123 @anchor{Make Targets}
124 @chapter Make Targets
126 The build system supports passing many kinds of targets some of which become very useful in normal development cycles. The targets by convention are lower-case words passed to @command{make}. Global targets are one-word targets. Scoped targets are usually two-words seperated by a period.
128 @anchor{Global Targets}
133 Alias for @samp{make build}.
136 Build main product. All necessary dependencies are also built if required.
139 Clean all build output excluding contrib modules. Configuration is retained.
142 Clean all build output including contrib modules. Configuration is retained.
145 @anchor{General Module Targets}
146 @section General Modules
148 General modules such as @samp{libhb} and @samp{test} have the following scoped targets:
151 @item make @i{MODULE}.build
154 @item make @i{MODULE}.clean
155 Clean build output for @i{MODULE}.
158 @anchor{Contrib Module Targets}
159 @section Contrib Modules
161 Contrib modules such as @samp{a52dec}, @samp{bzip2}, @samp{faac}, @samp{faad2}, @samp{ffmpeg}, @samp{lame}, @samp{libdca}, @samp{libdvdread}, @samp{libmkv}, @samp{libmp4v2}, @samp{libogg}, @samp{libsamplerate}, @samp{libtheora}, @samp{libvorbis}, @samp{mpeg2dec}, @samp{x264}, @samp{xvidcore} and @samp{zlib} have the following scoped targets:
164 @item make @i{MODULE}.fetch
165 Download source tarball from the Internet and save to @file{TOP/downloads} directory. No checksumming is performed.
167 @item make @i{MODULE}.extract
168 Extract source tarball into @file{build} tree.
170 @item make @i{MODULE}.patch
171 Apply appropriate patches (if any) to module sources.
173 @item make @i{MODULE}.configure
174 Configure module sources.
175 This usually invokes autotool configure.
177 @item make @i{MODULE}.build
179 This usually invokes autotool build.
181 @item make @i{MODULE}.install
182 Install module products such as headers and libraries into @file{build} tree.
183 This usually invokes autotool install.
185 @item make @i{MODULE}.uninstall
186 Uninstall module products; generally the reverse of install.
187 This usually invokes autotool uninstall.
189 @item make @i{MODULE}.clean
190 Clean module; generally the reverse of build.
191 This usually invokes autotool clean.
193 @item make @i{MODULE}.xclean
194 Extra clean module; first invokes uninstall then recursively removes the module build directory.
197 @anchor{Contrib Aggregate Targets}
198 @section Contrib Aggregate
200 For convenience, the following targets aggregate the all contrib modules' respective targets together:
203 @item make contrib.fetch
204 @item make contrib.extract
205 @item make contrib.patch
206 @item make contrib.configure
207 @item make contrib.build
208 @item make contrib.install
209 @item make contrib.uninstall
210 @item make contrib.clean
211 @item make contrib.xclean
214 @c %**-------------------------------------------------------------------------
216 @chapter Platform Requirements and Notes
218 The build system supports various platforms of interest to the project. However this does not mean it supports all plaforms. If the platform is not listed in this chapter, then it is not supported.
220 The following tools are used on various platforms and it is recommended you use these versions or newer:
223 @item python - Python 2.4.6
224 @item curl - curl 7.19.3 (or wget)
225 @item m4 - GNU M4 1.4.6
226 @item make - GNU Make 3.81
227 @item patch - Patch 2.5.8
228 @item tar - GNU tar 1.15.1
229 @item wget - GNU Wget 1.11.4 (or curl)
232 @anchor{@value{OS.osx}}
233 @section @value{OS.osx}
235 Building on @value{OS.osx} is well supported. It is the reference platform for @value{HB.name}. The following are the recommended specifications for this platform; but is not necessarily the only configuration that is possible:
238 @item Mac Intel hardware
239 @item @value{OS.osx} 10.5.6
241 @item gcc 4.0.1 (Apple Inc. build 5490)
242 @item yasm 0.7.2.2153 (for i386 or x86_64 architectures)
245 @include build/platform.common.bundled.texi
247 @anchor{@value{OS.cygwin}}
248 @section @value{OS.cygwin}
250 Building on @value{OS.cygwin} is supported. The following are the recommended specifications for this platform; but is not necessarily the only configuration that is possible:
253 @item Intel 32-bit or 64-bit hardware
254 @item @value{OS.cygwin}, gcc 4.3.2
255 @item yasm 0.7.1.2093 (for i386 or x86_64 architectures)
259 As of this writing, @value{OS.cygwin} has available to it several versions of gcc; only one of which may be found and
260 used in the path as @code{gcc} and @code{g++}. Configure will thus find what is probably the older version of gcc in a typical @value{OS.cygwin} environment. If you desire to build with the newer gcc, it is found in the path as @command{gcc-4} and @command{g++-4} respectively and you must indicate to configure the desired versions. The following syntax should do the trick:
264 ../configure --gcc=gcc-4
267 @anchor{@value{OS.linux}}
268 @section @value{OS.linux}
270 Building on @value{OS.linux} is supported. The following are the recommended specifications for this platform; but is not necessarily the only configuration that is possible:
273 @item Intel 32-bit or 64-bit hardware
274 @item Fedora 8, gcc 4.1.2, yasm 0.6.2.1985
275 @item Fedora 9, gcc 4.3.0, yasm 0.6.2.1985
276 @item Fedora 10, gcc 4.3.2, yasm 0.7.1.2093
277 @item gcc 4.0.0 or higher is reported to work
280 @include build/platform.common.bundled.texi