It seems that those who try to compile Android releases that follow ‘froyo’ on 32 bit systems are out of luck since a limitations has been imposed during the compile process. Being one of those unfortunate people I was annoyed at the fact that I am stuck with a ‘froyo’ build, luckily I have found that people have already encountered this situation before and found a solution. I will not go over the basic steps of building Android since those can be found at the Android source website but they must be performed before running the final ‘make’ command (make sure you follow the parts relating to ‘gingerbread’ and above since that’s what we’re building). I am assuming an Ubuntu environment since that’s what I have.
* This is only relevant for building on 32-bit systems if you are on a 64-bit system chances are you won’t encounter any errors by following the Android build at the website.*
First we must get the required packages, the Android website is a bit outdated so after a bit of trail and error and some Google searches we come up with the following list:
sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev git-core gnupg build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk ant gcc-multilib g++-multilib
After we’ve installed these packages the next step is to remove the limitation from the make files, for those of you who are lazy I have found a patch file to do just that. In case the original file is taken down or you just want to know what the individual steps are I have copied them here:
- Go to ‘build/core/main.mk’, lookup ‘ifneq (64,$(findstring 64,$(build_arch)))’ and replace any reference to ’64′ with your architecture (can be retrieved by running ‘uname -a’) mine in this case is i686 so I resulted in ‘+ifneq (i686,$(findstring i686,$(build_arch)))’
- Go over the following files:
- external/clearsilver/cgi/Android.mk
- external/clearsilver/java-jni/Android.mk
- external/clearsilver/util/Android.mk
- external/clearsilver/cs/Android.mk
and look for the lines stating ‘LOCAL_CFLAGS += -m64′ and ‘LOCAL_LDFLAGS += -m64′, you could either comment these lines or change it to show ‘-m32′
All that is left for us is to run make and enjoy a few hours of watching Android build on our system
Just a quick notice, this was tested on a clean Install of Ubuntu Server 10.10 32 bit if you encounter any errors paste them here and I’ll try to help.