m4
« Back to VersTracker
Description:
Macro processing language
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: macro text-processing gnu templating build-system
Install: brew install m4
About:
M4 is a general-purpose macro processor used primarily by developers to generate code or configuration files. It processes text by expanding macros, which are defined by the user, allowing for automation and abstraction in build systems. Its main value is providing a powerful, scriptable templating engine that is a prerequisite for building software like Autoconf.
Key Features:
  • Textual macro expansion
  • Built-in file inclusion and shell command execution
  • Support for conditional statements and looping
  • Stack-based integer arithmetic
Use Cases:
  • Generating configuration scripts (e.g., Autoconf's configure script)
  • Automating the creation of boilerplate source code
  • Creating complex text-based reports from simple inputs
Alternatives:
  • GNU Autoconf – Autoconf uses M4 as its underlying engine but provides a higher-level layer for generating portable build scripts.
  • Jinja2 – A modern templating engine with similar capabilities but a different syntax, commonly used in Python projects.
Version History
Detected Version Rev Change Commit
Sep 10, 2025 3:54am 0 VERSION_BUMP def0aa00
Sep 16, 2024 3:05pm 0 VERSION_BUMP cb072530