GNOME Bugzilla – Bug 794770
Meson: Stop depending on libtool to make android static link
Last modified: 2018-11-03 10:22:36 UTC
When building GStreamer with meson it won't generate .la files. So we can rely only on .pc files to make static builds. As part of bug #794568, we are going to generate a .pc file for each plugin, but that's just one step. Currently ndk-build/gstreamer-1.0.mk builds a shared library that static link all gstreamer plugins and their dependencies. To find dependencies it calls libtool-link function from tools.mk which parse .la files. With pkg-config getting the list of all libraries is easier: $ pkg-config --libs --static <list of plugins> But that's going to give too many -lfoo flags, we don't want to static link libs provided by the android NDK (e.g. libc), only those from gstreamer SDK. Currently that distinction is made based on .la files: Android NDK does not have .la files and GStreamer SDK does. So the decision is basically "static link if a .la is found, dynamic otherwise". I see 2 possibilities: - Hard-ode a blacklist of libs to not static link; or - For each -lfoo ask gcc to resolve to the absolute path to the .a and if found, and has as prefix GStreamer's SDK path, replace the -lfoo by the path to .a in the link command. That's what meson will do if this PR is accepted: https://github.com/mesonbuild/meson/pull/2816
As recipes have started using Meson, we have been generating the libtool files manually in Cerbero with LibtoolLibrary(), which was created ages ago to create libtool files for recipes that don't use Autotools. This is a cumbersome method, since we have to specify the dependencies by hand, so we should move to an automated method in the future; perhaps by using pkg-config files. But this bug is not a blocker for moving Cerbero to Meson.
I think this is blocker because it means manually generating a libtool file for each plugin, that's a lot of work too.
Not so much a blocker anymore as plugin .la are automatically generated. libs however are not and still need .la files generated.
Indeed it's not blocked anymore. We don't generate .la for libs? We could easily do it.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/cerbero/issues/49.