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

Distinguish between enabling the library and enabling shared libraries


Some tests for capsule-capture-libs will need to compile shared
libraries, even if libcapsule itself is not built.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 91312069
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -28,7 +28,7 @@ static_docs = Building Debugging Limitations Quick-Start Capsules ...@@ -28,7 +28,7 @@ static_docs = Building Debugging Limitations Quick-Start Capsules
# installable items: # installable items:
bin_PROGRAMS = capsule-capture-libs capsule-symbols capsule-version bin_PROGRAMS = capsule-capture-libs capsule-symbols capsule-version
if ENABLE_SHARED if ENABLE_LIBRARY
dist_bin_SCRIPTS = data/capsule-init-project dist_bin_SCRIPTS = data/capsule-init-project
lib_LTLIBRARIES = libcapsule.la lib_LTLIBRARIES = libcapsule.la
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
...@@ -43,7 +43,7 @@ tools_ldflags = -Wl,-rpath,$(enable_tools_rpath) ...@@ -43,7 +43,7 @@ tools_ldflags = -Wl,-rpath,$(enable_tools_rpath)
endif endif
if ENABLE_HOST_PREFIX if ENABLE_HOST_PREFIX
if ENABLE_SHARED if ENABLE_LIBRARY
bin_SCRIPTS = data/$(HOST_PREFIX)capsule-mkstublib 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
...@@ -72,12 +72,12 @@ uninstall-hook-host-prefix: ...@@ -72,12 +72,12 @@ uninstall-hook-host-prefix:
cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-symbols cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-symbols
cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-version cd $(DESTDIR)$(bindir) && rm -f $(HOST_PREFIX)capsule-version
else else
if ENABLE_SHARED if ENABLE_LIBRARY
dist_bin_SCRIPTS += data/capsule-mkstublib dist_bin_SCRIPTS += data/capsule-mkstublib
endif endif
endif endif
if ENABLE_SHARED if ENABLE_LIBRARY
# 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 \
capsule/_int_dlopen.h capsule/_int_dlopen.h
...@@ -115,7 +115,7 @@ capsule_version_SOURCES = utils/print-version.c utils/tools.c utils/tools.h ...@@ -115,7 +115,7 @@ capsule_version_SOURCES = utils/print-version.c utils/tools.c utils/tools.h
capsule_version_LDADD = utils/libld.la capsule_version_LDADD = utils/libld.la
capsule_version_LDFLAGS = $(AM_LDFLAGS) $(tools_ldflags) capsule_version_LDFLAGS = $(AM_LDFLAGS) $(tools_ldflags)
if ENABLE_SHARED if ENABLE_LIBRARY
libcapsule_la_SOURCES = capsule/capsule-dlmopen.c \ libcapsule_la_SOURCES = capsule/capsule-dlmopen.c \
capsule/capsule-relocate.c \ capsule/capsule-relocate.c \
capsule/capsule-init.c \ capsule/capsule-init.c \
...@@ -153,7 +153,7 @@ include $(top_srcdir)/data/disabled.mk ...@@ -153,7 +153,7 @@ include $(top_srcdir)/data/disabled.mk
insttestsdir = $(libexecdir)/installed-tests/$(PACKAGE_TARNAME) insttestsdir = $(libexecdir)/installed-tests/$(PACKAGE_TARNAME)
if ENABLE_SHARED if ENABLE_LIBRARY
# /!\ Order is important here: the helper library must come first # /!\ Order is important here: the helper library must come first
nobase_insttests_LTLIBRARIES = tests/red/libhelper.la \ nobase_insttests_LTLIBRARIES = tests/red/libhelper.la \
tests/green/libhelper.la \ tests/green/libhelper.la \
...@@ -256,7 +256,7 @@ maintainer-update-gl-shims: ...@@ -256,7 +256,7 @@ maintainer-update-gl-shims:
: > $(abs_top_srcdir)/examples/shim/"$$lib.symbols.updated-for"; \ : > $(abs_top_srcdir)/examples/shim/"$$lib.symbols.updated-for"; \
done done
if ENABLE_SHARED if ENABLE_LIBRARY
tests_lib_libnotgl_la_SOURCES = tests/notgl-ref.c \ tests_lib_libnotgl_la_SOURCES = tests/notgl-ref.c \
tests/notgl.h \ tests/notgl.h \
tests/notgl-helper.h tests/notgl-helper.h
...@@ -356,7 +356,7 @@ AM_TESTS_ENVIRONMENT = export CAPSULE_CAPTURE_LIBS_TOOL="$(abs_b ...@@ -356,7 +356,7 @@ AM_TESTS_ENVIRONMENT = export CAPSULE_CAPTURE_LIBS_TOOL="$(abs_b
export MALLOC_CHECK_=2; \ export MALLOC_CHECK_=2; \
export NM="$(NM)"; \ export NM="$(NM)"; \
export PKG_CONFIG_PATH="$(abs_builddir)/data"; export PKG_CONFIG_PATH="$(abs_builddir)/data";
if ENABLE_SHARED if ENABLE_LIBRARY
test_extra_programs = tests/notgl-user \ test_extra_programs = tests/notgl-user \
tests/notgl-helper-user \ tests/notgl-helper-user \
tests/notgl-dlopener tests/notgl-dlopener
...@@ -380,7 +380,7 @@ test_scripts = tests/capture-libs.pl \ ...@@ -380,7 +380,7 @@ test_scripts = tests/capture-libs.pl \
tests/symbols.pl \ tests/symbols.pl \
tests/version.pl tests/version.pl
if ENABLE_SHARED if ENABLE_LIBRARY
test_scripts += tests/gl-shim.pl \ test_scripts += tests/gl-shim.pl \
tests/init-project.pl \ tests/init-project.pl \
tests/notgl.pl tests/notgl.pl
...@@ -410,7 +410,7 @@ $(testmeta_DATA): tests/%.test: tests/% Makefile ...@@ -410,7 +410,7 @@ $(testmeta_DATA): tests/%.test: tests/% Makefile
echo "Exec=env CAPSULE_TESTS_GNU_HOST=$(host) $(insttestsdir)/tests/$*$$maybe_tap"; \ echo "Exec=env CAPSULE_TESTS_GNU_HOST=$(host) $(insttestsdir)/tests/$*$$maybe_tap"; \
) > $@.tmp && mv $@.tmp $@ ) > $@.tmp && mv $@.tmp $@
if ENABLE_SHARED if ENABLE_LIBRARY
# ============================================================================ # ============================================================================
# gtk-doc configuration: see /usr/share/doc/gtk-doc-tools/examples/Makefile.am # gtk-doc configuration: see /usr/share/doc/gtk-doc-tools/examples/Makefile.am
DOC_MODULE = libcapsule DOC_MODULE = libcapsule
......
...@@ -57,6 +57,15 @@ AC_CHECK_FUNCS_ONCE([secure_getenv]) ...@@ -57,6 +57,15 @@ AC_CHECK_FUNCS_ONCE([secure_getenv])
AM_CONDITIONAL([ENABLE_SHARED], [test "x$enable_shared" = xyes]) AM_CONDITIONAL([ENABLE_SHARED], [test "x$enable_shared" = xyes])
AC_ARG_ENABLE([library],
[AS_HELP_STRING([--enable-library],
[build the libcapsule library (disable if you only want CLI tools)])],
[],
[enable_library="$enable_shared"])
AS_IF([test "x$enable_shared" != xyes && test "x$enable_library" = xyes],
[AC_MSG_ERROR([libcapsule is only useful as a shared library])])
AM_CONDITIONAL([ENABLE_LIBRARY], [test "x$enable_library" = xyes])
dnl make sure we've got the _right_ libelf (doesn't always ship a .pc) dnl make sure we've got the _right_ libelf (doesn't always ship a .pc)
PKG_CHECK_MODULES([LIBELF], [libelf >= 0.152], [have_libelf=yes], [ PKG_CHECK_MODULES([LIBELF], [libelf >= 0.152], [have_libelf=yes], [
AC_MSG_WARN([libelf.pc not found]) AC_MSG_WARN([libelf.pc not found])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment