woodongwong / notes

4 stars 0 forks source link

FreeType2.9.1 'freetype-config' 是可选的 #25

Open woodongwong opened 5 years ago

woodongwong commented 5 years ago

FreeType从2.9.1开始,安装时freetype-config脚本是可选的,编译时可使用'--enable-freetype-config' 选项来安装freetype-config。

然而,Debian10取消了freetype-config,这使得PHP7.4之前的版本configure时无法找到freetype-config,解决方案有三个:

  1. 单独安装FreeType2.9.1之前的2.x版本
  2. 单独安装FreeType2,添加--enable-freetype-config
  3. 修改PHP的configure脚本或者修改ext/gd/config.m4,可参考我写的不成熟的代码:https://github.com/woodongwong/php-src/commit/43aad225a7a52d32fc3ccf7c3814c70eb48d54fb

还有一点就是:PHP7.4开始,不要使用 --with-freetype-dir=DIR,而是使用--enable-freetype,因为改为依赖pkg-config了。

参考:

  1. https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/ChangeLog?h=VER-2-9-1&id=86bc8a95056c97a810986434a3f268cbe67f2902#n328
  2. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870618
  3. https://www.php.net/manual/en/image.installation.php