From nobody Tue Dec 16 08:31:37 2025 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=1597079719; cv=none; d=zohomail.com; s=zohoarc; b=XctmqHcHFLtnLaEmwr1h7vP3cSrf6p1C2cTrTwxQ8NKcmjvmBMkskoXrNvU9h6X8uQw9Jf5fHjVtqepGI4IOmtqQfuaWD++nVB+NLWzr6VR5xfCVIGnwrLufzM+M5y7VATLdRJUbnQYnjPivYVWkx+BJ8/jFP8kksloSM5UoZnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597079719; 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=O7cxn5J4sGqTvFBek06hM8KZMfta5GjJogEHUyghwho=; b=emm7j5Y4+uwAHNtX30R3xqIeyp6/YCT89Np1EljFDzEqsGuuCaTiuaZ9O3nAI5r5wrraArbBX3PWIfXXEmbAn0jT+hgBkssuwOQEHMOnWfSuXdMi3KbYjlDVKO8zlsMEnadkQXK/hl0hCK0OS25Qn8e22b7aAPnJis3RZUJOC3Q= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597079719531924.0928563611199; Mon, 10 Aug 2020 10:15:19 -0700 (PDT) Received: from localhost ([::1]:52488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5BOI-00072O-21 for importer@patchew.org; Mon, 10 Aug 2020 13:15:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5BIx-00068B-K9 for qemu-devel@nongnu.org; Mon, 10 Aug 2020 13:09:47 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:49895 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k5BIv-0002lC-DS for qemu-devel@nongnu.org; Mon, 10 Aug 2020 13:09:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-538-Nx6-JlKrNey-oMavMassxQ-1; Mon, 10 Aug 2020 13:09:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E41CB107ACCA for ; Mon, 10 Aug 2020 17:09:40 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.110.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1C7D5F1E9; Mon, 10 Aug 2020 17:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597079384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O7cxn5J4sGqTvFBek06hM8KZMfta5GjJogEHUyghwho=; b=P8An2HjFXqV2+1AWBvPHEgojWr3x/CYlwBr3S78pFEFaHXDZo9pbV8okTemjbOQ3SdJz/1 R7inp2Ry7XSe9+UGbjTq/+ccSsj8ToWnvq4S4VdemyySuf+kQo32A1ZVduVnx8HFD430WK NrO5+pbRKmREhlbWh+4sXmNNiaCSTEI= X-MC-Unique: Nx6-JlKrNey-oMavMassxQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 018/147] build-sys: add meson submodule Date: Mon, 10 Aug 2020 19:06:56 +0200 Message-Id: <1597079345-42801-19-git-send-email-pbonzini@redhat.com> In-Reply-To: <1597079345-42801-1-git-send-email-pbonzini@redhat.com> References: <1597079345-42801-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/10 03:29:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham 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: pass (identity @redhat.com) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- .gitmodules | 3 +++ configure | 53 ++++++++++++++++++++++++++++++++++++++++++-= ---- meson | 1 + scripts/archive-source.sh | 3 ++- 4 files changed, 54 insertions(+), 6 deletions(-) create mode 160000 meson diff --git a/.gitmodules b/.gitmodules index 9c0501a..ce97939 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 f38c783..5806f92 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" @@ -1978,11 +1997,35 @@ 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 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 + fi +fi + +if test "$meson" =3D git; then + git_submodules=3D"${git_submodules} meson" fi -meson=3D$(command -v $meson) +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) + meson=3D${source_path}/meson/meson.py + ;; + *) + meson=3D$(command -v meson) + if ! has "$meson" ; then + error_exit "Meson not found. Use --meson=3D/path/to/meson|git|= internal" + fi + ;; +esac +meson=3D"$python $meson" =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 0000000..d0c68dc --- /dev/null +++ b/meson @@ -0,0 +1 @@ +Subproject commit d0c68dc11507a47b9b85de508e023d9590d60565 diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index fb5d6b3..c6169db 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 1.8.3.1