From nobody Tue Feb 10 16:44:13 2026 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=1684346355; cv=none; d=zohomail.com; s=zohoarc; b=M5QHa+7ISDMn4Mm/xldlHt75eUtd8a620KxiEWpwdsFg4dJWPn4K9Ex0AFL8qB+4yRJl++GaY0v05k2Ml2aaAfCCtUyXSc2JvXO6YfLZA4crHOI1Jf+cv9YF+2ZBXKlk9XFrYBbLxF5Ie+eiJUMocwI1x0NqbEPaSimYWrKWyOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684346355; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QBLkLIPImIhiMXXreUR0S6NO4vQOLpLc4SPHm9Q7bTE=; b=DgdqGbx+GATbULbzsq+1LnAcRrmpUU1AKTFeBbqot3fcheLs8JQSMokoyOnZ368q3FrA4r3P+nQv1CiR7GNw2oSrh4n1ZvfR8bFS/fsxNql9iPy3ZWYbdNAhCe1z0aPgKvFoEY3xW7ikBHgG+7ubiFqd3sAL8L4IsRA1Ln0Vass= 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 1684346355612662.6273082737043; Wed, 17 May 2023 10:59:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzLH7-0005Tn-To; Wed, 17 May 2023 13:49:21 -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 1pzLF4-0002LE-FC for qemu-devel@nongnu.org; Wed, 17 May 2023 13:47:14 -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 1pzLF2-0004bj-NU for qemu-devel@nongnu.org; Wed, 17 May 2023 13:47:14 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-282-ho86Qy0iOgaKgM-f19Y7mA-1; Wed, 17 May 2023 13:47:10 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f453ff4cdfso4731635e9.2 for ; Wed, 17 May 2023 10:47:10 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id i9-20020adffc09000000b0030497b3224bsm3393796wrr.64.2023.05.17.10.47.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 10:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684345632; 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=QBLkLIPImIhiMXXreUR0S6NO4vQOLpLc4SPHm9Q7bTE=; b=E28uFyfVN4b6MnBqTXPDvhao5H/18qnRwJhpVXIa8mvIrXaP61UCZpio+z+Rc8g+CrMklg uWH8VqHJ7EjxCKl+Hdm8EFyNMm47pw/8ZQ5+P1ow/8URptG7FoUQiS++6amcsb0eRDRIEY kGQlAhiVbo2ciCOshIRUZT535rC5PFs= X-MC-Unique: ho86Qy0iOgaKgM-f19Y7mA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684345629; x=1686937629; 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=QBLkLIPImIhiMXXreUR0S6NO4vQOLpLc4SPHm9Q7bTE=; b=dz1AC8V7XxadZ8roNP+uzf5UxA8Pe3aWkZJ9LOfD2d0DIH2fWQ2v6X+CAhd5eR6qpS 1PORf+Ke4srZ7rv88GfL/mfkxQX0Mt490xWrxFGwEV4LU3EA5ukOAQBK4xYJS1wYCoyw 9K+gDnwL1+rRWorAWROBBwTffiu3+gceEPbB2fzde9fUMLKTaVNi0imsiSUvj9zJkUG+ i64AuH1rRkc+U2FDA0Ycpa87KZci6GslY7I7eZ3BWHsGZKdrZE8F85SHr3Tsfn/sU0qi 5WEUTxCfC5OLHirKqMK10Z4xChd910GEGoSKQ/OknUmJBPSs+2yWO7pWGCZDd857NP5h PtRw== X-Gm-Message-State: AC+VfDzpggqhj1uR9klIWoYIemO2mW4GCjhArkOj4JJkONhEeVS2jk5E OFzcpp5nfZVW/pLy1dXSMfXW2Bsf2G57/Ta3Jyyi6K7EVWSbJxb7xYgB/mnmV+LQPg8Pz/Xytby TFg1f8vzUcJ89NziyfpUp/ytX3SXs8cxzFYhFpcMi4Fw+CozIM57HncHNeIngcc2WXmSZHCE94/ s= X-Received: by 2002:a7b:c014:0:b0:3f5:f52:beb1 with SMTP id c20-20020a7bc014000000b003f50f52beb1mr6495845wmb.12.1684345629295; Wed, 17 May 2023 10:47:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7TFsNgingm7QcvhO+D204bxDN0/OPb2UjK3hfUERNf5YiwAA5nNAO8z7874ZLMkPGhByxDcw== X-Received: by 2002:a7b:c014:0:b0:3f5:f52:beb1 with SMTP id c20-20020a7bc014000000b003f50f52beb1mr6495836wmb.12.1684345628943; Wed, 17 May 2023 10:47:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 66/68] configure: reorder option parsing code Date: Wed, 17 May 2023 19:45:18 +0200 Message-Id: <20230517174520.887405-67-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517174520.887405-1-pbonzini@redhat.com> References: <20230517174520.887405-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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1684346356180100003 Content-Type: text/plain; charset="utf-8" Move some variable assignments around for clarity and to remove one of three loops on the command line arguments. Signed-off-by: Paolo Bonzini --- configure | 121 ++++++++++++++++++++++++++---------------------------- 1 file changed, 58 insertions(+), 63 deletions(-) diff --git a/configure b/configure index 2d6ff2d6cef6..9dc17aaa7c86 100755 --- a/configure +++ b/configure @@ -177,29 +177,18 @@ then error_exit "main directory cannot contain spaces nor colons" fi =20 +# parse CC options first; some compiler tests are used to establish +# some defaults, based on the host environment + # default parameters cpu=3D"" -static=3D"no" cross_compile=3D"no" cross_prefix=3D"" host_cc=3D"cc" -use_containers=3D"yes" -gdb_bin=3D$(command -v "gdb-multiarch" || command -v "gdb") -gdb_arches=3D"" - -if test -e "$source_path/.git" -then - git_submodules_action=3D"update" -else - git_submodules_action=3D"ignore" -fi - -git_submodules=3D"ui/keycodemapdb" -git=3D"git" - -# Don't accept a target_list environment variable. -unset target_list -unset target_list_exclude +EXTRA_CFLAGS=3D"" +EXTRA_CXXFLAGS=3D"" +EXTRA_OBJCFLAGS=3D"" +EXTRA_LDFLAGS=3D"" =20 # Default value for a variable defining feature "foo". # * foo=3D"no" feature will only be used if --enable-foo arg is given @@ -212,49 +201,8 @@ unset target_list_exclude # Always add --enable-foo and --disable-foo command line args. # Distributions want to ensure that several features are compiled in, and = it # is impossible without a --enable-foo that exits if a feature is not foun= d. - default_feature=3D"" -# parse CC options second -for opt do - optarg=3D$(expr "x$opt" : 'x[^=3D]*=3D\(.*\)') - case "$opt" in - --without-default-features) - default_feature=3D"no" - ;; - esac -done =20 -EXTRA_CFLAGS=3D"" -EXTRA_CXXFLAGS=3D"" -EXTRA_OBJCFLAGS=3D"" -EXTRA_LDFLAGS=3D"" - -debug_tcg=3D"no" -docs=3D"auto" -EXESUF=3D"" -prefix=3D"/usr/local" -qemu_suffix=3D"qemu" -softmmu=3D"yes" -linux_user=3D"" -bsd_user=3D"" -pie=3D"" -plugins=3D"$default_feature" -ninja=3D"" -bindir=3D"bin" -skip_meson=3Dno -vfio_user_server=3D"disabled" - -# The following Meson options are handled manually (still they -# are included in the automatically generated help message) - -# 1. Track which submodules are needed -fdt=3D"auto" - -# 2. Automatically enable/disable other options -tcg=3D"auto" -cfi=3D"false" - -# parse CC options second for opt do optarg=3D$(expr "x$opt" : 'x[^=3D]*=3D\(.*\)') case "$opt" in @@ -293,9 +241,60 @@ for opt do --cross-prefix-*) cc_arch=3D${opt#--cross-prefix-}; cc_arch=3D${cc_arch%= %=3D*} eval "cross_prefix_${cc_arch}=3D\$optarg" ;; + --without-default-features) default_feature=3D"no" + ;; esac done =20 + +if test -e "$source_path/.git" +then + git_submodules_action=3D"update" +else + git_submodules_action=3D"ignore" +fi + +git_submodules=3D"ui/keycodemapdb" +git=3D"git" +debug_tcg=3D"no" +docs=3D"auto" +EXESUF=3D"" +prefix=3D"/usr/local" +qemu_suffix=3D"qemu" +softmmu=3D"yes" +linux_user=3D"" +bsd_user=3D"" +plugins=3D"$default_feature" +ninja=3D"" +python=3D +pypi=3D"enabled" +bindir=3D"bin" +skip_meson=3Dno +vfio_user_server=3D"disabled" +use_containers=3D"yes" +gdb_bin=3D$(command -v "gdb-multiarch" || command -v "gdb") +gdb_arches=3D"" +werror=3D"" + +# Don't accept a target_list environment variable. +unset target_list +unset target_list_exclude + +# The following Meson options are handled manually (still they +# are included in the automatically generated help message) + +# 1. Track which submodules are needed +fdt=3D"auto" + +# 2. Automatically enable/disable other options +tcg=3D"auto" +cfi=3D"false" + +# 3. Need to check for -static-pie before Meson runs. Also, +# Meson has PIE as a boolean rather than enabled/disabled/auto. +pie=3D"" +static=3D"no" + # Preferred compiler: # ${CC} (if set) # ${cross_prefix}gcc (if cross-prefix specified) @@ -536,8 +535,6 @@ check_py_version() { "$1" -c 'import sys; sys.exit(sys.version_info < (3,7))' } =20 -python=3D -pypi=3D"enabled" first_python=3D if test -z "${PYTHON}"; then # A bare 'python' is traditionally python 2.x, but some distros @@ -584,8 +581,6 @@ if test "$mingw32" =3D "yes" ; then qemu_suffix=3D"" fi =20 -werror=3D"" - meson_option_build_array() { printf '[' (if test "$targetos" =3D windows; then --=20 2.40.1