@@ -14,6 +14,344 @@ export CCACHE_RECACHE=yes
# make source path absolute
source_path=$(cd "$(dirname -- "$0")"; pwd)
+werror=""
+
+print_error() {
+ (echo
+ echo "ERROR: $1"
+ while test -n "$2"; do
+ echo " $2"
+ shift
+ done
+ echo) >&2
+}
+
+error_exit() {
+ print_error "$@"
+ exit 1
+}
+
+meson_option_build_array() {
+ printf '['
+ (if test "$targetos" = windows; then
+ IFS=\;
+ else
+ IFS=:
+ fi
+ for e in $1; do
+ printf '"""'
+ # backslash escape any '\' and '"' characters
+ printf "%s" "$e" | sed -e 's/\([\"]\)/\\\1/g'
+ printf '""",'
+ done)
+ printf ']\n'
+}
+
+. "$source_path/scripts/meson-buildoptions.sh"
+
+quote_sh() {
+ printf "%s" "$1" | sed "s,','\\\\'',g; s,.*,'&',"
+}
+
+meson_options=
+meson_option_add() {
+ meson_options="$meson_options $(quote_sh "$1")"
+}
+meson_option_parse() {
+ meson_options="$meson_options $(_meson_option_parse "$@")"
+ if test $? -eq 1; then
+ echo "ERROR: unknown option $1"
+ echo "Try '$0 --help' for more information"
+ exit 1
+ fi
+}
+
+for opt do
+ optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
+ case "$opt" in
+ --help|-h) show_help=yes
+ ;;
+ --version|-V) exec cat "$source_path/VERSION"
+ ;;
+ --prefix=*) prefix="$optarg"
+ ;;
+ --cross-prefix=*)
+ ;;
+ --cc=*)
+ ;;
+ --host-cc=*) host_cc="$optarg"
+ ;;
+ --cxx=*)
+ ;;
+ --objcc=*) objcc="$optarg"
+ ;;
+ --make=*) make="$optarg"
+ ;;
+ --install=*)
+ ;;
+ --python=*) python="$optarg" ; explicit_python=yes
+ ;;
+ --skip-meson) skip_meson=yes
+ ;;
+ --meson=*) meson="$optarg"
+ ;;
+ --ninja=*) ninja="$optarg"
+ ;;
+ --smbd=*) smbd="$optarg"
+ ;;
+ --extra-cflags=*)
+ ;;
+ --extra-cxxflags=*)
+ ;;
+ --extra-objcflags=*)
+ ;;
+ --extra-ldflags=*)
+ ;;
+ --cross-cc-*)
+ ;;
+ --cross-prefix-*)
+ ;;
+ --enable-debug-info) meson_option_add -Ddebug=true
+ ;;
+ --disable-debug-info) meson_option_add -Ddebug=false
+ ;;
+ --enable-modules)
+ modules="yes"
+ ;;
+ --disable-modules)
+ modules="no"
+ ;;
+ --cpu=*)
+ ;;
+ --target-list=*) target_list="$optarg"
+ if test "$target_list_exclude"; then
+ error_exit "Can't mix --target-list with --target-list-exclude"
+ fi
+ ;;
+ --target-list-exclude=*) target_list_exclude="$optarg"
+ if test "$target_list"; then
+ error_exit "Can't mix --target-list-exclude with --target-list"
+ fi
+ ;;
+ --with-default-devices) meson_option_add -Ddefault_devices=true
+ ;;
+ --without-default-devices) meson_option_add -Ddefault_devices=false
+ ;;
+ --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option"
+ ;;
+ --with-devices-*) device_arch=${opt#--with-devices-};
+ device_arch=${device_arch%%=*}
+ cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak
+ if test -f "$cf"; then
+ device_archs="$device_archs $device_arch"
+ eval "devices_${device_arch}=\$optarg"
+ else
+ error_exit "File $cf does not exist"
+ fi
+ ;;
+ --without-default-features) # processed above
+ ;;
+ --static)
+ static="yes"
+ QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
+ ;;
+ --bindir=*) bindir="$optarg"
+ ;;
+ --with-suffix=*) qemu_suffix="$optarg"
+ ;;
+ --host=*|--build=*|\
+ --disable-dependency-tracking|\
+ --sbindir=*|--sharedstatedir=*|\
+ --oldincludedir=*|--datarootdir=*|--infodir=*|\
+ --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
+ # These switches are silently ignored, for compatibility with
+ # autoconf-generated configure scripts. This allows QEMU's
+ # configure to be used by RPM and similar macros that set
+ # lots of directory switches by default.
+ ;;
+ --enable-debug-tcg) debug_tcg="yes"
+ ;;
+ --disable-debug-tcg) debug_tcg="no"
+ ;;
+ --enable-debug)
+ # Enable debugging options that aren't excessively noisy
+ debug_tcg="yes"
+ meson_option_parse --enable-debug-mutex ""
+ meson_option_add -Doptimization=0
+ fortify_source="no"
+ ;;
+ --enable-sanitizers) sanitizers="yes"
+ ;;
+ --disable-sanitizers) sanitizers="no"
+ ;;
+ --enable-tsan) tsan="yes"
+ ;;
+ --disable-tsan) tsan="no"
+ ;;
+ --disable-tcg) tcg="disabled"
+ plugins="no"
+ ;;
+ --enable-tcg) tcg="enabled"
+ ;;
+ --disable-system) softmmu="no"
+ ;;
+ --enable-system) softmmu="yes"
+ ;;
+ --disable-user)
+ linux_user="no" ;
+ bsd_user="no" ;
+ ;;
+ --enable-user) ;;
+ --disable-linux-user) linux_user="no"
+ ;;
+ --enable-linux-user) linux_user="yes"
+ ;;
+ --disable-bsd-user) bsd_user="no"
+ ;;
+ --enable-bsd-user) bsd_user="yes"
+ ;;
+ --enable-pie) pie="yes"
+ ;;
+ --disable-pie) pie="no"
+ ;;
+ --enable-werror) werror="yes"
+ ;;
+ --disable-werror) werror="no"
+ ;;
+ --enable-stack-protector) stack_protector="yes"
+ ;;
+ --disable-stack-protector) stack_protector="no"
+ ;;
+ --enable-safe-stack) safe_stack="yes"
+ ;;
+ --disable-safe-stack) safe_stack="no"
+ ;;
+ --enable-cfi)
+ cfi="true";
+ meson_option_add -Db_lto=true
+ ;;
+ --disable-cfi) cfi="false"
+ ;;
+ --disable-fdt) fdt="disabled"
+ ;;
+ --enable-fdt) fdt="enabled"
+ ;;
+ --enable-fdt=git) fdt="internal"
+ ;;
+ --enable-fdt=*) fdt="$optarg"
+ ;;
+ --with-coroutine=*) coroutine="$optarg"
+ ;;
+ --with-git=*) git="$optarg"
+ ;;
+ --with-git-submodules=*)
+ git_submodules_action="$optarg"
+ ;;
+ --enable-plugins) if test "$mingw32" = "yes"; then
+ error_exit "TCG plugins not currently supported on Windows platforms"
+ else
+ plugins="yes"
+ fi
+ ;;
+ --disable-plugins) plugins="no"
+ ;;
+ --enable-containers) use_containers="yes"
+ ;;
+ --disable-containers) use_containers="no"
+ ;;
+ --gdb=*) gdb_bin="$optarg"
+ ;;
+ --enable-vfio-user-server) vfio_user_server="enabled"
+ ;;
+ --disable-vfio-user-server) vfio_user_server="disabled"
+ ;;
+ # everything else has the same name in configure and meson
+ --*) meson_option_parse "$opt" "$optarg"
+ ;;
+ esac
+done
+
+# test for any invalid configuration combinations
+if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
+ error_exit "Can't enable plugins on non-TCG builds"
+fi
+
+if test x"$show_help" = x"yes" ; then
+cat << EOF
+
+Usage: configure [options]
+Options: [defaults in brackets after descriptions]
+
+Standard options:
+ --help print this message
+ --prefix=PREFIX install in PREFIX [$prefix]
+ --target-list=LIST set target list (default: build all)
+$(echo Available targets: $default_target_list | \
+ fold -s -w 53 | sed -e 's/^/ /')
+ --target-list-exclude=LIST exclude a set of targets from the default target-list
+
+Advanced options (experts only):
+ --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix]
+ --cc=CC use C compiler CC [$cc]
+ --host-cc=CC use C compiler CC [$host_cc] for code run at
+ build time
+ --cxx=CXX use C++ compiler CXX [$cxx]
+ --objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
+ --extra-cflags=CFLAGS append extra C compiler flags CFLAGS
+ --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
+ --extra-objcflags=OBJCFLAGS append extra Objective C compiler flags OBJCFLAGS
+ --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
+ --cross-cc-ARCH=CC use compiler when building ARCH guest test cases
+ --cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests
+ --cross-prefix-ARCH=PREFIX cross compiler prefix when building ARCH guest test cases
+ --make=MAKE use specified make [$make]
+ --python=PYTHON use specified python [$python]
+ --meson=MESON use specified meson [$meson]
+ --ninja=NINJA use specified ninja [$ninja]
+ --smbd=SMBD use specified smbd [$smbd]
+ --with-git=GIT use specified git [$git]
+ --with-git-submodules=update update git submodules (default if .git dir exists)
+ --with-git-submodules=validate fail if git submodules are not up to date
+ --with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
+ --static enable static build [$static]
+ --bindir=PATH install binaries in PATH
+ --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
+ --without-default-features default all --enable-* options to "disabled"
+ --without-default-devices do not include any device that is not needed to
+ start the emulator (only use if you are including
+ desired devices in configs/devices/)
+ --with-devices-ARCH=NAME override default configs/devices
+ --enable-debug enable common debug build options
+ --enable-sanitizers enable default sanitizers
+ --enable-tsan enable thread sanitizer
+ --disable-werror disable compilation abort on warning
+ --disable-stack-protector disable compiler-provided stack protection
+ --cpu=CPU Build for host CPU [$cpu]
+ --with-coroutine=BACKEND coroutine backend. Supported options:
+ ucontext, sigaltstack, windows
+ --enable-plugins
+ enable plugins via shared library loading
+ --disable-containers don't use containers for cross-building
+ --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin]
+EOF
+ meson_options_help
+cat << EOF
+ system all system emulation targets
+ user supported user emulation targets
+ linux-user all linux usermode emulation targets
+ bsd-user all BSD usermode emulation targets
+ pie Position Independent Executables
+ modules modules support (non-Windows)
+ debug-tcg TCG debugging (default is disabled)
+ debug-info debugging information
+ safe-stack SafeStack Stack Smash Protection. Depends on
+ clang/llvm >= 3.7 and requires coroutine backend ucontext.
+
+NOTE: The object files are built at the place where configure is launched
+EOF
+exit 0
+fi
+
if test "$PWD" = "$source_path"
then
echo "Using './build' as the directory for build output"
@@ -93,25 +431,6 @@ invoke=$(printf " '%s'" "$0" "$@")
test -n "$GITLAB_CI" && echo "configuring with: $invoke"
{ echo "$invoke"; echo; echo "#"; } >> config.log
-quote_sh() {
- printf "%s" "$1" | sed "s,','\\\\'',g; s,.*,'&',"
-}
-
-print_error() {
- (echo
- echo "ERROR: $1"
- while test -n "$2"; do
- echo " $2"
- shift
- done
- echo) >&2
-}
-
-error_exit() {
- print_error "$@"
- exit 1
-}
-
do_compiler() {
# Run the compiler, capturing its output to the log. First argument
# is compiler binary to execute.
@@ -639,249 +958,6 @@ if test "$mingw32" = "yes" ; then
qemu_suffix=""
fi
-werror=""
-
-meson_option_build_array() {
- printf '['
- (if test "$targetos" = windows; then
- IFS=\;
- else
- IFS=:
- fi
- for e in $1; do
- printf '"""'
- # backslash escape any '\' and '"' characters
- printf "%s" "$e" | sed -e 's/\([\"]\)/\\\1/g'
- printf '""",'
- done)
- printf ']\n'
-}
-
-. "$source_path/scripts/meson-buildoptions.sh"
-
-meson_options=
-meson_option_add() {
- meson_options="$meson_options $(quote_sh "$1")"
-}
-meson_option_parse() {
- meson_options="$meson_options $(_meson_option_parse "$@")"
- if test $? -eq 1; then
- echo "ERROR: unknown option $1"
- echo "Try '$0 --help' for more information"
- exit 1
- fi
-}
-
-for opt do
- optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
- case "$opt" in
- --help|-h) show_help=yes
- ;;
- --version|-V) exec cat "$source_path/VERSION"
- ;;
- --prefix=*) prefix="$optarg"
- ;;
- --cross-prefix=*)
- ;;
- --cc=*)
- ;;
- --host-cc=*) host_cc="$optarg"
- ;;
- --cxx=*)
- ;;
- --objcc=*) objcc="$optarg"
- ;;
- --make=*) make="$optarg"
- ;;
- --install=*)
- ;;
- --python=*) python="$optarg" ; explicit_python=yes
- ;;
- --skip-meson) skip_meson=yes
- ;;
- --meson=*) meson="$optarg"
- ;;
- --ninja=*) ninja="$optarg"
- ;;
- --smbd=*) smbd="$optarg"
- ;;
- --extra-cflags=*)
- ;;
- --extra-cxxflags=*)
- ;;
- --extra-objcflags=*)
- ;;
- --extra-ldflags=*)
- ;;
- --cross-cc-*)
- ;;
- --cross-prefix-*)
- ;;
- --enable-debug-info) meson_option_add -Ddebug=true
- ;;
- --disable-debug-info) meson_option_add -Ddebug=false
- ;;
- --enable-modules)
- modules="yes"
- ;;
- --disable-modules)
- modules="no"
- ;;
- --cpu=*)
- ;;
- --target-list=*) target_list="$optarg"
- if test "$target_list_exclude"; then
- error_exit "Can't mix --target-list with --target-list-exclude"
- fi
- ;;
- --target-list-exclude=*) target_list_exclude="$optarg"
- if test "$target_list"; then
- error_exit "Can't mix --target-list-exclude with --target-list"
- fi
- ;;
- --with-default-devices) meson_option_add -Ddefault_devices=true
- ;;
- --without-default-devices) meson_option_add -Ddefault_devices=false
- ;;
- --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option"
- ;;
- --with-devices-*) device_arch=${opt#--with-devices-};
- device_arch=${device_arch%%=*}
- cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak
- if test -f "$cf"; then
- device_archs="$device_archs $device_arch"
- eval "devices_${device_arch}=\$optarg"
- else
- error_exit "File $cf does not exist"
- fi
- ;;
- --without-default-features) # processed above
- ;;
- --static)
- static="yes"
- QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
- ;;
- --bindir=*) bindir="$optarg"
- ;;
- --with-suffix=*) qemu_suffix="$optarg"
- ;;
- --host=*|--build=*|\
- --disable-dependency-tracking|\
- --sbindir=*|--sharedstatedir=*|\
- --oldincludedir=*|--datarootdir=*|--infodir=*|\
- --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
- # These switches are silently ignored, for compatibility with
- # autoconf-generated configure scripts. This allows QEMU's
- # configure to be used by RPM and similar macros that set
- # lots of directory switches by default.
- ;;
- --enable-debug-tcg) debug_tcg="yes"
- ;;
- --disable-debug-tcg) debug_tcg="no"
- ;;
- --enable-debug)
- # Enable debugging options that aren't excessively noisy
- debug_tcg="yes"
- meson_option_parse --enable-debug-mutex ""
- meson_option_add -Doptimization=0
- fortify_source="no"
- ;;
- --enable-sanitizers) sanitizers="yes"
- ;;
- --disable-sanitizers) sanitizers="no"
- ;;
- --enable-tsan) tsan="yes"
- ;;
- --disable-tsan) tsan="no"
- ;;
- --disable-tcg) tcg="disabled"
- plugins="no"
- ;;
- --enable-tcg) tcg="enabled"
- ;;
- --disable-system) softmmu="no"
- ;;
- --enable-system) softmmu="yes"
- ;;
- --disable-user)
- linux_user="no" ;
- bsd_user="no" ;
- ;;
- --enable-user) ;;
- --disable-linux-user) linux_user="no"
- ;;
- --enable-linux-user) linux_user="yes"
- ;;
- --disable-bsd-user) bsd_user="no"
- ;;
- --enable-bsd-user) bsd_user="yes"
- ;;
- --enable-pie) pie="yes"
- ;;
- --disable-pie) pie="no"
- ;;
- --enable-werror) werror="yes"
- ;;
- --disable-werror) werror="no"
- ;;
- --enable-stack-protector) stack_protector="yes"
- ;;
- --disable-stack-protector) stack_protector="no"
- ;;
- --enable-safe-stack) safe_stack="yes"
- ;;
- --disable-safe-stack) safe_stack="no"
- ;;
- --enable-cfi)
- cfi="true";
- meson_option_add -Db_lto=true
- ;;
- --disable-cfi) cfi="false"
- ;;
- --disable-fdt) fdt="disabled"
- ;;
- --enable-fdt) fdt="enabled"
- ;;
- --enable-fdt=git) fdt="internal"
- ;;
- --enable-fdt=*) fdt="$optarg"
- ;;
- --with-coroutine=*) coroutine="$optarg"
- ;;
- --with-git=*) git="$optarg"
- ;;
- --with-git-submodules=*)
- git_submodules_action="$optarg"
- ;;
- --enable-plugins) if test "$mingw32" = "yes"; then
- error_exit "TCG plugins not currently supported on Windows platforms"
- else
- plugins="yes"
- fi
- ;;
- --disable-plugins) plugins="no"
- ;;
- --enable-containers) use_containers="yes"
- ;;
- --disable-containers) use_containers="no"
- ;;
- --gdb=*) gdb_bin="$optarg"
- ;;
- --enable-vfio-user-server) vfio_user_server="enabled"
- ;;
- --disable-vfio-user-server) vfio_user_server="disabled"
- ;;
- # everything else has the same name in configure and meson
- --*) meson_option_parse "$opt" "$optarg"
- ;;
- esac
-done
-
-# test for any invalid configuration combinations
-if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
- error_exit "Can't enable plugins on non-TCG builds"
-fi
-
case $git_submodules_action in
update|validate)
if test ! -e "$source_path/.git"; then
@@ -954,82 +1030,6 @@ for config in $mak_wilds; do
fi
done
-if test x"$show_help" = x"yes" ; then
-cat << EOF
-
-Usage: configure [options]
-Options: [defaults in brackets after descriptions]
-
-Standard options:
- --help print this message
- --prefix=PREFIX install in PREFIX [$prefix]
- --target-list=LIST set target list (default: build all)
-$(echo Available targets: $default_target_list | \
- fold -s -w 53 | sed -e 's/^/ /')
- --target-list-exclude=LIST exclude a set of targets from the default target-list
-
-Advanced options (experts only):
- --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix]
- --cc=CC use C compiler CC [$cc]
- --host-cc=CC use C compiler CC [$host_cc] for code run at
- build time
- --cxx=CXX use C++ compiler CXX [$cxx]
- --objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
- --extra-cflags=CFLAGS append extra C compiler flags CFLAGS
- --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
- --extra-objcflags=OBJCFLAGS append extra Objective C compiler flags OBJCFLAGS
- --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
- --cross-cc-ARCH=CC use compiler when building ARCH guest test cases
- --cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests
- --cross-prefix-ARCH=PREFIX cross compiler prefix when building ARCH guest test cases
- --make=MAKE use specified make [$make]
- --python=PYTHON use specified python [$python]
- --meson=MESON use specified meson [$meson]
- --ninja=NINJA use specified ninja [$ninja]
- --smbd=SMBD use specified smbd [$smbd]
- --with-git=GIT use specified git [$git]
- --with-git-submodules=update update git submodules (default if .git dir exists)
- --with-git-submodules=validate fail if git submodules are not up to date
- --with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
- --static enable static build [$static]
- --bindir=PATH install binaries in PATH
- --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
- --without-default-features default all --enable-* options to "disabled"
- --without-default-devices do not include any device that is not needed to
- start the emulator (only use if you are including
- desired devices in configs/devices/)
- --with-devices-ARCH=NAME override default configs/devices
- --enable-debug enable common debug build options
- --enable-sanitizers enable default sanitizers
- --enable-tsan enable thread sanitizer
- --disable-werror disable compilation abort on warning
- --disable-stack-protector disable compiler-provided stack protection
- --cpu=CPU Build for host CPU [$cpu]
- --with-coroutine=BACKEND coroutine backend. Supported options:
- ucontext, sigaltstack, windows
- --enable-plugins
- enable plugins via shared library loading
- --disable-containers don't use containers for cross-building
- --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin]
-EOF
- meson_options_help
-cat << EOF
- system all system emulation targets
- user supported user emulation targets
- linux-user all linux usermode emulation targets
- bsd-user all BSD usermode emulation targets
- pie Position Independent Executables
- modules modules support (non-Windows)
- debug-tcg TCG debugging (default is disabled)
- debug-info debugging information
- safe-stack SafeStack Stack Smash Protection. Depends on
- clang/llvm >= 3.7 and requires coroutine backend ucontext.
-
-NOTE: The object files are built at the place where configure is launched
-EOF
-exit 0
-fi
-
# Remove old dependency files to make sure that they get properly regenerated
rm -f ./*/config-devices.mak.d