Compilation of m4 1.4.10 to 1.4.18 fails due to "Please port gnulib freadahead.c to your platform!" on Ubuntu 18.10

Solution 1:

Try applying this patch. It is an OpenEmbedded-generated backport of upstream patch.

Solution 2:

If you want to build m4 from source then start by getting its build dependencies from the repository:

  1. enable Source code in the Software & Updates (software-properties-gtk)
  2. install needed build tools

    sudo apt-get install build-essential
    
  3. get necessary build dependencies for current m4 binary package

    sudo apt-get build-dep m4
    
  4. get source code of the current m4 binary package (with all needed patches provided by Debian and/or Ubuntu):

    apt-get source m4
    cd m4-*
    
  5. then compile it as usual