LinuxCommandLibrary

autoheader

SYNOPSIS

autoheader [OPTION]... [TEMPLATE]

PARAMETERS

--help
    print this help, then exit

-V, --version
    print version number, then exit

-v, --verbose
    verbosely report processing

-q, --quiet
    do not create output file

--debug
    print lots of debugging information

--trace
    trace execution verbosely (or use perl -d)

--autoconf=PROG
    use PROG instead of autoconf

--force
    overwrite generated output files

-I DIR, --include=DIR
    include DIR in aclocal directory list

-P DIR, --prepend-include=DIR
    prepend DIR to aclocal directory list

-W CATEGORY, --warnings=CATEGORY
    report warnings in CATEGORY (syntax, unsupported, all)

--output=FILE
    put output in FILE (implies -q)

DESCRIPTION

Autoheader is a GNU Autotools tool that creates a template file config.h.in from configure.ac (or configure.in). This template is processed by the configure script to generate config.h, containing #define statements based on system feature tests.

It scans the configure input for AC_DEFINE, AC_DEFINE_UNQUOTED, and AC_CONFIG_HEADERS macros, producing substitutions like @HAVE_FOO@ for conditional compilation. This enables portable software builds across platforms without hardcoded assumptions.

Usage fits into the Autotools workflow: autoreconf or manually autoheader, autoconf, automake, then ./configure & make. It ensures config.h reflects detected capabilities like library presence or compiler features, vital for large projects like GCC or Linux kernel tools.

CAVEATS

Requires valid configure.ac with AC_CONFIG_HEADERS; output is config.h.in by default. May need aclocal for m4 macros. Not for non-Autotools projects.

TYPICAL USAGE

autoheader
autoconf
./configure
make
Or use autoreconf -fiv to run all tools.

HISTORY

Introduced in early 1990s as part of GNU Autotools by David J. MacKenzie and others. Evolved with Autoconf versions; current in Autoconf 2.71 (2023), maintained by GNU Project for portable build systems.

SEE ALSO

Copied to clipboard