From patchwork Mon Aug 10 17:07:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 11707767 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16029138C for ; Mon, 10 Aug 2020 17:27:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF08520829 for ; Mon, 10 Aug 2020 17:27:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h6Kygd/s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF08520829 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5BaE-0000bI-2c for patchwork-qemu-devel@patchwork.kernel.org; Mon, 10 Aug 2020 13:27:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5BJQ-0007LG-VP for qemu-devel@nongnu.org; Mon, 10 Aug 2020 13:10:16 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43071 helo=us-smtp-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 1k5BJO-0002ot-Os for qemu-devel@nongnu.org; Mon, 10 Aug 2020 13:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597079414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYk4CZMOCyT897Paj4S5kATDfsV+8w4YBoAIby868qM=; b=h6Kygd/sdyl32hs5oPj0HiYCHXsv5xghEU+UYYAUOa3ckgXOcM1IQQ63GKN4WJHdweNcWa kI6M7RajsksOEMLhXiQml7uf0MBnABGvyiJusXM9NrTdlJIl8fbwxI+j8Y2bghZdCsN6ty FTuXk7ZLerTCNE4PAB+RvipQ94HpJPY= 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-135-9f6sUpqWOm2Easb5um4yKQ-1; Mon, 10 Aug 2020 13:10:12 -0400 X-MC-Unique: 9f6sUpqWOm2Easb5um4yKQ-1 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 1AFBE1009634 for ; Mon, 10 Aug 2020 17:10:11 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.110.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2826A5F1E9; Mon, 10 Aug 2020 17:10:09 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 037/147] meson: convert vss-win32 Date: Mon, 10 Aug 2020 19:07:15 +0200 Message-Id: <1597079345-42801-38-git-send-email-pbonzini@redhat.com> In-Reply-To: <1597079345-42801-1-git-send-email-pbonzini@redhat.com> References: <1597079345-42801-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/10 03:31:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- Makefile | 1 - Makefile.objs | 8 -------- qga/Makefile.objs | 1 - qga/meson.build | 6 ++++++ qga/vss-win32/Makefile.objs | 23 ----------------------- qga/vss-win32/meson.build | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 39 insertions(+), 33 deletions(-) delete mode 100644 qga/Makefile.objs delete mode 100644 qga/vss-win32/Makefile.objs create mode 100644 qga/vss-win32/meson.build diff --git a/Makefile b/Makefile index b50e290..36e1069 100644 --- a/Makefile +++ b/Makefile @@ -285,7 +285,6 @@ endif dummy := $(call unnest-vars,, \ authz-obj-y \ chardev-obj-y \ - qga-vss-dll-obj-y \ block-obj-y \ block-obj-m \ storage-daemon-obj-y \ diff --git a/Makefile.objs b/Makefile.objs index 259f993..baf1565 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -91,11 +91,3 @@ common-obj-y += disas/ ###################################################################### # Resource file for Windows executables version-obj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.o - -###################################################################### -# guest agent - -# FIXME: a few definitions from qapi/qapi-types.o and -# qapi/qapi-visit.o are needed by libqemuutil.a. These should be -# extracted into a QAPI schema module, or perhaps a separate schema. -qga-vss-dll-obj-y = qga/ diff --git a/qga/Makefile.objs b/qga/Makefile.objs deleted file mode 100644 index 9ecf249..0000000 --- a/qga/Makefile.objs +++ /dev/null @@ -1 +0,0 @@ -qga-vss-dll-obj-$(CONFIG_QGA_VSS) += vss-win32/ diff --git a/qga/meson.build b/qga/meson.build index 3513a90..948302e 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -44,3 +44,9 @@ qga = executable('qemu-ga', qga_ss.sources(), link_args: config_host['LIBS_QGA'].split(), dependencies: [qemuutil, libudev], install: true) + +if host_machine.system() == 'windows' + if 'CONFIG_QGA_VSS' in config_host + subdir('vss-win32') + endif +endif diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs deleted file mode 100644 index c82676a..0000000 --- a/qga/vss-win32/Makefile.objs +++ /dev/null @@ -1,23 +0,0 @@ -# rules to build qga-vss.dll - -qga-vss-dll-obj-y += requester.o provider.o install.o - -obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y)) -$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS := $(filter-out -fstack-protector-all -fstack-protector-strong, $(QEMU_CXXFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor - -QGA_VSS_LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static -$(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def - $(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vss-win32/qga-vss.def $(CXXFLAGS) $(QGA_VSS_LDFLAGS),"LINK","$(TARGET_DIR)$@") - - -# rules to build qga-provider.tlb -# Currently, only native build is supported because building .tlb -# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++). -MIDL=$(WIN_SDK)/Bin/midl - -$(obj)/qga-vss.tlb: $(SRC_PATH)/$(obj)/qga-vss.idl -ifeq ($(WIN_SDK),"") - $(call quiet-command,cp $(dir $<)qga-vss.tlb $@,"COPY","$(TARGET_DIR)$@") -else - $(call quiet-command,$(MIDL) -tlb $@ -I $(WIN_SDK)/Include $<,"MIDL","$(TARGET_DIR)$@") -endif diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build new file mode 100644 index 0000000..42c8d31 --- /dev/null +++ b/qga/vss-win32/meson.build @@ -0,0 +1,33 @@ +if add_languages('cpp', required: false) + glib_static = dependency('glib-2.0', static: true) + link_args = cc.get_supported_link_arguments(['-fstack-protector-all', '-fstack-protector-strong', + '-Wl,--add-stdcall-alias', '-Wl,--enable-stdcall-fixup']) + shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'], + name_prefix: '', + cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'], + link_args: link_args, + vs_module_defs: 'qga-vss.def', + dependencies: [glib_static, socket, + cc.find_library('ole32'), + cc.find_library('oleaut32'), + cc.find_library('shlwapi'), + cc.find_library('uuid'), + cc.find_library('intl')]) +endif + +# rules to build qga-vss.tlb +# Currently, only native build is supported because building .tlb +# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++). +midl = find_program('midl', required: false) +if midl.found() + gen_tlb = custom_target('gen-tlb', + input: 'qga-vss.idl', + output: 'qga-vss.tlb', + command: [midl, '-tlb', '-I' + config_host['WIN_SDK'], + '@INPUT@', '@OUTPUT@']) +else + gen_tlb = custom_target('gen-tlb', + input: 'qga-vss.tlb', + output: 'qga-vss.tlb', + command: ['cp', '@INPUT@', '@OUTPUT@']) +endif