Skip to content

Commit ac4ccac

Browse files
committed
configure: rename --enable-pypi to --enable-download, control subprojects too
The behavior of --{enable,disable}-pypi is similar to that of -Dwrapmode={default,nodownload} respectively. In particular, in both cases a feature needs to be explicitly enabled for the dependency to be downloaded. So, use a single option to control both cases. Now, --enable-slirp will trigger cloning and building of libslirp if the .pc file is not found on the machine. Reviewed-by: Daniel P. Berrangé <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 50cfed8 commit ac4ccac

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ GTAGS
2020
*.swp
2121
*.patch
2222
*.gcov
23-
24-
/subprojects/slirp

configure

+7-10
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bsd_user=""
266266
plugins="$default_feature"
267267
ninja=""
268268
python=
269-
pypi="enabled"
269+
download="enabled"
270270
bindir="bin"
271271
skip_meson=no
272272
vfio_user_server="disabled"
@@ -754,9 +754,9 @@ for opt do
754754
--with-git-submodules=*)
755755
git_submodules_action="$optarg"
756756
;;
757-
--disable-pypi) pypi="disabled"
757+
--disable-download) download="disabled"
758758
;;
759-
--enable-pypi) pypi="enabled"
759+
--enable-download) download="enabled"
760760
;;
761761
--enable-plugins) if test "$mingw32" = "yes"; then
762762
error_exit "TCG plugins not currently supported on Windows platforms"
@@ -960,7 +960,7 @@ python="$(command -v "$python")"
960960
# - venv is allowed to use system packages;
961961
# - all setup can be performed offline;
962962
# - missing packages may be fetched from PyPI,
963-
# unless --disable-pypi is passed.
963+
# unless --disable-download is passed.
964964
# - pip is not installed into the venv when possible,
965965
# but ensurepip is called as a fallback when necessary.
966966

@@ -977,7 +977,7 @@ python="$python -B"
977977
mkvenv="$python ${source_path}/python/scripts/mkvenv.py"
978978

979979
mkvenv_flags=""
980-
if test "$pypi" = "enabled" ; then
980+
if test "$download" = "enabled" ; then
981981
mkvenv_flags="--online"
982982
fi
983983

@@ -1000,7 +1000,7 @@ meson="$(cd pyvenv/bin; pwd)/meson"
10001000
# Conditionally ensure Sphinx is installed.
10011001

10021002
mkvenv_flags=""
1003-
if test "$pypi" = "enabled" -a "$docs" = "enabled" ; then
1003+
if test "$download" = "enabled" -a "$docs" = "enabled" ; then
10041004
mkvenv_flags="--online"
10051005
fi
10061006

@@ -1940,11 +1940,8 @@ if test "$skip_meson" = no; then
19401940

19411941
rm -rf meson-private meson-info meson-logs
19421942

1943-
# Prevent meson from automatically downloading wrapped subprojects when missing.
1944-
# You can use 'meson subprojects download' before running configure.
1945-
meson_option_add "--wrap-mode=nodownload"
1946-
19471943
# Built-in options
1944+
test "$download" = "disabled" && meson_option_add "--wrap-mode=nodownload"
19481945
test "$bindir" != "bin" && meson_option_add "-Dbindir=$bindir"
19491946
test "$default_feature" = no && meson_option_add -Dauto_features=disabled
19501947
test "$static" = yes && meson_option_add -Dprefer_static=true

meson.build

+8-4
Original file line numberDiff line numberDiff line change
@@ -3985,8 +3985,15 @@ endif
39853985
# Configuration summary #
39863986
#########################
39873987

3988-
# Directories
3988+
# Build environment
39893989
summary_info = {}
3990+
summary_info += {'Build directory': meson.current_build_dir()}
3991+
summary_info += {'Source path': meson.current_source_dir()}
3992+
summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
3993+
summary_info += {'Download dependencies': get_option('wrap_mode') != 'nodownload'}
3994+
summary(summary_info, bool_yn: true, section: 'Build environment')
3995+
3996+
# Directories
39903997
summary_info += {'Install prefix': get_option('prefix')}
39913998
summary_info += {'BIOS directory': qemu_datadir}
39923999
pathsep = targetos == 'windows' ? ';' : ':'
@@ -4004,9 +4011,6 @@ else
40044011
summary_info += {'local state directory': 'queried at runtime'}
40054012
endif
40064013
summary_info += {'Doc directory': get_option('prefix') / get_option('docdir')}
4007-
summary_info += {'Build directory': meson.current_build_dir()}
4008-
summary_info += {'Source path': meson.current_source_dir()}
4009-
summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
40104014
summary(summary_info, bool_yn: true, section: 'Directories')
40114015

40124016
# Host binaries

subprojects/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/packagecache
2+
3+
/slirp

0 commit comments

Comments
 (0)