These tools are experimental and subject to breaking changes.

The AutotoolsGen is a complete generator for the whole autotools system. It aggregates the functionality of AutotoolsDeps, AutotoolsToolchain and VirtualEnv into a single generator.

It will generate shell scripts containing environment variable definitions that the autotools build system can understand.

The AutotoolsGen generator can be used by name in conanfiles:
class Pkg(ConanFile):
    generators = "AutotoolsGen"

And it can also be fully instantiated in the conanfile generate() method:

from conans import ConanFile
from import AutotoolsGen

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

    def generate(self):
        tc = AutotoolsGen(self)

Its implementation is straightforward:

class AutotoolsGen:
    def __init__(self, conanfile):
        self.toolchain = AutotoolsToolchain(conanfile)
        self.deps = AutotoolsDeps(conanfile)
        self.env = VirtualEnv(conanfile)

And it will output the same files as VirtualEnv:

  • conanbuildenv .bat or .sh scripts, that are automatically loaded if existing by the recipes methods
  • conanrunenv .bat or .sh scripts, that can be explicitly opted-in in recipes methods with, env=["conanrunenv"])

These files will contain the necessary accumulated information from all the 3 internal generators.