mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-14 23:13:30 +00:00
configure: reorder option parsing code
Move some variable assignments around for clarity and to remove one of three loops on the command line arguments. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
eebcddf2fd
commit
13cf376c1f
121
configure
vendored
121
configure
vendored
|
@ -177,29 +177,18 @@ then
|
||||||
error_exit "main directory cannot contain spaces nor colons"
|
error_exit "main directory cannot contain spaces nor colons"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# parse CC options first; some compiler tests are used to establish
|
||||||
|
# some defaults, based on the host environment
|
||||||
|
|
||||||
# default parameters
|
# default parameters
|
||||||
cpu=""
|
cpu=""
|
||||||
static="no"
|
|
||||||
cross_compile="no"
|
cross_compile="no"
|
||||||
cross_prefix=""
|
cross_prefix=""
|
||||||
host_cc="cc"
|
host_cc="cc"
|
||||||
use_containers="yes"
|
EXTRA_CFLAGS=""
|
||||||
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
|
EXTRA_CXXFLAGS=""
|
||||||
gdb_arches=""
|
EXTRA_OBJCFLAGS=""
|
||||||
|
EXTRA_LDFLAGS=""
|
||||||
if test -e "$source_path/.git"
|
|
||||||
then
|
|
||||||
git_submodules_action="update"
|
|
||||||
else
|
|
||||||
git_submodules_action="ignore"
|
|
||||||
fi
|
|
||||||
|
|
||||||
git_submodules="ui/keycodemapdb"
|
|
||||||
git="git"
|
|
||||||
|
|
||||||
# Don't accept a target_list environment variable.
|
|
||||||
unset target_list
|
|
||||||
unset target_list_exclude
|
|
||||||
|
|
||||||
# Default value for a variable defining feature "foo".
|
# Default value for a variable defining feature "foo".
|
||||||
# * foo="no" feature will only be used if --enable-foo arg is given
|
# * foo="no" feature will only be used if --enable-foo arg is given
|
||||||
|
@ -212,49 +201,8 @@ unset target_list_exclude
|
||||||
# Always add --enable-foo and --disable-foo command line args.
|
# Always add --enable-foo and --disable-foo command line args.
|
||||||
# Distributions want to ensure that several features are compiled in, and it
|
# Distributions want to ensure that several features are compiled in, and it
|
||||||
# is impossible without a --enable-foo that exits if a feature is not found.
|
# is impossible without a --enable-foo that exits if a feature is not found.
|
||||||
|
|
||||||
default_feature=""
|
default_feature=""
|
||||||
# parse CC options second
|
|
||||||
for opt do
|
|
||||||
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
|
|
||||||
case "$opt" in
|
|
||||||
--without-default-features)
|
|
||||||
default_feature="no"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
EXTRA_CFLAGS=""
|
|
||||||
EXTRA_CXXFLAGS=""
|
|
||||||
EXTRA_OBJCFLAGS=""
|
|
||||||
EXTRA_LDFLAGS=""
|
|
||||||
|
|
||||||
debug_tcg="no"
|
|
||||||
docs="auto"
|
|
||||||
EXESUF=""
|
|
||||||
prefix="/usr/local"
|
|
||||||
qemu_suffix="qemu"
|
|
||||||
softmmu="yes"
|
|
||||||
linux_user=""
|
|
||||||
bsd_user=""
|
|
||||||
pie=""
|
|
||||||
plugins="$default_feature"
|
|
||||||
ninja=""
|
|
||||||
bindir="bin"
|
|
||||||
skip_meson=no
|
|
||||||
vfio_user_server="disabled"
|
|
||||||
|
|
||||||
# The following Meson options are handled manually (still they
|
|
||||||
# are included in the automatically generated help message)
|
|
||||||
|
|
||||||
# 1. Track which submodules are needed
|
|
||||||
fdt="auto"
|
|
||||||
|
|
||||||
# 2. Automatically enable/disable other options
|
|
||||||
tcg="auto"
|
|
||||||
cfi="false"
|
|
||||||
|
|
||||||
# parse CC options second
|
|
||||||
for opt do
|
for opt do
|
||||||
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
|
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
|
@ -293,9 +241,60 @@ for opt do
|
||||||
--cross-prefix-*) cc_arch=${opt#--cross-prefix-}; cc_arch=${cc_arch%%=*}
|
--cross-prefix-*) cc_arch=${opt#--cross-prefix-}; cc_arch=${cc_arch%%=*}
|
||||||
eval "cross_prefix_${cc_arch}=\$optarg"
|
eval "cross_prefix_${cc_arch}=\$optarg"
|
||||||
;;
|
;;
|
||||||
|
--without-default-features) default_feature="no"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if test -e "$source_path/.git"
|
||||||
|
then
|
||||||
|
git_submodules_action="update"
|
||||||
|
else
|
||||||
|
git_submodules_action="ignore"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git_submodules="ui/keycodemapdb"
|
||||||
|
git="git"
|
||||||
|
debug_tcg="no"
|
||||||
|
docs="auto"
|
||||||
|
EXESUF=""
|
||||||
|
prefix="/usr/local"
|
||||||
|
qemu_suffix="qemu"
|
||||||
|
softmmu="yes"
|
||||||
|
linux_user=""
|
||||||
|
bsd_user=""
|
||||||
|
plugins="$default_feature"
|
||||||
|
ninja=""
|
||||||
|
python=
|
||||||
|
pypi="enabled"
|
||||||
|
bindir="bin"
|
||||||
|
skip_meson=no
|
||||||
|
vfio_user_server="disabled"
|
||||||
|
use_containers="yes"
|
||||||
|
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
|
||||||
|
gdb_arches=""
|
||||||
|
werror=""
|
||||||
|
|
||||||
|
# Don't accept a target_list environment variable.
|
||||||
|
unset target_list
|
||||||
|
unset target_list_exclude
|
||||||
|
|
||||||
|
# The following Meson options are handled manually (still they
|
||||||
|
# are included in the automatically generated help message)
|
||||||
|
|
||||||
|
# 1. Track which submodules are needed
|
||||||
|
fdt="auto"
|
||||||
|
|
||||||
|
# 2. Automatically enable/disable other options
|
||||||
|
tcg="auto"
|
||||||
|
cfi="false"
|
||||||
|
|
||||||
|
# 3. Need to check for -static-pie before Meson runs. Also,
|
||||||
|
# Meson has PIE as a boolean rather than enabled/disabled/auto.
|
||||||
|
pie=""
|
||||||
|
static="no"
|
||||||
|
|
||||||
# Preferred compiler:
|
# Preferred compiler:
|
||||||
# ${CC} (if set)
|
# ${CC} (if set)
|
||||||
# ${cross_prefix}gcc (if cross-prefix specified)
|
# ${cross_prefix}gcc (if cross-prefix specified)
|
||||||
|
@ -536,8 +535,6 @@ check_py_version() {
|
||||||
"$1" -c 'import sys; sys.exit(sys.version_info < (3,7))'
|
"$1" -c 'import sys; sys.exit(sys.version_info < (3,7))'
|
||||||
}
|
}
|
||||||
|
|
||||||
python=
|
|
||||||
pypi="enabled"
|
|
||||||
first_python=
|
first_python=
|
||||||
if test -z "${PYTHON}"; then
|
if test -z "${PYTHON}"; then
|
||||||
# A bare 'python' is traditionally python 2.x, but some distros
|
# A bare 'python' is traditionally python 2.x, but some distros
|
||||||
|
@ -584,8 +581,6 @@ if test "$mingw32" = "yes" ; then
|
||||||
qemu_suffix=""
|
qemu_suffix=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
werror=""
|
|
||||||
|
|
||||||
meson_option_build_array() {
|
meson_option_build_array() {
|
||||||
printf '['
|
printf '['
|
||||||
(if test "$targetos" = windows; then
|
(if test "$targetos" = windows; then
|
||||||
|
|
Loading…
Reference in a new issue