Import QEMU upstream snapshot d2e570c
Upstream: https://gitlab.com/qemu-project/qemu.git Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
This commit is contained in:
commit
cf256aa081
11315 files changed
+3598369
No files matched your search
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Common routines for docker test scripts.
|
||||
#
|
||||
# Copyright (c) 2016 Red Hat Inc.
|
||||
#
|
||||
# Authors:
|
||||
# Fam Zheng <[email protected]>
|
||||
#
|
||||
# This work is licensed under the terms of the GNU GPL, version 2
|
||||
# or (at your option) any later version. See the COPYING file in
|
||||
# the top-level directory.
|
||||
|
||||
# This might be set by ENV of a docker container... it is always
|
||||
# overridden by TARGET_LIST if the user sets it. We special case
|
||||
# "none" to allow for other options like --disable-tcg to restrict the
|
||||
# builds we eventually do.
|
||||
if test "$DEF_TARGET_LIST" = "none"; then
|
||||
DEF_TARGET_LIST=""
|
||||
else
|
||||
DEF_TARGET_LIST=${DEF_TARGET_LIST:-"x86_64-softmmu,aarch64-softmmu"}
|
||||
fi
|
||||
|
||||
enable_rust=""
|
||||
if [ "$ENABLE_RUST" = "1" ]; then
|
||||
enable_rust="--enable-rust"
|
||||
if [ -n "$RUST_TARGET" ]; then
|
||||
enable_rust="$enable_rust --rust-target-triple=$RUST_TARGET"
|
||||
fi
|
||||
fi
|
||||
|
||||
requires_binary()
|
||||
{
|
||||
found=0
|
||||
for c in $@; do
|
||||
for d in /bin /usr/bin /usr/local/bin
|
||||
do
|
||||
if test -f "$d/$c"
|
||||
then
|
||||
found=1
|
||||
fi
|
||||
done
|
||||
done
|
||||
if test "$found" != "1"
|
||||
then
|
||||
echo "Prerequisite '$c' not present, skip"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
configure_qemu()
|
||||
{
|
||||
config_opts="--enable-werror \
|
||||
${TARGET_LIST:+--target-list=${TARGET_LIST}} \
|
||||
--prefix=$INSTALL_DIR \
|
||||
$enable_rust \
|
||||
$QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS \
|
||||
$@"
|
||||
echo "Configure options:"
|
||||
echo $config_opts
|
||||
$QEMU_SRC/configure $config_opts || \
|
||||
{ cat config.log >&2 ; cat meson-logs/meson-log.txt >&2 ; test_fail "Failed to run 'configure'"; }
|
||||
}
|
||||
|
||||
build_qemu()
|
||||
{
|
||||
configure_qemu $@
|
||||
make $MAKEFLAGS
|
||||
}
|
||||
|
||||
check_qemu()
|
||||
{
|
||||
# default to make check unless the caller specifies
|
||||
if [ $# = 0 ]; then
|
||||
INVOCATION="${TEST_COMMAND:-make $MAKEFLAGS check}"
|
||||
else
|
||||
INVOCATION="make $MAKEFLAGS $@"
|
||||
fi
|
||||
|
||||
$INVOCATION
|
||||
}
|
||||
|
||||
test_fail()
|
||||
{
|
||||
echo "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
prep_fail()
|
||||
{
|
||||
echo "$@"
|
||||
exit 2
|
||||
}
|
||||
|
||||
install_qemu()
|
||||
{
|
||||
make install $MAKEFLAGS DESTDIR=$PWD/=destdir
|
||||
ret=$?
|
||||
rm -rf $PWD/=destdir
|
||||
return $ret
|
||||
}
|
||||
Reference in new issue
Block a user