Building a Custom Emulator Package

Version added 18-Dec-2018| Modified 18-Dec-2018

To build a custom emulator package, you need to build virglrenderer and QEMU, and copy the results to the pre-built emulator package.

Building virglrenderer

virglrenderer is a library that allows graphics rendering by using the host GPU.

Before you begin, upgrade all the installed packages to the latest version and install the dependency packages.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get -f install git libtool libdrm-dev libepoxy-dev libgbm-dev libegl1-mesa-dev libgtk-3-dev autoconf

To build virglrenderer, run the following commands one by one.

$ git clone git://anongit.freedesktop.org/virglrenderer
$ cd virglrenderer
$ git checkout virglrenderer-0.6.0
$ ./autogen.sh
$ ./configure --with-glx
$ make && sudo make install

Building QEMU

Before you begin, make sure that the virglrenderer package has been built successfully.

After that, upgrade all the installed packages to the latest version and install the dependency packages.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get -f install libsdl2-dev libpixman-1-dev

To build QEMU, run the following commands one by one.

$ git clone https://github.com/webosose-emulator/qemu.git
$ cd qemu
$ ./configure --target-list=i386-softmmu --enable-sdl --with-sdlabi=2.0 --audio-drv-list=alsa,pa
$ make

Copying the Results to the Pre-built Emulator

As the last step, copy the build results to the pre-built emulator package. Note that you must specify a different target directory depending on whether the host operating system is 64-bit or 32-bit.

If you have not cloned or downloaded the package previously, clone the prebuilt-emulator repository first.

$ git clone https://github.com/webosose-emulator/prebuilt-emulator.git

On 64-bit Ubuntu

Copy the virglrenderer library.

$ cp /usr/local/lib/libvirglrenderer.so* prebuilt-emulator/lib/x86_64

Copy the qemu library.

$ cp <qemu directory path>/i386-softmmu/qemu-system-i386 prebuilt-emulator/bin/x86_64
$ cp -rf pc-bios prebuilt-emulator/bin

On 32-bit Ubuntu

Copy the virglrenderer library.

cp /usr/local/lib/libvirglrenderer.so* prebuilt-emulator/lib/x86

Copy the qemu library.

cp <qemu directory path>/i386-softmmu/qemu-system-i386 prebuilt-emulator/bin/x86
cp -rf pc-bios prebuilt-emulator/bin

Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.