forked from gtcasl/qsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-qemu.sh
executable file
·31 lines (26 loc) · 1.23 KB
/
build-qemu.sh
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
#!/bin/bash
if [ -n "${QSIM_PREFIX+1}" ]; then
echo "QSIM_PREFIX environment variable is set to: ${QSIM_PREFIX}"
else
echo "QSIM_PREFIX is not defined. Please set it to the root qsim folder."
exit 0;
fi
if [[ $1 = "debug" ]]; then
debug_flags="--enable-debug --enable-debug-tcg --enable-debug-info"
build_dir=.dbg_build
fi
if [[ $1 = "release" ]]; then
build_dir=.opt_build
fi
mkdir -p $QSIM_PREFIX/lib/
if [ ! -d "$build_dir" ]; then
mkdir -p $build_dir
cd $build_dir
QEMU_CFLAGS="-I${QSIM_PREFIX} -g -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wno-deprecated-declarations -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wtype-limits -fstack-protector-all -Wno-uninitialized" ../qemu/configure --extra-ldflags=-shared --target-list=aarch64-softmmu,x86_64-softmmu --disable-pie --disable-brlapi --disable-rdma --disable-rbd --disable-tcmalloc --disable-xen --disable-gtk --disable-uuid --disable-glusterfs --disable-xfsctl $debug_flags
else
cd $build_dir
fi
make -j4
cd ..
rm -f build
ln -s $build_dir build