Chapter 2. The buildtool command

Table of Contents

2.1. Command syntax
2.2. Site information
2.3. Examples

Buildtool's main program, buildtool is a small wrapper that executes the right module depending on the job you want to do. It also takes care to check if Buildtool's installed version matches the version required by the current package (if applicable), as described in Section 1.3, “Versioning”.

You cannot execute a module directly from the command line, as the wrapper issues several sanity checks and gives extra arguments to them, if needed. Therefore you will be using the module wrapper continuously.

2.1. Command syntax

buildtool [ -h | --help ] [ -v | --version ] target [target options]

The following options are recognized:

-h | --help

Shows an useful help message, listing all available optionsand default values for both input and output files.

-v | --version

Shows program name and version.

target specifies what the wrapper should do. Most of the times it matches a module name, though there are some small exceptions. target options are extra optional arguments directly passed to the module (and not interpreted by the wrapper).

The following targets are recognized by the wrapper. Most of them match an independant module, but others are internally parsed by it. See Section 1.2, “Modules” for more information.

build

Runs the bt_logic module to issue the build stage of the package.

clean

Runs the bt_logic module to issue the clean stage of the package.

cleandir

Runs the bt_logic module to issue the cleandir stage of the package.

config

Runs the bt_config module. See Chapter 4, Automatic package configuration.

deinstall

Runs the bt_logic module to issue the deinstall stage of the package.

dist

Runs the bt_dist module. See Chapter 14, Creating distribution files.

doc

Runs the bt_doc module. See Chapter 3, Build time documentation.

install

Runs the bt_logic module to issue the install stage of the package.

lint

Runs the bt_lint module. See Chapter 13, Verifying a package.

pkgflags

Runs the bt_pkgflags module. See Chapter 15, Package flags.

siteinfo

Shows information related to Buildtool's installation in the current system. This target is designed to be used from scripts to determine installation paths, for example. See Section 2.2, “Site information”.

swcgen

Runs the bt_swcgen module. See Chapter 6, System wide configuration.

test

Runs the bt_logic module to issue the test stage of the package.

wizard

Runs the bt_wizard module. See Chapter 16, The project wizard.

2.2. Site information

The siteinfo target is not a module on its own. It just provides information about the current installation, a very easy job that can be done by the wrapper itself.

If executed without extra arguments, it will print a summary of all installation details. However, this is suboptimal. You will usually want just one of the values available, so the target allows it. Each value has a keyword associated which can be passed as the single argument recognized by the target. These are:

dirconf

Directory where system wide configuration files are located.

dirpkgconfig

Directory where installed pkgconfig files are located.

dirpkgflags

Directory where installed pkgflags files are located.

dirsubr

Directory where generic configuration subroutines are located.

2.3. Examples

The following example shows buildtool's help message, which displays more or less the information shown above.

$ buildtool --help

The previous command is different than the one given below, which shows bt_config's help message. Please keep in mind this difference, as it might cause trouble to you:

$ buildtool config --help

The next command gets the directory where pkgflags files have to be installed and stores the result in a shell variable. This is often useful in third party configuration scripts to determine where to install files.

$ mydir=$(buildtool siteinfo dirpkgflags)