[GRASS-dev] FIXED: Re: compiling GRASS-latest - configure fails with Unable to locate PostgreSQL includes

Denis Ovsienko denis at ovsienko.info
Tue Jun 22 06:32:04 PDT 2021

On Mon, 21 Jun 2021 23:24:40 +0200
Markus Neteler <neteler at osgeo.org> wrote:

> Maybe others here have suggestions how to improve the current
> (message) situation?

As far as I understand it, since GRASS C source includes <ft2build.h>,
it uses FreeType 2. FreeType 2 documentation suggests using pkg-config
to tell where the headers are:

On my system (Ubuntu 18.04) the headers are in /usr/include/freetype2
(and not just):

$ pkg-config --cflags freetype2
-I/usr/include/freetype2 -I/usr/include/libpng16

FWIW, running configure with
--with-freetype-includes=/usr/include/freetype2 was always mandatory and
sufficient for building GRASS on my PC. I didn't always remember this
detail, so some of my builds were slightly more difficult than the

GRASS configure script uses pkg-config, but not for FreeType 2
detection. So it defaults to a hard-coded path,
which is now /usr/include/freetype. It is worth checking how many
distributions put FreeType 2 headers there instead
of /usr/include/freetype2. In other words, this default path might be
well out of date.

In terms of improving this situation (such that GRASS configure "just
works" for most users), the following changes could add to a more
useful error message:

1. Default to /usr/include/freetype2 if that's the most common location
   in supported distributions now.
2. Use pkg-config to detect the necessary FreeType 2 CFLAGS

As a side note, it might be a good time to migrate to a current version
of autoconf (2.69 seems to be a popular choice).

    Denis Ovsienko

More information about the grass-dev mailing list