# Get it
cd
test -f installed/m4-1.4.19.tar.xz && mv installed/m4-1.4.19.tar.xz .
test ! -f m4-1.4.19.tar.xz &&
wget http://ftpmirror.gnu.org/m4/m4-1.4.19.tar.xz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af\
96 m4-1.4.19.tar.xz" | sha256sum -c
# 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.19.tar.xz
cd m4-1.4.19
test $UID = 0 && chown -R root:root .
# If you will only be using m4 in English and want to save the extra spaces
# usued by translations, add --disable-nls
# 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 that still have ansi2knr
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.19.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 )
find /usr/share/locale/*/LC_MESSAGES/ -type f -name m4.mo -exec rm {} \;
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.*