[PATCH xserver] meson: Ensure we always build Xext/hashtable.c for glx

Lyude Paul lyude at redhat.com
Wed Apr 18 22:09:15 UTC 2018


Seems that while glxvnd relies on some of the hashtable functions in
Xext, we only build hashtable support for Xext if we're also building
the res extension. This leads to some errors if you try to build glx
without res enabled:

glx/liblibglxvnd.a(vndcmds.c.o): In function `LookupVendorPrivDispatch':
/home/lyudess/Projects/xserver/glx/vndcmds.c:65: undefined reference to `ht_find'
/home/lyudess/Projects/xserver/glx/vndcmds.c:67: undefined reference to `ht_add'
glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchInit':
/home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_compare'
/home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_hash'
/home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_create'
glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchReset':
/home/lyudess/Projects/xserver/glx/vndcmds.c:468: undefined reference to `ht_destroy'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

So, make sure that hashtable.c gets both for both glx and res

Signed-off-by: Lyude Paul <lyude at redhat.com>
---
 Xext/meson.build | 6 +++++-
 meson.build      | 9 +++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Xext/meson.build b/Xext/meson.build
index a72173718..7727e207e 100644
--- a/Xext/meson.build
+++ b/Xext/meson.build
@@ -23,8 +23,12 @@ if build_mitshm
     hdrs_xext += ['shmint.h']
 endif
 
+if build_hashtable
+    srcs_xext += 'hashtable.c'
+endif
+
 if build_res
-    srcs_xext += ['hashtable.c', 'xres.c']
+    srcs_xext += 'xres.c'
 endif
 
 if build_screensaver
diff --git a/meson.build b/meson.build
index e2dad87bb..5e794ccd0 100644
--- a/meson.build
+++ b/meson.build
@@ -96,6 +96,8 @@ nettle_dep = dependency('nettle')
 dbus_required = get_option('systemd_logind') == 'true'
 dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
 
+build_hashtable = false
+
 # Resolve default values of some options
 xkb_dir = get_option('xkb_dir')
 if xkb_dir == ''
@@ -300,6 +302,9 @@ if not xdmcp_dep.found()
 endif
 
 build_glx = get_option('glx')
+if build_glx
+    build_hashtable = true
+endif
 
 libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: false)
 
@@ -363,6 +368,10 @@ endif
 build_xf86bigfont = get_option('xf86bigfont')
 build_screensaver = get_option('screensaver')
 build_res = get_option('xres')
+if build_res
+    build_hashtable = true
+endif
+
 build_xace = get_option('xace')
 build_xinerama = get_option('xinerama')
 
-- 
2.14.3



More information about the xorg-devel mailing list