如何在Linux下编译Freetype1.x

由于在PHP程序中用了jpgraph,需要TTF支持。需要安装freetype1.x。

编译freetype1.3.1的时候不能编译通过.其错误如下.
ftdump.c:172:1: pasting "." and "glyph_object" does not give a valid preprocessing token
ftdump.c:182:1: pasting "." and "first_instance" does not give a valid preprocessing token
ftdump.c:191:1: pasting "." and "second_instance" does not give a valid preprocessing token
ftdump.c:201:1: pasting "." and "face_object" does not give a valid preprocessing token
ftdump.c:202:1: pasting "." and "glyph_object" does not give a valid preprocessing token
ftdump.c:203:1: pasting "." and "second_instance" does not give a valid preprocessing token
ftdump.c:863:1: pasting "." and "initial_overhead" does not give a valid preprocessing token
ftdump.c:882:1: pasting "." and "face_object" does not give a valid preprocessing token
make[1]: *** [ftdump.o] Error 1
make[1]: Leaving directory `/software/freetype-1.3.1/test'
make: *** [tttest] Error 2

在freetype网站上看了文档 http://freetype.sourceforge.net/freetype1/docs/faq/freetype1.txt,应该是测试程序在Linux平台不能编译吧。

修改Makefile.in:
1. 去掉all: ttlib tttest ttpo中的tttest
2. 删除
install:
        cd $(FTLIBDIR); $(MAKE) -f $(MAKEFILE) uninstall
        cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) uninstall
        cd $(FTPODIR); $(MAKE) uninstall
中的 cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) uninstall


# ./configure --prefix=/Data/apps/freetype1
# make
# make install

  最后提醒一下,如果以前在PHP中编译了GD,一定要加入--with-freetype重新编译GD,否则在PHP上是不能获得Freetype支持的

你可能感兴趣的:(linux,PHP,object,文档,makefile,ttf)