meson: conditionally include -ldl in gbm pkg-config file

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: 816bf7d164 ("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>
This commit is contained in:
Jonathan Gray 2019-12-06 17:25:58 +11:00 committed by Marge Bot
parent c97af23b13
commit 0398caa97f
2 changed files with 7 additions and 1 deletions

View 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'

View 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