blob: f7a87de1abc0013c1e99cb8f7a641b74483ac470 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#!/usr/bin/env bash
set -e
# This file will need to be run in bash, for now.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildQemu.sh as root, parts of your Toolchain directory will become root-owned"
echo "$DIR"
PREFIX="$DIR/Local/qemu"
BUILD=$(realpath "$DIR/../Build")
SYSROOT="$BUILD/Root"
# shellcheck source=/dev/null
source "${DIR}/../Ports/qemu/version.sh"
echo PREFIX is "$PREFIX"
echo SYSROOT is "$SYSROOT"
mkdir -p "$DIR/Tarballs"
pushd "$DIR/Tarballs"
if [ ! -e "${QEMU_ARCHIVE}" ]; then
curl -C - -O "${QEMU_ARCHIVE_URL}"
else
echo "Skipped downloading ${QEMU_ARCHIVE}"
fi
if ! sha256sum --status -c <(echo "${QEMU_ARCHIVE_SHA256SUM}" "${QEMU_ARCHIVE}"); then
echo "qemu sha256 sum mismatching, please run script again."
rm -f "${QEMU_ARCHIVE}"
exit 1
fi
if [ ! -d "$QEMU_VERSION" ]; then
echo "Extracting qemu..."
tar -xf "${QEMU_ARCHIVE}"
else
echo "Skipped extracting qemu"
fi
popd
mkdir -p "$PREFIX"
mkdir -p "$DIR/Build/qemu"
if [ -z "$MAKEJOBS" ]; then
MAKEJOBS=$(nproc)
fi
if [[ $(uname) == "Darwin" ]]
then
UI_LIB=cocoa
else
UI_LIB=gtk
fi
echo Using $UI_LIB based UI
pushd "$DIR/Build/qemu"
"$DIR"/Tarballs/qemu-"${QEMU_VERSION}"/configure --prefix="$PREFIX" \
--target-list=aarch64-softmmu,x86_64-softmmu \
--enable-$UI_LIB \
--enable-slirp || exit 1
make -j "$MAKEJOBS" || exit 1
make install || exit 1
popd
|