mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
CentOS 6 is probably the most frequently broken build, so adding it to CI would be a very good move. One problem is that CentOS 6 comes with Python 2.6, and Qemu requires 2.7. There appear to be no sensible ways to get Python 2.7 into a CentOS 6 environments, so modify the build script to skip the Qemu upstream build instead. Additionally, SeaBIOS requires GCC 4.6 or later, so skip it as well. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com>
66 lines
1.7 KiB
Python
Executable File
66 lines
1.7 KiB
Python
Executable File
#!/bin/bash -ex
|
|
|
|
$CC --version
|
|
|
|
# Express the compiler version as an integer. e.g. GCC 4.9.2 => 0x040902
|
|
cc-ver()
|
|
{
|
|
$CC -dumpversion | awk -F. '{ printf "0x%02x%02x%02x", $1, $2, $3 }'
|
|
}
|
|
|
|
# random config or default config
|
|
if [[ "${RANDCONFIG}" == "y" ]]; then
|
|
make -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
|
|
else
|
|
make -C xen defconfig
|
|
fi
|
|
|
|
# build up our configure options
|
|
cfgargs=()
|
|
cfgargs+=("--enable-docs")
|
|
|
|
if [[ "${CC}" == "clang" ]]; then
|
|
# SeaBIOS cannot be built with clang
|
|
cfgargs+=("--with-system-seabios=/usr/share/seabios/bios.bin")
|
|
# iPXE cannot be built with clang
|
|
cfgargs+=("--with-system-ipxe=/usr/lib/ipxe/ipxe.pxe")
|
|
# newlib cannot be built with clang so we cannot build stubdoms
|
|
cfgargs+=("--disable-stubdom")
|
|
fi
|
|
|
|
# Qemu requires Python 2.7 or later
|
|
if python -c "import sys; res = sys.version_info < (2, 7); exit(not(res))"; then
|
|
cfgargs+=("--with-system-qemu=/bin/false")
|
|
fi
|
|
|
|
# SeaBIOS requires GCC 4.6 or later
|
|
if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
|
|
cfgargs+=("--with-system-seabios=/bin/false")
|
|
fi
|
|
|
|
./configure "${cfgargs[@]}"
|
|
|
|
make -j$(nproc) dist
|
|
|
|
# Extract artifacts to avoid getting rewritten by customised builds
|
|
cp xen/.config xen-config
|
|
mkdir binaries
|
|
if [[ "${XEN_TARGET_ARCH}" == "x86_64" ]]; then
|
|
cp xen/xen binaries/xen
|
|
fi
|
|
|
|
# Build all the configs we care about
|
|
case ${XEN_TARGET_ARCH} in
|
|
x86_64) arch=x86 ;;
|
|
*) exit 0 ;;
|
|
esac
|
|
|
|
cfg_dir="automation/configs/${arch}"
|
|
for cfg in `ls ${cfg_dir}`; do
|
|
echo "Building $cfg"
|
|
make -j$(nproc) -C xen clean
|
|
rm -f xen/.config
|
|
make -C xen KBUILD_DEFCONFIG=../../../../${cfg_dir}/${cfg} XEN_CONFIG_EXPERT=y defconfig
|
|
make -j$(nproc) -C xen XEN_CONFIG_EXPERT=y
|
|
done
|