From bec787ee9da857eb721c34c402635b5e6bcfe279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Mon, 9 Nov 2015 15:36:40 -0700 Subject: [PATCH] Allow building lxc without virt-login-shell Add a configure option to disable virt-login-shell build even if lxc is enabled. --- configure.ac | 9 +++++++++ m4/virt-login-shell.m4 | 27 +++++++++++++++++++++++++++ src/Makefile.am | 4 ++-- tools/Makefile.am | 12 ++++++------ 4 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 m4/virt-login-shell.m4 diff --git a/configure.ac b/configure.ac index 928fcb4cb2..a566f5b015 100644 --- a/configure.ac +++ b/configure.ac @@ -1085,6 +1085,14 @@ if test "$with_lxc" = "yes" ; then fi AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"]) +dnl +dnl Check for virt-login-shell +dnl + +LIBVIRT_CHECK_LOGIN_SHELL + +AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"]) + dnl dnl Checks for the Parallels driver dnl @@ -2985,6 +2993,7 @@ AC_MSG_NOTICE([ Init script: $with_init_script]) AC_MSG_NOTICE([Char device locks: $with_chrdev_lock_files]) AC_MSG_NOTICE([ Default Editor: $DEFAULT_EDITOR]) AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram]) +AC_MSG_NOTICE([ virt-login-shell: $with_login_shell]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Developer Tools]) AC_MSG_NOTICE([]) diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 new file mode 100644 index 0000000000..0701054e4f --- /dev/null +++ b/m4/virt-login-shell.m4 @@ -0,0 +1,27 @@ +dnl Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl . + +AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [ + AC_ARG_WITH([login_shell], + [AS_HELP_STRING([--with-login-shell], + [build virt-login-shell @<:@default=yes@:>@])]) + m4_divert_text([DEFAULTS], [with_login_shell=yes]) + + if test "$with_login_shell" ; then + AC_DEFINE_UNQUOTED([WITH_LOGIN_SHELL], 1, [whether virt-login-shell is built]) + fi + AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" = "yes"]) +]) diff --git a/src/Makefile.am b/src/Makefile.am index 7219f7c563..af22fc17ba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2283,7 +2283,7 @@ libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD) # have a RPC client for local UNIX socket access only. We use # the ../config-post.h header to disable all external deps that # we don't want -if WITH_LXC +if WITH_SETUID_RPC_CLIENT noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la libvirt_setuid_rpc_client_la_SOURCES = \ @@ -2360,7 +2360,7 @@ libvirt_setuid_rpc_client_la_CFLAGS = \ $(SECDRIVER_CFLAGS) \ $(XDR_CFLAGS) \ $(NULL) -endif WITH_LXC +endif WITH_SETUID_RPC_CLIENT lockdriverdir = $(libdir)/libvirt/lock-driver lockdriver_LTLIBRARIES = diff --git a/tools/Makefile.am b/tools/Makefile.am index 9180564d0b..d39f2ba415 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -71,12 +71,12 @@ sbin_SCRIPTS = virt-sanlock-cleanup DISTCLEANFILES += virt-sanlock-cleanup endif WITH_SANLOCK -if WITH_LXC +if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf bin_PROGRAMS += virt-login-shell -else ! WITH_LXC +else ! WITH_LOGIN_SHELL EXTRA_DIST += virt-login-shell.conf -endif ! WITH_LXC +endif ! WITH_LOGIN_SHELL dist_man1_MANS = \ @@ -85,11 +85,11 @@ dist_man1_MANS = \ virt-xml-validate.1 \ virsh.1 \ virt-admin.1 -if WITH_LXC +if WITH_LOGIN_SHELL dist_man1_MANS += virt-login-shell.1 -else ! WITH_LXC +else ! WITH_LOGIN_SHELL EXTRA_DIST += virt-login-shell.1 -endif ! WITH_LXC +endif ! WITH_LOGIN_SHELL if WITH_SANLOCK dist_man8_MANS = virt-sanlock-cleanup.8 endif WITH_SANLOCK