ubuntu 9.04下ndk安装问题
转载时请注明出处和作者联系方式
文章出处:http://blog.csdn.com/keensword007
作者联系方式:琴剑 <keensword007 at sina dot com>
从android网站下载ndk-1.6后,执行设置脚本后,出现如下错误:
chenzhengyong@chenzhengyong-laptop:~/workspace/android/android-ndk-1.6_r1$ ./build/host-setup.sh
Checking host development environment.
NDK Root : /home/chenzhengyong/workspace/android/android-ndk-1.6_r1
GNU Make : make (version 3.81)
[: 205: Pass: unexpected operator
[: 205: Pass: unexpected operator
[: 205: Pass: unexpected operator
ERROR: Could not find a valid Nawk or Gawk executable.
Please ensure that either one of them is installed.
Use the --no-awk-check option to ignore this message.
开始还以为是gawk没有安装,确认gawk已经安装后,执行host-setup.sh脚本,仍然提示以上错误。 借助于互联网,找到了一下解决方法:将host-setup.sh脚本第119行由
if [ "$result" == "Pass" ] ; then
改成
if [ "$result" = "Pass" ] ; then
再执行,就不会有问题了。
为什么会出现这种错误呢,翻看了一下bash shell编程资料,=和==应该是等价的。但是我使用的ubuntu 9.04版本/bin/sh却是链到dash,因此另一个解决方法是修改第一行,将
#!/bin/sh
改成
#!/bin/bash
dash全称为Debian Almquist shell,它比bash小得多,速度快,但功能有所缩减。现在大部分脚本都是bash脚本,所以一劳永逸的做法是:
sudo rm /bin/sh
sudo ln -s bash /bin/sh
更多相关文章
- 包管理系统分析
- android error: Apostrophe not preceded 错误解决办法
- Android开发:Android虚拟机启动错误Can't find 'Linux version '
- Unable to locate package错误解决办法以及jdk的切换
- Android为textView设置setText的时候报错
- 使用NDK编译CMU Sphinx
- 【Android】实现非root的 Traceroute -- 非Root权限下移植可执行
- System.EntryPointNotFoundException: Unable to find an entry
- 我的第一个python脚本