[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 3/3] tools/flask: add FLASK policy to build
This patch enables the compilation of the FLASK policy as part of the tools build if the needed prerequisites are present. Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> --- Note: ./autogen.sh nees to be rerun after applying this patch config/Tools.mk.in | 1 + m4/checkpolicy.m4 | 12 ++++++++++++ tools/configure.ac | 10 ++++++++++ tools/flask/Makefile | 4 ++-- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 m4/checkpolicy.m4 diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 3967e7d..c69c7d2 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -46,6 +46,7 @@ GIT_HTTP := @githttp@ XENSTAT_XENTOP := @monitors@ LIBXENAPI_BINDINGS := @xenapi@ OCAML_TOOLS := @ocamltools@ +FLASK_POLICY := @xsmpolicy@ CONFIG_MINITERM := @miniterm@ CONFIG_LOMOUNT := @lomount@ CONFIG_OVMF := @ovmf@ diff --git a/m4/checkpolicy.m4 b/m4/checkpolicy.m4 new file mode 100644 index 0000000..f727a7d --- /dev/null +++ b/m4/checkpolicy.m4 @@ -0,0 +1,12 @@ +AC_DEFUN([AC_PROG_CHECKPOLICY], +[dnl + # check for a checkpolicy binary with support for -t xen + AC_CHECK_TOOL([CHECKPOLICY],[checkpolicy],[no]) + + if test "$CHECKPOLICY" != "no"; then + CHECKPOLICYHELP=`$CHECKPOLICY -h | grep xen` + if test "$CHECKPOLICYHELP" = ""; then + CHECKPOLICY=no + fi + fi +]) diff --git a/tools/configure.ac b/tools/configure.ac index de5d085..0d38408 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -28,6 +28,7 @@ m4_include([../m4/path_or_fail.m4]) m4_include([../m4/python_version.m4]) m4_include([../m4/python_devel.m4]) m4_include([../m4/ocaml.m4]) +m4_include([../m4/checkpolicy.m4]) m4_include([../m4/set_cflags_ldflags.m4]) m4_include([../m4/uuid.m4]) m4_include([../m4/pkg.m4]) @@ -42,6 +43,7 @@ AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP]) AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools]) AX_ARG_DEFAULT_DISABLE([xenapi], [Enable Xen API Bindings]) AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools]) +AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation]) AX_ARG_DEFAULT_DISABLE([miniterm], [Enable miniterm]) AX_ARG_DEFAULT_DISABLE([lomount], [Enable lomount]) AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF]) @@ -93,6 +95,14 @@ AS_IF([test "x$ocamltools" = "xy"], [ ocamltools="n" ]) ]) +AS_IF([test "x$xsmpolicy" = "xy"], [ + AC_PROG_CHECKPOLICY + AS_IF([test "x$CHECKPOLICY" = "xno"], [ + AS_IF([test "x$enable_xsmpolicy" = "xyes"], [ + AC_MSG_ERROR([XSM policy compilation enabled, but unable to find checkpolicy])]) + xsmpolicy="n" + ]) +]) AX_PATH_PROG_OR_FAIL([BASH], [bash]) AS_IF([echo "$PYTHON" | grep -q "^/"], [ PYTHONPATH=$PYTHON diff --git a/tools/flask/Makefile b/tools/flask/Makefile index add9035..bc77a06 100644 --- a/tools/flask/Makefile +++ b/tools/flask/Makefile @@ -1,8 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -SUBDIRS := -SUBDIRS += utils +SUBDIRS-y := utils +SUBDIRS-$(FLASK_POLICY) += policy .PHONY: all clean install all clean install: %: subdirs-% -- 1.8.1.2 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |