本文主要描述minigui交叉编译过程:
1.jpeg-7
step1:
./configure --prefix=/home/book/work/toolchain_book/arm/jpeg-7 --host=arm-linux CC=arm-linux-gnueabihf-gcc
step2:
make
step3:
make install
2.freetype
step1:
./configure --prefix=/home/book/work/toolchain_book/arm/freetype --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc –with-zlib=no
step2:
make
step3:
make install
3.harfbuzz
step1:
./configure --prefix=/home/book/work/toolchain_book/arm/harfbuzz --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --with-glib=no --with-freetype=yes PKG_CONFIG_PATH=/home/book/work/toolchain_book/arm/freetype/lib/pkgconfig
step2:
make
step3:
make install
FAQ:
1.添加了—with-freetype=yes,执行configure后报错:
configure: error: FreeType support requested but libfreetype2 not found
解决办法:
添加变量PKG_CONFIG_PATH
4.zlib
step1:
./configure --shared –prefix=/home/book/work/toolchain_book/arm/zlib
step2:
修改Makefile文件 ,在工具链前加上arm-linux-gnueabihf-
step3:
make
step4:
make install
FAQ:
./configure –help
usage:
configure [–shared] [–prefix=PREFIX] [–exec_prefix=EXPREFIX]
[–libdir=LIBDIR] [–includedir=INCLUDEDIR]
Zlib配置是不支持—host项,交叉编译时需要手动更改Makefile,将Makfile里的gcc、ar、ranlib均加上前缀arm-linux-gnueabihf-,再执行make && make install,编译安装成功后在—prefix指定的目录下生成include、shared和lib目录.
5.libpng
step1:
./configure --prefix=/home/book/work/toolchain_book/arm/libpng --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc执行此操作直接报错:configure: error: zlib not installed.继续添加其他变量依然无法解决该问题。
解决办法:
要解决这个问题最重要的是要了解到libpng库是不需要configure的,因为在scripts目录下已经提供makefile,所以没有必要使用configure来创建makefle文件了。
因此把scripts目录下makefile.linux拷贝到源码包根目录中,直接make就可以。但是为了解决找不到zlib库这个问题,所以需要修改这个makefile。
以下是安装libpng的具体步骤:
(1)cp scripts/makefile.linux makefile
(2)vim makefile
(3)makefile中找到zlib相关的两行,修改成实际的zlib/lib和zlib/include,再找到prefix项,修改为你想prefix的目录中,
如果此处是交叉编译的话,还需要在cc那边把gcc修改成您系统的交叉编译器,比如:arm-linux-gcc
(4)保存并且make && make install
6.chipmunk
step1:
cmake -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_INSTALL_PREFIX=/home/book/work/toolchain_book/arm/chipmunk
step2:
make
step3:
make install
如果cmake命令不执行,先下载cmake和cmake-gui,cmake-gui是图形命令
7.libminigui
FAQ:
1.pcxvfb.c: In function ‘PCXVFB_VideoInit’:
/usr/include/bits/select.h:36:5: error: impossible constraint in ‘asm’
asm volatile ("cld; rep; " __FD_ZERO_STOS
^
/usr/include/sys/select.h:93:26: note: in expansion of macro ‘__FD_ZERO’
#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
^
pcxvfb.c:521:13: note: in expansion of macro ‘FD_ZERO’
FD_ZERO(&rset);
^
/usr/include/bits/select.h:36:5: error: impossible constraint in ‘asm’
asm volatile ("cld; rep; " __FD_ZERO_STOS
^
/usr/include/sys/select.h:93:26: note: in expansion of macro ‘__FD_ZERO’
#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
^
pcxvfb.c:539:13: note: in expansion of macro ‘FD_ZERO’
FD_ZERO(&rset);
^
Makefile:386: recipe for target ‘pcxvfb.lo’ failed
make[4]: *** [pcxvfb.lo] Error 1
主要原因是在链接的时候出现了/usr/include路径,
configure: WARNING: unrecognized options: --enable-rtosxvfb, --enable-pcxvfb
查看configure -h,可以找到相对应的功能模块,这些模块是我们移植过程中不需要的,禁用此模块便可以编译通过。(–enable-videortosxvfb –enable-videopcxvfb)
step1:
./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --prefix=/home/book/work/toolchain_book/arm/minigui --with-ft2-includes=/home/book/work/toolchain_book/arm/freetype/include/freetype2 --with-runmode=ths --enable-videoqvfb=no --enable-videortosxvfb=no --enable-videopcxvfb=no --enable-videodri=no
此时出现—with-ft2-includes赋值无效,在configure文件中找到对应的位置发现对该变量赋值为空,删除此行。
arm-linux-gnueabi-gcc编译器编译:
./configure --host=arm-linux-gnueabi CC=arm-linux-gnueabi-gcc --prefix=/home/book/work/toolchain_book/arm-gnueabi/minigui --with-ft2-includes=/home/book/work/toolchain_book/arm-gnueabi/freetype/include/freetype2 --with-hb-includes=/home/book/work/toolchain_book/arm-gnueabi/harfbuzz/include/harfbuzz --with-runmode=ths --enable-videoqvfb=no --enable-videortosxvfb=no --enable-videopcxvfb=no --enable-videodri=no --enable-jpgsupport --enable-pngsupport --enable-consoleial --with-targetname=fbcon LIBS="-lrt -lpthread" DFLAGS="-L/home/book/work/toolchain_book/arm-gnueabi/freetype/lib -L/home/book/work/toolchain_book/arm-gnueabi/harfbuzz/lib -L/home/book/work/toolchain_book/arm-gnueabi/jpeg-7/lib -L/home/book/work/toolchain_book/arm-gnueabi/libpng/lib" CPPFLAGS="-I/home/book/work/toolchain_book/arm-gnueabi/freetype/include/freetype2 -I/home/book/work/toolchain_book/arm-gnueabi/harfbuzz/include -I/home/book/work/toolchain_book/arm-gnueabi/jpeg-7/include -I/home/book/work/toolchain_book/arm-gnueabi/libpng/include"
8.minigui-res
step1:
./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc –prefix=/home/book/work/toolchain_book/arm/minigui-res
step2:
make
step3:
make install
9.libmgplus
FAQ:
Q1:
执行configure命令时报如下错误:
checking whether the C compiler works… no
configure: error: in /home/book/work/minigui/miniGui4.0/miniGui-core/libmgplus-1.4.0': configure: error: C compiler cannot create executables Seeconfig.log’ for more details
原因:CPPFLAGS=/xxx,必须接-I/XXXX
Q2:
In file included from path.h:63:0,
from path.cpp:51:
…/agg/font_freetype/agg_font_freetype.h:49:22: fatal error: ft2build.h: No such file or directory
#include <ft2build.h>
^
compilation terminated.
原因:ft2build.h头文件找不到
CPPFLAGS连接多个头文件的路径时后面的变量值用双引号包含,不可多次使用CPPFLAGS赋值,否则后面的值会覆盖前面的值。
Step1:
./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --prefix=/home/book/work/toolchain_book/arm/mgplus PKG_CONFIG_PATH=/home/book/work/toolchain_book/arm/minigui/lib/pkgconfig CPPFLAGS="-I/home/book/work/toolchain_book/arm/minigui/include/ -I/home/book/work/toolchain_book/arm/freetype/include/freetype2/"
step2:
make
step3:
make install
10.libmgncs
step1:
env LIBS="-lharfbuzzex -lfreetype" CPPFLAGS="-I/home/book/work/toolchain_book/arm/harfbuzz/include -I/home/book/work/toolchain_book/arm/freetype/include -I/home/book/work/toolchain_book/arm/minigui/include" LDFLAGS="-L/home/book/work/toolchain_book/arm/harfbuzz/lib -L/home/book/work/toolchain_book/arm/freetype/lib" ./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --prefix=/home/book/work/toolchain_book/arm/mgutils PKG_CONFIG_PATH=/home/book/work/toolchain_book/arm/minigui/lib/pkgconfig
step2:
make
step3:
make install
FAQ:
checking whether the C compiler works… no
configure: error: in /home/book/work/minigui/miniGui4.0/miniGui-core/libmgutils-1.2.2': configure: error: C compiler cannot create executables Seeconfig.log’ for more details
遇到此问题时,先查看config.log信息。
11.mgncs:
step1:
env LIBS="-lharfbuzzex -lfreetype" CPPFLAGS="-I/home/book/work/toolchain_book/arm/mgutils/include -I/home/book/work/toolchain_book/arm/harfbuzz/include -I/home/book/work/toolchain_book/arm/freetype/include -I/home/book/work/toolchain_book/arm/minigui/include -I/home/book/work/toolchain_book/arm/mgplus/include" LDFLAGS="-L/home/book/work/toolchain_book/arm/harfbuzz/lib -L/home/book/work/toolchain_book/arm/freetype/lib" ./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --prefix=/home/book/work/toolchain_book/arm/mgncs PKG_CONFIG_PATH=/home/book/work/toolchain_book/arm/minigui/lib/pkgconfig:/home/book/work/toolchain_book/arm/mgplus/lib/pkgconfig:/home/book/work/toolchain_book/arm/mgutils/lib/pkgconfig
step2:
make
step3:
make install
12.mgeff
step1:
./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --prefix=/home/book/work/toolchain_book/arm/mgeff PKG_CONFIG_PATH=/home/book/work/toolchain_book/arm/mgplus/lib/pkgconfig:/home/book/work/toolchain_book/arm/mgutils/lib/pkgconfig:/home/book/work/toolchain_book/arm/minigui/lib/pkgconfig CPPFLAGS="-I/home/book/work/toolchain_book/arm/mgutils/include -I/home/book/work/toolchain_book/arm/harfbuzz/include -I/home/book/work/toolchain_book/arm/freetype/include -I/home/book/work/toolchain_book/arm/minigui/include -I/home/book/work/toolchain_book/arm/mgplus/include" LDFLAGS="-L/home/book/work/toolchain_book/arm/harfbuzz/lib -L/home/book/work/toolchain_book/arm/freetype/lib"
step2:
make
step3:
make install
FAQ:
在编译此源码的时候,提示在src/effector/目录下找不到头文件,将libmgeff-1.2.1版本中相应位置的头文件拷贝过来。
13.miniGui3.2.3:
./configure --prefix=/home/book/work/toolchain_book/arm3.2.3/freetype --host=arm-linux CC=arm-linux-gnueabi-gcc LDFLAGS=-L/home/book/work/toolchain_book/arm3.2.3/zlib/lib/ CPPFLAGS=-I/home/book/work/toolchain_book/arm3.2.3/zlib/include/
14.mg-sample
step1:
FAQ:
1.在make时,提示/minigui/lib/libminigui_ths.so: undefined reference to `__hb_extern_get_unicode_funcs’
collect2: error: ld returned 1 exit status
Makefile:779: recipe for target ‘helloworld’ failed
make[2]: *** [helloworld] Error 1
471



被折叠的 条评论
为什么被折叠?



