1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-28 15:33:37 +02:00
cpu_features/scripts/setup_qemu.sh
2018-02-14 09:41:51 +01:00

41 lines
904 B
Bash
Executable File

#!/bin/bash
set -e
VERSION=${QEMU_VERSION:=2.11.0}
ARCHES=${QEMU_ARCHES:=arm aarch64 i386 x86_64 mipsel}
TARGETS=${QEMU_TARGETS:=$(echo $ARCHES | sed 's#$# #;s#\([^ ]*\) #\1-softmmu \1-linux-user #g')}
if echo "$VERSION $TARGETS" | cmp --silent $HOME/qemu/.build -; then
echo "qemu $VERSION up to date!"
exit 0
fi
echo "VERSION: $VERSION"
echo "TARGETS: $TARGETS"
cd $HOME
rm -rf qemu
# Checking for a tarball before downloading makes testing easier :-)
test -f "qemu-$VERSION.tar.xz" || wget "http://wiki.qemu-project.org/download/qemu-$VERSION.tar.xz"
tar -xJf "qemu-$VERSION.tar.xz"
cd "qemu-$VERSION"
./configure \
--prefix="$HOME/qemu" \
--target-list="$TARGETS" \
--disable-docs \
--disable-sdl \
--disable-gtk \
--disable-gnutls \
--disable-gcrypt \
--disable-nettle \
--disable-curses \
--static
make -j4
make install
echo "$VERSION $TARGETS" > $HOME/qemu/.build