autoconf

Rules

autoconf

load("@rules_cc_autoconf//autoconf:autoconf.bzl", "autoconf")

autoconf(name, deps, checks)

Run autoconf-like checks and produce results.

This rule resolves the autoconf_toolchain (when registered) to skip redundant checker actions. If a check's cache variable name already has a result in the toolchain or in transitive deps, the existing result file is reused.

Use autoconf_library instead for targets that feed into autoconf_toolchain to avoid a dependency cycle.

Example:

load("@rules_cc_autoconf//autoconf:checks.bzl", "checks")

autoconf(
    name = "config",
    checks = [
        checks.AC_CHECK_HEADER("stdio.h"),
        checks.AC_CHECK_HEADER("stdlib.h"),
        checks.AC_CHECK_FUNC("printf"),
    ],
)

The results can then be used by autoconf_hdr or autoconf_srcs to generate headers or wrapped source files.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
depsAdditional autoconf, autoconf_library, or package_info dependencies.List of labelsoptional[]
checksList of JSON-encoded checks from checks (e.g., checks.AC_CHECK_HEADER('stdio.h')).List of stringsoptional[]