From a10b4fcdc016d7ac56e5bb35f7f844af41016efe Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 10 Oct 2017 14:28:33 +0100 Subject: [PATCH] meson: Fix linkage of loadable modules for PE/COFF For the loadable modules it makes sense to build for PE/COFF targets, link those loadable modules with the import library for the Xorg executable, so that symbols provided by the executable can be satisfied at link time (as required by PE/COFF). Since this uses the syntax of using the returned build target object from an executable() with an implib: kwarg to link_with:, introduced in meson 0.42 and a syntax error with older meson, also update the minimum meson version which we require in project() to that. Signed-off-by: Jon Turney --- hw/xfree86/dixmods/meson.build | 5 ++++- hw/xfree86/exa/meson.build | 2 +- hw/xfree86/fbdevhw/meson.build | 1 + hw/xfree86/meson.build | 3 ++- hw/xfree86/shadowfb/meson.build | 1 + meson.build | 2 +- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/dixmods/meson.build b/hw/xfree86/dixmods/meson.build index 06ca568620..835d232159 100644 --- a/hw/xfree86/dixmods/meson.build +++ b/hw/xfree86/dixmods/meson.build @@ -6,6 +6,7 @@ fb = shared_module( c_args: xorg_c_args, dependencies: common_dep, link_whole: libxserver_fb, + link_with: e, install: true, install_dir: module_dir, @@ -19,6 +20,7 @@ shared_module( c_args: [ xorg_c_args, wfb_args ], dependencies: common_dep, link_whole: libxserver_wfb, + link_with: e, install: true, install_dir: module_dir, @@ -32,7 +34,7 @@ shared_module( c_args: xorg_c_args, dependencies: common_dep, link_whole: libxserver_miext_shadow, - link_with: fb, + link_with: [fb, e], install: true, install_dir: module_dir, @@ -47,6 +49,7 @@ if build_glx c_args: [ xorg_c_args, glx_align64 ], dependencies: [ common_dep, dl_dep ], link_whole: libxserver_glx, + link_with: e, install: true, install_dir: join_paths(module_dir, 'extensions') diff --git a/hw/xfree86/exa/meson.build b/hw/xfree86/exa/meson.build index bfc5590f84..5f5cf08a7e 100644 --- a/hw/xfree86/exa/meson.build +++ b/hw/xfree86/exa/meson.build @@ -2,7 +2,7 @@ xorg_exa = shared_module('exa', 'examodule.c', include_directories: [inc, xorg_inc], dependencies: common_dep, - link_with: libxserver_exa, + link_with: [libxserver_exa, e], c_args: xorg_c_args, install: true, install_dir: module_dir, diff --git a/hw/xfree86/fbdevhw/meson.build b/hw/xfree86/fbdevhw/meson.build index 2f82e2d9fb..35d66ef2c1 100644 --- a/hw/xfree86/fbdevhw/meson.build +++ b/hw/xfree86/fbdevhw/meson.build @@ -11,6 +11,7 @@ shared_module('fbdevhw', c_args: xorg_c_args, install: true, install_dir: module_dir, + link_with: e, ) install_data('fbdevhw.h', install_dir: xorgsdkdir) diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build index 3c5f46f0be..3b1aa17ffb 100644 --- a/hw/xfree86/meson.build +++ b/hw/xfree86/meson.build @@ -91,7 +91,7 @@ xorg_deps = [ libdrm_dep, ] -executable( +e = executable( 'Xorg', srcs_xorg, include_directories: [inc, xorg_inc], @@ -100,6 +100,7 @@ executable( link_args: linker_export_flags, c_args: xorg_c_args, install: true, + implib: true, ) # subdirs for modules loadable by Xorg diff --git a/hw/xfree86/shadowfb/meson.build b/hw/xfree86/shadowfb/meson.build index 0470ecbb50..7ecc9bc30e 100644 --- a/hw/xfree86/shadowfb/meson.build +++ b/hw/xfree86/shadowfb/meson.build @@ -5,6 +5,7 @@ shared_module('shadowfb', c_args: xorg_c_args, install: true, install_dir: module_dir, + link_with: e, ) install_data('shadowfb.h', install_dir: xorgsdkdir) diff --git a/meson.build b/meson.build index f9b21b36c2..2b63f0f191 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,7 @@ project('xserver', 'c', 'c_std=gnu99', ], version: '1.19.99.1', - meson_version: '>= 0.40.0', + meson_version: '>= 0.42.0', ) add_project_arguments('-DHAVE_DIX_CONFIG_H', language: 'c') cc = meson.get_compiler('c')