在MiniGUI官网提供了编译方法:http://www.minigui.com/blog/quick-start
编译5.0和4.0的方法类似,这两个版本的下载链接分别是https://github.com/VincentWei/build-minigui-5.0和https://github.com/VincentWei/build-minigui-4.0,下面以编译4.0为例。
交叉编译工具链:arm-linux-gnueabihf-gcc 7.3
下载:
$ git clone https://github.com/VincentWei/build-minigui-4.0.git $ cd build-minigui-4.0
执行 ./fetch-all.sh,下载软件包
编译两个会用到的工具bin2c和upf2c:
$ cd mg-tools/tools $ gcc bin2c.c -o bin2c $ sudo cp bin2c /usr/local/bin $ cd mg-tools/font-tools $ gcc upf2c.c -o upf2c $ sudo cp upf2c /usr/local/bin
然后进入cross-build/arm-r16-linux/,这里提供了一个交叉编译MiniGUI的参考,不过编译的是时候会有一些问题。
diff --git a/cross-build/arm-r16-linux/modify-this-config.sh b/cross-build/arm-r16-linux/modify-this-config.sh index 698bc6f..c5e0a08 100644 --- a/cross-build/arm-r16-linux/modify-this-config.sh +++ b/cross-build/arm-r16-linux/modify-this-config.sh @@ -3,7 +3,7 @@ # You must set TINA_DIR for r16 tina dirctory. # It is the ONLY line you have to modify in the whole compiling process. -TINA_DIR=/home/projects/r16/tinav2.5 +TINA_DIR=${PWD}/build
下面开始编译:
然后为rootfs/usr/local/lib/libharfbuzzex.so.0.20501.0建立一个软连接,因为在编译minigui时会检测libharfbuzz.so
ln -sf libharfbuzzex.so.0.20501.0 libharfbuzz.so
3rd-party/udev-182/src/sd-daemon.c:394: undefined reference to `mq_getattr‘
修改build-all.sh,编译udev时为LDFLAGS增加参数"-lrt"
freetype2.h:65:10: fatal error: ft2build.h: No such file or directory #include <ft2build.h>
修改build-all.sh,编译minigui时增加-I$WORK_DIR/rootfs/usr/local/include/freetype2
harzbuff-minigui-funcs.c:66:10: fatal error: hb.h: No such file or directory #include <hb.h>
修改build-all.sh,编译minigui时增加-I$WORK_DIR/rootfs/usr/local/include/harfbuzz
grep: /usr/lib/arm-linux-gnueabihf/libfreetype.la: No such file or directory sed: can‘t read /usr/lib/arm-linux-gnueabihf/libfreetype.la: No such file or directory
删除rm rootfs/usr/local/lib/libharfbuzzex.la
/lib/libminigui_ths.so: undefined reference to `dlsym‘ /lib/libminigui_ths.so: undefined reference to `dlerror‘ /lib/libminigui_ths.so: undefined reference to `dlopen‘ /lib/libminigui_ths.so: undefined reference to `dlclose‘
重新编译minigui,增加编译参数"-ldl",然后make clean,重新执行build-all.sh
上面默认编译的MiniGUI是线程模式,下面编译process模式,修改build-all.sh,修改minigui的编译参数“--with-runmode=procs”,然后将“-lminigui_ths”改为“-lminigui_procs”。编译:
drmvideo.c:2054:18: error: format ‘%lu‘ expects argument of type ‘long unsigned int‘, but argument 6 has type ‘size_t {aka unsigned int}‘ [-Werror=format=]
修改minigui的编译参数,增加:-Wno-error=format=
下面是交叉编译minigui的压缩包的下载链接:
链接: https://pan.baidu.com/s/1JjN3QEr0njw-UWmXdeHF6Q 提取码: 215s
完。
原文:https://www.cnblogs.com/pengdonglin137/p/13056578.html