Commit 6fc5ee1f authored by Simon McVittie's avatar Simon McVittie
Browse files

tools: Add a build option to add a -rpath

We have to do this in two stages, because passing ${ORIGIN} through
Autoconf, Automake and Make is a massive pain: first write in a
dummy rpath that starts with /_ORIGIN_ (implemented here), then
rewrite it to start with ${ORIGIN} with chrpath (to be done

Signed-off-by: Simon McVittie's avatarSimon McVittie <>
parent 90a21b5d
......@@ -34,6 +34,11 @@ pkgconfig_DATA = data/libcapsule.pc data/libcapsule-tools.pc
nobase_include_HEADERS = capsule/capsule.h
dist_doc_DATA = $(foreach doc,$(static_docs),doc/$(doc).txt)
# Use -Wl to hide it from libtool
tools_ldflags = -Wl,-rpath,$(enable_tools_rpath)
bin_SCRIPTS = data/$(HOST_PREFIX)capsule-mkstublib
......@@ -83,16 +88,20 @@ capsule_elf_dump_LDADD = utils/ -ldl
# This looks redundant, but it forces Automake to build separate
# instantiations of dump.o for elf-dump and libcapsule
capsule_elf_dump_CFLAGS = $(AM_CFLAGS)
capsule_elf_dump_LDFLAGS = $(AM_LDFLAGS) $(tools_ldflags)
capsule_capture_libs_SOURCES = utils/capture-libs.c
capsule_capture_libs_LDADD = utils/
capsule_capture_libs_LDFLAGS = $(AM_LDFLAGS) $(tools_ldflags)
# now the rules for building our installables:
capsule_symbols_SOURCES = utils/print-libstubs.c
capsule_symbols_LDADD = utils/
capsule_symbols_LDFLAGS = $(AM_LDFLAGS) $(tools_ldflags)
capsule_version_SOURCES = utils/print-version.c
capsule_version_LDADD = utils/
capsule_version_LDFLAGS = $(AM_LDFLAGS) $(tools_ldflags)
libcapsule_la_SOURCES = capsule/capsule-dlmopen.c \
capsule/capsule-relocate.c \
......@@ -82,6 +82,19 @@ AS_IF([test "x$enable_host_prefix" = xno],
AC_SUBST([HOST_PREFIX], [$enable_host_prefix])
[install link to tools with a RPATH ready to override with chrpath])],
AS_IF([test "x$enable_tools_rpath" = xyes],
AS_IF([test "x$enable_tools_rpath" = xno],
AM_CONDITIONAL([ENABLE_TOOLS_RPATH], [test "x$enable_tools_rpath" != x])
AC_SEARCH_LIBS([dlmopen], [dl])
AC_PATH_PROG([XSLTPROC], [xsltproc])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment