diff --git a/build/meta-qemu/classes/qemu.bbclass b/build/meta-qemu/classes/qemu.bbclass index 7d267505cb..b9062ffa94 100644 --- a/build/meta-qemu/classes/qemu.bbclass +++ b/build/meta-qemu/classes/qemu.bbclass @@ -11,15 +11,30 @@ qemu_do_configure () { # per IB_PLATFORM), but PRESERVE any other arch already built in a prior # run — otherwise meson would drop it. So building arm-softmmu then # aarch64-softmmu (or vice-versa) keeps both qemu-system-* binaries. - tlist="${QEMU_TARGET}" + # + # Fixed order, so the same targets always give the same configure line. + + tlist="" for t in arm-softmmu aarch64-softmmu; do - if [ "$t" != "${QEMU_TARGET}" ] && ls build/$t/qemu-system-* >/dev/null 2>&1; then - tlist="$tlist,$t" + if [ "$t" = "${QEMU_TARGET}" ] || ls build/$t/qemu-system-* >/dev/null 2>&1; then + tlist="${tlist:+$tlist,}$t" fi done + # QEMU's configure wipes build/, so re-running it means a full rebuild. + # Only run it when the options changed; meson/ninja handle the rest. + + args="--target-list=$tlist ${QEMU_OPTS}" + stamp=build/.ib-configure-args + + if [ -f $stamp ] && [ "$(cat $stamp)" = "$args" ]; then + echo "QEMU already configured (target-list=$tlist), skipping configure" + return + fi + echo "Configuring QEMU (target-list=$tlist)..." - ./configure --target-list=$tlist ${QEMU_OPTS} + ./configure $args + echo "$args" > $stamp }