#!/bin/bash -ex $CC --version # 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 so we cannot build rombios cfgargs+=("--disable-rombios") # newlib cannot be built with clang so we cannot build stubdoms cfgargs+=("--disable-stubdom") fi if [[ "${XEN_TARGET_ARCH}" == "arm64" || "${XEN_TARGET_ARCH}" == "arm32" ]]; then cfgargs+=("--disable-tools") # we don't have the cross depends installed elif [[ "${CC}" != "clang" ]]; then cfgargs+=("--enable-ovmf") # build ovmf with gcc on x86, arm doesn't use in-tree ovmf fi ./configure "${cfgargs[@]}" make dist