| 1 | AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip |
1 | AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip |
| 2 | EXTRA_DIST = sandbox.bashrc canonicalize.c libctest.c symbols.in |
2 | EXTRA_DIST = sandbox.bashrc canonicalize.c libctest.c symbols.in |
| 3 | CLEANFILES = symbols.h |
3 | CLEANFILES = symbols.h |
| 4 | |
4 | |
| 5 | AM_CPPFLAGS = -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT \ |
5 | AM_CPPFLAGS = -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT \ |
| 6 | -DLIBC_VERSION=\"$(LIBC_VERSION)\" \ |
|
|
| 7 | -DLIBSANDBOX_PATH=\"$(libdir)\" \ |
6 | -DLIBSANDBOX_PATH=\"$(libdir)\" \ |
| 8 | -DSANDBOX_BASHRC_PATH=\"$(pkgdatadir)\" |
7 | -DSANDBOX_BASHRC_PATH=\"$(pkgdatadir)\" |
| 9 | |
8 | |
| 10 | dist_pkgdata_DATA = sandbox.bashrc |
9 | dist_pkgdata_DATA = sandbox.bashrc |
| 11 | |
10 | |
| 12 | lib_LTLIBRARIES = libsandbox.la |
11 | lib_LTLIBRARIES = libsandbox.la |
| 13 | libsandbox_la_SOURCES = libsandbox.c localdecls.h |
12 | libsandbox_la_SOURCES = libsandbox.c localdecls.h |
| 14 | # Do not add -nostdlib or -nostartfiles, as then our constructor |
13 | # Do not add -nostdlib or -nostartfiles, as then our constructor |
| 15 | # and destructor will not be executed ... |
14 | # and destructor will not be executed ... |
| 16 | libsandbox_la_LDFLAGS = -nodefaultlibs -lc -ldl |
15 | libsandbox_la_LDFLAGS = -nodefaultlibs -lc -ldl |
| 17 | # We need -fexceptions here, else we do not catch exceptions |
16 | # We need -fexceptions here, else we do not catch exceptions |
| 18 | # (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions). |
17 | # (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions). |
| 19 | libsandbox_la_CFLAGS = -fexceptions |
18 | libsandbox_la_CFLAGS = -fexceptions |
| 20 | |
19 | |
| 21 | bin_PROGRAMS = sandbox |
20 | bin_PROGRAMS = sandbox |
| 22 | sandbox_SOURCES = sandbox.c sandbox.h sandbox_futils.c getcwd.c |
21 | sandbox_SOURCES = sandbox.c sandbox.h sandbox_futils.c getcwd.c |
| 23 | sandbox_CFLAGS = -DOUTSIDE_LIBSANDBOX |
22 | sandbox_CFLAGS = -DOUTSIDE_LIBSANDBOX |
| 24 | |
23 | |
| 25 | libsandbox.c: symbols.h |
24 | libsandbox.c: symbols.h |
| 26 | |
25 | |
| 27 | # Basically generates symbols.h from the function names in symbols.in. |
26 | # Basically generates symbols.h from the function names in symbols.in. |
| 28 | # Not sure if we can count on the latest version the only symbol |
27 | # Not sure if we can count on the latest version the only symbol |
| 29 | # countaining '@@' ... |
28 | # countaining '@@' ... |
| 30 | symbols.h: symbols.in |
29 | symbols.h: symbols.in |
| 31 | @echo "Generating $@"; \ |
30 | @echo "Generating $@"; \ |
| 32 | if [ ! -e "$(LIBC_PATH)" ]; then\ |
31 | if [ ! -e "$(LIBC_PATH)" ]; then\ |
| 33 | echo -e "\n*** Cannot find $(LIBC_PATH)!\n"; \ |
32 | echo -e "\n*** Cannot find LIBC_PATH '$(LIBC_PATH)' !\n"; \ |
| 34 | exit 1; \ |
33 | exit 1; \ |
| 35 | fi; \ |
34 | fi; \ |
| 36 | echo "#ifndef __symbol_h" > $@; \ |
35 | echo "#ifndef __symbol_h" > $@; \ |
| 37 | echo -e "#define __symbol_h\n" >> $@; \ |
36 | echo -e "#define __symbol_h\n" >> $@; \ |
| 38 | for x in `cat $^`; do \ |
37 | for x in `cat $^`; do \ |
| … | |
… | |
| 47 | else \ |
46 | else \ |
| 48 | echo "#define symver_$${x} NULL" >> $@; \ |
47 | echo "#define symver_$${x} NULL" >> $@; \ |
| 49 | fi; \ |
48 | fi; \ |
| 50 | done; \ |
49 | done; \ |
| 51 | echo -e "\n#endif /* __symbol_h */" >> $@ |
50 | echo -e "\n#endif /* __symbol_h */" >> $@ |
| 52 | |
|
|