LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to cross compile Microwindows for ARM arch (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-cross-compile-microwindows-for-arm-arch-4175457532/)

srg_btl 04-09-2013 02:02 PM

How to cross compile Microwindows for ARM arch
 
Hello! Have some problem with cross-compile of Microwindows.
Here are my steps:
0. Download cross-compile toolchain
Code:

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. Download last version (v. 0.92) of Microwindows

Code:

       
cd ~
wget ftp://microwindows.censoft.com/pub/microwindows/microwindows-full-0.92.tar.gz
        tar xvf microwindows-full-0.92.tar.gz

2. Pre-configuration: install next packages:

Code:

       
sudo apt-get install libjpeg-dev libpng-dev python-dev libfreetype6-dev

3. Edit config file for ARM architecture

Code:

cd microwindows-0.92/src
nano config

And edited next lines:
Code:

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

4. Run make

After then I have next messages:
Code:

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

What's wrang? And how I can fix it?

business_kid 04-10-2013 08:53 AM

What's in the cross compile toolchain?

You need arm kernel headers, a libc, and a compiler. The kernel headers are includes in /usr/include. It seems to be reading your x86 ones. Then try

CC=/path/to/arm/compiler
./configure --includedir=/opt/toolchain/include --libdir=/opt/toolchain/lib
(guessing wildly here)
to point the configure at your arm ones. Better getting a guide on this. But you get the idea - the syustem is going to reach for the x86 stuff automatically.

knudfl 04-10-2013 12:22 PM

And :
Quote:

sudo apt-get install libjpeg-dev libpng-dev python-dev libfreetype6-dev
.. those packages cannot be used for arm.

All dependencies for Microwindows must be cross compiled for arm
to e.g. /opt/cross**, before you start the Microwindows build.

-


All times are GMT -5. The time now is 04:37 PM.