Autotools

Warning

These tools are experimental and subject to breaking changes.

The Autotools build helper is a wrapper around the command line invocation of autotools. It will abstract the calls like ./configure or make into Python method calls.

The Autotools helper can be used like:

from conans import conanfile
from conan.tools.gnu import Autotools

class App(ConanFile):
    settings = "os", "arch", "compiler", "build_type"

    def build(self):
        autotools = Autotools(self)
        autotools.configure()
        autotools.make()

It will read the conanbuild.json file generated by the AutotoolsToolchain to know read the arguments for calling the configure and make scripts:

  • configure_args: Arguments to call the configure script.

  • make_args: Arguments to call the make script.

Methods

configure()

def configure(self)

Call the configure script.

make()

def make(self, target=None)

Call the make program.

Parameters:
  • target (Optional, Defaulted to None): Choose which target to build. This allows building of e.g., docs, shared libraries or install for some AutoTools projects.

install()

def install(self)

This is just an “alias” of self.make(target="install")