我想为不同的目的构建 cairo,但也遇到了找不到 freetype 库的问题。
首先,cairo'sconfigure
正在打印checking for FREETYPE...
,但它实际上并不是在寻找FREETYPE
或freetype
,它正在寻找freetype2
。
其次,freetype 库有 2 个版本控制系统(一个返回 2.X,另一个返回 9.Y)。
在里面configure
,在第 30659 行附近有一个这样的片段:
# We use pkg-config to look for freetype2, but fall back to
# freetype-config if it fails. We prefer pkg-config, since we can
# then just put freetype2 >= $FREETYPE_MIN_VERSION in
# Requires.private, but at least up to 2003-06-07, there was no
# freetype2.pc in the release.
#
# FreeType versions come in three forms:
# release (such as 2.1.9)
# libtool (such as 9.7.3) (returned by freetype-config and pkg-config)
# platform-specific/soname (such as 6.3.4)
# and they recommend you never use the platform-specific version
# (see docs/VERSION.DLL in freetype2 sources)
#
# Set these as appropriate:
# release number - for information only
FREETYPE_MIN_RELEASE=2.1.9
# libtool-specific version - this is what is checked
FREETYPE_MIN_VERSION=9.7.3
就我而言,pkg-config 使用的是 2.X 版本。将 的值FREETYPE_MIN_VERSION
更改为 的值FREETYPE_MIN_RELEASE
解决了问题。