Add a configure option to disable virt-login-shell build even if lxc is
enabled.
---
Diff to V1:
* moved the configure.ac code into m4/virt-login-shell.m4
* allow building virt-login-shell without lxc
* Introduce WITH_SETUID_RPC_CLIENT to have it built if
either lxc or virt-login-shell is built.
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 f481c50..6fef728 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1075,6 +1075,14 @@ 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
@@ -2974,6 +2982,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 0000000..0701054
--- /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 <
http://www.gnu.org/licenses/>.
+
+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 99b4993..2f40910 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2225,7 +2225,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 = \
@@ -2302,7 +2302,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 d5638d9..d005035 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 = \
@@ -84,11 +84,11 @@ dist_man1_MANS = \
virt-pki-validate.1 \
virt-xml-validate.1 \
virsh.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
--
2.1.4