From nobody Tue Feb 10 01:32:59 2026 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=1597675488; cv=none; d=zohomail.com; s=zohoarc; b=SHXfJYc/jTwe5SwTonNlgxwjYhZBQavqx9AFEf433LGErGHLBA2QUaPvj43UB8wDfANUvQZrewOacZ3ilB1x8e6oZYR6lre84Iw1WvJGO6+5IQhfzg53GDp/GmyGrpwz92CLNTCHvgTVbhUdBRDuqVOqPlY/BHW6dpH2X8ouG4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597675488; h=Content-Type: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=A7aT8Lsvyvguxpc7XKTthGOqaaTVf42GL2XpGYgV4Bc=; b=nKrLcqciXMBSlGcQYNEUP4R5RsnpVKc3G3Aa8YMDlshl37boheCAZOkdggCPbHmGRrN6JN/FDxSkzSn7fuRnwxhWk2CIMieu39j6avf4DjMnK03gVjr1vWHSELwAYae3VCgPogbDF+NZpI47lKXiHJb9tX0OFH0eAdFn7eKinds= 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 1597675488175105.41139040064809; Mon, 17 Aug 2020 07:44:48 -0700 (PDT) Received: from localhost ([::1]:46888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7gNS-0007WL-Ky for importer@patchew.org; Mon, 17 Aug 2020 10:44:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7gGj-0003f9-HZ for qemu-devel@nongnu.org; Mon, 17 Aug 2020 10:37:49 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:39303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7gGh-00063h-Fx for qemu-devel@nongnu.org; Mon, 17 Aug 2020 10:37:49 -0400 Received: by mail-wr1-x441.google.com with SMTP id a5so15256919wrm.6 for ; Mon, 17 Aug 2020 07:37:46 -0700 (PDT) Received: from donizetti.redhat.com ([2001:b07:6468:f312:a0d1:fc42:c610:f977]) by smtp.gmail.com with ESMTPSA id i22sm34966603wrb.45.2020.08.17.07.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 07:37:44 -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=A7aT8Lsvyvguxpc7XKTthGOqaaTVf42GL2XpGYgV4Bc=; b=LLOaVJQn96NjmAzOMVxfB7eXeARoiwoZ/q/JdKXl0RNx1ThXgVTCYV49/JLrsIQo9P j2GNHkN/zlXBYrxMDU6MHenXoOiwdL+O1tY4A+KW7KTqFKN8eX5eFaTg8xbI17fv4XhJ 1ygsnQ/T4ZKjPlLYodfCoobnah8gbIQyOL5akgkbU/BDtbTXcJH94ZaQcBh3RHLOSGdM szCgt9PZnQ0xGbu0WHTk9k92Nrl/Hckivuiqhh5ncX6YuPvnZrLQYiIwB3F/8uGOM1FQ I+9+m5D+zQQwfVqPZfJ5K5JoIPuszqlU4U9eg09ojjt+RG4kTpVFHQ5nSTafB5FgZBuP YKbA== 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=A7aT8Lsvyvguxpc7XKTthGOqaaTVf42GL2XpGYgV4Bc=; b=lZYiginnBX6HnC268DyyhykfTKUYd9py4s7sNCHrTZ2kD5OPs5FKplUJwwD/2/oZa/ 094LJIAIUKpJCYf+Df8ZcE9gVMjNzno7DKUeTTF77xfcFMx80daJkB3legAbyb7ekN5s VT4JuZv6bVqakbVgAY0N+2B8ES7uamU4f6MGkT0dykpSq11z30OutaHqbBss5faOBzVL R9RpGdgOdtkBizA5aS7APByqGFSlzz09KWKa8EbiF2jrOUhmp5g3VOiGCKcuJnFmIKQs WzE9XZdYx5vif6jq8ODHGqw6dbfpS5d49kUviJ5SMoqeNSoQodWBY9PV92ySXJoPJP8Q LOeA== X-Gm-Message-State: AOAM532HvFAy7Q88GvV1GHtAk8EQI2tKqIbYrvmgNKqISKbnst1WKmlu qDm5X6OiHljDLZKwYhHZM12TNxRtUsI= X-Google-Smtp-Source: ABdhPJy4RdemsMDT4TtB3Dq1coeHJoDQPPN4KIjQYmMo9kuC2teB9QLXJ8/0eE0bz1ldDW4EuMsjAQ== X-Received: by 2002:adf:efd2:: with SMTP id i18mr15254882wrp.32.1597675065663; Mon, 17 Aug 2020 07:37:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 018/150] build-sys: add meson submodule Date: Mon, 17 Aug 2020 16:35:11 +0200 Message-Id: <20200817143723.343284-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200817143723.343284-1-pbonzini@redhat.com> References: <20200817143723.343284-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::441; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x441.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: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- .gitmodules | 3 ++ configure | 73 ++++++++++++++++++++++++++++++++++----- meson | 1 + scripts/archive-source.sh | 3 +- 4 files changed, 71 insertions(+), 9 deletions(-) create mode 160000 meson diff --git a/.gitmodules b/.gitmodules index 9c0501a4d4..ce979398a8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,3 +58,6 @@ [submodule "roms/qboot"] path =3D roms/qboot url =3D https://github.com/bonzini/qboot +[submodule "meson"] + path =3D meson + url =3D https://github.com/mesonbuild/meson/ diff --git a/configure b/configure index 994e9844aa..45111a619d 100755 --- a/configure +++ b/configure @@ -174,6 +174,25 @@ path_of() { return 1 } =20 +version_ge () { + local_ver1=3D`echo $1 | tr . ' '` + local_ver2=3D`echo $2 | tr . ' '` + while true; do + set x $local_ver1 + local_first=3D${2-0} + # shift 2 does nothing if there are less than 2 arguments + shift; shift + local_ver1=3D$* + set x $local_ver2 + # the second argument finished, the first must be greater or equal + test $# =3D 1 && return 0 + test $local_first -lt $2 && return 1 + test $local_first -gt $2 && return 0 + shift; shift + local_ver2=3D$* + done +} + have_backend () { echo "$trace_backends" | grep "$1" >/dev/null } @@ -506,7 +525,7 @@ fuzzing=3D"no" rng_none=3D"no" secret_keyring=3D"" libdaxctl=3D"" -meson=3Dmeson +meson=3D"" =20 supported_cpu=3D"no" supported_os=3D"no" @@ -916,6 +935,7 @@ fi # python 2.x, but some distros have it as python 3.x, so # we check that too python=3D +explicit_python=3Dno for binary in "${PYTHON-python3}" python do if has "$binary" @@ -999,7 +1019,7 @@ for opt do ;; --install=3D*) install=3D"$optarg" ;; - --python=3D*) python=3D"$optarg" + --python=3D*) python=3D"$optarg" ; explicit_python=3Dyes ;; --sphinx-build=3D*) sphinx_build=3D"$optarg" ;; @@ -1978,15 +1998,52 @@ python_version=3D$($python -c 'import sys; print("%= d.%d.%d" % (sys.version_info[0] # Suppress writing compiled files python=3D"$python -B" =20 -if ! has "$meson" -then - error_exit "Meson not found. Use --meson=3D/path/to/meson" +if test -z "$meson"; then + if test "$explicit_python" =3D no && has meson && version_ge "$(meson = --version)" 0.55.0; then + meson=3Dmeson + elif test -e "${source_path}/.git" && test $git_update =3D 'yes' ; then + meson=3Dgit + elif test -e "${source_path}/meson/meson.py" ; then + meson=3Dinternal + else + if test "$explicit_python" =3D yes; then + error_exit "--python requires using QEMU's embedded Meson dist= ribution, but it was not found." + else + error_exit "Meson not found. Use --meson=3D/path/to/meson" + fi + fi +else + # Meson uses its own Python interpreter to invoke other Python scripts, + # but the user wants to use the one they specified with --python. + # + # We do not want to override the distro Python interpreter (and someti= mes + # cannot: for example in Homebrew /usr/bin/meson is a bash script), so + # just require --meson=3Dgit|internal together with --python. + if test "$explicit_python" =3D yes; then + case "$meson" in + git | internal) ;; + *) error_exit "--python requires using QEMU's embedded Meson d= istribution." ;; + esac + fi fi -meson=3D$(command -v $meson) =20 -if ! $python -c 'import pkg_resources' > /dev/null 2>&1; then - error_exit "Python setuptools not found" +if test "$meson" =3D git; then + git_submodules=3D"${git_submodules} meson" fi +if test "$git_update" =3D yes; then + (cd "${source_path}" && GIT=3D"$git" "./scripts/git-submodule.sh" upda= te "$git_submodules") +fi + +case "$meson" in + git | internal) + if ! $python -c 'import pkg_resources' > /dev/null 2>&1; then + error_exit "Python setuptools not found" + fi + meson=3D"$python ${source_path}/meson/meson.py" + ;; + *) meson=3D$(command -v meson) ;; +esac + =20 # Check that the C compiler works. Doing this here before testing # the host CPU ensures that we had a valid CC to autodetect the diff --git a/meson b/meson new file mode 160000 index 0000000000..d0c68dc115 --- /dev/null +++ b/meson @@ -0,0 +1 @@ +Subproject commit d0c68dc11507a47b9b85de508e023d9590d60565 diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index fb5d6b3918..c6169db69f 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -26,7 +26,8 @@ sub_file=3D"${sub_tdir}/submodule.tar" # independent of what the developer currently has initialized # in their checkout, because the build environment is completely # different to the host OS. -submodules=3D"dtc slirp ui/keycodemapdb tests/fp/berkeley-softfloat-3 test= s/fp/berkeley-testfloat-3" +submodules=3D"dtc slirp meson ui/keycodemapdb" +submodules=3D"$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-= testfloat-3" sub_deinit=3D"" =20 function cleanup() { --=20 2.26.2