Linux HOWTOs

About | Home | Search


ERROR: Slooooow dooooown... this page load was delayed.

HOWTO: m4
Description: Macro processor
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# GNU m4 1.4.18
# =============
# Slackware 13.37, 14.0: m4 1.4.16
# Slackware 14.1, 14.2: m4 1.4.17

# If the download site used below is busy, try one of these:
# http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/m4/
# http://ftp.gnu.org/gnu/m4/
# ftp://ftp.gnu.org/gnu/m4/

# Get it
cd
test -f installed/m4-1.4.18.tar.xz && mv installed/m4-1.4.18.tar.xz .
test ! -f m4-1.4.18.tar.xz &&
 wget http://ftpmirror.gnu.org/m4/m4-1.4.18.tar.xz

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "228604686ca23f42e48b98930babeb5d217f1899  m4-1.4.18.tar.xz" | \
sha1sum -c

# Verify tarball w/ sha256sum:
# (this also came from my gpg-verified tarball)
echo "f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07  m\
4-1.4.18.tar.xz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 2527436A > /dev/null 2>&1 || gpg --recv-keys 2527436A ) &&
 wget -nc http://ftpmirror.gnu.org/m4/m4-1.4.18.tar.xz.sig &&
  gpg --verify m4-1.4.18.tar.xz.sig && rm m4-1.4.18.tar.xz.sig

# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "m4-*" -exec rm -r {} \;
tar xJvf ~/m4-1.4.18.tar.xz
cd m4-1.4.18
test $UID = 0 && chown -R root:root .

# Configure the build
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man

# Build it
make

# Test the build
make check

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg m4

# Remove files from old versions
rm -f /usr/bin/ansi2knr /usr/man/man1/ansi2knr.1 \
/usr/share/man/man1/ansi2knr.1

# Install the new version
make install

# Become your non-root user again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/m4-*.tar.*
mv m4-1.4.18.tar.xz installed/


# If you ever want to uninstall m4, this should do it:
cd
su
test -d src/m4-* && ( cd src/m4-* ; make uninstall )
rm -f /usr/bin/m4 /usr/info/m4.info /usr/man/man1/m4.1 \
/usr/share/info/m4.info /usr/share/man/man1/m4.1
exit
find ~/src -maxdepth 1 -type d -name "m4-*" -exec rm -r {} \;
rm -f ~/installed/m4-*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>