From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560165740; cv=none; d=zoho.com; s=zohoarc; b=PsDJR/yV6Jnt767nkR9jGzR7xBFRbzCTE40NErqH+uJlCtrzGnRxnNLefStai8prNdndh6GWxSC6+QO6MSSw7vr3xIIiAqCjDa73nnxC961bAZiuOXmS4DVPOm7nqCS2dkthR2V5AlQiAOfiYqil8e7cYKl+38kbs+4RVS6lhc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560165740; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1omRPDRi7iCVPq5GB5WX2fT+eVVyp3BW8K0GbfnTaX8=; b=O3a4ydtEG9tGuMN0KHPKF4GMaXy55D5FI1Mhqa7BgXzL61LRb27+89wWLrgNLlM4coTYOypSIidc6WHNJw95ZPN+YOMqG91ZOKDVuqQipD6OAb6y2hUjNaQKVVoZ+UB2yZDkNwGmNq/ET62Kfd+2wAOWQSNxlk7saijAIsRPCaQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 156016574025117.608146620029743; Mon, 10 Jun 2019 04:22:20 -0700 (PDT) Received: from localhost ([::1]:44566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haINP-00045e-6L for importer@patchew.org; Mon, 10 Jun 2019 07:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43034) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGa-00071t-OT for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGZ-0000R5-JO for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:08 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:35097) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGZ-0000Q7-CR for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:07 -0400 Received: by mail-wr1-x443.google.com with SMTP id m3so8771252wrv.2 for ; Mon, 10 Jun 2019 04:15:07 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=1omRPDRi7iCVPq5GB5WX2fT+eVVyp3BW8K0GbfnTaX8=; b=Ge8VqP9EoqailoiM5YlJbaNRMZz5BSRZMEK3HU0RJIdeplbQVbbvxMr3fYHG0a+/ZK uBvLk06WNFu6Pmd86zL7SzMmeoFdlh9syLFUuZCZH9/C6DVet2NU1tfu6/bnY/88OMQz jTFQ1PYZzg9PWdn+mYpYJ8ca6BUtg5ho3oU0YiJDVk65AL4zu6FfmZbJuq/3kac6K8Wh S1zIesIFjhvp1vF68mPZHrlAT2WCGRqc5KYAjmooahKj2nKcVpD1syMIVJvefvLlrWW4 PRpTQ6u7bDVEtvrkEh9DtmTq88yt00Mav2MgnSiiKwDEvRQLCZ/ZGTOQ7bhFEwnzi5U6 nU6w== 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:subject:date:message-id :in-reply-to:references; bh=1omRPDRi7iCVPq5GB5WX2fT+eVVyp3BW8K0GbfnTaX8=; b=XV31UPpX24yLXuy4umfZC1/OXNzmU2cB19+Q718pL0iSO36AWBy395hunKodLu3CrZ tEJ/gAjP7i/0prullxxM8kD7L4cOZVfmtP0MaYCVU3G702R2xU3kmpufQYUexvbZUd1b 40oN/Dp4ozvCWvUDfDIVonuf8f8cFxR6oBH6i5uMwFE7FvyF1DRRzqGSwAwSKFHWBhwA J5xaOVkuPTosDEE/UhBIH7phAcMKGSh+mpikacVSM8dPAY9a6smpfgwWYVTFmG3FtA0S p7Q9koJZdKEJRLvAOsU+AjVDBsQnHrOQZjZhpk40imQpFmEu/snOUltItxjiHbfOKcDl EXxw== X-Gm-Message-State: APjAAAXqgajKHz4AWdEWyezujc+r6/0VPFrnPCYETp/WtSOyJWgW35S/ bXnavsY7a8aXZoKQGHBiUi55y70D X-Google-Smtp-Source: APXvYqypX8uI75F1/mPNi8c5XmVKBIe/R9Jzl3n4Co8pwLMRSgt3ur0lKl66TOp7WY9/aadigcmang== X-Received: by 2002:a5d:51cb:: with SMTP id n11mr5149562wrv.143.1560165305921; Mon, 10 Jun 2019 04:15:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:14:55 +0200 Message-Id: <1560165301-39026-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH 1/7] configure: do not include $(...) variables in config-host.mak 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This ensures that Meson will be able to reuse the results of the tests that are performed in the configure script. Signed-off-by: Paolo Bonzini --- configure | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 6cdcfb2..203dece 100755 --- a/configure +++ b/configure @@ -597,7 +597,7 @@ QEMU_CFLAGS=3D"-fno-strict-aliasing -fno-common -fwrapv= -std=3Dgnu99 $QEMU_CFLAGS" QEMU_CFLAGS=3D"-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CF= LAGS" QEMU_CFLAGS=3D"-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS=3D"-D_GNU_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE = $QEMU_CFLAGS" -QEMU_INCLUDES=3D"-iquote . -iquote \$(SRC_PATH) -iquote \$(SRC_PATH)/accel= /tcg -iquote \$(SRC_PATH)/include" +QEMU_INCLUDES=3D"-iquote . -iquote ${source_path} -iquote ${source_path}/a= ccel/tcg -iquote ${source_path}/include" if test "$debug_info" =3D "yes"; then CFLAGS=3D"-g $CFLAGS" LDFLAGS=3D"-g $LDFLAGS" @@ -896,7 +896,7 @@ Linux) linux=3D"yes" linux_user=3D"yes" kvm=3D"yes" - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU= _INCLUDES" + QEMU_INCLUDES=3D"-I${source_path}/linux-headers -I$PWD/linux-headers $QE= MU_INCLUDES" supported_os=3D"yes" libudev=3D"yes" ;; @@ -4090,8 +4090,8 @@ EOF symlink "$source_path/dtc/Makefile" "dtc/Makefile" symlink "$source_path/dtc/scripts" "dtc/scripts" fi - fdt_cflags=3D"-I\$(SRC_PATH)/dtc/libfdt" - fdt_ldflags=3D"-L\$(BUILD_DIR)/dtc/libfdt" + fdt_cflags=3D"-I${source_path}/dtc/libfdt" + fdt_ldflags=3D"-L$PWD/dtc/libfdt" fdt_libs=3D"$fdt_libs" elif test "$fdt" =3D "yes" ; then # Not a git build & no libfdt found, prompt for system install @@ -5040,13 +5040,13 @@ case "$capstone" in git_submodules=3D"${git_submodules} capstone" fi mkdir -p capstone - QEMU_CFLAGS=3D"$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include" + QEMU_CFLAGS=3D"$QEMU_CFLAGS -I${source_path}/capstone/include" if test "$mingw32" =3D "yes"; then LIBCAPSTONE=3Dcapstone.lib else LIBCAPSTONE=3Dlibcapstone.a fi - LIBS=3D"-L\$(BUILD_DIR)/capstone -lcapstone $LIBS" + LIBS=3D"-L$PWD/capstone -lcapstone $LIBS" ;; =20 system) @@ -5951,8 +5951,8 @@ case "$slirp" in git_submodules=3D"${git_submodules} slirp" fi mkdir -p slirp - slirp_cflags=3D"-I\$(SRC_PATH)/slirp/src -I\$(BUILD_DIR)/slirp/src" - slirp_libs=3D"-L\$(BUILD_DIR)/slirp -lslirp" + slirp_cflags=3D"-I${source_path}/slirp/src -I$PWD/slirp/src" + slirp_libs=3D"-L$PWD/slirp -lslirp" ;; =20 system) @@ -7307,21 +7307,21 @@ if test "$sheepdog" =3D "yes" ; then fi =20 if test "$tcg_interpreter" =3D "yes"; then - QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote ${source_path}/tcg/tci $QEMU_INCLUDES" elif test "$ARCH" =3D "sparc64" ; then - QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote ${source_path}/tcg/sparc $QEMU_INCLUDES" elif test "$ARCH" =3D "s390x" ; then - QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote ${source_path}/tcg/s390 $QEMU_INCLUDES" elif test "$ARCH" =3D "x86_64" || test "$ARCH" =3D "x32" ; then - QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote ${source_path}/tcg/i386 $QEMU_INCLUDES" elif test "$ARCH" =3D "ppc64" ; then - QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote ${source_path}/tcg/ppc $QEMU_INCLUDES" elif test "$ARCH" =3D "riscv32" || test "$ARCH" =3D "riscv64" ; then - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/riscv $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-I${source_path}/tcg/riscv $QEMU_INCLUDES" else - QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote ${source_path}/tcg/\$(ARCH) $QEMU_INCLUDES" fi -QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg $QEMU_INCLUDES" +QEMU_INCLUDES=3D"-iquote ${source_path}/tcg $QEMU_INCLUDES" =20 echo "TOOLS=3D$tools" >> $config_host_mak echo "ROMS=3D$roms" >> $config_host_mak --=20 1.8.3.1 From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560165574; cv=none; d=zoho.com; s=zohoarc; b=gs3uFedGQ3agZtld7T0yHAeSHVkA2XC7df8sow8qv5tY8XjtDNFC5MzPNxpKDsMBUh0SCkr4xc0xViKPKIdAUG6l88o91YwweGvtYKpORXa/AJBw7bD0jhuwjVAea+JT2pnq9fhwSG7pTO9fI+VqVmaIx+1jcAmu8Gp/eWr/W1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560165574; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=WyANGAEE9NsiT8vOFmuxFH7zVf5CQD/04rtusUXksTk=; b=dYdux7/58Aee1sT+79iPfACTS2Fm8TgASe6sJ09XhR9hmD2XBGCMyiSGX3Bp4Vs3B0LW/c5ln6zAJJDWgev6nbJngFL5nDWf9U6dysgfU68yCmso79BJIAVghKOc1dGMd0XiK0/xbgV8nUw128CVwyInnqbDbpA3st4OU2wNW+o= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560165574437400.23134442021455; Mon, 10 Jun 2019 04:19:34 -0700 (PDT) Received: from localhost ([::1]:44542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIKm-0000u6-D9 for importer@patchew.org; Mon, 10 Jun 2019 07:19:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43044) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGb-00071v-97 for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGa-0000S0-Ge for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:09 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:38688) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGa-0000Qu-8V for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:08 -0400 Received: by mail-wr1-x436.google.com with SMTP id d18so8742421wrs.5 for ; Mon, 10 Jun 2019 04:15:08 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=WyANGAEE9NsiT8vOFmuxFH7zVf5CQD/04rtusUXksTk=; b=jaw+MK5RMB4LJJZgZLq5gMFXL44EoXYTrA8sryfOJFFhDURtaaQ50TfeLZUv+lgpI1 3Z1pksE8H/qy6j4wzycmIYU5NKZnWEcffFEh5mfFKMtn8QFZ2jC/WJOs4lIktpY/LKeQ hS20epoF9J75gdqIiKGJ6lmjhRNv4rWTmzildRj2iIGFua3opm5z2l9bsPYi1kLhZVZ4 YJmIJJpdf/5l2spGxxAR8xKNpZKUAd9hkdW/XvOsG2RPBFbSP4laSohQY3vei8NZIEdT x7vJzh8qTSjxmiIVnOx5Ya7TfB8ppnstYzYGOfrXacsNwvgkLrIZJ/EUZR3h1yMZtBO6 H6Ww== 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:subject:date:message-id :in-reply-to:references; bh=WyANGAEE9NsiT8vOFmuxFH7zVf5CQD/04rtusUXksTk=; b=llsfVa6ZWzKg+4qWOiKWpHG7KnkQlYbzCfHXmVDNSZ8/fNLSBSXky9vmh9YT2jM8EY XPtXTQL0QB8QJCrN+x7LhpoOcjhACGlrhrTXlIAYdLm+3+ki9w0GMZ8R05RbFbn0Iiac lNiMAhcfAyw6gpi5pijb1//SZDj0HOLwQKEzGAkIDRIKKVKt9+4cE2B2anotuV/brJ6o lvo/MSPAWlI+rHM7Pz5Q/8yXvhfhg4g2aTi2QZcNcz/9vIa84/P41t8y3ASioWVISt3Y MmT5BA617vZMoGf15agxh2mYI5y1W+bGtO3rJbeMCmtTTJKIX9oiF5cPeAFBe5br98CF JmWQ== X-Gm-Message-State: APjAAAVMByiJgJj2bIUSlon+1M+twiGGC7xLgJToZYYzh+TtY10LxjmZ 77kLSxUverslasnBPkMK9yt0h4tH X-Google-Smtp-Source: APXvYqyJSGpGFDDc6kMDJs5RJRCK89O0jozLM/XT60sgEiIN1R7e2wMSG1Se+xF4li6qtA9mqnZPJQ== X-Received: by 2002:adf:ce8f:: with SMTP id r15mr32944368wrn.122.1560165306928; Mon, 10 Jun 2019 04:15:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:14:56 +0200 Message-Id: <1560165301-39026-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 Subject: [Qemu-devel] [PATCH 2/7] configure: set $PYTHON to a full path 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This will make it possible to replace it in a shebang line. Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 203dece..0814a5f 100755 --- a/configure +++ b/configure @@ -918,7 +918,7 @@ for binary in "${PYTHON-python3}" python python2 do if has "$binary" then - python=3D"$binary" + python=3D$(type -p "$binary") break fi done --=20 1.8.3.1 From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560165887; cv=none; d=zoho.com; s=zohoarc; b=Ch6P+3Y+n91X6Kai7Uc91/Tmm5hXKcO4JeehNGOqNbc6DiH5ql1e55ZyEAoG6GXAX7cOPOFcM61ERIiPTTNQY1RPV6NQkQdAdhGOFhMBjelxSULCJYhfPLCxNJLszksOk5X5pecnGTNjsAzXTqiEQ2UfMsztlUAqRj2u0G6/N1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560165887; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tANxqYWGrmjcD7B1274P/Tj4NKNee/ohNwUY8q35tV8=; b=YzndZF312Sh38I+l6YeY9+6DkRoe+SxANF4qvKTcy9PI4NjXnjEfU9VAC/YPZvgnC1JMV1HhqubHcKE5kP2E88QMEZN1ONrbkBG+BBP5Po4kFvmmQC5mlWh/rEIyHwJeZrfi0IlhNPvd4krsHHABUgLuACO7zfAqMNFRmVXeqbI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1560165887538746.3434693158774; Mon, 10 Jun 2019 04:24:47 -0700 (PDT) Received: from localhost ([::1]:44582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIPj-0006Ob-7G for importer@patchew.org; Mon, 10 Jun 2019 07:24:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43105) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGg-0007A9-0q for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGc-0000Vc-1R for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:13 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGb-0000Sp-KH for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:09 -0400 Received: by mail-wr1-x436.google.com with SMTP id r18so8734338wrm.10 for ; Mon, 10 Jun 2019 04:15:09 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=tANxqYWGrmjcD7B1274P/Tj4NKNee/ohNwUY8q35tV8=; b=OKjdFkON0SP2lFh3YoIxNy7+OJa31xYGyFiRdfruvv9xX70dB/00q1KKT5TViI1pEW 6w6z4VWyQ+bM+7IscXcQq0vBtjlFHbnAs29aqxxnDixehFMT7fkeUNGjeUVD4noVhAFs xMDcsdRCtXGDg1hPz6HWedebkaITr0ZB8fXmIXKOti9hIWwLc+jQmTYMxoUsF1ep4UtC VdLFMRGWgG87DQE1asnaiTGEPLiOB7HwwAbCGuOWiMhDm7Xf7VOL6CFCJCVvFvivY88I 42PRjwxqTrOzxnVfyFw3DzJ6mcsRZLMcBgBBbW6hW6x1zDN6/YlNpCND0clDg4WvaRas AMfA== 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:subject:date:message-id :in-reply-to:references; bh=tANxqYWGrmjcD7B1274P/Tj4NKNee/ohNwUY8q35tV8=; b=RQ09t8PbOcMzGencDBZJSm2HTUdNUEpKCOlKpdRPIsjQfJRGSRCZSNsXvPiphnlY1C p5fnKN+C9+byaMjkXpnQnSs95R4y8KrvrWCPxOKEeJcfF948VENyBDqkWMASBB/Y9Ukn AtUeWcg6bU4qrI1eK9AKTWKIf60gSUIYFxUprB9LhaqgMfzVe9/+PQV1A/xq2W3Y2oTH ORjMVFkSchYnU5wzR/tsFdLOOFwIZjZblc5BJPfCmGJR9RUG5lgqbSI9OS3xmy+MwtIz szgSk3hy0BulfJEdsxa5L8Iq5JzSwsnUnEo0eQ5LIIW//pM7yriWXc/dhaHmO4Gzztr3 P9Vg== X-Gm-Message-State: APjAAAV1X8vugPWWhiGgDpXKAGiAYO1z7bqyLNduF9qw2XvOh6K9EVMj mafEZFh7Fn9SGt3cmLsOyXZUc1A8 X-Google-Smtp-Source: APXvYqzD7kS0excIt8zM8UtUjWJO43+7J+4ygE1z0kotvD3mxzcVifM8cVtONvUhrTKNIUSCEyHWdQ== X-Received: by 2002:a5d:480c:: with SMTP id l12mr20154906wrq.1.1560165307993; Mon, 10 Jun 2019 04:15:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:14:57 +0200 Message-Id: <1560165301-39026-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 Subject: [Qemu-devel] [PATCH 3/7] configure: integrate Meson in the build system 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The Meson build system is integrated in the existing configure/make steps by invoking Meson from the configure script and converting Meson's build.ni= nja rules to an included Makefile. Signed-off-by: Paolo Bonzini --- Makefile | 9 + configure | 30 ++ meson.build | 9 + scripts/ninjatool.py | 964 +++++++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 1012 insertions(+) create mode 100644 meson.build create mode 100644 scripts/ninjatool.py diff --git a/Makefile b/Makefile index 8e2fc66..b8f802c 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,15 @@ git-submodule-update: endif endif =20 +export NINJA=3D./ninjatool +Makefile.ninja: build.ninja ninjatool + ./ninjatool -t ninja2make --omit dist uninstall < $< > $@ +-include Makefile.ninja + +ninjatool: $(SRC_PATH)/scripts/ninjatool.py + sed -e '1c\' -e '#! $(PYTHON)' $< > $@ + chmod +x $@ + .git-submodule-status: git-submodule-update config-host.mak =20 # Check that we're not trying to do an out-of-tree build from diff --git a/configure b/configure index 0814a5f..b8c3c58 100755 --- a/configure +++ b/configure @@ -493,6 +493,7 @@ docker=3D"no" debug_mutex=3D"no" libpmem=3D"" default_devices=3D"yes" +meson=3Dmeson =20 # cross compilers defaults, can be overridden with --cross-cc-ARCH cross_cc_aarch64=3D"aarch64-linux-gnu-gcc" @@ -983,6 +984,8 @@ for opt do ;; --python=3D*) python=3D"$optarg" ;; + --meson=3D*) meson=3D"$optarg" + ;; --gcov=3D*) gcov_tool=3D"$optarg" ;; --smbd=3D*) smbd=3D"$optarg" @@ -1685,6 +1688,7 @@ Advanced options (experts only): --make=3DMAKE use specified make [$make] --install=3DINSTALL use specified install [$install] --python=3DPYTHON use specified python [$python] + --meson=3DPYTHON use specified meson [$meson] --smbd=3DSMBD use specified smbd [$smbd] --with-git=3DGIT use specified git [$git] --static enable static build [$static] @@ -1850,6 +1854,11 @@ then error_exit "Python not found. Use --python=3D/path/to/python" fi =20 +if ! has "$meson" +then + error_exit "Meson not found. Use --meson=3D/path/to/meson" +fi + # 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 < (2,7))'; then @@ -7983,6 +7992,27 @@ echo "# Automatically generated by configure - do no= t modify" > "$iotests_common echo >> "$iotests_common_env" echo "export PYTHON=3D'$python'" >> "$iotests_common_env" =20 +# bootstrap ninjatool, we need it before Make runs +if ! test -x ninjatool; then + sed -e '1c\' -e "#! $python" ${source_path}/scripts/ninjatool.py > ninja= tool + chmod +x ninjatool +fi +rm -rf meson-private meson-info meson-logs +NINJA=3D$PWD/ninjatool $python $meson setup \ + --prefix "$prefix" \ + --libdir "$libdir" \ + --libexecdir "$libexecdir" \ + --bindir "$bindir" \ + --includedir "$includedir" \ + --datadir "$datadir" \ + --mandir "$mandir" \ + --sysconfdir "$sysconfdir" \ + --localstatedir "$local_statedir" \ + $(test "$strip_opt" =3D yes && echo --strip) \ + --buildtype $(if test "$debug" =3D yes; then echo debug; else echo releas= e; fi) \ + "$PWD" "$source_path" + + # Save the configure command line for later reuse. cat <config.status #!/bin/sh diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..b683d70 --- /dev/null +++ b/meson.build @@ -0,0 +1,9 @@ +project('qemu', 'c', meson_version: '>=3D0.50.999') + +kconfig =3D import('unstable-kconfig') +config_host =3D kconfig.load(meson.current_build_dir() / 'config-host.mak') + +add_project_arguments(config_host['QEMU_CFLAGS'].split(), + language: 'c') +add_project_arguments(config_host['QEMU_INCLUDES'].split(), + language: 'c') diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py new file mode 100644 index 0000000..6d90919 --- /dev/null +++ b/scripts/ninjatool.py @@ -0,0 +1,964 @@ +#! /usr/bin/env python3 + +"""Python module for parsing and processing .ninja files. + + Author: Paolo Bonzini + + Copyright (C) 2019 Red Hat, Inc.""" + +from collections import namedtuple, defaultdict +import sys +import os +import re +import json +import argparse + + +class InvalidArgumentError(Exception): + pass + + +# ---- lexer and parser ---- + +BUILD =3D 1 +POOL =3D 2 +RULE =3D 3 +DEFAULT =3D 4 +EQUALS =3D 5 +COLON =3D 6 +PIPE =3D 7 +PIPE2 =3D 8 +IDENT =3D 9 +INCLUDE =3D 10 +INDENT =3D 11 +EOL =3D 12 + + +class LexerError(Exception): + pass + + +class ParseError(Exception): + pass + + +class NinjaParserEvents(object): + def __init__(self, parser): + self.parser =3D parser + + def literal_token(self, word, in_path=3DFalse): + word =3D word.replace('$', '$$') + if in_path: + word =3D word.replace(' ', '$ ').replace(':', '$:') + return word + + def variable_expansion_token(self, varname): + return '${%s}' % varname + + def tokens_to_arg(self, tokens): + return ''.join(tokens or []) + + def variable(self, name, arg): + pass + + def begin_file(self): + pass + + def end_file(self): + pass + + def end_scope(self): + pass + + def begin_pool(self, name): + pass + + def begin_rule(self, name): + pass + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + pass + + def default(self, targets): + pass + + +class NinjaParser(object): + PATH_RE =3D r"[^$\s:|]+|\$[$ :]|\$[a-zA-Z0-9_-]+|\$\{[a-zA-Z0-9_.-]+\}" + STRING_RE =3D r"(" + PATH_RE + r"|[\s:|])(?:\r?\n)?" + TOPLEVEL_RE =3D r"([=3D:#]|\|\|?|^ +|(?:" + PATH_RE + r")+)\s*" + IDENT_RE =3D r"[a-zA-Z0-9_.-]+$" + + InputFile =3D namedtuple('InputFile', 'filename iter lineno') + + def __init__(self, filename, input): + self.stack =3D [] + self.lineno =3D None + self.match_keyword =3D True + self.push(filename, input) + + def __iter__(self): + return self + + def __next__(self): + while len(self.stack): + try: + return next(self.stack[-1].iter) + except StopIteration: + self.pop() + raise StopIteration + + def push(self, filename, input): + entered =3D self.InputFile(filename=3Dfilename or 'stdin', + iter=3Dself._tokens(input), + lineno=3Dself.lineno) + self.stack.append(entered) + self.lineno =3D 0 + if filename is not None: + os.chdir(os.path.dirname(filename) or '.') + + def pop(self): + left =3D self.stack.pop() + self.lineno =3D left.lineno + if len(self.stack): + os.chdir(os.path.dirname(self.stack[-1].filename) or '.') + + def next_line(self, input): + line =3D next(input).rstrip() + self.lineno +=3D 1 + while len(line) and line[-1] =3D=3D '$': + line =3D line[0:-1] + next(input).strip() + self.lineno +=3D 1 + return line + + def print_token(self, tok): + if tok =3D=3D EOL: + return "end of line" + if tok =3D=3D BUILD: + return '"build"' + if tok =3D=3D POOL: + return '"pool"' + if tok =3D=3D RULE: + return '"rule"' + if tok =3D=3D DEFAULT: + return '"default"' + if tok =3D=3D EQUALS: + return '"=3D"' + if tok =3D=3D COLON: + return '":"' + if tok =3D=3D PIPE: + return '"|"' + if tok =3D=3D PIPE2: + return '"||"' + if tok =3D=3D INCLUDE: + return '"include"' + if tok =3D=3D IDENT: + return 'identifier' + return '"%s"' % tok + + def error(self, msg): + raise LexerError("%s:%d: %s" % (self.stack[-1].filename, self.line= no, msg)) + + def parse_error(self, msg): + raise ParseError("%s:%d: %s" % (self.stack[-1].filename, self.line= no, msg)) + + def expected(self, expected, tok): + msg =3D "found %s, expected " % (self.print_token(tok), ) + for i, exp_tok in enumerate(expected): + if i > 0: + msg =3D msg + (' or ' if i =3D=3D len(expected) - 1 else '= , ') + msg =3D msg + self.print_token(exp_tok) + self.parse_error(msg) + + def find_tokens(self, regex, line): + # group 1 is used to distinguish expected input from bad characters + # group 2, which is really group 1 in regex, is returned + for m in re.finditer("(" + regex + ")|.", line): + if not m.group(1): + self.error("unexpected '%s'" % (m.group(0), )) + if m.group(2): + yield m.span(), m.group(2) + + def _variable_tokens(self, value): + for span, match in self.find_tokens(self.STRING_RE, value): + yield match + + def _tokens(self, input): + while True: + try: + line =3D self.next_line(input) + except StopIteration: + return + for span, match in self.find_tokens(self.TOPLEVEL_RE, line): + if match =3D=3D ':': + yield COLON + continue + if match =3D=3D '|': + yield PIPE + continue + if match =3D=3D '||': + yield PIPE2 + continue + if match[0] =3D=3D ' ': + yield INDENT + continue + if match[0] =3D=3D '=3D': + value =3D line[span[0] + 1:].lstrip() + yield EQUALS + yield from self._variable_tokens(value) + break + if match[0] =3D=3D '#': + break + + # identifier + if self.match_keyword: + if match =3D=3D 'build': + yield BUILD + continue + if match =3D=3D 'pool': + yield POOL + continue + if match =3D=3D 'rule': + yield RULE + continue + if match =3D=3D 'default': + yield DEFAULT + continue + if match =3D=3D 'include': + filename =3D line[span[0] + 8:].strip() + self.push(filename, open(filename, 'r')) + break + if match =3D=3D 'subninja': + self.error('subninja is not supported') + yield match + yield EOL + + def read_ident(self): + """Read an identifier, where the only allowed characters are + letter, numbers, dash, period and underscore.""" + self.match_keyword =3D False + token =3D self.__next__() + self.match_keyword =3D True + if isinstance(token, str) and not re.match(self.IDENT_RE, token): + self.parse_error('variable expansion not allowed') + return token + + def read_path(self): + """Read a space-delimited path or a non-alphanumeric token, and + return a generator that produces either the token alone, or + the components of the path (identifiers and variable expansions= ).""" + self.match_keyword =3D False + token =3D self.__next__() + self.match_keyword =3D True + if isinstance(token, str): + yield from self._variable_tokens(token) + else: + yield token + + def parse(self, events): + global_var =3D True + + def advance(): + try: + return next(self) + except StopIteration: + return None + + def look_for(*expected): + tok =3D advance() + if tok in expected: + return tok + self.expected(expected, tok) + + def look_for_ident(*expected): + try: + tok =3D self.read_ident() + except StopIteration: + tok =3D None + if isinstance(tok, str) or tok in expected: + return tok + self.expected(expected + (IDENT,), tok) + + def parse_assignment_rhs(gen, expected, in_path): + value =3D [] + for tok in gen: + if not isinstance(tok, str): + if tok in expected: + break + self.expected(expected + (IDENT,), tok) + if tok[0] !=3D '$': + value.append(events.literal_token(tok, in_path)) + elif tok =3D=3D '$ ' or tok =3D=3D '$$' or tok =3D=3D '$:': + value.append(events.literal_token(tok[1], in_path)) + else: + var =3D tok[2:-1] if tok[1] =3D=3D '{' else tok[1:] + value.append(events.variable_expansion_token(var)) + else: + # gen must have raised StopIteration, return None + # for consistency with advance() + tok =3D None + value =3D value if len(value) else None + return value, tok + + def look_for_path(*expected): + # paths in build rules are parsed one space-separated token + # at a time and expanded + gen =3D self.read_path() + value, tok =3D parse_assignment_rhs(gen, expected, True) + return value, tok + + def parse_assignment(tok): + assert isinstance(tok, str) + look_for(EQUALS) + name =3D tok + value, tok =3D parse_assignment_rhs(self, (EOL,), False) + assert tok =3D=3D EOL + events.variable(name, events.tokens_to_arg(value)) + + def parse_build(): + # parse outputs + out =3D [] + iout =3D [] + while True: + value, tok =3D look_for_path(COLON, PIPE) + if value is None: + break + out.append(events.tokens_to_arg(value)) + if tok =3D=3D PIPE: + while True: + value, tok =3D look_for_path(COLON) + if value is None: + break + iout.append(events.tokens_to_arg(value)) + + # parse rule + assert tok =3D=3D COLON + rule =3D look_for_ident() + + # parse inputs and dependencies + in_ =3D [] + iin =3D [] + orderdep =3D [] + while True: + value, tok =3D look_for_path(PIPE, PIPE2, EOL) + if value is None: + break + in_.append(events.tokens_to_arg(value)) + if tok =3D=3D PIPE: + while True: + value, tok =3D look_for_path(PIPE2, EOL) + if value is None: + break + iin.append(events.tokens_to_arg(value)) + if tok =3D=3D PIPE2: + while True: + value, tok =3D look_for_path(EOL) + if value is None: + break + orderdep.append(events.tokens_to_arg(value)) + assert tok =3D=3D EOL + events.begin_build(out, iout, rule, in_, iin, orderdep) + nonlocal global_var + global_var =3D False + + def parse_pool(): + # pool declarations are ignored. Just gobble all the variables + ident =3D look_for_ident() + look_for(EOL) + events.begin_pool(ident) + nonlocal global_var + global_var =3D False + + def parse_rule(): + ident =3D look_for_ident() + look_for(EOL) + events.begin_rule(ident) + nonlocal global_var + global_var =3D False + + def parse_default(): + idents =3D [] + while True: + ident =3D look_for_ident(EOL) + if ident =3D=3D EOL: + break + idents.append(ident) + events.default(idents) + + def parse_declaration(tok): + if tok =3D=3D EOL: + return + + nonlocal global_var + if tok =3D=3D INDENT: + if global_var: + self.parse_error('indented line outside rule or edge') + tok =3D look_for_ident(EOL) + if tok =3D=3D EOL: + return + parse_assignment(tok) + return + + if not global_var: + events.end_scope() + global_var =3D True + if not tok: + return + if tok =3D=3D POOL: + parse_pool() + elif tok =3D=3D BUILD: + parse_build() + elif tok =3D=3D RULE: + parse_rule() + elif tok =3D=3D DEFAULT: + parse_default() + elif isinstance(tok, str): + parse_assignment(tok) + else: + self.expected((POOL, BUILD, RULE, INCLUDE, DEFAULT, IDENT)= , tok) + + events.begin_file() + while True: + tok =3D advance() + parse_declaration(tok) + if not tok: + break + events.end_file() + + +# ---- variable handling ---- + +def expand(x, rule_vars=3DNone, build_vars=3DNone, global_vars=3DNone): + if x is None: + return None + changed =3D True + while changed: + changed =3D False + matches =3D list(re.finditer(r'\$\$|\$\{([^}]*)\}', x)) + if not matches: + break + + # Reverse the match so that expanding later matches does not + # invalidate m.span() for earlier ones. Do not reduce $$ to $ + # until all variables are dealt with. + matches.reverse() + for m in matches: + if not m.group(1): + continue + changed =3D True + name =3D m.group(1) + if build_vars and name in build_vars: + value =3D build_vars[name] + elif rule_vars and name in rule_vars: + value =3D rule_vars[name] + elif name in global_vars: + value =3D global_vars[name] + else: + value =3D '' + start, end =3D m.span() + x =3D x[:start] + value + x[end:] + return x.replace('$$', '$') + + +class Scope(object): + def __init__(self, events): + self.events =3D events + + def on_left_scope(self): + pass + + def on_variable(self, key, value): + pass + + +class BuildScope(Scope): + def __init__(self, events, out, iout, rule, in_, iin, orderdep, rule_v= ars): + super().__init__(events) + self.rule =3D rule + self.out =3D [events.expand_and_normalize(x) for x in out] + self.in_ =3D [events.expand_and_normalize(x) for x in in_] + self.iin =3D [events.expand_and_normalize(x) for x in iin] + self.orderdep =3D [events.expand_and_normalize(x) for x in orderde= p] + self.iout =3D [events.expand_and_normalize(x) for x in iout] + self.rule_vars =3D rule_vars + self.build_vars =3D dict() + self._define_variable('out', ' '.join(self.out)) + self._define_variable('in', ' '.join(self.in_)) + + def expand(self, x): + return self.events.expand(x, self.rule_vars, self.build_vars) + + def on_left_scope(self): + self.events.variable('out', self.build_vars['out']) + self.events.variable('in', self.build_vars['in']) + self.events.end_build(self, self.out, self.iout, self.rule, self.i= n_, + self.iin, self.orderdep) + + def _define_variable(self, key, value): + # The value has been expanded already, quote it for further + # expansion from rule variables + value =3D value.replace('$', '$$') + self.build_vars[key] =3D value + + def on_variable(self, key, value): + # in and out are at the top of the lookup order and cannot + # be overridden. Also, unlike what the manual says, build + # variables only lookup global variables. They never lookup + # rule variables, earlier build variables, or in/out. + if key not in ('in', 'out'): + self._define_variable(key, self.events.expand(value)) + + +class RuleScope(Scope): + def __init__(self, events, name, vars_dict): + super().__init__(events) + self.name =3D name + self.vars_dict =3D vars_dict + self.generator =3D False + + def on_left_scope(self): + self.events.end_rule(self, self.name) + + def on_variable(self, key, value): + self.vars_dict[key] =3D value + if key =3D=3D 'generator': + self.generator =3D True + + +class NinjaParserEventsWithVars(NinjaParserEvents): + def __init__(self, parser): + super().__init__(parser) + self.rule_vars =3D defaultdict(lambda: dict()) + self.global_vars =3D dict() + self.scope =3D None + + def variable(self, name, value): + if self.scope: + self.scope.on_variable(name, value) + else: + self.global_vars[name] =3D self.expand(value) + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + if rule !=3D 'phony' and rule not in self.rule_vars: + self.parser.parse_error("undefined rule '%s'" % rule) + + self.scope =3D BuildScope(self, out, iout, rule, in_, iin, orderde= p, self.rule_vars[rule]) + + def begin_pool(self, name): + # pool declarations are ignored. Just gobble all the variables + self.scope =3D Scope(self) + + def begin_rule(self, name): + if name in self.rule_vars: + self.parser.parse_error("duplicate rule '%s'" % name) + self.scope =3D RuleScope(self, name, self.rule_vars[name]) + + def end_scope(self): + self.scope.on_left_scope() + self.scope =3D None + + # utility functions: + + def expand(self, x, rule_vars=3DNone, build_vars=3DNone): + return expand(x, rule_vars, build_vars, self.global_vars) + + def expand_and_normalize(self, x): + return os.path.normpath(self.expand(x)) + + # extra events not present in the superclass: + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + pass + + def end_rule(self, scope, name): + pass + + +# ---- test client that just prints back whatever it parsed ---- + +class Writer(NinjaParserEvents): + ARGS =3D argparse.ArgumentParser(description=3D'Rewrite input build.ni= nja to stdout.') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.output =3D output + self.indent =3D '' + self.had_vars =3D False + + def print(self, *args, **kwargs): + if len(args): + self.output.write(self.indent) + print(*args, **kwargs, file=3Dself.output) + + def variable(self, name, value): + self.print('%s =3D %s' % (name, value)) + self.had_vars =3D True + + def begin_scope(self): + self.indent =3D ' ' + self.had_vars =3D False + + def end_scope(self): + if self.had_vars: + self.print() + self.indent =3D '' + self.had_vars =3D False + + def begin_pool(self, name): + self.print('pool %s' % name) + self.begin_scope() + + def begin_rule(self, name): + self.print('rule %s' % name) + self.begin_scope() + + def begin_build(self, outputs, implicit_outputs, rule, inputs, implici= t, order_only): + all_outputs =3D list(outputs) + all_inputs =3D list(inputs) + + if implicit: + all_inputs.append('|') + all_inputs.extend(implicit) + if order_only: + all_inputs.append('||') + all_inputs.extend(order_only) + if implicit_outputs: + all_outputs.append('|') + all_outputs.extend(implicit_outputs) + + self.print('build %s: %s' % (' '.join(all_outputs), + ' '.join([rule] + all_inputs))) + self.begin_scope() + + def default(self, targets): + self.print('default %s' % ' '.join(targets)) + + +# ---- emit compile_commands.json ---- + +class Compdb(NinjaParserEventsWithVars): + ARGS =3D argparse.ArgumentParser(description=3D'Emit compile_commands.= json.') + ARGS.add_argument('rules', nargs=3D'*', + help=3D'The ninja rules to emit compilation commands= for.') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.output =3D output + self.rules =3D args.rules + self.sep =3D '' + + def begin_file(self): + self.output.write('[') + self.directory =3D os.getcwd() + + def print_entry(self, **entry): + entry['directory'] =3D self.directory + self.output.write(self.sep + json.dumps(entry)) + self.sep =3D ',\n' + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + if in_ and rule in self.rules: + super().begin_build(out, iout, rule, in_, iin, orderdep) + else: + self.scope =3D Scope(self) + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + self.print_entry(command=3Dscope.expand('${command}'), file=3Din_[= 0]) + + def end_file(self): + self.output.write(']\n') + + +# ---- clean output files ---- + +class Clean(NinjaParserEventsWithVars): + ARGS =3D argparse.ArgumentParser(description=3D'Remove output build fi= les.') + ARGS.add_argument('-g', dest=3D'generator', action=3D'store_true', + help=3D'clean generated files too') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.dry_run =3D args.dry_run + self.verbose =3D args.verbose or args.dry_run + self.generator =3D args.generator + + def begin_file(self): + print('Cleaning... ', end=3D(None if self.verbose else ''), flush= =3DTrue) + self.cnt =3D 0 + + def end_file(self): + print('%d files' % self.cnt) + + def do_clean(self, *files): + for f in files: + if self.dry_run: + if os.path.exists(f): + self.cnt +=3D 1 + print('Would remove ' + f) + continue + else: + try: + os.unlink(f) + self.cnt +=3D 1 + if self.verbose: + print('Removed ' + f) + except FileNotFoundError: + pass + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + if not self.generator and scope.expand('${generator}'): + return + self.do_clean(*out, *iout) + depfile =3D scope.expand('${depfile}') + if depfile: + self.do_clean(depfile) + + +# ---- convert build.ninja to makefile ---- + +class Ninja2Make(NinjaParserEventsWithVars): + ARGS =3D argparse.ArgumentParser(description=3D'Convert build.ninja to= a Makefile.') + ARGS.add_argument('--clean', dest=3D'emit_clean', action=3D'store_true= ', + help=3D'Emit clean/distclean rules.') + ARGS.add_argument('--doublecolon', action=3D'store_true', + help=3D'Emit double-colon rules for phony targets.') + ARGS.add_argument('--omit', metavar=3D'TARGET', nargs=3D'+', + help=3D'Targets to omit.') + + def __init__(self, output, parser, args): + super().__init__(parser) + self.output =3D output + + self.emit_clean =3D args.emit_clean + self.doublecolon =3D args.doublecolon + self.omit =3D set(args.omit) + + if self.emit_clean: + self.omit.update(['clean', 'distclean']) + + # Lists of targets are kept in memory and emitted only at the + # end because appending is really inefficient in GNU make. + # We only do it when it's O(#rules) or O(#variables), but + # never when it could be O(#targets). + self.depfiles =3D list() + self.build_vars =3D defaultdict(lambda: dict()) + self.rule_targets =3D defaultdict(lambda: list()) + self.all_outs =3D set() + self.all_ins =3D set() + self.all_phony =3D set() + self.seen_default =3D False + + def print(self, *args, **kwargs): + print(*args, **kwargs, file=3Dself.output) + + def literal_token(self, word, in_path=3DFalse): + if in_path and ' ' in word: + self.parser.parse_error('Make does not support spaces in filen= ames') + return word.replace('$', '$$') + + def print_phony(self, outs, ins): + targets =3D ' '.join(outs).replace('$', '$$') + deps =3D ' '.join(ins).replace('$', '$$') + deps =3D deps.strip() + if self.doublecolon: + self.print(targets + '::' + (' ' if deps else '') + deps + ';@= :') + else: + self.print(targets + ':' + (' ' if deps else '') + deps) + self.all_phony.update(outs) + + def begin_file(self): + self.print(r'# This is an automatically generated file, and it sho= ws.') + self.print(r'ninja-default:') + self.print(r'.PHONY: ninja-default') + if self.emit_clean: + self.print(r'ninja-clean:: ninja-clean-start; $(if $V,,@)rm -f= ${ninja-depfiles}') + self.print(r'ninja-clean-start:; $(if $V,,@echo Cleaning...)') + self.print(r'ninja-distclean:: clean') + self.print(r'.PHONY: ninja-clean ninja-clean-start ninja-distc= lean') + self.print_phony(['clean'], ['ninja-clean']) + self.print_phony(['distclean'], ['ninja-distclean']) + self.print(r'vpath') + self.print(r'NULL :=3D') + self.print(r'SPACE :=3D ${NULL} #') + self.print(r'MAKEFLAGS +=3D -rR') + self.print(r'define NEWLINE') + self.print(r'') + self.print(r'endef') + self.print(r'.var.in_newline =3D $(subst $(SPACE),$(NEWLINE),${.va= r.in})') + self.print(r"ninja-command =3D $(if $V,,@printf '%s\n' '$(subst ',= '\'',${.var.description})' && )${.var.command}") + + def mangle_vars_for_make(self, x): + matches =3D list(re.finditer(r'\$\$|\$\{([^}]*)\}', x)) + + # Reverse the match so that expanding later matches does not + # invalidate m.span() for earlier ones. + matches.reverse() + for m in matches: + if not m.group(1): + continue + value =3D '${.var.' + m.group(1) + '}' + start, end =3D m.span() + x =3D x[:start] + value + x[end:] + return x + + def end_file(self): + def natural_sort_key(s, _nsre=3Dre.compile('([0-9]+)')): + return [int(text) if text.isdigit() else text.lower() + for text in _nsre.split(s)] + + self.print() + self.print('ninja-outputdirs :=3D') + for rule in self.rule_vars: + if rule =3D=3D 'phony': + continue + self.print('ninja-targets-%s :=3D %s' % (rule, ' '.join(self.r= ule_targets[rule]))) + for name, value in self.rule_vars[rule].items(): + self.print('$(ninja-targets-%s): .var.%s =3D %s' % (rule, = name, self.mangle_vars_for_make(value))) + self.print('ninja-outputdirs +=3D $(sort $(dir ${ninja-targets= -%s}))' % rule) + self.print() + self.print('dummy :=3D $(shell mkdir -p . $(sort $(ninja-outputdir= s)))') + self.print('ninja-depfiles :=3D' + ' '.join(self.depfiles)) + self.print('-include ${ninja-depfiles}') + self.print() + for targets in self.build_vars: + for name, value in self.build_vars[targets].items(): + self.print('%s: .var.%s :=3D %s' % (targets, name, value)) + self.print() + if not self.seen_default: + default_targets =3D sorted(self.all_outs - self.all_ins, key= =3Dnatural_sort_key) + self.print('ninja-default: ' + ' '.join(default_targets)) + + # This is a hack... Meson declares input meson.build files as + # phony, because Ninja does not have an equivalent of Make's + # "path/to/file:" declaration that ignores "path/to/file" even + # if it is absent. However, Makefile.ninja wants to depend on + # build.ninja, which in turn depends on these phony targets which + # would cause Makefile.ninja to be rebuilt in a loop. + phony_targets =3D sorted(self.all_phony - self.all_ins, key=3Dnatu= ral_sort_key) + self.print('.PHONY: ' + ' '.join(phony_targets)) + + def variable(self, name, value): + super().variable(name, value) + if self.scope is None: + self.global_vars[name] =3D self.expand(value) + self.print('.var.%s :=3D %s' % (name, self.global_vars[name])) + elif isinstance(self.scope, BuildScope): + # These have to be printed last, because they override rule va= riables + # but we cannot print rule variables until we know the list of= targets + # for each rule. + self.build_vars[self.current_targets][name] =3D self.scope.bui= ld_vars[name] + + def begin_build(self, out, iout, rule, in_, iin, orderdep): + if any(x in self.omit for x in out): + self.scope =3D Scope(self) + return + + super().begin_build(out, iout, rule, in_, iin, orderdep) + self.rule_targets[rule] +=3D self.scope.out + self.rule_targets[rule] +=3D self.scope.iout + + self.all_outs.update(self.scope.iout) + self.all_outs.update(self.scope.out) + self.all_ins.update(self.scope.in_) + self.all_ins.update(self.scope.iin) + + if rule =3D=3D 'phony': + # Phony rules treat order-only dependencies as normal deps + self.print_phony(self.scope.out + self.scope.iout, + self.scope.in_ + self.scope.iin + self.scope.= orderdep) + self.scope =3D Scope(self) + return + + targets =3D ' '.join(self.scope.out + self.scope.iout).replace('$'= , '$$') + inputs =3D ' '.join(self.scope.in_ + self.scope.iin).replace('$', = '$$') + orderonly =3D ' '.join(self.scope.orderdep).replace('$', '$$') + self.print('%s: %s | %s; ${ninja-command}' % (targets, inputs, ord= eronly)) + self.current_targets =3D targets + + def end_build(self, scope, out, iout, rule, in_, iin, orderdep): + depfile =3D scope.expand('${depfile}') + if depfile: + self.depfiles.append(depfile) + self.current_targets =3D None + + def end_rule(self, scope, name): + if self.emit_clean: + self.print('ninja-%s:: ; $(if $V,,@)rm -f ${ninja-targets-%s}'= % ( + 'distclean' if scope.generator else 'clean', + name)) + + def default(self, targets): + self.print("ninja-default: " + ' '.join(targets)) + self.seen_default =3D True + + +# ---- command line parsing ---- + +# we cannot use subparsers because tools are chosen through the "-t" +# option. + +class ToolAction(argparse.Action): + def __init__(self, option_strings, dest, choices, metavar=3D'TOOL', na= rgs=3DNone, **kwargs): + if nargs is not None: + raise ValueError("nargs not allowed") + super().__init__(option_strings, dest, required=3DTrue, choices=3D= choices, + metavar=3Dmetavar, **kwargs) + + def __call__(self, parser, namespace, value, option_string): + tool =3D self.choices[value] + setattr(namespace, self.dest, tool) + tool.ARGS.prog =3D '%s %s %s' % (parser.prog, option_string, value) + + +class ToolHelpAction(argparse.Action): + def __init__(self, option_strings, dest, nargs=3DNone, **kwargs): + if nargs is not None: + raise ValueError("nargs not allowed") + super().__init__(option_strings, dest, nargs=3D0, **kwargs) + + def __call__(self, parser, namespace, values, option_string=3DNone): + if namespace.tool: + namespace.tool.ARGS.print_help() + else: + parser.print_help() + parser.exit() + + +tools =3D { + 'test': Writer, + 'ninja2make': Ninja2Make, + 'compdb': Compdb, + 'clean': Clean, +} + +parser =3D argparse.ArgumentParser(description=3D'Process and transform bu= ild.ninja files.', + add_help=3DFalse) +parser.add_argument('-C', metavar=3D'DIR', dest=3D'dir', default=3D'.', + help=3D'change to DIR before doing anything else') +parser.add_argument('-f', metavar=3D'FILE', dest=3D'file', default=3D'buil= d.ninja', + help=3D'specify input build file [default=3Dbuild.ninj= a]') +parser.add_argument('-n', dest=3D'dry_run', action=3D'store_true', + help=3D'do not actually do anything') +parser.add_argument('-v', dest=3D'verbose', action=3D'store_true', + help=3D'be more verbose') + +parser.add_argument('-t', dest=3D'tool', choices=3Dtools, action=3DToolAct= ion, + help=3D'choose the tool to run') +parser.add_argument('-h', '--help', action=3DToolHelpAction, + help=3D'show this help message and exit') + +if len(sys.argv) >=3D 2 and sys.argv[1] =3D=3D '--version': + print('1.8') + sys.exit(0) + +args, tool_args =3D parser.parse_known_args() +args.tool.ARGS.parse_args(tool_args, args) + +os.chdir(args.dir) +with open(args.file, 'r') as f: + parser =3D NinjaParser(args.file, f) + try: + events =3D args.tool(sys.stdout, parser, args) + except InvalidArgumentError as e: + parser.error(str(e)) + parser.parse(events) --=20 1.8.3.1 From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560165871; cv=none; d=zoho.com; s=zohoarc; b=fiTqzwDtxpOspfQrNx/i5BLTHQOAYem/FpYJE03MsvSMVUjVVX9F8pY317aGJSWUEO4uzL7nmarBLzJt+KSSToMagN4NowKjisWDWx43pPhgUE8EzK4Ty6zqMs/NBOuvU/6jxuNQPLKPZXmbbcmq2J9+8yxDva2hVirr9IoV15o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560165871; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ElZKCGuiZjv0T7oDmrIXGv2pOxAvcOLWWjOt4Xe9G90=; b=l+zdnC4Br6/LzeROBe3XcexwByU1rJ92hPXCU+ZsyLUl2Apj+C+KJTDdRzy72LhOH+f0MgatqfF1i82nvGniHS3UtWeBPaddUD4kL6pXulz5FDN6uI7Ar5udZN2j67QZ3dc+q9jD5WSa9UcRnF0rMsixHejz9r3AMV8HZKRINTM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560165871720834.4101924907885; Mon, 10 Jun 2019 04:24:31 -0700 (PDT) Received: from localhost ([::1]:44580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIPZ-0006HM-CU for importer@patchew.org; Mon, 10 Jun 2019 07:24:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43061) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGd-00074O-Ij for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGc-0000Wi-Bf for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:11 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:36557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGc-0000UF-4Q for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:10 -0400 Received: by mail-wr1-x444.google.com with SMTP id n4so8771568wrs.3 for ; Mon, 10 Jun 2019 04:15:10 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=ElZKCGuiZjv0T7oDmrIXGv2pOxAvcOLWWjOt4Xe9G90=; b=d3lQy6AW9hzOkwduoPZmT5mDb5MwZv7XIGUnTP7I43BJ5iOm77/Zxw9xS8N9lBgBJM /AHVxlxnTvCixGnYa+hxZ99vhiPeRXwDKvhs2tu23IHWPNrrjjszhiGO1yzdSAOcVz0N ubttsNLukYlT4HFjBgNk7Y1t2Am0kualo/Yu9Vt0hWWEXhd9JR6YX4mRn2BBxho+ptup 7Da+lLNPuUUnwOfWhkJlYgYtJw1yocteXRnEZFvtCDgZKPhFZvAPQDogpeZMYKAzybWr ZcIEN1sVJIjd8uSgxG9fchiPaGjOX9/Egu3GgsWQa/DsHk4NqP9tK/XpBupHMYk4HLZl qT2w== 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:subject:date:message-id :in-reply-to:references; bh=ElZKCGuiZjv0T7oDmrIXGv2pOxAvcOLWWjOt4Xe9G90=; b=QHldLZ2eiXDSkD7uCzX3hhospRWylNJbgBDeiJX3w/yf64j14faqg55ADqDUFw5lSi 7gJCV3xBWpcQofGVJCKQ2lXmUYZNfGPg7LhXNXN58m4h74ZHqAUIKoB60QzQRqLRHUbP l6lYYkxdm+NN7B73Et5lOrMBi9FcGkQutZPeNQ0qktwnel7pySZs0E38BOx8+XHwXtlr TZapf3twbdti+sCIqehCusRauAemw0bdcgyrGZFHXHUmYAsfO528akrx1aiSyWktPEV/ 4IbGA+uvDci3YNPTL+MTpQQz71nXxvgXHVY7aD7AHflj1Qo//EFjwihGPBKIzz5QVFjF qbwg== X-Gm-Message-State: APjAAAV/r3UJy8qDzFOgKugpB3JunzNhmM8h2B7Hd609S1sSQo68oyrU y2gVWGkmALZp6tvXp4Mv2CY98hUX X-Google-Smtp-Source: APXvYqzl7MyzzUVZz2eH0I6jiJmkgbFV9oZYmQ1uOoDbZaP1H5ARpP7+Or75Jp8rWA0uzGob32rU2Q== X-Received: by 2002:a5d:4e83:: with SMTP id e3mr11137394wru.263.1560165308741; Mon, 10 Jun 2019 04:15:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:14:58 +0200 Message-Id: <1560165301-39026-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH 4/7] libvhost-user: convert to Meson 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Because libqemuutil.a is not converted yet, selected files have to be compiled twice, once with Meson and once with Makefile.objs. Apart from this the conversion is straightforward. Signed-off-by: Paolo Bonzini --- Makefile | 10 ++++------ Makefile.objs | 1 - contrib/libvhost-user/Makefile.objs | 1 - contrib/libvhost-user/meson.build | 7 +++++++ meson.build | 2 ++ 5 files changed, 13 insertions(+), 8 deletions(-) delete mode 100644 contrib/libvhost-user/Makefile.objs create mode 100644 contrib/libvhost-user/meson.build diff --git a/Makefile b/Makefile index b8f802c..6a3461e 100644 --- a/Makefile +++ b/Makefile @@ -426,7 +426,6 @@ dummy :=3D $(call unnest-vars,, \ ivshmem-client-obj-y \ ivshmem-server-obj-y \ rdmacm-mux-obj-y \ - libvhost-user-obj-y \ vhost-user-scsi-obj-y \ vhost-user-blk-obj-y \ vhost-user-input-obj-y \ @@ -529,7 +528,6 @@ Makefile: $(version-obj-y) # Build libraries =20 libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y) -libvhost-user.a: $(libvhost-user-obj-y) $(util-obj-y) $(stub-obj-y) =20 ###################################################################### =20 @@ -632,21 +630,21 @@ ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) $(CO= MMON_LDADDS) ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS) $(call LINK, $^) endif -vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a +vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) contrib/libvhost-user/l= ibvhost-user.a $(call LINK, $^) -vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a +vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) contrib/libvhost-user/lib= vhost-user.a $(call LINK, $^) =20 rdmacm-mux$(EXESUF): LIBS +=3D "-libumad" rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS) $(call LINK, $^) =20 -vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) li= bqemuutil.a libqemustub.a +vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) contrib/libvhost-user/lib= vhost-user.a $(call LINK, $^) =20 ifdef CONFIG_VHOST_USER_INPUT ifdef CONFIG_LINUX -vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) libvhost-user.a libqe= muutil.a +vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) contrib/libvhost-user= /libvhost-user.a $(COMMON_LDADDS) $(call LINK, $^) =20 # build by default, do not install diff --git a/Makefile.objs b/Makefile.objs index c8337fa..4f2fa6a 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -116,7 +116,6 @@ qga-vss-dll-obj-y =3D qga/ elf2dmp-obj-y =3D contrib/elf2dmp/ ivshmem-client-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshmem-client/ ivshmem-server-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshmem-server/ -libvhost-user-obj-y =3D contrib/libvhost-user/ vhost-user-scsi.o-cflags :=3D $(LIBISCSI_CFLAGS) vhost-user-scsi.o-libs :=3D $(LIBISCSI_LIBS) vhost-user-scsi-obj-y =3D contrib/vhost-user-scsi/ diff --git a/contrib/libvhost-user/Makefile.objs b/contrib/libvhost-user/Ma= kefile.objs deleted file mode 100644 index ef3778e..0000000 --- a/contrib/libvhost-user/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -libvhost-user-obj-y +=3D libvhost-user.o libvhost-user-glib.o diff --git a/contrib/libvhost-user/meson.build b/contrib/libvhost-user/meso= n.build new file mode 100644 index 0000000..7ef610a --- /dev/null +++ b/contrib/libvhost-user/meson.build @@ -0,0 +1,7 @@ +libvhost_user =3D static_library('vhost-user', + [files('libvhost-user.c', 'libvhost-user-glib.c'), + meson.source_root() / 'stubs/error-printf.c', + meson.source_root() / 'stubs/monitor.c', + meson.source_root() / 'util/error.c', + meson.source_root() / 'util/qemu-error.c', + meson.source_root() / 'util/memfd.c']) diff --git a/meson.build b/meson.build index b683d70..a6748f9 100644 --- a/meson.build +++ b/meson.build @@ -7,3 +7,5 @@ add_project_arguments(config_host['QEMU_CFLAGS'].split(), language: 'c') add_project_arguments(config_host['QEMU_INCLUDES'].split(), language: 'c') + +subdir('contrib/libvhost-user') --=20 1.8.3.1 From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560166072; cv=none; d=zoho.com; s=zohoarc; b=AFXDrkI5e3NUCc/dvd+5uMFAu7g/6eu+s/K5RlL9oYclzvsJWhXhJsXNSWQwal8jBHPwKmdw/IvY2Urus5HaLQ0QBzDEQupsvhQvrVArYgflkID2pQtKq7U7vJXLZsykJrF9JbDKbj0+d54PIA7qAL6DUH5ff7ByC61lVXvnqpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560166072; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1zrIFAijuNVbF8dO1b1lYHUT6C8Kbe7c2Cym046QUnE=; b=Puuy+3d6+00owWpx+0BbSIZOhLDKow5Dz1rzVN92e/JR9m2o6BtFCJl0kpiUR9LrtqL4u+PomqTqa3taynNAWaGE8SQqMK+odd2djuv7ymaQHpkv6aqyRLnxl5KmUVsPVepVjkmIT0W4TFw1XlOUtd3qyvSlMUOVrtN5ytD19EM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1560166072451610.8616581015165; Mon, 10 Jun 2019 04:27:52 -0700 (PDT) Received: from localhost ([::1]:44590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haISo-0008Na-AQ for importer@patchew.org; Mon, 10 Jun 2019 07:27:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43071) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGe-00076n-Dv for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGd-0000YB-7m for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:12 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:33345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGd-0000Wd-0w for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:11 -0400 Received: by mail-wr1-x442.google.com with SMTP id n9so8781901wru.0 for ; Mon, 10 Jun 2019 04:15:10 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=1zrIFAijuNVbF8dO1b1lYHUT6C8Kbe7c2Cym046QUnE=; b=KRBKkGjJpU4QOt/jNdsDx/1OpdSgbquLUk5NWRAjZbcYRx5JDiU/9xLxCkYsaYoS5F 1Y+gUcsCbx8Qzmio89GH9Mm8axSHrcpRYrcV968hP+Y4O8yx0si+Oz5oKDnyLLhtzjTr ql4HlOtj23wPBfpFfGEDfe6ZKxZNQ2+ueaHjhtnEwFCgzVMEXaIpms+uYXSdSxWX/qSP JPj7V99p0hV/IzfpAzHftcgP16zEUj3tOmy9r/SwIJw1bkfEGN+qZa+UdoAFrEHOrUDF zKenmemSXXgRBTbqiAhqEdjqbB6a2qEYQOpno1CIcu4IkXQ4S0H0bWMNzxczE1YT/Pfq Tzpg== 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:subject:date:message-id :in-reply-to:references; bh=1zrIFAijuNVbF8dO1b1lYHUT6C8Kbe7c2Cym046QUnE=; b=i5QkCthBOL0xvANdU2/SrKI3yGyHSVosMyE8U7IZW2Ol+mBjL7FCcNzo4OPc1eGhii 7hNHpTODsCWVXScVkMjhVvGNTY9FgVKj1ULn1g+5iwoyx7m6oICciXVJQdqJwhuUFhCW 5T0A5eMoUPO4kziR0EddFf7pR8dgAmgN1ipPMPB2/cYTRwEF1LXTupSM6yDLJV0vEP4i O3sM1unQsinFmHytqdcDdTh7Ccx8SAi7BBDDSx4sbdv/2IhvTGOYxXdKTy/YG51Q17SG ohYzB22AisEGK8chAci/lT2I+yj+PAydbglaxqvlBzGmOmuE94eooP31pkbLEuYvRi3+ 8/hA== X-Gm-Message-State: APjAAAU3WJOgCFUBzNXAUT06Yyh0yWPh4AIpKvXVVUwx3hdD4UOx2yoU /e+mezttE9OcdOrDF4qWBZOYLLSG X-Google-Smtp-Source: APXvYqy+YQrRf+Wis1OURi99yd2MqRz3ytwchKCxkxs7yS6q0rOe7mzAwKy4JOgRK0Ix5zgBCK2cdg== X-Received: by 2002:adf:dd82:: with SMTP id x2mr7391025wrl.27.1560165309690; Mon, 10 Jun 2019 04:15:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:14:59 +0200 Message-Id: <1560165301-39026-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH 5/7] vhost-user-blk: convert to Meson 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The GLib pkg-config information is extracted from config-host.mak and used to link vhost-user-blk. Signed-off-by: Paolo Bonzini --- .gitignore | 2 +- Makefile | 3 --- Makefile.objs | 1 - configure | 2 ++ contrib/vhost-user-blk/Makefile.objs | 1 - contrib/vhost-user-blk/meson.build | 3 +++ meson.build | 4 ++++ 7 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 contrib/vhost-user-blk/Makefile.objs create mode 100644 contrib/vhost-user-blk/meson.build diff --git a/.gitignore b/.gitignore index fd6e6c3..20637a1 100644 --- a/.gitignore +++ b/.gitignore @@ -64,7 +64,7 @@ /module_block.h /scsi/qemu-pr-helper /vhost-user-scsi -/vhost-user-blk +/contrib/vhost-user-blk/vhost-user-blk /fsdev/virtfs-proxy-helper *.tmp *.[1-9] diff --git a/Makefile b/Makefile index 6a3461e..da290fa 100644 --- a/Makefile +++ b/Makefile @@ -427,7 +427,6 @@ dummy :=3D $(call unnest-vars,, \ ivshmem-server-obj-y \ rdmacm-mux-obj-y \ vhost-user-scsi-obj-y \ - vhost-user-blk-obj-y \ vhost-user-input-obj-y \ vhost-user-gpu-obj-y \ qga-vss-dll-obj-y \ @@ -632,8 +631,6 @@ ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMM= ON_LDADDS) endif vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) contrib/libvhost-user/l= ibvhost-user.a $(call LINK, $^) -vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) contrib/libvhost-user/lib= vhost-user.a - $(call LINK, $^) =20 rdmacm-mux$(EXESUF): LIBS +=3D "-libumad" rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS) diff --git a/Makefile.objs b/Makefile.objs index 4f2fa6a..644e2bd 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -119,7 +119,6 @@ ivshmem-server-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshme= m-server/ vhost-user-scsi.o-cflags :=3D $(LIBISCSI_CFLAGS) vhost-user-scsi.o-libs :=3D $(LIBISCSI_LIBS) vhost-user-scsi-obj-y =3D contrib/vhost-user-scsi/ -vhost-user-blk-obj-y =3D contrib/vhost-user-blk/ rdmacm-mux-obj-y =3D contrib/rdmacm-mux/ vhost-user-input-obj-y =3D contrib/vhost-user-input/ vhost-user-gpu-obj-y =3D contrib/vhost-user-gpu/ diff --git a/configure b/configure index b8c3c58..f00a9e4 100755 --- a/configure +++ b/configure @@ -7364,6 +7364,8 @@ echo "CFLAGS_NOPIE=3D$CFLAGS_NOPIE" >> $config_host_m= ak echo "QEMU_CFLAGS=3D$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=3D$QEMU_CXXFLAGS" >> $config_host_mak echo "QEMU_INCLUDES=3D$QEMU_INCLUDES" >> $config_host_mak +echo "GLIB_CFLAGS=3D$glib_cflags" >> $config_host_mak +echo "GLIB_LIBS=3D$glib_libs" >> $config_host_mak if test "$sparse" =3D "yes" ; then echo "CC :=3D REAL_CC=3D\"\$(CC)\" cgcc" >> $config_host= _mak echo "CPP :=3D REAL_CC=3D\"\$(CPP)\" cgcc" >> $config_host= _mak diff --git a/contrib/vhost-user-blk/Makefile.objs b/contrib/vhost-user-blk/= Makefile.objs deleted file mode 100644 index 72e2cdc..0000000 --- a/contrib/vhost-user-blk/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -vhost-user-blk-obj-y =3D vhost-user-blk.o diff --git a/contrib/vhost-user-blk/meson.build b/contrib/vhost-user-blk/me= son.build new file mode 100644 index 0000000..6c00b3b --- /dev/null +++ b/contrib/vhost-user-blk/meson.build @@ -0,0 +1,3 @@ +executable('vhost-user-blk', files('vhost-user-blk.c'), + link_with: libvhost_user, + dependencies: glib) diff --git a/meson.build b/meson.build index a6748f9..c4cad8f 100644 --- a/meson.build +++ b/meson.build @@ -8,4 +8,8 @@ add_project_arguments(config_host['QEMU_CFLAGS'].split(), add_project_arguments(config_host['QEMU_INCLUDES'].split(), language: 'c') =20 +glib =3D declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split= (), + link_args: config_host['GLIB_LIBS'].split()) + subdir('contrib/libvhost-user') +subdir('contrib/vhost-user-blk') --=20 1.8.3.1 From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560165587; cv=none; d=zoho.com; s=zohoarc; b=KdT5Pnn0sZc8d9zvLWlXf+Hz16zS19gRAziPraV0FAKZ/JccgZYGS+nCVIBSrXaUEDVAjG+ssu6/gOzX4IxcRCibcTlceGdip6rbQaQwHRCQdgr5IWyfBl1wBFvFL9nvW4qsFxNAcWEhYLXpFpPNlY4Q7CNe3FpQyATidkgUQJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560165587; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3rDTeC3Zw+Hw1sj7S+oSbSBKIxPHg3b0TKg/3EFDzXo=; b=HKCH0SBxo/s7raNGCLMc0/k1kDHVu7gg48f8HCAgA3RIrmXvC7llGuNOcwMsUOEH0scXZK6yanC1e0NemZyXyh41tbBBMfl8rFfEDqqMzO9Yb6BPs0+97/Xd1+BIyzdrPpeB80BP/wkM9boyLX1OINlM2x6a5gnXzCDZ2Tx4/Cc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1560165587413496.4824244139288; Mon, 10 Jun 2019 04:19:47 -0700 (PDT) Received: from localhost ([::1]:44544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIKy-0001OI-8q for importer@patchew.org; Mon, 10 Jun 2019 07:19:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43084) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGf-00078b-CP for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGe-0000Zu-43 for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:13 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGd-0000YJ-Sz for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:12 -0400 Received: by mail-wr1-x441.google.com with SMTP id v14so8744140wrr.4 for ; Mon, 10 Jun 2019 04:15:11 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=3rDTeC3Zw+Hw1sj7S+oSbSBKIxPHg3b0TKg/3EFDzXo=; b=r0cLEwzGba/WaEp6d0gFnLMaeVU60yjeIM61HpLGWV8O5b3QcLdXbmnC3aSm9Zsrdl VGDXS7h8lfwIo/MuSKFPbOeb1wYaLVF69LGlWKY+2KtmltJLBYXfl8XnCS15ti61qy4j 25An/RU72JAU08Pg87uwDT/RZ7JzhgIWWLWSRG5AcqUoDruZGsjMDIGyqc6yc7yX7+on WOc9LtD3Xr3eoH/5Gmw1vAdhLd5I3aFpCpnYIT/10/04k4YPBhj5G1rg0HeOT5QWxTcX cydJk5unBb/Sw+gVV2WDetlLUkj/tqLbePm1Y3o23ohEtht9OY7er4Ml89Xuxd8OWabr gQ7Q== 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:subject:date:message-id :in-reply-to:references; bh=3rDTeC3Zw+Hw1sj7S+oSbSBKIxPHg3b0TKg/3EFDzXo=; b=EC1x9kRtbTh36B9l9hM+cAfsYkzU57MR7q0/f/jRaUVZQkWcki8LmUajVXiXGAJ2RN UF2KdFQiqpKjxuywEwLDaHb5kZDGM4aM+PwhIOG8xXuOs1UkNe4arIxDjdGLyTenoy9d PLpUQWoddG4FwNGudn4+JX7rzS83J/24gwicHyhbzxbw7gdOQsm+lXvf483/LKok+eHS Yb+Tl9/fU3BqxlXWP6BaaNqAG/6On/P/3mKKX8AS5jkflTiCo2NEwaoqn4aQwLhH2uKJ /5WDn+SQCrJLubMKx9tCaQP7dYbIPAMHmvaqiK65Y5eLoAfcdRwfZMNdDlcaqbrJRrKI 3IbA== X-Gm-Message-State: APjAAAUKeCxoKX047W2Y1hH2qEU6qDW2qN1gA6HV3ypUud8LmqkRQI3y HMmaHnaKKJzWVj8lZR5gM+Ht+OE/ X-Google-Smtp-Source: APXvYqyX9e+xCRLViUCy/AIvH+iQQBxMG1iUQIPkEDNUR/H1qmPcJ/Xn7YN4H0B9s7+wmJLdeRy90g== X-Received: by 2002:adf:e485:: with SMTP id i5mr8912317wrm.75.1560165310664; Mon, 10 Jun 2019 04:15:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:15:00 +0200 Message-Id: <1560165301-39026-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH 6/7] vhost-user-scsi: convert to Meson 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The libiscsi pkg-config information is extracted from config-host.mak and used to link vhost-user-blk. Signed-off-by: Paolo Bonzini --- .gitignore | 2 +- Makefile | 3 --- Makefile.objs | 3 --- contrib/vhost-user-scsi/Makefile.objs | 1 - contrib/vhost-user-scsi/meson.build | 3 +++ meson.build | 3 +++ 6 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 contrib/vhost-user-scsi/Makefile.objs create mode 100644 contrib/vhost-user-scsi/meson.build diff --git a/.gitignore b/.gitignore index 20637a1..3934eff 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,7 @@ /qemu-version.h.tmp /module_block.h /scsi/qemu-pr-helper -/vhost-user-scsi +/contrib/vhost-user-scsi/vhost-user-scsi /contrib/vhost-user-blk/vhost-user-blk /fsdev/virtfs-proxy-helper *.tmp diff --git a/Makefile b/Makefile index da290fa..bff097c 100644 --- a/Makefile +++ b/Makefile @@ -426,7 +426,6 @@ dummy :=3D $(call unnest-vars,, \ ivshmem-client-obj-y \ ivshmem-server-obj-y \ rdmacm-mux-obj-y \ - vhost-user-scsi-obj-y \ vhost-user-input-obj-y \ vhost-user-gpu-obj-y \ qga-vss-dll-obj-y \ @@ -629,8 +628,6 @@ ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) $(COMM= ON_LDADDS) ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS) $(call LINK, $^) endif -vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) contrib/libvhost-user/l= ibvhost-user.a - $(call LINK, $^) =20 rdmacm-mux$(EXESUF): LIBS +=3D "-libumad" rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS) diff --git a/Makefile.objs b/Makefile.objs index 644e2bd..adf2f92 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -116,9 +116,6 @@ qga-vss-dll-obj-y =3D qga/ elf2dmp-obj-y =3D contrib/elf2dmp/ ivshmem-client-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshmem-client/ ivshmem-server-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshmem-server/ -vhost-user-scsi.o-cflags :=3D $(LIBISCSI_CFLAGS) -vhost-user-scsi.o-libs :=3D $(LIBISCSI_LIBS) -vhost-user-scsi-obj-y =3D contrib/vhost-user-scsi/ rdmacm-mux-obj-y =3D contrib/rdmacm-mux/ vhost-user-input-obj-y =3D contrib/vhost-user-input/ vhost-user-gpu-obj-y =3D contrib/vhost-user-gpu/ diff --git a/contrib/vhost-user-scsi/Makefile.objs b/contrib/vhost-user-scs= i/Makefile.objs deleted file mode 100644 index e83a38a..0000000 --- a/contrib/vhost-user-scsi/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -vhost-user-scsi-obj-y =3D vhost-user-scsi.o diff --git a/contrib/vhost-user-scsi/meson.build b/contrib/vhost-user-scsi/= meson.build new file mode 100644 index 0000000..b80398c --- /dev/null +++ b/contrib/vhost-user-scsi/meson.build @@ -0,0 +1,3 @@ +executable('vhost-user-scsi', files('vhost-user-scsi.c'), + link_with: libvhost_user, + dependencies: [glib, libiscsi]) diff --git a/meson.build b/meson.build index c4cad8f..bc7fbea 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,9 @@ add_project_arguments(config_host['QEMU_INCLUDES'].split(= ), =20 glib =3D declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split= (), link_args: config_host['GLIB_LIBS'].split()) +libiscsi =3D declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS= '].split(), + link_args: config_host['LIBISCSI_LIBS'].split()) =20 subdir('contrib/libvhost-user') subdir('contrib/vhost-user-blk') +subdir('contrib/vhost-user-scsi') --=20 1.8.3.1 From nobody Sun May 5 04:32:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1560165738; cv=none; d=zoho.com; s=zohoarc; b=TRZpQ8jQPpSsMRBTBogpfWrUxwWwGnRfyAsfjn4Yevf2vCEkzebreJl2X7GUQM06ailX/GLqgauG8xf5Hn7zEUmtt28uckF0+iZ2qm0RH8g2DKz5dWAFmPuot4G1jsN1ziCP0bh5XjNmJKuAoARCW7MybfcgrNKpRbImJoi88u4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560165738; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5QNa1qywltOY6IhhPyZZnFVHJhPrjIri5Xi1Vm0lVkk=; b=MqU6tnuLrr9f1+fHJe8lgUEADarHw4HGxmLBV+vPBpHxixKaV+BZxxWccGcvCwa0GgdYf/JIF/4RoWJ6AK7jK9qdglZKdkgMCv25MOMpsBC/e9UpGKJQ+beLz/f0Xd7fKC57FaZhp0HBTy+KPs/UpAXXvkNK4cwORIaP3nAP4Uw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1560165738370622.0281608734559; Mon, 10 Jun 2019 04:22:18 -0700 (PDT) Received: from localhost ([::1]:44568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haINQ-00048x-O9 for importer@patchew.org; Mon, 10 Jun 2019 07:22:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43119) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haIGg-0007BV-II for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haIGf-0000bM-79 for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:14 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52830) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haIGe-0000aG-Vb for qemu-devel@nongnu.org; Mon, 10 Jun 2019 07:15:13 -0400 Received: by mail-wm1-x344.google.com with SMTP id s3so8077279wms.2 for ; Mon, 10 Jun 2019 04:15:12 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u13sm11934414wrq.62.2019.06.10.04.15.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 04:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=5QNa1qywltOY6IhhPyZZnFVHJhPrjIri5Xi1Vm0lVkk=; b=tbkNzMgZvlmIF2ql8mCeTLatUCDgwBJMugxDqS9+v7duU8xmgmwIFXx+VMtjiRk48s 55+REGzJR8GKzxUr5ydLQfRwH4j7+TLBmTy8oI4rknKQttNnKyrjhng7jUQB2ITWFEy5 CDQ0qSQi2CxWWM58YsO/gxPKjFIDz/vCEGSmAka8INu6UjXzuV6EB5n63Ky87kEKRy1C S4pj4eATdqWUFCoxQ2975atQILYdgDRrXk30dHNzoR36DVkQgTnW+6LDXDmN1SeZ+VPY S0BjEA6HbKAQgl7huWwqVmwG0dIGbnQzy3NPYl5bYiXROSUoZXFPDVEjPPmiSaQLqU6M qkMw== 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:subject:date:message-id :in-reply-to:references; bh=5QNa1qywltOY6IhhPyZZnFVHJhPrjIri5Xi1Vm0lVkk=; b=mnDwQLciX5fcxouoVfct4kIqlDYeKwv7WRpkwjipVP05mu1MBkLwcggeagXZq4SD2K xj+FY8m/tNGMENvyucFqIrvd9GAq31PmIBxpD29gNqsi6003rJes5iEcymkE95+zq/zS BEu0DGM3X2/mgPd+BfJROCbATB2EPQzBWtpt/xHEjunGk++VeJ+7MNSP0843C2mU1emQ 0J0l7WORzTo0fFMsmTQUG/KHetUii1I272aUUCRDBrh1C4dL8XJkYlDimXCIIZLj4r1B 1lz/DqM/+iTep+aA0xpMKTpYNVKWq2CnNNzkDLxqU6njX55DbkehKLiB7aHbut4wY2Lm YwjQ== X-Gm-Message-State: APjAAAW/n1edD0QwLr8RGqzfRK0+OyyJmS3jYZAl1w4h2XJBwT9fdIHP XiXIe3acHZe9/e/q3s7X5Vax9MIS X-Google-Smtp-Source: APXvYqwXycJSjS0AoXaUh8Z0Ig0CGIEQY3cHg/3+0ZunE1t+2yNZxZgqR6l1Ge6UbNzn9U7zyZ0dPw== X-Received: by 2002:a1c:2082:: with SMTP id g124mr12614993wmg.71.1560165311604; Mon, 10 Jun 2019 04:15:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2019 13:15:01 +0200 Message-Id: <1560165301-39026-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> References: <1560165301-39026-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH 7/7] rdmacm-mux: convert to Meson 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We can use config-host.mak to decide whether the tool has to be built, apart from that the conversion is straightforward. Signed-off-by: Paolo Bonzini --- .gitignore | 1 + Makefile | 5 ----- Makefile.objs | 1 - contrib/rdmacm-mux/Makefile.objs | 3 --- contrib/rdmacm-mux/meson.build | 6 ++++++ meson.build | 2 ++ 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 contrib/rdmacm-mux/Makefile.objs create mode 100644 contrib/rdmacm-mux/meson.build diff --git a/.gitignore b/.gitignore index 3934eff..b8d38a8 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ /qemu-version.h.tmp /module_block.h /scsi/qemu-pr-helper +/contrib/rdmacm-mux/rdmacm-mux /contrib/vhost-user-scsi/vhost-user-scsi /contrib/vhost-user-blk/vhost-user-blk /fsdev/virtfs-proxy-helper diff --git a/Makefile b/Makefile index bff097c..713f301 100644 --- a/Makefile +++ b/Makefile @@ -425,7 +425,6 @@ dummy :=3D $(call unnest-vars,, \ elf2dmp-obj-y \ ivshmem-client-obj-y \ ivshmem-server-obj-y \ - rdmacm-mux-obj-y \ vhost-user-input-obj-y \ vhost-user-gpu-obj-y \ qga-vss-dll-obj-y \ @@ -629,10 +628,6 @@ ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COM= MON_LDADDS) $(call LINK, $^) endif =20 -rdmacm-mux$(EXESUF): LIBS +=3D "-libumad" -rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS) - $(call LINK, $^) - vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) contrib/libvhost-user/lib= vhost-user.a $(call LINK, $^) =20 diff --git a/Makefile.objs b/Makefile.objs index adf2f92..cf02f63 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -116,7 +116,6 @@ qga-vss-dll-obj-y =3D qga/ elf2dmp-obj-y =3D contrib/elf2dmp/ ivshmem-client-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshmem-client/ ivshmem-server-obj-$(CONFIG_IVSHMEM) =3D contrib/ivshmem-server/ -rdmacm-mux-obj-y =3D contrib/rdmacm-mux/ vhost-user-input-obj-y =3D contrib/vhost-user-input/ vhost-user-gpu-obj-y =3D contrib/vhost-user-gpu/ =20 diff --git a/contrib/rdmacm-mux/Makefile.objs b/contrib/rdmacm-mux/Makefile= .objs deleted file mode 100644 index 3df744a..0000000 --- a/contrib/rdmacm-mux/Makefile.objs +++ /dev/null @@ -1,3 +0,0 @@ -ifdef CONFIG_PVRDMA -rdmacm-mux-obj-y =3D main.o -endif diff --git a/contrib/rdmacm-mux/meson.build b/contrib/rdmacm-mux/meson.build new file mode 100644 index 0000000..8451756 --- /dev/null +++ b/contrib/rdmacm-mux/meson.build @@ -0,0 +1,6 @@ +if config_host['CONFIG_PVRDMA'] =3D=3D 'y' + # if not found, CONFIG_PVRDMA should not be set + libumad =3D cc.find_library('ibumad', required: true) + executable('rdmacm-mux', files('main.c'), + dependencies: [glib, libumad]) +endif diff --git a/meson.build b/meson.build index bc7fbea..2fc6111 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,5 @@ project('qemu', 'c', meson_version: '>=3D0.50.999') +cc =3D meson.get_compiler('c') =20 kconfig =3D import('unstable-kconfig') config_host =3D kconfig.load(meson.current_build_dir() / 'config-host.mak') @@ -14,5 +15,6 @@ libiscsi =3D declare_dependency(compile_args: config_host= ['LIBISCSI_CFLAGS'].split link_args: config_host['LIBISCSI_LIBS'].split()) =20 subdir('contrib/libvhost-user') +subdir('contrib/rdmacm-mux') subdir('contrib/vhost-user-blk') subdir('contrib/vhost-user-scsi') --=20 1.8.3.1