首页 > 学院 > 开发设计 > 正文

交叉编译freetype2

2019-11-08 19:52:12
字体:
来源:转载
供稿:网友

FreeType 2被设计为一种占用空间小的、高效的、高度可定制的、并且可以产生可移植的高品质输出(符号图像)。可以被用在诸如图像库、展出服务器、字体转换工具、图像文字产生工具等多种其它产品上。(百度百科)

这里写图片描述 编译器:arm-none-linux-gnueabi-g++

使用系统默认编译器gcc直接编译

$ ./configure --PRefix=$PWD/_INSTALL --without-zlib$ make & make install

直接在当前目录的_INSTALL/生成对应的libfreetype.a以及libfreetype.so;

使用arm-none-linux-gnueabi-g++交叉编译:

$ ./configure CC=arm-none-linux-gnueabi-g++ --host=arm-linux --prefix=$PWD/_INSTALL --without-zlib$ make & make install

其中–without-zlib表示不使用第三库zlib,使用freetype内部的相关函数;

configure结束后出现日志:

configure: creating ./config.statusconfig.status: creating unix-cc.mkconfig.status: creating unix-def.mkconfig.status: creating freetype-configconfig.status: creating freetype2.pcconfig.status: creating ftconfig.hconfig.status: executing libtool commandsmake: Nothing to be done for `unix'.

可以看出脚本为我们创建了其他的脚本文件,如下:

builds/unix/config.statusbuilds/unix/unix-cc.mkbuilds/unix/unix-def.mkbuilds/unix/freetype-configbuilds/unix/freetype2.pcbuilds/unix/ftconfig.h

可以查看配置后的这些文件: unix-cc.mk

......CC := arm-none-linux-gnueabi-g++......

unix-def.mk

......prefix := /home/admin/project/demo/freetype-2.4.10/freetype-2.4.10/_INSTALLexec_prefix := ${prefix}libdir := ${exec_prefix}/libbindir := ${exec_prefix}/binincludedir := ${prefix}/includedatarootdir := ${prefix}/share......

config.status

......host='arm-unknown-linux-gnu'......

所以如果没有重新configure修改配置的前提下, 之后的每一次代码修改都可以直接使用make&make install来完成编译工作;

开源库下载地址: https://www.freetype.org/download.html https://sourceforge.net/projects/freetype/files/ https://sourceforge.net/projects/freetype/files/freetype2/

这里写图片描述 这里最新的为2.7.1版本,可以直接下载编译; 或者网速较慢直接使用: http://download.csdn.net/detail/dreamintheworld/9755333


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表