From nobody Sun May 5 22:55:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1625659084; cv=none; d=zohomail.com; s=zohoarc; b=eNq/qkgJiYaOUq1lKbkSPcTvuAmVXoux5eKEXyeDdh8/D+BKzUkqUeZWwYEDaxX871YhQ4vSaoLdGdLK5bCD+FTB2HbTd1NsqNQjwl/AKxTQsQjj8vAUEUm8v2tAJ4HiNTarVAe6haFN+bcj4QfmgXy1Bl8FNHnj35KoX7JrcR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625659084; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Him3sqPYJSFMgYHeSYachGhk2DFf1RyTfP2gLnh4I+Y=; b=Y1jCT+A1l07/3fCno7f2/IJpXgdddSScdTOMKVzc4UNTjPFlc9u1MTkPSNVk/oLkR5ojMkKmShjnGSd0EKF4YpOOrbPOEQOJts5jyLMvpfEB9r/K/Uzijj2o24fs62kASPuGK9/cVvD4luMfx+6rjyx24+P0JUsmZe0HTR7THJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1625659084182495.6652188812142; Wed, 7 Jul 2021 04:58:04 -0700 (PDT) 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-417-JVfGi9vTMQ2ajv2SubaCUg-1; Wed, 07 Jul 2021 07:58:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81FFD804141; Wed, 7 Jul 2021 11:57:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4307560843; Wed, 7 Jul 2021 11:57:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 113824EA2A; Wed, 7 Jul 2021 11:57:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 167BvoBl030398 for ; Wed, 7 Jul 2021 07:57:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id CF44D2EB07; Wed, 7 Jul 2021 11:57:50 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.194.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CCE82EB04 for ; Wed, 7 Jul 2021 11:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625659083; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Him3sqPYJSFMgYHeSYachGhk2DFf1RyTfP2gLnh4I+Y=; b=ep4pzPVvjHy4PcbLXFTbQAC1yBf7Tn2Ek1mqsuUnL36e4vwDBcXu0PG+0LDDtGFFNdtvMV fT7XAMA3xCy/ik8uXRXzqVgGT/60lhdI3uKlTz3+uLMzF8ZGpiGDr3ygJlu3fRFsZ6x8zA LxA0ERkH3cbTj4vf6NG99hgvRDVph1g= X-MC-Unique: JVfGi9vTMQ2ajv2SubaCUg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH] meson: check for `XDR` and `driver_remote` early Date: Wed, 7 Jul 2021 13:57:44 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1625659085084100001 Content-Type: text/plain; charset="utf-8" We have several other options that depend on result of `driver_remote` option check so we need to do it early to have the result available. Fixes: https://gitlab.com/libvirt/libvirt/-/issues/185 Signed-off-by: Pavel Hrdina Reviewed-by: J=C3=A1n Tomko --- meson.build | 65 ++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/meson.build b/meson.build index c95c7f7444..ca4291e37a 100644 --- a/meson.build +++ b/meson.build @@ -848,6 +848,37 @@ foreach name : optional_programs endforeach =20 =20 +# early checks where lot of other packages depend on the result + +# On MinGW portablexdr provides XDR functions, on linux they are +# provided by libtirpc and on FreeBSD/macOS there is no need to +# use extra library as it's provided by libc directly. +if host_machine.system() =3D=3D 'windows' + xdr_dep =3D cc.find_library('portablexdr', required: false) +elif host_machine.system() =3D=3D 'linux' + xdr_dep =3D dependency('libtirpc', required: false) +elif host_machine.system() in [ 'freebsd', 'darwin' ] + xdr_dep =3D cc.find_library('c', required: false) +else + xdr_dep =3D dependency('', required: false) +endif + +if not get_option('driver_remote').disabled() + use_remote =3D true + + if not xdr_dep.found() + use_remote =3D false + if get_option('driver_remote').enabled() + error('XDR is required for remote driver') + endif + endif + + if use_remote + conf.set('WITH_REMOTE', 1) + endif +endif + + # generic build dependencies =20 # FIXME rewrite to use dependency() @@ -1005,7 +1036,7 @@ else endif =20 libssh_version =3D '0.7' -if not get_option('driver_remote').disabled() +if conf.has('WITH_REMOTE') libssh_dep =3D dependency('libssh', version: '>=3D' + libssh_version, re= quired: get_option('libssh')) if libssh_dep.found() conf.set('WITH_LIBSSH', 1) @@ -1028,7 +1059,7 @@ else endif =20 libssh2_version =3D '1.3' -if not get_option('driver_remote').disabled() +if conf.has('WITH_REMOTE') libssh2_dep =3D dependency('libssh2', version: '>=3D' + libssh2_version,= required: get_option('libssh2')) if libssh2_dep.found() conf.set('WITH_SSH2', 1) @@ -1172,7 +1203,7 @@ if not get_option('sanlock').disabled() endif =20 sasl_version =3D '2.1.26' -if get_option('driver_remote').enabled() +if conf.has('WITH_REMOTE') sasl_dep =3D dependency('libsasl2', version: '>=3D' + sasl_version, requ= ired: get_option('sasl')) if sasl_dep.found() conf.set('WITH_SASL', 1) @@ -1280,19 +1311,6 @@ if wireshark_dep.found() endif endif =20 -# On MinGW portablexdr provides XDR functions, on linux they are -# provided by libtirpc and on FreeBSD/macOS there is no need to -# use extra library as it's provided by libc directly. -if host_machine.system() =3D=3D 'windows' - xdr_dep =3D cc.find_library('portablexdr', required: false) -elif host_machine.system() =3D=3D 'linux' - xdr_dep =3D dependency('libtirpc', required: false) -elif host_machine.system() in [ 'freebsd', 'darwin' ] - xdr_dep =3D cc.find_library('c', required: false) -else - xdr_dep =3D dependency('', required: false) -endif - yajl_version =3D '2.0.3' yajl_dep =3D dependency('yajl', version: '>=3D' + yajl_version, required: = get_option('yajl')) if yajl_dep.found() @@ -1406,21 +1424,6 @@ endif =20 # build driver options =20 -if not get_option('driver_remote').disabled() - use_remote =3D true - - if not xdr_dep.found() - use_remote =3D false - if get_option('driver_remote').enabled() - error('XDR is required for remote driver') - endif - endif - - if use_remote - conf.set('WITH_REMOTE', 1) - endif -endif - remote_default_mode =3D get_option('remote_default_mode') if remote_default_mode =3D=3D 'direct' conf.set('REMOTE_DRIVER_AUTOSTART_DIRECT', '1') --=20 2.31.1