免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3693 | 回复: 2
打印 上一主题 下一主题

how to building SDK for Window with cygwin [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-08-05 14:39 |只看该作者 |倒序浏览
本帖最后由 bxfqing 于 2011-08-10 17:52 编辑

1.0 INSTALL CYGWIN
First ,install cygwin 1.5, You  can find at this page:
http://cygwin.org/win-9x.html
Don't mind the page title, just grab setup-legacy.exe and it will works just fine
under XP or Vista.
- When installing Cygwin, set Default Text File Type to Unix/binary, not DOS/text.
  This is really important, otherwise you will get errors when trying to
  checkout code using git.
- Packages that you must install or not:
  - Required packages: autoconf, bison, curl, flex, gcc, g++, git, gnupg, make,
                       mingw-zlib, python, zip, unzip.
  - Suggested extra packages: diffutils, emacs, openssh, rsync, vim, wget.
  - Packages that must not be installed: readline.

Attention 1:
安装cygwin要分为两步, a ) install default packages b) install required packages by android
否则,会提示一大堆的错误, e.g.
  1. autoconf.sh exit code -6
  2.                 autoconf2.1.sh exit code -6
  3.                 autoconf2.5.sh exit code -6
  4.                 base-files-mketc.sh exit code -6
  5.                 base-files-profile.sh exit code -6
  6.                 bash.sh exit code -6
  7.                 coreutils.sh exit code -6
  8.                 cygwin-doc.sh exit code -6
复制代码
就算增量的安装,也会提示一个错误: autoconf2.5.sh exit code -6,or autoconf2.5.sh exit code 1
目前我未发现对下载,编译有影响;
Attention 2:
安装完成后,运行时windows系统会提示:
16位 MS-DOS子系统,cygwin.pif XXX程序文件名无效
解决方法: 第一 确认command.com程序是否存在于你的windows系统中,包括目录:
c:\windows and C:\WINDOWS\system32
如果2个目录都有,还是存在此问题:
把系统盘(Windows XP安装盘)放入光驱,然后启动CMD(开始—运行—输入CMD),
在CMD命令行里输入以下命令(假设你的系统安装在C:下面,光驱为F:)
expand F:\i386\config.nt_ C:\WINDOWS\system32\config.nt
expand F:\i386\autoexec.nt_ C:\WINDOWS\system32\autoexec.nt
expand F:\i386\command.co_ C:\WINDOWS\system32\command.com
expand F:\i386\command.co_ C:\WINDOWS\command.com
我到此,cygwin就可以使用了
2.0 DOWNLOAD ANDROID SOURCE
2.1 如果你的环境存在代理,那么请这样做
$vim  ~/.bash_profile  
adding:
export http_proxy=http://www.XXX.com:80
export https_proxy=https://www.XXX.com:80
export ftp_proxy=ftp://www.XXX.com:80
$source ~/.bash_profile
2.2 由于瓷器国环境,repo 使用git方式,经常失败,所以我使用http方式,试用可正常访问android.git.kernel.org,方法如下:
参考 :http://source.android.com/source/downloading.html
2.2.1 Installing Repo
$curl http://android.git.kernel.org/repo > ~/bin/repo #使用http和https,
$chmod a+x ~/bin/repo
$ vim ~/bin/repo
将 REPO_URL='git://android.git.kernel.org/tools/repo.git'
修改为 REPO_URL='http://android.git.kernel.org/tools/repo.git'

2.2.2 Initializing a Repo client
cd ~/my-android-git
$python ~/bin/repo init -u http://android.git.kernel.org/platform/manifest.git -b android-2.3.4_r1 #使用http
$vim  .repo/mainfest.xml
modify fetch="git://android.git.kernel.org/"
with   fetch="http://android.git.kernel.org/"
python ~/bin/repo sync
漫长的等待... ... ... ...

论坛徽章:
0
2 [报告]
发表于 2011-08-08 13:24 |只看该作者

Question

本帖最后由 bxfqing 于 2011-08-08 13:29 编辑
  1. $ python ~/bin/repo sync
  2. Fetching projects: 100% (165/165), done.
  3.   14851 [main] git 3344 C:\cygwin\bin\git.exe: *** fatal error - could not load
  4. shell32, Win32 error 487
  5. Traceback (most recent call last):
  6.   File "/home/Android/my-android-git/.repo/repo/main.py", line 238, in <module>
  7.     _Main(sys.argv[1:])
  8.   File "/home/Android/my-android-git/.repo/repo/main.py", line 220, in _Main
  9.     repo._Run(argv)
  10.   File "/home/Android/my-android-git/.repo/repo/main.py", line 125, in _Run
  11.     cmd.Execute(copts, cargs)
  12.   File "/home/Android/my-android-git/.repo/repo/subcmds/sync.py", line 417, in E
  13. xecute
  14.     project.Sync_LocalHalf(syncbuf)
  15.   File "/home/Android/my-android-git/.repo/repo/project.py", line 956, in Sync_L
  16. ocalHalf
  17.     self._InitWorkTree()
  18.   File "/home/Android/my-android-git/.repo/repo/project.py", line 1579, in _Init
  19. WorkTree
  20.     raise GitError("cannot initialize work tree")
  21. error.GitError: cannot initialize work tree

  22. Android@android-3d1ddfd ~/my-android-git
复制代码

论坛徽章:
0
3 [报告]
发表于 2011-08-08 13:31 |只看该作者

Other method RE: how to building SDK for Window

I tried, too

On Ubuntu 10.04 (x86_64),

$ repo init -b android-2.3.4_r1
$ repo sync

$ sudo apt-get install mingw32
$ make -j8 PRODUCT-sdk-win_sdk showcommands dist

It worked fine for me.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP