进入$SRC目录
下载源码
保持网络畅通
git clone https://fuchsia.googlesource.com/third_party/qemu
进入qemu目录
~/fuchsia/qemu$ git branch -a
* fuchsia
master
remotes/origin/HEAD -> origin/master
remotes/origin/fuchsia
remotes/origin/master
remotes/origin/stable-0.10
remotes/origin/stable-0.11
remotes/origin/stable-0.12
remotes/origin/stable-0.13
remotes/origin/stable-0.14
remotes/origin/stable-0.15
remotes/origin/stable-1.0
remotes/origin/stable-1.1
remotes/origin/stable-1.2
remotes/origin/stable-1.3
remotes/origin/stable-1.4
remotes/origin/stable-1.5
remotes/origin/stable-1.6
remotes/origin/stable-1.7
remotes/origin/stable-2.0
remotes/origin/stable-2.1
remotes/origin/stable-2.2
remotes/origin/stable-2.3
remotes/origin/stable-2.4
remotes/origin/stable-2.5
remotes/origin/staging
切换代码到fuchsia分支
git checkout fuchsia
使用./configure --help可以查看支持的配置参数
~/fuchsia/qemu$ ./configure --help
Usage: configure [options]
Options: [defaults in brackets after descriptions]
Standard options:
--help print this message
--prefix=PREFIX install in PREFIX [/usr/local]
--interp-prefix=PREFIX where to find shared libraries, etc.
use %M for cpu name [/usr/gnemul/qemu-%M]
--target-list=LIST set target list (default: build everything)
Available targets: aarch64-softmmu alpha-softmmu
arm-softmmu cris-softmmu i386-softmmu lm32-softmmu
m68k-softmmu microblaze-softmmu microblazeel-softmmu
mips-softmmu mips64-softmmu mips64el-softmmu
mipsel-softmmu moxie-softmmu or32-softmmu
ppc-softmmu ppc64-softmmu ppcemb-softmmu
s390x-softmmu sh4-softmmu sh4eb-softmmu
sparc-softmmu sparc64-softmmu tricore-softmmu
unicore32-softmmu x86_64-softmmu xtensa-softmmu
xtensaeb-softmmu aarch64-linux-user alpha-linux-user
arm-linux-user armeb-linux-user cris-linux-user
i386-linux-user m68k-linux-user
microblaze-linux-user microblazeel-linux-user
mips-linux-user mips64-linux-user
mips64el-linux-user mipsel-linux-user
mipsn32-linux-user mipsn32el-linux-user
or32-linux-user ppc-linux-user ppc64-linux-user
ppc64abi32-linux-user ppc64le-linux-user
s390x-linux-user sh4-linux-user sh4eb-linux-user
sparc-linux-user sparc32plus-linux-user
sparc64-linux-user tilegx-linux-user
unicore32-linux-user x86_64-linux-user
Advanced options (experts only):
--source-path=PATH path of source code [/home/jiang/fuchsia/qemu]
--cross-prefix=PREFIX use PREFIX for compile tools []
--cc=CC use C compiler CC [cc]
--iasl=IASL use ACPI compiler IASL [iasl]
--host-cc=CC use C compiler CC [cc] for code run at
build time
--cxx=CXX use C++ compiler CXX [c++]
--objcc=OBJCC use Objective-C compiler OBJCC [cc]
--extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
--make=MAKE use specified make [make]
--install=INSTALL use specified install [install]
--python=PYTHON use specified python [python -B]
--smbd=SMBD use specified smbd [/usr/sbin/smbd]
--static enable static build [no]
--mandir=PATH install man pages in PATH
--datadir=PATH install firmware in PATH/qemu
--docdir=PATH install documentation in PATH/qemu
--bindir=PATH install binaries in PATH
--libdir=PATH install libraries in PATH
--sysconfdir=PATH install config in PATH/qemu
--localstatedir=PATH install local state in PATH (set at runtime on win32)
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [/qemu]
--enable-debug enable common debug build options
--disable-strip disable stripping binaries
--disable-werror disable compilation abort on warning
--disable-stack-protector disable compiler-provided stack protection
--audio-drv-list=LIST set audio drivers list:
Available drivers: oss alsa sdl pa
--block-drv-whitelist=L Same as --block-drv-rw-whitelist=L
--block-drv-rw-whitelist=L
set block driver read-write whitelist
(affects only QEMU, not qemu-img)
--block-drv-ro-whitelist=L
set block driver read-only whitelist
(affects only QEMU, not qemu-img)
--enable-trace-backends=B Set trace backend
Available backends: nop, dtrace, ftrace, simple, stderr, ust
--with-trace-file=NAME Full PATH,NAME of file to store traces
Default:trace-
--disable-slirp disable SLIRP userspace network connectivity
--enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)
--oss-lib path to OSS library
--cpu=CPU Build for host CPU [x86_64]
--with-coroutine=BACKEND coroutine backend. Supported options:
gthread, ucontext, sigaltstack, windows
--enable-gcov enable test coverage analysis with gcov
--gcov=GCOV use specified gcov [gcov]
--disable-blobs disable installing provided firmware blobs
--with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent
--with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb)
Optional features, enabled with --enable-FEATURE and
disabled with --disable-FEATURE, default is enabled if available:
system all system emulation targets
user supported user emulation targets
linux-user all linux usermode emulation targets
bsd-user all BSD usermode emulation targets
docs build documentation
guest-agent build the QEMU Guest Agent
guest-agent-msi build guest agent Windows MSI installation package
pie Position Independent Executables
modules modules support
debug-tcg TCG debugging (default is disabled)
debug-info debugging information
sparse sparse checker
gnutls GNUTLS cryptography support
nettle nettle cryptography support
gcrypt libgcrypt cryptography support
sdl SDL UI
--with-sdlabi select preferred SDL ABI 1.2 or 2.0
gtk gtk UI
--with-gtkabi select preferred GTK ABI 2.0 or 3.0
vte vte support for the gtk UI
curses curses UI
vnc VNC UI support
vnc-sasl SASL encryption for VNC server
vnc-jpeg JPEG lossy compression for VNC server
vnc-png PNG compression for VNC server
cocoa Cocoa UI (Mac OS X only)
virtfs VirtFS
xen xen backend driver support
xen-pci-passthrough
brlapi BrlAPI (Braile)
curl curl connectivity
fdt fdt device tree
bluez bluez stack connectivity
kvm KVM acceleration support
rdma RDMA-based migration support
uuid uuid support
vde support for vde network
netmap support for netmap network
linux-aio Linux AIO support
cap-ng libcap-ng support
attr attr and xattr support
vhost-net vhost-net acceleration support
spice spice
rbd rados block device (rbd)
libiscsi iscsi support
libnfs nfs support
smartcard smartcard support (libcacard)
libusb libusb (for usb passthrough)
usb-redir usb network redirection support
lzo support of lzo compression library
snappy support of snappy compression library
bzip2 support of bzip2 compression library
(for reading bzip2-compressed dmg images)
seccomp seccomp support
coroutine-pool coroutine freelist (better performance)
glusterfs GlusterFS backend
archipelago Archipelago backend
tpm TPM support
libssh2 ssh block device support
vhdx support for the Microsoft VHDX image format
numa libnuma support
tcmalloc tcmalloc support
jemalloc jemalloc support
NOTE: The object files are built at the place where configure is launched
./configure --target-list=arm-softmmu,aarch64-softmmu,x86_64-softmmu --prefix=/home/jiang/apps
编译
make -j8
安装
make install
这样相应的文件便安装到了~/apps/目录
~/fuchsia/qemu$ ls ~/apps/bin/
ivshmem-client ivshmem-server qemu-ga qemu-img qemu-io qemu-nbd qemu-system-aarch64 qemu-system-arm qemu-system-x86_64
把安装的bin目录加入PATH
export PATH=$PATH:/home/jiang/apps/bin