aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-05-11 09:34:13 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-05-18 13:35:28 +0200
commit13cf376c1f5ee778d1ddae043346d494b4627cb2 (patch)
treeda57d3ce14406378929c3c0a5bb9077fb9d812e8 /configure
parenteebcddf2fd41a6c8776533b242d592f3a01e5fda (diff)
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>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure121
1 files changed, 58 insertions, 63 deletions
diff --git a/configure b/configure
index 7a5edc1b95..5d3e3d39ee 100755
--- a/configure
+++ b/configure
@@ -177,29 +177,18 @@ then
error_exit "main directory cannot contain spaces nor colons"
fi
+# parse CC options first; some compiler tests are used to establish
+# some defaults, based on the host environment
+
# default parameters
cpu=""
-static="no"
cross_compile="no"
cross_prefix=""
host_cc="cc"
-use_containers="yes"
-gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
-gdb_arches=""
-
-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
+EXTRA_CFLAGS=""
+EXTRA_CXXFLAGS=""
+EXTRA_OBJCFLAGS=""
+EXTRA_LDFLAGS=""
# Default value for a variable defining feature "foo".
# * 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.
# 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.
-
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
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
case "$opt" in
@@ -293,9 +241,60 @@ for opt do
--cross-prefix-*) cc_arch=${opt#--cross-prefix-}; cc_arch=${cc_arch%%=*}
eval "cross_prefix_${cc_arch}=\$optarg"
;;
+ --without-default-features) default_feature="no"
+ ;;
esac
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:
# ${CC} (if set)
# ${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))'
}
-python=
-pypi="enabled"
first_python=
if test -z "${PYTHON}"; then
# A bare 'python' is traditionally python 2.x, but some distros
@@ -584,8 +581,6 @@ if test "$mingw32" = "yes" ; then
qemu_suffix=""
fi
-werror=""
-
meson_option_build_array() {
printf '['
(if test "$targetos" = windows; then