aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure82
1 files changed, 38 insertions, 44 deletions
diff --git a/configure b/configure
index 2ba1a82613..dc53e4df03 100755
--- a/configure
+++ b/configure
@@ -57,7 +57,7 @@ GNUmakefile: ;
EOF
cd build
- exec $source_path/configure "$@"
+ exec "$source_path/configure" "$@"
fi
# Temporary directory used for files created while
@@ -67,8 +67,7 @@ fi
# it when configure exits.)
TMPDIR1="config-temp"
rm -rf "${TMPDIR1}"
-mkdir -p "${TMPDIR1}"
-if [ $? -ne 0 ]; then
+if ! mkdir -p "${TMPDIR1}"; then
echo "ERROR: failed to create temporary directory"
exit 1
fi
@@ -111,7 +110,7 @@ error_exit() {
do_compiler() {
# Run the compiler, capturing its output to the log. First argument
# is compiler binary to execute.
- local compiler="$1"
+ compiler="$1"
shift
if test -n "$BASH_VERSION"; then eval '
echo >>config.log "
@@ -311,7 +310,6 @@ pie=""
coroutine=""
plugins="$default_feature"
meson=""
-meson_args=""
ninja=""
bindir="bin"
skip_meson=no
@@ -687,7 +685,7 @@ meson_option_build_array() {
printf ']\n'
}
-. $source_path/scripts/meson-buildoptions.sh
+. "$source_path/scripts/meson-buildoptions.sh"
meson_options=
meson_option_add() {
@@ -707,7 +705,7 @@ for opt do
case "$opt" in
--help|-h) show_help=yes
;;
- --version|-V) exec cat $source_path/VERSION
+ --version|-V) exec cat "$source_path/VERSION"
;;
--prefix=*) prefix="$optarg"
;;
@@ -973,7 +971,7 @@ default_target_list=""
mak_wilds=""
if [ "$linux_user" != no ]; then
- if [ "$targetos" = linux ] && [ -d $source_path/linux-user/include/host/$cpu ]; then
+ if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$cpu" ]; then
linux_user=yes
elif [ "$linux_user" = yes ]; then
error_exit "linux-user not supported on this architecture"
@@ -983,7 +981,7 @@ if [ "$bsd_user" != no ]; then
if [ "$bsd_user" = "" ]; then
test $targetos = freebsd && bsd_user=yes
fi
- if [ "$bsd_user" = yes ] && ! [ -d $source_path/bsd-user/$targetos ]; then
+ if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
error_exit "bsd-user not supported on this host OS"
fi
fi
@@ -1081,7 +1079,7 @@ exit 0
fi
# Remove old dependency files to make sure that they get properly regenerated
-rm -f */config-devices.mak.d
+rm -f ./*/config-devices.mak.d
if test -z "$python"
then
@@ -1099,16 +1097,13 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
"Use --python=/path/to/python to specify a supported Python."
fi
-# Preserve python version since some functionality is dependent on it
-python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null)
-
# Suppress writing compiled files
python="$python -B"
if test -z "$meson"; then
if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.59.3; then
meson=meson
- elif test $git_submodules_action != 'ignore' ; then
+ elif test "$git_submodules_action" != 'ignore' ; then
meson=git
elif test -e "${source_path}/meson/meson.py" ; then
meson=internal
@@ -1816,7 +1811,7 @@ fi
container="no"
if test $use_containers = "yes"; then
if has "docker" || has "podman"; then
- container=$($python $source_path/tests/docker/docker.py probe)
+ container=$($python "$source_path"/tests/docker/docker.py probe)
fi
fi
@@ -2048,7 +2043,6 @@ probe_target_compiler() {
: ${container_cross_strip:=${container_cross_prefix}strip}
done
- local t try
try=cross
case "$target_arch:$cpu" in
aarch64_be:aarch64 | \
@@ -2061,8 +2055,8 @@ probe_target_compiler() {
try='native cross' ;;
esac
eval "target_cflags=\${cross_cc_cflags_$target_arch}"
- for t in $try; do
- case $t in
+ for thistry in $try; do
+ case $thistry in
native)
target_cc=$cc
target_ccas=$ccas
@@ -2266,7 +2260,7 @@ if test "$QEMU_GA_DISTRO" = ""; then
QEMU_GA_DISTRO=Linux
fi
if test "$QEMU_GA_VERSION" = ""; then
- QEMU_GA_VERSION=$(cat $source_path/VERSION)
+ QEMU_GA_VERSION=$(cat "$source_path"/VERSION)
fi
@@ -2293,7 +2287,7 @@ LINKS="$LINKS python"
LINKS="$LINKS contrib/plugins/Makefile "
for f in $LINKS ; do
if [ -e "$source_path/$f" ]; then
- mkdir -p `dirname ./$f`
+ mkdir -p "$(dirname ./"$f")"
symlink "$source_path/$f" "$f"
fi
done
@@ -2515,7 +2509,7 @@ fi
for target in $target_list; do
target_dir="$target"
target_name=$(echo $target | cut -d '-' -f 1)$EXESUF
- mkdir -p $target_dir
+ mkdir -p "$target_dir"
case $target in
*-user) symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" ;;
*) symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" ;;
@@ -2550,14 +2544,14 @@ for target in $target_list; do
config_target_mak=tests/tcg/config-$target.mak
echo "# Automatically generated by configure - do not modify" > $config_target_mak
- echo "TARGET_NAME=$arch" >> $config_target_mak
+ echo "TARGET_NAME=$arch" >> "$config_target_mak"
case $target in
xtensa*-linux-user)
# the toolchain is not complete with headers, only build softmmu tests
continue
;;
*-softmmu)
- test -f $source_path/tests/tcg/$arch/Makefile.softmmu-target || continue
+ test -f "$source_path/tests/tcg/$arch/Makefile.softmmu-target" || continue
qemu="qemu-system-$arch"
;;
*-linux-user|*-bsd-user)
@@ -2572,73 +2566,73 @@ for target in $target_list; do
# compilers is a requirememt for adding a new test that needs a
# compiler feature.
- echo "BUILD_STATIC=$build_static" >> $config_target_mak
- write_target_makefile >> $config_target_mak
+ echo "BUILD_STATIC=$build_static" >> "$config_target_mak"
+ write_target_makefile >> "$config_target_mak"
case $target in
aarch64-*)
if do_compiler "$target_cc" $target_cflags \
-march=armv8.1-a+sve -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_SVE=y" >> "$config_target_mak"
fi
if do_compiler "$target_cc" $target_cflags \
-march=armv8.1-a+sve2 -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_SVE2=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_SVE2=y" >> "$config_target_mak"
fi
if do_compiler "$target_cc" $target_cflags \
-march=armv8.3-a -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_ARMV8_3=y" >> "$config_target_mak"
fi
if do_compiler "$target_cc" $target_cflags \
-mbranch-protection=standard -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_ARMV8_BTI=y" >> "$config_target_mak"
fi
if do_compiler "$target_cc" $target_cflags \
-march=armv8.5-a+memtag -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_ARMV8_MTE=y" >> "$config_target_mak"
fi
;;
ppc*)
if do_compiler "$target_cc" $target_cflags \
-mpower8-vector -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> "$config_target_mak"
fi
if do_compiler "$target_cc" $target_cflags \
-mpower10 -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_POWER10=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_POWER10=y" >> "$config_target_mak"
fi
;;
i386-linux-user)
if do_compiler "$target_cc" $target_cflags \
-Werror -fno-pie -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_I386_NOPIE=y" >> "$config_target_mak"
fi
;;
esac
elif test -n "$container_image"; then
echo "build-tcg-tests-$target: docker-image-$container_image" >> $makefile
- echo "BUILD_STATIC=y" >> $config_target_mak
- write_container_target_makefile >> $config_target_mak
+ echo "BUILD_STATIC=y" >> "$config_target_mak"
+ write_container_target_makefile >> "$config_target_mak"
case $target in
aarch64-*)
- echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
- echo "CROSS_CC_HAS_SVE2=y" >> $config_target_mak
- echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
- echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
- echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_SVE=y" >> "$config_target_mak"
+ echo "CROSS_CC_HAS_SVE2=y" >> "$config_target_mak"
+ echo "CROSS_CC_HAS_ARMV8_3=y" >> "$config_target_mak"
+ echo "CROSS_CC_HAS_ARMV8_BTI=y" >> "$config_target_mak"
+ echo "CROSS_CC_HAS_ARMV8_MTE=y" >> "$config_target_mak"
;;
ppc*)
- echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
- echo "CROSS_CC_HAS_POWER10=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> "$config_target_mak"
+ echo "CROSS_CC_HAS_POWER10=y" >> "$config_target_mak"
;;
i386-linux-user)
- echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
+ echo "CROSS_CC_HAS_I386_NOPIE=y" >> "$config_target_mak"
;;
esac
got_cross_cc=yes
fi
if test $got_cross_cc = yes; then
mkdir -p tests/tcg/$target
- echo "QEMU=$PWD/$qemu" >> $config_target_mak
+ echo "QEMU=$PWD/$qemu" >> "$config_target_mak"
echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile
tcg_tests_targets="$tcg_tests_targets $target"
fi