configure: allow user to override docker engine

If you have both engines installed but one is broken you are stuck
with the automagic. Allow the user to override the engine for this
case.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20231009164104.369749-7-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2023-10-09 17:40:45 +01:00
parent c691925092
commit 42ede11aee
1 changed files with 6 additions and 2 deletions

8
configure vendored
View File

@ -180,6 +180,7 @@ fi
# some defaults, based on the host environment # some defaults, based on the host environment
# default parameters # default parameters
container_engine="auto"
cpu="" cpu=""
cross_compile="no" cross_compile="no"
cross_prefix="" cross_prefix=""
@ -787,6 +788,8 @@ for opt do
;; ;;
--disable-containers) use_containers="no" --disable-containers) use_containers="no"
;; ;;
--container-engine=*) container_engine="$optarg"
;;
--gdb=*) gdb_bin="$optarg" --gdb=*) gdb_bin="$optarg"
;; ;;
# everything else has the same name in configure and meson # everything else has the same name in configure and meson
@ -921,6 +924,7 @@ Advanced options (experts only):
--enable-plugins --enable-plugins
enable plugins via shared library loading enable plugins via shared library loading
--disable-containers don't use containers for cross-building --disable-containers don't use containers for cross-building
--container-engine=TYPE which container engine to use [$container_engine]
--gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin]
EOF EOF
meson_options_help meson_options_help
@ -1195,14 +1199,14 @@ fi
container="no" container="no"
runc="" runc=""
if test $use_containers = "yes" && (has "docker" || has "podman"); then if test $use_containers = "yes" && (has "docker" || has "podman"); then
case $($python "$source_path"/tests/docker/docker.py probe) in case $($python "$source_path"/tests/docker/docker.py --engine "$container_engine" probe) in
*docker) container=docker ;; *docker) container=docker ;;
podman) container=podman ;; podman) container=podman ;;
no) container=no ;; no) container=no ;;
esac esac
if test "$container" != "no"; then if test "$container" != "no"; then
docker_py="$python $source_path/tests/docker/docker.py --engine $container" docker_py="$python $source_path/tests/docker/docker.py --engine $container"
runc=$($python "$source_path"/tests/docker/docker.py probe) runc=$container
fi fi
fi fi