Fam Zheng | 3568f98 | 2016-06-01 12:25:20 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Common routines for docker test scripts. |
| 4 | # |
| 5 | # Copyright (c) 2016 Red Hat Inc. |
| 6 | # |
| 7 | # Authors: |
| 8 | # Fam Zheng <famz@redhat.com> |
| 9 | # |
| 10 | # This work is licensed under the terms of the GNU GPL, version 2 |
| 11 | # or (at your option) any later version. See the COPYING file in |
| 12 | # the top-level directory. |
| 13 | |
Fam Zheng | c16fe84 | 2016-09-28 15:31:32 +0800 | [diff] [blame] | 14 | BUILD_DIR=/var/tmp/qemu-build |
| 15 | mkdir $BUILD_DIR |
| 16 | |
Fam Zheng | 3568f98 | 2016-06-01 12:25:20 +0800 | [diff] [blame] | 17 | requires() |
| 18 | { |
| 19 | for c in $@; do |
| 20 | if ! echo "$FEATURES" | grep -wq -e "$c"; then |
| 21 | echo "Prerequisite '$c' not present, skip" |
| 22 | exit 0 |
| 23 | fi |
| 24 | done |
| 25 | } |
| 26 | |
| 27 | build_qemu() |
| 28 | { |
Fam Zheng | 9445c28 | 2016-09-21 11:49:25 +0800 | [diff] [blame] | 29 | config_opts="--enable-werror \ |
| 30 | ${TARGET_LIST:+--target-list=${TARGET_LIST}} \ |
| 31 | --prefix=$PWD/install \ |
Alex Bennée | 24e0131 | 2017-02-20 10:51:37 +0000 | [diff] [blame] | 32 | $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS \ |
Fam Zheng | 9445c28 | 2016-09-21 11:49:25 +0800 | [diff] [blame] | 33 | $@" |
| 34 | echo "Configure options:" |
| 35 | echo $config_opts |
| 36 | $QEMU_SRC/configure $config_opts |
Fam Zheng | 3568f98 | 2016-06-01 12:25:20 +0800 | [diff] [blame] | 37 | make $MAKEFLAGS |
| 38 | } |