Otok public index

apotocki/m4

GNU M4, the macro processor, built from source.

Library
m4
Newest
1.4.21 (r1, apple)
Targets
apple, linux
License
GPL-3.0-or-later
Homepage
https://www.gnu.org/software/m4/
Documentation
https://www.gnu.org/software/m4/manual/
Keywords
macro, m4, tool

Use it

In otok.toml:

[deps.m4]
recipe = "apotocki/m4"
version = "~> 1.4.21"

Versions

VersionTargetChannelPublishedStatus
1.4.21 (r1, apple) apple stable 2026-11-14
1.4.21 (r1, linux) linux stable 2026-11-14

1.4.21 (r1, apple)

Platforms

macosx

Toolchains

Recipe files

build.lua 818 bytes · raw
-- m4 built by its configure and make: its library of gnulib and the program, not the documentation and tests.
function build(slice, options, deps)
    local p = slice.prefix
    local env = { CC = slice.toolchain.cc, CFLAGS = table.concat(slice.toolchain.cflags, " ") }
    -- without NLS: m4 alone, which needs no library of the machine
    local args = { "sh", slice.source .. "/configure", "--prefix=" .. p, "--disable-nls", "--disable-dependency-tracking" }
    otok.run(args, { cwd = slice.build, env = env })
    otok.run({ slice.toolchains.make, "-j" .. slice.jobs, "-C", "lib" }, { cwd = slice.build })
    otok.run({ slice.toolchains.make, "-j" .. slice.jobs, "-C", "src" }, { cwd = slice.build })
    otok.copy(slice.build .. "/src/m4", p .. "/bin/m4")
    return { programs = { m4 = p .. "/bin/m4" } }
end
recipe.toml 1054 bytes · raw
# The otok recipe of GNU M4 (https://github.com/apotocki/otok): the m4 macro processor for the builds of other recipes,
# which name it as their toolchain (`m4 = { default-recipe = "apotocki/m4" }`), flex and Bison among them, which run it
# and carry it beside their programs; on macOS: built from the release archive with its configure and make.
[recipe]
api = 1
library = "m4"
name = "m4"
version = "1.4.21"
revision = 1
license = "GPL-3.0-or-later"
license-files = ["COPYING"]
homepage = "https://www.gnu.org/software/m4/"
documentation = "https://www.gnu.org/software/m4/manual/"
description = "GNU M4, the macro processor, built from source."
keywords = ["macro", "m4", "tool"]

[tool]
programs = ["m4"]

[source]
url = "https://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz"
sha256 = "f25c6ab51548a73a75558742fb031e0625d6485fe5f9155949d6486a2408ab66"
mirrors = ["https://ftpmirror.gnu.org/gnu/m4/m4-1.4.21.tar.xz"]

[platforms]
supported = ["macosx"]
build-on = ["macos/xcode"]

[toolchains]
make = { version = ">= 3.81", default-recipe = "apotocki/make" }