# GNU m4

> GNU version of UNIX m4 macro language processor

**Wikidata**: [Q1022237](https://www.wikidata.org/wiki/Q1022237)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/GNU_m4)  
**Source**: https://4ort.xyz/entity/gnu-m4

## Summary
GNU m4 is a general-purpose macro processor that implements the m4 macro language, originally derived from the UNIX m4 utility. It is part of the GNU Project and is distributed as free software under the GNU General Public License, version 2.0 or later. GNU m4 is widely used in software development for code generation, text transformation, and as a foundational tool in build systems.

## Key Facts
- **Instance of**: General-purpose macro processor, GNU package, free software
- **Part of**: GNU Project (founded 1983-09-27), GNU toolchain
- **License**: GNU General Public License, version 2.0 or later
- **Maintained by**: Eric Blake (since 2006)
- **Latest stable version**: 1.4.21 (released 2026-02-06)
- **Previous versions**:
  - 1.4.20 (2025-05-10)
  - 1.4.19 (2021-05-28)
  - 1.4.18 (2016-12-31)
  - 1.4.17 (2013-09-22)
- **Operating systems supported**: macOS, BSD, GNU/Hurd, Unix-like systems
- **Implementation of**: m4 macro language
- **Programming language**: C (based on OpenHub data)
- **Available packages**:
  - Debian: m4, m4-doc
  - Ubuntu: m4, m4-doc
  - Fedora: m4
  - Arch Linux: m4
  - Gentoo: sys-devel/m4
  - Homebrew: m4
  - FreeBSD: devel/m4
  - OpenBSD: devel/m4
  - Nixpkgs: gnum4
  - AUR: m4-git
- **Source code repositories**:
  - Primary: https://git.savannah.gnu.org/cgit/m4.git
  - Mirror: https://ftpmirror.gnu.org/m4/
- **Mailing lists**:
  - Announcements: https://lists.gnu.org/archive/html/m4-announce/
  - Discussion: https://lists.gnu.org/archive/html/m4-discuss/
  - Bug reports: https://lists.gnu.org/archive/html/bug-m4/
- **Website**: https://www.gnu.org/software/m4/m4.html
- **Man page**: m4.1
- **Aliases**: GNU M4, m4, جنو إم٤
- **Wikipedia languages**: Arabic, English, Finnish, French, Dutch, Chinese

## FAQs
### What is GNU m4 used for?
GNU m4 is a macro processor used primarily in software development for tasks like code generation, template expansion, and text preprocessing. It is often used in build systems and configuration scripts, such as those generated by GNU autoconf.

### Is GNU m4 free software?
Yes, GNU m4 is free software distributed under the terms of the GNU General Public License, version 2.0 or later. This allows users to run, study, modify, and redistribute the software.

### On which operating systems does GNU m4 run?
GNU m4 runs on macOS, BSD, GNU/Hurd, and other Unix-like operating systems. It is designed to be portable and compatible with a wide range of environments.

### Who maintains GNU m4?
GNU m4 is currently maintained by Eric Blake, who has been the maintainer since 2006.

### What is the latest version of GNU m4?
As of February 2026, the latest stable version is 1.4.21. Previous stable versions include 1.4.20 (May 2025), 1.4.19 (May 2021), and 1.4.18 (December 2016).

### Where can I find the source code for GNU m4?
The source code is hosted on Savannah at https://git.savannah.gnu.org/cgit/m4.git, with mirrors available at https://ftpmirror.gnu.org/m4/.

### What mailing lists are associated with GNU m4?
There are three main mailing lists:
- Announcements: https://lists.gnu.org/archive/html/m4-announce/
- Discussion: https://lists.gnu.org/archive/html/m4-discuss/
- Bug reports: https://lists.gnu.org/archive/html/bug-m4/

### Is GNU m4 part of a larger project?
Yes, GNU m4 is part of the GNU Project, which began in 1983, and is also a component of the GNU toolchain.

## Why It Matters
GNU m4 plays a foundational role in software development by providing a robust and extensible macro processing engine. It is essential in the generation of code and configuration files, particularly in build systems like those involving GNU autoconf. As part of the GNU Project, it supports the broader mission of free software by ensuring accessibility, modifiability, and redistributability. Its compatibility with Unix-like systems and integration into major package managers and distributions make it a critical tool for developers working in Unix environments.

## Notable For
- Being part of the GNU Project, a cornerstone of the free software movement
- Serving as a core component of the GNU toolchain
- Supporting multiple Unix-like operating systems including macOS, BSD, and GNU/Hurd
- Having a long history of stable releases, with version 1.4.21 being the latest as of 2026
- Being actively maintained by Eric Blake since 2006
- Integration into major package managers like Homebrew, Debian, Fedora, and Arch Linux
- Hosting source code on Savannah with public access and mirrors
- Providing mailing list support for announcements, discussion, and bug tracking

## Body

### History and Development
GNU m4 is the GNU Project's implementation of the m4 macro language processor, originally inspired by the UNIX m4 utility. It was developed as part of the broader GNU Project, which was initiated on September 27, 1983, with the goal of creating a completely free Unix-like operating system. GNU m4 has been maintained by Eric Blake since 2006, ensuring its continued relevance and stability in modern software development environments.

### Licensing and Distribution
GNU m4 is distributed as free software under the GNU General Public License, version 2.0 or later. This license guarantees users the freedom to run, study, modify, and redistribute the software. As a result, it is widely included in free software distributions and is a standard component of many Unix-like systems.

### Versioning and Releases
GNU m4 has seen multiple stable releases over the years:
- Version 1.4.17 was released on September 22, 2013.
- Version 1.4.18 was released on December 31, 2016.
- Version 1.4.19 was released on May 28, 2021.
- Version 1.4.20 was released on May 10, 2025.
- Version 1.4.21, the latest stable version, was released on February 6, 2026.

Each release is available for download from the GNU FTP mirror: https://ftpmirror.gnu.org/m4/.

### Operating System Support
GNU m4 is compatible with a wide range of Unix-like systems, including:
- macOS (since 2001)
- BSD variants
- GNU/Hurd
- Other Unix-like operating systems

This broad compatibility ensures its utility across diverse development environments.

### Integration and Packaging
GNU m4 is packaged in major Linux distributions and package managers:
- **Debian**: m4, m4-doc (since December 16, 2000)
- **Ubuntu**: m4, m4-doc
- **Fedora**: m4
- **Arch Linux**: m4
- **Gentoo**: sys-devel/m4
- **FreeBSD**: devel/m4
- **OpenBSD**: devel/m4
- **Nixpkgs**: gnum4
- **AUR**: m4-git
- **Homebrew**: m4

### Source Code and Community
The source code for GNU m4 is hosted on Savannah:
- Primary repository: https://git.savannah.gnu.org/cgit/m4.git
- Mirror: https://ftpmirror.gnu.org/m4/

Community engagement is supported through mailing lists:
- Announcements: https://lists.gnu.org/archive/html/m4-announce/
- Discussion: https://lists.gnu.org/archive/html/m4-discuss/
- Bug reports: https://lists.gnu.org/archive/html/bug-m4/

### Role in the GNU Ecosystem
GNU m4 is part of the GNU toolchain, a collection of programming tools produced by the GNU Project. As such, it contributes to the GNU Project's overarching goal of providing a complete free software operating system. It is also categorized as a general-purpose macro processor, making it a versatile tool for developers working on code generation, templating, and build automation.

### Documentation and References
GNU m4 is documented through its man page (m4.1) and online resources, including its official website: https://www.gnu.org/software/m4/m4.html. It also has entries in the Free Software Directory and is indexed by Repology under the project name "m4".

### Programming Language and Implementation
While the implementation language is not explicitly stated, OpenHub data references C as the primary language used in GNU m4's development. This aligns with its role as a low-level utility in system development.

### Aliases and Localization
GNU m4 is known by several aliases:
- GNU M4
- m4
- جنو إم٤

It is documented in multiple languages on Wikipedia, including Arabic, English, Finnish, French, Dutch, and Chinese, reflecting its global usage and community support.

## References

1. Autotools : a practitioner's guide to GNU Autoconf, Automake, and Libtool
2. Free Software Directory
3. [Source](https://www.openhub.net/p/m4/analyses/latest/languages_summary)
4. [m4-1.4.17 released [stable]. 2013](https://lists.gnu.org/archive/html/info-gnu/2013-09/msg00010.html)
5. [m4-1.4.18 released. 2016](https://lists.gnu.org/archive/html/info-gnu/2016-12/msg00015.html)
6. [m4-1.4.19 released. 2021](https://lists.gnu.org/archive/html/info-gnu/2021-05/msg00014.html)
7. [m4-1.4.20 released [stable]. 2025](https://lists.gnu.org/archive/html/m4-announce/2025-05/msg00000.html)
8. [m4-1.4.21 released [stable]. m4-announce. 2026](https://lists.gnu.org/archive/html/m4-announce/2026-02/msg00000.html)
9. Freebase Data Dumps. 2013
10. [Source](https://openports.eu/ports/devel/m4)
11. [Source](https://lists.gnu.org/mailman/listinfo/bug-m4)
12. [Source](https://lists.gnu.org/mailman/listinfo/m4-discuss)
13. [Source](https://lists.gnu.org/mailman/listinfo/m4-announce)