Moxa Technologies W341 Manual De Usuario

Descargar
Página de 104
ThinkCore W311/321/341 Linux User’s Manual 
Tool Chains for Application Development
 
 
5-2
Linux Tool Chain 
The Linux tool chain contains a suite of cross compilers and other tools, as well as the libraries 
and header files that are necessary to compile your applications. These tool chain components 
must be installed in your host computer (PC) running Linux. We have confirmed that the 
following Linux distributions can be used to install the tool chain. 
Fefora core 1 & 2. 
Steps for Installing the Linux Tool Chain 
The tool chain needs about 485 MB of hard disk space. To install it, follow the steps.   
1.  Insert the package CD into your PC and then issue the following commands: 
#mount /dev/cdrom /mnt/cdrom 
#sh /mnt/cdrom/tool-chain/linux/install.sh 
2.  Wait for the installation process to complete. This should take a few minutes. 
3.  Add the directory /usr/local/arm-linux/bin to your path. You can do this for the current login 
by issuing the following commands: 
#export PATH=“/usr/local/arm-linux/bin:$PATH” 
Alternatively, you can add the same commands to $HOME/.bash_profile to make it 
effective for all login sessions. 
Compilation for Applications 
To compile a simple C application, use the cross compiler instead of the regular compiler: 
#arm-linux-gcc  –o example –Wall –g –O2 example.c 
#arm-linux-strip  –s  example 
#arm-linux-gcc  -ggdb  –o  example-debug  example.c 
Most of the cross compiler tools are the same as their native compiler counterparts, but with an 
additional prefix that specifies the target system. In the case of x86 environments, the prefix is 
i386-linux-
 and in the case of IA204/241 ARM boards, it is arm-linux-
For example, the native C compiler is gcc and the cross C compiler for ARM in the 
W311/321/341 is arm-linux-gcc.