Skip to content
Snippets Groups Projects
Commit be7cb506 authored by Simon McVittie's avatar Simon McVittie
Browse files

Make host prefix for tools modifiable


Use the canonical Debian GNU type for the Debian packages, matching
the prefix on gcc.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent e3157cde
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -33,28 +33,32 @@ pkgconfig_DATA = data/libcapsule.pc data/libcapsule-tools.pc ...@@ -33,28 +33,32 @@ pkgconfig_DATA = data/libcapsule.pc data/libcapsule-tools.pc
nobase_include_HEADERS = capsule/capsule.h nobase_include_HEADERS = capsule/capsule.h
dist_doc_DATA = $(foreach doc,$(static_docs),doc/$(doc).txt) dist_doc_DATA = $(foreach doc,$(static_docs),doc/$(doc).txt)
bin_SCRIPTS = data/$(host)-capsule-mkstublib if ENABLE_HOST_PREFIX
bin_SCRIPTS = data/$(HOST_PREFIX)capsule-mkstublib
# Write out a version of capsule-mkstublib with different defaults # Write out a version of capsule-mkstublib with different defaults
# for each architecture # for each architecture
data/$(host)-capsule-mkstublib: data/capsule-mkstublib Makefile data/$(HOST_PREFIX)capsule-mkstublib: data/capsule-mkstublib Makefile
$(AM_V_GEN)set -e; \ $(AM_V_GEN)set -e; \
( \ ( \
sed -e 1q $<; \ sed -e 1q $<; \
echo '# Inserted by Makefile to make this architecture-specific'; \ echo '# Inserted by Makefile to make this architecture-specific'; \
echo ': "$${CAPSULE_SYMBOLS_TOOL:="$(bindir)/$(host)-capsule-symbols"}"';\ echo ': "$${CAPSULE_SYMBOLS_TOOL:="$(bindir)/$(HOST_PREFIX)capsule-symbols"}"';\
sed -e 1d $<; \ sed -e 1d $<; \
) > $@.tmp; chmod +x $@.tmp; mv $@.tmp $@ ) > $@.tmp; chmod +x $@.tmp; mv $@.tmp $@
install-exec-hook: install-exec-hook:
cd $(DESTDIR)$(bindir) && ln -f capsule-symbols $(host)-capsule-symbols cd $(DESTDIR)$(bindir) && ln -f capsule-symbols $(HOST_PREFIX)capsule-symbols
cd $(DESTDIR)$(bindir) && ln -f capsule-version $(host)-capsule-version cd $(DESTDIR)$(bindir) && ln -f capsule-version $(HOST_PREFIX)capsule-version
cd $(DESTDIR)$(bindir) && ln -f capsule-elf-dump $(host)-capsule-elf-dump cd $(DESTDIR)$(bindir) && ln -f capsule-elf-dump $(HOST_PREFIX)capsule-elf-dump
uninstall-hook: uninstall-hook:
cd $(DESTDIR)$(bindir) && rm -f $(host)-capsule-elf-dump cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-elf-dump
cd $(DESTDIR)$(bindir) && rm -f $(host)-capsule-symbols cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-symbols
cd $(DESTDIR)$(bindir) && rm -f $(host)-capsule-version cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-version
else
dist_bin_SCRIPTS += data/capsule-mkstublib
endif
# Headers to be included by shim libraries # Headers to be included by shim libraries
nobase_include_HEADERS += capsule/capsule-shim.h \ nobase_include_HEADERS += capsule/capsule-shim.h \
...@@ -369,7 +373,9 @@ $(DOC_MAIN_SGML_FILE): sgml-build.stamp ...@@ -369,7 +373,9 @@ $(DOC_MAIN_SGML_FILE): sgml-build.stamp
# These need to come after we include gtk-doc.make, which unconditionally # These need to come after we include gtk-doc.make, which unconditionally
# defines these variables # defines these variables
CLEANFILES += $(testmeta_DATA) CLEANFILES += $(testmeta_DATA)
CLEANFILES += data/$(host)-capsule-mkstublib if ENABLE_HOST_PREFIX
CLEANFILES += data/$(HOST_PREFIX)capsule-mkstublib
endif
CLEANFILES += $(nodist_tests_shim_libnotgl_la_SOURCES) CLEANFILES += $(nodist_tests_shim_libnotgl_la_SOURCES)
CLEANFILES += $(nodist_tests_shim_libnotgles_la_SOURCES) CLEANFILES += $(nodist_tests_shim_libnotgles_la_SOURCES)
......
...@@ -66,6 +66,19 @@ PKG_CHECK_MODULES([LIBELF], [libelf >= 0.152], [have_libelf=yes], [ ...@@ -66,6 +66,19 @@ PKG_CHECK_MODULES([LIBELF], [libelf >= 0.152], [have_libelf=yes], [
LIBELF_LIBS=-lelf LIBELF_LIBS=-lelf
]) ])
AC_ARG_ENABLE([host-prefix],
[AS_HELP_STRING([--enable-host-prefix=PREFIX/yes/no],
[install link to tools with a prefix [default=$host-]])],
[],
[enable_host_prefix=yes])
AM_CONDITIONAL([ENABLE_HOST_PREFIX], [test "x$enable_host_prefix" != xno])
AS_IF([test "x$enable_host_prefix" = xyes],
[enable_host_prefix="$host-"])
AS_IF([test "x$enable_host_prefix" = xno],
[enable_host_prefix=""])
AC_SUBST([HOST_PREFIX], [$enable_host_prefix])
AC_SEARCH_LIBS([dlmopen], [dl]) AC_SEARCH_LIBS([dlmopen], [dl])
AC_PATH_PROG([XSLTPROC], [xsltproc]) AC_PATH_PROG([XSLTPROC], [xsltproc])
GTK_DOC_CHECK GTK_DOC_CHECK
......
...@@ -7,9 +7,9 @@ datarootdir=@datarootdir@ ...@@ -7,9 +7,9 @@ datarootdir=@datarootdir@
datadir=@datarootdir@ datadir=@datarootdir@
makeinc=@datadir@/libcapsule makeinc=@datadir@/libcapsule
CAPSULE_INIT_PROJECT_TOOL=@bindir@/capsule-init-project CAPSULE_INIT_PROJECT_TOOL=@bindir@/capsule-init-project
CAPSULE_MKSTUBLIB_TOOL=@bindir@/@host@-capsule-mkstublib CAPSULE_MKSTUBLIB_TOOL=@bindir@/@HOST_PREFIX@capsule-mkstublib
CAPSULE_SYMBOLS_TOOL=@bindir@/@host@-capsule-symbols CAPSULE_SYMBOLS_TOOL=@bindir@/@HOST_PREFIX@capsule-symbols
CAPSULE_VERSION_TOOL=@bindir@/@host@-capsule-version CAPSULE_VERSION_TOOL=@bindir@/@HOST_PREFIX@capsule-version
Name: libcapsule-tools Name: libcapsule-tools
Description: segregated dynamic linking library - development tools Description: segregated dynamic linking library - development tools
......
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
%: %:
dh $@ --with autoreconf dh $@ --with autoreconf
confflags = --libexecdir=\$${exec_prefix}/lib/libcapsule --enable-gtk-doc confflags = \
--enable-gtk-doc \
--enable-host-prefix=$(DEB_HOST_GNU_TYPE)- \
--libexecdir=\$${exec_prefix}/lib/libcapsule \
$(NULL)
override_dh_auto_configure: override_dh_auto_configure:
dh_auto_configure -- $(confflags) dh_auto_configure -- $(confflags)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment