[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/32] configure: move environment-specific defaults to config-mes
From: |
Paolo Bonzini |
Subject: |
[PULL 27/32] configure: move environment-specific defaults to config-meson.cross |
Date: |
Wed, 18 Oct 2023 10:27:47 +0200 |
Store the -Werror and SMBD defaults in the machine file, which still allows
them to be overridden on the command line and enables automatic parsing
of the related options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 37 +++++++++++++----------------------
scripts/meson-buildoptions.py | 3 ++-
scripts/meson-buildoptions.sh | 5 +++++
3 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/configure b/configure
index 8f23c8d1655..200570a3d18 100755
--- a/configure
+++ b/configure
@@ -258,7 +258,6 @@ skip_meson=no
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
@@ -314,7 +313,6 @@ objcopy="${OBJCOPY-${cross_prefix}objcopy}"
ld="${LD-${cross_prefix}ld}"
ranlib="${RANLIB-${cross_prefix}ranlib}"
nm="${NM-${cross_prefix}nm}"
-smbd="$SMBD"
strip="${STRIP-${cross_prefix}strip}"
widl="${WIDL-${cross_prefix}widl}"
windres="${WINDRES-${cross_prefix}windres}"
@@ -651,8 +649,6 @@ for opt do
;;
--ninja=*) ninja="$optarg"
;;
- --smbd=*) smbd="$optarg"
- ;;
--extra-cflags=*)
;;
--extra-cxxflags=*)
@@ -744,10 +740,6 @@ for opt do
;;
--disable-pie) pie="no"
;;
- --enable-werror) werror="yes"
- ;;
- --disable-werror) werror="no"
- ;;
--enable-cfi) cfi=true
;;
--disable-cfi) cfi=false
@@ -879,7 +871,6 @@ Advanced options (experts only):
--cross-prefix-ARCH=PREFIX cross compiler prefix when building ARCH guest
test cases
--python=PYTHON use specified python [$python]
--ninja=NINJA use specified ninja [$ninja]
- --smbd=SMBD use specified smbd [$smbd]
--static enable static build [$static]
--without-default-features default all --enable-* options to "disabled"
--without-default-devices do not include any device that is not needed to
@@ -887,7 +878,6 @@ Advanced options (experts only):
desired devices in configs/devices/)
--with-devices-ARCH=NAME override default configs/devices
--enable-debug enable common debug build options
- --disable-werror disable compilation abort on warning
--cpu=CPU Build for host CPU [$cpu]
--disable-containers don't use containers for cross-building
--container-engine=TYPE which container engine to use [$container_engine]
@@ -1011,17 +1001,6 @@ if test -z "$ninja"; then
fi
fi
-# Consult white-list to determine whether to enable werror
-# by default. Only enable by default for git builds
-if test -z "$werror" ; then
- if test -e "$source_path/.git" && \
- { test "$targetos" = linux || test "$targetos" = "windows"; }; then
- werror="yes"
- else
- werror="no"
- fi
-fi
-
if test "$targetos" = "bogus"; then
# Now that we know that we're not printing the help and that
# the compiler works (so the results of the check_defines we used
@@ -1764,6 +1743,20 @@ if test "$skip_meson" = no; then
test -n "$objcc" && echo "objc_args = [$(meson_quote $OBJCFLAGS
$EXTRA_OBJCFLAGS)]" >> $cross
echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS
$EXTRA_LDFLAGS)]" >> $cross
echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS
$EXTRA_LDFLAGS)]" >> $cross
+
+ # Only enable by default for git builds and on select OSes
+ echo "# environment defaults, can still be overridden on " >> $cross
+ echo "# the command line" >> $cross
+ if test -e "$source_path/.git" && \
+ { test "$targetos" = linux || test "$targetos" = "windows"; }; then
+ echo 'werror = true' >> $cross
+ fi
+ echo "[project options]" >> $cross
+ if test "$SMBD" != ''; then
+ echo "smbd = $(meson_quote "$SMBD")" >> $cross
+ fi
+
+ echo >> $cross
echo "[binaries]" >> $cross
echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross
test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross
@@ -1818,14 +1811,12 @@ if test "$skip_meson" = no; then
test "$default_feature" = no && meson_option_add -Dauto_features=disabled
test "$static" = yes && meson_option_add -Dprefer_static=true
test "$pie" = no && meson_option_add -Db_pie=false
- test "$werror" = yes && meson_option_add -Dwerror=true
# QEMU options
test "$cfi" != false && meson_option_add "-Dcfi=$cfi" "-Db_lto=$cfi"
test "$docs" != auto && meson_option_add "-Ddocs=$docs"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add
"-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
test "$plugins" = yes && meson_option_add "-Dplugins=true"
- test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
run_meson() {
NINJA=$ninja $meson setup "$@" "$PWD" "$source_path"
diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
index 0c24bdc1e8c..2e88732a291 100644
--- a/scripts/meson-buildoptions.py
+++ b/scripts/meson-buildoptions.py
@@ -28,7 +28,6 @@
SKIP_OPTIONS = {
"default_devices",
"fuzzing_engine",
- "smbd",
}
OPTION_NAMES = {
@@ -47,6 +46,7 @@
# Options that configure autodetects, even though meson defines them as boolean
AUTO_OPTIONS = {
"plugins",
+ "werror",
}
BUILTIN_OPTIONS = {
@@ -64,6 +64,7 @@
"prefix",
"strip",
"sysconfdir",
+ "werror",
}
LINE_WIDTH = 76
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index e1522030619..dec33820163 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -64,6 +64,7 @@ meson_options_help() {
printf "%s\n" ' --localstatedir=VALUE Localstate data directory
[/var/local]'
printf "%s\n" ' --mandir=VALUE Manual page directory [share/man]'
printf "%s\n" ' --prefix=VALUE Installation prefix [/usr/local]'
+ printf "%s\n" ' --smbd=VALUE Path to smbd for slirp networking'
printf "%s\n" ' --sysconfdir=VALUE Sysconf data directory [etc]'
printf "%s\n" ' --tls-priority=VALUE Default TLS protocol/cipher
priority string'
printf "%s\n" ' [NORMAL]'
@@ -205,6 +206,7 @@ meson_options_help() {
printf "%s\n" ' vpc vpc image format support'
printf "%s\n" ' vte vte support for the gtk UI'
printf "%s\n" ' vvfat vvfat image format support'
+ printf "%s\n" ' werror Treat warnings as errors'
printf "%s\n" ' whpx WHPX acceleration support'
printf "%s\n" ' xen Xen backend support'
printf "%s\n" ' xen-pci-passthrough'
@@ -453,6 +455,7 @@ _meson_option_parse() {
--disable-slirp-smbd) printf "%s" -Dslirp_smbd=disabled ;;
--enable-smartcard) printf "%s" -Dsmartcard=enabled ;;
--disable-smartcard) printf "%s" -Dsmartcard=disabled ;;
+ --smbd=*) quote_sh "-Dsmbd=$2" ;;
--enable-snappy) printf "%s" -Dsnappy=enabled ;;
--disable-snappy) printf "%s" -Dsnappy=disabled ;;
--enable-sndio) printf "%s" -Dsndio=enabled ;;
@@ -529,6 +532,8 @@ _meson_option_parse() {
--disable-vte) printf "%s" -Dvte=disabled ;;
--enable-vvfat) printf "%s" -Dvvfat=enabled ;;
--disable-vvfat) printf "%s" -Dvvfat=disabled ;;
+ --enable-werror) printf "%s" -Dwerror=true ;;
+ --disable-werror) printf "%s" -Dwerror=false ;;
--enable-whpx) printf "%s" -Dwhpx=enabled ;;
--disable-whpx) printf "%s" -Dwhpx=disabled ;;
--enable-xen) printf "%s" -Dxen=enabled ;;
--
2.41.0
- Re: [PULL 17/32] meson, cutils: allow non-relocatable installs, (continued)
- [PULL 14/32] tracetool: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 16/32] meson: do not use set10, Paolo Bonzini, 2023/10/18
- [PULL 15/32] meson: do not build shaders by default, Paolo Bonzini, 2023/10/18
- [PULL 19/32] hw/xen: cleanup sourcesets, Paolo Bonzini, 2023/10/18
- [PULL 20/32] hw/remote: move stub vfu_object_set_bus_irq out of stubs/, Paolo Bonzini, 2023/10/18
- [PULL 22/32] configure, tests/tcg: simplify GDB conditionals, Paolo Bonzini, 2023/10/18
- [PULL 21/32] tests/tcg/arm: move non-SVE tests out of conditional, Paolo Bonzini, 2023/10/18
- [PULL 18/32] configure: clean up handling of CFI option, Paolo Bonzini, 2023/10/18
- [PULL 24/32] configure: clean up PIE option handling, Paolo Bonzini, 2023/10/18
- [PULL 27/32] configure: move environment-specific defaults to config-meson.cross,
Paolo Bonzini <=
- [PULL 25/32] configure: remove some dead cruft, Paolo Bonzini, 2023/10/18
- [PULL 29/32] configure, meson: use command line options to configure qemu-ga, Paolo Bonzini, 2023/10/18
- [PULL 23/32] configure: clean up plugin option handling, Paolo Bonzini, 2023/10/18
- [PULL 31/32] meson: add a note on why we use config_host for program paths, Paolo Bonzini, 2023/10/18
- [PULL 28/32] configure: unify handling of several Debian cross containers, Paolo Bonzini, 2023/10/18
- [PULL 30/32] meson-buildoptions: document the data at the top, Paolo Bonzini, 2023/10/18
- [PULL 32/32] configure: define "pkg-config" in addition to "pkgconfig", Paolo Bonzini, 2023/10/18
- [PULL 26/32] configure: move target-specific defaults to an external machine file, Paolo Bonzini, 2023/10/18
- Re: [PULL 00/32] x86 and build system changes for 2023-10-18, Stefan Hajnoczi, 2023/10/18