Compile ADB and fastboot for windows in Linux

Source: Internet
Author: User

Environment:
Fedora 17 64-bit
Android: 4.0.1

1. Go to the android source code directory

2. Execute:

# . build/envsetup.sh

3. Execute

# choosecombo

Select parameters. In these two steps, some compilation parameters and environment variables are set. Follow the android compilation settings.

4. If this is the first compilation, You need to first compile the ADB version under Linux. Otherwise, go to step 2.

Run:

# make adb

5. Install the Linux-Windows cross-compiling environment mingw. The first step is to compile the C program, and the second step is to compile the CPP program.

Run:

# yum install mingw32-gcc# yum install mingw32-gcc-c++

4. Find the corresponding file in the android source code Directory :~ /Android_source_code/build/CORE/Combo/HOST_windows-x86.mk
Run the following code:

#  TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-#  HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include#  HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib#  HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)

To:

#  TOOLS_PREFIX := /usr/bin/i686-w64-mingw32-#  HOST_C_INCLUDES += /usr/i686-w64-mingw32/sys-root/mingw/include#  HOST_GLOBAL_LD_DIRS += -L/usr/i686-w64-mingw32/sys-root/mingw/lib#  HOST_CXX := $(TOOLS_PREFIX)g++ -static-libgcc$(TOOLS_EXE_SUFFIX)

The above modification depends on the mingw version.

Last run:

# make USE_MINGW=y adb

Three unrecognized command options may be reported here. I don't know if the mingw version is correct. Currently, the following impacts are also found:

#  cc: error: unrecognized command line option ‘-mfloat-abi=softfp’#  cc: error: unrecognized command line option ‘-mfpu=vfpv3-d16’#  cc: error: unrecognized command line option ‘-mthumb-interwork’

5. Execute:

# make USE_MINGW=y fastboot

Finally to the out/host/windows-x86/bin directory to find what you just compiled.

NOTE: If no package is installed, install the package and try again. Packages such as ncurses.
Reference: http://blog.csdn.net/wzz_momo/article/details/6577039

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.