Thanks to Google I’ve just found searching in many Forum threads the way to build adb on ARM arch.
Just download sources with git (apt-get install git-core on debian-like system):

$ git clone git://android.git.kernel.org/platform/system/core.git system/core
$ git clone git://android.git.kernel.org/platform/build.git build
$ git clone git://android.git.kernel.org/platform/external/zlib.git external/zlib
$ git clone git://android.git.kernel.org/platform/bionic.git bionic
or you can go into Android source code and find the directory /system/core/adb/
Now edit build/core/main.mk and comment out the parts labelled
# Check for the correct version of java
and
# Check for the correct version of javac
Since adb doesn’t need Java, these checks are unnecessary.
Also edit build/target/product/sdk.mk and comment out the “include” lines after
# include available languages for TTS in the system image
This avoids having to download language files that aren’t needed for adb.

Save this Makefile as system/core/adb/Makefile: https://gist.github.com/958335
Then just run:
cd system/core/adb; make

Then you can copy and use your adb binary.
That’s all! If you have any problems search your distro’s packages repository to install needed packages!
:-)
Makefile:
SRCS+= utils.c


VPATH+= ../libcutils
SRCS+= abort_socket.c
SRCS+= socket_inaddr_any_server.c
SRCS+= socket_local_client.c
SRCS+= socket_local_server.c
SRCS+= socket_loopback_client.c
SRCS+= socket_loopback_server.c
SRCS+= socket_network_client.c


VPATH+= ../libzipfile
SRCS+= centraldir.c
SRCS+= zipfile.c


VPATH+= ../../../external/zlib
SRCS+= adler32.c
SRCS+= compress.c
SRCS+= crc32.c
SRCS+= deflate.c
SRCS+= infback.c
SRCS+= inffast.c
SRCS+= inflate.c
SRCS+= inftrees.c
SRCS+= trees.c
SRCS+= uncompr.c
SRCS+= zutil.c


CPPFLAGS+= -DADB_HOST=1
CPPFLAGS+= -DHAVE_FORKEXEC=1
CPPFLAGS+= -DHAVE_SYMLINKS
CPPFLAGS+= -DHAVE_TERMIO_H
CPPFLAGS+= -D_GNU_SOURCE
CPPFLAGS+= -D_XOPEN_SOURCE
CPPFLAGS+= -I.
CPPFLAGS+= -I../include
CPPFLAGS+= -I../../../external/zlib


CFLAGS+= -O2 -g -Wall -Wno-unused-parameter
LDFLAGS= -static
LIBS= -lrt -lpthread


TOOLCHAIN= arm-none-linux-gnueabi-
CC= $(TOOLCHAIN)gcc
LD= $(TOOLCHAIN)gcc


OBJS= $(SRCS:.c=.o)


all: adb


adb: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)


clean:
rm -rf $(OBJS)
http://blog.csdn.net/dssxk/article/details/7263351 ============================================================================================================================================================

pseudolocalize.cpp is not needed for adb. And NDK toolchain is intended to build with bionic(Android libc). adb requires glibc(GNU libc) to build.

I created a Makefile to compile adb for Linux/ARM. This Makefile makes statically linked adb executable binary for Linux/ARM, thus it works on Android/ARM as well.

  • standalone Makefile for adb

How to make.

  1. Install Sourcery G++ Lite for ARM and GNU Make.
  2. Download "Android source code".
  3. Save Makefile as system/core/adb/Makefile.
  4. cd system/core/adb; make.
