Cross-compiling MESA,X11LIB,QT OpenGL

Source: Internet
Author: User

Record the Mesa configuration file as follows:

Mesa version: Mesa-10.2.3

[HTML]View Plaincopy
  1. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/mesa --target=arm-linux --host =arm-linux--enable-gles2--enable-gles1--disable-glx--enable-egl--disable-dri--enable-shared-glapi -- with-egl-platforms=fbdev --with-dri-drivers=swrast
  2. Or
  3. Unset Pkg_config_path
  4. Export Pkg_config_path=/home/work/download/presen/lib/pkgconfig:/home/work/download/libdrm/lib/pkgconfig
  5. cc=/usr/local/arm-4.8.1/bin/arm-none-linux-gnueabi-gcccxx=/usr/local/arm-4.8.1/bin/arm-none-linux-gnueabi-g++./configure--target=arm-linux --host=< Span class= "Attribute-value" >arm-linux --prefix=/home/work/download/mesa-10.0  --enable-gl --enable-gles2 --enable-gles1 --enable-opengl --enable-shared-glapi  --disable-dri --enable-shared-dricore --enable-gles1 --enable-opengl -- Enable-gallium-egl --with-egl-platforms=fbdev  --with-gallium-drivers=swrast  --with-dri-drivers=swrast  Cflags= "-i/home/work/download/libudev/include -l/home/work/download/libudev /lib/arm-linux-gnueabi "&NBSP;&NBSP;
  6. Make &&make Install

QT configuration:

[HTML]View Plaincopy
  1. ./configure -prefix /usr/local/qt-5.2.1-embedded-arm-quick -release -opensource - Qt-libpng -qt-libjpeg -plugin-sql-sqlite -widgets -qt-sql-sqlite -make libs  -no-cups -no-nis -no-iconv -no-dbus -no-openssl -no-iconv - no-accessibility -no-javascript-jit -no-sse2 -silent -xplatform   linux-arm-gnueabi-g++  -nomake tools -nomake examples -nomake tests - qt-freetype -opengl es2  -qreal float -no-glib -strip -xinput2 - linuxfb -plugindir /usr/local/qt-5.2.1-embedded-arm-quick/plugin -qmldir /usr/local/ qt-5.2.1-embedded-arm-quick/qml -importdir /usr/local/qt-5.2.1-embedded-arm-quick/imports   -L/home/work/DownLoad/Mesa/lib -I/home/work/DownLoad/Mesa/include -confirm-license  "[ Email protected] " -verbose  
  2. Make && make install
  3. qmake.conf need to join : Qmake_libs_opengl_es2 =-lglapi-lglesv2-legl
  4. This is because libglesv2.so relies on libglapi.so, and you can use ARM-NONE-LINUX-GNUEABI-LD to view the dependencies of the relational library. Mesa Cross-Compile if there is no--ENABLE-SHARED-GLAPI, the following error will be reported:
  5. libGLESv2.so:undefined reference to ' _glapi_get_dispatch '
  6. libGLESv2.so:undefined reference to ' _glapi_dispatch '


Xlib All source code:

[HTML]View Plaincopy
    1. http://cgit.freedesktop.org/xorg/

http://cgit.freedesktop.org/xorg/

Ubuntu command line bulk Download: Wget-r-np-nd ftp://mirrors.go-part.com/xorg/X11R7.7/


The configuration of the logging libx11-1.3.2 is as follows:

[HTML]View Plaincopy
    1. echo enable_malloc0returnsnull=Yes>arm-linux.cache

This sentence is to ensure that you can cross-compile, or cross-compile when the test is not too, will report the following error:

Checking whether malloc (0) returns NULL ... configure:error:in '/home/work/download/libx11-1.3.2 ':
Configure:error:cannot Run test program while the cross compiling

This is because Xlib is forbidden to cross-compile when using--host=arm-linux. Workaround for the sentence from Congfirue to find the error, look at the script with +set, for example in this case:

