My previous post, Compiling Android Source on Mac OS X 10.6 Snow Leopard, is outdated and doesn’t work with the new source code, so I thought I’ll update this for eclair.
Here are the steps.
1. Install XCode, Macports, repo, etc.
I assume everyone knows how to do this. Follow the instructions from the Get Android Source Code page. Just remember to create a new partition that is a case-sensitive partition if you’re using a non case-sensitive primary partition. I’ll start off after you’ve gotten the source from git.
2. Get the following patches.
Since there is only 1 patch to grab, I used repo for this.
Patch 12074 - Change Ic4caeff0: Enable building on java 1.6 without conflicts.
This patch will allow you to use Java 1.6 that comes with Snow Leopard instead of Java 1.5.
repo download platform/build 12074/5
The rest of the patches seems to have made it into the trunk, so it isn’t required to patch them anymore.
3. Edit the files.
However, there is 1 extra step you need to do in order to get a clean build. I can’t find the patch for this yet, so if anyone knows, please comment the patch number. You have to edit the following file:
system/core/libacc/acc.cpp
In a gist, change all the (int) to (size_t). Change the following lines:
Line 4557:
pGen->leaR0((int) glo, mkpCharPtr, ET_RVALUE);
to
pGen->leaR0((size_t) glo, mkpCharPtr, ET_RVALUE);
Line 4637:
pGen->loadFloat((int) glo, mkpFloat);
to
pGen->loadFloat((size_t) glo, mkpFloat);
Line 4643:
pGen->loadFloat((int) glo, mkpDouble);
to
pGen->loadFloat((size_t) glo, mkpDouble);
Line 4730-4731:
pVI->pForward = (void*) pGen->leaForward(
(int) pVI->pForward, pVal);
to
pVI->pForward = (void*) pGen->leaForward(
(size_t) pVI->pForward, pVal);
Line 5740:
pGen->resolveForward((int) name->pForward);
to
pGen->resolveForward((size_t) name->pForward);
4. Build and watch it fly.
make
Wait for an hour or two for the build to be completed and you’ll have a nice Android 2.1 build in the “out” directory.
Recent Comments