Makefile # embed raw
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
                                                                            SRCS                                        += adb.c                                                                                                                SRCS+                                        = adb_client.c                                                                                                                SRCS+                                        = commandline.c                                                                                                                SRCS+                                        = console.c                                                                                                                SRCS+                                        = file_sync_client.c                                                                                                                SRCS+                                        = fdevent.c                                                                                                                SRCS+                                        = get_my_path_linux.c                                                                                                                SRCS+                                        = services.c                                                                                                                SRCS+                                        = sockets.c                                                                                                                SRCS+                                        = transport.c                                                                                                                SRCS+                                        = transport_local.c                                                                                                                SRCS+                                        = transport_usb.c                                                                                                                SRCS+                                        = usb_linux.c                                                                                                                SRCS+                                        = usb_vendors.c                                                                                                                SRCS+                                        = utils.c                                                                                                                                                                                        VPATH+                                        = ../libcutils                                                                                                                SRCS+                                        = abort_socket.c                                                                                                                SRCS+                                        = socket_inaddr_any_server.c                                                                                                                SRCS+                                        = socket_local_client.c                                                                                                                SRCS+                                        = socket_local_server.c                                                                                                                SRCS+                                        = socket_loopback_client.c                                                                                                                SRCS+                                        = socket_loopback_server.c                                                                                                                SRCS+                                        = socket_network_client.c                                                                                                                                                                                        VPATH+                                        = ../libzipfile                                                                                                                SRCS+                                        = centraldir.c                                                                                                                SRCS+                                        = zipfile.c                                                                                                                                                                                        VPATH+                                        = ../../../external/zlib                                                                                                                SRCS+                                        = adler32.c                                                                                                                SRCS+                                        = compress.c                                                                                                                SRCS+                                        = crc32.c                                                                                                                SRCS+                                        = deflate.c                                                                                                                SRCS+                                        = infback.c                                                                                                                SRCS+                                        = inffast.c                                                                                                                SRCS+                                        = inflate.c                                                                                                                SRCS+                                        = inftrees.c                                                                                                                SRCS+                                        = trees.c                                                                                                                SRCS+                                        = uncompr.c                                                                                                                SRCS+                                        = zutil.c                                                                                                                                                                                        CPPFLAGS+                                        = -DADB_HOST                                        =1                                                                                                                CPPFLAGS+                                        = -DHAVE_FORKEXEC                                        =1                                                                                                                CPPFLAGS+                                        = -DHAVE_SYMLINKS                                                                                                                CPPFLAGS+                                        = -DHAVE_TERMIO_H                                                                                                                CPPFLAGS+                                        = -D_GNU_SOURCE                                                                                                                CPPFLAGS+                                        = -D_XOPEN_SOURCE                                                                                                                CPPFLAGS+                                        = -I.                                                                                                                CPPFLAGS+                                        = -I../include                                                                                                                CPPFLAGS+                                        = -I../../../external/zlib                                                                                                                                                                                        CFLAGS+                                        = -O2 -g -Wall -Wno-unused-parameter                                                                                                                LDFLAGS                                        = -static                                                                                                                LIBS                                        = -lrt -lpthread                                                                                                                                                                                        TOOLCHAIN                                        = arm-none-linux-gnueabi-                                                                                                                CC                                        =                                         $(TOOLCHAIN                                        )gcc                                                                                                                LD                                        =                                         $(TOOLCHAIN                                        )gcc                                                                                                                                                                                        OBJS                                        =                                         $(SRCS:.c                                        =.o                                        )                                                                                                                                                                                        all: adb                                                                                                                                                                                        adb:                                         $(OBJS                                        )                                                                                                                $(LD                                        ) -o                                         $@                                         $(LDFLAGS                                        )                                         $(OBJS                                        )                                         $(LIBS                                        )                                                                                                                                                                                        clean:                                                                                                                rm -rf                                         $(OBJS                                        )                                    

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android(安卓)连续多次点击事件的实现
  2. 分析各种Android设备屏幕分辨率与适配 -
  3. Android(安卓)开发中使用 SQLite 数据库
  4. android framework 源码流程分析技巧
  5. Android(安卓)LinearGradient的使用
  6. android launcher之管理对象LauncherAppl
  7. Android(安卓)时间选择器 PickerView,的详
  8. android 调试技巧
  9. Android(安卓)SDK最新问题
  10. Android(安卓)Studio部分汉化中文包