[HTML]View Plaincopy
  1. Vim Configure
  2. Find checking whether malloc (0) returns Null ... This sentence, get the following information
  3. # Check whether--enable-malloc0returnsnull was given.
  4. if test "${enable_malloc0returnsnull+set}" = set; Then
  5. enableval= $enable _malloc0returnsnull; malloc_zero_returns_null= $enableval
  6. Else
  7. malloc_zero_returns_null=Auto
  8. Fi
  9. {$as _echo "$as _me: $LINENO: Checking whether malloc (0) returns NULL" >&5
  10. $as _echo_n "<span style=" color: #FF0000; " >checking whether malloc (0) returns NULL ... " >&6;}
  11. if test "x$malloc_zero_returns_null" = Xauto; Then
  12. if test "$cross _compiling" = yes; Then
  13. {{$as _echo $as _me: $LINENO: error:in \ ' $ac _pwd ': " >&5
  14. $as _echo "$as _me:error:in \ ' $ac _pwd ':" >&2;}
  15. {{$as _echo $as _me: $LINENO: Error:cannot Run test program, while cross compiling
  16. See \ ' Config.log ' for more details. " >&5
  17. $as _echo "$as _me:error:cannot Run test program while the cross compiling
  18. See \ ' Config.log ' for more details. "  >&2;}


Because he is in the if test "${enable_malloc0returnsnull+set}" = set;

  1. Make clean && make Distclean
  2. RM-RF Arm-linux.cache
  3. echo enable_malloc0returnsnull=Yes>arm-linux.cache
  4. cc=/usr/local/arm-4.8.1/bin/arm-none-linux-gnueabi-gcccxx=/usr/local/arm-4.8.1/bin/arm-none-linux-gnueabi-g++ ./configure --prefix=/home/work/download/libx11/ --disable-xf86bigfont  --host=arm-linux --target=< Span class= "Attribute-value" >arm-linux  cflags= "-i/home/work/download/libx11/include -i/home/work/download/libx11/libxcb/include -l/home/work/ Download/libx11/lib -l/home/work/download/libx11/libxcb/lib " --includedir=/ Home/work/download/libx11/include xproto_libs=/home/work/download/libx11/lib  --cache-file=ARM-LINUX.CACHE&NBSP;&NBSP;
  5. Make && make install
[HTML]View Plaincopy
    1. cflags="-i/home/work/download/libx11/include-l/home/work/download/libx11/lib", this sentence formulates the path of Xporto, Because of the need to use the x.h in Xproto

Cross-compiling X11 requires cross-compiling Xproto (version xproto-7.0.17):

Xporto:

[HTML]View Plaincopy
    1. http://cgit.freedesktop.org/xorg/proto/xproto/
    2. Configxproto.sh as follows:
[HTML]View Plaincopy
    1. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/ --host=arm-linux -- target=arm-linux
    2. Make && make install

Due to the need to use Xtrans.h, it is necessary to download Xtrans, as:

[HTML]View Plaincopy
    1. http://www.x.org/releases/X11R7.5/src/lib/

The version I have selected is: xtrans-1.2.5

Cross-compiling and similar above

[HTML]View Plaincopy
    1. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/ --host=arm-linux -- target=arm-linux --cache-file=arm-linux.cache
    2. Make && make install

Because of the error xkb.c:36:37:fatal error:x11/extensions/xkbproto.h:no such file or directory, you need to use kbproto-1.0.6

kbproto-1.0.6:

[HTML]View Plaincopy
    1. http://cgit.freedesktop.org/xorg/proto/kbproto/

kbproto-1.0.6 cross-compiling is similar to the above:

[HTML]View Plaincopy
    1. Make clean && make Distclean
    2. RM-RF Configure
    3. ./autogen.sh
    4. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/kbproto --host=arm-linux --target=arm-linux
    5. Make && make install


Need XI.h, need to download inputproto-2.1.99.6, for:

[HTML]View Plaincopy
    1. http://cgit.freedesktop.org/xorg/proto/inputproto/

iputProto-2.1.99.6 cross-compiling and similar above

[HTML]View Plaincopy
    1. Make clean && make Distclean
    2. RM-RF Configure
    3. ./autogen.sh
    4. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/inputporto/ --host= Arm-linux --target=arm-linux

Error:.. /include/x11/xlib-xcb.h:7:21:fatal error:xcb/xcb.h:no such file or directory
Need to download LIBXCB,

[HTML]View Plaincopy
    1. http://xcb.freedesktop.org/dist/

libxcb-1.8.1 cross-compile as follows:

[HTML]View Plaincopy
  1. Export pkg_config_path=/home/work/download/libx11/xcbproto/lib/pkgconfig
  2. Make clean && make Distclean
  3. RM-RF Arm-linux.cache
  4. echo ac_cv_path_xsltproc=/home/work/download/libx11/libxslt/bin > Arm-linux.cache
  5. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/libxcb/ CFLAGS="-I/home/ work/download/libx11/libxslt/include-i/home/work/download/libx11/libxau/include-i/home/work/download/libx11/ Include-l/home/work/download/libx11/libxslt/lib-l/home/work/download/libx11/libxau/lib " --host= Arm-linux --target=arm-linux --cache-file=arm-linux.cache
  6. Error message: Configure:error:XCB requires Xsltproc

Download Xsltproc,:

[HTML]View Plaincopy
  1. https://git.gnome.org/browse/libxslt/
  2. <pre name= "code"  class= "html" span class= "tag" >>cc=/usr/local/arm-4.8.1/bin/arm-none-linux-gnueabi-gcc cxx=/usr/local/arm-4.8.1/bin/arm-none-linux-gnueabi-g++ ./configure  --with-libxml-libs-prefix=/home/work/download/libx11/libxml2/lib  --with-libxml-include-prefix=/home/work/download/libx11/include/libxml2/libxml/ < span class= "attribute" >--prefix=/home/work/download/libx11/libxslt/ --host=arm-linux --target= arm-linux  


If you have cross-compiled and you have specified the path to LIBXML2, but you still cannot find the LIBXML2, you can manually indicate the path to the XML in Congfigure
libxml_config_prefix= "/HOME/WORK/DOWNLOAD/LIBX11/LIBXML2"
Xsltproc need to download libxml,:

[HTML]View Plaincopy
  1. ftp://xmlsoft.org/libxml2/
  2. Cross-compiling and similar above
  3. XCB needs xcb-proto,:http://xcb.freedesktop.org/dist/.
  4. xcb-proto-1.7 cross-compile as follows:
  5. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/xcbproto/ --host=arm-linux --target=arm-linux
  6. Make && make install
  7. XCB needs libxau,:http://cgit.freedesktop.org/xorg/lib/libxau/.
  8. libXau-1.0.7 Cross-compiling:
  9. Make clean && make Distclean
  10. RM-RF Configure
  11. ./autogen.sh
  12. CC=/USR/LOCAL/ARM-4.8.1/BIN/ARM-NONE-LINUX-GNUEABI-GCC cxx=/usr/local/arm-4.8.1/bin/ arm-none-linux-gnueabi-g++./configure --prefix=/home/work/download/libx11/libxau/ --host=arm-linux --target=arm-linux cflags="-i/home/work/download/libx11/include"
  13. Make && make instal


Appendix once the successful cross-compilation of Lib library, for later download use:

http://download.csdn.net/detail/mkndg/7738667

Cross-compiling MESA,X11LIB,QT OpenGL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.