Skip to content

Commit

Permalink
configure: rename --enable-pypi to --enable-download, control subproj…
Browse files Browse the repository at this point in the history
…ects 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]>
  • Loading branch information
bonzini committed Jun 6, 2023
1 parent 50cfed8 commit ac4ccac
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ GTAGS
*.swp
*.patch
*.gcov

/subprojects/slirp
17 changes: 7 additions & 10 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ bsd_user=""
plugins="$default_feature"
ninja=""
python=
pypi="enabled"
download="enabled"
bindir="bin"
skip_meson=no
vfio_user_server="disabled"
Expand Down Expand Up @@ -754,9 +754,9 @@ for opt do
--with-git-submodules=*)
git_submodules_action="$optarg"
;;
--disable-pypi) pypi="disabled"
--disable-download) download="disabled"
;;
--enable-pypi) pypi="enabled"
--enable-download) download="enabled"
;;
--enable-plugins) if test "$mingw32" = "yes"; then
error_exit "TCG plugins not currently supported on Windows platforms"
Expand Down Expand Up @@ -960,7 +960,7 @@ python="$(command -v "$python")"
# - venv is allowed to use system packages;
# - all setup can be performed offline;
# - missing packages may be fetched from PyPI,
# unless --disable-pypi is passed.
# unless --disable-download is passed.
# - pip is not installed into the venv when possible,
# but ensurepip is called as a fallback when necessary.

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

mkvenv_flags=""
if test "$pypi" = "enabled" ; then
if test "$download" = "enabled" ; then
mkvenv_flags="--online"
fi

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

mkvenv_flags=""
if test "$pypi" = "enabled" -a "$docs" = "enabled" ; then
if test "$download" = "enabled" -a "$docs" = "enabled" ; then
mkvenv_flags="--online"
fi

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

rm -rf meson-private meson-info meson-logs

# Prevent meson from automatically downloading wrapped subprojects when missing.
# You can use 'meson subprojects download' before running configure.
meson_option_add "--wrap-mode=nodownload"

# Built-in options
test "$download" = "disabled" && meson_option_add "--wrap-mode=nodownload"
test "$bindir" != "bin" && meson_option_add "-Dbindir=$bindir"
test "$default_feature" = no && meson_option_add -Dauto_features=disabled
test "$static" = yes && meson_option_add -Dprefer_static=true
Expand Down
12 changes: 8 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3985,8 +3985,15 @@ endif
# Configuration summary #
#########################

# Directories
# Build environment
summary_info = {}
summary_info += {'Build directory': meson.current_build_dir()}
summary_info += {'Source path': meson.current_source_dir()}
summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
summary_info += {'Download dependencies': get_option('wrap_mode') != 'nodownload'}
summary(summary_info, bool_yn: true, section: 'Build environment')

# Directories
summary_info += {'Install prefix': get_option('prefix')}
summary_info += {'BIOS directory': qemu_datadir}
pathsep = targetos == 'windows' ? ';' : ':'
Expand All @@ -4004,9 +4011,6 @@ else
summary_info += {'local state directory': 'queried at runtime'}
endif
summary_info += {'Doc directory': get_option('prefix') / get_option('docdir')}
summary_info += {'Build directory': meson.current_build_dir()}
summary_info += {'Source path': meson.current_source_dir()}
summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
summary(summary_info, bool_yn: true, section: 'Directories')

# Host binaries
Expand Down
3 changes: 3 additions & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/packagecache

/slirp

0 comments on commit ac4ccac

Please sign in to comment.