From nobody Wed Nov 27 19:38:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697438028; cv=none; d=zohomail.com; s=zohoarc; b=ZqLC4t8LIMTJlAABsSOZJ8HhpwokTXAkgu8PBJmpPjJbl/HZl0Ou57ndx0uNJuXZVljf1Eo7Do9skCqXiqLsh3YpVBf/epE/zqbouxO0SC5WiiM/pL1SzIz5tCVr1NvIH0T8A3ZPux+cWAwjx7ogAnRfTKHICz/olfanv71n3TI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697438028; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=7wRraFOki6xoNL40X+dNtMD9Sl5rl5qNKGPpTlgSs3w=; b=ix1vyAdDYVQ9kjxPoSZCNCIlWzaN/vgUyWHAB7QYq7tngbSxORvR+ul2WHVJB1179HyqbUcHyxnaoDk+plBoccfvTdbeKLJqWrN82IqeZrFp80D7w26g2xqjystPx1R5jhDyY1ZonuXh0Ec/7B2HkBuodVjreT06PvXfn2kmETE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169743802845517.702681425118044; Sun, 15 Oct 2023 23:33:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qsH9M-0004cW-50; Mon, 16 Oct 2023 02:32:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsH9I-0004Ni-TL for qemu-devel@nongnu.org; Mon, 16 Oct 2023 02:32:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsH9H-0005WU-0d for qemu-devel@nongnu.org; Mon, 16 Oct 2023 02:32:20 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-sQUOtt8cPhyXo6EiGol3TA-1; Mon, 16 Oct 2023 02:31:56 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-9ae686dafedso294022266b.3 for ; Sun, 15 Oct 2023 23:31:56 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id f25-20020a170906085900b009ae0042e48bsm3346343ejd.5.2023.10.15.23.31.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697437938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7wRraFOki6xoNL40X+dNtMD9Sl5rl5qNKGPpTlgSs3w=; b=YKOtLoldTyWnWGHRxsRRC3BoL8kHUzaQ2zZ5+vmazvuIXUQhBqB2IAvfAX4oXQrS6nXNsC VUzlvepFFb4XLvTFTvjeYz6SEwqWeGUKt2Kt2Y50gLnCGxfXzdrqY9meMnphSDNe8zds+H 7cGFFs9t/HRJa23Jcqi+xaMIqMg9cb4= X-MC-Unique: sQUOtt8cPhyXo6EiGol3TA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697437915; x=1698042715; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7wRraFOki6xoNL40X+dNtMD9Sl5rl5qNKGPpTlgSs3w=; b=P2ddQ86C16kBz+VIXtcH0hUv3LDjqmkmyXdaEM0pQOmSqblYfg6Skg9uBgLYacCJAH 9sWDa+QRovVO0Vs25nQIRghVqxgFB9GCL0AzSkSOexlkBZPX6ZSu0LpNPIbnfRA5TvzL oWvFmjnj8+7gZUHuZxk//d8cmVFjief/EQ7aZB/sBt56H4m8CFH9Yf8n5etqYJVuEp5b ZpdffxaWcN5xN2jN1Ljs/uLQug7jk3maxlj1Del3UxkTVZ27QClzAO5tsZh8DA3+fTaf RYy9hdZ79wLFSXKjiooERwrcRA6C83SM2MhwM80bJf8ZlQCTaDW5Na2mmDG26btQsULC MCaw== X-Gm-Message-State: AOJu0YyCywayYHd82YJqICoFo8XThlxk7WNGJXKd0wt9iRQnCZTTr5wV 4nwkwuAzKqRQrQ0+WJuEqWYEqoGvkVLlZ/kgU/3cIociAyTqQ9xqDNWoHarNlY+TofzWmNq3BvT 1L9HWCspw0GJrvo/mil7CYkFLkDN0ZT9XQlG/iAhvns0qzX93DDdayCldbVEzzgoZCGT5d4Zr2u I= X-Received: by 2002:a17:907:7ea4:b0:9be:3c01:f061 with SMTP id qb36-20020a1709077ea400b009be3c01f061mr5926056ejc.66.1697437915055; Sun, 15 Oct 2023 23:31:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDh0bkkHAtP4yyEz6JHjdj3iaffOzC4o8eVcMtCWQIYIqfGqSxm50IMbl3/zH0yJI+TtVsbQ== X-Received: by 2002:a17:907:7ea4:b0:9be:3c01:f061 with SMTP id qb36-20020a1709077ea400b009be3c01f061mr5926044ejc.66.1697437914697; Sun, 15 Oct 2023 23:31:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 13/17] configure: move environment-specific defaults to config-meson.cross Date: Mon, 16 Oct 2023 08:31:23 +0200 Message-ID: <20231016063127.161204-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016063127.161204-1-pbonzini@redhat.com> References: <20231016063127.161204-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697438029339100001 Content-Type: text/plain; charset="utf-8" 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 --- 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 e6787dc4111..24f8866e141 100755 --- a/configure +++ b/configure @@ -258,7 +258,6 @@ skip_meson=3Dno use_containers=3D"yes" gdb_bin=3D$(command -v "gdb-multiarch" || command -v "gdb") gdb_arches=3D"" -werror=3D"" =20 # Don't accept a target_list environment variable. unset target_list @@ -314,7 +313,6 @@ objcopy=3D"${OBJCOPY-${cross_prefix}objcopy}" ld=3D"${LD-${cross_prefix}ld}" ranlib=3D"${RANLIB-${cross_prefix}ranlib}" nm=3D"${NM-${cross_prefix}nm}" -smbd=3D"$SMBD" strip=3D"${STRIP-${cross_prefix}strip}" widl=3D"${WIDL-${cross_prefix}widl}" windres=3D"${WINDRES-${cross_prefix}windres}" @@ -648,8 +646,6 @@ for opt do ;; --ninja=3D*) ninja=3D"$optarg" ;; - --smbd=3D*) smbd=3D"$optarg" - ;; --extra-cflags=3D*) ;; --extra-cxxflags=3D*) @@ -741,10 +737,6 @@ for opt do ;; --disable-pie) pie=3D"no" ;; - --enable-werror) werror=3D"yes" - ;; - --disable-werror) werror=3D"no" - ;; --enable-cfi) cfi=3Dtrue ;; --disable-cfi) cfi=3Dfalse @@ -876,7 +868,6 @@ Advanced options (experts only): --cross-prefix-ARCH=3DPREFIX cross compiler prefix when building ARCH gu= est test cases --python=3DPYTHON use specified python [$python] --ninja=3DNINJA use specified ninja [$ninja] - --smbd=3DSMBD 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 @@ -884,7 +875,6 @@ Advanced options (experts only): desired devices in configs/devices/) --with-devices-ARCH=3DNAME override default configs/devices --enable-debug enable common debug build options - --disable-werror disable compilation abort on warning --cpu=3DCPU Build for host CPU [$cpu] --disable-containers don't use containers for cross-building --container-engine=3DTYPE which container engine to use [$container_eng= ine] @@ -1008,17 +998,6 @@ if test -z "$ninja"; then fi fi =20 -# 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" =3D linux || test "$targetos" =3D "windows"; };= then - werror=3D"yes" - else - werror=3D"no" - fi -fi - if test "$targetos" =3D "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 @@ -1761,6 +1740,20 @@ if test "$skip_meson" =3D no; then test -n "$objcc" && echo "objc_args =3D [$(meson_quote $OBJCFLAGS $EXTRA= _OBJCFLAGS)]" >> $cross echo "c_link_args =3D [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXT= RA_LDFLAGS)]" >> $cross echo "cpp_link_args =3D [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAG= S $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" =3D linux || test "$targetos" =3D "windows"; }; t= hen + echo 'werror =3D true' >> $cross + fi + echo "[project options]" >> $cross + if test "$SMBD" !=3D ''; then + echo "smbd =3D $(meson_quote "$SMBD")" >> $cross + fi + + echo >> $cross echo "[binaries]" >> $cross echo "c =3D [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross test -n "$cxx" && echo "cpp =3D [$(meson_quote $cxx $CPU_CFLAGS)]" >> $c= ross @@ -1815,7 +1808,6 @@ if test "$skip_meson" =3D no; then test "$default_feature" =3D no && meson_option_add -Dauto_features=3Ddis= abled test "$static" =3D yes && meson_option_add -Dprefer_static=3Dtrue test "$pie" =3D no && meson_option_add -Db_pie=3Dfalse - test "$werror" =3D yes && meson_option_add -Dwerror=3Dtrue =20 # QEMU options test "$cfi" !=3D false && meson_option_add "-Dcfi=3D$cfi" @@ -1823,7 +1815,6 @@ if test "$skip_meson" =3D no; then test "$docs" !=3D auto && meson_option_add "-Ddocs=3D$docs" test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engin= e=3D$LIB_FUZZING_ENGINE" test "$plugins" =3D yes && meson_option_add "-Dplugins=3Dtrue" - test "$smbd" !=3D '' && meson_option_add "-Dsmbd=3D$smbd" test "$tcg" !=3D enabled && meson_option_add "-Dtcg=3D$tcg" run_meson() { NINJA=3D$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 =3D { "default_devices", "fuzzing_engine", - "smbd", } =20 OPTION_NAMES =3D { @@ -47,6 +46,7 @@ # Options that configure autodetects, even though meson defines them as bo= olean AUTO_OPTIONS =3D { "plugins", + "werror", } =20 BUILTIN_OPTIONS =3D { @@ -64,6 +64,7 @@ "prefix", "strip", "sysconfdir", + "werror", } =20 LINE_WIDTH =3D 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=3DVALUE Localstate data directory [/= var/local]' printf "%s\n" ' --mandir=3DVALUE Manual page directory [share= /man]' printf "%s\n" ' --prefix=3DVALUE Installation prefix [/usr/lo= cal]' + printf "%s\n" ' --smbd=3DVALUE Path to smbd for slirp netwo= rking' printf "%s\n" ' --sysconfdir=3DVALUE Sysconf data directory [etc]' printf "%s\n" ' --tls-priority=3DVALUE 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=3Ddisabled ;; --enable-smartcard) printf "%s" -Dsmartcard=3Denabled ;; --disable-smartcard) printf "%s" -Dsmartcard=3Ddisabled ;; + --smbd=3D*) quote_sh "-Dsmbd=3D$2" ;; --enable-snappy) printf "%s" -Dsnappy=3Denabled ;; --disable-snappy) printf "%s" -Dsnappy=3Ddisabled ;; --enable-sndio) printf "%s" -Dsndio=3Denabled ;; @@ -529,6 +532,8 @@ _meson_option_parse() { --disable-vte) printf "%s" -Dvte=3Ddisabled ;; --enable-vvfat) printf "%s" -Dvvfat=3Denabled ;; --disable-vvfat) printf "%s" -Dvvfat=3Ddisabled ;; + --enable-werror) printf "%s" -Dwerror=3Dtrue ;; + --disable-werror) printf "%s" -Dwerror=3Dfalse ;; --enable-whpx) printf "%s" -Dwhpx=3Denabled ;; --disable-whpx) printf "%s" -Dwhpx=3Ddisabled ;; --enable-xen) printf "%s" -Dxen=3Denabled ;; --=20 2.41.0