From nobody Thu May 2 06:09:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599991611; cv=none; d=zohomail.com; s=zohoarc; b=RFQNtfiYkNKJDFqLMV8FfTmH2Hoj6q6kaxrirty/LaGh8eSOyf7cmoPX7wNuIjc75oB9M2UOOhqLuXN/c1/mS0N4vsXcbiK/uor8Cw8aCr7A7JE5mVxkJR3dTsv0vHSP888ljXWTeZD3uQyLULe8/fcywyvY43rAdnzjbYK4AA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599991611; h=Content-Transfer-Encoding:Cc: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=8u7qVIji/P6iDBnP9RNpMszmujgXnbWqw7uGLeKpFr0=; b=Ho+roDwppDGH9hKzryAyZxFuKa8u8fsi4VoLk+euQVHSTVATUctNL4fFaGaJS3gfbxYO1UWxE1iHPWy34MxqcF8UaBT/ic9Q9pP/64XwYOuLgrsioMT5/qBjJTF+BjOJgtlk1zM1R9a8hzRSR1ztDv/vbKUQZlPAamR5+vBSQgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599991611663173.23536336115671; Sun, 13 Sep 2020 03:06:51 -0700 (PDT) Received: from localhost ([::1]:45036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHOuH-0001si-Pj for importer@patchew.org; Sun, 13 Sep 2020 06:06:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHOtB-0000bX-1b for qemu-devel@nongnu.org; Sun, 13 Sep 2020 06:05:41 -0400 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:36263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHOt9-0002Ci-Ee for qemu-devel@nongnu.org; Sun, 13 Sep 2020 06:05:40 -0400 Received: by mail-ej1-x642.google.com with SMTP id e23so19196971eja.3 for ; Sun, 13 Sep 2020 03:05:39 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:9c8:f845:9041:a5ee]) by smtp.gmail.com with ESMTPSA id g11sm6690286edj.85.2020.09.13.03.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 03:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8u7qVIji/P6iDBnP9RNpMszmujgXnbWqw7uGLeKpFr0=; b=vZ9RxewQQozeRyK+1qPtX7GHPu8JvZ6BJchCWSDvQagc/LIZM/CM080HlSOaFnLSU0 vA0afcQX3OJVpnLYp2hU15F7AOzV2tICXmVlYGOk68zkWtZQk3ljBMiS2qjCfleYUUR+ D5/OwKZzrotKGCkyAjI7s39v3KBhu5ONvps8TTTU8hjPQ89vJNT9FXbcOKYZhVJ45frj EQOC9U1Y4GqtUZbwhCj090mnsUKZXZTWqUH2h7hwdXXQHk+s5vtz5gDmKAtTKPyO61mx dTyST2moyw7log3up1QGJGqKuzgXykNDeWbT5LJgl9xaaaPFwQl+u7WYWyVOjnLOHdSG DgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8u7qVIji/P6iDBnP9RNpMszmujgXnbWqw7uGLeKpFr0=; b=T1fEC36VJd9Niiy5eKI5LHcn3sQWa6aDFnLo/XydZL2RRn5JpOhGdx6TlpCOy3x/gX IXCpri8t2IutybDfRx6ocDzZHILdYlh8MxZKfm7xwZfm6pBiaVUauVGVIEmkIH/ROtXl 40ZKVG9jlpmFt2hN9PLkQ3D557YXJWCM42pjid6qP8Q9xvOhgpZVQaNCaxKXmzWldqPi o+4/wdPiM+vqFvMS39nXV1kaKXNjDB2FPBLLoBXjnUXgAHfjV9uaJPx1NpjSm7jqJcDF M7qwouoEz0p3pkx5gaSYcR0dwVQ7jbojdRhQwjwdopQvPjqjKlg7f/CfpskhsFjmJswI 0kkA== X-Gm-Message-State: AOAM5302/tWmsCW9TVkeLAkJARdBzQ6Bb8WLwoXOJaQOUiRD+Jcu7I2n 8iI07m9BOHtEbfj8E+3UejeN60aWPhI= X-Google-Smtp-Source: ABdhPJwVeCuyoyC2evhAHHUM8H+7jpiIujmNF2qN0wjIqJ8+24wC+SH+STZk4I9NnYXbVyY/cpqh1g== X-Received: by 2002:a17:906:838f:: with SMTP id p15mr10039657ejx.315.1599991537996; Sun, 13 Sep 2020 03:05:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/3] configure: quote command line arguments in config.status Date: Sun, 13 Sep 2020 12:05:32 +0200 Message-Id: <20200913100534.22084-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913100534.22084-1-pbonzini@redhat.com> References: <20200913100534.22084-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=2a00:1450:4864:20::642; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, berrange@redhat.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 53723ace57..beae010e39 100755 --- a/configure +++ b/configure @@ -89,6 +89,10 @@ printf " '%s'" "$0" "$@" >> config.log echo >> config.log echo "#" >> config.log =20 +quote_sh() { + printf "'%s'" "$(echo "$1" | sed "s,','\\',")" +} + print_error() { (echo echo "ERROR: $1" @@ -8061,7 +8065,7 @@ preserve_env WINDRES =20 printf "exec" >>config.status for i in "$0" "$@"; do - test "$i" =3D --skip-meson || printf " '%s'" "$i" >>config.status + test "$i" =3D --skip-meson || printf " %s" "$(quote_sh $i)" >>config.sta= tus done echo ' "$@"' >>config.status chmod +x config.status --=20 2.26.2 From nobody Thu May 2 06:09:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599991613; cv=none; d=zohomail.com; s=zohoarc; b=UBqQ3W5mFvKUMCh4JmbpgjmhcneeHAav+4YOI3QZJeEpItF+syYmlCw3cyp2j5dTIinEmRE7C6LLHq6Ztee5MWyCwYOL8Iln1rzj/A9SEwgxdHPLVsHYloadic6XmRNiALTj3fV2wOnbm76vlPlH/5x97AvDdxuLjHzVF6VyMWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599991613; h=Content-Transfer-Encoding:Cc: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=DtaDJQIlwIYvq2X082N0v4uFIfZ0Kcg079ABQmsDHiE=; b=RO/MIB7p1CjN/KxM8FOb45M0hvulu+5AND1aTZHmqCVgFOOZB5vi8K0ZHPIwtoVYDh3jNmG2MA3CtgSdGUgfkBeYK6xbHxyuPWF8Ylp6qhRv/j2qFjS3e50H/UY8e5IoBaNtiF3u/YhrxFIA4hcQJzpG9gnuG/bJGL/lDzMfqUk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599991613410543.3673482006606; Sun, 13 Sep 2020 03:06:53 -0700 (PDT) Received: from localhost ([::1]:45228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHOuK-0001xU-4O for importer@patchew.org; Sun, 13 Sep 2020 06:06:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHOtC-0000cR-Gz for qemu-devel@nongnu.org; Sun, 13 Sep 2020 06:05:42 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:44084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHOtB-0002EF-0h for qemu-devel@nongnu.org; Sun, 13 Sep 2020 06:05:42 -0400 Received: by mail-ed1-x534.google.com with SMTP id b12so14683135edz.11 for ; Sun, 13 Sep 2020 03:05:40 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:9c8:f845:9041:a5ee]) by smtp.gmail.com with ESMTPSA id g11sm6690286edj.85.2020.09.13.03.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 03:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DtaDJQIlwIYvq2X082N0v4uFIfZ0Kcg079ABQmsDHiE=; b=A4N2voeYBC2qsKyH8x6m1146Un++nAZ7mCqQOPq7Z+aKyudXH8E0+vRilGsQb98lSc KM3ESx9hn/xxjPCyUCZy+9TkUqaQhQ6UyUUl9WaoePvPm+n9XIx/BQ+B1FOY6nByMaN2 DyVDKmhMt2ATRljJxKWtDic+4FR+2nV+AfNbsry9LwQbWo5FQuFy/jTOEHR/VG8LuL15 2rCaHDjMF7Uy5VBtJhGkWjkfXo+zTuUsJ/R4xrCJzHZXAe9Rij0sKNPzEOjuPDRAw80d 9sKMfMF0itkYvtgAxUIqWuypyazZq874poDxN4ItBewQ7pSR390YUlqYO8+AE7TNkD0K krSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DtaDJQIlwIYvq2X082N0v4uFIfZ0Kcg079ABQmsDHiE=; b=Sj5ikP070jd9xaeZ5Hp9uzxqV2iEKpif3u47jZVE9Kzwcg7/XMXYLQ4kO9wolyLer8 0zhW0v7laBmw/0E2kjJqptJmv/cR4bzcJMGKj1kHPTKrauNaO9M5wNzsctLbEFwQMJL+ tre/PwHdVLNlSwhaB+1Lrj8HURZ2cMkU8KiU5ejWfYgvAcxLNwBa+D+KqNUWt6pmKI1F fAPY0ke2oQpifRQL8jkkyxEHPjai/pJUeTyF6winWYatPkpt8KOf5Cv6mnxUo1ay5aiz 5EeiW7B9wEp+5yFam6sLMbNzFmttLbS/HVouFnIAP55smHU5v3/evEERBVflNK/ZNmU3 Sx1g== X-Gm-Message-State: AOAM532wKbA8ywj7C4klnWt1RGFvv5Y0CZswTfXnUU/+gkNS8Lr9ele9 mG40eq08IMjkk4r8qv2/1YPZPSome8s= X-Google-Smtp-Source: ABdhPJyBb+BZ4B0OhPVVmPjn5giuL9o6HUt+PvhujlkT+7UH4fIPvleAxLIx77LWy555RwFhIIwXvw== X-Received: by 2002:aa7:d785:: with SMTP id s5mr11738576edq.154.1599991539070; Sun, 13 Sep 2020 03:05:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/3] configure: early test for Python Date: Sun, 13 Sep 2020 12:05:33 +0200 Message-Id: <20200913100534.22084-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913100534.22084-1-pbonzini@redhat.com> References: <20200913100534.22084-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=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, berrange@redhat.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" --- configure | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/configure b/configure index beae010e39..b4f5d2e272 100755 --- a/configure +++ b/configure @@ -1631,6 +1631,23 @@ for opt do esac done =20 +if test -n "$python" +then + # Preserve python version since some functionality is dependent on it + python_version=3D$($python -c 'import sys; print("%d.%d.%d" % (sys.ver= sion_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) + + # Suppress writing compiled files + python=3D"$python -B" + + # Note that if the Python conditional here evaluates True we will exit + # with status 1 which is a shell 'false' value. + if ! $python -c 'import sys; sys.exit(sys.version_info < (3,5))'; then + print_error "Cannot use '$python', Python >=3D 3.5 is required." \ + "Use --python=3D/path/to/python to specify a supported Python." + python=3D + fi +fi + firmwarepath=3D"${firmwarepath:-$prefix/share/qemu-firmware}" libdir=3D"${libdir:-$prefix/lib}" libexecdir=3D"${libexecdir:-$prefix/libexec}" @@ -1962,19 +1979,6 @@ then error_exit "Python not found. Use --python=3D/path/to/python" fi =20 -# Note that if the Python conditional here evaluates True we will exit -# with status 1 which is a shell 'false' value. -if ! $python -c 'import sys; sys.exit(sys.version_info < (3,5))'; then - error_exit "Cannot use '$python', Python >=3D 3.5 is required." \ - "Use --python=3D/path/to/python to specify a supported Python." -fi - -# Preserve python version since some functionality is dependent on it -python_version=3D$($python -c 'import sys; print("%d.%d.%d" % (sys.version= _info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) - -# Suppress writing compiled files -python=3D"$python -B" - if test -z "$meson"; then if test "$explicit_python" =3D no && has meson && version_ge "$(meson = --version)" 0.55.1; then meson=3Dmeson --=20 2.26.2 From nobody Thu May 2 06:09:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599991712; cv=none; d=zohomail.com; s=zohoarc; b=B+5G0d4p0hUJdnRSd3QKB9/KxW74D4tBt29J7gn8eU7G0BookuNLEg9e26Z0FwkvuX0P/+//yYsU6XYm/EFY44eUcovvtJZgcSkQAi23z3lLaAJRMWFrLMGq1o61MmyZh06/CFaWorxvp6sUgxI9BKHEFudqE1ZZdTmVmt5BiW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599991712; h=Content-Transfer-Encoding:Cc: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=r1N7Ev4rCsSdVnTtJcqJ0WOCgfujEqoUaKWiju4ZvBA=; b=fpQ2uA1numqXCh8CmZOK/T7iXuIwhGlrCYuggrgZpmlORAzGwWKFAWNumH5DT+OdRYMK4QuxO8mY1IZZWSFjlCzZj/YieMQq06NBYPMwTVmm/23NYHjzrw7peGYfllkI1mazqTHqV5mfh9dLcCNhEKdgm7kBMvNx9yN9dDhH28g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599991712655675.2346137970845; Sun, 13 Sep 2020 03:08:32 -0700 (PDT) Received: from localhost ([::1]:49446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHOvv-0003hl-9X for importer@patchew.org; Sun, 13 Sep 2020 06:08:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHOtD-0000f3-Sv for qemu-devel@nongnu.org; Sun, 13 Sep 2020 06:05:43 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:35601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHOtB-0002F9-QG for qemu-devel@nongnu.org; Sun, 13 Sep 2020 06:05:43 -0400 Received: by mail-ej1-x62d.google.com with SMTP id u21so19198133eja.2 for ; Sun, 13 Sep 2020 03:05:41 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:9c8:f845:9041:a5ee]) by smtp.gmail.com with ESMTPSA id g11sm6690286edj.85.2020.09.13.03.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 03:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r1N7Ev4rCsSdVnTtJcqJ0WOCgfujEqoUaKWiju4ZvBA=; b=aVmTeNhd28RbgODF5B496tbOGt5xmgqFWlm5qbkAeJ5wRgaKrCVbKfDtYrm3DzsFMQ HgrFTtl4XxteLE1PhNEw5XsJP6q9+T8wCi/lbNKY+bkDhTDNoTjjP9TkHFNK6Y9FH3x4 3CfcAV7bno4It+6H8DvgOrAkOewr7kl68nNKwLT4CQi90REDZpSy2nsVUfyfr8lH9gFL UTiO/5jzHQm9TMfMqmO9smJYo+PgmFgNh6XxqPs2VyGkBStiZ+hfTk7p0mLdvHBi2ImY Qe7UlntJAt4v6mhsu+GGMcMeiGPU5eSzqhcAnlbghQXm0bKvx8c9qvXFKl8CmkWCEDtp 6Rcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=r1N7Ev4rCsSdVnTtJcqJ0WOCgfujEqoUaKWiju4ZvBA=; b=GZtuaO5Z2lPZzHkykWL88lPXwhpikOvGpIPpz1porwcICbP5HbmiWL80fweQo/7BsN Imz8xmO58evf9TxBUO6LeLsUhuY6h59jrdjWyyszoJ4yO1cxVhVNm9eaaF5XcmZUm3x6 2S2xIXVrCI5dtbNa44mec5LJFkzg6ANX/M68KNm+iFiUFwe2KlrF3etDVkRFkJ0ylh+0 UXbF9pWy0Vc9S8WxeYYYJpii1ehr5kujtZO/CgNntBR7ceySyaBKYHJJ4dQLPgEsm8ZO sm4r+9PGkEJJxsireGTu7A3YLNVyoCTMba57iYZKGlp0iAQ2BcDTJorIfuBYBijD8cC6 n4NQ== X-Gm-Message-State: AOAM531E+/Kfr+09SdlcZAEY3NfVGwg2ZcaF4VBSWWgOIo4YlAHosjDx pCM0YTDxkBYhkEBjh9ze6L3EL8+n9wo= X-Google-Smtp-Source: ABdhPJxr8cyZflKOO6j9mftc8D379EHLqmcFSq8mQD4G9ffhagq1hF5MvFkDX8uqcM/ir5StMNTiFQ== X-Received: by 2002:a17:906:ce3b:: with SMTP id sd27mr9650668ejb.433.1599991540007; Sun, 13 Sep 2020 03:05:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 3/3] configure: automatically parse command line for meson -D options Date: Sun, 13 Sep 2020 12:05:34 +0200 Message-Id: <20200913100534.22084-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913100534.22084-1-pbonzini@redhat.com> References: <20200913100534.22084-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=2a00:1450:4864:20::62d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, berrange@redhat.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- Makefile | 6 ++ configure | 71 +++++-------- docs/devel/build-system.rst | 35 +------ meson-buildoptions.json | 130 ++++++++++++++++++++++++ scripts/configure-parse-buildoptions.py | 94 +++++++++++++++++ 5 files changed, 258 insertions(+), 78 deletions(-) create mode 100644 meson-buildoptions.json create mode 100644 scripts/configure-parse-buildoptions.py diff --git a/Makefile b/Makefile index d6c5c9fdef..b22e5b272e 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,12 @@ ifneq ($(MESON),) Makefile.mtest: build.ninja scripts/mtest2make.py $(MESON) introspect --tests --benchmarks | $(PYTHON) scripts/mtest2make.p= y > $@ -include Makefile.mtest + +# jq is used to keep the result stable +meson-buildoptions.json: meson_options.txt + $(MESON) introspect --buildoptions . | \ + jq 'map(select(.section =3D=3D "user")) | sort_by(.name)' \ + > $(SRC_PATH)/meson-buildoptions.json endif =20 Makefile: .git-submodule-status diff --git a/configure b/configure index b4f5d2e272..54958bfc17 100755 --- a/configure +++ b/configure @@ -396,16 +396,10 @@ docs=3D"" fdt=3D"" netmap=3D"no" sdl=3D"auto" -sdl_image=3D"auto" virtfs=3D"" mpath=3D"" -vnc=3D"enabled" sparse=3D"no" vde=3D"" -vnc_sasl=3D"auto" -vnc_jpeg=3D"auto" -vnc_png=3D"auto" -xkbcommon=3D"auto" xen=3D"" xen_ctrl_version=3D"" xen_pci_passthrough=3D"" @@ -466,7 +460,6 @@ trace_file=3D"trace" spice=3D"" rbd=3D"" smartcard=3D"" -u2f=3D"auto" libusb=3D"" usb_redir=3D"" opengl=3D"" @@ -539,6 +532,7 @@ rng_none=3D"no" secret_keyring=3D"" libdaxctl=3D"" meson=3D"" +meson_args=3D"" ninja=3D"" skip_meson=3Dno gettext=3D"" @@ -1100,10 +1094,6 @@ for opt do ;; --enable-sdl) sdl=3D"enabled" ;; - --disable-sdl-image) sdl_image=3D"disabled" - ;; - --enable-sdl-image) sdl_image=3D"enabled" - ;; --disable-qom-cast-debug) qom_cast_debug=3D"no" ;; --enable-qom-cast-debug) qom_cast_debug=3D"yes" @@ -1116,10 +1106,6 @@ for opt do ;; --enable-mpath) mpath=3D"yes" ;; - --disable-vnc) vnc=3D"disabled" - ;; - --enable-vnc) vnc=3D"enabled" - ;; --disable-gettext) gettext=3D"false" ;; --enable-gettext) gettext=3D"true" @@ -1158,18 +1144,6 @@ for opt do ;; --disable-strip) strip_opt=3D"no" ;; - --disable-vnc-sasl) vnc_sasl=3D"disabled" - ;; - --enable-vnc-sasl) vnc_sasl=3D"enabled" - ;; - --disable-vnc-jpeg) vnc_jpeg=3D"disabled" - ;; - --enable-vnc-jpeg) vnc_jpeg=3D"enabled" - ;; - --disable-vnc-png) vnc_png=3D"disabled" - ;; - --enable-vnc-png) vnc_png=3D"enabled" - ;; --disable-slirp) slirp=3D"no" ;; --enable-slirp=3Dgit) slirp=3D"git" @@ -1369,10 +1343,6 @@ for opt do ;; --enable-smartcard) smartcard=3D"yes" ;; - --disable-u2f) u2f=3D"disabled" - ;; - --enable-u2f) u2f=3D"enabled" - ;; --disable-libusb) libusb=3D"no" ;; --enable-libusb) libusb=3D"yes" @@ -1593,10 +1563,6 @@ for opt do ;; --disable-libpmem) libpmem=3Dno ;; - --enable-xkbcommon) xkbcommon=3D"enabled" - ;; - --disable-xkbcommon) xkbcommon=3D"disabled" - ;; --enable-plugins) plugins=3D"yes" ;; --disable-plugins) plugins=3D"no" @@ -1623,6 +1589,9 @@ for opt do ;; --disable-libdaxctl) libdaxctl=3Dno ;; + --enable-* | --disable-*) + meson_args=3D"$meson_args $(quote_sh "$opt")" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1648,6 +1617,16 @@ then fi fi =20 +# Convert unknown --enable/--disable arguments to Meson build options. +meson_options=3D$(eval \ + \$python \ + \$source_path/scripts/configure-parse-buildoptions.py \ + \< \$source_path/meson-buildoptions.json $meson_args) +if test $? =3D 1; then + echo "Try '$0 --help' for more information" + exit 1 +fi + firmwarepath=3D"${firmwarepath:-$prefix/share/qemu-firmware}" libdir=3D"${libdir:-$prefix/lib}" libexecdir=3D"${libexecdir:-$prefix/libexec}" @@ -1853,10 +1831,14 @@ Advanced options (experts only): enable plugins via shared library loading --disable-containers don't use containers for cross-building --gdb=3DGDB-path gdb to use for gdbstub tests [$gdb_bin] - -Optional features, enabled with --enable-FEATURE and -disabled with --disable-FEATURE, default is enabled if available: - +EOF + if test -z "$python"; then + echo + echo "Python not found. Use --python=3D/path/to/python to see complete= help" + exit 0 + fi + $python $source_path/scripts/configure-parse-buildoptions.py --print-hel= p < $source_path/meson-buildoptions.json +cat << EOF system all system emulation targets user supported user emulation targets linux-user all linux usermode emulation targets @@ -1883,10 +1865,6 @@ disabled with --disable-FEATURE, default is enabled = if available: vte vte support for the gtk UI curses curses UI iconv font glyph conversion support - vnc VNC UI support - vnc-sasl SASL encryption for VNC server - vnc-jpeg JPEG lossy compression for VNC server - vnc-png PNG compression for VNC server cocoa Cocoa UI (Mac OS X only) virtfs VirtFS mpath Multipath persistent reservation passthrough @@ -1920,7 +1898,6 @@ disabled with --disable-FEATURE, default is enabled i= f available: libiscsi iscsi support libnfs nfs support smartcard smartcard support (libcacard) - u2f U2F support (u2f-emu) libusb libusb (for usb passthrough) live-block-migration Block migration in the main migration stream usb-redir usb network redirection support @@ -1962,7 +1939,6 @@ disabled with --disable-FEATURE, default is enabled i= f available: capstone capstone disassembler support debug-mutex mutex debugging support libpmem libpmem support - xkbcommon xkbcommon support rng-none dummy RNG, avoid using /dev/(u)random and getrandom() libdaxctl libdaxctl support =20 @@ -8008,9 +7984,8 @@ NINJA=3D${ninja:-$PWD/ninjatool} $meson setup \ -Dstrip=3D$(if test "$strip_opt" =3D yes; then echo true; else ech= o false; fi) \ -Db_pie=3D$(if test "$pie" =3D yes; then echo true; else echo fals= e; fi) \ -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ - -Dsdl=3D$sdl -Dsdl_image=3D$sdl_image \ - -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_png=3D$v= nc_png \ - -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f\ + $meson_args \ + -Dsdl=3D$sdl -Dgettext=3D$gettext \ $cross_arg \ "$PWD" "$source_path" =20 diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 08e85c69e1..9fd321f227 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -52,12 +52,6 @@ following tasks: =20 - Add a Meson build option to meson_options.txt. =20 - - Add support to the command line arg parser to handle any new - `--enable-XXX`/`--disable-XXX` flags required by the feature. - - - Add information to the help output message to report on the new - feature flag. - - Add code to perform the actual feature check. =20 - Add code to include the feature status in `config-host.h` @@ -66,30 +60,6 @@ following tasks: upon completion. =20 =20 -Taking the probe for SDL2_Image as an example, we have the following pieces -in configure:: - - # Initial variable state - sdl_image=3Dauto - - ..snip.. - - # Configure flag processing - --disable-sdl-image) sdl_image=3Ddisabled - ;; - --enable-sdl-image) sdl_image=3Denabled - ;; - - ..snip.. - - # Help output feature message - sdl-image SDL Image support for icons - - ..snip.. - - # Meson invocation - -Dsdl_image=3D$sdl_image - In meson_options.txt:: =20 option('sdl', type : 'feature', value : 'auto', @@ -108,6 +78,11 @@ In meson.build:: # Summary summary_info +=3D {'SDL image support': sdl_image.found()} =20 +The configure script automatically converts command line options to +Meson options as long as the `meson-buildoptions.json` file in the +root source directory is up-to-date. You can simply type +`make meson-buildoptions.json` to update it; the `jq` program +is needed. =20 =20 Helper functions diff --git a/meson-buildoptions.json b/meson-buildoptions.json new file mode 100644 index 0000000000..dbaf5bc71e --- /dev/null +++ b/meson-buildoptions.json @@ -0,0 +1,130 @@ +[ + { + "name": "docdir", + "value": "doc", + "section": "user", + "machine": "any", + "type": "string", + "description": "Base directory for documentation installation (can be = empty)" + }, + { + "name": "gettext", + "value": true, + "section": "user", + "machine": "any", + "type": "boolean", + "description": "Localization of the GTK+ user interface" + }, + { + "name": "qemu_suffix", + "value": "qemu", + "section": "user", + "machine": "any", + "type": "string", + "description": "Suffix for QEMU data/modules/config directories (can b= e empty)" + }, + { + "name": "sdl", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "SDL user interface" + }, + { + "name": "sdl_image", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "SDL Image support for icons" + }, + { + "name": "u2f", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "U2F emulation support" + }, + { + "name": "vnc", + "value": "enabled", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "VNC server" + }, + { + "name": "vnc_jpeg", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "JPEG lossy compression for VNC server" + }, + { + "name": "vnc_png", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "PNG compression for VNC server" + }, + { + "name": "vnc_sasl", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "SASL authentication for VNC server" + }, + { + "name": "xkbcommon", + "value": "auto", + "section": "user", + "machine": "any", + "choices": [ + "enabled", + "disabled", + "auto" + ], + "type": "combo", + "description": "xkbcommon support" + } +] diff --git a/scripts/configure-parse-buildoptions.py b/scripts/configure-pa= rse-buildoptions.py new file mode 100644 index 0000000000..4171312d75 --- /dev/null +++ b/scripts/configure-parse-buildoptions.py @@ -0,0 +1,94 @@ +#! /usr/bin/env python3 + +# Parse configure command line options based on Meson's user build options +# introspection data (passed on stdin). +# +# Copyright (C) 2020 Red Hat, Inc. +# +# Author: Paolo Bonzini + +import json +import re +import shlex +import sys +import textwrap + +SKIP_OPTIONS =3D [ 'docdir', 'qemu_suffix' ] +FEATURE_CHOICES =3D [ 'auto', 'disabled', 'enabled' ] + +options =3D { x['name']: x + for x in json.load(sys.stdin) + if x['section'] =3D=3D 'user' and x['name'] not in SKIP_OPTION= S } + +for x in options.values(): + if x['type'] =3D=3D 'combo' and sorted(x['choices']) =3D=3D FEATURE_CH= OICES: + x['type'] =3D 'feature' + +def value_to_help(x): + if x =3D=3D True: + return 'enabled' + if x =3D=3D False: + return 'disabled' + return str(x) + +def print_help_line(key, opt, indent): + key =3D ' ' + key + value =3D '%s [%s]' % (opt['description'], value_to_help(opt['value'])) + if len(key) >=3D indent: + print(key) + key =3D '' + spaces =3D ' ' * indent + key =3D (key + spaces)[0:indent] + print(textwrap.fill(value, initial_indent=3Dkey, subsequent_indent=3Ds= paces)) + +def print_help(): + for o, x in options.items(): + if x['type'] not in ('boolean', 'feature'): + print_help_line('--enable-' + o, x, 24) + + print() + print('Optional features, enabled with --enable-FEATURE and') + print('disabled with --disable-FEATURE:') + for o, x in options.items(): + if x['type'] in ('boolean', 'feature'): + print_help_line(o, x, 18) + +def error(s, *args): + print('ERROR:', s % args, file=3Dsys.stderr) + sys.exit(1) + +def main(argv): + if not argv: + return + + if argv[0] =3D=3D '--print-help': + print_help() + return + + args =3D [] + for arg in sys.argv[1:]: + m =3D re.search('--(enable|disable)-([^=3D]*)(?:=3D(.*))?', arg) + if not m: + error('internal error parsing command line') + opt =3D m.group(2).replace('-', '_') + if opt not in options: + error('Unknown option --%s-%s', m.group(1), m.group(2)) + opt_type =3D options[opt]['type'] + if opt_type in ('boolean', 'feature'): + if m.group(3) is not None: + error('option --%s-%s does not take an argument', m.group(= 1), m.group(2)) + if opt_type =3D=3D 'feature': + value =3D m.group(1) + 'd' + else: + value =3D 'true' if m.group(1) =3D=3D 'enable' else 'false' + else: + if m.group(1) =3D=3D 'disable': + error('Unknown option --disable-%s', m.group(2)) + if m.group(3) is None: + error('option --enable-%s takes an argument', m.group(2)) + + args.append(shlex.quote('-D%s=3D%s' % (opt, value))) + print(' '.join(args)) + +if __name__ =3D=3D "__main__": + main(sys.argv[1:]) --=20 2.26.2