Compile Bash for Android

1. Get the bash source:

$ wget -c http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz

$ tar zxvf bash-4.1.tar.gz

 

2. Download the ARM Toolkit , e.g. Sourcery G++ Lite 2008q1-126 for ARM GNU /Linux

$ wget -c http://www.codesourcery.com/sgpp/lite/arm/portal/package2549/public/arm-none-linux-gnueabi/arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

note:  using the newest toolchain compile bash-4.1 failed, use this toolchain 4.2.3 compiled ok.

 

 

3. configure the bash

$ cd bash-4.1

$./configure -host=arm-linux --enable-static-link --without-bash-malloc CC=/yourpath/arm-2008q1/bin/arm-none-linux-gnueabi-gcc

 

 

4. compile the bash

$ make

$ arm-none-linux-gnueabi-strip bash

$ file bash

bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.14, stripped

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值