From nobody Sun Nov 16 07:42:53 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599052290; cv=none; d=zohomail.com; s=zohoarc; b=JJsXAgVIxkvl+rSxURQrwW2DCVGgaJZ86ym042OEdbtVQA51npZpuYuJnl2/eH9I2QCMj4wd9SQo73/Iwbt9lNKIEjOEf35JwnC2reivspYk7YuGkJdE4byzZ+o1zR547ubctl3BgauvFXZaxsUM+U9UBSg2FzFy2fbufC/i9eU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599052290; 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=+iF9cT1AEifStdmNdJWnjXFEA/AnsREladpxeCR1Wic=; b=XQ8BO884qZGTGuTf8rCtqm4q1odhb7k8tlpdtenih2bpc0RIcUR0xmF836Y8t4r/hbbyZL+uSj1yUIDJJ8eOb/+XSiYBh8GB2noNlDgQtKyyKahI7i5myG/7bFvEaR2srpHWvQ+kVe2uiUN7izftRcbeMlI3O4P8fTFun2iMsJ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass 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 1599052290660859.0174598732099; Wed, 2 Sep 2020 06:11:30 -0700 (PDT) Received: from localhost ([::1]:43338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDSXx-0003QC-QU for importer@patchew.org; Wed, 02 Sep 2020 09:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDSMW-0006GH-Tk for qemu-devel@nongnu.org; Wed, 02 Sep 2020 08:59:40 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:38801 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDSMU-00079p-E6 for qemu-devel@nongnu.org; Wed, 02 Sep 2020 08:59:40 -0400 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-343-nIL7C4yKM1-8qsUnku0BUw-1; Wed, 02 Sep 2020 08:59:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42B9E3FF9 for ; Wed, 2 Sep 2020 12:59:35 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1142C5D9CC for ; Wed, 2 Sep 2020 12:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599051577; h=from:from: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; bh=+iF9cT1AEifStdmNdJWnjXFEA/AnsREladpxeCR1Wic=; b=FcmTvi7XWNWbr+nueC3C7ESB/f3sCYKijoTVK7IaO1oEldnEx9jA9D+H6+xbNrpZFnHuV0 ZIKvNPUAxsuQgZfYVfDr6WJW+PZciiA0ZYCNnM07hs9bjUdIUTIbQ/W1QMxVbWoNftw9NR S3+1shwLUI/EBMd4GupMeXzJOb8K61k= X-MC-Unique: nIL7C4yKM1-8qsUnku0BUw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 36/39] meson: get glib compilation flags from GLIB_CFLAGS Date: Wed, 2 Sep 2020 08:59:14 -0400 Message-Id: <20200902125917.26021-37-pbonzini@redhat.com> In-Reply-To: <20200902125917.26021-1-pbonzini@redhat.com> References: <20200902125917.26021-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=207.211.31.81; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/02 02:33:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The glib compilation flags were added to QEMU_CFLAGS. While we still want them to be added to all compilation commands (at least for now), do that via GLIB_CFLAGS rather than via QEMU_CFLAGS. This shows that glib is a special case and makes it clearer that QEMU_CFLAGS is only about compiler commands and not dependencies. Signed-off-by: Paolo Bonzini --- configure | 19 +++++++++---------- meson.build | 7 +++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/configure b/configure index d148242c9a..7d4e499202 100755 --- a/configure +++ b/configure @@ -3742,24 +3742,23 @@ if test "$plugins" =3D yes; then glib_modules=3D"$glib_modules gmodule-2.0" fi =20 -# This workaround is required due to a bug in pkg-config file for glib as = it -# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static - -if test "$static" =3D yes && test "$mingw32" =3D yes; then - QEMU_CFLAGS=3D"-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" -fi - for i in $glib_modules; do if $pkg_config --atleast-version=3D$glib_req_ver $i; then glib_cflags=3D$($pkg_config --cflags $i) glib_libs=3D$($pkg_config --libs $i) - QEMU_CFLAGS=3D"$glib_cflags $QEMU_CFLAGS" LIBS=3D"$glib_libs $LIBS" else error_exit "glib-$glib_req_ver $i is required to compile QEMU" fi done =20 +# This workaround is required due to a bug in pkg-config file for glib as = it +# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static + +if test "$static" =3D yes && test "$mingw32" =3D yes; then + glib_cflags=3D"-DGLIB_STATIC_COMPILATION $glib_cflags" +fi + if $pkg_config --atleast-version=3D$glib_req_ver gio-2.0; then gio=3Dyes gio_cflags=3D$($pkg_config --cflags gio-2.0) @@ -3794,7 +3793,7 @@ int main(void) { } EOF =20 -if ! compile_prog "$CFLAGS" "$LIBS" ; then +if ! compile_prog "$glib_cflags" "$glib_libs" ; then error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ "You probably need to set PKG_CONFIG_LIBDIR"\ "to point to the right pkg-config files for your"\ @@ -3809,7 +3808,7 @@ EOF if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then if cc_has_warning_flag "-Wno-unknown-attributes"; then glib_cflags=3D"-Wno-unknown-attributes $glib_cflags" - QEMU_CFLAGS=3D"-Wno-unknown-attributes $CFLAGS" + CFLAGS=3D"-Wno-unknown-attributes $CFLAGS" fi fi =20 diff --git a/meson.build b/meson.build index 2455eb5e1a..6d0e61a05d 100644 --- a/meson.build +++ b/meson.build @@ -115,8 +115,11 @@ elif targetos =3D=3D 'haiku' cc.find_library('network'), cc.find_library('bsd')] endif -glib =3D declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split= (), - link_args: config_host['GLIB_LIBS'].split()) +# The path to glib.h is added to all compilation commands. This was +# grandfathered in from the QEMU Makefiles. +add_project_arguments(config_host['GLIB_CFLAGS'].split(), + native: false, language: ['c', 'cpp', 'objc']) +glib =3D declare_dependency(link_args: config_host['GLIB_LIBS'].split()) gio =3D not_found if 'CONFIG_GIO' in config_host gio =3D declare_dependency(compile_args: config_host['GIO_CFLAGS'].split= (), --=20 2.26.2