프로그래밍

How to cross-compile BASH for Android

지니아부지 2011. 6. 8. 13:43

http://roycormier.net/2010/11/03/how-to-cross-compile-bash-for-android/

Follow these steps to compile the BASH shell for ARM (Android devices).

If you’re looking for a copy of the BASH binary you can download it HERE

Download the ARM Toolkit (http://www.codesourcery.com/gnu_toolchains/arm/download.html)

Download the Bash Source code (http://ftp.gnu.org/gnu/bash/), I used v 4.1

# export CC=arm-none-linux-gnueabi-gcc
# ./configure –host=arm-linux –enable-static-link –without-bash-malloc

Edit Makefile and add “-static” to CFLAGS

vi Makefile
CFLAGS = -g -O2 -static

Build the source

# make

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



* bs에 bash 을 넣을때 static으로 컴팔하자.

'프로그래밍' 카테고리의 다른 글

구조체 동적 배열  (0) 2011.07.16
동적배열  (0) 2011.07.16
ioremap  (0) 2011.05.09
UML 기초  (0) 2011.05.07
Maximum segment size(MSS)  (0) 2011.05.07