Compiling LESS Pager – Step-by-Step Guide

compilingless

I would like to compile less with latest fixes.

I do this:

git clone https://github.com/gwsw/less
cd less/
autoheader
autoconf
./configure
make

But make says this:

make: *** No rule to make target 'funcs.h', needed by 'main.o'. Stop.

There are no Makefile rules that create funcs.h

So, how to compile less from source?

Best Answer

Here's the method I just successfully used on Ubuntu 18.04:

  • git clone https://github.com/gwsw/less.git
  • cd less
  • autoreconf -i # install the autoconf package if you haven't already
  • make -f Makefile.aut dist

This creates a directory release/less-550 containing less-550.tar.gz and less-550.zip. It also attempts to create a gpg signature for less-550.tar.gz. That hung on my system, so I killed the gpg --detach-sign ... process from another window. You could also just kill the make process.

less-550.tar.gz is a standard buildable source tarball, which you can install as usual:

  • tar xf less-550.tar.gz
  • cd less-550
  • ./configure --prefix=some-directory other-options
  • make
  • make install

The most interesting options for ./configure are probably:

--with-regex=LIB        select regular expression library
                        (LIB is one of
                         auto,none,gnu,pcre,pcre2,posix,
                         regcmp,re_comp,regcomp,regcomp-local) [auto]
--with-editor=PROGRAM   use PROGRAM as the default editor [vi]

Run ./configure --help for a full list of options.

Related Question