meson: conditionally include -ldl in gbm pkg-config file
authorJonathan Gray <jsg@jsg.id.au>
Fri, 6 Dec 2019 06:25:58 +0000 (17:25 +1100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 Aug 2020 09:14:57 +0000 (09:14 +0000)
Follow libGL and only include -ldl in gbm pkg-config file if libdl was
actually found.  Many systems have these functions in libc and don't
have libdl.

Fixes: 816bf7d1644 ("meson: build gbm")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

meson.build
src/gbm/meson.build

index edb49e0fe7c57084a47bd2862079c1ccebccaf48..b79a378776a1c165fcf1c2a77e8b17c557d56645 100644 (file)
@@ -1853,6 +1853,12 @@ if dep_dl.found()
   gl_priv_libs += '-ldl'
 endif
 
+# FIXME: autotools lists this as incomplete
+gbm_priv_libs = []
+if dep_dl.found()
+  gbm_priv_libs += '-ldl'
+endif
+
 pkg = import('pkgconfig')
 
 if host_machine.system() == 'windows'
index 2a9be93450b6961c6109bc830ff8546983e2de0f..873366600bc8dcfa714e355a6a702a9828d0a8ae 100644 (file)
@@ -64,7 +64,7 @@ pkg.generate(
   description : 'Mesa gbm library',
   version : meson.project_version(),
   libraries : libgbm,
-  libraries_private : '-ldl',  # FIXME: autotools lists this a incomplete
+  libraries_private : gbm_priv_libs,
 )
 
 if with_symbols_check