rebuild-expected-aml.sh: allow partial target list
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 18 Oct 2021 21:14:28 +0000 (17:14 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 20 Oct 2021 08:44:05 +0000 (04:44 -0400)
Only rebuild AML for configured targets.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tests/data/acpi/rebuild-expected-aml.sh

index fc787705446fb19aef46f3964195c778e65614c3..dcf2e2f221b3f2aaa44d334db800eab736d5f8a2 100755 (executable)
@@ -12,7 +12,7 @@
 # This work is licensed under the terms of the GNU GPLv2.
 # See the COPYING.LIB file in the top-level directory.
 
-qemu_bins="./qemu-system-x86_64 ./qemu-system-aarch64"
+qemu_arches="x86_64 aarch64"
 
 if [ ! -e "tests/qtest/bios-tables-test" ]; then
     echo "Test: bios-tables-test is required! Run make check before this script."
@@ -20,6 +20,26 @@ if [ ! -e "tests/qtest/bios-tables-test" ]; then
     exit 1;
 fi
 
+if grep TARGET_DIRS= config-host.mak; then
+    for arch in $qemu_arches; do
+        if  grep TARGET_DIRS= config-host.mak | grep "$arch"-softmmu;
+        then
+            qemu_bins="$qemu_bins ./qemu-system-$arch"
+        fi
+    done
+else
+    echo "config-host.mak missing!"
+    echo "Run this script from the build directory."
+    exit 1;
+fi
+
+if [ -z "$qemu_bins" ]; then
+    echo "Only the following architectures are currently supported: $qemu_arches"
+    echo "None of these configured!"
+    echo "To fix, run configure --target-list=x86_64-softmmu,aarch64-softmmu"
+    exit 1;
+fi
+
 for qemu in $qemu_bins; do
     if [ ! -e $qemu ]; then
         echo "Run 'make' to build the following QEMU executables: $qemu_bins"