Ubuntu9.10 is a pure system installed by default, and no other software is installed.
1. Download the source code android-2.1_r2, directly make
2. Errors and solutions:
(1)/bin/Bash: bison: Command not found
Solution: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install bison
(2) Make: *** no rule to make target 'Please-install-JDK-5.0,-Update-12-or-Higher, -which-you-can-download-from-java.sun.com ',
Needed by 'out/target/common/docs/API-stubs-timestamp'. Stop.
Solution: Install JDK 5.0
1): According to the official document, the source code compilation must use JDK 5 to compile. Therefore, we use JDK 5 here.
2): update the source and run sudo Vim/etc/APT/sources. List on the terminal.
3): copy the following two lines to the end of the document in source. List:
Deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
Deb http://us.archive.ubuntu.com/ubuntu/ jaunty-Updates multiverse
Save and exit.
4): Execute sudo apt-Get update to update the source.
5): configure the compiling environment and download the jdk5: sudo apt-Get install sun-java5-jdk
(3)/bin/Bash: G ++: Command not found
Make: *** [out/host/linux-x86/obj/static_libraries/libhost_intermediates/pseudo localize. O] Error 127
Solution: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install build-essential
(4) External/clearsilver/cgi. C: 22: 18: Error: zlib. h: no such file or directory
External/clearsilver/cgi. C: In function 'cgi _ compress ':
External/clearsilver/cgi. C: 885: Error: 'z _ stream' undeclared (first use in this function)
External/clearsilver/cgi. C: 885: Error: (each undeclared identifier is reported only once
External/clearsilver/cgi. C: 885: Error: for each function it appears in .)
External/clearsilver/cgi. C: 885: Error: Expected '; 'before' stream'
External/clearsilver/cgi. C: 888: Error: 'stream' undeclared (first use in this function)
External/clearsilver/cgi. C: 888: Error: 'bytef' undeclared (first use in
This function)
External/clearsilver/cgi. C: 888: Error: Expected expression before ') 'token
External/clearsilver/cgi. C: 889: Error: 'uint' undeclared (first use in this function)
External/clearsilver/cgi. C: 889: Error: Expected '; 'before' STR'
External/clearsilver/cgi. C: 890: Error: Expected expression before ') 'token
External/clearsilver/cgi. C: 892: Error: 'ullong' undeclared (first use in this function)
External/clearsilver/cgi. C: 892: Error: Expected ') 'before' stream'
External/clearsilver/cgi. C: 895: Error: 'alloc _ func' undeclared (first use in this function)
External/clearsilver/cgi. C: 895: Error: Expected '; 'before numeric constant
External/clearsilver/cgi. C: 896: Error: 'free _ func' undeclared (first use in this function)
External/clearsilver/cgi. C: 896: Error: Expected '; 'before numeric constant
External/clearsilver/cgi. C: 897: Error: 'voidpf 'undeclared (first use in this function)
External/clearsilver/cgi. C: 897: Error: Expected '; 'before numeric constant
External/clearsilver/cgi. C: 900: Error: 'z _ default_compression 'undeclared (first use in this function)
External/clearsilver/cgi. C: 900: Error: 'z _ deflated 'undeclared (first use in this function)
External/clearsilver/cgi. C: 900: Error: 'max _ wbits 'undeclared (first use in this function)
External/clearsilver/cgi. C: 900: Error: 'z _ default_strategy 'undeclared (first use in this function)
External/clearsilver/cgi. C: 901: Error: 'z _ OK 'undeclared (first use in this function)
External/clearsilver/cgi. C: 904: Error: 'z _ finish 'undeclared (first use in this function)
External/clearsilver/cgi. C: 905: Error: 'z _ stream_end 'undeclared
(First use in this function) External/clearsilver/cgi. C: In Function
'Cgi _ output ':
External/clearsilver/cgi. C: 1200: Error: 'z _ null' undeclared (first use in this function)
External/clearsilver/cgi. C: 1201: Error: Expected ') 'before' bytef'
External/clearsilver/cgi. C: 1218: Error: 'z _ deflated 'undeclared (first use in this function)
Make: *** [out/host/linux-x86/obj/shared_libraries/libneo_cgi_intermediates/cgi. O] Error 1
Solution: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install zlib1g-dev
(5)/bin/Bash: Flex: Command not found
Make: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_l.cpp] Error 127
Solution: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install flex
(6)/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: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install libncurses-Dev
(7) prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 55: 22: Error: X11/xlib. h: no such file or directory
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 56: 23: Error: X11/xatom. h: no such file or directory
In file encoded ded from external/qemu/Android/skin/window. C: 19:
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 73: Error: Expected specifier-qualifier-list before 'xevent'
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 86: Error: Expected specifier-qualifier-list before 'display'
Make: *** [out/host/linux-x86/obj/executables/emulator_intermediates/Android/skin/window. O] Error 1
Solution: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install libx11-dev
(8) Sh: gperf: not found
Calling gperf failed: 32512 at./makeprop. pl line 96.
Make: *** [out/target/product/generic/obj/static_libraries/libwebcore_intermediates/WebCore/CSS/csspropertynames. H] Error 25
Make :***
Deleting File
'Out/target/product/generic/obj/static_libraries/libwebcore_intermediates/WebCore/CSS/csspropertynames. H'
Solution: A @ Ubuntu :~ /Work/android-2.1_r2 $ sudo apt-Get install gperf
Http://hi.baidu.com/maxgoto/blog/item/fa000f7bf01135f80ad187d8.html recent download
Android 2.1 source code, in Ubuntu
9.10 was compiled once. Because the system is a pure system, no Android compilation has been performed before, so you need to install some necessary software first. Refer to some articles on the Internet to take notes during compilation.
For reference:
1. Download or update the android source code
To the latest version, as of the day before yesterday (04-09), it seems to be 2.1-R2.
2. JDK 1.5 required by Android, and only JDK 1.6in ubuntu9.10. Currently, there are two solutions on the Internet:
Solution 1:
Install jdk1.5
1) according to the official document, the source code compilation must use JDK 5 to compile. Therefore, we use JDK 5 here.
2) Update the source and run sudo Vim/etc/APT/sources. List on the terminal.
3) copy the following two lines to the end of the document in source. List:
Deb http://us.archive.ubuntu.com/ubuntu/
Jaunty multiverse
Deb http://us.archive.ubuntu.com/ubuntu/
Jaunty-Updates multiverse
Save and exit.
4) execute sudo apt-Get update to update the source.
5) configure the compiling environment and download the jdk5: sudo apt-Get install sun-java5-jdk
Solution 2:
Install JDK 1.6
To modify the android source file.
1) install JDK 1.6 and modify <src_top/build/CORE/make. mk> (if the source code of Version 2.0 is correct, modify <src_top/build/CORE/Main. mk>)
Search for the file and separate the following values:
Java_version: = $ (shell Java-Version 2> & 1 | head-N 1 | grep '["] 1.5 [." $]')
Javac_version: = $ (shell javac-Version 2> & 1 | head-N 1 | grep '["] 1.5 [." $]')
Change the two rows:
Java_version: = $ (shell Java-Version 2> & 1 | head-N 1 | grep '["] 1.6 [." $]')
Javac_version: = $ (shell javac-Version 2> & 1 | head-N 1 | grep '["] 1.6 [." $]')
You can.
The first solution is recommended.
3. install required software during compilation
. Based on the experience of senior people on the Internet, this is the minimum tool software set compiled.
$ Sudo apt-Get install build-essential
$ Sudo apt-Get install zlib1g-dev
$ Sudo apt-Get install flex
$ Sudo apt-Get install libncurses-Dev
$ Sudo apt-Get install libx11-dev
$ Sudo apt-Get install gperf
4. Make
. After a long compilation process, the compilation is successful.