configure: clean-up container cross compile detect

The introduction of podman support inadvertently broke configure's
detect of the container support as the configure probe didn't specify
an engine type. To fix this in docker.py:

  - only (re)set USE_ENGINE if --engine is specified
  - enhance the output so docker is no longer just yes

In the configure script we can at least start cleaning up the
detecting and naming of variables. To avoid too much churn the
conversion of the various make DOCKER_foo variables has been left for
future clean-ups.

Fixes: 9459f75413
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
Alex Bennée 2019-09-03 10:33:39 +01:00
parent 4030289a44
commit 8480517d4c
2 changed files with 9 additions and 8 deletions

10
configure vendored
View File

@ -495,7 +495,7 @@ qed="yes"
parallels="yes" parallels="yes"
sheepdog="yes" sheepdog="yes"
libxml2="" libxml2=""
docker="no" container="no"
debug_mutex="no" debug_mutex="no"
libpmem="" libpmem=""
default_devices="yes" default_devices="yes"
@ -5894,14 +5894,14 @@ EOF
fi fi
########################################## ##########################################
# Docker and cross-compiler support # Container based cross-compiler support
# #
# This is specifically for building test # This is specifically for building test
# cases for foreign architectures, not # cases for foreign architectures, not
# cross-compiling QEMU itself. # cross-compiling QEMU itself.
if has "docker"; then if has "docker" || has "podman"; then
docker=$($python $source_path/tests/docker/docker.py probe) container=$($python $source_path/tests/docker/docker.py probe)
fi fi
########################################## ##########################################
@ -6474,7 +6474,7 @@ echo "qed support $qed"
echo "parallels support $parallels" echo "parallels support $parallels"
echo "sheepdog support $sheepdog" echo "sheepdog support $sheepdog"
echo "capstone $capstone" echo "capstone $capstone"
echo "docker $docker" echo "container support $container"
echo "libpmem support $libpmem" echo "libpmem support $libpmem"
echo "libudev $libudev" echo "libudev $libudev"
echo "default devices $default_devices" echo "default devices $default_devices"

View File

@ -536,9 +536,9 @@ class ProbeCommand(SubCommand):
try: try:
docker = Docker() docker = Docker()
if docker._command[0] == "docker": if docker._command[0] == "docker":
print("yes") print("docker")
elif docker._command[0] == "sudo": elif docker._command[0] == "sudo":
print("sudo") print("sudo docker")
elif docker._command[0] == "podman": elif docker._command[0] == "podman":
print("podman") print("podman")
except Exception: except Exception:
@ -651,7 +651,8 @@ def main():
cmd.args(subp) cmd.args(subp)
subp.set_defaults(cmdobj=cmd) subp.set_defaults(cmdobj=cmd)
args, argv = parser.parse_known_args() args, argv = parser.parse_known_args()
USE_ENGINE = args.engine if args.engine:
USE_ENGINE = args.engine
return args.cmdobj.run(args, argv) return args.cmdobj.run(args, argv)