mirror of https://github.com/xemu-project/xemu.git
configure: move target-specific defaults to an external machine file
Enable Windows-specific defaults with a machine file, so that related options can be automatically parsed and included in the help message. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
050b439887
commit
c36dd41ba2
|
@ -0,0 +1,9 @@
|
||||||
|
# target-specific defaults, can still be overridden on
|
||||||
|
# the command line
|
||||||
|
|
||||||
|
[built-in options]
|
||||||
|
bindir = ''
|
||||||
|
prefix = '/qemu'
|
||||||
|
|
||||||
|
[project options]
|
||||||
|
qemu_suffix = ''
|
|
@ -246,8 +246,6 @@ default_cflags='-O2 -g'
|
||||||
git_submodules_action="update"
|
git_submodules_action="update"
|
||||||
docs="auto"
|
docs="auto"
|
||||||
EXESUF=""
|
EXESUF=""
|
||||||
prefix="/usr/local"
|
|
||||||
qemu_suffix="qemu"
|
|
||||||
system="yes"
|
system="yes"
|
||||||
linux_user=""
|
linux_user=""
|
||||||
bsd_user=""
|
bsd_user=""
|
||||||
|
@ -256,7 +254,6 @@ subdirs=""
|
||||||
ninja=""
|
ninja=""
|
||||||
python=
|
python=
|
||||||
download="enabled"
|
download="enabled"
|
||||||
bindir="bin"
|
|
||||||
skip_meson=no
|
skip_meson=no
|
||||||
use_containers="yes"
|
use_containers="yes"
|
||||||
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
|
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
|
||||||
|
@ -583,9 +580,6 @@ done
|
||||||
|
|
||||||
if test "$targetos" = "windows" ; then
|
if test "$targetos" = "windows" ; then
|
||||||
EXESUF=".exe"
|
EXESUF=".exe"
|
||||||
prefix="/qemu"
|
|
||||||
bindir=""
|
|
||||||
qemu_suffix=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
meson_option_build_array() {
|
meson_option_build_array() {
|
||||||
|
@ -622,6 +616,14 @@ meson_option_parse() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meson_add_machine_file() {
|
||||||
|
if test "$cross_compile" = "yes"; then
|
||||||
|
meson_option_add --cross-file "$1"
|
||||||
|
else
|
||||||
|
meson_option_add --native-file "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
for opt do
|
for opt do
|
||||||
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
|
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
|
@ -629,8 +631,6 @@ for opt do
|
||||||
;;
|
;;
|
||||||
--version|-V) exec cat "$source_path/VERSION"
|
--version|-V) exec cat "$source_path/VERSION"
|
||||||
;;
|
;;
|
||||||
--prefix=*) prefix="$optarg"
|
|
||||||
;;
|
|
||||||
--cross-prefix=*)
|
--cross-prefix=*)
|
||||||
;;
|
;;
|
||||||
--cc=*)
|
--cc=*)
|
||||||
|
@ -701,10 +701,6 @@ for opt do
|
||||||
;;
|
;;
|
||||||
--static) static="yes"
|
--static) static="yes"
|
||||||
;;
|
;;
|
||||||
--bindir=*) bindir="$optarg"
|
|
||||||
;;
|
|
||||||
--with-suffix=*) qemu_suffix="$optarg"
|
|
||||||
;;
|
|
||||||
--host=*|--build=*|\
|
--host=*|--build=*|\
|
||||||
--disable-dependency-tracking|\
|
--disable-dependency-tracking|\
|
||||||
--sbindir=*|--sharedstatedir=*|\
|
--sbindir=*|--sharedstatedir=*|\
|
||||||
|
@ -861,7 +857,6 @@ Options: [defaults in brackets after descriptions]
|
||||||
|
|
||||||
Standard options:
|
Standard options:
|
||||||
--help print this message
|
--help print this message
|
||||||
--prefix=PREFIX install in PREFIX [$prefix]
|
|
||||||
--target-list=LIST set target list (default: build all)
|
--target-list=LIST set target list (default: build all)
|
||||||
$(echo Available targets: $default_target_list | \
|
$(echo Available targets: $default_target_list | \
|
||||||
fold -s -w 53 | sed -e 's/^/ /')
|
fold -s -w 53 | sed -e 's/^/ /')
|
||||||
|
@ -886,8 +881,6 @@ Advanced options (experts only):
|
||||||
--ninja=NINJA use specified ninja [$ninja]
|
--ninja=NINJA use specified ninja [$ninja]
|
||||||
--smbd=SMBD use specified smbd [$smbd]
|
--smbd=SMBD use specified smbd [$smbd]
|
||||||
--static enable static build [$static]
|
--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-features default all --enable-* options to "disabled"
|
||||||
--without-default-devices do not include any device that is not needed to
|
--without-default-devices do not include any device that is not needed to
|
||||||
start the emulator (only use if you are including
|
start the emulator (only use if you are including
|
||||||
|
@ -1803,24 +1796,25 @@ if test "$skip_meson" = no; then
|
||||||
else
|
else
|
||||||
echo "endian = 'little'" >> $cross
|
echo "endian = 'little'" >> $cross
|
||||||
fi
|
fi
|
||||||
cross_arg="--cross-file config-meson.cross"
|
|
||||||
|
|
||||||
native="config-meson.native.new"
|
native="config-meson.native.new"
|
||||||
echo "# Automatically generated by configure - do not modify" > $native
|
echo "# Automatically generated by configure - do not modify" > $native
|
||||||
echo "[binaries]" >> $native
|
echo "[binaries]" >> $native
|
||||||
echo "c = [$(meson_quote $host_cc)]" >> $native
|
echo "c = [$(meson_quote $host_cc)]" >> $native
|
||||||
mv $native config-meson.native
|
mv $native config-meson.native
|
||||||
cross_arg="$cross_arg --native-file config-meson.native"
|
meson_option_add --native-file
|
||||||
else
|
meson_option_add config-meson.native
|
||||||
cross_arg="--native-file config-meson.cross"
|
|
||||||
fi
|
fi
|
||||||
mv $cross config-meson.cross
|
mv $cross config-meson.cross
|
||||||
|
meson_add_machine_file config-meson.cross
|
||||||
|
if test -f "$source_path/configs/meson/$targetos.txt"; then
|
||||||
|
meson_add_machine_file $source_path/configs/meson/$targetos.txt
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf meson-private meson-info meson-logs
|
rm -rf meson-private meson-info meson-logs
|
||||||
|
|
||||||
# Built-in options
|
# Built-in options
|
||||||
test "$download" = "disabled" && meson_option_add "--wrap-mode=nodownload"
|
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 "$default_feature" = no && meson_option_add -Dauto_features=disabled
|
||||||
test "$static" = yes && meson_option_add -Dprefer_static=true
|
test "$static" = yes && meson_option_add -Dprefer_static=true
|
||||||
test "$pie" = no && meson_option_add -Db_pie=false
|
test "$pie" = no && meson_option_add -Db_pie=false
|
||||||
|
@ -1831,11 +1825,10 @@ if test "$skip_meson" = no; then
|
||||||
test "$docs" != auto && meson_option_add "-Ddocs=$docs"
|
test "$docs" != auto && meson_option_add "-Ddocs=$docs"
|
||||||
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
|
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
|
||||||
test "$plugins" = yes && meson_option_add "-Dplugins=true"
|
test "$plugins" = yes && meson_option_add "-Dplugins=true"
|
||||||
test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
|
|
||||||
test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
|
test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
|
||||||
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
|
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
|
||||||
run_meson() {
|
run_meson() {
|
||||||
NINJA=$ninja $meson setup --prefix "$prefix" "$@" $cross_arg "$PWD" "$source_path"
|
NINJA=$ninja $meson setup "$@" "$PWD" "$source_path"
|
||||||
}
|
}
|
||||||
eval run_meson $meson_options
|
eval run_meson $meson_options
|
||||||
if test "$?" -ne 0 ; then
|
if test "$?" -ne 0 ; then
|
||||||
|
|
|
@ -28,7 +28,6 @@ import sys
|
||||||
SKIP_OPTIONS = {
|
SKIP_OPTIONS = {
|
||||||
"default_devices",
|
"default_devices",
|
||||||
"fuzzing_engine",
|
"fuzzing_engine",
|
||||||
"qemu_suffix",
|
|
||||||
"smbd",
|
"smbd",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +39,7 @@ OPTION_NAMES = {
|
||||||
"malloc": "enable-malloc",
|
"malloc": "enable-malloc",
|
||||||
"pkgversion": "with-pkgversion",
|
"pkgversion": "with-pkgversion",
|
||||||
"qemu_firmwarepath": "firmwarepath",
|
"qemu_firmwarepath": "firmwarepath",
|
||||||
|
"qemu_suffix": "with-suffix",
|
||||||
"trace_backends": "enable-trace-backends",
|
"trace_backends": "enable-trace-backends",
|
||||||
"trace_file": "with-trace-file",
|
"trace_file": "with-trace-file",
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ AUTO_OPTIONS = {
|
||||||
BUILTIN_OPTIONS = {
|
BUILTIN_OPTIONS = {
|
||||||
"b_coverage",
|
"b_coverage",
|
||||||
"b_lto",
|
"b_lto",
|
||||||
|
"bindir",
|
||||||
"datadir",
|
"datadir",
|
||||||
"debug",
|
"debug",
|
||||||
"includedir",
|
"includedir",
|
||||||
|
@ -60,6 +61,7 @@ BUILTIN_OPTIONS = {
|
||||||
"localedir",
|
"localedir",
|
||||||
"localstatedir",
|
"localstatedir",
|
||||||
"mandir",
|
"mandir",
|
||||||
|
"prefix",
|
||||||
"strip",
|
"strip",
|
||||||
"sysconfdir",
|
"sysconfdir",
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ meson_options_help() {
|
||||||
printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices: alsa/co'
|
printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices: alsa/co'
|
||||||
printf "%s\n" ' reaudio/default/dsound/jack/oss/pa/pipewire/sdl/s'
|
printf "%s\n" ' reaudio/default/dsound/jack/oss/pa/pipewire/sdl/s'
|
||||||
printf "%s\n" ' ndio)'
|
printf "%s\n" ' ndio)'
|
||||||
|
printf "%s\n" ' --bindir=VALUE Executable directory [bin]'
|
||||||
printf "%s\n" ' --block-drv-ro-whitelist=VALUE'
|
printf "%s\n" ' --block-drv-ro-whitelist=VALUE'
|
||||||
printf "%s\n" ' set block driver read-only whitelist (by default'
|
printf "%s\n" ' set block driver read-only whitelist (by default'
|
||||||
printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
|
printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
|
||||||
|
@ -62,6 +63,7 @@ meson_options_help() {
|
||||||
printf "%s\n" ' --localedir=VALUE Locale data directory [share/locale]'
|
printf "%s\n" ' --localedir=VALUE Locale data directory [share/locale]'
|
||||||
printf "%s\n" ' --localstatedir=VALUE Localstate data directory [/var/local]'
|
printf "%s\n" ' --localstatedir=VALUE Localstate data directory [/var/local]'
|
||||||
printf "%s\n" ' --mandir=VALUE Manual page directory [share/man]'
|
printf "%s\n" ' --mandir=VALUE Manual page directory [share/man]'
|
||||||
|
printf "%s\n" ' --prefix=VALUE Installation prefix [/usr/local]'
|
||||||
printf "%s\n" ' --sysconfdir=VALUE Sysconf data directory [etc]'
|
printf "%s\n" ' --sysconfdir=VALUE Sysconf data directory [etc]'
|
||||||
printf "%s\n" ' --tls-priority=VALUE Default TLS protocol/cipher priority string'
|
printf "%s\n" ' --tls-priority=VALUE Default TLS protocol/cipher priority string'
|
||||||
printf "%s\n" ' [NORMAL]'
|
printf "%s\n" ' [NORMAL]'
|
||||||
|
@ -69,6 +71,8 @@ meson_options_help() {
|
||||||
printf "%s\n" ' auto/sigaltstack/ucontext/windows)'
|
printf "%s\n" ' auto/sigaltstack/ucontext/windows)'
|
||||||
printf "%s\n" ' --with-pkgversion=VALUE use specified string as sub-version of the'
|
printf "%s\n" ' --with-pkgversion=VALUE use specified string as sub-version of the'
|
||||||
printf "%s\n" ' package'
|
printf "%s\n" ' package'
|
||||||
|
printf "%s\n" ' --with-suffix=VALUE Suffix for QEMU data/modules/config directories'
|
||||||
|
printf "%s\n" ' (can be empty) [qemu]'
|
||||||
printf "%s\n" ' --with-trace-file=VALUE Trace file prefix for simple backend [trace]'
|
printf "%s\n" ' --with-trace-file=VALUE Trace file prefix for simple backend [trace]'
|
||||||
printf "%s\n" ''
|
printf "%s\n" ''
|
||||||
printf "%s\n" 'Optional features, enabled with --enable-FEATURE and'
|
printf "%s\n" 'Optional features, enabled with --enable-FEATURE and'
|
||||||
|
@ -229,6 +233,7 @@ _meson_option_parse() {
|
||||||
--disable-gcov) printf "%s" -Db_coverage=false ;;
|
--disable-gcov) printf "%s" -Db_coverage=false ;;
|
||||||
--enable-lto) printf "%s" -Db_lto=true ;;
|
--enable-lto) printf "%s" -Db_lto=true ;;
|
||||||
--disable-lto) printf "%s" -Db_lto=false ;;
|
--disable-lto) printf "%s" -Db_lto=false ;;
|
||||||
|
--bindir=*) quote_sh "-Dbindir=$2" ;;
|
||||||
--enable-blkio) printf "%s" -Dblkio=enabled ;;
|
--enable-blkio) printf "%s" -Dblkio=enabled ;;
|
||||||
--disable-blkio) printf "%s" -Dblkio=disabled ;;
|
--disable-blkio) printf "%s" -Dblkio=disabled ;;
|
||||||
--block-drv-ro-whitelist=*) quote_sh "-Dblock_drv_ro_whitelist=$2" ;;
|
--block-drv-ro-whitelist=*) quote_sh "-Dblock_drv_ro_whitelist=$2" ;;
|
||||||
|
@ -407,6 +412,7 @@ _meson_option_parse() {
|
||||||
--disable-plugins) printf "%s" -Dplugins=false ;;
|
--disable-plugins) printf "%s" -Dplugins=false ;;
|
||||||
--enable-png) printf "%s" -Dpng=enabled ;;
|
--enable-png) printf "%s" -Dpng=enabled ;;
|
||||||
--disable-png) printf "%s" -Dpng=disabled ;;
|
--disable-png) printf "%s" -Dpng=disabled ;;
|
||||||
|
--prefix=*) quote_sh "-Dprefix=$2" ;;
|
||||||
--enable-pvrdma) printf "%s" -Dpvrdma=enabled ;;
|
--enable-pvrdma) printf "%s" -Dpvrdma=enabled ;;
|
||||||
--disable-pvrdma) printf "%s" -Dpvrdma=disabled ;;
|
--disable-pvrdma) printf "%s" -Dpvrdma=disabled ;;
|
||||||
--enable-qcow1) printf "%s" -Dqcow1=enabled ;;
|
--enable-qcow1) printf "%s" -Dqcow1=enabled ;;
|
||||||
|
@ -414,6 +420,7 @@ _meson_option_parse() {
|
||||||
--enable-qed) printf "%s" -Dqed=enabled ;;
|
--enable-qed) printf "%s" -Dqed=enabled ;;
|
||||||
--disable-qed) printf "%s" -Dqed=disabled ;;
|
--disable-qed) printf "%s" -Dqed=disabled ;;
|
||||||
--firmwarepath=*) quote_sh "-Dqemu_firmwarepath=$(meson_option_build_array $2)" ;;
|
--firmwarepath=*) quote_sh "-Dqemu_firmwarepath=$(meson_option_build_array $2)" ;;
|
||||||
|
--with-suffix=*) quote_sh "-Dqemu_suffix=$2" ;;
|
||||||
--enable-qga-vss) printf "%s" -Dqga_vss=enabled ;;
|
--enable-qga-vss) printf "%s" -Dqga_vss=enabled ;;
|
||||||
--disable-qga-vss) printf "%s" -Dqga_vss=disabled ;;
|
--disable-qga-vss) printf "%s" -Dqga_vss=disabled ;;
|
||||||
--enable-qom-cast-debug) printf "%s" -Dqom_cast_debug=true ;;
|
--enable-qom-cast-debug) printf "%s" -Dqom_cast_debug=true ;;
|
||||||
|
|
Loading…
Reference in New Issue