[RFC PATCH 0/8] Meson build system

Daniel Stone daniel at fooishbar.org
Wed Nov 30 09:21:29 UTC 2016


Hi Pekka,

On 30 November 2016 at 08:54, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Wed, 30 Nov 2016 01:02:13 +0000 Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> As we build (simple `make') binaries are linked against the in-tree
>> DSO(s). Upon `make install' autotools/libtool relinks each binary. The
>> latter of which can be quite costly.
>> One way around it is to hack into libtool with another to use a
>> project called slibtool (I've mentioned it a while back). The latter
>> links only once, thus in theory (at least) the whole thing could be
>> noticeably faster. For some reason normal linking with slibtool can be
>> a bit slow :-(
>
> I haven't yet looked at what Meson actually generates, but the
> documentation mentioned that one can just run the binaries from the
> build tree and they will use the libraries from the build tree
> automatically. Would that not imply that the install step must massage
> all binaries to have them use installed libs instead of leaving
> left-overs from the build setup?
>
> Autotools does it worse: every binary is actually a shell script with
> the real binary in a hidder directory, which makes using gdb and
> valgrind require a magic libtool incantation, *and* (you say) it also
> relinks on install. What's up with that?
>
> How does slibtool achieve the "easy" running of binaries in the build
> dir if it does not relink on install?

I'm not sure what slibtool does, but at least for Meson, it's a pretty
easy answer. The binaries get a DT_RPATH ELF entry for the build tree,
which makes them look there for libraries first. On install, you don't
need to relink, but just strip the rpath entry from the binary as you
install.

> One huge convenience of Meson is (the documentation claims) that you
> only need the one file 'meson.py' to use it, which makes the dependency
> to meson a very easy one. When I look at the list of files installed by
> e.g. CMake or autoconf...

I would like to agree and say that's great, but I think it's either
slightly misunderstood or only about half true. Meson itself _can_ be
'zipped' into a single Python file indeed, though I haven't actually
tried this myself: I either use distro packages or use a local install
via pip. That being said, its effect on the source tree is far better
than autotools: it generates build.ninja & compile_commands.json
inside the build directory, and leaves the source directory completely
untouched. This is markedly better than autotools, which generates a
huge amount of stuff inside the source directory. From that
perspective at least, it's far more clean.

Cheers,
Daniel


More information about the wayland-devel mailing list