The recommended method is via xpm.

Overview

The xPack GNU M4 can be installed automatically, via xpm (the recommended method), or manually, by downloading and unpacking one of the portable archives.

Binaries are available only for GNU/Linux and macOS.

Easy install

The easiest way to install GNU M4 is by using the binary xPack, available as @xpack-dev-tools/m4 from the npmjs.com registry.

Prerequisites

The only requirement is a recent xpm, which is a portable Node.js command line application. To install it, follow the instructions from the xpm install page.

Install

With xpm available, installing the latest version of the package is quite easy:

cd my-project
xpm init # Only at first use.

xpm install @xpack-dev-tools/m4@latest --verbose

This command will always install the latest available version, in the global xPacks store, which is a platform dependent folder (check the output of the xpm command for the actual folder used on your platform).

Uninstall

To remove the links from the current project:

cd my-project

xpm uninstall @xpack-dev-tools/m4

To completely remove the package from the central xPacks store:

xpm uninstall --global @xpack-dev-tools/m4 --verbose

Test

To check if the xpm installed GNU M4 starts, use something like:

$ ~/Library/xPacks/@xpack-dev-tools/m4/1.4.19-2.1/.content/bin/m4 --version
m4 (GNU M4) 1.4.19

Manual install

For all platforms, the xPack GNU M4 binaries are released as portable archives that can be installed in any location.

The archives can be downloaded from the GitHub releases page.

Download

The macOS versions of xPack GNU M4 are packed as .tar.gz archives. Download the latest version named like:

  • xpack-m4-1.4.19-2-darwin-x64.tar.gz
  • xpack-m4-1.4.19-2-darwin-arm64.tar.gz

Unpack

To manually install the xPack GNU M4, unpack the archive and move it to ~/.local/xPacks/m4/xpack-m4-1.4.19-2:

mkdir -p ~/.local/xPacks/m4
cd ~/.local/xPacks/m4

tar xvf ~/Downloads/xpack-m4-1.4.19-2-darwin-x64.tar.gz
chmod -R -w xpack-m4-1.4.19-2

The result is a structure like:

$ tree -L 2 /Users/ilg/.local/xPacks/m4/xpack-m4-1.4.19-2
/Users/ilg/.local/xPacks/m4/xpack-m4-1.4.19-2/
├── README.md
├── bin
│   ├── gm4 -> m4
│   └── m4
├── distro-info
│   ├── CHANGELOG.md
│   ├── licenses
│   └── scripts
├── libexec
│   └── libiconv.2.dylib
└── share
    └── info

7 directories, 5 files

Test

To check if the manually installed GNU M4 starts, use something like:

$ ~/.local/xPacks/m4/xpack-m4-1.4.19-2/bin/m4 --version
m4 (GNU M4) 1.4.19

Easy install

The easiest way to install GNU M4 is by using the binary xPack, available as @xpack-dev-tools/m4 from the npmjs.com registry.

Prerequisites

The only requirement is a recent xpm, which is a portable Node.js command line application. To install it, follow the instructions from the xpm install page.

Install

With xpm available, installing the latest version of the package is quite easy:

cd my-project
xpm init # Only at first use.

xpm install @xpack-dev-tools/m4@latest --verbose

This command will always install the latest available version, in the global xPacks store, which is a platform dependent folder (check the output of the xpm command for the actual folder used on your platform).

Uninstall

To remove the links from the current project:

cd my-project

xpm uninstall @xpack-dev-tools/m4

To completely remove the package from the central xPacks store:

xpm uninstall --global @xpack-dev-tools/m4 --verbose

Test

To check if the xpm installed GNU M4 starts, use something like:

$ ~/.local/xPacks/@xpack-dev-tools/m4/1.4.19-2.1/.content/bin/m4 --version
m4 (GNU M4) 1.4.19

Manual install

For all platforms, the xPack GNU M4 binaries are released as portable archives that can be installed in any location.

The archives can be downloaded from the GitHub releases page.

Download

The GNU/Linux versions of xPack GNU M4 are packed as .tar.gz archives. Download the latest version named like:

  • xpack-m4-1.4.19-2-linux-x64.tar.gz

As the name implies, these are GNU/Linux tar.gz archives; they were build on Ubuntu, but can be executed on most recent GNU/Linux distributions.

Unpack

To manually install the xPack GNU M4, unpack the archive and move it to ~/.local/xPacks/m4/xpack-m4-1.4.19-2:

mkdir -p ~/.local/xPacks/m4
cd ~/.local/xPacks/m4

tar xvf ~/Downloads/xpack-m4-1.4.19-2-linux-x64.tar.gz
chmod -R -w xpack-m4-1.4.19-2
$ tree -L 2 '/home/ilg/.local/xPacks/m4/xpack-m4-1.4.19-2'
/home/ilg/.local/xPacks/m4/xpack-m4-1.4.19-2/
├── README.md
├── bin
│   ├── gm4 -> m4
│   └── m4
├── distro-info
│   ├── CHANGELOG.md
│   ├── licenses
│   └── scripts
├── libexec
│   ├── libiconv.so.2 -> libiconv.so.2.6.1
│   └── libiconv.so.2.6.1
└── share
    └── info

7 directories, 6 files

Test

To check if the manually installed GNU M4 starts, use something like:

$ ~/.local/xPacks/m4/xpack-m4-1.4.19-2/bin/m4 --version
m4 (GNU M4) 1.4.19