Skip to content
Snippets Groups Projects
Commit 4556587e authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

Update the Makefile.am for the new project layout

We no longer build proxy libraries as part of libcapsule

Several extra tools have been added to make setting up a libcapsule
proxy library project as easy as possible.

All of this is tied together by a capsule.pc meta data file.
parent 80dd9390
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -15,73 +15,75 @@ ...@@ -15,73 +15,75 @@
# You should have received a copy of the GNU Lesser General Public # You should have received a copy of the GNU Lesser General Public
# License along with libcapsule. If not, see <http://www.gnu.org/licenses/>. # License along with libcapsule. If not, see <http://www.gnu.org/licenses/>.
V ?= 0 AUTOMAKE_OPTIONS = subdir-objects
AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = --std=c99 -D_GNU_SOURCE -Wall -Werror
AM_CFLAGS = --std=c99 -D_GNU_SOURCE -Wall -Werror
# installable items:
bin_PROGRAMS = elf-dump print-libstubs libexec_PROGRAMS = capsule-symbols capsule-version
lib_LTLIBRARIES = libcapsule.la libexec_SCRIPTS = data/capsule-mkstublib data/capsule-init-project
lib_LTLIBRARIES = libcapsule.la
lib_LTLIBRARIES += libz.la pkgconfigdir = $(libdir)/pkgconfig
lib_LTLIBRARIES += libGL.la pkgconfig_DATA = data/capsule.pc
include_HEADERS = capsule/capsule.h
include_HEADERS = capsule/capsule.h
nodist_include_HEADERS = utils/utils.h utils/dump.h utils/process-pt-dynamic.h # demo program - keep this hanging around as it's a useful PoC
noinst_PROGRAMS = elf-dump
elf_dump_SOURCES = utils/elf-dump.c
elf_dump_LDFLAGS = -ldl elf_dump_SOURCES = utils/elf-dump.c
elf_dump_LDFLAGS = -ldl
print_libstubs_SOURCES = utils/print-libstubs.c \ elf_dump_SOURCES += utils/utils.h
utils/utils.c \
utils/ld-cache.c \ # now the rules for building our installables:
utils/ld-libs.c capsule_symbols_SOURCES = utils/print-libstubs.c \
print_libstubs_LDFLAGS = -ldl -lelf utils/utils.c \
print_libstubs_CFLAGS = $(AM_CFLAGS) utils/ld-cache.c \
utils/ld-libs.c
libcapsule_la_SOURCES = capsule/capsule-dlmopen.c \ capsule_symbols_SOURCES += \
capsule/capsule-relocate.c \ utils/utils.h \
capsule/capsule-init.c \ utils/ld-cache.h \
utils/utils.c utils/dump.c \ utils/ld-libs.h
utils/process-pt-dynamic.c \ capsule_symbols_LDFLAGS = -ldl -lelf
utils/mmap-info.c \ # this looks like a no-op but it gives capsule_symbols its own target
utils/ld-cache.c \ # so that libtool doesn't get bent out of shape about using an object
utils/ld-libs.c # (ld-cache.o, ld-libs.o) as both part of a library and a standalone
# executable:
libcapsule_la_LDFLAGS = -lelf capsule_symbols_CFLAGS = $(AM_CFLAGS)
############################################################################
# shim libraries: capsule_version_SOURCES = utils/print-version.c \
utils/utils.c \
# libz to match version 1.2.8 and have the same symbol versioning: utils/ld-cache.c \
libz_la_SOURCES = shim/libz.so.c utils/ld-libs.c
libz_la_LDFLAGS = -lcapsule -version-number 1:2:8 \ capsule_version_SOURCES += \
-Wl,--version-script=shim/libz.so.map utils/utils.h \
utils/ld-cache.h \
# libGL is always 1.2.0, and doesn't use symbol versioning: utils/ld-libs.h
libGL_la_SOURCES = shim/libGL.so.c capsule_version_LDFLAGS = -ldl -lelf
libGL_la_LDFLAGS = -lcapsule -version-number 1:2 capsule_version_CFLAGS = $(AM_CFLAGS)
############################################################################
shims = $(patsubst shim/lib%.so.c,%,$(filter shim/lib%.so.c,$(SOURCES))) libcapsule_la_SOURCES = capsule/capsule-dlmopen.c \
shim_srcs = $(foreach l,$(shims),shim/lib$l.so.c) capsule/capsule-relocate.c \
shim_base = $(basename $(shim_srcs)) capsule/capsule-init.c \
shim_files = $(foreach y,map symbols,$(foreach x,$(shim_base),$x.$y)) utils/utils.c \
utils/dump.c \
GENSTUB_V1 = utils/process-pt-dynamic.c \
GENSTUB_V0 = @echo " GENSTUB " $(subst $(word 1, $(basename $(filter shim/lib%,$^))),,$(filter shim/lib%,$^)) : $@; utils/mmap-info.c \
GENSTUB = $(GENSTUB_V$(V)) utils/ld-cache.c \
utils/ld-libs.c
libcapsule_la_LDFLAGS = -lelf -version-number 0:1 \
libcapsule_la_SOURCES += utils/utils.h \
utils/dump.h \
utils/process-pt-dynamic.h \
utils/mmap-info.h \
utils/ld-cache.h \
utils/ld-libs.h
dist_pkgdata_DATA = data/capsule-shim.h \
data/capsule-shim.mk.in \
disabled.mk
CLEANFILES = $(shim_files) $(shim_srcs) CLEANFILES = $(shim_files) $(shim_srcs)
BUILT_SOURCES = $(shim_srcs) BUILT_SOURCES = $(shim_srcs)
include disabled.mk include disabled.mk
# explicitly depend on the generators and .excluded and .shared metafiles
# depend on the .dlopen file IFF it exists
shim/lib%.so.c: generate-stublib.sh print-libstubs capsule-shim.h shim/lib%.so.c.*
$(GENSTUB)$(top_srcdir)/$< $$(basename $@ .c) $@.excluded $@.shared $@ "$(lib$(*)_la_LDFLAGS)";
debug:
@echo srcs : $(shim_srcs)
@echo files: $(shim_files)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment