Build System

The Libav build system is based on posix shell and gnu make and follows the quite common pattern of having a configure script to set options and check the build environment and Makefile rules to implement actions.

Even if the configure script named as the one commonly provided by autotools its syntax is not always compatible.

configure

The configure script is implemented using posix shell in order to ensure optimal portability.

The script could be split in three logic blocks: variable system and test logic and output writer

In the configure script every feature and option is describe as a variable, the variable has a name and a state. Each variable belongs to one or more lists specifying its behaviour.

The state can be enabled, disabled or unset.

When run the script parses its argument and the environment variables, setting the initial state for all the variables .

The components may have dependency relationships and if a required feature depends on a missing component an error is reported.

Upon success the configure script generates a Makefile, c header, asm header and pkgconf files.

Variable system

The variables are grouped in lists,

HAVE_LIST

The list holds the features that should be probed, such as external library presence or system capabilities.

CONFIG_LIST

The list holds the configurable options, each variable can be enabled/disabled by passing --enable-/--disable-$name during the configure invocation.

Dependency expression

The configure script provides a simple dsl to express dependencies across components.

dep

select

suggest

Feature check

The following primitives are available:

Generators

All the components in

config.mak

config.h

config.asm

pkgconf files

Makefile

Special targets

make config

make check

make fate

make fate-rsync

make documentation

make apidoc

make lcov

make lcov-reset