4.1. System fundamentals

In general form the build system works as follows:

-
Options with data, applied to a project, compose the configuration. Options are stored in config files or are passed through command line of any launch. The system reads these options and transforms them to variables in shell language.

-
Then the system makes up the script, which at the beginning has the input variables, made from options.

-
After that the variables are initialised, which compose system API and are used in anybuilds.

-
After that the script includes functions from libraries of any. They perform all the typical work to form binary package, hidden from developer.

-
After the generic functions the package anybuild is included, xz package in our case. Anybuild contains the code, unique for xz, unlike generic library functions.

-
At the end of the script specialised functions are called, each of them performs some predescribed task during package creation, such as forming the sources or configuration. Until that moment none functions were actually called, they were only included as libraries.

-
The system writes down the resulting script into the service file and executes it. The script is not removed afterwards. Moreover, it is executed as separate process after entire preparation from paragraphs above has been completed. So the build may be relaunched manually, and its result will be the same, as through mechanism of any.

The schematic work looks like that:

    #!/bin/sh
    # data from configs
    any_option_one='value one'
    any_option_two='value two'
    ...

    # including libraries and API
    . any_libraries.sh

    # including anybuild of a package
    . package.build

    # the sequence of building
    build_pack_one
    build_pack_two
    ...

In spite a large number of details, the building procedure cuts down to a plain shell script ultimately. Its point is exactly the same as manual call of configure, make, make install.

Examine in more details the listed blocks of build procedure.