From patchwork Wed Jun 13 19:20:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Otubo X-Patchwork-Id: 164744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 88CA7B6FE0 for ; Thu, 14 Jun 2012 05:21:09 +1000 (EST) Received: from localhost ([::1]:46711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Set7r-0002FH-BQ for incoming@patchwork.ozlabs.org; Wed, 13 Jun 2012 15:21:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Set7b-0002E6-EC for qemu-devel@nongnu.org; Wed, 13 Jun 2012 15:20:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Set7Y-0007hz-S6 for qemu-devel@nongnu.org; Wed, 13 Jun 2012 15:20:50 -0400 Received: from e24smtp02.br.ibm.com ([32.104.18.86]:40930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Set7X-0007h7-Sw for qemu-devel@nongnu.org; Wed, 13 Jun 2012 15:20:48 -0400 Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jun 2012 16:20:43 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Jun 2012 16:20:40 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.13.184.25]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id CE1041DC004E for ; Wed, 13 Jun 2012 15:20:39 -0400 (EDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay03.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5DJK5Un23527544 for ; Wed, 13 Jun 2012 16:20:05 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5DHKXND005212 for ; Wed, 13 Jun 2012 14:20:33 -0300 Received: from vader.br.ibm.com ([9.12.229.71]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5DHKShX004870; Wed, 13 Jun 2012 14:20:31 -0300 From: Eduardo Otubo To: qemu-devel@nongnu.org Date: Wed, 13 Jun 2012 16:20:21 -0300 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061319-2194-0000-0000-0000022459C9 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.104.18.86 Cc: Eduardo Otubo Subject: [Qemu-devel] [RFC] [PATCHv2 1/2] Adding support for libseccomp in configure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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]. I am also making the configure script to add the specific line to Makefile.obj in order to compile with appropriate support to seccomp. Signed-off-by: Eduardo Otubo --- configure | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/configure b/configure index c2366ee..145956d 100755 --- a/configure +++ b/configure @@ -195,6 +195,7 @@ zlib="yes" guest_agent="yes" libiscsi="" coroutine="" +libseccomp="no" # parse CC options first for opt do @@ -825,6 +826,10 @@ for opt do ;; --disable-guest-agent) guest_agent="no" ;; + --enable-libseccomp) libseccomp="yes" + ;; + --disable-libseccomp) libseccomp="no" + ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -1109,6 +1114,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-libseccomp disable libseccomp support" +echo " --enable-libseccomp enable libseccomp support" echo " --with-coroutine=BACKEND coroutine backend. Supported options:" echo " gthread, ucontext, sigaltstack, windows" echo "" @@ -1354,6 +1361,17 @@ EOF fi ########################################## +# libseccomp check + +if test "$libseccomp" = "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 @@ -3033,6 +3051,7 @@ echo "usb net redir $usb_redir" echo "OpenGL support $opengl" echo "libiscsi support $libiscsi" echo "build guest agent $guest_agent" +echo "seccomp support $libseccomp" echo "coroutine backend $coroutine_backend" if test "$sdl_too_old" = "yes"; then @@ -3334,6 +3353,12 @@ if test "$libiscsi" = "yes" ; then echo "CONFIG_LIBISCSI=y" >> $config_host_mak fi +if test "$libseccomp" = "yes" ; then + echo "CONFIG_LIBSECCOMP=y" >> $config_host_mak + echo "# libseccomp support added by configure script:" >> Makefile.obj + echo "common-obj-y += qemu-seccomp.o" >> Makefile.obj +fi + # XXX: suppress that if [ "$bsd" = "yes" ] ; then echo "CONFIG_BSD=y" >> $config_host_mak