Received: from eggs.gnu.org ([208.118.235.92]:40383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1mKj-0003Vs-IT for qemu-devel@nongnu.org; Wed, 15 Aug 2012 18:45:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1mKi-0001hx-2V for qemu-devel@nongnu.org; Wed, 15 Aug 2012 18:45:01 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:58777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1mKh-0001hm-SH for qemu-devel@nongnu.org; Wed, 15 Aug 2012 18:45:00 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Aug 2012 16:44:59 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 6C2C0C40002 for ; Wed, 15 Aug 2012 16:44:52 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7FMilpp070868 for ; Wed, 15 Aug 2012 16:44:48 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7FMk6xj011183 for ; Wed, 15 Aug 2012 16:46:06 -0600 From: Anthony Liguori Date: Wed, 15 Aug 2012 17:44:39 -0500 Message-Id: <1345070682-8675-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1345070682-8675-1-git-send-email-aliguori@us.ibm.com> References: <1345070682-8675-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 1/4] Adding support for libseccomp in configure and Makefile (v8) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paul Moore , Anthony Liguori , Eduardo Otubo From: 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. Signed-off-by: Eduardo Otubo Signed-off-by: Anthony Liguori --- 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) --- Makefile.objs | 6 ++++++ configure | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 309d066..4412757 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -97,6 +97,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 45b9268..5267d53 100755 --- a/configure +++ b/configure @@ -218,6 +218,7 @@ zlib="yes" guest_agent="yes" libiscsi="" coroutine="" +seccomp="" # parse CC options first for opt do @@ -864,6 +865,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 @@ -1152,6 +1157,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 "" @@ -1414,6 +1421,20 @@ EOF 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 if test "$xen" != "no" ; then @@ -3143,6 +3164,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 @@ -3438,6 +3460,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.5.4