Download Android source code:Official download or refer to Android source code Download Method
Android compiled version:Platform_version = 4.0.1 (latest Android 4.0.1)
OS Operating System Platform:Linux Yanggang 2.6.35-30-generic # 61-ubuntu SMP Tue Oct 11 15:29:15 UTC 2011 i686 GNU/Linux (ubuntu10.10 32bit)
First, install some common tools.
Curl:Sudo apt-Get install curl
Git:Sudo apt-Get install git
G ++:Sudo apt-Get install g ++
Then, make installs whatever it lacks.
/Usr/bin/ld: cannot find-LZ
Host executable: aapt (Out/host/linux-x86/obj/executables/aapt_intermediates/aapt)
/Usr/bin/ld: cannot find-LZ
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/executables/aapt_intermediates/aapt] Error 1
Solution:Sudo apt-Get install zlib1g-dev sudo apt-Get install lib64z1-dev
/Bin/Bash: bison: Command not found
YACC: aidl <= frameworks/base/tools/aidl/aidl_language_y.y
Bison-D-O out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/Bin/Bash: bison: Command not found
Make: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp] Error 127
Solution: sudo apt-Get install bison
/Bin/Bash: Flex: Command not found
Out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp: In function 'int yyparse ()':
Out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp: 1827: Warning: deprecated conversion from String constant to 'Char *'
Out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp: 1970: Warning: deprecated conversion from String constant to 'Char *'
LEX: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/Bin/Bash: Flex: Command not found
Make: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_l.cpp] Error 127
Solution: sudo apt-Get install flex
/Usr/bin/ld: cannot find-lncurses
Host executable: ADB (Out/host/linux-x86/obj/executables/adb_intermediates/ADB)
/Usr/bin/ld: cannot find-lncurses
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/executables/adb_intermediates/ADB] Error 1
Solution: sudo apt-Get install libncurses5-dev
Fatal error: Gl/Glx. h: no such file or directory
Development/tools/emulator/OpenGL/host/libs/Translator/glcommon/gldispatch. cpp: 22: Fatal error: Gl/Glx. h: no such file or directory
Compilation terminated.
Make: *** [out/host/linux-x86/obj/static_libraries/libglcommon_intermediates/gldispatch. O] Error 1
Solution: sudo apt-Get install libgl1-mesa-dev
SH: gperf: not found
Target generated: libwebcore <= external/WebKit/source/javascriptcore/create_regex_tables
Generating csspropertynames. H <= csspropertynames. In
SH: gperf: not found
Calling gperf failed: 32512 at./makeprop. pl line 140.
Make: *** [out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/WebCore/CSS/csspropertynames. H] Error 25
Make: *** deleting file 'out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/WebCore/CSS/csspropertynames. H'
Solution: sudo apt-Get install gperf
For more information, see download.