3

I've got a problem when I complied android adb source code. I follow some tips on google:

$ git clone git://android.googlesource.com/platform/system/core.git
system/core
$ git clone git://android.googlesource.com/platform/build.git build
$ git clone git://android.googlesource.com/platform/external/zlib.git

external/zlib $ git clone git://android.googlesource.com/platform/bionic.git bionic

It goes well. And I do this: " 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. " then it's the Makefile.Here I don't konw what I should do now, as the blog said,I should save the Makefile like this and then

cd system/core/adb; 
make

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)

Then an error has occurred:

$ make arm-none-linux-gnueabi-gcc -O2 -g -Wall -Wno-unused-parameter -DADB_HOST=1 -DHAVE_FORKEXEC=1 -DHAVE_SYMLINKS -DHAVE_TERMIO_H -D_GNU_SOURCE -D_XOPEN_SOURCE -I. -I../include -I../../../external/zlib -c -o adb_client.o adb_client.c make: arm-none-linux-gnueabi-gcc:command not found make: * [adb_client.o] error 127

I think it‘s my OS is ubuntu but not Linux/ARM,but I don't know what I could do with this Makefile because of the lack of knowledge. help,please. Thank you!

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
x_ineriley
  • 31
  • 3
  • Do you really need to compile it? Why not install a pre-compiled package? http://stackoverflow.com/questions/10493334/ubuntu-ppa-for-android-sdk-ndk – Yaroslav Mytkalyk Feb 25 '13 at 16:07
  • Because I want to modify some source files, and learn how adb works so I have to. – x_ineriley Feb 26 '13 at 04:51
  • Unless you are cross compiling this for arm linux system *from something else*, you want to remove the toolchain prefix arm-none-linux-gnueabi- and leave it blank instead. – Chris Stratton Feb 21 '15 at 08:17

1 Answers1

0

you need to install cross compiler for ARM by command

sudo apt-get install gcc-4.6-multilib-arm-linux-gnueabi

Maybe you need to install g++ cross compiler for arm. Best regards

  • The poster is not intending to cross compile. The reference to arm is either entirely erroneous, or else their ubuntu system is running on arm, and what they should be installing is the build-essential meta package. – Chris Stratton Feb 21 '15 at 08:18