blob: 0eb7bd3dfc527e154ccbe685ae993ad16f71c850 (
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
77
78
79
80
|
AUTOMAKE_OPTIONS = foreign
lib_LTLIBRARIES = libsandbox.la
bin_PROGRAMS = sandbox
AM_CPPFLAGS = \
-DPIC -fPIC -D_REENTRANT \
-DLIBSANDBOX_PATH=\"$(libdir)\" \
-DSANDBOX_BASHRC_PATH=\"$(pkgdatadir)\" \
-I$(top_srcdir) -Wall
INCLUDES = -I$(top_srcdir)/librcutil/include
LOCAL_INCLUDES = $(top_srcdir)/localdecls.h
# 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
# Do not add -nostdlib or -nostartfiles, as then our constructor
# and destructor will not be executed ...
libsandbox_la_LIBADD = \
-lc $(LIBDL) \
$(top_builddir)/librcutil/.libs/librcutil.a
# Could use the following, but then libtool link it with --whole-archive
# $(top_builddir)/librcutil/librcutil.la
libsandbox_la_LDFLAGS = \
-nodefaultlibs \
-Wl,--version-script,libsandbox.map
libsandbox_la_SOURCES = \
libsandbox.c \
canonicalize.c \
sandbox_utils.c \
$(LOCAL_INCLUDES)
sandbox_CFLAGS = -DOUTSIDE_LIBSANDBOX
sandbox_LDADD = $(top_builddir)/librcutil/librcutil.la
sandbox_SOURCES = \
sandbox.c \
sandbox.h \
sandbox_utils.c \
$(LOCAL_INCLUDES)
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) -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) -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)
|