GNOME Bugzilla – Bug 784026
gl: not finding bcm_host with meson
Last modified: 2017-06-22 16:23:49 UTC
I'm trying to build gst-plugins-bad on the raspberry pi using meson with: - c_args ['-I/opt/vc/include', '-I/opt/vc/include/interface/vcos/pthreads', '-I/opt/vc/include/interface/vmcs_host/linux'] - c_link_args ['-L/opt/vc/lib'] - with_gl_api gles2 - with_gl_platform egl - with_gl_winsys dispmanx Meson isn't able to find bcm_host as no pkg-config file is provided. We use AC_CHECK_LIB with the autotools so I think we should use cc.find_library() instead of dependency()
Created attachment 354142 [details] [review] gl: meson: use cc.find_library() to detect 'bcm_host' On the raspberry pi no pkg-config file is provided for the bcm_host library. We are using AC_CHECK_LIB to detect this lib with autotools, cc.find_library() library is a closer meson equivalent.
Attachment 354142 [details] pushed as 859daad - gl: meson: use cc.find_library() to detect 'bcm_host'
Isn't there a pkg-config file for this stuff now in later versions?
That I don't know, I expected this patch to be right since this is what we do in configure.ac. We don't even try to get a pkg-config in there. Worst case, it won't be hard to implement a pkg-config check with fallback to find_library. Just let us know if it matters.
pkg-config would have the advantage to also allow picking up CFLAGS, LDFLAGS, etc as needed without you having to provide them yourself. I think checking for both would be useful, unless everybody ships with the pkg-config files by now.
(In reply to Sebastian Dröge (slomo) from comment #3) > Isn't there a pkg-config file for this stuff now in later versions? Not in the latest raspbian Jessie. Are you using another distribution on pi ?
Yes, later raspberrypi-userland has .pc files in them which you should use. The pushed patch is incorrect as it should try dependency(), then find_library().
Its a bit of an exaggeration, previously it did not work on the recommended distro now it works on both, but I take your point and will write the fallback.
Created attachment 354250 [details] [review] meson: Re-add pkg-config support for bcm_host Now we just fallback to find_library for Rasbian jessy and older.
Review of attachment 354250 [details] [review]: ::: gst-libs/gst/gl/meson.build @@ +521,3 @@ + # support older distribution + bcm_host_dep = dependency('bcm_host', required : false) + if not bcm_host_dep.fount() should be .found()
Created attachment 354256 [details] [review] meson: Re-add pkg-config support for bcm_host v2: Actually tested it this time, sorry. fount->found and added missing endif, this is not Python or C.
Attachment 354256 [details] pushed as 55e701a - meson: Re-add pkg-config support for bcm_host