Home | History | Annotate | Download | only in qemu
      1 This package contains the sources to the Android emulator program.
      2 
      3 Supported Development Platforms:
      4 --------------------------------
      5 
      6 The 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 
     14 Note that development on 64-bit versions of Darwin and Windows is
     15 not supported. The 32-bit emulator binary should run normally on
     16 these platforms though.
     17 
     18 The Windows emulator binary is built using the -no-cygwin option
     19 and thus doesn't depend on CYGWIN.DLL being installed on your system.
     20 
     21 It is possible to hack the android-configure.sh script to build
     22 a 64-bit emulator binary on Linux. Unfortunately the resulting
     23 program will crash pretty soon during emulation. This problem is
     24 due to the way the emulator works and cannot be easily fixed at
     25 the moment.
     26 
     27 Supported Compilers:
     28 --------------------
     29 
     30 The Android emulator is a heavy fork of QEMU 0.8.2, and as such,
     31 can only be built properly with a small number of compilers. Moreover,
     32 which compiler can be used depends on your platform.
     33 
     34 The following table sums up the compilers that are *known* to produce
     35 correct 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 
     42 Use any other compiler at your own risks ! A 'bad binary' usually
     43 results in the VM crashing either immediately or after a few seconds.
     44 
     45 Note that on Darwin, the *build* number of your compiler *is* important.
     46 Some builds of gcc-4.0.1 are known to generate bad binaries on Darwin x86,
     47 so your own fails to build an executable that works correctly.
     48 You can find the sources to the required gcc here:
     49 
     50 
     51 We distribute a file named distrib/build_gcc_qemu_darwin.sh which can be
     52 used as a replacement for the Apple-provided build_gcc.sh that comes with
     53 their gcc distribution.
     54 
     55 
     56 Building the emulator with the Android build system:
     57 ----------------------------------------------------
     58 
     59 Ensure that you have properly configured your build by running the
     60 envsetup.sh script and using the appropriate 'lunch' command.
     61 
     62 Then type: 
     63 
     64      m emulator
     65 
     66 This will rebuild the emulator and place it in an adequate location.
     67 Simply type 'emulator' to start it with the currently built system
     68 image.
     69 
     70 
     71 Building the emulator without the Android build system:
     72 -------------------------------------------------------
     73 
     74 You can also build the emulator as a stand-alone program, by following
     75 these 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.15
     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 
     99 The emulator binary is located into objs/emulator, you can strip it and
    100 copy it to any location of your choosing.
    101 
    102 
    103 Creating an emulator source distribution package:
    104 -------------------------------------------------
    105 
    106 We provide a script to build a tar.gz package file that contains all the
    107 sources required to rebuild the emulator (i.e. it includes the patched SDL
    108 sources as well) plus a handy script to automate the rebuild.
    109 
    110 Simply invoke:
    111 
    112     cd $TOP/tools/qemu
    113     distrib/make-distrib.sh
    114 
    115 This script will create a tar.gz file under /tmp/android-package and will
    116 print its location when it completes.
    117 
    118 To rebuild the corresponding emulator, un-tar-gz the package, and run
    119 the 'rebuild.sh' script.
    120