免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1220 | 回复: 0

Import marvel compiler to scratchbox [复制链接]

论坛徽章:
0
发表于 2009-12-16 14:47 |显示全部楼层


  Normal
  0
  
  7.8 磅
  0
  2
  
  false
  false
  false
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4



st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:普通表格;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
1.              
Abstract
This document explains how to import a
foreign compiler to scratchbox.

2.              
Introduction
.      for compiling source code to marvle
platform,we must import the marvel compiler to our scrathbox,then I began this
work.
3.              
import step
3.1      
summary
for I donot want to pollute my previous scratchbox
environment,then I create a new environment named SDK_MARVEL,if you do not know
how please see doc——How to setup empty scratchbox.doc.
3.2      
get
foreign compiler.
Extract the prebuilt toolchain to your COMPILER_DIR:eg.
/scratchbox/compilers/ arm-linux-4.1.1 .
The COMPILER_DIR should probably now have subdirectories like bin,your-arch-name and lib.
For  the alien wrapper to work, you must have
Scratchbox version 1.0.3 or newer
(Apophis branch) and the compiler must work when invoked directly, eg.
       /scratchbox/compilers/ arm-linux-4.1.1/bin/arm-linux-gcc –version
3.3      
get the
sb-toolchain-extras
you should login
you to your object platform,eg,SDK_MARVEL for me,by invoke
/some/directory/scratchbox/login
sb-conf select SDK_MARVEL
       then go
to a directory that you have write privilege,eg,/scratchbox/output,invoke:
              
darcs get
--set-scripts-executable
http://scratchbox.org/repos/1.0/sb-toolchain-extras

(here the time
decided by your network and your rp);

3.4      
create
your configure file.
Ofcourse you can
write you own configure ,contains compiler related info and target platform
characteristic,but you can use a simple script to help you to do this.
Go to the
directory of you cool compiler ,eg /scratchbox/compiler/ arm-linux-4.1.1
Run
the helper script:
~/sb-toolchain-extras/confhelper/create_toolchain_conf.py >
~/sb-toolchain-extras/meta/alien-tc/arm-marvel.conf
(here ~ show that the sb-toolchain-extras is put to there)
You can edit
that to fit for you.
3.5      
Build the
sb-toolchain-extras tools.
Go to the directory
of sb-toolchain-extras,then invoke :
make
CONFIG=meta/alien-tc/arm-marvel.conf -C meta/alien-tc
all-sums(the time decided by your
network and your rp)
make CONFIG=meta/alien-tc/yourconfig.conf -C
meta/alien-tc
(here
you can meet some errors just ignored it)


3.6      
Run
sb-menu to setup compiler.
Run sb-menu —>setup->SDK_MARMEL->arm-linux-4.1.1,then
choose doctools,debian-etch,cputransp,perl,maemo3-tools,then choose a qemu,you
can choose the qemu-arm-0.8.2-sb2,then ignore the rootstrap then choose install
the files,after this,you can run gcc –v here you will see your new cool
compiler has been install in the scratchbox.

4.              
test helloworld.
You can write a helloworld program to test the
gcc.the code can be like this:
int main(int argc,char **argv)
{
  Printf(“Hello
cruel world\n”);
  Return 0;
}
Run gcc helloworld.c –o helloworld
If you qemu support the new compiler ,you can run
the helloworld in the local machine,like this:
./helloworld
Or else you must copy your program to the object
platform
If you  see
the output:
Hello cruel world
Then you succeed!

5.              
reference
[1]. How to setup empty scratchbox.doc.
[2].
http://www.scratchbox.org/wiki/ForeignToolchains
[3]. http://www.scratchbox.org/wiki/Toolchains

               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/67984/showart_2122871.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP