From nobody Sat May 4 04:22:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1596624682; cv=none; d=zohomail.com; s=zohoarc; b=afiTEwvgL44X73fA/dFKbHMiQ+ihw4I4U/VUgNCjHvB5nRT2JMmPchH5MqimRd12Om8GlVA/Zfnqjo2tVQIMEV2eMLpHtvNxq3AGwass5cQ7o23XgtWFKwfv4S8N9vsf567HFvxMtVO+mxhO4sgPcWV7JNAsuLGQAsNAsN9BCjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596624682; 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=VcqxWkUinffC/iL/YnZ62KpxPpcsqc0JJSRLwuBD3nI=; b=SmcpHl44aqWB3FdOvrl6begcy8+PE+AlXg+4l9Y8IKnzXQY4N7g1lH0JZkpKHtM7HtZtXTrNU9rU96R4v7PL2x6rv+l+dQa5RLGmxVagbzeOrNi1ao9+kXrjvMjK6qzUDq7lPwTNhb55SvZCD1maHUMoXiT8h5kXxX8Qv4Xebx8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1596624682359252.87906850482045; Wed, 5 Aug 2020 03:51:22 -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-446-G_yETBTmNLKqt-rgbjcUpw-1; Wed, 05 Aug 2020 06:51:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BED941005504; Wed, 5 Aug 2020 10:51:11 +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 674815C1BD; Wed, 5 Aug 2020 10:51:11 +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 E7FAB96917; Wed, 5 Aug 2020 10:51:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 075Ap7tS031062 for ; Wed, 5 Aug 2020 06:51:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7007579251; Wed, 5 Aug 2020 10:51:07 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.192.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0A3E74F4D for ; Wed, 5 Aug 2020 10:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596624681; 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=VcqxWkUinffC/iL/YnZ62KpxPpcsqc0JJSRLwuBD3nI=; b=JISOLTOpJtaSfzyK5Y9EilZKJ8r5gOWk5k0k2Y2F7152sZBairqCuqOmd8RV3absjWAMhO 6Zj7IeFz37dv+itUVqZ8MuIC6F9ZUKHlsGaObO5w/zd+P52CE4ikioSY9zoURF6Xd0yDFc 3q5QOdToJhPZKPMMdCcA1kUddZ04wtI= X-MC-Unique: G_yETBTmNLKqt-rgbjcUpw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH] meson: fix readline detection if there is no pkg-config file Date: Wed, 5 Aug 2020 12:51:03 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.16 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" Commit <74416b1d4849ef77ef31de5344dd75f03094434b> added check for rl_completion_quote_character to make sure we have correct readline library. Commit added inaccurate comment that it's a function. We need to check for generic symbol instead of checking for function. In addition the readline/readline.h file requires stdio.h to by included beforehand which was done in autotools but I dropped it in meson. And lastly the final condition to print error or disable readline was broken as well by replacing the readline_dep every time if readline was not explicitly enabled. Reported-by: Erik Skultety Signed-off-by: Pavel Hrdina --- meson.build | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index ad269640ba..19b4795527 100644 --- a/meson.build +++ b/meson.build @@ -1268,17 +1268,19 @@ if not readline_dep.found() readline_dep =3D cc.find_library('readline', required: get_option('readl= ine')) =20 if readline_dep.found() - # This function is present in all reasonable (5.0+) readline versions; + # 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 - # functions is as good a witness for that fact as any. - correct_rl =3D cc.has_function('rl_completion_quote_character', prefix= : '#include ') - if not correct_rl and get_option('readline').enabled() - error('readline is missing rl_completion_quote_character') - else - readline_dep =3D dependency('', required: false) + # 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) + endif endif endif endif --=20 2.26.2