不使用X11构建Mali驱动程序

时间:2016-03-14 14:53:46

标签: x11 yocto mali

我尝试为没有X11和Wayland支持的bananaPro构建图像。但是我在Mali测试二进制编译期间遇到了以下错误:

make: Leaving directory '/home/yusuf/yocto/poky/bananaProHf/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/sunxi-mali/git-r0/git/include'
make -C test test
make[1]: Entering directory '/home/yusuf/yocto/poky/bananaProHf/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/sunxi-mali/git-r0/git/test'
arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/home/yusuf/yocto/poky/bananaProHf/tmp/sysroots/bananapro -O2 -pipe -g -feliminate-unused-debug-types -I../include -L../../image/usr/lib -o test test.c -lEGL -lGLESv2 -lX11
In file included from ../include/EGL/egl.h:36:0,
from test.c:32:
../include/EGL/eglplatform.h:89:22: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
Makefile:8: recipe for target 'test' failed

当我查看0001-fix-test-build.patch文件时,我看到以下行

test: ../config.mk test.c

    -$(CC) $(CFLAGS) -o $@ test.c -lEGL -lGLESv2
    +$(CC) $(CFLAGS) -I../include -L../../image/usr/lib -o $@ test.c -lEGL -lGLESv2 -lX11

由于图像不支持X11,我认为不应该包含X11库。那不是真的吗? 我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

在Yocto中,要在没有X11和Wayland的情况下构建图像,您所要做的就是:

DISTRO_FEATURES_remove = " x11 wayland "

这将忽略所有x11和wayland组件。

编辑: 您正在使用的Sunxi Mali Recipe需要X11来编译

PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
                  ${@base_contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
PACKAGECONFIG[wayland] = "EGL_TYPE=framebuffer,,,"
PACKAGECONFIG[x11] = "EGL_TYPE=x11,,virtual/libx11 libxau libxdmcp libdri2,"

解决此问题的一种方法是使用X11和Wayland编译mali,然后将所有组件移动到帧缓冲系统。

需要移动的组件包括:

${S}/include/EGL/*.h ${D}${includedir}/EGL/
#In the recipe, this is in do_install, 
#what it does it move the file from ${S}/include/EGL/*.h to ${D}${incluedir}/EGL/

${S}/include/GLES/*.h ${D}${includedir}/GLES/
${S}/include/GLES2/*.h ${D}${includedir}/GLES2/
${S}/include/KHR/*.h ${D}${includedir}/KHR/
${S}/egl.pc ${D}${libdir}/pkgconfig/
${S}/gles_cm.pc ${D}${libdir}/pkgconfig/
${S}/glesv2.pc ${D}${libdir}/pkgconfig/

mv ${D}${libdir}/libMali.so ${D}${libdir}/libMali.so.3
    ln -sf libMali.so.3 ${D}${libdir}/libMali.so
for flib in libEGL.so.1.4 libGLESv1_CM.so.1.1 libGLESv2.so.2.0 ; do
        rm ${D}${libdir}/$flib
        ln -sf libMali.so.3 ${D}${libdir}/$flib
    done

${S}/test/test ${D}${bindir}/sunximali-test