[GRASS-git] [OSGeo/grass] 702009: Use pkg-config for FreeType 2. (#1719)

Denis Ovsienko noreply at github.com
Mon Sep 6 08:58:32 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 7020091c85e307ecf77224a5e5b3129a45b0950a
      https://github.com/OSGeo/grass/commit/7020091c85e307ecf77224a5e5b3129a45b0950a
  Author: Denis Ovsienko <denis at ovsienko.info>
  Date:   2021-09-06 (Mon, 06 Sep 2021)

  Changed paths:
    M configure
    M configure.in

  Log Message:
  -----------
  Use pkg-config for FreeType 2. (#1719)

In package-based Linux distributions FreeType 2 headers tend to be in
/usr/include/freetype2; in particular, "pkg-config --cflags freetype2"
returns at least /usr/include/freetype2 in the list of directories on
Debian 10, Fedora 34, openSUSE 15.3 and Ubuntu 18.04/20.04. In the
FreeBSD port they are in /usr/local/include/freetype2 and in the NetBSD
pkgsrc package they are in /usr/pkg/include/freetype2. pkg-config is the
established means of managing this compexity for both the compiler and
the linker flags.

GRASS has been using both FreeType 2 and pkg-config, but not the two
together, and its default FreeType 2 include directory has been set to
/usr/include/freetype, which belongs to FreeType 1. This way, the
configure script always required the --with-freetype-includes=...
argument.

Fix the script to handle FreeType 2 the same way it handles Cairo: allow
to override the defaults if required, but default to the flags provided
by pkg-config so things usually just work:

$ ./configure
[...]
checking whether to use FreeType... yes
checking for location of FreeType includes...
checking for ft2build.h... yes
checking for location of FreeType library...
checking for FT_Init_FreeType in -lfreetype... yes
[...]

As a side effect, restore the stdlib.h/exit() declarations test block,
which was lost in commit f752840 (Ubuntu 20.04 autoreconf 2.13 does not
generate it, but openSUSE 15.3 autoreconf 2.13 does).




More information about the grass-commit mailing list