From nobody Sun May 19 14:32:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636082529457494.2488571107193; Thu, 4 Nov 2021 20:22:09 -0700 (PDT) Received: from localhost ([::1]:55672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mipns-00071E-2e for importer@patchew.org; Thu, 04 Nov 2021 23:22:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miplY-00047Z-Tm for qemu-devel@nongnu.org; Thu, 04 Nov 2021 23:19:44 -0400 Received: from out28-169.mail.aliyun.com ([115.124.28.169]:57936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miplV-0003zC-Gn for qemu-devel@nongnu.org; Thu, 04 Nov 2021 23:19:44 -0400 Received: from localhost.localdomain(mailfrom:zhiwei_liu@c-sky.com fp:SMTPD_---.LnnfNlI_1636082370) by smtp.aliyun-inc.com(10.147.40.26); Fri, 05 Nov 2021 11:19:31 +0800 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.07760695|-1; CH=green; DM=|CONTINUE|false|; DS=CONTINUE|ham_system_inform|0.000804269-0.000131237-0.999065; FP=0|0|0|0|0|-1|-1|-1; HT=ay29a033018047201; MF=zhiwei_liu@c-sky.com; NM=1; PH=DS; RN=2; RT=2; SR=0; TI=SMTPD_---.LnnfNlI_1636082370; From: LIU Zhiwei To: qemu-devel@nongnu.org Subject: [PATCH] configure: Support modules for Windows Date: Fri, 5 Nov 2021 11:19:25 +0800 Message-Id: <20211105031925.83740-1-zhiwei_liu@c-sky.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: none client-ip=115.124.28.169; envelope-from=zhiwei_liu@c-sky.com; helo=out28-169.mail.aliyun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: LIU Zhiwei Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1636082531327100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: LIU Zhiwei --- configure | 7 +------ meson.build | 34 ++++++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 33682cb971..6280e412a9 100755 --- a/configure +++ b/configure @@ -1422,7 +1422,7 @@ cat << EOF bsd-user all BSD usermode emulation targets guest-agent build the QEMU Guest Agent pie Position Independent Executables - modules modules support (non-Windows) + modules modules support module-upgrades try to load modules from alternate paths for upgrades debug-tcg TCG debugging (default is disabled) debug-info debugging information @@ -1698,11 +1698,6 @@ else QEMU_CFLAGS=3D"$QEMU_CFLAGS -Wno-missing-braces" fi =20 -# Our module code doesn't support Windows -if test "$modules" =3D "yes" && test "$mingw32" =3D "yes" ; then - error_exit "Modules are not available for Windows" -fi - # module_upgrades is only reasonable if modules are enabled if test "$modules" =3D "no" && test "$module_upgrades" =3D "yes" ; then error_exit "Can't enable module-upgrades as Modules are not enabled" diff --git a/meson.build b/meson.build index 47df10afc2..26195cb24f 100644 --- a/meson.build +++ b/meson.build @@ -2625,7 +2625,7 @@ block_mods =3D [] softmmu_mods =3D [] foreach d, list : modules foreach m, module_ss : list - if enable_modules and targetos !=3D 'windows' + if enable_modules module_ss =3D module_ss.apply(config_all, strict: false) sl =3D static_library(d + '-' + m, [genh, module_ss.sources()], dependencies: [modulecommon, module_ss.dependenc= ies()], pic: true) @@ -2658,7 +2658,7 @@ endforeach =20 foreach d, list : target_modules foreach m, module_ss : list - if enable_modules and targetos !=3D 'windows' + if enable_modules foreach target : target_dirs if target.endswith('-softmmu') config_target =3D config_target_mak[target] @@ -2800,14 +2800,15 @@ common_ss.add(hwcore) ########### # Targets # ########### - -foreach m : block_mods + softmmu_mods - shared_module(m.name(), - name_prefix: '', - link_whole: m, - install: true, - install_dir: qemu_moddir) -endforeach +if targetos !=3D 'windows' + foreach m : block_mods + softmmu_mods + shared_module(m.name(), + name_prefix: '', + link_whole: m, + install: true, + install_dir: qemu_moddir) + endforeach +endif =20 softmmu_ss.add(authz, blockdev, chardev, crypto, io, qmp) common_ss.add(qom, qemuutil) @@ -2826,6 +2827,7 @@ common_all =3D static_library('common', feature_to_c =3D find_program('scripts/feature_to_c.sh') =20 emulators =3D {} +emulator =3D 0 foreach target : target_dirs config_target =3D config_target_mak[target] target_name =3D config_target['TARGET_NAME'] @@ -2966,6 +2968,7 @@ foreach target : target_dirs link_language: link_language, link_depends: [block_syms, qemu_syms] + exe.get('link_depen= ds', []), link_args: link_args, + implib: true, win_subsystem: exe['win_subsystem']) =20 if targetos =3D=3D 'darwin' @@ -3023,6 +3026,17 @@ foreach target : target_dirs endif endforeach endforeach +if (targetos =3D=3D 'windows') + foreach m : block_mods + softmmu_mods + shared_module(m.name(), + name_prefix: '', + link_whole: m, + install: true, + dependencies: glib, + link_with: emulator, + install_dir: qemu_moddir) + endforeach +endif =20 # Other build targets =20 --=20 2.25.1