$ . build/envsetup.sh
$ lunch 2

are two separate commands. The first one sets up the environment and
the second one sets which configuration you want to build.

On Mon, Dec 1, 2008 at 2:30 PM, Lucky-dog <[EMAIL PROTECTED]> wrote:
>
> My ubuntu is 8.10. I try the tips to compile android for x86. But it
> seem envsetup.sh does not work. Would you like to help me? Thank you
> very much. The log is as below.
> [EMAIL PROTECTED]:~/mydroid/build$ echo $SHELL
> /bin/bash
> [EMAIL PROTECTED]:~/mydroid/build$ bash --version
> GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
> Copyright (C) 2007 Free Software Foundation, Inc.
> [EMAIL PROTECTED]:~/mydroid/build$ ./envsetup.sh lunch 2
> [EMAIL PROTECTED]:~/mydroid/build$ ./envsetup.sh help
> [EMAIL PROTECTED]:~/mydroid/build$
>
>
>
> On Oct 24, 7:26 am, fadden <[EMAIL PROTECTED]> wrote:
>> On Oct 23, 9:52 am, kapare <[EMAIL PROTECTED]> wrote:
>>
>> > Can you give me clue or example of how to compile the dalvik for x86
>> > or PPC.
>>
>> Start with:
>>
>>   . build/envsetup.sh
>>   lunch 2
>>
>> This configures you to build for the desktop, linking against glibc.
>> This mode is NOT recommended for anything but experimental use.  It
>> may go away.  Don't use it; forget you saw it.  Thanks.
>>
>> Build the world:
>>
>>   make
>>
>> When that completes, you have a working dalvikm on your desktop
>> machine:
>>
>> % dalvikvm
>> E/dalvikvm(19521): ERROR: must specify non-'.' bootclasspath
>> W/dalvikvm(19521): JNI_CreateJavaVM failed
>> Dalvik VM init failed (check log file)
>>
>> To actually do something, you need to specify the bootstrap class path
>> and give it a place to put DEX data that it uncompresses from jar
>> files.  You can do that with a script like this:
>>
>> ----- snip & save -----
>> #!/bin/sh
>>
>> # base directory, at top of source tree; replace with absolute path
>> base=`pwd`
>>
>> # configure root dir of interesting stuff
>> root=$base/out/debug/host/linux-x86/product/sim/system
>> export ANDROID_ROOT=$root
>>
>> # configure bootclasspath
>> bootpath=$root/framework
>> export BOOTCLASSPATH=$bootpath/core.jar:$bootpath/ext.jar:$bootpath/
>> framework.jar:$bootpath/android.policy.jar:$bootpath/services.jar
>>
>> # this is where we create the dalvik-cache directory; make sure it
>> exists
>> export ANDROID_DATA=/tmp/dalvik_$USER
>> mkdir -p $ANDROID_DATA/dalvik_cache
>>
>> exec dalvikvm $@
>> -----
>>
>> Of course, you can't just run this against javac output, since it's
>> not a Java VM.  You have to run your class files through "dx":
>>
>>   % cat > Foo.java
>>   class Foo { public static void main(String[] args) {
>>     System.out.println("Hello, world");
>>   } }
>>   (ctrl-D)
>>   % javac Foo.java
>>   % dx --dex --output=foo.jar Foo.class
>>   % ./rund -cp foo.jar Foo
>>   Hello, world
>>   I/dalvikvm(19564): DestroyJavaVM shutting VM down
>>
>> (I really ought to get rid of that DestroyJavaVM line -- it's supposed
>> to be in the log file, but on the desktop the "log file" is stderr.)
>>
>> Get some info about valid arguments like this:
>>
>>   % ./rund -help
>>
>> This also shows what options the VM was configured with.  The "lunch
>> 2" build has all sorts of additional assertions and checks enabled,
>> which slows the VM down, but since this is just for experiments it
>> doesn't matter.
>>
>> All of the above applies to x86 Linux.  Anything else will likely
>> require a porting effort.
> >
>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to