blob: bc551c8250152fc748d3a71e16469259dabcd64d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
AUTOMAKE_OPTIONS = foreign
lib_LTLIBRARIES = libsandbox.la
bin_PROGRAMS = sandbox
AM_CPPFLAGS = \
$(SANDBOX_DEFINES) \
-DPIC -fPIC -D_REENTRANT \
-I$(top_srcdir) -Wall
INCLUDES = \
-I$(top_srcdir)/libsbutil \
-I$(top_srcdir)/libsbutil/include
# We need -fexceptions here, else we do not catch exceptions
# (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions).
libsandbox_la_CFLAGS = -fexceptions
# Could use the following to libsandbox_la_LIBADD, but then libtool links it
# with --whole-archive:
# $(top_builddir)/libsbutil/libsbutil.la
libsandbox_la_LIBSBOBJS = $(wildcard $(top_builddir)/libsbutil/*.lo)
libsandbox_la_LIBADD = \
-lc $(LIBDL) \
$(libsandbox_la_LIBSBOBJS)
# Do not add -nostdlib or -nostartfiles, as then our constructor
# and destructor will not be executed ...
libsandbox_la_LDFLAGS = \
-nodefaultlibs \
-Wl,--version-script,libsandbox.map
libsandbox_la_SOURCES = \
libsandbox.c \
canonicalize.c
sandbox_CFLAGS = -DOUTSIDE_LIBSANDBOX
sandbox_LDADD = $(top_builddir)/libsbutil/libsbutil.la
sandbox_SOURCES = sandbox.c
libsandbox.c: libsandbox.map symbols.h
SYMBOLS_FILE = $(srcdir)/symbols.h.in
SYMBOLS_LIST = $(shell $(EGREP) -v '^\#' $(SYMBOLS_FILE))
GEN_VERSION_MAP_SCRIPT = $(top_srcdir)/scripts/gen_symbol_version_map.awk
GEN_HEADER_SCRIPT = $(top_srcdir)/scripts/gen_symbol_header.awk
libsandbox.map: $(SYMBOLS_FILE) $(GEN_VERSION_MAP_SCRIPT)
@echo "Generating $@"; \
if [ ! -e "$(LIBC_PATH)" ]; then\
echo -e "\n*** Cannot find LIBC_PATH '$(LIBC_PATH)' !\n"; \
exit 1; \
fi; \
export SYMBOLS="$(SYMBOLS_LIST)"; \
if ! $(READELF) -h -s $(LIBC_PATH) | \
$(AWK) -f $(GEN_VERSION_MAP_SCRIPT) > $@ ; \
then \
echo "\n*** Failed to generate '$@' !\n"; \
exit 1; \
fi
symbols.h: $(SYMBOLS_FILE) $(GEN_HEADER_SCRIPT)
@echo "Generating $@"; \
if [ ! -e "$(LIBC_PATH)" ]; then\
echo -e "\n*** Cannot find LIBC_PATH '$(LIBC_PATH)' !\n"; \
exit 1; \
fi; \
export SYMBOLS="$(SYMBOLS_LIST)"; \
if ! $(READELF) -h -s $(LIBC_PATH) | \
$(AWK) -f $(GEN_HEADER_SCRIPT) > $@ ; \
then \
echo "\n*** Failed to generate '$@' !\n"; \
exit 1; \
fi
EXTRA_DIST = $(SYMBOLS_FILE)
CLEANFILES = libsandbox.map symbols.h
DISTCLEANFILES = $(CLEANFILES)
|