autoconf

Functions

autoconf

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

autoconf(*, name, build_settings, checks, deps, **kwargs)

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_cache instead for targets that feed into autoconf_toolchain to avoid a dependency cycle.

Example:

load("@rules_cc_autoconf//autoconf:autoconf.bzl", "autoconf")
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.

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
build_settingsList of checks.AC_BUILD_SETTING(...) entries associating Bazel build setting targets (any rule providing BuildSettingInfo) with autoconf-style defines and substitutions.None
checksList of JSON-encoded checks from checks (e.g., checks.AC_CHECK_HEADER('stdio.h')).None
depsAdditional autoconf, autoconf_cache, or package_info dependencies.None
kwargsStandard Bazel attributes (e.g. visibility, tags).none