aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/Makefile.in
diff options
context:
space:
mode:
authorPhilipp Stephani2020-12-17 11:20:55 +0100
committerPhilipp Stephani2021-01-17 17:45:02 +0100
commitea51edc2a58b6d44fdb9cff160834d9e8312cf9e (patch)
tree1398b5fcb4b32172ac402a06a2a3a3877810cf06 /lib-src/Makefile.in
parent6dec7327ab002903ac4791be33fec3669e6082c2 (diff)
downloademacs-scratch/seccomp-no-gnulib.tar.gz
emacs-scratch/seccomp-no-gnulib.zip
Add a helper binary to create a basic Secure Computing filter.scratch/seccomp-no-gnulib
The binary uses the 'seccomp' helper library. The library isn't needed to load the generated Secure Computing filter. * configure.ac: Check for 'seccomp' header and library. * lib-src/seccomp-filter.c: New helper binary to generate a generic Secure Computing filter for GNU/Linux. * lib-src/Makefile.in (DONT_INSTALL): Add 'seccomp-filter' helper binary if possible. (all): Add Secure Computing filter file if possible. (seccomp-filter$(EXEEXT)): Compile helper binary. (seccomp-filter.bpf seccomp-filter.pfc): Generate filter files. * test/src/emacs-tests.el (emacs-tests/seccomp/allows-stdout) (emacs-tests/seccomp/forbids-subprocess): New unit tests. * test/Makefile.in (src/emacs-tests.log): Add dependency on the helper binary.
Diffstat (limited to 'lib-src/Makefile.in')
-rw-r--r--lib-src/Makefile.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 0a6dd826c10..78905e48fb3 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -214,6 +214,12 @@ LIB_WSOCK32=@LIB_WSOCK32@
214## Extra libraries for etags 214## Extra libraries for etags
215LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) 215LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM)
216 216
217LIBSECCOMP=@LIBSECCOMP@
218
219ifneq ($(LIBSECCOMP),)
220DONT_INSTALL += seccomp-filter$(EXEEXT)
221endif
222
217## Extra libraries to use when linking movemail. 223## Extra libraries to use when linking movemail.
218LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ 224LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
219 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS) 225 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS)
@@ -243,6 +249,10 @@ config_h = ../src/config.h $(srcdir)/../src/conf_post.h
243 249
244all: ${EXE_FILES} ${SCRIPTS} 250all: ${EXE_FILES} ${SCRIPTS}
245 251
252ifneq ($(LIBSECCOMP),)
253all: seccomp-filter.bpf
254endif
255
246.PHONY: all need-blessmail maybe-blessmail 256.PHONY: all need-blessmail maybe-blessmail
247 257
248LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) 258LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
@@ -425,4 +435,13 @@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
425emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico 435emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico
426 $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< 436 $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<
427 437
438ifneq ($(LIBSECCOMP),)
439seccomp-filter$(EXEEXT): $(srcdir)/seccomp-filter.c $(config_h)
440 $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $< $(LIBSECCOMP) -o $@
441
442seccomp-filter.bpf seccomp-filter.pfc: seccomp-filter$(EXEEXT)
443 $(AM_V_GEN)./seccomp-filter$(EXEEXT) \
444 seccomp-filter.bpf seccomp-filter.pfc
445endif
446
428## Makefile ends here. 447## Makefile ends here.