#! /bin/bash PROJECT=qemu # Available sub-projects. AVAILABLE_PROJECTS=( qemu ) # Enabled sub-projects. PROJECTS=( qemu ) # Additional options (see functions sources below). # Options followed by a ':' require an argument, by '::' allow an optional argument. SHORT_OPTIONS= # Long options are not available with BSD getopt. LONG_OPTIONS= # Help for additional options usage() { # option h "help" "display this help and exit" return } # Find the directory containing this script. source="${BASH_SOURCE[0]}" while [ -h "${source}" ] ; do SCRIPTS="$(cd -P "$(dirname "${source}")" && pwd)" source="$(readlink "${source}")" [[ ${source} != /* ]] && source="$DIR/${source}" done SCRIPTS="$(cd -P "$(dirname "${source}")" && pwd)" # Get support functions and definitions. source ${SCRIPTS}/support # Add mingw targets EXTRATARGETS="x86_64-w64-mingw32 i686-w64-mingw32" # Projects. qemu="${SRCTOP} git://git.qemu-project.org/qemu.git qemu git" HOST=--host=${TARGETARCH}-${TARGETOS} if [ ${TOOLS} = "ecc" -a "${SHARED}" != "yes" ] ; then CFLAGS="${CFLAGS} -static" CXXFLAGS="${CXXFLAGS} -static" HOST_CC="${HOST_CC} -static" fi CFLAGS="${CFLAGS} -Wno-unused-command-line-argument" CXXFLAGS="${CXXFLAGS} -Wno-unused-command-line-argument" # The QEMU user targets. qemu_target_list="i386-linux-user \ x86_64-linux-user arm-linux-user armeb-linux-user aarch64-linux-user \ microblaze-linux-user mips-linux-user mipsel-linux-user mips64-linux-user \ ppc-linux-user ppc64-linux-user ppc64le-linux-user ppc64abi32-linux-user \ sparc-linux-user" configure() { # Configuring package qemu for all targets. run check_checkout run mkdir -p ${BUILDDIR} run cd ${BUILDDIR} run ${PROJECTDIR}/configure \ --prefix=${LOCAL} \ --disable-strip --target-list="${qemu_target_list}" --disable-guest-agent \ --disable-tools --static \ --cc="${LOCALBIN}/clang" --cxx="${LOCALBIN}/clang++" \ # ecc doesn't have glib and Linux headers needed to compile qemu. #--cc="${CC}" --host-cc=${HOST_CC} --extra-cflags="${CFLAGS}" \ #--cxx=$"${CXX}" --extra-cxxflags="${CXXFLAGS}" \ } build() { run check_checkout run check_configure run ${MAKE} LDFLAGS="${LDFLAGS}" -j ${MAXJOBS} -C ${BUILDDIR} } install() { run check_checkout run check_configure run ${MAKE} DFLAGS="${LDFLAGS}" -j ${MAXJOBS} -C ${BUILDDIR} install # Special case for name consitancy. cd ${LOCALBIN} ln -sf qemu-ppc64le qemu-ppc64el } tests() { # Run regression tests. run cd ${BUILDDIR} run ${MAKE} -j ${MAXJOBS} -C ${BUILDDIR} check run ${MAKE} -j ${MAXJOBS} -C ${BUILDDIR} clang-test } if [ "${CHECKOUT}" == "y" ] ; then checkout || exit 1 fi if [ "${CONFIGURE}" == "y" ] ; then configure || exit 1 fi if [ "${UPDATE}" == "y" ] ; then update || exit 1 fi if [ "${PATCH}" == "y" ] ; then patch || exit 1 fi if [ "${CREATE_PATCH}" == "y" ] ; then create_patch || exit 1 fi if [ "${BUILD}" == "y" ] ; then build || exit 1 fi if [ "${TESTS}" == "y" ] ; then tests || exit 1 fi if [ "${INSTALL}" == "y" ] ; then install || exit 1 cp -pr ${LOCAL}/bin/* ${LOCALBIN} fi