• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This package contains the sources to the Android emulator program.
2
3Supported Development Platforms:
4--------------------------------
5
6The Android emulator can be built on the following platforms:
7
8    - Linux 32-bits
9    - Linux 64-bits (*only* generates 32-bit emulator binary)
10    - Darwin x86
11    - Darwin ppc  (experimental only)
12    - Windows x86  (through Cygwin only)
13
14Note that development on 64-bit versions of Darwin and Windows is
15not supported. The 32-bit emulator binary should run normally on
16these platforms though.
17
18The Windows emulator binary is built using the -no-cygwin option
19and thus doesn't depend on CYGWIN.DLL being installed on your system.
20
21It is possible to hack the android-configure.sh script to build
22a 64-bit emulator binary on Linux. Unfortunately the resulting
23program will crash pretty soon during emulation. This problem is
24due to the way the emulator works and cannot be easily fixed at
25the moment.
26
27Supported Compilers:
28--------------------
29
30The Android emulator is a heavy fork of QEMU 0.8.2, and as such,
31can only be built properly with a small number of compilers. Moreover,
32which compiler can be used depends on your platform.
33
34The following table sums up the compilers that are *known* to produce
35correct output:
36
37  Linux x86:              gcc-3.4.6
38  Linux x86 and x86_64:   gcc-4.2.3
39  Darwin x86:             gcc-4.0.1 (build 5341)
40  Darwin ppc:             gcc-3.3   (build 1819)
41
42Use any other compiler at your own risks ! A 'bad binary' usually
43results in the VM crashing either immediately or after a few seconds.
44
45Note that on Darwin, the *build* number of your compiler *is* important.
46Some builds of gcc-4.0.1 are known to generate bad binaries on Darwin x86,
47so your own fails to build an executable that works correctly.
48You can find the sources to the required gcc here:
49
50
51We distribute a file named distrib/build_gcc_qemu_darwin.sh which can be
52used as a replacement for the Apple-provided build_gcc.sh that comes with
53their gcc distribution.
54
55
56Building the emulator with the Android build system:
57----------------------------------------------------
58
59Ensure that you have properly configured your build by running the
60envsetup.sh script and using the appropriate 'lunch' command.
61
62Then type:
63
64     m emulator
65
66This will rebuild the emulator and place it in an adequate location.
67Simply type 'emulator' to start it with the currently built system
68image.
69
70
71Building the emulator without the Android build system:
72-------------------------------------------------------
73
74You can also build the emulator as a stand-alone program, by following
75these simple steps:
76
77  1/ First, build Android's patched libSDL as a static library,
78     this can be done as:
79
80        cd $TOP/external/qemu/distrib/sdl-1.2.12
81        ./android-configure --prefix=<PATH>
82        make
83        make install
84
85    Where $TOP is the path of your open-source Android source tree, and
86    where <PATH> is any path of your chosing where the library will
87    be copied to by the 'make install' command. For example, you
88    can use $HOME/android-sdl
89
90  2/ Configure the emulator with android-configure.sh, as in:
91
92        cd $TOP/external/qemu
93        ./android-configure.sh --sdl-config=<PATH>/bin/sdl-config
94        make
95
96     Where <PATH> is the same path you used with the --prefix option
97     when building the SDL library
98
99The emulator binary is located into objs/emulator, you can strip it and
100copy it to any location of your choosing.
101
102
103Creating an emulator source distribution package:
104-------------------------------------------------
105
106We provide a script to build a tar.gz package file that contains all the
107sources required to rebuild the emulator (i.e. it includes the patched SDL
108sources as well) plus a handy script to automate the rebuild.
109
110Simply invoke:
111
112    cd $TOP/tools/qemu
113    distrib/make-distrib.sh
114
115This script will create a tar.gz file under /tmp/android-package and will
116print its location when it completes.
117
118To rebuild the corresponding emulator, un-tar-gz the package, and run
119the 'rebuild.sh' script.
120