From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T17rp-0001xO-UE for qemu-devel@nongnu.org; Mon, 13 Aug 2012 23:32:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T17rm-0004wj-TB for qemu-devel@nongnu.org; Mon, 13 Aug 2012 23:32:29 -0400 Received: from [201.82.139.216] (port=37976 helo=oc2381481656.ibm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T17rm-0004wN-Jf for qemu-devel@nongnu.org; Mon, 13 Aug 2012 23:32:26 -0400 From: Eduardo Otubo Date: Mon, 13 Aug 2012 15:44:46 -0300 Message-Id: <1344883488-6680-2-git-send-email-otubo@linux.vnet.ibm.com> In-Reply-To: <1344883488-6680-1-git-send-email-otubo@linux.vnet.ibm.com> References: <1344883488-6680-1-git-send-email-otubo@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v6 1/3] Adding support for libseccomp in configure and Makefile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Otubo 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. 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. v3: * Removing the line from Makefile.obj and adding it to Makefile.objs. * Marking libseccomp default option to 'yes' in the configure script. Signed-off-by: Eduardo Otubo --- Makefile.objs | 6 ++++++ configure | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 5ebbcfa..13db9f3 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -96,6 +96,12 @@ common-obj-y += qemu-timer.o qemu-timer-common.o common-obj-$(CONFIG_SLIRP) += slirp/ ###################################################################### +# libseccomp +ifeq ($(CONFIG_SECCOMP),y) +common-obj-y += qemu-seccomp.o +endif + +###################################################################### # libuser user-obj-y = diff --git a/configure b/configure index f0dbc03..b35d314 100755 --- a/configure +++ b/configure @@ -219,6 +219,7 @@ zlib="yes" guest_agent="yes" libiscsi="" coroutine="" +seccomp="yes" # parse CC options first for opt do @@ -848,6 +849,10 @@ for opt do ;; --disable-guest-agent) guest_agent="no" ;; + --enable-seccomp) seccomp="yes" + ;; + --disable-seccomp) seccomp="no" + ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -1135,6 +1140,8 @@ echo " --disable-usb-redir disable 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 " --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 " gthread, ucontext, sigaltstack, windows" echo "" @@ -1397,6 +1404,16 @@ EOF fi ########################################## +# libseccomp check + +if test "$seccomp" = "yes" ; then + if $pkg_config libseccomp --modversion >/dev/null 2>&1; then + LIBS=`$pkg_config --libs libseccomp` + else + feature_not_found "libseccomp" + fi +fi +########################################## # xen probe if test "$xen" != "no" ; then @@ -3126,6 +3143,7 @@ echo "usb net redir $usb_redir" echo "OpenGL support $opengl" echo "libiscsi support $libiscsi" echo "build guest agent $guest_agent" +echo "seccomp support $seccomp" echo "coroutine backend $coroutine_backend" if test "$sdl_too_old" = "yes"; then @@ -3424,6 +3442,10 @@ if test "$libiscsi" = "yes" ; then echo "CONFIG_LIBISCSI=y" >> $config_host_mak fi +if test "$seccomp" = "yes"; then + echo "CONFIG_SECCOMP=y" >> $config_host_mak +fi + # XXX: suppress that if [ "$bsd" = "yes" ] ; then echo "CONFIG_BSD=y" >> $config_host_mak -- 1.7.1