mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Use pkg-config to check for libseccomp.
We need at list version 2.4.0 of libseccomp for seccomp-filter.c to build cleanly. * configure.ac: Use pkg-config to check for libseccomp. * lib-src/Makefile.in (HAVE_LIBSECCOMP, LIBSECCOMP_LIBS) (LIBSECCOMP_CFLAGS): New variables. (SECCOMP_FILTER, seccomp-filter$(EXEEXT)): Use them.
This commit is contained in:
parent
d06c54db1b
commit
725fc96b70
2 changed files with 10 additions and 7 deletions
|
|
@ -4189,10 +4189,10 @@ AC_CHECK_HEADERS(
|
||||||
#include <linux/seccomp.h>
|
#include <linux/seccomp.h>
|
||||||
]])])
|
]])])
|
||||||
|
|
||||||
LIBSECCOMP=
|
EMACS_CHECK_MODULES([LIBSECCOMP], [libseccomp >= 2.4.0])
|
||||||
AC_CHECK_HEADER([seccomp.h],
|
AC_SUBST([HAVE_LIBSECCOMP])
|
||||||
[AC_CHECK_LIB([seccomp], [seccomp_init], [LIBSECCOMP=-lseccomp])])
|
AC_SUBST([LIBSECCOMP_LIBS])
|
||||||
AC_SUBST([LIBSECCOMP])
|
AC_SUBST([LIBSECCOMP_CFLAGS])
|
||||||
|
|
||||||
OLD_LIBS=$LIBS
|
OLD_LIBS=$LIBS
|
||||||
LIBS="$LIB_PTHREAD $LIB_MATH $LIBS"
|
LIBS="$LIB_PTHREAD $LIB_MATH $LIBS"
|
||||||
|
|
|
||||||
|
|
@ -189,10 +189,12 @@ LIB_WSOCK32=@LIB_WSOCK32@
|
||||||
## Extra libraries for etags
|
## Extra libraries for etags
|
||||||
LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM)
|
LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM)
|
||||||
|
|
||||||
LIBSECCOMP=@LIBSECCOMP@
|
HAVE_LIBSECCOMP=@HAVE_LIBSECCOMP@
|
||||||
|
LIBSECCOMP_LIBS=@LIBSECCOMP_LIBS@
|
||||||
|
LIBSECCOMP_CFLAGS=@LIBSECCOMP_CFLAGS@
|
||||||
|
|
||||||
# Currently, we can only generate seccomp filter files for x86-64.
|
# Currently, we can only generate seccomp filter files for x86-64.
|
||||||
ifneq ($(LIBSECCOMP),)
|
ifeq ($(HAVE_LIBSECCOMP),yes)
|
||||||
ifeq ($(shell uname -m),x86_64)
|
ifeq ($(shell uname -m),x86_64)
|
||||||
SECCOMP_FILTER=1
|
SECCOMP_FILTER=1
|
||||||
endif
|
endif
|
||||||
|
|
@ -419,7 +421,8 @@ emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico
|
||||||
|
|
||||||
ifeq ($(SECCOMP_FILTER),1)
|
ifeq ($(SECCOMP_FILTER),1)
|
||||||
seccomp-filter$(EXEEXT): $(srcdir)/seccomp-filter.c $(config_h)
|
seccomp-filter$(EXEEXT): $(srcdir)/seccomp-filter.c $(config_h)
|
||||||
$(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $< $(LIBSECCOMP) -o $@
|
$(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(LIBSECCOMP_CFLAGS) $< \
|
||||||
|
$(LIBSECCOMP_LIBS) -o $@
|
||||||
|
|
||||||
seccomp-filter.bpf seccomp-filter.pfc: seccomp-filter$(EXEEXT)
|
seccomp-filter.bpf seccomp-filter.pfc: seccomp-filter$(EXEEXT)
|
||||||
$(AM_V_GEN)./seccomp-filter$(EXEEXT) \
|
$(AM_V_GEN)./seccomp-filter$(EXEEXT) \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue