From nobody Thu Apr 25 22:23:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1620030957; cv=none; d=zohomail.com; s=zohoarc; b=F2uG4ergNRvFJTCrAwCxx2Fi2WZTqGSzkuZCj6krJXHhO1cTA+MvvWgOMV6Y8ooXHBNvhoux+WEmymwRIJCn2irAQnpoIAmVb34eNWOJHR30ztCltOfACiQqpZvVAu4+UdcVpSd4Je6SANxUZxoq3iTxAKRpL77Dm/cMMrm/9Fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620030957; 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=JcYWCNspFgL5zJIjT+OlOs31JXu6WAE1m8AYJ9r9u1M=; b=HNAIyn0frrWw6SuBxSaTJq+GzpDOGb4W/nQPp9nI5s7hQnbQfXmN/YIqLKdfo67RBXIeKM19BEJfs2M39chrc+/YF6j+gqKGhPGujYRsfJsqMawA0peGfM39sJAkVuMZjaLAF8cFkZ71I1Bssi7rbHYN//QfrK7WHqXmfA2xwkk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620030957094691.3029531658086; Mon, 3 May 2021 01:35:57 -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-322-x6DhQekIMaiQosodRvQR0g-1; Mon, 03 May 2021 04:35:52 -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 103D61883520; Mon, 3 May 2021 08:35:48 +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 3C1116B8F7; Mon, 3 May 2021 08:35:47 +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 781B518005B6; Mon, 3 May 2021 08:35:45 +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 1438ZG0B025848 for ; Mon, 3 May 2021 04:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 30F8D16E46; Mon, 3 May 2021 08:35:16 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id A51731A881 for ; Mon, 3 May 2021 08:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620030956; 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=JcYWCNspFgL5zJIjT+OlOs31JXu6WAE1m8AYJ9r9u1M=; b=bWitjDYAzc/5vWzywQoKx42kfptXxBQOaPVZAXle16miVaEYpcLU4SYaJBVuhKrLN2wS7D 53iRRw4leHEkJGHSXjt/ExDWRPdNJsZlWbGTASumurkmJCTbb2XAJ9c/Z7Jitr/NFJ7DAt 24wCA+Zc23jqD/jafbFNe/yb2ek6yrc= X-MC-Unique: x6DhQekIMaiQosodRvQR0g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2] meson: Declare GLIB_VERSION_* macros at configure Date: Mon, 3 May 2021 10:35:07 +0200 Message-Id: <86ce01770d776df04ed494edeb9052df9695fbbf.1620030809.git.mprivozn@redhat.com> 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.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" So far we have three places where glib version is recorded: meson.build and then in config.h. The latter is so well hidden that it's easy to miss when bumping minimal glib version in the former. With a bit of python^Wmeson string magic GLIB_VERSION_MIN_REQUIRED and GLIB_VERSION_MAX_ALLOWED macros can be defined to match glib_version from meson.build. Signed-off-by: Michal Privoznik --- v2 of: https://listman.redhat.com/archives/libvir-list/2021-April/msg01300.html diff to v1: - Introduced new glib_version_str variable per Pavel's suggestion config.h | 10 ---------- meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/config.h b/config.h index ca6720f37d..0eacfd139d 100644 --- a/config.h +++ b/config.h @@ -51,13 +51,3 @@ #else # error You either need at least GCC 4.8 or Clang 3.4 or XCode Clang 5.1 t= o compile libvirt #endif - -/* Ask for warnings for anything that was marked deprecated in - * the defined version, or before. It is a candidate for rewrite. - */ -#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_48 - -/* Ask for warnings if code tries to use function that did not - * exist in the defined version. These risk breaking builds - */ -#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_48 diff --git a/meson.build b/meson.build index 951da67896..ecbfdb1208 100644 --- a/meson.build +++ b/meson.build @@ -949,6 +949,14 @@ endif glib_dep =3D declare_dependency( dependencies: [ glib_dep, gobject_dep, gio_dep ], ) +glib_version_arr =3D glib_version.split('.') +glib_version_str =3D 'GLIB_VERSION_@0@_@1@'.format(glib_version_arr[0], gl= ib_version_arr[1]) +# Ask for warnings for anything that was marked deprecated in +# the defined version, or before. It is a candidate for rewrite. +conf.set('GLIB_VERSION_MIN_REQUIRED', glib_version_str) +# Ask for warnings if code tries to use function that did not +# exist in the defined version. These risk breaking builds +conf.set('GLIB_VERSION_MAX_ALLOWED', glib_version_str) =20 glusterfs_version =3D '3.4.1' glusterfs_dep =3D dependency('glusterfs-api', version: '>=3D' + glusterfs_= version, required: get_option('glusterfs')) --=20 2.26.3