From nobody Sun Feb 8 20:58:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1602165675; cv=none; d=zohomail.com; s=zohoarc; b=E7kZwu6aiFRhDH6FmzdicNWjIr8EwHGslocW2i2uu4WRr/TeHcGCztA6T1cfjl0i++CtxTF4x3kW+EKKjRTs4zNiT0/tZkhJxXdhHMlUyzzX1CEF580Hz0V7KiiQe6HkT6j3KPj5Vsvn6OqTn6OWtq4ImC/qQdnlrG1g6liPLw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602165675; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NTqvIU94vHTciGfUOtLBjYGueda2L+BYKrSo8UGKjbU=; b=dIkjleSKn5BSvqe1TsFrzSstW+eylfI84HeWod8N2sOqzquCktP97/VRmoL88HAtbnTWAgOnw8XidHYvVQJytiJHVamoWXAUm9E86sSZUNub9PVDWrBuJXgCx6+S9FRsT6NTSR9nJbUwxyslRJZkbBRYJdTGVlwDfusla/balSI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1602165675411349.7700018719304; Thu, 8 Oct 2020 07:01:15 -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-254-gfCJiD5ENBSMlnnHJFSNoQ-1; Thu, 08 Oct 2020 09:59:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 803BD6415E; Thu, 8 Oct 2020 13:59:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D6C355786; Thu, 8 Oct 2020 13:59:18 +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 250381832FD7; Thu, 8 Oct 2020 13:59:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 098DxDGk013664 for ; Thu, 8 Oct 2020 09:59:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70C425D9D5; Thu, 8 Oct 2020 13:59:13 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id E32E45D9F1 for ; Thu, 8 Oct 2020 13:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602165672; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NTqvIU94vHTciGfUOtLBjYGueda2L+BYKrSo8UGKjbU=; b=fyLlrlbDQkN8PUCaKzJYLrhckywmCIXBCBd3vYoyI1zjKN0GDcf9PE3Ex5gK9ZGUub4e+Y M8YdPzlPOc9ZpSvcfmo4YdAssmOoSYEZkQx0c6TgA4N3FP8mUtDHJniGSU4X2496+a7BYn TPRSjlQAhJvXeja1WVDnkVG0VlFdhhc= X-MC-Unique: gfCJiD5ENBSMlnnHJFSNoQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 06/15] meson: properly handle readline if it's explicitly disabled Date: Thu, 8 Oct 2020 15:58:55 +0200 Message-Id: <82a7c4dd23fe49f7a71e8f5208e550b5a81e0a73.1602165221.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.15 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) Content-Type: text/plain; charset="utf-8" If readline is detected using pkg-config it would ignore the readline option. Signed-off-by: Pavel Hrdina --- meson.build | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 0941be8136..c1f56e8fdb 100644 --- a/meson.build +++ b/meson.build @@ -1243,26 +1243,30 @@ endif =20 # readline 7.0 is the first version which includes pkg-config support readline_version =3D '7.0' -readline_dep =3D dependency('readline', version: '>=3D' + readline_version= , required: false) -if not readline_dep.found() - readline_dep =3D cc.find_library('readline', required: get_option('readl= ine')) +if not get_option('readline').disabled() + readline_dep =3D dependency('readline', version: '>=3D' + readline_versi= on, required: false) + if not readline_dep.found() + readline_dep =3D cc.find_library('readline', required: get_option('rea= dline')) =20 - if readline_dep.found() - # This variable is present in all reasonable (5.0+) readline versions; - # however, the macOS base system contains a library called libedit whi= ch - # takes over the readline name despite lacking many of its features. We - # want to make sure we only enable readline support when linking again= st - # the actual readline library, and the availability of this specific - # variable is as good a witness for that fact as any. - correct_rl =3D cc.has_header_symbol('readline/readline.h', 'rl_complet= ion_quote_character', prefix: '#include ') - if not correct_rl - if get_option('readline').enabled() - error('readline is missing rl_completion_quote_character') - else - readline_dep =3D dependency('', required: false) + if readline_dep.found() + # This variable is present in all reasonable (5.0+) readline version= s; + # however, the macOS base system contains a library called libedit w= hich + # takes over the readline name despite lacking many of its features.= We + # want to make sure we only enable readline support when linking aga= inst + # the actual readline library, and the availability of this specific + # variable is as good a witness for that fact as any. + correct_rl =3D cc.has_header_symbol('readline/readline.h', 'rl_compl= etion_quote_character', prefix: '#include ') + if not correct_rl + if get_option('readline').enabled() + error('readline is missing rl_completion_quote_character') + else + readline_dep =3D dependency('', required: false) + endif endif endif endif +else + readline_dep =3D dependency('', required: false) endif if readline_dep.found() # Gross kludge for readline include path obtained through pkg-config. --=20 2.26.2