Adding support for libseccomp in configure and Makefile (v8)

Adding basic options to the configure script to use libseccomp or not.
The default is set to 'no'. If the flag --enable-libseccomp is used, the
script will check for its existence using pkg-config.

Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2:
 - As I removed all the code related to seccomp from vl.c, I created
   qemu-seccomp.[ch].
 - Also making the configure script to add the specific line to
   Makefile.obj in order to compile with appropriate support to seccomp.

v2 -> v3:
 - Removing the line from Makefile.obj and adding it to Makefile.objs.
 - Marking libseccomp default option to 'yes' in the configure script.

v3 -> v8:
 - fix configure probe if libseccomp isn't available (aliguori)
This commit is contained in:
Eduardo Otubo 2012-08-14 18:44:05 -03:00 committed by Anthony Liguori
parent bc9b78debf
commit f794573eab
2 changed files with 32 additions and 0 deletions

View File

@ -96,6 +96,12 @@ common-obj-y += qemu-timer.o qemu-timer-common.o
common-obj-$(CONFIG_SLIRP) += slirp/ common-obj-$(CONFIG_SLIRP) += slirp/
######################################################################
# libseccomp
ifeq ($(CONFIG_SECCOMP),y)
common-obj-y += qemu-seccomp.o
endif
###################################################################### ######################################################################
# libuser # libuser

26
configure vendored
View File

@ -218,6 +218,7 @@ zlib="yes"
guest_agent="yes" guest_agent="yes"
libiscsi="" libiscsi=""
coroutine="" coroutine=""
seccomp=""
# parse CC options first # parse CC options first
for opt do for opt do
@ -864,6 +865,10 @@ for opt do
;; ;;
--disable-guest-agent) guest_agent="no" --disable-guest-agent) guest_agent="no"
;; ;;
--enable-seccomp) seccomp="yes"
;;
--disable-seccomp) seccomp="no"
;;
*) echo "ERROR: unknown option $opt"; show_help="yes" *) echo "ERROR: unknown option $opt"; show_help="yes"
;; ;;
esac esac
@ -1152,6 +1157,8 @@ echo " --disable-usb-redir disable usb network redirection support"
echo " --enable-usb-redir enable usb network redirection support" echo " --enable-usb-redir enable usb network redirection support"
echo " --disable-guest-agent disable building of the QEMU Guest Agent" echo " --disable-guest-agent disable building of the QEMU Guest Agent"
echo " --enable-guest-agent enable building of the QEMU Guest Agent" echo " --enable-guest-agent enable building of the QEMU Guest Agent"
echo " --disable-seccomp disable seccomp support"
echo " --enable-seccomp enables seccomp support"
echo " --with-coroutine=BACKEND coroutine backend. Supported options:" echo " --with-coroutine=BACKEND coroutine backend. Supported options:"
echo " gthread, ucontext, sigaltstack, windows" echo " gthread, ucontext, sigaltstack, windows"
echo "" echo ""
@ -1413,6 +1420,20 @@ EOF
fi fi
fi fi
##########################################
# libseccomp check
if test "$seccomp" != "no" ; then
if $pkg_config libseccomp --modversion >/dev/null 2>&1; then
LIBS=`$pkg_config --libs libseccomp`
seccomp="yes"
else
seccomp="no"
if test "$seccomp" = "yes"; then
feature_not_found "libseccomp"
fi
fi
fi
########################################## ##########################################
# xen probe # xen probe
@ -3143,6 +3164,7 @@ echo "usb net redir $usb_redir"
echo "OpenGL support $opengl" echo "OpenGL support $opengl"
echo "libiscsi support $libiscsi" echo "libiscsi support $libiscsi"
echo "build guest agent $guest_agent" echo "build guest agent $guest_agent"
echo "seccomp support $seccomp"
echo "coroutine backend $coroutine_backend" echo "coroutine backend $coroutine_backend"
if test "$sdl_too_old" = "yes"; then if test "$sdl_too_old" = "yes"; then
@ -3438,6 +3460,10 @@ if test "$libiscsi" = "yes" ; then
echo "CONFIG_LIBISCSI=y" >> $config_host_mak echo "CONFIG_LIBISCSI=y" >> $config_host_mak
fi fi
if test "$seccomp" = "yes"; then
echo "CONFIG_SECCOMP=y" >> $config_host_mak
fi
# XXX: suppress that # XXX: suppress that
if [ "$bsd" = "yes" ] ; then if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak echo "CONFIG_BSD=y" >> $config_host_mak