Skip to content

autotools: Make INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR respect prefix/datadir/libdir

The provided m4 macro uses pkg-config for setting INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR which can be used to install the generated gir/typelib files into. Up until now this always used the prefix encoded in the g-i .pc file and ignored the prefix provided by the autotools project using it.

This can be fixed by passing "--define-variable=datadir=/mydatadir" to pkg-config. To get the real value of datadir include a copy of AS_AC_EXPAND in our m4 and use it to expand the variables we need so we can pass the real paths to pkg-config which will use them to generate the new girdir/typelibdir paths.

The reason this hasn't been much of a problem is that the example autotools code suggested using "girdir = $(datadir)/gir-1.0" and "typelibsdir = $(libdir)/girepository-1.0" and not using the variables defined by our macro, so not many projects used it. Now both ways should work.

See !133 (closed)

Edited by Christoph Reiter

Merge request reports