build: Calculate ABS_GLIB_RUNTIME_LIBDIR at build time

Rather than calculating it at configure time. This means it can expand
$libdir properly, and use the Make $(realpath) function rather than
invoking the non-portable `readlink -f`.

This fixes problems where `readlink` would be called on an invalid path
(due to a variable not being expanded) and would evaluate to "", which
would then cause things to be installed in the wrong place.

https://bugzilla.gnome.org/show_bug.cgi?id=744772
This commit is contained in:
Philip Withnall
2016-01-11 14:23:45 +00:00
committed by Philip Withnall
parent 57f9c590f9
commit 8c263008bb
4 changed files with 33 additions and 4 deletions

View File

@@ -130,6 +130,14 @@ tapset_in_files = gobject.stp.in
tapsetdir = @ABS_TAPSET_DIR@
tapset_DATA = $(tapset_in_files:.stp.in=.stp)
EXTRA_DIST += $(tapset_in_files)
CLEANFILES += $(tapset_in_files:.stp.in=.stp)
$(tapset_DATA): %.stp: %.stp.in Makefile
$(AM_V_GEN)$(SED) \
-e 's|[@]ABS_GLIB_RUNTIME_LIBDIR[@]|$(ABS_GLIB_RUNTIME_LIBDIR)|g' \
-e 's|[@]LT_CURRENT[@]|$(LT_CURRENT)|g' \
-e 's|[@]LT_REVISION[@]|$(LT_REVISION)|g' \
$< > $@
endif
# non-header sources (headers should be specified in the above variables)
@@ -260,6 +268,12 @@ libgobject-gdb.py: libgobject-gdb.py.in
uninstall-gdb:
-rm -r $(DESTDIR)$(datadir)/gdb
if HAVE_GLIB_RUNTIME_LIBDIR
ABS_GLIB_RUNTIME_LIBDIR = $(realpath $(libdir)/$(GLIB_RUNTIME_LIBDIR))
else
ABS_GLIB_RUNTIME_LIBDIR = $(libdir)
endif
install-data-hook: libgobject-gdb.py
mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
$(INSTALL) $(builddir)/libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py