如何交叉编译Microwindows for ARM arch

时间:2013-04-09 19:15:04

标签: arm cross-compiling embedded-linux

Microwindows的交叉编译存在一些问题。 这是我的步骤: 0.下载交叉编译工具链


    wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    sudo mkdir –p /opt/toolchain
    sudo cp arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 /opt/toolchain
    cd /opt/toolchain
    sudo tar –jxvf arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    export PATH=/opt/toolchain/arm-2009q3/bin:$PATH

  1. 下载Microwindows的最新版本(v.0.92)
  2.    
    
        cd ~
        wget ftp://microwindows.censoft.com/pub/microwindows/microwindows-full-0.92.tar.gz
            tar xvf microwindows-full-0.92.tar.gz
    
    
    1. 预配置:安装下一个包:
    2.    
      
          sudo apt-get install libjpeg-dev libpng-dev python-dev libfreetype6-dev
      
      
      1. 编辑ARM体系结构的配置文件
      2. 
            cd microwindows-0.92/src
            nano config 
        
        

        编辑下一行:

        ARCH                     = LINUX-ARM
        ARMTOOLSPREFIX           = arm-none-linux-gnueabi-  
        INCJPEG                  = /usr/include/
        INCPNG                   = /usr/include/
        INCZ                     = /usr/include/
        INCTIFF                  = /usr/include/
        LIBFT2LIB                = /usr/lib/libfreetype.a
        
        1. 运行make
        2. 之后我有下一条消息:

          
              cc1: warning: include location "/usr/include/" is unsafe for cross-compilation
              cc1: warning: include location "/usr/include/freetype2" is unsafe for cross-compilation
              In file included from /home/user/microwindows-0.92/src/include/windows.h:19,
                               from /home/user/microwindows-0.92/src/mwin/winmain.c:44:
              /home/user/microwindows-0.92/src/include/windef.h:131: warning: function declaration isn't a prototype
              /home/user/microwindows-0.92/src/include/windef.h:132: warning: function declaration isn't a prototype
              /home/user/microwindows-0.92/src/include/windef.h:133: warning: function declaration isn't a prototype
              /home/user/microwindows-0.92/src/mwin/winmain.c: In function 'MwSelect':
              /home/user/microwindows-0.92/src/mwin/winmain.c:356: error: impossible constraint in 'asm'
              /home/user/microwindows-0.92/src/mwin/winmain.c:357: error: impossible constraint in 'asm'
              /home/user/microwindows-0.92/src/mwin/winmain.c:358: error: impossible constraint in 'asm'
              make[1]: *** [/home/user/microwindows-0.92/src/obj/mwin/winmain.o] Error 1
              make: *** [subdir-/home/user/microwindows-0.92/src/mwin] Error 2
          
          

          什么是争吵?我该如何解决它?

1 个答案:

答案 0 :(得分:0)

首先,您需要所有依赖库的源代码和CROSS-COMPILE libjpeg-dev libpng-dev python-dev libfreetype6-dev以及其他依赖库。

然后在编译microwindow时,includelibrary的路径必须在交叉编译库所在的Makefile中更新。